aboutsummaryrefslogtreecommitdiffstats
path: root/alc/mixer/mixer_sse2.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-08-31 15:49:34 -0700
committerChris Robinson <[email protected]>2019-08-31 15:49:34 -0700
commit3973334a64f0aa428c9cbd06c89cfb60951810c8 (patch)
tree654595d4e772011a218e3405c81a8fe15d070f1b /alc/mixer/mixer_sse2.cpp
parenta546343148ad87786b1a199e9ca91ffc50da4e81 (diff)
Store the voice fraction offset as unsigned
Diffstat (limited to 'alc/mixer/mixer_sse2.cpp')
-rw-r--r--alc/mixer/mixer_sse2.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/alc/mixer/mixer_sse2.cpp b/alc/mixer/mixer_sse2.cpp
index e3443f4e..b126cd25 100644
--- a/alc/mixer/mixer_sse2.cpp
+++ b/alc/mixer/mixer_sse2.cpp
@@ -29,13 +29,12 @@
template<>
const ALfloat *Resample_<LerpTag,SSE2Tag>(const InterpState*, const ALfloat *RESTRICT src,
- ALsizei frac, ALint increment, const al::span<float> dst)
+ ALuint frac, ALint increment, const al::span<float> dst)
{
const __m128i increment4{_mm_set1_epi32(increment*4)};
const __m128 fracOne4{_mm_set1_ps(1.0f/FRACTIONONE)};
const __m128i fracMask4{_mm_set1_epi32(FRACTIONMASK)};
- ASSUME(frac >= 0);
ASSUME(increment > 0);
alignas(16) ALsizei pos_[4], frac_[4];
@@ -70,15 +69,15 @@ const ALfloat *Resample_<LerpTag,SSE2Tag>(const InterpState*, const ALfloat *RES
/* NOTE: These four elements represent the position *after* the last four
* samples, so the lowest element is the next position to resample.
*/
- ALsizei pos{_mm_cvtsi128_si32(pos4)};
+ src += static_cast<ALuint>(_mm_cvtsi128_si32(pos4));
frac = _mm_cvtsi128_si32(frac4);
while(dst_iter != dst.end())
{
- *(dst_iter++) = lerp(src[pos], src[pos+1], frac * (1.0f/FRACTIONONE));
+ *(dst_iter++) = lerp(src[0], src[1], frac * (1.0f/FRACTIONONE));
frac += increment;
- pos += frac>>FRACTIONBITS;
+ src += frac>>FRACTIONBITS;
frac &= FRACTIONMASK;
}
return dst.begin();