diff options
Diffstat (limited to 'alc/front_stablizer.h')
-rw-r--r-- | alc/front_stablizer.h | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/alc/front_stablizer.h b/alc/front_stablizer.h index 179a1953..91309bf7 100644 --- a/alc/front_stablizer.h +++ b/alc/front_stablizer.h @@ -1,25 +1,33 @@ #ifndef ALC_FRONT_STABLIZER_H #define ALC_FRONT_STABLIZER_H +#include <array> +#include <memory> + #include "alcmain.h" #include "almalloc.h" -#include "devformat.h" #include "filters/splitter.h" struct FrontStablizer { static constexpr size_t DelayLength{256u}; + FrontStablizer(size_t numchans) : DelayBuf{numchans} { } + BandSplitter MidFilter; - alignas(16) float MidLF[BUFFERSIZE]; - alignas(16) float MidHF[BUFFERSIZE]; - alignas(16) float Side[BUFFERSIZE]; + alignas(16) float MidLF[BUFFERSIZE]{}; + alignas(16) float MidHF[BUFFERSIZE]{}; + alignas(16) float Side[BUFFERSIZE]{}; + + alignas(16) float TempBuf[BUFFERSIZE + DelayLength]{}; - alignas(16) float TempBuf[BUFFERSIZE + DelayLength]; + using DelayLine = std::array<float,DelayLength>; + al::FlexArray<DelayLine,16> DelayBuf; - alignas(16) float DelayBuf[MAX_OUTPUT_CHANNELS][DelayLength]; + static std::unique_ptr<FrontStablizer> Create(size_t numchans) + { return std::unique_ptr<FrontStablizer>{new(FamCount{numchans}) FrontStablizer{numchans}}; } - DEF_NEWDEL(FrontStablizer) + DEF_FAM_NEWDEL(FrontStablizer, DelayBuf) }; #endif /* ALC_FRONT_STABLIZER_H */ |