diff options
author | Chris Robinson <[email protected]> | 2014-05-03 17:24:46 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-05-03 17:24:46 -0700 |
commit | 34e96aef601e8e417bbc61708d68e5f6bbd2842e (patch) | |
tree | fb99e140bb905e452c435d64742c645c98544d7e /Alc/mixer_neon.c | |
parent | 2660ecfd4a0c0028f4332a8c1c6857a163e6cbfa (diff) |
Make sure all gain steps are applied with the SSE and Neon mixers
Diffstat (limited to 'Alc/mixer_neon.c')
-rw-r--r-- | Alc/mixer_neon.c | 41 |
1 files changed, 9 insertions, 32 deletions
diff --git a/Alc/mixer_neon.c b/Alc/mixer_neon.c index 5a598f5c..1b695d81 100644 --- a/Alc/mixer_neon.c +++ b/Alc/mixer_neon.c @@ -93,25 +93,14 @@ void MixDirect_Neon(DirectParams *params, const ALfloat *restrict data, ALuint s if(Step != 1.0f && Counter > 0) { DrySend = params->Mix.Gains.Current[srcchan][c]; - for(;BufferSize-pos > 3 && Counter-pos > 3;pos+=4) + for(;pos < BufferSize && pos < Counter;pos++) { - OutBuffer[c][OutPos+pos ] += data[pos ]*DrySend; + OutBuffer[c][OutPos+pos] += data[pos]*DrySend; DrySend *= Step; - OutBuffer[c][OutPos+pos+1] += data[pos+1]*DrySend; - DrySend *= Step; - OutBuffer[c][OutPos+pos+2] += data[pos+2]*DrySend; - DrySend *= Step; - OutBuffer[c][OutPos+pos+4] += data[pos+3]*DrySend; - DrySend *= Step; - } - if(!(BufferSize-pos > 3)) - { - for(;pos < BufferSize && pos < Counter;pos++) - { - OutBuffer[c][OutPos+pos] += data[pos]*DrySend; - DrySend *= Step; - } } + /* Mix until pos is aligned with 4 or the mix is done. */ + for(;pos < BufferSize && (pos&3) != 0;pos++) + OutBuffer[c][OutPos+pos] += data[pos]*DrySend; params->Mix.Gains.Current[srcchan][c] = DrySend; } @@ -146,25 +135,13 @@ void MixSend_Neon(SendParams *params, const ALfloat *restrict data, if(Step != 1.0f && Counter > 0) { WetGain = params->Gain.Current; - for(;BufferSize-pos > 3 && Counter-pos > 3;pos+=4) + for(;pos < BufferSize && pos < Counter;pos++) { - OutBuffer[0][OutPos+pos ] += data[pos ]*WetGain; + OutBuffer[0][OutPos+pos] += data[pos]*WetGain; WetGain *= Step; - OutBuffer[0][OutPos+pos+1] += data[pos+1]*WetGain; - WetGain *= Step; - OutBuffer[0][OutPos+pos+2] += data[pos+2]*WetGain; - WetGain *= Step; - OutBuffer[0][OutPos+pos+4] += data[pos+3]*WetGain; - WetGain *= Step; - } - if(!(BufferSize-pos > 3)) - { - for(;pos < BufferSize && pos < Counter;pos++) - { - OutBuffer[0][OutPos+pos] += data[pos]*WetGain; - WetGain *= Step; - } } + for(;pos < BufferSize && (pos&3) != 0;pos++) + OutBuffer[0][OutPos+pos] += data[pos]*WetGain; params->Gain.Current = WetGain; } |