aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/bformatdec.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-12-14 23:26:44 -0800
committerChris Robinson <[email protected]>2018-12-14 23:26:44 -0800
commit2d13e0af29144815e5fc55b2a532ffa9d3bc12f6 (patch)
treee21029bf815ebdcfaa520ddea184946b100957ae /Alc/bformatdec.cpp
parent0882728dec2b9109fb60d98a46da31dc92acb790 (diff)
Add macros for the ambisonic order masks
Diffstat (limited to 'Alc/bformatdec.cpp')
-rw-r--r--Alc/bformatdec.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/Alc/bformatdec.cpp b/Alc/bformatdec.cpp
index 322a7977..882184a3 100644
--- a/Alc/bformatdec.cpp
+++ b/Alc/bformatdec.cpp
@@ -103,25 +103,29 @@ void BFormatDec::reset(const AmbDecConf *conf, ALsizei chancount, ALuint srate,
const bool periphonic{(conf->ChanMask&AMBI_PERIPHONIC_MASK) != 0};
if(periphonic)
{
- mUpSampler[0].Gains[HF_BAND] = (conf->ChanMask > 0x1ff) ? W_SCALE_3H3P :
- (conf->ChanMask > 0xf) ? W_SCALE_2H2P : 1.0f;
+ mUpSampler[0].Gains[HF_BAND] =
+ (conf->ChanMask > AMBI_2ORDER_MASK) ? W_SCALE_3H3P :
+ (conf->ChanMask > AMBI_1ORDER_MASK) ? W_SCALE_2H2P : 1.0f;
mUpSampler[0].Gains[LF_BAND] = 1.0f;
for(ALsizei i{1};i < 4;i++)
{
- mUpSampler[i].Gains[HF_BAND] = (conf->ChanMask > 0x1ff) ? XYZ_SCALE_3H3P :
- (conf->ChanMask > 0xf) ? XYZ_SCALE_2H2P : 1.0f;
+ mUpSampler[i].Gains[HF_BAND] =
+ (conf->ChanMask > AMBI_2ORDER_MASK) ? XYZ_SCALE_3H3P :
+ (conf->ChanMask > AMBI_1ORDER_MASK) ? XYZ_SCALE_2H2P : 1.0f;
mUpSampler[i].Gains[LF_BAND] = 1.0f;
}
}
else
{
- mUpSampler[0].Gains[HF_BAND] = (conf->ChanMask > 0x1ff) ? W_SCALE_3H0P :
- (conf->ChanMask > 0xf) ? W_SCALE_2H0P : 1.0f;
+ mUpSampler[0].Gains[HF_BAND] =
+ (conf->ChanMask > AMBI_2ORDER_MASK) ? W_SCALE_3H0P :
+ (conf->ChanMask > AMBI_1ORDER_MASK) ? W_SCALE_2H0P : 1.0f;
mUpSampler[0].Gains[LF_BAND] = 1.0f;
for(ALsizei i{1};i < 3;i++)
{
- mUpSampler[i].Gains[HF_BAND] = (conf->ChanMask > 0x1ff) ? XYZ_SCALE_3H0P :
- (conf->ChanMask > 0xf) ? XYZ_SCALE_2H0P : 1.0f;
+ mUpSampler[i].Gains[HF_BAND] =
+ (conf->ChanMask > AMBI_2ORDER_MASK) ? XYZ_SCALE_3H0P :
+ (conf->ChanMask > AMBI_1ORDER_MASK) ? XYZ_SCALE_2H0P : 1.0f;
mUpSampler[i].Gains[LF_BAND] = 1.0f;
}
mUpSampler[3].Gains[HF_BAND] = 0.0f;