Use blended HRIRs for the B-Format decode
[openal-soft.git] / alc / filters / splitter.h
blob5117a244c4a1ca69cd06bb4aeb7753b1df37e543
1 #ifndef FILTER_SPLITTER_H
2 #define FILTER_SPLITTER_H
4 #include <cstddef>
7 /* Band splitter. Splits a signal into two phase-matching frequency bands. */
8 template<typename Real>
9 class BandSplitterR {
10 Real mCoeff{0.0f};
11 Real mLpZ1{0.0f};
12 Real mLpZ2{0.0f};
13 Real mApZ1{0.0f};
15 public:
16 BandSplitterR() = default;
17 BandSplitterR(const BandSplitterR&) = default;
18 BandSplitterR(Real f0norm) { init(f0norm); }
20 void init(Real f0norm);
21 void clear() noexcept { mLpZ1 = mLpZ2 = mApZ1 = 0.0f; }
22 void process(Real *hpout, Real *lpout, const Real *input, const size_t count);
24 void applyHfScale(Real *samples, const Real hfscale, const size_t count);
26 /* The all-pass portion of the band splitter. Applies the same phase shift
27 * without splitting the signal. Note that each use of this method is
28 * indepedent, it does not track history between calls.
30 void applyAllpass(Real *samples, const size_t count) const;
32 using BandSplitter = BandSplitterR<float>;
34 #endif /* FILTER_SPLITTER_H */