diff options
-rw-r--r-- | Alc/filters/splitter.h | 8 | ||||
-rw-r--r-- | Alc/hrtf.cpp | 6 | ||||
-rw-r--r-- | OpenAL32/alSource.cpp | 3 |
3 files changed, 11 insertions, 6 deletions
diff --git a/Alc/filters/splitter.h b/Alc/filters/splitter.h index 669d9d03..cd5fe864 100644 --- a/Alc/filters/splitter.h +++ b/Alc/filters/splitter.h @@ -14,6 +14,10 @@ class BandSplitterR { Real ap_z1{0.0f}; public: + BandSplitterR() = default; + BandSplitterR(const BandSplitterR&) = default; + BandSplitterR(Real f0norm) { init(f0norm); } + 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); @@ -30,6 +34,10 @@ class SplitterAllpassR { Real z1{0.0f}; public: + SplitterAllpassR() = default; + SplitterAllpassR(const SplitterAllpassR&) = default; + SplitterAllpassR(Real f0norm) { init(f0norm); } + void init(Real f0norm); void clear() noexcept { z1 = 0.0f; } void process(Real *samples, int count); diff --git a/Alc/hrtf.cpp b/Alc/hrtf.cpp index 9fa79e22..ede8f8c5 100644 --- a/Alc/hrtf.cpp +++ b/Alc/hrtf.cpp @@ -339,10 +339,8 @@ void BuildBFormatHrtf(const HrtfEntry *Hrtf, DirectHrtfState *state, const ALsiz */ static constexpr ALsizei base_delay{DualBand ? 12 : 0}; const ALdouble xover_norm{400.0 / Hrtf->sampleRate}; - BandSplitterR<double> splitter; - SplitterAllpassR<double> allpass; - splitter.init(xover_norm); - allpass.init(xover_norm); + BandSplitterR<double> splitter{xover_norm}; + SplitterAllpassR<double> allpass{xover_norm}; auto tmpres = al::vector<HrirArray<ALdouble>>(NumChannels); auto tmpfilt = al::vector<std::array<ALdouble,HRIR_LENGTH*4>>(3); diff --git a/OpenAL32/alSource.cpp b/OpenAL32/alSource.cpp index 513adb88..48f9a157 100644 --- a/OpenAL32/alSource.cpp +++ b/OpenAL32/alSource.cpp @@ -2936,8 +2936,7 @@ START_API_FUNC OrderFromChan = Order3DFromChan; } - BandSplitter splitter; - splitter.init(400.0f / static_cast<ALfloat>(device->Frequency)); + BandSplitter splitter{400.0f / static_cast<ALfloat>(device->Frequency)}; const auto scales = BFormatDec::GetHFOrderScales(1, device->mAmbiOrder); auto init_ambi = [scales,&OrderFromChan,&splitter](ALvoice::ResampleData &resdata) -> void |