diff options
author | Chris Robinson <[email protected]> | 2017-04-08 13:43:19 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-04-08 13:43:19 -0700 |
commit | 319d0971986309d7882a9be42a5aef7dc612945d (patch) | |
tree | 4c05460eaa7949e7438969dd60b5d3d8d769a0da /OpenAL32/Include | |
parent | 5ef7d8fe6248bccc8edf895afece8e1b44b0f4ea (diff) |
Pre-compute the sinc4 resampler coefficient table
Diffstat (limited to 'OpenAL32/Include')
-rw-r--r-- | OpenAL32/Include/alu.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index 48520b41..7a29915f 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -287,9 +287,8 @@ inline ALuint64 clampu64(ALuint64 val, ALuint64 min, ALuint64 max) { return minu64(max, maxu64(min, val)); } -extern alignas(16) ALfloat ResampleCoeffs_FIR4[FRACTIONONE][4]; - extern alignas(16) const ALfloat bsincTab[18840]; +extern alignas(16) const ALfloat sinc4Tab[FRACTIONONE][4]; inline ALfloat lerp(ALfloat val1, ALfloat val2, ALfloat mu) @@ -298,8 +297,8 @@ 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]; - return k[0]*val0 + k[1]*val1 + k[2]*val2 + k[3]*val3; + return sinc4Tab[frac][0]*val0 + sinc4Tab[frac][1]*val1 + + sinc4Tab[frac][2]*val2 + sinc4Tab[frac][3]*val3; } |