Defines | |
#define | SHIFT(x) (x) |
FPM_DEFAULT without OPT_SSO will actually lose accuracy and performance. | |
#define | SHIFT(x) (x) |
FPM_DEFAULT without OPT_SSO will actually lose accuracy and performance. | |
#define | MUL(x, y) mad_f_mul((x), (y)) |
The idea is to simplify 32x32->64-bit multiplication to 32x32->32 such that extra scaling and rounding are not necessary. This often allows the compiler to use faster 32-bit multiply-accumulate instructions instead of explicit 64-bit multiply, shift, and add instructions.
SSO works like this: a full 32x32->64-bit multiply of two mad_fixed_t values requires the result to be right-shifted 28 bits to be properly scaled to the same fixed-point format. Right shifts can be applied at any time to either operand or to the result, so the optimization involves careful placement of these shifts to minimize the loss of accuracy.
First, a 14-bit shift is applied with rounding at compile-time to the D[] table of coefficients for the subband synthesis window. This only loses 2 bits of accuracy because the lower 12 bits are always zero. A second 12-bit shift occurs after the DCT calculation. This loses 12 bits of accuracy. Finally, a third 2-bit shift occurs just before the sample is saved in the PCM buffer. 14 + 12 + 2 == 28 bits.
#define MUL | ( | x, | |||
y | ) | mad_f_mul((x), (y)) |
#define SHIFT | ( | x | ) | (x) |
#define SHIFT | ( | x | ) | (x) |
FPM_DEFAULT without OPT_SSO will actually lose accuracy and performance.
second SSO shift, with rounding.
Definition at line 540 of file synth.c.
Referenced by dct32(), synth_full(), and synth_half().