2020-03-30 01:16:15 -07:00
|
|
|
#ifndef ALC_FRONT_STABLIZER_H
|
|
|
|
#define ALC_FRONT_STABLIZER_H
|
|
|
|
|
2020-05-05 01:31:21 -07:00
|
|
|
#include <array>
|
|
|
|
#include <memory>
|
|
|
|
|
2020-03-30 01:16:15 -07:00
|
|
|
#include "almalloc.h"
|
2020-05-21 13:48:50 -07:00
|
|
|
#include "bufferline.h"
|
2020-03-30 01:16:15 -07:00
|
|
|
#include "filters/splitter.h"
|
|
|
|
|
|
|
|
|
|
|
|
struct FrontStablizer {
|
|
|
|
static constexpr size_t DelayLength{256u};
|
|
|
|
|
2020-05-05 01:31:21 -07:00
|
|
|
FrontStablizer(size_t numchans) : DelayBuf{numchans} { }
|
|
|
|
|
2020-05-21 13:48:50 -07:00
|
|
|
alignas(16) std::array<float,BUFFERSIZE + DelayLength> Side{};
|
2020-06-15 02:05:10 -07:00
|
|
|
alignas(16) std::array<float,BUFFERSIZE + DelayLength> MidDirect{};
|
2020-05-21 13:48:50 -07:00
|
|
|
alignas(16) std::array<float,DelayLength> MidDelay{};
|
|
|
|
|
|
|
|
alignas(16) std::array<float,BUFFERSIZE + DelayLength> TempBuf{};
|
2020-05-05 01:31:21 -07:00
|
|
|
|
2020-05-21 13:48:50 -07:00
|
|
|
BandSplitter MidFilter;
|
|
|
|
alignas(16) FloatBufferLine MidLF{};
|
|
|
|
alignas(16) FloatBufferLine MidHF{};
|
2020-03-30 01:16:15 -07:00
|
|
|
|
2020-05-05 01:31:21 -07:00
|
|
|
using DelayLine = std::array<float,DelayLength>;
|
|
|
|
al::FlexArray<DelayLine,16> DelayBuf;
|
2020-03-30 01:16:15 -07:00
|
|
|
|
2020-05-05 01:31:21 -07:00
|
|
|
static std::unique_ptr<FrontStablizer> Create(size_t numchans)
|
2020-05-19 12:15:57 -07:00
|
|
|
{ return std::unique_ptr<FrontStablizer>{new(FamCount(numchans)) FrontStablizer{numchans}}; }
|
2020-05-05 01:01:30 -07:00
|
|
|
|
2020-05-05 01:31:21 -07:00
|
|
|
DEF_FAM_NEWDEL(FrontStablizer, DelayBuf)
|
2020-03-30 01:16:15 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* ALC_FRONT_STABLIZER_H */
|