From 7ed37a82823f46ff59aa42c9812eccb9128d38ac Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 7 May 2020 03:15:46 -0700 Subject: Use dual-band for the internal quad and 7.1 decoders --- alc/bformatdec.cpp | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'alc/bformatdec.cpp') diff --git a/alc/bformatdec.cpp b/alc/bformatdec.cpp index 36adf005..41710332 100644 --- a/alc/bformatdec.cpp +++ b/alc/bformatdec.cpp @@ -98,14 +98,32 @@ BFormatDec::BFormatDec(const AmbDecConf *conf, const bool allow_2band, const siz } } -BFormatDec::BFormatDec(const size_t inchans, const al::span chancoeffs) - : mChannelDec{inchans} +BFormatDec::BFormatDec(const size_t inchans, const al::span coeffs, + const al::span coeffslf) : mChannelDec{inchans} { - for(size_t j{0};j < mChannelDec.size();++j) + mDualBand = !coeffslf.empty(); + + if(!mDualBand) + { + for(size_t j{0};j < mChannelDec.size();++j) + { + float *outcoeffs{mChannelDec[j].mGains.Single}; + for(const ChannelDec &incoeffs : coeffs) + *(outcoeffs++) = incoeffs[j]; + } + } + else { - float *outcoeffs{mChannelDec[j].mGains.Single}; - for(const ChannelDec &incoeffs : chancoeffs) - *(outcoeffs++) = incoeffs[j]; + for(size_t j{0};j < mChannelDec.size();++j) + { + float *outcoeffs{mChannelDec[j].mGains.Dual[sHFBand]}; + for(const ChannelDec &incoeffs : coeffs) + *(outcoeffs++) = incoeffs[j]; + + outcoeffs = mChannelDec[j].mGains.Dual[sLFBand]; + for(const ChannelDec &incoeffs : coeffslf) + *(outcoeffs++) = incoeffs[j]; + } } } -- cgit v1.2.3