From ab6622a8d6912fa6ff8da9caa3fcaf96047ca14a Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 27 Sep 2015 23:52:16 -0700 Subject: Replace the cubic resampler with a 4-point sinc/lanczos filter --- OpenAL32/Include/alMain.h | 2 +- OpenAL32/Include/alu.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenAL32/Include') diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 9d76fcd2..7d508721 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -528,7 +528,7 @@ enum DistanceModel { enum Resampler { PointResampler, LinearResampler, - CubicResampler, + FIR4Resampler, ResamplerMax, }; diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index f5fc9fa4..16b3e1ab 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -202,16 +202,16 @@ inline ALuint64 clampu64(ALuint64 val, ALuint64 min, ALuint64 max) { return minu64(max, maxu64(min, val)); } -extern alignas(16) ALfloat CubicLUT[FRACTIONONE][4]; +extern alignas(16) ALfloat ResampleCoeffs[FRACTIONONE][4]; inline ALfloat lerp(ALfloat val1, ALfloat val2, ALfloat mu) { return val1 + (val2-val1)*mu; } -inline ALfloat cubic(ALfloat val0, ALfloat val1, ALfloat val2, ALfloat val3, ALuint frac) +inline ALfloat resample_fir4(ALfloat val0, ALfloat val1, ALfloat val2, ALfloat val3, ALuint frac) { - const ALfloat *k = CubicLUT[frac]; + const ALfloat *k = ResampleCoeffs[frac]; return k[0]*val0 + k[1]*val1 + k[2]*val2 + k[3]*val3; } -- cgit v1.2.3