aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Alc/alu.cpp12
-rw-r--r--Alc/ambdec.h2
-rw-r--r--Alc/ambidefs.h28
-rw-r--r--Alc/bformatdec.cpp14
-rw-r--r--Alc/bformatdec.h8
-rw-r--r--Alc/effects/chorus.cpp2
-rw-r--r--Alc/effects/dedicated.cpp2
-rw-r--r--Alc/effects/distortion.cpp2
-rw-r--r--Alc/effects/echo.cpp2
-rw-r--r--Alc/effects/fshifter.cpp2
-rw-r--r--Alc/effects/pshifter.cpp2
-rw-r--r--Alc/hrtf.cpp4
-rw-r--r--Alc/hrtf.h2
-rw-r--r--Alc/panning.cpp30
-rw-r--r--OpenAL32/Include/alu.h6
15 files changed, 59 insertions, 59 deletions
diff --git a/Alc/alu.cpp b/Alc/alu.cpp
index 3b4ecfbd..39d75954 100644
--- a/Alc/alu.cpp
+++ b/Alc/alu.cpp
@@ -640,7 +640,7 @@ void CalcPanningAndFilters(ALvoice *voice, const ALfloat Azi, const ALfloat Elev
* moved to +/-90 degrees for direct right and left speaker
* responses.
*/
- ALfloat coeffs[MAX_AMBI_COEFFS];
+ ALfloat coeffs[MAX_AMBI_CHANNELS];
CalcAngleCoeffs((Device->mRenderMode==StereoPair) ? ScaleAzimuthFront(Azi, 1.5f) : Azi,
Elev, Spread, coeffs);
@@ -739,7 +739,7 @@ void CalcPanningAndFilters(ALvoice *voice, const ALfloat Azi, const ALfloat Elev
*/
for(ALsizei c{0};c < num_channels;c++)
{
- ALfloat coeffs[MAX_AMBI_COEFFS];
+ ALfloat coeffs[MAX_AMBI_CHANNELS];
CalcAngleCoeffs(chans[c].angle, chans[c].elevation, 0.0f, coeffs);
for(ALsizei i{0};i < NumSends;i++)
@@ -780,7 +780,7 @@ void CalcPanningAndFilters(ALvoice *voice, const ALfloat Azi, const ALfloat Elev
/* Calculate the directional coefficients once, which apply to all
* input channels of the source sends.
*/
- ALfloat coeffs[MAX_AMBI_COEFFS];
+ ALfloat coeffs[MAX_AMBI_CHANNELS];
CalcAngleCoeffs(Azi, Elev, Spread, coeffs);
for(ALsizei i{0};i < NumSends;i++)
@@ -818,7 +818,7 @@ void CalcPanningAndFilters(ALvoice *voice, const ALfloat Azi, const ALfloat Elev
voice->Direct.Params[c].Hrtf.Target.Gain = DryGain;
/* Normal panning for auxiliary sends. */
- ALfloat coeffs[MAX_AMBI_COEFFS];
+ ALfloat coeffs[MAX_AMBI_CHANNELS];
CalcAngleCoeffs(chans[c].angle, chans[c].elevation, Spread, coeffs);
for(ALsizei i{0};i < NumSends;i++)
@@ -862,7 +862,7 @@ void CalcPanningAndFilters(ALvoice *voice, const ALfloat Azi, const ALfloat Elev
/* Calculate the directional coefficients once, which apply to all
* input channels.
*/
- ALfloat coeffs[MAX_AMBI_COEFFS];
+ ALfloat coeffs[MAX_AMBI_CHANNELS];
CalcAngleCoeffs((Device->mRenderMode==StereoPair) ? ScaleAzimuthFront(Azi, 1.5f) : Azi,
Elev, Spread, coeffs);
@@ -930,7 +930,7 @@ void CalcPanningAndFilters(ALvoice *voice, const ALfloat Azi, const ALfloat Elev
continue;
}
- ALfloat coeffs[MAX_AMBI_COEFFS];
+ ALfloat coeffs[MAX_AMBI_CHANNELS];
CalcAngleCoeffs(
(Device->mRenderMode==StereoPair) ? ScaleAzimuthFront(chans[c].angle, 3.0f)
: chans[c].angle,
diff --git a/Alc/ambdec.h b/Alc/ambdec.h
index 1629c14d..ff7b71ee 100644
--- a/Alc/ambdec.h
+++ b/Alc/ambdec.h
@@ -34,7 +34,7 @@ struct AmbDecConf {
};
al::vector<SpeakerConf> Speakers;
- using CoeffArray = std::array<float,MAX_AMBI_COEFFS>;
+ using CoeffArray = std::array<float,MAX_AMBI_CHANNELS>;
/* Unused when FreqBands == 1 */
float LFOrderGain[MAX_AMBI_ORDER+1]{};
al::vector<CoeffArray> LFMatrix;
diff --git a/Alc/ambidefs.h b/Alc/ambidefs.h
index eeb09f75..2b04d70b 100644
--- a/Alc/ambidefs.h
+++ b/Alc/ambidefs.h
@@ -3,12 +3,12 @@
#include <array>
-/* 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, third-order has 16, and fourth-order has 25.
+/* The maximum number of Ambisonics channels. 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, 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))
+#define MAX_AMBI_ORDER 3
+#define MAX_AMBI_CHANNELS ((MAX_AMBI_ORDER+1) * (MAX_AMBI_ORDER+1))
/* A bitmask of ambisonic channels for 0 to 4th order. This only specifies up
* to 4th order, which is the highest order a 32-bit mask value can specify (a
@@ -26,22 +26,22 @@
*/
#define AMBI_PERIPHONIC_MASK (0xfe7ce4)
-/* The maximum number of Ambisonic coefficients for 2D (non-periphonic)
+/* The maximum number of ambisonic channels for 2D (non-periphonic)
* representation. This is 2 per each order above zero-order, plus 1 for zero-
* order. Or simply, o*2 + 1.
*/
-#define MAX_AMBI2D_COEFFS (MAX_AMBI_ORDER*2 + 1)
+#define MAX_AMBI2D_CHANNELS (MAX_AMBI_ORDER*2 + 1)
/* NOTE: These are scale factors as applied to Ambisonics content. Decoder
* coefficients should be divided by these values to get proper scalings.
*/
struct AmbiScale {
- static constexpr std::array<float,MAX_AMBI_COEFFS> FromN3D{{
+ static constexpr std::array<float,MAX_AMBI_CHANNELS> FromN3D{{
1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,
1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f
}};
- static constexpr std::array<float,MAX_AMBI_COEFFS> FromSN3D{{
+ static constexpr std::array<float,MAX_AMBI_CHANNELS> FromSN3D{{
1.000000000f, /* ACN 0, sqrt(1) */
1.732050808f, /* ACN 1, sqrt(3) */
1.732050808f, /* ACN 2, sqrt(3) */
@@ -59,7 +59,7 @@ struct AmbiScale {
2.645751311f, /* ACN 14, sqrt(7) */
2.645751311f, /* ACN 15, sqrt(7) */
}};
- static constexpr std::array<float,MAX_AMBI_COEFFS> FromFuMa{{
+ static constexpr std::array<float,MAX_AMBI_CHANNELS> FromFuMa{{
1.414213562f, /* ACN 0 (W), sqrt(2) */
1.732050808f, /* ACN 1 (Y), sqrt(3) */
1.732050808f, /* ACN 2 (Z), sqrt(3) */
@@ -80,7 +80,7 @@ struct AmbiScale {
};
struct AmbiIndex {
- static constexpr std::array<int,MAX_AMBI_COEFFS> FromFuMa{{
+ static constexpr std::array<int,MAX_AMBI_CHANNELS> FromFuMa{{
0, /* W */
3, /* X */
1, /* Y */
@@ -98,15 +98,15 @@ struct AmbiIndex {
15, /* P */
9, /* Q */
}};
- static constexpr std::array<int,MAX_AMBI_COEFFS> FromACN{{
+ static constexpr std::array<int,MAX_AMBI_CHANNELS> FromACN{{
0, 1, 2, 3, 4, 5, 6, 7,
8, 9, 10, 11, 12, 13, 14, 15
}};
- static constexpr std::array<int,MAX_AMBI2D_COEFFS> From2D{{
+ static constexpr std::array<int,MAX_AMBI2D_CHANNELS> From2D{{
0, 1,3, 4,8, 9,15
}};
- static constexpr std::array<int,MAX_AMBI_COEFFS> From3D{{
+ static constexpr std::array<int,MAX_AMBI_CHANNELS> From3D{{
0, 1, 2, 3, 4, 5, 6, 7,
8, 9, 10, 11, 12, 13, 14, 15
}};
diff --git a/Alc/bformatdec.cpp b/Alc/bformatdec.cpp
index 31d71dbd..d735b94c 100644
--- a/Alc/bformatdec.cpp
+++ b/Alc/bformatdec.cpp
@@ -39,7 +39,7 @@ inline auto GetDecoderHFScales(ALsizei order) noexcept -> const ALfloat(&)[MAX_A
return Ambi3DDecoderHFScale;
}
-inline auto GetAmbiScales(AmbDecScale scaletype) noexcept -> const std::array<float,MAX_AMBI_COEFFS>&
+inline auto GetAmbiScales(AmbDecScale scaletype) noexcept -> const std::array<float,MAX_AMBI_CHANNELS>&
{
if(scaletype == AmbDecScale::FuMa) return AmbiScale::FromFuMa;
if(scaletype == AmbDecScale::SN3D) return AmbiScale::FromSN3D;
@@ -91,14 +91,14 @@ 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_COEFFS> &coeff_scale = GetAmbiScales(conf->CoeffScale);
- const ALsizei coeff_count{periphonic ? MAX_AMBI_COEFFS : MAX_AMBI2D_COEFFS};
+ const std::array<float,MAX_AMBI_CHANNELS> &coeff_scale = GetAmbiScales(conf->CoeffScale);
+ const ALsizei 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_COEFFS] = mMatrix.Single[chanmap[i]];
+ ALfloat (&mtx)[MAX_AMBI_CHANNELS] = mMatrix.Single[chanmap[i]];
for(ALsizei j{0},k{0};j < coeff_count;j++)
{
const ALsizei l{periphonic ? j : AmbiIndex::From2D[j]};
@@ -119,7 +119,7 @@ void BFormatDec::reset(const AmbDecConf *conf, bool allow_2band, ALsizei inchans
const float ratio{std::pow(10.0f, conf->XOverRatio / 40.0f)};
for(size_t i{0u};i < conf->Speakers.size();i++)
{
- ALfloat (&mtx)[sNumBands][MAX_AMBI_COEFFS] = mMatrix.Dual[chanmap[i]];
+ ALfloat (&mtx)[sNumBands][MAX_AMBI_CHANNELS] = mMatrix.Dual[chanmap[i]];
for(ALsizei j{0},k{0};j < coeff_count;j++)
{
const ALsizei l{periphonic ? j : AmbiIndex::From2D[j]};
@@ -175,8 +175,8 @@ void BFormatDec::reset(const ALsizei inchans, const ALfloat xover_norm, const AL
for(ALsizei i{0};i < chancount;i++)
{
- const ALfloat (&coeffs)[MAX_AMBI_COEFFS] = chancoeffs[chanmap[i]];
- ALfloat (&mtx)[MAX_AMBI_COEFFS] = mMatrix.Single[chanmap[i]];
+ const ALfloat (&coeffs)[MAX_AMBI_CHANNELS] = chancoeffs[chanmap[i]];
+ ALfloat (&mtx)[MAX_AMBI_CHANNELS] = mMatrix.Single[chanmap[i]];
std::copy_n(std::begin(coeffs), inchans, std::begin(mtx));
}
diff --git a/Alc/bformatdec.h b/Alc/bformatdec.h
index 2f7ef612..40097f05 100644
--- a/Alc/bformatdec.h
+++ b/Alc/bformatdec.h
@@ -10,7 +10,7 @@
struct AmbDecConf;
-using ChannelDec = ALfloat[MAX_AMBI_COEFFS];
+using ChannelDec = ALfloat[MAX_AMBI_CHANNELS];
class BFormatDec {
static constexpr size_t sHFBand{0};
@@ -20,12 +20,12 @@ class BFormatDec {
ALuint mEnabled; /* Bitfield of enabled channels. */
union MatrixU {
- ALfloat Dual[MAX_OUTPUT_CHANNELS][sNumBands][MAX_AMBI_COEFFS];
- ALfloat Single[MAX_OUTPUT_CHANNELS][MAX_AMBI_COEFFS];
+ ALfloat Dual[MAX_OUTPUT_CHANNELS][sNumBands][MAX_AMBI_CHANNELS];
+ ALfloat Single[MAX_OUTPUT_CHANNELS][MAX_AMBI_CHANNELS];
} mMatrix;
/* NOTE: BandSplitter filters are unused with single-band decoding */
- BandSplitter mXOver[MAX_AMBI_COEFFS];
+ BandSplitter mXOver[MAX_AMBI_CHANNELS];
al::vector<std::array<ALfloat,BUFFERSIZE>, 16> mSamples;
/* These two alias into Samples */
diff --git a/Alc/effects/chorus.cpp b/Alc/effects/chorus.cpp
index 05216059..6b3053a4 100644
--- a/Alc/effects/chorus.cpp
+++ b/Alc/effects/chorus.cpp
@@ -146,7 +146,7 @@ void ChorusState::update(const ALCcontext *Context, const ALeffectslot *Slot, co
mFeedback = props->Chorus.Feedback;
/* Gains for left and right sides */
- ALfloat coeffs[2][MAX_AMBI_COEFFS];
+ ALfloat coeffs[2][MAX_AMBI_CHANNELS];
CalcAngleCoeffs(al::MathDefs<float>::Pi()*-0.5f, 0.0f, 0.0f, coeffs[0]);
CalcAngleCoeffs(al::MathDefs<float>::Pi()* 0.5f, 0.0f, 0.0f, coeffs[1]);
diff --git a/Alc/effects/dedicated.cpp b/Alc/effects/dedicated.cpp
index 64b24e9d..1804895a 100644
--- a/Alc/effects/dedicated.cpp
+++ b/Alc/effects/dedicated.cpp
@@ -78,7 +78,7 @@ void ALdedicatedState::update(const ALCcontext* UNUSED(context), const ALeffects
}
else
{
- ALfloat coeffs[MAX_AMBI_COEFFS];
+ ALfloat coeffs[MAX_AMBI_CHANNELS];
CalcAngleCoeffs(0.0f, 0.0f, 0.0f, coeffs);
mOutBuffer = target.Main->Buffer;
diff --git a/Alc/effects/distortion.cpp b/Alc/effects/distortion.cpp
index 12eb12fb..72ce7062 100644
--- a/Alc/effects/distortion.cpp
+++ b/Alc/effects/distortion.cpp
@@ -87,7 +87,7 @@ void ALdistortionState::update(const ALCcontext *context, const ALeffectslot *sl
calc_rcpQ_from_bandwidth(cutoff / (frequency*4.0f), bandwidth)
);
- ALfloat coeffs[MAX_AMBI_COEFFS];
+ ALfloat coeffs[MAX_AMBI_CHANNELS];
CalcAngleCoeffs(0.0f, 0.0f, 0.0f, coeffs);
mOutBuffer = target.Main->Buffer;
diff --git a/Alc/effects/echo.cpp b/Alc/effects/echo.cpp
index 197e9686..ad368b5b 100644
--- a/Alc/effects/echo.cpp
+++ b/Alc/effects/echo.cpp
@@ -115,7 +115,7 @@ void ALechoState::update(const ALCcontext *context, const ALeffectslot *slot, co
calc_rcpQ_from_slope(gainhf, 1.0f)
);
- ALfloat coeffs[2][MAX_AMBI_COEFFS];
+ ALfloat coeffs[2][MAX_AMBI_CHANNELS];
CalcAngleCoeffs(al::MathDefs<float>::Pi()*-0.5f*lrpan, 0.0f, spread, coeffs[0]);
CalcAngleCoeffs(al::MathDefs<float>::Pi()* 0.5f*lrpan, 0.0f, spread, coeffs[1]);
diff --git a/Alc/effects/fshifter.cpp b/Alc/effects/fshifter.cpp
index 55ff4247..5c808a4b 100644
--- a/Alc/effects/fshifter.cpp
+++ b/Alc/effects/fshifter.cpp
@@ -130,7 +130,7 @@ void ALfshifterState::update(const ALCcontext *context, const ALeffectslot *slot
break;
}
- ALfloat coeffs[MAX_AMBI_COEFFS];
+ ALfloat coeffs[MAX_AMBI_CHANNELS];
CalcAngleCoeffs(0.0f, 0.0f, 0.0f, coeffs);
mOutBuffer = target.Main->Buffer;
diff --git a/Alc/effects/pshifter.cpp b/Alc/effects/pshifter.cpp
index 9fe5f867..31d40abc 100644
--- a/Alc/effects/pshifter.cpp
+++ b/Alc/effects/pshifter.cpp
@@ -181,7 +181,7 @@ void ALpshifterState::update(const ALCcontext* UNUSED(context), const ALeffectsl
mPitchShiftI = fastf2i(pitch*FRACTIONONE);
mPitchShift = mPitchShiftI * (1.0f/FRACTIONONE);
- ALfloat coeffs[MAX_AMBI_COEFFS];
+ ALfloat coeffs[MAX_AMBI_CHANNELS];
CalcAngleCoeffs(0.0f, 0.0f, 0.0f, coeffs);
mOutBuffer = target.Main->Buffer;
diff --git a/Alc/hrtf.cpp b/Alc/hrtf.cpp
index b6b5ce43..a47c4d35 100644
--- a/Alc/hrtf.cpp
+++ b/Alc/hrtf.cpp
@@ -297,9 +297,9 @@ std::unique_ptr<DirectHrtfState> DirectHrtfState::Create(size_t num_chans)
return std::unique_ptr<DirectHrtfState>{new (ptr) DirectHrtfState{num_chans}};
}
-void BuildBFormatHrtf(const HrtfEntry *Hrtf, DirectHrtfState *state, const ALsizei NumChannels, const AngularPoint *AmbiPoints, const ALfloat (*RESTRICT AmbiMatrix)[MAX_AMBI_COEFFS], const ALsizei AmbiCount, const ALfloat *RESTRICT AmbiOrderHFGain)
+void BuildBFormatHrtf(const HrtfEntry *Hrtf, DirectHrtfState *state, const ALsizei NumChannels, const AngularPoint *AmbiPoints, const ALfloat (*RESTRICT AmbiMatrix)[MAX_AMBI_CHANNELS], const ALsizei AmbiCount, const ALfloat *RESTRICT AmbiOrderHFGain)
{
- static constexpr int OrderFromChan[MAX_AMBI_COEFFS]{
+ static constexpr int OrderFromChan[MAX_AMBI_CHANNELS]{
0, 1,1,1, 2,2,2,2,2, 3,3,3,3,3,3,3,
};
/* Set this to true for dual-band HRTF processing. May require better
diff --git a/Alc/hrtf.h b/Alc/hrtf.h
index 0f1270f0..c87210d4 100644
--- a/Alc/hrtf.h
+++ b/Alc/hrtf.h
@@ -109,6 +109,6 @@ void GetHrtfCoeffs(const HrtfEntry *Hrtf, ALfloat elevation, ALfloat azimuth, AL
* ordered and scaled according to the matrix input. Note the specified virtual
* positions should be in degrees, not radians!
*/
-void BuildBFormatHrtf(const HrtfEntry *Hrtf, DirectHrtfState *state, const ALsizei NumChannels, const AngularPoint *AmbiPoints, const ALfloat (*RESTRICT AmbiMatrix)[MAX_AMBI_COEFFS], const ALsizei AmbiCount, const ALfloat *RESTRICT AmbiOrderHFGain);
+void BuildBFormatHrtf(const HrtfEntry *Hrtf, DirectHrtfState *state, const ALsizei NumChannels, const AngularPoint *AmbiPoints, const ALfloat (*RESTRICT AmbiMatrix)[MAX_AMBI_CHANNELS], const ALsizei AmbiCount, const ALfloat *RESTRICT AmbiOrderHFGain);
#endif /* ALC_HRTF_H */
diff --git a/Alc/panning.cpp b/Alc/panning.cpp
index f8171235..01ac5ad7 100644
--- a/Alc/panning.cpp
+++ b/Alc/panning.cpp
@@ -42,13 +42,13 @@
#include "bs2b.h"
-constexpr std::array<float,MAX_AMBI_COEFFS> AmbiScale::FromN3D;
-constexpr std::array<float,MAX_AMBI_COEFFS> AmbiScale::FromSN3D;
-constexpr std::array<float,MAX_AMBI_COEFFS> AmbiScale::FromFuMa;
-constexpr std::array<int,MAX_AMBI_COEFFS> AmbiIndex::FromFuMa;
-constexpr std::array<int,MAX_AMBI_COEFFS> AmbiIndex::FromACN;
-constexpr std::array<int,MAX_AMBI2D_COEFFS> AmbiIndex::From2D;
-constexpr std::array<int,MAX_AMBI_COEFFS> AmbiIndex::From3D;
+constexpr std::array<float,MAX_AMBI_CHANNELS> AmbiScale::FromN3D;
+constexpr std::array<float,MAX_AMBI_CHANNELS> AmbiScale::FromSN3D;
+constexpr std::array<float,MAX_AMBI_CHANNELS> AmbiScale::FromFuMa;
+constexpr std::array<int,MAX_AMBI_CHANNELS> AmbiIndex::FromFuMa;
+constexpr std::array<int,MAX_AMBI_CHANNELS> AmbiIndex::FromACN;
+constexpr std::array<int,MAX_AMBI2D_CHANNELS> AmbiIndex::From2D;
+constexpr std::array<int,MAX_AMBI_CHANNELS> AmbiIndex::From3D;
namespace {
@@ -101,7 +101,7 @@ inline const char *GetLabelFromChannel(Channel channel)
struct ChannelMap {
Channel ChanName;
- ALfloat Config[MAX_AMBI2D_COEFFS];
+ ALfloat Config[MAX_AMBI2D_CHANNELS];
};
bool MakeSpeakerMap(ALCdevice *device, const AmbDecConf *conf, ALsizei (&speakermap)[MAX_OUTPUT_CHANNELS])
@@ -308,14 +308,14 @@ void InitDistanceComp(ALCdevice *device, const AmbDecConf *conf, const ALsizei (
}
-auto GetAmbiScales(AmbiNorm scaletype) noexcept -> const std::array<float,MAX_AMBI_COEFFS>&
+auto GetAmbiScales(AmbiNorm scaletype) noexcept -> const std::array<float,MAX_AMBI_CHANNELS>&
{
if(scaletype == AmbiNorm::FuMa) return AmbiScale::FromFuMa;
if(scaletype == AmbiNorm::SN3D) return AmbiScale::FromSN3D;
return AmbiScale::FromN3D;
}
-auto GetAmbiLayout(AmbiLayout layouttype) noexcept -> const std::array<int,MAX_AMBI_COEFFS>&
+auto GetAmbiLayout(AmbiLayout layouttype) noexcept -> const std::array<int,MAX_AMBI_CHANNELS>&
{
if(layouttype == AmbiLayout::FuMa) return AmbiIndex::FromFuMa;
return AmbiIndex::FromACN;
@@ -379,8 +379,8 @@ void InitPanning(ALCdevice *device)
if(device->FmtChans == DevFmtAmbi3D)
{
const char *devname{device->DeviceName.c_str()};
- const std::array<int,MAX_AMBI_COEFFS> &acnmap = GetAmbiLayout(device->mAmbiLayout);
- const std::array<float,MAX_AMBI_COEFFS> &n3dscale = GetAmbiScales(device->mAmbiScale);
+ const std::array<int,MAX_AMBI_CHANNELS> &acnmap = GetAmbiLayout(device->mAmbiLayout);
+ const std::array<float,MAX_AMBI_CHANNELS> &n3dscale = GetAmbiScales(device->mAmbiScale);
count = (device->mAmbiOrder == 3) ? 16 :
(device->mAmbiOrder == 2) ? 9 :
@@ -652,7 +652,7 @@ void InitHrtfPanning(ALCdevice *device)
{ -69.094843f, 180.000000f },
{ 69.094843f, 180.000000f },
};
- static constexpr ALfloat AmbiMatrix[][MAX_AMBI_COEFFS]{
+ static constexpr ALfloat AmbiMatrix[][MAX_AMBI_CHANNELS]{
{ 5.00000000e-02f, 5.00000000e-02f, 5.00000000e-02f, 5.00000000e-02f, 6.45497224e-02f, 6.45497224e-02f, 0.00000000e+00f, 6.45497224e-02f, 0.00000000e+00f, 1.48264644e-02f, 6.33865691e-02f, 1.01126676e-01f, -7.36485380e-02f, -1.09260065e-02f, 7.08683387e-02f, -1.01622099e-01f },
{ 5.00000000e-02f, -5.00000000e-02f, 5.00000000e-02f, 5.00000000e-02f, -6.45497224e-02f, -6.45497224e-02f, 0.00000000e+00f, 6.45497224e-02f, 0.00000000e+00f, -1.48264644e-02f, -6.33865691e-02f, -1.01126676e-01f, -7.36485380e-02f, -1.09260065e-02f, 7.08683387e-02f, -1.01622099e-01f },
{ 5.00000000e-02f, -5.00000000e-02f, 5.00000000e-02f, -5.00000000e-02f, 6.45497224e-02f, -6.45497224e-02f, 0.00000000e+00f, -6.45497224e-02f, 0.00000000e+00f, -1.48264644e-02f, 6.33865691e-02f, -1.01126676e-01f, -7.36485380e-02f, 1.09260065e-02f, 7.08683387e-02f, 1.01622099e-01f },
@@ -680,7 +680,7 @@ void InitHrtfPanning(ALCdevice *device)
2.35702260e+00f, 1.82574186e+00f, 9.42809042e-01f
/*1.86508671e+00f, 1.60609389e+00f, 1.14205530e+00f, 5.68379553e-01f*/
};
- static constexpr ALsizei IndexMap[MAX_AMBI_COEFFS]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
+ static constexpr ALsizei IndexMap[MAX_AMBI_CHANNELS]{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
static constexpr ALsizei ChansPerOrder[MAX_AMBI_ORDER+1]{ 1, 3, 5, 7 };
const ALfloat *AmbiOrderHFGain{AmbiOrderHFGainFOA};
@@ -755,7 +755,7 @@ void InitUhjPanning(ALCdevice *device)
void CalcAmbiCoeffs(const ALfloat y, const ALfloat z, const ALfloat x, const ALfloat spread,
- ALfloat (&coeffs)[MAX_AMBI_COEFFS])
+ ALfloat (&coeffs)[MAX_AMBI_CHANNELS])
{
/* Zeroth-order */
coeffs[0] = 1.0f; /* ACN 0 = 1 */
diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h
index d5cb513d..052302b8 100644
--- a/OpenAL32/Include/alu.h
+++ b/OpenAL32/Include/alu.h
@@ -369,7 +369,7 @@ void aluSelectPostProcess(ALCdevice *device);
* second, and third parameters respectively -- simply negate X and Z.
*/
void CalcAmbiCoeffs(const ALfloat y, const ALfloat z, const ALfloat x, const ALfloat spread,
- ALfloat (&coeffs)[MAX_AMBI_COEFFS]);
+ ALfloat (&coeffs)[MAX_AMBI_CHANNELS]);
/**
* CalcDirectionCoeffs
@@ -378,7 +378,7 @@ void CalcAmbiCoeffs(const ALfloat y, const ALfloat z, const ALfloat x, const ALf
* vector must be normalized (unit length), and the spread is the angular width
* of the sound (0...tau).
*/
-inline void CalcDirectionCoeffs(const ALfloat (&dir)[3], ALfloat spread, ALfloat (&coeffs)[MAX_AMBI_COEFFS])
+inline void CalcDirectionCoeffs(const ALfloat (&dir)[3], ALfloat spread, ALfloat (&coeffs)[MAX_AMBI_CHANNELS])
{
/* Convert from OpenAL coords to Ambisonics. */
CalcAmbiCoeffs(-dir[0], dir[1], -dir[2], spread, coeffs);
@@ -391,7 +391,7 @@ inline void CalcDirectionCoeffs(const ALfloat (&dir)[3], ALfloat spread, ALfloat
* azimuth and elevation parameters are in radians, going right and up
* respectively.
*/
-inline void CalcAngleCoeffs(ALfloat azimuth, ALfloat elevation, ALfloat spread, ALfloat (&coeffs)[MAX_AMBI_COEFFS])
+inline void CalcAngleCoeffs(ALfloat azimuth, ALfloat elevation, ALfloat spread, ALfloat (&coeffs)[MAX_AMBI_CHANNELS])
{
ALfloat x = -std::sin(azimuth) * std::cos(elevation);
ALfloat y = std::sin(elevation);