summaryrefslogtreecommitdiffstats
path: root/spa/plugins/audioconvert/crossover.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:28:17 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:28:17 +0000
commit7a46c07230b8d8108c0e8e80df4522d0ac116538 (patch)
treed483300dab478b994fe199a5d19d18d74153718a /spa/plugins/audioconvert/crossover.h
parentInitial commit. (diff)
downloadpipewire-0bfb2679f751193be0325ef92c84c3863d22ac84.tar.xz
pipewire-0bfb2679f751193be0325ef92c84c3863d22ac84.zip
Adding upstream version 0.3.65.upstream/0.3.65upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'spa/plugins/audioconvert/crossover.h')
-rw-r--r--spa/plugins/audioconvert/crossover.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/spa/plugins/audioconvert/crossover.h b/spa/plugins/audioconvert/crossover.h
new file mode 100644
index 0000000..b6f458b
--- /dev/null
+++ b/spa/plugins/audioconvert/crossover.h
@@ -0,0 +1,31 @@
+/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef CROSSOVER_H_
+#define CROSSOVER_H_
+
+#include <stdbool.h>
+
+#include "biquad.h"
+/* An LR4 filter is two biquads with the same parameters connected in series:
+ *
+ * x -- [BIQUAD] -- y -- [BIQUAD] -- z
+ *
+ * Both biquad filter has the same parameter b[012] and a[12],
+ * The variable [xyz][12] keep the history values.
+ */
+struct lr4 {
+ struct biquad bq;
+ float x1, x2;
+ float y1, y2;
+ float z1, z2;
+ bool active;
+};
+
+void lr4_set(struct lr4 *lr4, enum biquad_type type, float freq);
+
+void lr4_process(struct lr4 *lr4, float *dst, const float *src, const float vol, int samples);
+
+#endif /* CROSSOVER_H_ */