From d45dd9c668b2f4331492600d8ff99dc20c068664 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 19 Feb 2017 14:36:06 -0800 Subject: Remove the sinc8 resampler option Perf shows less than 1 percent CPU difference from the higher quality bsinc resampler, but uses almost twice as much memory (a 128KB lookup table). --- OpenAL32/Include/alu.h | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'OpenAL32') diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index c3c7a20c..c9f8760e 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -229,11 +229,7 @@ inline ALuint64 clampu64(ALuint64 val, ALuint64 min, ALuint64 max) { return minu64(max, maxu64(min, val)); } -union ResamplerCoeffs { - ALfloat FIR4[FRACTIONONE][4]; - ALfloat FIR8[FRACTIONONE][8]; -}; -extern alignas(16) union ResamplerCoeffs ResampleCoeffs; +extern alignas(16) ALfloat ResampleCoeffs_FIR4[FRACTIONONE][4]; extern alignas(16) const ALfloat bsincTab[18840]; @@ -244,15 +240,9 @@ inline ALfloat lerp(ALfloat val1, ALfloat val2, ALfloat mu) } inline ALfloat resample_fir4(ALfloat val0, ALfloat val1, ALfloat val2, ALfloat val3, ALuint frac) { - const ALfloat *k = ResampleCoeffs.FIR4[frac]; + const ALfloat *k = ResampleCoeffs_FIR4[frac]; return k[0]*val0 + k[1]*val1 + k[2]*val2 + k[3]*val3; } -inline ALfloat resample_fir8(ALfloat val0, ALfloat val1, ALfloat val2, ALfloat val3, ALfloat val4, ALfloat val5, ALfloat val6, ALfloat val7, ALuint frac) -{ - const ALfloat *k = ResampleCoeffs.FIR8[frac]; - return k[0]*val0 + k[1]*val1 + k[2]*val2 + k[3]*val3 + - k[4]*val4 + k[5]*val5 + k[6]*val6 + k[7]*val7; -} enum HrtfRequestMode { -- cgit v1.2.3