aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-01-07 05:32:07 -0800
committerChris Robinson <[email protected]>2018-01-07 05:32:07 -0800
commit4cc1c646466737ba411aa23ce4a6116936ada8c2 (patch)
tree796fc698eb910630ac5f398fe38f26aef2cd456c /OpenAL32
parent0e1fd34c89d8f09f68c2c243ceccd0dab4f7c6c0 (diff)
Replace the sinc4 resampler with cubic
Turns out the C version of the cubic resampler is just slightly faster than even the SSE3 version of the FIR4 resampler. This is likely due to not using a 64KB random-access lookup table along with unaligned loads, both offseting the gains from SSE.
Diffstat (limited to 'OpenAL32')
-rw-r--r--OpenAL32/Include/alu.h4
-rw-r--r--OpenAL32/alState.c4
2 files changed, 2 insertions, 6 deletions
diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h
index 625da0dc..c427df0c 100644
--- a/OpenAL32/Include/alu.h
+++ b/OpenAL32/Include/alu.h
@@ -396,10 +396,6 @@ inline ALfloat lerp(ALfloat val1, ALfloat val2, ALfloat mu)
{
return val1 + (val2-val1)*mu;
}
-inline ALfloat resample_fir4(ALfloat val0, ALfloat val1, ALfloat val2, ALfloat val3, const ALfloat *restrict filter)
-{
- return filter[0]*val0 + filter[1]*val1 + filter[2]*val2 + filter[3]*val3;
-}
enum HrtfRequestMode {
diff --git a/OpenAL32/alState.c b/OpenAL32/alState.c
index 623e1d6b..c8c81065 100644
--- a/OpenAL32/alState.c
+++ b/OpenAL32/alState.c
@@ -50,7 +50,7 @@ static const ALchar alErrOutOfMemory[] = "Out of Memory";
/* Resampler strings */
static const ALchar alPointResampler[] = "Nearest";
static const ALchar alLinearResampler[] = "Linear";
-static const ALchar alSinc4Resampler[] = "3rd order Sinc";
+static const ALchar alCubicResampler[] = "Cubic";
static const ALchar alBSinc12Resampler[] = "11th order Sinc";
static const ALchar alBSinc24Resampler[] = "23rd order Sinc";
@@ -761,7 +761,7 @@ AL_API const ALchar* AL_APIENTRY alGetStringiSOFT(ALenum pname, ALsizei index)
{
const char *ResamplerNames[] = {
alPointResampler, alLinearResampler,
- alSinc4Resampler, alBSinc12Resampler,
+ alCubicResampler, alBSinc12Resampler,
alBSinc24Resampler,
};
const ALchar *value = NULL;