1
0
Fork 0
forked from len0rd/rockbox

Do not duplicate const table, make getEvent function static inline, gives about a ~1.5% speedup, put tick function in iram, ~3.5% speedup

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14873 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Nils Wallménius 2007-09-27 20:17:38 +00:00
parent 93787dd42c
commit 6888db3240
6 changed files with 23 additions and 20 deletions

View file

@ -22,6 +22,21 @@
extern struct plugin_api * rb;
/* This came from one of the Gravis documents */
const uint32_t gustable[]=
{
8175, 8661, 9177, 9722, 10300, 10913, 11562, 12249, 12978, 13750, 14567, 15433,
16351, 17323, 18354, 19445, 20601, 21826, 23124, 24499, 25956, 27500, 29135, 30867,
32703, 34647, 36708, 38890, 41203, 43653, 46249, 48999, 51913, 54999, 58270, 61735,
65406, 69295, 73416, 77781, 82406, 87306, 92498, 97998, 103826, 109999, 116540, 123470,
130812, 138591, 146832, 155563, 164813, 174614, 184997, 195997, 207652, 219999, 233081, 246941,
261625, 277182, 293664, 311126, 329627, 349228, 369994, 391995, 415304, 440000, 466163, 493883,
523251, 554365, 587329, 622254, 659255, 698456, 739989, 783991, 830609, 880000, 932328, 987767,
1046503, 1108731, 1174660, 1244509, 1318511, 1396914, 1479979, 1567983, 1661220, 1760002, 1864657, 1975536,
2093007, 2217464, 2349321, 2489019, 2637024, 2793830, 2959960, 3135968, 3322443, 3520006, 3729316, 3951073,
4186073, 4434930, 4698645, 4978041, 5274051, 5587663, 5919922, 6271939, 6644889, 7040015, 7458636, 7902150
};
unsigned int readWord(int file)
{
return (readChar(file)<<0) | (readChar(file)<<8); // | (readChar(file)<<8) | (readChar(file)<<0);

View file

@ -17,20 +17,7 @@
*
****************************************************************************/
/* This came from one of the Gravis documents */
static const unsigned int gustable[]=
{
8175, 8661, 9177, 9722, 10300, 10913, 11562, 12249, 12978, 13750, 14567, 15433,
16351, 17323, 18354, 19445, 20601, 21826, 23124, 24499, 25956, 27500, 29135, 30867,
32703, 34647, 36708, 38890, 41203, 43653, 46249, 48999, 51913, 54999, 58270, 61735,
65406, 69295, 73416, 77781, 82406, 87306, 92498, 97998, 103826, 109999, 116540, 123470,
130812, 138591, 146832, 155563, 164813, 174614, 184997, 195997, 207652, 219999, 233081, 246941,
261625, 277182, 293664, 311126, 329627, 349228, 369994, 391995, 415304, 440000, 466163, 493883,
523251, 554365, 587329, 622254, 659255, 698456, 739989, 783991, 830609, 880000, 932328, 987767,
1046503, 1108731, 1174660, 1244509, 1318511, 1396914, 1479979, 1567983, 1661220, 1760002, 1864657, 1975536,
2093007, 2217464, 2349321, 2489019, 2637024, 2793830, 2959960, 3135968, 3322443, 3520006, 3729316, 3951073,
4186073, 4434930, 4698645, 4978041, 5274051, 5587663, 5919922, 6271939, 6644889, 7040015, 7458636, 7902150
};
extern const uint32_t gustable[];
struct GWaveform
{

View file

@ -141,7 +141,6 @@ int printf(const char *fmt, ...);
int midimain(void * filename);
unsigned char readChar(int file);
inline void setPoint(struct SynthObject * so, int pt);
struct Event * getEvent(struct Track * tr, int evNum);
int readTwoBytes(int file);
int readFourBytes(int file);
int readVarData(int file);

View file

@ -19,6 +19,7 @@
#include "plugin.h"
#include "midiutil.h"
#include "guspat.h"
#include "synth.h"
void setVolScale(int a);
@ -320,6 +321,7 @@ static void sendEvent(struct Event * ev)
}
}
int tick(void) ICODE_ATTR;
int tick(void)
{
if(mf==NULL)

View file

@ -23,11 +23,6 @@
extern struct plugin_api * rb;
struct Event * getEvent(struct Track * tr, int evNum)
{
return tr->dataBlock + (evNum*sizeof(struct Event));
}
void readTextBlock(int file, char * buf)
{
char c = 0;

View file

@ -48,3 +48,8 @@ static inline void synthSample(int * mixL, int * mixR)
return; /* No more ghetto lowpass filter.. linear intrpolation works well. */
}
static inline struct Event * getEvent(struct Track * tr, int evNum)
{
return tr->dataBlock + (evNum*sizeof(struct Event));
}