Here is a faster Power code to use in the dB to Linear module.
There is a problem with this code that I dont really understand. It only works in mono.
What happens is that, if the inputs are stream and you feed it with a packed stereo signal the output will only be the left channel. The right channel is gone some how.
Maybe this is a feature ? ... it is a very fast code. 211 cycles compared to the one you used that was about 800 or more cycles.
What I did to get around that problem was that I unpacked the signal and used 2 codes, one on each channel and then packed them again. This works and still saves at least 400 cycles.
Heres that code. Only in asm Im afraid.
- Code: Select all
float fBas = 0.0;
float fExp = 0.0;
float fAns = 0.0;
float fHlf = 0.5;
//--- Get the base/exponent values...
//--- base^exponent ...
//--- Move the answer into 'out'...