aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/bformatdec.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-02-21 04:05:49 -0800
committerChris Robinson <[email protected]>2019-02-21 04:05:49 -0800
commita9648905378b8a3321742bb0e498227cfc6ee5f6 (patch)
treee9f3c91b810b1e042d3153ceb512896195bf23d7 /Alc/bformatdec.cpp
parenta35255291f946c634219da71b287339654eeff3c (diff)
Add helpers to get the channel count from an ambisonic order
Diffstat (limited to 'Alc/bformatdec.cpp')
-rw-r--r--Alc/bformatdec.cpp14
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] :