Use a unique_ptr for the FrontStablizer
[openal-soft.git] / Alc / filters / splitter.h
blob13f4cd5571a73f4568e6dfd22f209f0939f4b679
1 #ifndef FILTER_SPLITTER_H
2 #define FILTER_SPLITTER_H
4 #include "alMain.h"
5 #include "almalloc.h"
8 /* Band splitter. Splits a signal into two phase-matching frequency bands. */
9 struct BandSplitter {
10 ALfloat coeff{0.0f};
11 ALfloat lp_z1{0.0f};
12 ALfloat lp_z2{0.0f};
13 ALfloat hp_z1{0.0f};
16 void bandsplit_init(BandSplitter *splitter, ALfloat f0norm);
17 void bandsplit_clear(BandSplitter *splitter);
18 void bandsplit_process(BandSplitter *splitter, ALfloat *RESTRICT hpout, ALfloat *RESTRICT lpout,
19 const ALfloat *input, ALsizei count);
21 /* The all-pass portion of the band splitter. Applies the same phase shift
22 * without splitting the signal.
24 struct SplitterAllpass {
25 ALfloat coeff{0.0f};
26 ALfloat z1{0.0f};
29 void splitterap_init(SplitterAllpass *splitter, ALfloat f0norm);
30 void splitterap_clear(SplitterAllpass *splitter);
31 void splitterap_process(SplitterAllpass *splitter, ALfloat *RESTRICT samples, ALsizei count);
34 struct FrontStablizer {
35 SplitterAllpass APFilter[MAX_OUTPUT_CHANNELS];
36 BandSplitter LFilter, RFilter;
37 alignas(16) ALfloat LSplit[2][BUFFERSIZE];
38 alignas(16) ALfloat RSplit[2][BUFFERSIZE];
40 DEF_NEWDEL(FrontStablizer)
43 #endif /* FILTER_SPLITTER_H */