aboutsummaryrefslogtreecommitdiffstats
path: root/alc/bformatdec.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-01-15 10:09:41 -0800
committerChris Robinson <[email protected]>2020-01-15 10:09:41 -0800
commitfcfcb88b28af65fa6a26257e2e5346ed31abb858 (patch)
treecd6a10bb55187d1065a173cf8f0079b1d1afa983 /alc/bformatdec.h
parentc112acadaf72e356877138624597b2f0dc3af3d3 (diff)
Repack B-Format decoder fields
This should better provide sequential access.
Diffstat (limited to 'alc/bformatdec.h')
-rw-r--r--alc/bformatdec.h25
1 files changed, 13 insertions, 12 deletions
diff --git a/alc/bformatdec.h b/alc/bformatdec.h
index fe4b8263..d3380616 100644
--- a/alc/bformatdec.h
+++ b/alc/bformatdec.h
@@ -24,21 +24,22 @@ class BFormatDec {
static constexpr size_t sLFBand{1};
static constexpr size_t sNumBands{2};
- bool mDualBand{false};
-
- ALuint mNumChannels{0u};
- union MatrixU {
- float Dual[MAX_AMBI_CHANNELS][sNumBands][MAX_OUTPUT_CHANNELS];
- float Single[MAX_AMBI_CHANNELS][MAX_OUTPUT_CHANNELS];
- } mMatrix{};
+ struct ChannelDecoder {
+ union MatrixU {
+ float Dual[sNumBands][MAX_OUTPUT_CHANNELS];
+ float Single[MAX_OUTPUT_CHANNELS];
+ } mGains{};
- /* NOTE: BandSplitter filters and temp samples are unused with single-band
- * decoding.
- */
- BandSplitter mXOver[MAX_AMBI_CHANNELS];
+ /* NOTE: BandSplitter filter is unused with single-band decoding. */
+ BandSplitter mXOver;
+ };
alignas(16) std::array<FloatBufferLine,2> mSamples;
+ bool mDualBand{false};
+
+ al::FlexArray<ChannelDecoder> mChannelDec;
+
public:
BFormatDec(const AmbDecConf *conf, const bool allow_2band, const ALuint inchans,
const ALuint srate, const ALuint (&chanmap)[MAX_OUTPUT_CHANNELS]);
@@ -53,7 +54,7 @@ public:
static std::array<float,MAX_AMBI_ORDER+1> GetHFOrderScales(const ALuint in_order,
const ALuint out_order) noexcept;
- DEF_NEWDEL(BFormatDec)
+ DEF_FAM_NEWDEL(BFormatDec, mChannelDec)
};
#endif /* BFORMATDEC_H */