aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mixer_c.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-05-31 10:18:34 -0700
committerChris Robinson <[email protected]>2016-05-31 10:18:34 -0700
commit5e64882be9ad3e3a1552e41befef5a6216f4ecfe (patch)
tree47059e787d77c86a0e2575e0d5a1d6b13798b8b4 /Alc/mixer_c.c
parent72d2febccbc670843669494fe5bc052839f54294 (diff)
Use SSE for applying the HQ B-Format decoder matrices
Diffstat (limited to 'Alc/mixer_c.c')
-rw-r--r--Alc/mixer_c.c21
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;
+ }
+}