diff options
author | Chris Robinson <[email protected]> | 2017-08-16 02:45:25 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-08-16 02:45:25 -0700 |
commit | f9c09cc845b786705b43b39300d8706db7ab0054 (patch) | |
tree | 7cbc0b883b916c971390cf48fe2a76199267a1c9 /Alc/ALu.c | |
parent | 520dd5c77972cad13d1a97e228903b3c5bdc384f (diff) |
Simplify bsinc filter storage in the filter state
Rather than storing individual pointers to filter, scale delta, phase delta,
and scale phase delta entries, per phase index, the new table layout makes it
trivial to access the per-phase filter and delta entries given the base offset
and coefficient count.
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r-- | Alc/ALu.c | 15 |
1 files changed, 3 insertions, 12 deletions
@@ -226,9 +226,9 @@ void aluInit(void) */ ALboolean BsincPrepare(const ALuint increment, BsincState *state) { - ALfloat sf; - ALsizei si, pi; ALboolean uncut = AL_TRUE; + ALfloat sf; + ALsizei si; if(increment > FRACTIONONE) { @@ -262,16 +262,7 @@ ALboolean BsincPrepare(const ALuint increment, BsincState *state) state->sf = sf; state->m = bsinc.m[si]; state->l = -((state->m/2) - 1); - /* The CPU cost of this table re-mapping could be traded for the memory - * cost of a complete table map (1024 elements large). - */ - for(pi = 0;pi < BSINC_PHASE_COUNT;pi++) - { - state->coeffs[pi].filter = &bsinc.Tab[bsinc.filterOffset[si] + bsinc.m[si]*(pi*4 + 0)]; - state->coeffs[pi].scDelta = &bsinc.Tab[bsinc.filterOffset[si] + bsinc.m[si]*(pi*4 + 1)]; - state->coeffs[pi].phDelta = &bsinc.Tab[bsinc.filterOffset[si] + bsinc.m[si]*(pi*4 + 2)]; - state->coeffs[pi].spDelta = &bsinc.Tab[bsinc.filterOffset[si] + bsinc.m[si]*(pi*4 + 3)]; - } + state->filter = bsinc.Tab + bsinc.filterOffset[si]; return uncut; } |