diff options
author | Chris Robinson <[email protected]> | 2017-08-18 19:20:30 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-08-18 19:20:30 -0700 |
commit | 5f50d085adbf20dfa07800715762c498a5c87459 (patch) | |
tree | 582ea1701e311d2b6d35e0990a407b9bbe6c0614 | |
parent | f75020da5a56fed275b5dafc7ee3750f85ee957f (diff) |
Pass the filter entry to apply to resample_fir4
-rw-r--r-- | Alc/ALu.c | 5 | ||||
-rw-r--r-- | Alc/mixer_c.c | 2 | ||||
-rw-r--r-- | Alc/mixer_neon.c | 2 | ||||
-rw-r--r-- | Alc/mixer_sse3.c | 2 | ||||
-rw-r--r-- | Alc/mixer_sse41.c | 2 | ||||
-rw-r--r-- | OpenAL32/Include/alu.h | 5 |
6 files changed, 8 insertions, 10 deletions
@@ -69,9 +69,8 @@ extern inline ALuint64 maxu64(ALuint64 a, ALuint64 b); extern inline ALuint64 clampu64(ALuint64 val, ALuint64 min, ALuint64 max); extern inline ALfloat lerp(ALfloat val1, ALfloat val2, ALfloat mu); -extern inline ALfloat resample_fir4(const ALfloat (*restrict filter)[4], - ALfloat val0, ALfloat val1, ALfloat val2, ALfloat val3, - ALsizei frac); +extern inline ALfloat resample_fir4(ALfloat val0, ALfloat val1, ALfloat val2, ALfloat val3, + const ALfloat *restrict filter); extern inline void aluVectorSet(aluVector *restrict vector, ALfloat x, ALfloat y, ALfloat z, ALfloat w); diff --git a/Alc/mixer_c.c b/Alc/mixer_c.c index 738789f9..1635476a 100644 --- a/Alc/mixer_c.c +++ b/Alc/mixer_c.c @@ -59,7 +59,7 @@ const ALfloat *Resample_fir4_C(const InterpState *state, const ALfloat *restrict src -= 1; for(i = 0;i < numsamples;i++) { - dst[i] = resample_fir4(filter, src[0], src[1], src[2], src[3], frac); + dst[i] = resample_fir4(src[0], src[1], src[2], src[3], filter[frac]); frac += increment; src += frac>>FRACTIONBITS; diff --git a/Alc/mixer_neon.c b/Alc/mixer_neon.c index fbd0f158..3345290c 100644 --- a/Alc/mixer_neon.c +++ b/Alc/mixer_neon.c @@ -127,7 +127,7 @@ const ALfloat *Resample_fir4_Neon(const InterpState *state, ALint pos = pos_[0]; frac = frac_[0]; do { - dst[i] = resample_fir4(filter, src[pos], src[pos+1], src[pos+2], src[pos+3], frac); + dst[i] = resample_fir4(src[pos], src[pos+1], src[pos+2], src[pos+3], filter[frac]); frac += increment; pos += frac>>FRACTIONBITS; diff --git a/Alc/mixer_sse3.c b/Alc/mixer_sse3.c index 7e98105c..d60fed5f 100644 --- a/Alc/mixer_sse3.c +++ b/Alc/mixer_sse3.c @@ -88,7 +88,7 @@ const ALfloat *Resample_fir4_SSE3(const InterpState *state, for(;i < numsamples;i++) { - dst[i] = resample_fir4(filter, src[pos], src[pos+1], src[pos+2], src[pos+3], frac); + dst[i] = resample_fir4(src[pos], src[pos+1], src[pos+2], src[pos+3], filter[frac]); frac += increment; pos += frac>>FRACTIONBITS; diff --git a/Alc/mixer_sse41.c b/Alc/mixer_sse41.c index 20a9d9c7..354d16b7 100644 --- a/Alc/mixer_sse41.c +++ b/Alc/mixer_sse41.c @@ -145,7 +145,7 @@ const ALfloat *Resample_fir4_SSE41(const InterpState *state, for(;i < numsamples;i++) { - dst[i] = resample_fir4(filter, src[pos], src[pos+1], src[pos+2], src[pos+3], frac); + dst[i] = resample_fir4(src[pos], src[pos+1], src[pos+2], src[pos+3], filter[frac]); frac += increment; pos += frac>>FRACTIONBITS; diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index b1c62553..d902a8c4 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -392,10 +392,9 @@ inline ALfloat lerp(ALfloat val1, ALfloat val2, ALfloat mu) { return val1 + (val2-val1)*mu; } -inline ALfloat resample_fir4(const ALfloat (*restrict filter)[4], ALfloat val0, ALfloat val1, ALfloat val2, ALfloat val3, ALsizei frac) +inline ALfloat resample_fir4(ALfloat val0, ALfloat val1, ALfloat val2, ALfloat val3, const ALfloat *restrict filter) { - return filter[frac][0]*val0 + filter[frac][1]*val1 + - filter[frac][2]*val2 + filter[frac][3]*val3; + return filter[0]*val0 + filter[1]*val1 + filter[2]*val2 + filter[3]*val3; } |