diff options
author | Chris Robinson <[email protected]> | 2018-02-09 18:43:34 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-02-09 18:43:34 -0800 |
commit | c346baff5b5e86e7e7982b5e644ecf756a040170 (patch) | |
tree | 13b738f339110d76b614592d1885c3c76db8f3c5 /Alc | |
parent | 20bee69955380d9ff65838c2cb005637c5c348ae (diff) |
Clarify some macro names using ambisonic mixed-mode notation
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/bformatdec.c | 24 | ||||
-rw-r--r-- | Alc/bformatdec.h | 16 | ||||
-rw-r--r-- | Alc/panning.c | 24 |
3 files changed, 32 insertions, 32 deletions
diff --git a/Alc/bformatdec.c b/Alc/bformatdec.c index 0e79fd3f..9673b422 100644 --- a/Alc/bformatdec.c +++ b/Alc/bformatdec.c @@ -269,13 +269,13 @@ void bformatdec_reset(BFormatDec *dec, const AmbDecConf *conf, ALsizei chancount { periphonic = true; - dec->UpSampler[0].Gains[FB_HighFreq] = (dec->NumChannels > 9) ? W_SCALE3D_THIRD : - (dec->NumChannels > 4) ? W_SCALE3D_SECOND : 1.0f; + dec->UpSampler[0].Gains[FB_HighFreq] = (conf->ChanMask > 0x1ff) ? W_SCALE_3H3P : + (conf->ChanMask > 0xf) ? W_SCALE_2H2P : 1.0f; dec->UpSampler[0].Gains[FB_LowFreq] = 1.0f; for(i = 1;i < 4;i++) { - dec->UpSampler[i].Gains[FB_HighFreq] = (dec->NumChannels > 9) ? XYZ_SCALE3D_THIRD : - (dec->NumChannels > 4) ? XYZ_SCALE3D_SECOND : 1.0f; + dec->UpSampler[i].Gains[FB_HighFreq] = (conf->ChanMask > 0x1ff) ? XYZ_SCALE_3H3P : + (conf->ChanMask > 0xf) ? XYZ_SCALE_2H2P : 1.0f; dec->UpSampler[i].Gains[FB_LowFreq] = 1.0f; } } @@ -283,13 +283,13 @@ void bformatdec_reset(BFormatDec *dec, const AmbDecConf *conf, ALsizei chancount { periphonic = false; - dec->UpSampler[0].Gains[FB_HighFreq] = (dec->NumChannels > 5) ? W_SCALE2D_THIRD : - (dec->NumChannels > 3) ? W_SCALE2D_SECOND : 1.0f; + dec->UpSampler[0].Gains[FB_HighFreq] = (conf->ChanMask > 0x1ff) ? W_SCALE_3H0P : + (conf->ChanMask > 0xf) ? W_SCALE_2H0P : 1.0f; dec->UpSampler[0].Gains[FB_LowFreq] = 1.0f; for(i = 1;i < 3;i++) { - dec->UpSampler[i].Gains[FB_HighFreq] = (dec->NumChannels > 5) ? XYZ_SCALE2D_THIRD : - (dec->NumChannels > 3) ? XYZ_SCALE2D_SECOND : 1.0f; + dec->UpSampler[i].Gains[FB_HighFreq] = (conf->ChanMask > 0x1ff) ? XYZ_SCALE_3H0P : + (conf->ChanMask > 0xf) ? XYZ_SCALE_2H0P : 1.0f; dec->UpSampler[i].Gains[FB_LowFreq] = 1.0f; } dec->UpSampler[3].Gains[FB_HighFreq] = 0.0f; @@ -559,10 +559,10 @@ void ambiup_reset(struct AmbiUpsampler *ambiup, const ALCdevice *device) else { /* Assumes full 3D/periphonic on the input and output mixes! */ - ALfloat w_scale = (device->Dry.NumChannels > 9) ? W_SCALE3D_THIRD : - (device->Dry.NumChannels > 4) ? W_SCALE3D_SECOND : 1.0f; - ALfloat xyz_scale = (device->Dry.NumChannels > 9) ? XYZ_SCALE3D_THIRD : - (device->Dry.NumChannels > 4) ? XYZ_SCALE3D_SECOND : 1.0f; + ALfloat w_scale = (device->Dry.NumChannels > 9) ? W_SCALE_3H3P : + (device->Dry.NumChannels > 4) ? W_SCALE_2H2P : 1.0f; + ALfloat xyz_scale = (device->Dry.NumChannels > 9) ? XYZ_SCALE_3H3P : + (device->Dry.NumChannels > 4) ? XYZ_SCALE_2H2P : 1.0f; for(i = 0;i < 4;i++) { ALsizei index = GetChannelForACN(device->Dry, i); diff --git a/Alc/bformatdec.h b/Alc/bformatdec.h index b017cfd3..c897ac3a 100644 --- a/Alc/bformatdec.h +++ b/Alc/bformatdec.h @@ -7,18 +7,18 @@ /* These are the necessary scales for first-order HF responses to play over * higher-order 2D (non-periphonic) decoders. */ -#define W_SCALE2D_SECOND 1.224744871f /* sqrt(1.5) */ -#define XYZ_SCALE2D_SECOND 1.0f -#define W_SCALE2D_THIRD 1.414213562f /* sqrt(2) */ -#define XYZ_SCALE2D_THIRD 1.082392196f +#define W_SCALE_2H0P 1.224744871f /* sqrt(1.5) */ +#define XYZ_SCALE_2H0P 1.0f +#define W_SCALE_3H0P 1.414213562f /* sqrt(2) */ +#define XYZ_SCALE_3H0P 1.082392196f /* These are the necessary scales for first-order HF responses to play over * higher-order 3D (periphonic) decoders. */ -#define W_SCALE3D_SECOND 1.341640787f /* sqrt(1.8) */ -#define XYZ_SCALE3D_SECOND 1.0f -#define W_SCALE3D_THIRD 1.695486018f -#define XYZ_SCALE3D_THIRD 1.136697713f +#define W_SCALE_2H2P 1.341640787f /* sqrt(1.8) */ +#define XYZ_SCALE_2H2P 1.0f +#define W_SCALE_3H3P 1.695486018f +#define XYZ_SCALE_3H3P 1.136697713f struct AmbDecConf; diff --git a/Alc/panning.c b/Alc/panning.c index 1691aacd..eaeb2646 100644 --- a/Alc/panning.c +++ b/Alc/panning.c @@ -679,10 +679,10 @@ static void InitPanning(ALCdevice *device) chanmap, count, &device->Dry.NumChannels); device->Dry.CoeffCount = coeffcount; - w_scale = (device->Dry.CoeffCount > 9) ? W_SCALE2D_THIRD : - (device->Dry.CoeffCount > 4) ? W_SCALE2D_SECOND : 1.0f; - xyz_scale = (device->Dry.CoeffCount > 9) ? XYZ_SCALE2D_THIRD : - (device->Dry.CoeffCount > 4) ? XYZ_SCALE2D_SECOND : 1.0f; + w_scale = (device->Dry.CoeffCount > 9) ? W_SCALE_3H0P : + (device->Dry.CoeffCount > 4) ? W_SCALE_2H0P : 1.0f; + xyz_scale = (device->Dry.CoeffCount > 9) ? XYZ_SCALE_3H0P : + (device->Dry.CoeffCount > 4) ? XYZ_SCALE_2H0P : 1.0f; memset(&device->FOAOut.Ambi, 0, sizeof(device->FOAOut.Ambi)); for(i = 0;i < device->Dry.NumChannels;i++) @@ -713,26 +713,26 @@ static void InitCustomPanning(ALCdevice *device, const AmbDecConf *conf, const A { if(conf->ChanMask > 0x1ff) { - w_scale = W_SCALE3D_THIRD; - xyz_scale = XYZ_SCALE3D_THIRD; + w_scale = W_SCALE_3H3P; + xyz_scale = XYZ_SCALE_3H3P; } else if(conf->ChanMask > 0xf) { - w_scale = W_SCALE3D_SECOND; - xyz_scale = XYZ_SCALE3D_SECOND; + w_scale = W_SCALE_2H2P; + xyz_scale = XYZ_SCALE_2H2P; } } else { if(conf->ChanMask > 0x1ff) { - w_scale = W_SCALE2D_THIRD; - xyz_scale = XYZ_SCALE2D_THIRD; + w_scale = W_SCALE_3H0P; + xyz_scale = XYZ_SCALE_3H0P; } else if(conf->ChanMask > 0xf) { - w_scale = W_SCALE2D_SECOND; - xyz_scale = XYZ_SCALE2D_SECOND; + w_scale = W_SCALE_2H0P; + xyz_scale = XYZ_SCALE_2H0P; } } |