Move the filters to core
This commit is contained in:
parent
84d47f7d4c
commit
69d55d7e03
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -10,12 +10,10 @@
|
||||
#include <iterator>
|
||||
#include <numeric>
|
||||
|
||||
#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<float,MAX_AMBI_ORDER+1> Ambi3DDecoderHFScale3O{{
|
||||
5.89792205e-01f, 8.79693856e-01f, 1.00000000e+00f, 1.00000000e+00f
|
||||
}};
|
||||
|
||||
inline auto GetDecoderHFScales(ALuint order) noexcept -> const std::array<float,MAX_AMBI_ORDER+1>&
|
||||
inline auto GetDecoderHFScales(uint order) noexcept -> const std::array<float,MAX_AMBI_ORDER+1>&
|
||||
{
|
||||
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<FrontStablizer> stablizer)
|
||||
: mStablizer{std::move(stablizer)}, mDualBand{allow_2band && (conf->FreqBands == 2)}
|
||||
, mChannelDec{inchans}
|
||||
@ -269,7 +267,7 @@ void BFormatDec::processStablize(const al::span<FloatBufferLine> 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<float,MAX_AMBI_ORDER+1>
|
||||
{
|
||||
std::array<float,MAX_AMBI_ORDER+1> ret{};
|
||||
@ -286,7 +284,7 @@ auto BFormatDec::GetHFOrderScales(const ALuint in_order, const ALuint out_order)
|
||||
}
|
||||
|
||||
std::unique_ptr<BFormatDec> 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<FrontStablizer> stablizer)
|
||||
{
|
||||
return std::unique_ptr<BFormatDec>{new(FamCount(inchans))
|
||||
|
@ -5,14 +5,12 @@
|
||||
#include <cstddef>
|
||||
#include <memory>
|
||||
|
||||
#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<FrontStablizer> stablizer);
|
||||
BFormatDec(const size_t inchans, const al::span<const ChannelDec> coeffs,
|
||||
const al::span<const ChannelDec> coeffslf, std::unique_ptr<FrontStablizer> stablizer);
|
||||
@ -61,11 +59,11 @@ public:
|
||||
const size_t SamplesToDo);
|
||||
|
||||
/* Retrieves per-order HF scaling factors for "upsampling" ambisonic data. */
|
||||
static std::array<float,MAX_AMBI_ORDER+1> GetHFOrderScales(const ALuint in_order,
|
||||
const ALuint out_order) noexcept;
|
||||
static std::array<float,MAX_AMBI_ORDER+1> GetHFOrderScales(const uint in_order,
|
||||
const uint out_order) noexcept;
|
||||
|
||||
static 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<FrontStablizer> stablizer);
|
||||
static std::unique_ptr<BFormatDec> Create(const size_t inchans,
|
||||
const al::span<const ChannelDec> coeffs, const al::span<const ChannelDec> coeffslf,
|
||||
|
@ -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 {
|
||||
|
@ -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"
|
||||
|
@ -24,11 +24,10 @@
|
||||
#include <cmath>
|
||||
#include <cstdlib>
|
||||
|
||||
#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 {
|
||||
|
@ -25,17 +25,19 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#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<float,16> 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;
|
||||
|
||||
|
@ -26,11 +26,10 @@
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
|
||||
#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"
|
||||
|
||||
|
||||
|
@ -26,11 +26,10 @@
|
||||
#include <cmath>
|
||||
#include <algorithm>
|
||||
|
||||
#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"
|
||||
|
||||
|
||||
|
@ -29,13 +29,12 @@
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
|
||||
#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"
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
#include "almalloc.h"
|
||||
#include "core/bufferline.h"
|
||||
#include "filters/splitter.h"
|
||||
#include "core/filters/splitter.h"
|
||||
|
||||
|
||||
struct FrontStablizer {
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifndef FILTERS_BIQUAD_H
|
||||
#define FILTERS_BIQUAD_H
|
||||
#ifndef CORE_FILTERS_BIQUAD_H
|
||||
#define CORE_FILTERS_BIQUAD_H
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
@ -141,4 +141,4 @@ struct DualBiquadR {
|
||||
using BiquadFilter = BiquadFilterR<float>;
|
||||
using DualBiquad = DualBiquadR<float>;
|
||||
|
||||
#endif /* FILTERS_BIQUAD_H */
|
||||
#endif /* CORE_FILTERS_BIQUAD_H */
|
@ -1,5 +1,5 @@
|
||||
#ifndef FILTER_NFC_H
|
||||
#define FILTER_NFC_H
|
||||
#ifndef CORE_FILTERS_NFC_H
|
||||
#define CORE_FILTERS_NFC_H
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
@ -60,4 +60,4 @@ public:
|
||||
void process4(const al::span<const float> src, float *RESTRICT dst);
|
||||
};
|
||||
|
||||
#endif /* FILTER_NFC_H */
|
||||
#endif /* CORE_FILTERS_NFC_H */
|
@ -1,5 +1,5 @@
|
||||
#ifndef FILTER_SPLITTER_H
|
||||
#define FILTER_SPLITTER_H
|
||||
#ifndef CORE_FILTERS_SPLITTER_H
|
||||
#define CORE_FILTERS_SPLITTER_H
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
@ -33,4 +33,4 @@ public:
|
||||
};
|
||||
using BandSplitter = BandSplitterR<float>;
|
||||
|
||||
#endif /* FILTER_SPLITTER_H */
|
||||
#endif /* CORE_FILTERS_SPLITTER_H */
|
Loading…
x
Reference in New Issue
Block a user