aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mixer_sse41.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-08-16 18:09:53 -0700
committerChris Robinson <[email protected]>2017-08-16 18:09:53 -0700
commit5008024e73e7451c25a4c8729bfb636699615e8e (patch)
treee74f3f6fed16f70db6982d6819d2d347a708c7f2 /Alc/mixer_sse41.c
parentf9c09cc845b786705b43b39300d8706db7ab0054 (diff)
Store the sinc4 table in the filter state
Also rename the resampler functions to remove the unnecessary '32' token.
Diffstat (limited to 'Alc/mixer_sse41.c')
-rw-r--r--Alc/mixer_sse41.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/Alc/mixer_sse41.c b/Alc/mixer_sse41.c
index 613a89ff..20a9d9c7 100644
--- a/Alc/mixer_sse41.c
+++ b/Alc/mixer_sse41.c
@@ -28,7 +28,7 @@
#include "mixer_defs.h"
-const ALfloat *Resample_lerp32_SSE41(const InterpState* UNUSED(state),
+const ALfloat *Resample_lerp_SSE41(const InterpState* UNUSED(state),
const ALfloat *restrict src, ALsizei frac, ALint increment,
ALfloat *restrict dst, ALsizei numsamples)
{
@@ -85,10 +85,11 @@ const ALfloat *Resample_lerp32_SSE41(const InterpState* UNUSED(state),
return dst;
}
-const ALfloat *Resample_fir4_32_SSE41(const InterpState* UNUSED(state),
+const ALfloat *Resample_fir4_SSE41(const InterpState *state,
const ALfloat *restrict src, ALsizei frac, ALint increment,
ALfloat *restrict dst, ALsizei numsamples)
{
+ const ALfloat (*restrict filter)[4] = ASSUME_ALIGNED(state->sinc4.filter, 16);
const __m128i increment4 = _mm_set1_epi32(increment*4);
const __m128i fracMask4 = _mm_set1_epi32(FRACTIONMASK);
union { alignas(16) ALint i[4]; float f[4]; } pos_;
@@ -109,10 +110,10 @@ const ALfloat *Resample_fir4_32_SSE41(const InterpState* UNUSED(state),
const __m128 val1 = _mm_loadu_ps(&src[pos_.i[1]]);
const __m128 val2 = _mm_loadu_ps(&src[pos_.i[2]]);
const __m128 val3 = _mm_loadu_ps(&src[pos_.i[3]]);
- __m128 k0 = _mm_load_ps(sinc4Tab[frac_.i[0]]);
- __m128 k1 = _mm_load_ps(sinc4Tab[frac_.i[1]]);
- __m128 k2 = _mm_load_ps(sinc4Tab[frac_.i[2]]);
- __m128 k3 = _mm_load_ps(sinc4Tab[frac_.i[3]]);
+ __m128 k0 = _mm_load_ps(filter[frac_.i[0]]);
+ __m128 k1 = _mm_load_ps(filter[frac_.i[1]]);
+ __m128 k2 = _mm_load_ps(filter[frac_.i[2]]);
+ __m128 k3 = _mm_load_ps(filter[frac_.i[3]]);
__m128 out;
k0 = _mm_mul_ps(k0, val0);
@@ -144,7 +145,7 @@ const ALfloat *Resample_fir4_32_SSE41(const InterpState* UNUSED(state),
for(;i < numsamples;i++)
{
- dst[i] = resample_fir4(src[pos], src[pos+1], src[pos+2], src[pos+3], frac);
+ dst[i] = resample_fir4(filter, src[pos], src[pos+1], src[pos+2], src[pos+3], frac);
frac += increment;
pos += frac>>FRACTIONBITS;