aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/bformatdec.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-08-21 03:05:42 -0700
committerChris Robinson <[email protected]>2016-08-21 03:05:42 -0700
commit846cdd472da81fefefca8ffa113d32824bc297c2 (patch)
tree1dc3e1caff16aecc5afd59da4d5e12d1028f24e1 /Alc/bformatdec.c
parentd16954c34ebb4bfbd4e7ef27090b01d6f4ff9261 (diff)
Band-split the HRIRs when building the ambisonic decoder filters
This allows each HRIR to contribute a frequency-dependent response, essentially acting like a dual-band decoder playing over the cube speaker array.
Diffstat (limited to 'Alc/bformatdec.c')
-rw-r--r--Alc/bformatdec.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/Alc/bformatdec.c b/Alc/bformatdec.c
index 3c175b33..356423ce 100644
--- a/Alc/bformatdec.c
+++ b/Alc/bformatdec.c
@@ -10,14 +10,7 @@
#include "almalloc.h"
-typedef struct BandSplitter {
- ALfloat coeff;
- ALfloat lp_z1;
- ALfloat lp_z2;
- ALfloat hp_z1;
-} BandSplitter;
-
-static void bandsplit_init(BandSplitter *splitter, ALfloat freq_mult)
+void bandsplit_init(BandSplitter *splitter, ALfloat freq_mult)
{
ALfloat w = freq_mult * F_TAU;
ALfloat cw = cosf(w);
@@ -31,8 +24,15 @@ static void bandsplit_init(BandSplitter *splitter, ALfloat freq_mult)
splitter->hp_z1 = 0.0f;
}
-static void bandsplit_process(BandSplitter *splitter, ALfloat *restrict hpout, ALfloat *restrict lpout,
- const ALfloat *input, ALuint count)
+void bandsplit_clear(BandSplitter *splitter)
+{
+ splitter->lp_z1 = 0.0f;
+ splitter->lp_z2 = 0.0f;
+ splitter->hp_z1 = 0.0f;
+}
+
+void bandsplit_process(BandSplitter *splitter, ALfloat *restrict hpout, ALfloat *restrict lpout,
+ const ALfloat *input, ALuint count)
{
ALfloat coeff, d, x;
ALfloat z1, z2;