Change loop structure for sample synthesizing. Gives a nice speedup on both coldfire and arm targets.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15036 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Nils Wallménius 2007-10-08 19:28:41 +00:00
parent d712e252fe
commit f619f81676
3 changed files with 64 additions and 76 deletions

View file

@ -148,32 +148,31 @@ bool lastswap=1;
static inline void synthbuf(void)
{
int32_t *outptr;
register int i;
int currentSample=0;
int synthtemp[2];
int32_t *outptr;
int i;
#ifndef SYNC
if(lastswap==swap) return;
lastswap=swap;
if(lastswap==swap) return;
lastswap=swap;
outptr=(swap ? gmbuf : gmbuf+BUF_SIZE);
outptr=(swap ? gmbuf : gmbuf+BUF_SIZE);
#else
outptr=gmbuf;
outptr=gmbuf;
#endif
for(i=0; i<BUF_SIZE; i++)
{
synthSample(&synthtemp[0], &synthtemp[1]);
currentSample++;
*outptr=((synthtemp[0]&0xFFFF) << 16) | (synthtemp[1]&0xFFFF);
outptr++;
if(currentSample==numberOfSamples)
{
if( tick() == 0 ) quit=1;
currentSample=0;
}
}
for(i=0; i<BUF_SIZE/numberOfSamples; i++)
{
synthSamples((int32_t*)outptr, numberOfSamples);
outptr += numberOfSamples;
if( tick() == 0 )
quit=1;
}
if(BUF_SIZE%numberOfSamples)
{
synthSamples((int32_t*)outptr, BUF_SIZE%numberOfSamples);
outptr += BUF_SIZE%numberOfSamples;
}
}
void get_more(unsigned char** start, size_t* size)