diff options
author | Chris Robinson <[email protected]> | 2019-02-21 04:05:49 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-02-21 04:05:49 -0800 |
commit | a9648905378b8a3321742bb0e498227cfc6ee5f6 (patch) | |
tree | e9f3c91b810b1e042d3153ceb512896195bf23d7 /Alc/bformatdec.cpp | |
parent | a35255291f946c634219da71b287339654eeff3c (diff) |
Add helpers to get the channel count from an ambisonic order
Diffstat (limited to 'Alc/bformatdec.cpp')
-rw-r--r-- | Alc/bformatdec.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Alc/bformatdec.cpp b/Alc/bformatdec.cpp index d735b94c..efac73ca 100644 --- a/Alc/bformatdec.cpp +++ b/Alc/bformatdec.cpp @@ -92,17 +92,17 @@ void BFormatDec::reset(const AmbDecConf *conf, bool allow_2band, ALsizei inchans const bool periphonic{(conf->ChanMask&AMBI_PERIPHONIC_MASK) != 0}; const std::array<float,MAX_AMBI_CHANNELS> &coeff_scale = GetAmbiScales(conf->CoeffScale); - const ALsizei coeff_count{periphonic ? MAX_AMBI_CHANNELS : MAX_AMBI2D_CHANNELS}; + const size_t coeff_count{periphonic ? MAX_AMBI_CHANNELS : MAX_AMBI2D_CHANNELS}; if(!mDualBand) { for(size_t i{0u};i < conf->Speakers.size();i++) { ALfloat (&mtx)[MAX_AMBI_CHANNELS] = mMatrix.Single[chanmap[i]]; - for(ALsizei j{0},k{0};j < coeff_count;j++) + for(size_t j{0},k{0};j < coeff_count;j++) { - const ALsizei l{periphonic ? j : AmbiIndex::From2D[j]}; - if(!(conf->ChanMask&(1<<l))) continue; + const size_t l{periphonic ? j : AmbiIndex::From2D[j]}; + if(!(conf->ChanMask&(1u<<l))) continue; mtx[j] = conf->HFMatrix[i][k] / coeff_scale[l] * ((l>=9) ? conf->HFOrderGain[3] : (l>=4) ? conf->HFOrderGain[2] : @@ -120,10 +120,10 @@ void BFormatDec::reset(const AmbDecConf *conf, bool allow_2band, ALsizei inchans for(size_t i{0u};i < conf->Speakers.size();i++) { ALfloat (&mtx)[sNumBands][MAX_AMBI_CHANNELS] = mMatrix.Dual[chanmap[i]]; - for(ALsizei j{0},k{0};j < coeff_count;j++) + for(size_t j{0},k{0};j < coeff_count;j++) { - const ALsizei l{periphonic ? j : AmbiIndex::From2D[j]}; - if(!(conf->ChanMask&(1<<l))) continue; + const size_t l{periphonic ? j : AmbiIndex::From2D[j]}; + if(!(conf->ChanMask&(1u<<l))) continue; mtx[sHFBand][j] = conf->HFMatrix[i][k] / coeff_scale[l] * ((l>=9) ? conf->HFOrderGain[3] : (l>=4) ? conf->HFOrderGain[2] : |