diff --git a/CMakeLists.txt b/CMakeLists.txt index 97004962..8c08af6b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -633,6 +633,12 @@ set(ALC_OBJS core/bufferline.h core/devformat.cpp core/devformat.h + core/filters/biquad.h + core/filters/biquad.cpp + core/filters/nfc.cpp + core/filters/nfc.h + core/filters/splitter.cpp + core/filters/splitter.h core/mastering.cpp core/mastering.h @@ -674,12 +680,6 @@ set(ALC_OBJS alc/effects/pshifter.cpp alc/effects/reverb.cpp alc/effects/vmorpher.cpp - alc/filters/biquad.h - alc/filters/biquad.cpp - alc/filters/nfc.cpp - alc/filters/nfc.h - alc/filters/splitter.cpp - alc/filters/splitter.h alc/fmt_traits.cpp alc/fmt_traits.h alc/fpu_ctrl.cpp diff --git a/al/source.cpp b/al/source.cpp index 1af39da2..5dcd1cca 100644 --- a/al/source.cpp +++ b/al/source.cpp @@ -59,10 +59,10 @@ #include "backends/base.h" #include "bformatdec.h" #include "buffer.h" +#include "core/filters/nfc.h" +#include "core/filters/splitter.h" #include "event.h" #include "filter.h" -#include "filters/nfc.h" -#include "filters/splitter.h" #include "inprogext.h" #include "logging.h" #include "math_defs.h" diff --git a/alc/alc.cpp b/alc/alc.cpp index faf6392e..87c0578e 100644 --- a/alc/alc.cpp +++ b/alc/alc.cpp @@ -82,10 +82,10 @@ #include "compat.h" #include "core/devformat.h" #include "core/mastering.h" +#include "core/filters/nfc.h" +#include "core/filters/splitter.h" #include "cpu_caps.h" #include "effects/base.h" -#include "filters/nfc.h" -#include "filters/splitter.h" #include "fpu_ctrl.h" #include "front_stablizer.h" #include "hrtf.h" diff --git a/alc/alcmain.h b/alc/alcmain.h index 7949baf2..42808f26 100644 --- a/alc/alcmain.h +++ b/alc/alcmain.h @@ -25,7 +25,7 @@ #include "atomic.h" #include "core/bufferline.h" #include "core/devformat.h" -#include "filters/splitter.h" +#include "core/filters/splitter.h" #include "hrtf.h" #include "inprogext.h" #include "intrusive_ptr.h" diff --git a/alc/alu.cpp b/alc/alu.cpp index 18a26a38..c13365ec 100644 --- a/alc/alu.cpp +++ b/alc/alu.cpp @@ -61,12 +61,12 @@ #include "bs2b.h" #include "core/bsinc_tables.h" #include "core/devformat.h" +#include "core/filters/biquad.h" +#include "core/filters/nfc.h" +#include "core/filters/splitter.h" #include "core/mastering.h" #include "cpu_caps.h" #include "effects/base.h" -#include "filters/biquad.h" -#include "filters/nfc.h" -#include "filters/splitter.h" #include "fpu_ctrl.h" #include "front_stablizer.h" #include "hrtf.h" diff --git a/alc/bformatdec.cpp b/alc/bformatdec.cpp index b2a2aec9..6f229947 100644 --- a/alc/bformatdec.cpp +++ b/alc/bformatdec.cpp @@ -10,12 +10,10 @@ #include #include -#include "AL/al.h" - #include "almalloc.h" #include "alu.h" #include "ambdec.h" -#include "filters/splitter.h" +#include "core/filters/splitter.h" #include "front_stablizer.h" #include "math_defs.h" #include "opthelpers.h" @@ -33,7 +31,7 @@ constexpr std::array Ambi3DDecoderHFScale3O{{ 5.89792205e-01f, 8.79693856e-01f, 1.00000000e+00f, 1.00000000e+00f }}; -inline auto GetDecoderHFScales(ALuint order) noexcept -> const std::array& +inline auto GetDecoderHFScales(uint order) noexcept -> const std::array& { if(order >= 3) return Ambi3DDecoderHFScale3O; if(order == 2) return Ambi3DDecoderHFScale2O; @@ -52,7 +50,7 @@ inline auto GetAmbiScales(AmbDecScale scaletype) noexcept BFormatDec::BFormatDec(const AmbDecConf *conf, const bool allow_2band, const size_t inchans, - const ALuint srate, const ALuint (&chanmap)[MAX_OUTPUT_CHANNELS], + const uint srate, const uint (&chanmap)[MAX_OUTPUT_CHANNELS], std::unique_ptr stablizer) : mStablizer{std::move(stablizer)}, mDualBand{allow_2band && (conf->FreqBands == 2)} , mChannelDec{inchans} @@ -269,7 +267,7 @@ void BFormatDec::processStablize(const al::span OutBuffer, } -auto BFormatDec::GetHFOrderScales(const ALuint in_order, const ALuint out_order) noexcept +auto BFormatDec::GetHFOrderScales(const uint in_order, const uint out_order) noexcept -> std::array { std::array ret{}; @@ -286,7 +284,7 @@ auto BFormatDec::GetHFOrderScales(const ALuint in_order, const ALuint out_order) } std::unique_ptr BFormatDec::Create(const AmbDecConf *conf, const bool allow_2band, - const size_t inchans, const ALuint srate, const ALuint (&chanmap)[MAX_OUTPUT_CHANNELS], + const size_t inchans, const uint srate, const uint (&chanmap)[MAX_OUTPUT_CHANNELS], std::unique_ptr stablizer) { return std::unique_ptr{new(FamCount(inchans)) diff --git a/alc/bformatdec.h b/alc/bformatdec.h index 280ca2fc..adc69dc3 100644 --- a/alc/bformatdec.h +++ b/alc/bformatdec.h @@ -5,14 +5,12 @@ #include #include -#include "AL/al.h" - -#include "alcmain.h" #include "almalloc.h" #include "alspan.h" #include "ambidefs.h" +#include "core/bufferline.h" #include "core/devformat.h" -#include "filters/splitter.h" +#include "core/filters/splitter.h" struct AmbDecConf; struct FrontStablizer; @@ -44,7 +42,7 @@ class BFormatDec { public: BFormatDec(const AmbDecConf *conf, const bool allow_2band, const size_t inchans, - const ALuint srate, const ALuint (&chanmap)[MAX_OUTPUT_CHANNELS], + const uint srate, const uint (&chanmap)[MAX_OUTPUT_CHANNELS], std::unique_ptr stablizer); BFormatDec(const size_t inchans, const al::span coeffs, const al::span coeffslf, std::unique_ptr stablizer); @@ -61,11 +59,11 @@ public: const size_t SamplesToDo); /* Retrieves per-order HF scaling factors for "upsampling" ambisonic data. */ - static std::array GetHFOrderScales(const ALuint in_order, - const ALuint out_order) noexcept; + static std::array GetHFOrderScales(const uint in_order, + const uint out_order) noexcept; static std::unique_ptr Create(const AmbDecConf *conf, const bool allow_2band, - const size_t inchans, const ALuint srate, const ALuint (&chanmap)[MAX_OUTPUT_CHANNELS], + const size_t inchans, const uint srate, const uint (&chanmap)[MAX_OUTPUT_CHANNELS], std::unique_ptr stablizer); static std::unique_ptr Create(const size_t inchans, const al::span coeffs, const al::span coeffslf, diff --git a/alc/effects/autowah.cpp b/alc/effects/autowah.cpp index 5ac51e32..f2ffab44 100644 --- a/alc/effects/autowah.cpp +++ b/alc/effects/autowah.cpp @@ -29,7 +29,7 @@ #include "alcmain.h" #include "alcontext.h" #include "alu.h" -#include "filters/biquad.h" +#include "core/filters/biquad.h" #include "vecmat.h" namespace { diff --git a/alc/effects/convolution.cpp b/alc/effects/convolution.cpp index e191e7bc..2442f97e 100644 --- a/alc/effects/convolution.cpp +++ b/alc/effects/convolution.cpp @@ -8,7 +8,6 @@ #include "AL/al.h" #include "AL/alc.h" -#include "al/auxeffectslot.h" #include "alcmain.h" #include "alcomplex.h" #include "alcontext.h" @@ -17,8 +16,9 @@ #include "ambidefs.h" #include "bformatdec.h" #include "buffer_storage.h" +#include "core/filters/splitter.h" #include "effects/base.h" -#include "filters/splitter.h" +#include "effectslot.h" #include "fmt_traits.h" #include "logging.h" #include "polyphase_resampler.h" diff --git a/alc/effects/distortion.cpp b/alc/effects/distortion.cpp index 757244c5..65f8977b 100644 --- a/alc/effects/distortion.cpp +++ b/alc/effects/distortion.cpp @@ -24,11 +24,10 @@ #include #include -#include "al/auxeffectslot.h" #include "alcmain.h" #include "alcontext.h" -#include "alu.h" -#include "filters/biquad.h" +#include "core/filters/biquad.h" +#include "effectslot.h" namespace { diff --git a/alc/effects/echo.cpp b/alc/effects/echo.cpp index a50d3c61..c030ac5b 100644 --- a/alc/effects/echo.cpp +++ b/alc/effects/echo.cpp @@ -25,17 +25,19 @@ #include -#include "al/auxeffectslot.h" -#include "al/filter.h" +#include "AL/efx.h" + #include "alcmain.h" #include "alcontext.h" -#include "alu.h" -#include "filters/biquad.h" +#include "core/filters/biquad.h" +#include "effectslot.h" #include "vector.h" namespace { +constexpr float LowpassFreqRef{5000.0f}; + struct EchoState final : public EffectState { al::vector mSampleBuffer; @@ -95,7 +97,7 @@ void EchoState::update(const ALCcontext *context, const EffectSlot *slot, mTap[1].delay = float2uint(props->Echo.LRDelay*frequency + 0.5f) + mTap[0].delay; const float gainhf{maxf(1.0f - props->Echo.Damping, 0.0625f)}; /* Limit -24dB */ - mFilter.setParamsFromSlope(BiquadType::HighShelf, LOWPASSFREQREF/frequency, gainhf, 1.0f); + mFilter.setParamsFromSlope(BiquadType::HighShelf, LowpassFreqRef/frequency, gainhf, 1.0f); mFeedGain = props->Echo.Feedback; diff --git a/alc/effects/equalizer.cpp b/alc/effects/equalizer.cpp index 19d38498..c311a941 100644 --- a/alc/effects/equalizer.cpp +++ b/alc/effects/equalizer.cpp @@ -26,11 +26,10 @@ #include #include -#include "al/auxeffectslot.h" #include "alcmain.h" #include "alcontext.h" -#include "alu.h" -#include "filters/biquad.h" +#include "core/filters/biquad.h" +#include "effectslot.h" #include "vecmat.h" diff --git a/alc/effects/modulator.cpp b/alc/effects/modulator.cpp index 7e4f9fc0..a0af9890 100644 --- a/alc/effects/modulator.cpp +++ b/alc/effects/modulator.cpp @@ -26,11 +26,10 @@ #include #include -#include "al/auxeffectslot.h" #include "alcmain.h" #include "alcontext.h" -#include "alu.h" -#include "filters/biquad.h" +#include "core/filters/biquad.h" +#include "effectslot.h" #include "vecmat.h" diff --git a/alc/effects/reverb.cpp b/alc/effects/reverb.cpp index 6471b210..a4b423c7 100644 --- a/alc/effects/reverb.cpp +++ b/alc/effects/reverb.cpp @@ -29,13 +29,12 @@ #include #include -#include "al/auxeffectslot.h" -#include "al/listener.h" #include "alcmain.h" #include "alcontext.h" -#include "alu.h" +#include "alnumeric.h" #include "bformatdec.h" -#include "filters/biquad.h" +#include "core/filters/biquad.h" +#include "effectslot.h" #include "vector.h" #include "vecmat.h" diff --git a/alc/front_stablizer.h b/alc/front_stablizer.h index 94882835..0fedeb50 100644 --- a/alc/front_stablizer.h +++ b/alc/front_stablizer.h @@ -6,7 +6,7 @@ #include "almalloc.h" #include "core/bufferline.h" -#include "filters/splitter.h" +#include "core/filters/splitter.h" struct FrontStablizer { diff --git a/alc/hrtf.cpp b/alc/hrtf.cpp index 12cea416..01dc342f 100644 --- a/alc/hrtf.cpp +++ b/alc/hrtf.cpp @@ -47,7 +47,7 @@ #include "alnumeric.h" #include "aloptional.h" #include "alspan.h" -#include "filters/splitter.h" +#include "core/filters/splitter.h" #include "logging.h" #include "math_defs.h" #include "opthelpers.h" diff --git a/alc/hrtf.h b/alc/hrtf.h index 3b9a272c..c26947de 100644 --- a/alc/hrtf.h +++ b/alc/hrtf.h @@ -11,7 +11,7 @@ #include "ambidefs.h" #include "atomic.h" #include "core/bufferline.h" -#include "filters/splitter.h" +#include "core/filters/splitter.h" #include "intrusive_ptr.h" #include "vector.h" diff --git a/alc/voice.cpp b/alc/voice.cpp index 54775a72..8b5cd02f 100644 --- a/alc/voice.cpp +++ b/alc/voice.cpp @@ -47,10 +47,10 @@ #include "alstring.h" #include "alu.h" #include "core/devformat.h" +#include "core/filters/biquad.h" +#include "core/filters/nfc.h" +#include "core/filters/splitter.h" #include "cpu_caps.h" -#include "filters/biquad.h" -#include "filters/nfc.h" -#include "filters/splitter.h" #include "fmt_traits.h" #include "hrtf.h" #include "inprogext.h" diff --git a/alc/voice.h b/alc/voice.h index 8a7d12d1..00012de3 100644 --- a/alc/voice.h +++ b/alc/voice.h @@ -8,9 +8,9 @@ #include "alu.h" #include "buffer_storage.h" #include "core/devformat.h" -#include "filters/biquad.h" -#include "filters/nfc.h" -#include "filters/splitter.h" +#include "core/filters/biquad.h" +#include "core/filters/nfc.h" +#include "core/filters/splitter.h" #include "hrtf.h" #include "mixer/defs.h" diff --git a/alc/filters/biquad.cpp b/core/filters/biquad.cpp similarity index 100% rename from alc/filters/biquad.cpp rename to core/filters/biquad.cpp diff --git a/alc/filters/biquad.h b/core/filters/biquad.h similarity index 98% rename from alc/filters/biquad.h rename to core/filters/biquad.h index 3ce70cb3..b2e2cfdb 100644 --- a/alc/filters/biquad.h +++ b/core/filters/biquad.h @@ -1,5 +1,5 @@ -#ifndef FILTERS_BIQUAD_H -#define FILTERS_BIQUAD_H +#ifndef CORE_FILTERS_BIQUAD_H +#define CORE_FILTERS_BIQUAD_H #include #include @@ -141,4 +141,4 @@ struct DualBiquadR { using BiquadFilter = BiquadFilterR; using DualBiquad = DualBiquadR; -#endif /* FILTERS_BIQUAD_H */ +#endif /* CORE_FILTERS_BIQUAD_H */ diff --git a/alc/filters/nfc.cpp b/core/filters/nfc.cpp similarity index 100% rename from alc/filters/nfc.cpp rename to core/filters/nfc.cpp diff --git a/alc/filters/nfc.h b/core/filters/nfc.h similarity index 95% rename from alc/filters/nfc.h rename to core/filters/nfc.h index 2327c966..33f67a5f 100644 --- a/alc/filters/nfc.h +++ b/core/filters/nfc.h @@ -1,5 +1,5 @@ -#ifndef FILTER_NFC_H -#define FILTER_NFC_H +#ifndef CORE_FILTERS_NFC_H +#define CORE_FILTERS_NFC_H #include @@ -60,4 +60,4 @@ public: void process4(const al::span src, float *RESTRICT dst); }; -#endif /* FILTER_NFC_H */ +#endif /* CORE_FILTERS_NFC_H */ diff --git a/alc/filters/splitter.cpp b/core/filters/splitter.cpp similarity index 100% rename from alc/filters/splitter.cpp rename to core/filters/splitter.cpp diff --git a/alc/filters/splitter.h b/core/filters/splitter.h similarity index 90% rename from alc/filters/splitter.h rename to core/filters/splitter.h index 18ab4998..ba548c10 100644 --- a/alc/filters/splitter.h +++ b/core/filters/splitter.h @@ -1,5 +1,5 @@ -#ifndef FILTER_SPLITTER_H -#define FILTER_SPLITTER_H +#ifndef CORE_FILTERS_SPLITTER_H +#define CORE_FILTERS_SPLITTER_H #include @@ -33,4 +33,4 @@ public: }; using BandSplitter = BandSplitterR; -#endif /* FILTER_SPLITTER_H */ +#endif /* CORE_FILTERS_SPLITTER_H */