13 #include "devformat.h"
14 #include "filters/splitter.h"
20 using ChannelDec
= ALfloat
[MAX_AMBI_CHANNELS
];
23 static constexpr size_t sHFBand
{0};
24 static constexpr size_t sLFBand
{1};
25 static constexpr size_t sNumBands
{2};
27 bool mDualBand
{false};
28 ALuint mEnabled
{0u}; /* Bitfield of enabled channels. */
30 ALuint mNumChannels
{0u};
32 ALfloat Dual
[MAX_OUTPUT_CHANNELS
][sNumBands
][MAX_AMBI_CHANNELS
];
33 ALfloat Single
[MAX_OUTPUT_CHANNELS
][MAX_AMBI_CHANNELS
];
36 /* NOTE: BandSplitter filters are unused with single-band decoding */
37 BandSplitter mXOver
[MAX_AMBI_CHANNELS
];
39 al::vector
<FloatBufferLine
, 16> mSamples
;
40 /* These two alias into Samples */
41 FloatBufferLine
*mSamplesHF
{nullptr};
42 FloatBufferLine
*mSamplesLF
{nullptr};
45 BFormatDec(const AmbDecConf
*conf
, const bool allow_2band
, const ALuint inchans
,
46 const ALuint srate
, const ALuint (&chanmap
)[MAX_OUTPUT_CHANNELS
]);
47 BFormatDec(const ALuint inchans
, const ALsizei chancount
,
48 const ChannelDec (&chancoeffs
)[MAX_OUTPUT_CHANNELS
],
49 const ALuint (&chanmap
)[MAX_OUTPUT_CHANNELS
]);
51 /* Decodes the ambisonic input to the given output channels. */
52 void process(const al::span
<FloatBufferLine
> OutBuffer
, const FloatBufferLine
*InSamples
,
53 const size_t SamplesToDo
);
55 /* Retrieves per-order HF scaling factors for "upsampling" ambisonic data. */
56 static std::array
<ALfloat
,MAX_AMBI_ORDER
+1> GetHFOrderScales(const ALuint in_order
,
57 const ALuint out_order
) noexcept
;
59 DEF_NEWDEL(BFormatDec
)
62 #endif /* BFORMATDEC_H */