diff options
author | Chris Robinson <[email protected]> | 2016-06-01 23:39:13 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2016-06-01 23:39:13 -0700 |
commit | b7da69510c85b776ba119d69c4c74aa38d412594 (patch) | |
tree | 3eeda7d1786a007165e84b85e0ad8e236cad62db /Alc/mixer_neon.c | |
parent | a16d0b192e9833ae0abd6e1e7ef2305c34705497 (diff) |
Implement a Neon-enhanced MixRow
Diffstat (limited to 'Alc/mixer_neon.c')
-rw-r--r-- | Alc/mixer_neon.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Alc/mixer_neon.c b/Alc/mixer_neon.c index 96936ef5..073f62c8 100644 --- a/Alc/mixer_neon.c +++ b/Alc/mixer_neon.c @@ -118,3 +118,28 @@ void Mix_Neon(const ALfloat *data, ALuint OutChans, ALfloat (*restrict OutBuffer OutBuffer[c][OutPos+pos] += data[pos]*gain; } } + +void MixRow_Neon(ALfloat *OutBuffer, const ALfloat *Mtx, ALfloat (*restrict data)[BUFFERSIZE], ALuint InChans, ALuint BufferSize) +{ + float32x4_t gain4; + ALuint c; + + for(c = 0;c < InChans;c++) + { + ALuint pos = 0; + ALfloat gain = Mtx[c]; + if(!(fabsf(gain) > GAIN_SILENCE_THRESHOLD)) + continue; + + gain4 = vdupq_n_f32(gain); + for(;BufferSize-pos > 3;pos += 4) + { + const float32x4_t val4 = vld1q_f32(&data[c][pos]); + float32x4_t dry4 = vld1q_f32(&OutBuffer[pos]); + dry4 = vmlaq_f32(dry4, val4, gain4); + vst1q_f32(&OutBuffer[pos], dry4); + } + for(;pos < BufferSize;pos++) + OutBuffer[pos] += data[c][pos]*gain; + } +} |