aboutsummaryrefslogtreecommitdiffstats
path: root/alc/bformatdec.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-01-14 23:08:04 -0800
committerChris Robinson <[email protected]>2020-01-14 23:08:04 -0800
commitc112acadaf72e356877138624597b2f0dc3af3d3 (patch)
tree50f6eacd9571a4715a74be1e458776948047814e /alc/bformatdec.h
parent030d428aec2389f65336eef28076c55914e34d00 (diff)
Transpose BFormatDec's matrices
This allows the band-split and output mix to happen together, rather than splitting all input channels first and then mixing them to output.
Diffstat (limited to 'alc/bformatdec.h')
-rw-r--r--alc/bformatdec.h16
1 files changed, 7 insertions, 9 deletions
diff --git a/alc/bformatdec.h b/alc/bformatdec.h
index bf48a05f..fe4b8263 100644
--- a/alc/bformatdec.h
+++ b/alc/bformatdec.h
@@ -17,7 +17,7 @@
struct AmbDecConf;
-using ChannelDec = ALfloat[MAX_AMBI_CHANNELS];
+using ChannelDec = float[MAX_AMBI_CHANNELS];
class BFormatDec {
static constexpr size_t sHFBand{0};
@@ -25,21 +25,19 @@ class BFormatDec {
static constexpr size_t sNumBands{2};
bool mDualBand{false};
- ALuint mEnabled{0u}; /* Bitfield of enabled channels. */
ALuint mNumChannels{0u};
union MatrixU {
- ALfloat Dual[MAX_OUTPUT_CHANNELS][sNumBands][MAX_AMBI_CHANNELS];
- ALfloat Single[MAX_OUTPUT_CHANNELS][MAX_AMBI_CHANNELS];
+ float Dual[MAX_AMBI_CHANNELS][sNumBands][MAX_OUTPUT_CHANNELS];
+ float Single[MAX_AMBI_CHANNELS][MAX_OUTPUT_CHANNELS];
} mMatrix{};
- /* NOTE: BandSplitter filters are unused with single-band decoding */
+ /* NOTE: BandSplitter filters and temp samples are unused with single-band
+ * decoding.
+ */
BandSplitter mXOver[MAX_AMBI_CHANNELS];
- al::vector<FloatBufferLine, 16> mSamples;
- /* These two alias into Samples */
- FloatBufferLine *mSamplesHF{nullptr};
- FloatBufferLine *mSamplesLF{nullptr};
+ alignas(16) std::array<FloatBufferLine,2> mSamples;
public:
BFormatDec(const AmbDecConf *conf, const bool allow_2band, const ALuint inchans,