diff options
Diffstat (limited to 'Alc/filters/splitter.h')
-rw-r--r-- | Alc/filters/splitter.h | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/Alc/filters/splitter.h b/Alc/filters/splitter.h index cd5fe864..70fddd9e 100644 --- a/Alc/filters/splitter.h +++ b/Alc/filters/splitter.h @@ -21,28 +21,16 @@ public: void init(Real f0norm); void clear() noexcept { lp_z1 = lp_z2 = ap_z1 = 0.0f; } void process(Real *hpout, Real *lpout, const Real *input, const int count); - void applyHfScale(Real *samples, const Real hfscale, const int count); -}; -using BandSplitter = BandSplitterR<float>; - -/* The all-pass portion of the band splitter. Applies the same phase shift - * without splitting the signal. - */ -template<typename Real> -class SplitterAllpassR { - Real coeff{0.0f}; - Real z1{0.0f}; -public: - SplitterAllpassR() = default; - SplitterAllpassR(const SplitterAllpassR&) = default; - SplitterAllpassR(Real f0norm) { init(f0norm); } + void applyHfScale(Real *samples, const Real hfscale, const int count); - void init(Real f0norm); - void clear() noexcept { z1 = 0.0f; } - void process(Real *samples, int count); + /* The all-pass portion of the band splitter. Applies the same phase shift + * without splitting the signal. Note that each use of this method is + * indepedent, it does not track history between calls. + */ + void applyAllpass(Real *samples, const int count) const; }; -using SplitterAllpass = SplitterAllpassR<float>; +using BandSplitter = BandSplitterR<float>; struct FrontStablizer { @@ -50,7 +38,6 @@ struct FrontStablizer { alignas(16) float DelayBuf[MAX_OUTPUT_CHANNELS][DelayLength]; - SplitterAllpass APFilter; BandSplitter LFilter, RFilter; alignas(16) float LSplit[2][BUFFERSIZE]; alignas(16) float RSplit[2][BUFFERSIZE]; |