aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mixer/mixer_sse.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-09-22 08:26:52 -0700
committerChris Robinson <[email protected]>2018-09-22 08:26:52 -0700
commit77a53594bad3ae39bbbeb22b19815edec24c4fa8 (patch)
treed5a072902cedd1a2f2262b8afdc0d80a6ccf6aa9 /Alc/mixer/mixer_sse.c
parent36a6b9d42a79f40108441c2b6f9ad88d45e7a98e (diff)
Improve the gain stepping difference check
Given the more stable stepping now in use, check that the total difference is enough for perceptible transition, instead of the step itself.
Diffstat (limited to 'Alc/mixer/mixer_sse.c')
-rw-r--r--Alc/mixer/mixer_sse.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Alc/mixer/mixer_sse.c b/Alc/mixer/mixer_sse.c
index 78cf26f1..725a5ebc 100644
--- a/Alc/mixer/mixer_sse.c
+++ b/Alc/mixer/mixer_sse.c
@@ -149,11 +149,12 @@ void Mix_SSE(const ALfloat *data, ALsizei OutChans, ALfloat (*restrict OutBuffer
{
ALsizei pos = 0;
ALfloat gain = CurrentGains[c];
- const ALfloat step = (TargetGains[c] - gain) * delta;
+ const ALfloat diff = TargetGains[c] - gain;
- if(fabsf(step) > FLT_EPSILON)
+ if(fabsf(diff) > FLT_EPSILON)
{
ALsizei minsize = mini(BufferSize, Counter);
+ const ALfloat step = diff * delta;
ALfloat step_count = 0.0f;
/* Mix with applying gain steps in aligned multiples of 4. */
if(LIKELY(minsize > 3))
@@ -227,7 +228,7 @@ void MixRow_SSE(ALfloat *OutBuffer, const ALfloat *Gains, const ALfloat (*restri
for(c = 0;c < InChans;c++)
{
ALsizei pos = 0;
- ALfloat gain = Gains[c];
+ const ALfloat gain = Gains[c];
if(!(fabsf(gain) > GAIN_SILENCE_THRESHOLD))
continue;