From 49ac268334bf8875ff1b5baa1e79edc8b7fe15bd Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 20 Dec 2018 04:19:35 -0800 Subject: Add index maps from 2D and 3D --- Alc/bformatdec.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'Alc/bformatdec.cpp') diff --git a/Alc/bformatdec.cpp b/Alc/bformatdec.cpp index 6a149611..d0d1325a 100644 --- a/Alc/bformatdec.cpp +++ b/Alc/bformatdec.cpp @@ -63,8 +63,6 @@ auto GetAmbiScales(AmbDecScale scaletype) noexcept -> const std::array ALfloat - { ASSUME(index > 0); return coeffs[index]; } + { ASSUME(index >= 0); return coeffs[index]; } ); } assert(chancount >= 3); for(ALsizei c{0};c < 3;c++) { - const ALsizei i{map2DTo3D[c]}; + const ALsizei i{AmbiIndex::From2D[c]}; ALdouble gain{0.0}; for(size_t k{0u};k < COUNTOF(Ambi3DDecoder);k++) gain += (ALdouble)Ambi3DDecoder[k][i] * encgains[k][c]; @@ -142,7 +140,7 @@ void BFormatDec::reset(const AmbDecConf *conf, ALsizei chancount, ALuint srate, ALfloat (&mtx)[MAX_AMBI_COEFFS] = mMatrix.Single[chanmap[i]]; for(ALsizei j{0},k{0};j < coeff_count;j++) { - const ALsizei l{periphonic ? j : map2DTo3D[j]}; + const ALsizei l{periphonic ? j : AmbiIndex::From2D[j]}; if(!(conf->ChanMask&(1<HFMatrix[i][k] / coeff_scale[l] * ((l>=9) ? conf->HFOrderGain[3] : @@ -163,7 +161,7 @@ void BFormatDec::reset(const AmbDecConf *conf, ALsizei chancount, ALuint srate, ALfloat (&mtx)[sNumBands][MAX_AMBI_COEFFS] = mMatrix.Dual[chanmap[i]]; for(ALsizei j{0},k{0};j < coeff_count;j++) { - const ALsizei l{periphonic ? j : map2DTo3D[j]}; + const ALsizei l{periphonic ? j : AmbiIndex::From2D[j]}; if(!(conf->ChanMask&(1<HFMatrix[i][k] / coeff_scale[l] * ((l>=9) ? conf->HFOrderGain[3] : -- cgit v1.2.3