aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mixer_neon.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2015-09-30 17:25:28 -0700
committerChris Robinson <[email protected]>2015-09-30 17:25:28 -0700
commit904cdfda32d11f5c3376a20363051b98bc1d3033 (patch)
treeb9e8fad9fd46d56af2336ce43ad4539d3185bf41 /Alc/mixer_neon.c
parentb68fbe3628cc1d27507a20e118e52fdd67b8fac4 (diff)
Avoid double-checks for the stepping mixer loops
Diffstat (limited to 'Alc/mixer_neon.c')
-rw-r--r--Alc/mixer_neon.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/Alc/mixer_neon.c b/Alc/mixer_neon.c
index 6078a40d..0c50140e 100644
--- a/Alc/mixer_neon.c
+++ b/Alc/mixer_neon.c
@@ -107,7 +107,8 @@ void Mix_Neon(const ALfloat *data, ALuint OutChans, ALfloat (*restrict OutBuffer
step = Gains[c].Step;
if(step != 0.0f && Counter > 0)
{
- for(;pos < BufferSize && pos < Counter;pos++)
+ ALuint minsize = minu(BufferSize, Counter);
+ for(;pos < minsize;pos++)
{
OutBuffer[c][OutPos+pos] += data[pos]*gain;
gain += step;
@@ -115,8 +116,10 @@ void Mix_Neon(const ALfloat *data, ALuint OutChans, ALfloat (*restrict OutBuffer
if(pos == Counter)
gain = Gains[c].Target;
Gains[c].Current = gain;
+
/* Mix until pos is aligned with 4 or the mix is done. */
- for(;pos < BufferSize && (pos&3) != 0;pos++)
+ minsize = minu(BufferSize, (pos+3)&3);
+ for(;pos < minsize;pos++)
OutBuffer[c][OutPos+pos] += data[pos]*gain;
}