aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/filters
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-11-22 04:53:29 -0800
committerChris Robinson <[email protected]>2018-11-22 04:53:29 -0800
commit671ed1abf8cc246c6e2b5f9ae3bac132fb9af519 (patch)
tree66402274da934f19f30da30b2acb8a25a6958a53 /Alc/filters
parentcc3e2a838f245770af3d773e8d2c461b9912e392 (diff)
Use a unique_ptr for the FrontStablizer
Diffstat (limited to 'Alc/filters')
-rw-r--r--Alc/filters/splitter.h32
1 files changed, 14 insertions, 18 deletions
diff --git a/Alc/filters/splitter.h b/Alc/filters/splitter.h
index a996917c..13f4cd55 100644
--- a/Alc/filters/splitter.h
+++ b/Alc/filters/splitter.h
@@ -2,18 +2,16 @@
#define FILTER_SPLITTER_H
#include "alMain.h"
+#include "almalloc.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
/* Band splitter. Splits a signal into two phase-matching frequency bands. */
-typedef struct BandSplitter {
- ALfloat coeff;
- ALfloat lp_z1;
- ALfloat lp_z2;
- ALfloat hp_z1;
-} BandSplitter;
+struct BandSplitter {
+ ALfloat coeff{0.0f};
+ ALfloat lp_z1{0.0f};
+ ALfloat lp_z2{0.0f};
+ ALfloat hp_z1{0.0f};
+};
void bandsplit_init(BandSplitter *splitter, ALfloat f0norm);
void bandsplit_clear(BandSplitter *splitter);
@@ -23,25 +21,23 @@ void bandsplit_process(BandSplitter *splitter, ALfloat *RESTRICT hpout, ALfloat
/* The all-pass portion of the band splitter. Applies the same phase shift
* without splitting the signal.
*/
-typedef struct SplitterAllpass {
- ALfloat coeff;
- ALfloat z1;
-} SplitterAllpass;
+struct SplitterAllpass {
+ ALfloat coeff{0.0f};
+ ALfloat z1{0.0f};
+};
void splitterap_init(SplitterAllpass *splitter, ALfloat f0norm);
void splitterap_clear(SplitterAllpass *splitter);
void splitterap_process(SplitterAllpass *splitter, ALfloat *RESTRICT samples, ALsizei count);
-typedef struct FrontStablizer {
+struct FrontStablizer {
SplitterAllpass APFilter[MAX_OUTPUT_CHANNELS];
BandSplitter LFilter, RFilter;
alignas(16) ALfloat LSplit[2][BUFFERSIZE];
alignas(16) ALfloat RSplit[2][BUFFERSIZE];
-} FrontStablizer;
-#ifdef __cplusplus
-} // extern "C"
-#endif
+ DEF_NEWDEL(FrontStablizer)
+};
#endif /* FILTER_SPLITTER_H */