aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/Include
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2015-09-27 23:52:16 -0700
committerChris Robinson <[email protected]>2015-09-27 23:57:25 -0700
commitab6622a8d6912fa6ff8da9caa3fcaf96047ca14a (patch)
treea872017f199f85f55b55d21dcb939f96aad70077 /OpenAL32/Include
parent3e60b1898943c26d817aef8d31466c1fee5aa83b (diff)
Replace the cubic resampler with a 4-point sinc/lanczos filter
Diffstat (limited to 'OpenAL32/Include')
-rw-r--r--OpenAL32/Include/alMain.h2
-rw-r--r--OpenAL32/Include/alu.h6
2 files changed, 4 insertions, 4 deletions
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;
}