Stop the Oboe recording stream when recording is stopped
[openal-soft.git] / core / uhjfilter.h
blobc2cb8722af6910dbb7d583ea8b38557eba97a9b1
1 #ifndef CORE_UHJFILTER_H
2 #define CORE_UHJFILTER_H
4 #include <array>
6 #include "almalloc.h"
7 #include "bufferline.h"
10 struct Uhj2Encoder {
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
13 * center-aligned).
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{};
29 /**
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 */