aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mixer_sse.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-11-25 02:08:48 -0800
committerChris Robinson <[email protected]>2014-11-25 02:08:48 -0800
commitefb5c5eecd3b2fd1744f8ce965653fed3a76cf01 (patch)
tree46fb3f1e0f0ae94f6241a954c47a1d03d3c107e0 /Alc/mixer_sse.c
parent42ef85d3f6803cc413d5867bb278bee2a8996e06 (diff)
Use linear gain stepping
Diffstat (limited to 'Alc/mixer_sse.c')
-rw-r--r--Alc/mixer_sse.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/Alc/mixer_sse.c b/Alc/mixer_sse.c
index 75f50f88..4dfc748d 100644
--- a/Alc/mixer_sse.c
+++ b/Alc/mixer_sse.c
@@ -167,23 +167,23 @@ void Mix_SSE(const ALfloat *data, ALuint OutChans, ALfloat (*restrict OutBuffer)
ALuint pos = 0;
gain = Gains[c].Current;
step = Gains[c].Step;
- if(step != 1.0f && Counter > 0)
+ if(step != 0.0f && Counter > 0)
{
/* Mix with applying gain steps in aligned multiples of 4. */
if(BufferSize-pos > 3 && Counter-pos > 3)
{
gain4 = _mm_setr_ps(
gain,
- gain * step,
- gain * step * step,
- gain * step * step * step
+ gain + step,
+ gain + step + step,
+ gain + step + step + step
);
- step4 = _mm_set1_ps(step * step * step * step);
+ step4 = _mm_set1_ps(step + step + step + step);
do {
const __m128 val4 = _mm_load_ps(&data[pos]);
__m128 dry4 = _mm_load_ps(&OutBuffer[c][OutPos+pos]);
dry4 = _mm_add_ps(dry4, _mm_mul_ps(val4, gain4));
- gain4 = _mm_mul_ps(gain4, step4);
+ gain4 = _mm_add_ps(gain4, step4);
_mm_store_ps(&OutBuffer[c][OutPos+pos], dry4);
pos += 4;
} while(BufferSize-pos > 3 && Counter-pos > 3);
@@ -193,7 +193,7 @@ void Mix_SSE(const ALfloat *data, ALuint OutChans, ALfloat (*restrict OutBuffer)
for(;pos < BufferSize && pos < Counter;pos++)
{
OutBuffer[c][OutPos+pos] += data[pos]*gain;
- gain *= step;
+ gain += step;
}
if(pos == Counter)
gain = Gains[c].Target;