1 #ifndef CORE_UHJFILTER_H
2 #define CORE_UHJFILTER_H
7 #include "bufferline.h"
11 /* A particular property of the filter allows it to cover nearly twice its
12 * length, so the filter size is also the effective delay (despite being
15 constexpr static size_t sFilterSize
{128};
17 /* Delays for the unfiltered signal. */
18 alignas(16) std::array
<float,sFilterSize
> mMidDelay
{};
19 alignas(16) std::array
<float,sFilterSize
> mSideDelay
{};
21 alignas(16) std::array
<float,BufferLineSize
+sFilterSize
> mMid
{};
22 alignas(16) std::array
<float,BufferLineSize
+sFilterSize
> mSide
{};
24 /* History for the FIR filter. */
25 alignas(16) std::array
<float,sFilterSize
*2 - 1> mSideHistory
{};
27 alignas(16) std::array
<float,BufferLineSize
+ sFilterSize
*2> mTemp
{};
30 * Encodes a 2-channel UHJ (stereo-compatible) signal from a B-Format input
31 * signal. The input must use FuMa channel ordering and scaling.
33 void encode(FloatBufferLine
&LeftOut
, FloatBufferLine
&RightOut
,
34 const FloatBufferLine
*InSamples
, const size_t SamplesToDo
);
36 DEF_NEWDEL(Uhj2Encoder
)
39 #endif /* CORE_UHJFILTER_H */