now does rescaling on 256base instead of 100; removes a lot of division by a shift right 8

Needs testing!!! Volunteer please come in. 
Benefits of change:
-248 bytes code generated used gcc 4.7.2
-huge performance increase. My measurements:
   simple mix goes down from 2,87msec to 1.93msec
   middle complex mix goes down from 3,37msec to 2,00msec
   complex mix (with phase change) goes down from 6,87msec to 4,18msec
This commit is contained in:
open.20.fsguruh@xoxy.net
2013-02-18 20:26:16 +00:00
parent 71b311cb26
commit 63e2ae60a5
3 changed files with 168 additions and 49 deletions
+12
View File
@@ -1003,6 +1003,16 @@ void generalDefault();
void modelDefault(uint8_t id);
#if defined(CPUARM)
inline int16_t calc100to256(register int8_t x) // @@@2 open.20.fsguruh: return x*2.56
{
return ((int16_t) x * 256) / 100;
}
inline int16_t calc100toRESX_16Bits(register int16_t x) // @@@ open.20.fsguruh
{
return x * 1024 / 100;
}
inline int32_t calc100toRESX(register int8_t x)
{
return x * 1024 / 100;
@@ -1024,6 +1034,8 @@ inline int16_t calcRESXto100(register int32_t x)
}
#else
extern int16_t calc100to256(int8_t x); // @@@2 open.20.fsguruh: return x*2.56
extern int16_t calc100toRESX_16Bits(int16_t x); // @@@ open.20.fsguruh
extern int16_t calc100toRESX(int8_t x);
extern int16_t calc1000toRESX(int16_t x);
extern int16_t calcRESXto1000(int16_t x);