diff options
author | Chris Robinson <[email protected]> | 2018-01-10 19:20:58 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-01-10 19:20:58 -0800 |
commit | 279799ad7020360e59763cbd80af82e202357c51 (patch) | |
tree | bca1a1f12bfe30a8fcb2c7d3b41e33489c6aa76d /Alc | |
parent | ea6b384980cc04eb6c17d22354f9ce4d0280d5a6 (diff) |
Don't return whether the bsinc filter cuts or not
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALu.c | 30 |
1 files changed, 8 insertions, 22 deletions
@@ -208,34 +208,21 @@ void aluInit(void) * modified for use with an interpolated increment for buttery-smooth pitch * changes. */ -ALboolean BsincPrepare(const ALuint increment, BsincState *state, const BSincTable *table) +void BsincPrepare(const ALuint increment, BsincState *state, const BSincTable *table) { - ALboolean uncut = AL_TRUE; ALfloat sf; ALsizei si; if(increment > FRACTIONONE) { sf = (ALfloat)FRACTIONONE / increment; - if(sf < table->scaleBase) - { - /* Signal has been completely cut. The return result can be used - * to skip the filter (and output zeros) as an optimization. - */ - sf = 0.0f; - si = 0; - uncut = AL_FALSE; - } - else - { - sf = (BSINC_SCALE_COUNT - 1) * (sf - table->scaleBase) * table->scaleRange; - si = fastf2i(sf); - /* The interpolation factor is fit to this diagonally-symmetric - * curve to reduce the transition ripple caused by interpolating - * different scales of the sinc function. - */ - sf = 1.0f - cosf(asinf(sf - si)); - } + sf = maxf(0.0f, (BSINC_SCALE_COUNT-1) * (sf-table->scaleBase) * table->scaleRange); + si = fastf2i(sf); + /* The interpolation factor is fit to this diagonally-symmetric curve + * to reduce the transition ripple caused by interpolating different + * scales of the sinc function. + */ + sf = 1.0f - cosf(asinf(sf - si)); } else { @@ -247,7 +234,6 @@ ALboolean BsincPrepare(const ALuint increment, BsincState *state, const BSincTab state->m = table->m[si]; state->l = -((state->m/2) - 1); state->filter = table->Tab + table->filterOffset[si]; - return uncut; } |