diff options
author | Chris Robinson <[email protected]> | 2016-05-31 10:18:34 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2016-05-31 10:18:34 -0700 |
commit | 5e64882be9ad3e3a1552e41befef5a6216f4ecfe (patch) | |
tree | 47059e787d77c86a0e2575e0d5a1d6b13798b8b4 /Alc/mixer_c.c | |
parent | 72d2febccbc670843669494fe5bc052839f54294 (diff) |
Use SSE for applying the HQ B-Format decoder matrices
Diffstat (limited to 'Alc/mixer_c.c')
-rw-r--r-- | Alc/mixer_c.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Alc/mixer_c.c b/Alc/mixer_c.c index e9d26140..7952ec93 100644 --- a/Alc/mixer_c.c +++ b/Alc/mixer_c.c @@ -167,3 +167,24 @@ void Mix_C(const ALfloat *data, ALuint OutChans, ALfloat (*restrict OutBuffer)[B OutBuffer[c][OutPos+pos] += data[pos]*gain; } } + +/* Basically the inverse of the above. Rather than one input going to multiple + * outputs (each with its own gain), it's multiple inputs (each with its own + * gain) going to one output. This applies one row (vs one column) of a matrix + * transform. And as the matrices are more or less static once set up, no + * stepping is necessary. + */ +void MixRow_C(ALfloat *OutBuffer, const ALfloat *Mtx, ALfloat (*restrict data)[BUFFERSIZE], ALuint InChans, ALuint BufferSize) +{ + ALuint c, i; + + for(c = 0;c < InChans;c++) + { + ALfloat gain = Mtx[c]; + if(!(fabsf(gain) > GAIN_SILENCE_THRESHOLD)) + continue; + + for(i = 0;i < BufferSize;i++) + OutBuffer[i] += data[c][i] * gain; + } +} |