diff options
author | Chris Robinson <[email protected]> | 2017-08-16 18:09:53 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-08-16 18:09:53 -0700 |
commit | 5008024e73e7451c25a4c8729bfb636699615e8e (patch) | |
tree | e74f3f6fed16f70db6982d6819d2d347a708c7f2 /Alc/ALu.c | |
parent | f9c09cc845b786705b43b39300d8706db7ab0054 (diff) |
Store the sinc4 table in the filter state
Also rename the resampler functions to remove the unnecessary '32' token.
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r-- | Alc/ALu.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -69,7 +69,9 @@ extern inline ALuint64 maxu64(ALuint64 a, ALuint64 b); extern inline ALuint64 clampu64(ALuint64 val, ALuint64 min, ALuint64 max); extern inline ALfloat lerp(ALfloat val1, ALfloat val2, ALfloat mu); -extern inline ALfloat resample_fir4(ALfloat val0, ALfloat val1, ALfloat val2, ALfloat val3, ALsizei frac); +extern inline ALfloat resample_fir4(const ALfloat (*restrict filter)[4], + ALfloat val0, ALfloat val1, ALfloat val2, ALfloat val3, + ALsizei frac); extern inline void aluVectorSet(aluVector *restrict vector, ALfloat x, ALfloat y, ALfloat z, ALfloat w); @@ -1037,7 +1039,10 @@ static void CalcNonAttnSourceParams(ALvoice *voice, const struct ALvoiceProps *p voice->Step = MAX_PITCH<<FRACTIONBITS; else voice->Step = maxi(fastf2i(Pitch*FRACTIONONE + 0.5f), 1); - BsincPrepare(voice->Step, &voice->ResampleState.bsinc); + if(props->Resampler == BSincResampler) + BsincPrepare(voice->Step, &voice->ResampleState.bsinc); + else + voice->ResampleState.sinc4.filter = sinc4Tab; voice->Resampler = SelectResampler(props->Resampler); /* Calculate gains */ @@ -1380,7 +1385,10 @@ static void CalcAttnSourceParams(ALvoice *voice, const struct ALvoiceProps *prop voice->Step = MAX_PITCH<<FRACTIONBITS; else voice->Step = maxi(fastf2i(Pitch*FRACTIONONE + 0.5f), 1); - BsincPrepare(voice->Step, &voice->ResampleState.bsinc); + if(props->Resampler == BSincResampler) + BsincPrepare(voice->Step, &voice->ResampleState.bsinc); + else + voice->ResampleState.sinc4.filter = sinc4Tab; voice->Resampler = SelectResampler(props->Resampler); if(Distance > FLT_EPSILON) |