aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r--Alc/ALu.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 17227f8a..7c261f73 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -225,7 +225,7 @@ void aluInit(void)
* modified for use with an interpolated increment for buttery-smooth pitch
* changes.
*/
-ALboolean BsincPrepare(const ALuint increment, BsincState *state)
+ALboolean BsincPrepare(const ALuint increment, BsincState *state, const BSincTable *table)
{
ALboolean uncut = AL_TRUE;
ALfloat sf;
@@ -234,7 +234,7 @@ ALboolean BsincPrepare(const ALuint increment, BsincState *state)
if(increment > FRACTIONONE)
{
sf = (ALfloat)FRACTIONONE / increment;
- if(sf < bsinc12.scaleBase)
+ 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.
@@ -245,7 +245,7 @@ ALboolean BsincPrepare(const ALuint increment, BsincState *state)
}
else
{
- sf = (BSINC_SCALE_COUNT - 1) * (sf - bsinc12.scaleBase) * bsinc12.scaleRange;
+ 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
@@ -261,9 +261,9 @@ ALboolean BsincPrepare(const ALuint increment, BsincState *state)
}
state->sf = sf;
- state->m = bsinc12.m[si];
+ state->m = table->m[si];
state->l = -((state->m/2) - 1);
- state->filter = bsinc12.Tab + bsinc12.filterOffset[si];
+ state->filter = table->Tab + table->filterOffset[si];
return uncut;
}
@@ -1038,9 +1038,12 @@ static void CalcNonAttnSourceParams(ALvoice *voice, const struct ALvoiceProps *p
voice->Step = MAX_PITCH<<FRACTIONBITS;
else
voice->Step = maxi(fastf2i(Pitch*FRACTIONONE + 0.5f), 1);
- if(props->Resampler == BSinc12Resampler)
- BsincPrepare(voice->Step, &voice->ResampleState.bsinc);
+ if(props->Resampler == BSinc24Resampler)
+ BsincPrepare(voice->Step, &voice->ResampleState.bsinc, &bsinc24);
+ else if(props->Resampler == BSinc12Resampler)
+ BsincPrepare(voice->Step, &voice->ResampleState.bsinc, &bsinc12);
else
+
voice->ResampleState.sinc4.filter = sinc4Tab;
voice->Resampler = SelectResampler(props->Resampler);
@@ -1384,8 +1387,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);
- if(props->Resampler == BSinc12Resampler)
- BsincPrepare(voice->Step, &voice->ResampleState.bsinc);
+ if(props->Resampler == BSinc24Resampler)
+ BsincPrepare(voice->Step, &voice->ResampleState.bsinc, &bsinc24);
+ else if(props->Resampler == BSinc12Resampler)
+ BsincPrepare(voice->Step, &voice->ResampleState.bsinc, &bsinc12);
else
voice->ResampleState.sinc4.filter = sinc4Tab;
voice->Resampler = SelectResampler(props->Resampler);