Use a macro to specify the ambisonic periphonic channel mask

This commit is contained in:
Chris Robinson
2016-06-01 05:30:06 -07:00
parent 5e64882be9
commit c63d468d4c
3 changed files with 13 additions and 4 deletions
+1 -1
View File
@@ -310,7 +310,7 @@ void bformatdec_reset(BFormatDec *dec, const AmbDecConf *conf, ALuint chancount,
ratio = 400.0f / (ALfloat)srate;
for(i = 0;i < 4;i++)
bandsplit_init(&dec->UpSampler.XOver[i], ratio);
if((conf->ChanMask & ~0x831b))
if((conf->ChanMask&AMBI_PERIPHONIC_MASK))
{
dec->UpSampler.MatrixHF = CubeMatrixHF;
dec->UpSampler.MatrixLF = CubeMatrixLF;
+2 -2
View File
@@ -673,7 +673,7 @@ static void InitHQPanning(ALCdevice *device, const AmbDecConf *conf, const ALuin
if(GetConfigValueBool(devname, "decoder", "distance-comp", 1))
decflags |= BFDF_DistanceComp;
if((conf->ChanMask & ~0x831b))
if((conf->ChanMask&AMBI_PERIPHONIC_MASK))
{
count = (conf->ChanMask > 0x1ff) ? 16 :
(conf->ChanMask > 0xf) ? 9 : 4;
@@ -701,7 +701,7 @@ static void InitHQPanning(ALCdevice *device, const AmbDecConf *conf, const ALuin
TRACE("Enabling %s-band %s-order%s ambisonic decoder\n",
(conf->FreqBands == 1) ? "single" : "dual",
(conf->ChanMask > 0xf) ? (conf->ChanMask > 0x1ff) ? "third" : "second" : "first",
(conf->ChanMask & ~0x831b) ? " periphonic" : ""
(conf->ChanMask&AMBI_PERIPHONIC_MASK) ? " periphonic" : ""
);
bformatdec_reset(device->AmbiDecoder, conf, count, device->Frequency,
speakermap, decflags);
+10 -1
View File
@@ -483,10 +483,19 @@ enum RenderMode {
/* The maximum number of Ambisonics coefficients. For a given order (o), the
* size needed will be (o+1)**2, thus zero-order has 1, first-order has 4,
* second-order has 9, and third-order has 16. */
* second-order has 9, third-order has 16, and fourth-order has 25. */
#define MAX_AMBI_ORDER 3
#define MAX_AMBI_COEFFS ((MAX_AMBI_ORDER+1) * (MAX_AMBI_ORDER+1))
/* A bitmask of ambisonic channels with height information. If none of these
* channels are used/needed, there's no height (e.g. with most surround sound
* speaker setups). This only specifies up to 4th order, which is the highest
* order a 32-bit mask value can specify (a 64-bit mask could handle up to 7th
* order). This is ACN ordering, with bit 0 being ACN 0, etc.
*/
#define AMBI_PERIPHONIC_MASK (0xfe7ce4)
typedef ALfloat ChannelConfig[MAX_AMBI_COEFFS];
typedef struct BFChannelConfig {
ALfloat Scale;