aboutsummaryrefslogtreecommitdiffstats
path: root/alc
diff options
context:
space:
mode:
Diffstat (limited to 'alc')
-rw-r--r--alc/alc.cpp6
-rw-r--r--alc/alcmain.h2
-rw-r--r--alc/alu.cpp24
-rw-r--r--alc/alu.h8
-rw-r--r--alc/ambdec.cpp2
-rw-r--r--alc/ambdec.h6
-rw-r--r--alc/ambidefs.h38
-rw-r--r--alc/bformatdec.cpp18
-rw-r--r--alc/bformatdec.h4
-rw-r--r--alc/effects/autowah.cpp4
-rw-r--r--alc/effects/compressor.cpp4
-rw-r--r--alc/effects/convolution.cpp8
-rw-r--r--alc/effects/equalizer.cpp4
-rw-r--r--alc/effects/modulator.cpp4
-rw-r--r--alc/effects/reverb.cpp6
-rw-r--r--alc/effects/vmorpher.cpp4
-rw-r--r--alc/hrtf.cpp4
-rw-r--r--alc/hrtf.h4
-rw-r--r--alc/panning.cpp76
-rw-r--r--alc/voice.cpp4
20 files changed, 116 insertions, 114 deletions
diff --git a/alc/alc.cpp b/alc/alc.cpp
index 00008a81..2e416d00 100644
--- a/alc/alc.cpp
+++ b/alc/alc.cpp
@@ -1775,7 +1775,7 @@ static ALCenum UpdateDeviceParams(ALCdevice *device, const int *attrList)
{
if(!optlayout || !optscale)
return ALC_INVALID_VALUE;
- if(aorder < 1 || aorder > MAX_AMBI_ORDER)
+ if(aorder < 1 || aorder > MaxAmbiOrder)
return ALC_INVALID_VALUE;
if((*optlayout == DevAmbiLayout::FuMa || *optscale == DevAmbiScaling::FuMa)
&& aorder > 3)
@@ -2890,7 +2890,7 @@ static size_t GetIntegerv(ALCdevice *device, ALCenum param, const al::span<int>
values[i++] = device->Limiter ? ALC_TRUE : ALC_FALSE;
values[i++] = ALC_MAX_AMBISONIC_ORDER_SOFT;
- values[i++] = MAX_AMBI_ORDER;
+ values[i++] = MaxAmbiOrder;
values[i++] = 0;
}
@@ -3023,7 +3023,7 @@ static size_t GetIntegerv(ALCdevice *device, ALCenum param, const al::span<int>
return 1;
case ALC_MAX_AMBISONIC_ORDER_SOFT:
- values[0] = MAX_AMBI_ORDER;
+ values[0] = MaxAmbiOrder;
return 1;
default:
diff --git a/alc/alcmain.h b/alc/alcmain.h
index 42808f26..68d0e31d 100644
--- a/alc/alcmain.h
+++ b/alc/alcmain.h
@@ -267,7 +267,7 @@ struct ALCdevice : public al::intrusive_ref<ALCdevice> {
/* The "dry" path corresponds to the main output. */
MixParams Dry;
- ALuint NumChannelsPerOrder[MAX_AMBI_ORDER+1]{};
+ ALuint NumChannelsPerOrder[MaxAmbiOrder+1]{};
/* "Real" output, which will be written to the device buffer. May alias the
* dry buffer.
diff --git a/alc/alu.cpp b/alc/alu.cpp
index 62938b2a..fe42b14b 100644
--- a/alc/alu.cpp
+++ b/alc/alu.cpp
@@ -347,20 +347,20 @@ inline ALuint dither_rng(ALuint *seed) noexcept
}
-auto GetAmbiScales(AmbiScaling scaletype) noexcept -> const std::array<float,MAX_AMBI_CHANNELS>&
+auto GetAmbiScales(AmbiScaling scaletype) noexcept -> const std::array<float,MaxAmbiChannels>&
{
if(scaletype == AmbiScaling::FuMa) return AmbiScale::FromFuMa;
if(scaletype == AmbiScaling::SN3D) return AmbiScale::FromSN3D;
return AmbiScale::FromN3D;
}
-auto GetAmbiLayout(AmbiLayout layouttype) noexcept -> const std::array<uint8_t,MAX_AMBI_CHANNELS>&
+auto GetAmbiLayout(AmbiLayout layouttype) noexcept -> const std::array<uint8_t,MaxAmbiChannels>&
{
if(layouttype == AmbiLayout::FuMa) return AmbiIndex::FromFuMa;
return AmbiIndex::FromACN;
}
-auto GetAmbi2DLayout(AmbiLayout layouttype) noexcept -> const std::array<uint8_t,MAX_AMBI2D_CHANNELS>&
+auto GetAmbi2DLayout(AmbiLayout layouttype) noexcept -> const std::array<uint8_t,MaxAmbi2DChannels>&
{
if(layouttype == AmbiLayout::FuMa) return AmbiIndex::FromFuMa2D;
return AmbiIndex::From2D;
@@ -590,14 +590,14 @@ const auto RotatorCoeffArray = RotatorCoeffs::ConcatArrays(RotatorCoeffs::GenCoe
* coefficients, this fills in the coefficients for the higher orders up to and
* including the given order. The matrix is in ACN layout.
*/
-void AmbiRotator(std::array<std::array<float,MAX_AMBI_CHANNELS>,MAX_AMBI_CHANNELS> &matrix,
+void AmbiRotator(std::array<std::array<float,MaxAmbiChannels>,MaxAmbiChannels> &matrix,
const int order)
{
/* Don't do anything for < 2nd order. */
if(order < 2) return;
auto P = [](const int i, const int l, const int a, const int n, const size_t last_band,
- const std::array<std::array<float,MAX_AMBI_CHANNELS>,MAX_AMBI_CHANNELS> &R)
+ const std::array<std::array<float,MaxAmbiChannels>,MaxAmbiChannels> &R)
{
const float ri1{ R[static_cast<ALuint>(i+2)][ 1+2]};
const float rim1{R[static_cast<ALuint>(i+2)][-1+2]};
@@ -612,12 +612,12 @@ void AmbiRotator(std::array<std::array<float,MAX_AMBI_CHANNELS>,MAX_AMBI_CHANNEL
};
auto U = [P](const int l, const int m, const int n, const size_t last_band,
- const std::array<std::array<float,MAX_AMBI_CHANNELS>,MAX_AMBI_CHANNELS> &R)
+ const std::array<std::array<float,MaxAmbiChannels>,MaxAmbiChannels> &R)
{
return P(0, l, m, n, last_band, R);
};
auto V = [P](const int l, const int m, const int n, const size_t last_band,
- const std::array<std::array<float,MAX_AMBI_CHANNELS>,MAX_AMBI_CHANNELS> &R)
+ const std::array<std::array<float,MaxAmbiChannels>,MaxAmbiChannels> &R)
{
if(m > 0)
{
@@ -632,7 +632,7 @@ void AmbiRotator(std::array<std::array<float,MAX_AMBI_CHANNELS>,MAX_AMBI_CHANNEL
return d ? p1*std::sqrt(2.0f) : (p0 + p1);
};
auto W = [P](const int l, const int m, const int n, const size_t last_band,
- const std::array<std::array<float,MAX_AMBI_CHANNELS>,MAX_AMBI_CHANNELS> &R)
+ const std::array<std::array<float,MaxAmbiChannels>,MaxAmbiChannels> &R)
{
assert(m != 0);
if(m > 0)
@@ -893,7 +893,7 @@ void CalcPanningAndFilters(Voice *voice, const float xpos, const float ypos, con
* order elements, then construct the rotation for the higher
* orders.
*/
- std::array<std::array<float,MAX_AMBI_CHANNELS>,MAX_AMBI_CHANNELS> shrot{};
+ std::array<std::array<float,MaxAmbiChannels>,MaxAmbiChannels> shrot{};
shrot[0][0] = 1.0f;
shrot[1][1] = U[0]; shrot[1][2] = -V[0]; shrot[1][3] = -N[0];
shrot[2][1] = -U[1]; shrot[2][2] = V[1]; shrot[2][3] = N[1];
@@ -907,8 +907,8 @@ void CalcPanningAndFilters(Voice *voice, const float xpos, const float ypos, con
GetAmbi2DLayout(voice->mAmbiLayout).data() :
GetAmbiLayout(voice->mAmbiLayout).data()};
- static const uint8_t ChansPerOrder[MAX_AMBI_ORDER+1]{1, 3, 5, 7,};
- static const uint8_t OrderOffset[MAX_AMBI_ORDER+1]{0, 1, 4, 9,};
+ static const uint8_t ChansPerOrder[MaxAmbiOrder+1]{1, 3, 5, 7,};
+ static const uint8_t OrderOffset[MaxAmbiOrder+1]{0, 1, 4, 9,};
for(size_t c{1};c < num_channels;c++)
{
const size_t acn{index_map[c]};
@@ -918,7 +918,7 @@ void CalcPanningAndFilters(Voice *voice, const float xpos, const float ypos, con
const float scale{scales[acn] * coverage};
auto in = shrot.cbegin() + offset;
- coeffs = std::array<float,MAX_AMBI_CHANNELS>{};
+ coeffs = std::array<float,MaxAmbiChannels>{};
for(size_t x{0};x < tocopy;++x)
coeffs[offset+x] = in[x][acn] * scale;
diff --git a/alc/alu.h b/alc/alu.h
index 7e7f8996..fd1d0b37 100644
--- a/alc/alu.h
+++ b/alc/alu.h
@@ -72,7 +72,7 @@ void aluInitEffectPanning(ALeffectslot *slot, ALCcontext *context);
* The components are ordered such that OpenAL's X, Y, and Z are the first,
* second, and third parameters respectively -- simply negate X and Z.
*/
-std::array<float,MAX_AMBI_CHANNELS> CalcAmbiCoeffs(const float y, const float z, const float x,
+std::array<float,MaxAmbiChannels> CalcAmbiCoeffs(const float y, const float z, const float x,
const float spread);
/**
@@ -82,7 +82,7 @@ std::array<float,MAX_AMBI_CHANNELS> CalcAmbiCoeffs(const float y, const float z,
* vector must be normalized (unit length), and the spread is the angular width
* of the sound (0...tau).
*/
-inline std::array<float,MAX_AMBI_CHANNELS> CalcDirectionCoeffs(const float (&dir)[3],
+inline std::array<float,MaxAmbiChannels> CalcDirectionCoeffs(const float (&dir)[3],
const float spread)
{
/* Convert from OpenAL coords to Ambisonics. */
@@ -96,7 +96,7 @@ inline std::array<float,MAX_AMBI_CHANNELS> CalcDirectionCoeffs(const float (&dir
* azimuth and elevation parameters are in radians, going right and up
* respectively.
*/
-inline std::array<float,MAX_AMBI_CHANNELS> CalcAngleCoeffs(const float azimuth,
+inline std::array<float,MaxAmbiChannels> CalcAngleCoeffs(const float azimuth,
const float elevation, const float spread)
{
const float x{-std::sin(azimuth) * std::cos(elevation)};
@@ -125,7 +125,7 @@ auto SetAmbiPanIdentity(T iter, I count, F func) -> std::enable_if_t<std::is_int
{
if(count < 1) return;
- std::array<float,MAX_AMBI_CHANNELS> coeffs{{1.0f}};
+ std::array<float,MaxAmbiChannels> coeffs{{1.0f}};
func(*iter, coeffs);
++iter;
for(I i{1};i < count;++i,++iter)
diff --git a/alc/ambdec.cpp b/alc/ambdec.cpp
index adf116fe..eaeb9086 100644
--- a/alc/ambdec.cpp
+++ b/alc/ambdec.cpp
@@ -118,7 +118,7 @@ bool load_ambdec_speakers(al::vector<AmbDecConf::SpeakerConf> &spkrs, const std:
return true;
}
-bool load_ambdec_matrix(float (&gains)[MAX_AMBI_ORDER+1], al::vector<AmbDecConf::CoeffArray> &matrix, const std::size_t maxrow, std::istream &f, std::string &buffer)
+bool load_ambdec_matrix(float (&gains)[MaxAmbiOrder+1], al::vector<AmbDecConf::CoeffArray> &matrix, const std::size_t maxrow, std::istream &f, std::string &buffer)
{
bool gotgains{false};
std::size_t cur{0u};
diff --git a/alc/ambdec.h b/alc/ambdec.h
index ff7b71ee..db662a76 100644
--- a/alc/ambdec.h
+++ b/alc/ambdec.h
@@ -34,12 +34,12 @@ struct AmbDecConf {
};
al::vector<SpeakerConf> Speakers;
- using CoeffArray = std::array<float,MAX_AMBI_CHANNELS>;
+ using CoeffArray = std::array<float,MaxAmbiChannels>;
/* Unused when FreqBands == 1 */
- float LFOrderGain[MAX_AMBI_ORDER+1]{};
+ float LFOrderGain[MaxAmbiOrder+1]{};
al::vector<CoeffArray> LFMatrix;
- float HFOrderGain[MAX_AMBI_ORDER+1]{};
+ float HFOrderGain[MaxAmbiOrder+1]{};
al::vector<CoeffArray> HFMatrix;
int load(const char *fname) noexcept;
diff --git a/alc/ambidefs.h b/alc/ambidefs.h
index 79c0f1cf..339b51f9 100644
--- a/alc/ambidefs.h
+++ b/alc/ambidefs.h
@@ -5,30 +5,32 @@
#include <stddef.h>
#include <stdint.h>
+using uint = unsigned int;
+
/* 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
+constexpr uint8_t MaxAmbiOrder{3};
constexpr inline size_t AmbiChannelsFromOrder(size_t order) noexcept
{ return (order+1) * (order+1); }
-#define MAX_AMBI_CHANNELS AmbiChannelsFromOrder(MAX_AMBI_ORDER)
+constexpr size_t MaxAmbiChannels{AmbiChannelsFromOrder(MaxAmbiOrder)};
/* 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
* 64-bit mask could handle up to 7th order).
*/
-#define AMBI_0ORDER_MASK 0x00000001
-#define AMBI_1ORDER_MASK 0x0000000f
-#define AMBI_2ORDER_MASK 0x000001ff
-#define AMBI_3ORDER_MASK 0x0000ffff
-#define AMBI_4ORDER_MASK 0x01ffffff
+constexpr uint Ambi0OrderMask{0x00000001};
+constexpr uint Ambi1OrderMask{0x0000000f};
+constexpr uint Ambi2OrderMask{0x000001ff};
+constexpr uint Ambi3OrderMask{0x0000ffff};
+constexpr uint Ambi4OrderMask{0x01ffffff};
/* 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 is ACN ordering, with bit 0 being ACN 0, etc.
*/
-#define AMBI_PERIPHONIC_MASK 0xfe7ce4
+constexpr uint AmbiPeriphonicMask{0xfe7ce4};
/* The maximum number of ambisonic channels for 2D (non-periphonic)
* representation. This is 2 per each order above zero-order, plus 1 for zero-
@@ -36,18 +38,18 @@ constexpr inline size_t AmbiChannelsFromOrder(size_t order) noexcept
*/
constexpr inline size_t Ambi2DChannelsFromOrder(size_t order) noexcept
{ return order*2 + 1; }
-#define MAX_AMBI2D_CHANNELS Ambi2DChannelsFromOrder(MAX_AMBI_ORDER)
+constexpr size_t MaxAmbi2DChannels{Ambi2DChannelsFromOrder(MaxAmbiOrder)};
/* 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_CHANNELS> FromN3D{{
+ static constexpr std::array<float,MaxAmbiChannels> 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_CHANNELS> FromSN3D{{
+ static constexpr std::array<float,MaxAmbiChannels> FromSN3D{{
1.000000000f, /* ACN 0, sqrt(1) */
1.732050808f, /* ACN 1, sqrt(3) */
1.732050808f, /* ACN 2, sqrt(3) */
@@ -65,7 +67,7 @@ struct AmbiScale {
2.645751311f, /* ACN 14, sqrt(7) */
2.645751311f, /* ACN 15, sqrt(7) */
}};
- static constexpr std::array<float,MAX_AMBI_CHANNELS> FromFuMa{{
+ static constexpr std::array<float,MaxAmbiChannels> FromFuMa{{
1.414213562f, /* ACN 0 (W), sqrt(2) */
1.732050808f, /* ACN 1 (Y), sqrt(3) */
1.732050808f, /* ACN 2 (Z), sqrt(3) */
@@ -86,7 +88,7 @@ struct AmbiScale {
};
struct AmbiIndex {
- static constexpr std::array<uint8_t,MAX_AMBI_CHANNELS> FromFuMa{{
+ static constexpr std::array<uint8_t,MaxAmbiChannels> FromFuMa{{
0, /* W */
3, /* X */
1, /* Y */
@@ -104,7 +106,7 @@ struct AmbiIndex {
15, /* P */
9, /* Q */
}};
- static constexpr std::array<uint8_t,MAX_AMBI2D_CHANNELS> FromFuMa2D{{
+ static constexpr std::array<uint8_t,MaxAmbi2DChannels> FromFuMa2D{{
0, /* W */
3, /* X */
1, /* Y */
@@ -114,18 +116,18 @@ struct AmbiIndex {
9, /* Q */
}};
- static constexpr std::array<uint8_t,MAX_AMBI_CHANNELS> FromACN{{
+ static constexpr std::array<uint8_t,MaxAmbiChannels> FromACN{{
0, 1, 2, 3, 4, 5, 6, 7,
8, 9, 10, 11, 12, 13, 14, 15
}};
- static constexpr std::array<uint8_t,MAX_AMBI2D_CHANNELS> From2D{{
+ static constexpr std::array<uint8_t,MaxAmbi2DChannels> From2D{{
0, 1,3, 4,8, 9,15
}};
- static constexpr std::array<uint8_t,MAX_AMBI_CHANNELS> OrderFromChannel{{
+ static constexpr std::array<uint8_t,MaxAmbiChannels> OrderFromChannel{{
0, 1,1,1, 2,2,2,2,2, 3,3,3,3,3,3,3,
}};
- static constexpr std::array<uint8_t,MAX_AMBI2D_CHANNELS> OrderFrom2DChannel{{
+ static constexpr std::array<uint8_t,MaxAmbi2DChannels> OrderFrom2DChannel{{
0, 1,1, 2,2, 3,3,
}};
};
diff --git a/alc/bformatdec.cpp b/alc/bformatdec.cpp
index 6f229947..c47a042f 100644
--- a/alc/bformatdec.cpp
+++ b/alc/bformatdec.cpp
@@ -21,17 +21,17 @@
namespace {
-constexpr std::array<float,MAX_AMBI_ORDER+1> Ambi3DDecoderHFScale{{
+constexpr std::array<float,MaxAmbiOrder+1> Ambi3DDecoderHFScale{{
1.00000000e+00f, 1.00000000e+00f
}};
-constexpr std::array<float,MAX_AMBI_ORDER+1> Ambi3DDecoderHFScale2O{{
+constexpr std::array<float,MaxAmbiOrder+1> Ambi3DDecoderHFScale2O{{
7.45355990e-01f, 1.00000000e+00f, 1.00000000e+00f
}};
-constexpr std::array<float,MAX_AMBI_ORDER+1> Ambi3DDecoderHFScale3O{{
+constexpr std::array<float,MaxAmbiOrder+1> Ambi3DDecoderHFScale3O{{
5.89792205e-01f, 8.79693856e-01f, 1.00000000e+00f, 1.00000000e+00f
}};
-inline auto GetDecoderHFScales(uint order) noexcept -> const std::array<float,MAX_AMBI_ORDER+1>&
+inline auto GetDecoderHFScales(uint order) noexcept -> const std::array<float,MaxAmbiOrder+1>&
{
if(order >= 3) return Ambi3DDecoderHFScale3O;
if(order == 2) return Ambi3DDecoderHFScale2O;
@@ -39,7 +39,7 @@ inline auto GetDecoderHFScales(uint order) noexcept -> const std::array<float,MA
}
inline auto GetAmbiScales(AmbDecScale scaletype) noexcept
- -> const std::array<float,MAX_AMBI_CHANNELS>&
+ -> const std::array<float,MaxAmbiChannels>&
{
if(scaletype == AmbDecScale::FuMa) return AmbiScale::FromFuMa;
if(scaletype == AmbDecScale::SN3D) return AmbiScale::FromSN3D;
@@ -55,8 +55,8 @@ BFormatDec::BFormatDec(const AmbDecConf *conf, const bool allow_2band, const siz
: mStablizer{std::move(stablizer)}, mDualBand{allow_2band && (conf->FreqBands == 2)}
, mChannelDec{inchans}
{
- const bool periphonic{(conf->ChanMask&AMBI_PERIPHONIC_MASK) != 0};
- const std::array<float,MAX_AMBI_CHANNELS> &coeff_scale = GetAmbiScales(conf->CoeffScale);
+ const bool periphonic{(conf->ChanMask&AmbiPeriphonicMask) != 0};
+ const std::array<float,MaxAmbiChannels> &coeff_scale = GetAmbiScales(conf->CoeffScale);
if(!mDualBand)
{
@@ -268,9 +268,9 @@ void BFormatDec::processStablize(const al::span<FloatBufferLine> OutBuffer,
auto BFormatDec::GetHFOrderScales(const uint in_order, const uint out_order) noexcept
- -> std::array<float,MAX_AMBI_ORDER+1>
+ -> std::array<float,MaxAmbiOrder+1>
{
- std::array<float,MAX_AMBI_ORDER+1> ret{};
+ std::array<float,MaxAmbiOrder+1> ret{};
assert(out_order >= in_order);
diff --git a/alc/bformatdec.h b/alc/bformatdec.h
index adc69dc3..d9cddf51 100644
--- a/alc/bformatdec.h
+++ b/alc/bformatdec.h
@@ -16,7 +16,7 @@ struct AmbDecConf;
struct FrontStablizer;
-using ChannelDec = std::array<float,MAX_AMBI_CHANNELS>;
+using ChannelDec = std::array<float,MaxAmbiChannels>;
class BFormatDec {
static constexpr size_t sHFBand{0};
@@ -59,7 +59,7 @@ public:
const size_t SamplesToDo);
/* Retrieves per-order HF scaling factors for "upsampling" ambisonic data. */
- static std::array<float,MAX_AMBI_ORDER+1> GetHFOrderScales(const uint in_order,
+ static std::array<float,MaxAmbiOrder+1> GetHFOrderScales(const uint in_order,
const uint out_order) noexcept;
static std::unique_ptr<BFormatDec> Create(const AmbDecConf *conf, const bool allow_2band,
diff --git a/alc/effects/autowah.cpp b/alc/effects/autowah.cpp
index f2ffab44..4e089a80 100644
--- a/alc/effects/autowah.cpp
+++ b/alc/effects/autowah.cpp
@@ -63,7 +63,7 @@ struct AutowahState final : public EffectState {
/* Effect gains for each output channel */
float CurrentGains[MAX_OUTPUT_CHANNELS];
float TargetGains[MAX_OUTPUT_CHANNELS];
- } mChans[MAX_AMBI_CHANNELS];
+ } mChans[MaxAmbiChannels];
/* Effects buffers */
alignas(16) float mBufferOut[BufferLineSize];
@@ -121,7 +121,7 @@ void AutowahState::update(const ALCcontext *context, const EffectSlot *slot,
mBandwidthNorm = (MAX_FREQ-MIN_FREQ) / frequency;
mOutTarget = target.Main->Buffer;
- auto set_gains = [slot,target](auto &chan, al::span<const float,MAX_AMBI_CHANNELS> coeffs)
+ auto set_gains = [slot,target](auto &chan, al::span<const float,MaxAmbiChannels> coeffs)
{ ComputePanGains(target.Main, coeffs.data(), slot->Gain, chan.TargetGains); };
SetAmbiPanIdentity(std::begin(mChans), slot->Wet.Buffer.size(), set_gains);
}
diff --git a/alc/effects/compressor.cpp b/alc/effects/compressor.cpp
index f1fe6f36..00ccb59c 100644
--- a/alc/effects/compressor.cpp
+++ b/alc/effects/compressor.cpp
@@ -40,7 +40,7 @@ namespace {
struct CompressorState final : public EffectState {
/* Effect gains for each channel */
- float mGain[MAX_AMBI_CHANNELS][MAX_OUTPUT_CHANNELS]{};
+ float mGain[MaxAmbiChannels][MAX_OUTPUT_CHANNELS]{};
/* Effect parameters */
bool mEnabled{true};
@@ -79,7 +79,7 @@ void CompressorState::update(const ALCcontext*, const EffectSlot *slot,
mEnabled = props->Compressor.OnOff;
mOutTarget = target.Main->Buffer;
- auto set_gains = [slot,target](auto &gains, al::span<const float,MAX_AMBI_CHANNELS> coeffs)
+ auto set_gains = [slot,target](auto &gains, al::span<const float,MaxAmbiChannels> coeffs)
{ ComputePanGains(target.Main, coeffs.data(), slot->Gain, gains); };
SetAmbiPanIdentity(std::begin(mGain), slot->Wet.Buffer.size(), set_gains);
}
diff --git a/alc/effects/convolution.cpp b/alc/effects/convolution.cpp
index 2442f97e..733a0a27 100644
--- a/alc/effects/convolution.cpp
+++ b/alc/effects/convolution.cpp
@@ -74,20 +74,20 @@ void LoadSamples(double *RESTRICT dst, const al::byte *src, const size_t srcstep
}
-auto GetAmbiScales(AmbiScaling scaletype) noexcept -> const std::array<float,MAX_AMBI_CHANNELS>&
+auto GetAmbiScales(AmbiScaling scaletype) noexcept -> const std::array<float,MaxAmbiChannels>&
{
if(scaletype == AmbiScaling::FuMa) return AmbiScale::FromFuMa;
if(scaletype == AmbiScaling::SN3D) return AmbiScale::FromSN3D;
return AmbiScale::FromN3D;
}
-auto GetAmbiLayout(AmbiLayout layouttype) noexcept -> const std::array<uint8_t,MAX_AMBI_CHANNELS>&
+auto GetAmbiLayout(AmbiLayout layouttype) noexcept -> const std::array<uint8_t,MaxAmbiChannels>&
{
if(layouttype == AmbiLayout::FuMa) return AmbiIndex::FromFuMa;
return AmbiIndex::FromACN;
}
-auto GetAmbi2DLayout(AmbiLayout layouttype) noexcept -> const std::array<uint8_t,MAX_AMBI2D_CHANNELS>&
+auto GetAmbi2DLayout(AmbiLayout layouttype) noexcept -> const std::array<uint8_t,MaxAmbi2DChannels>&
{
if(layouttype == AmbiLayout::FuMa) return AmbiIndex::FromFuMa2D;
return AmbiIndex::From2D;
@@ -382,7 +382,7 @@ void ConvolutionState::update(const ALCcontext *context, const EffectSlot *slot,
GetAmbi2DLayout(mAmbiLayout).data() :
GetAmbiLayout(mAmbiLayout).data()};
- std::array<float,MAX_AMBI_CHANNELS> coeffs{};
+ std::array<float,MaxAmbiChannels> coeffs{};
for(size_t c{0u};c < mChans->size();++c)
{
const size_t acn{index_map[c]};
diff --git a/alc/effects/equalizer.cpp b/alc/effects/equalizer.cpp
index c311a941..e4544e49 100644
--- a/alc/effects/equalizer.cpp
+++ b/alc/effects/equalizer.cpp
@@ -85,7 +85,7 @@ struct EqualizerState final : public EffectState {
/* Effect gains for each channel */
float CurrentGains[MAX_OUTPUT_CHANNELS]{};
float TargetGains[MAX_OUTPUT_CHANNELS]{};
- } mChans[MAX_AMBI_CHANNELS];
+ } mChans[MaxAmbiChannels];
FloatBufferLine mSampleBuffer{};
@@ -149,7 +149,7 @@ void EqualizerState::update(const ALCcontext *context, const EffectSlot *slot,
}
mOutTarget = target.Main->Buffer;
- auto set_gains = [slot,target](auto &chan, al::span<const float,MAX_AMBI_CHANNELS> coeffs)
+ auto set_gains = [slot,target](auto &chan, al::span<const float,MaxAmbiChannels> coeffs)
{ ComputePanGains(target.Main, coeffs.data(), slot->Gain, chan.TargetGains); };
SetAmbiPanIdentity(std::begin(mChans), slot->Wet.Buffer.size(), set_gains);
}
diff --git a/alc/effects/modulator.cpp b/alc/effects/modulator.cpp
index a0af9890..56394566 100644
--- a/alc/effects/modulator.cpp
+++ b/alc/effects/modulator.cpp
@@ -78,7 +78,7 @@ struct ModulatorState final : public EffectState {
float CurrentGains[MAX_OUTPUT_CHANNELS]{};
float TargetGains[MAX_OUTPUT_CHANNELS]{};
- } mChans[MAX_AMBI_CHANNELS];
+ } mChans[MaxAmbiChannels];
void deviceUpdate(const ALCdevice *device) override;
@@ -124,7 +124,7 @@ void ModulatorState::update(const ALCcontext *context, const EffectSlot *slot,
mChans[i].Filter.copyParamsFrom(mChans[0].Filter);
mOutTarget = target.Main->Buffer;
- auto set_gains = [slot,target](auto &chan, al::span<const float,MAX_AMBI_CHANNELS> coeffs)
+ auto set_gains = [slot,target](auto &chan, al::span<const float,MaxAmbiChannels> coeffs)
{ ComputePanGains(target.Main, coeffs.data(), slot->Gain, chan.TargetGains); };
SetAmbiPanIdentity(std::begin(mChans), slot->Wet.Buffer.size(), set_gains);
}
diff --git a/alc/effects/reverb.cpp b/alc/effects/reverb.cpp
index a4b423c7..3e643969 100644
--- a/alc/effects/reverb.cpp
+++ b/alc/effects/reverb.cpp
@@ -435,7 +435,7 @@ struct ReverbState final : public EffectState {
const size_t counter, const size_t offset, const size_t todo);
MixOutT mMixOut{&ReverbState::MixOutPlain};
- std::array<float,MAX_AMBI_ORDER+1> mOrderScales{};
+ std::array<float,MaxAmbiOrder+1> mOrderScales{};
std::array<std::array<BandSplitter,NUM_LINES>,2> mAmbiSplitter;
@@ -973,13 +973,13 @@ void ReverbState::update3DPanning(const float *ReflectionsPan, const float *Late
mOutTarget = target.Main->Buffer;
for(size_t i{0u};i < NUM_LINES;i++)
{
- const float coeffs[MAX_AMBI_CHANNELS]{earlymat[0][i], earlymat[1][i], earlymat[2][i],
+ const float coeffs[MaxAmbiChannels]{earlymat[0][i], earlymat[1][i], earlymat[2][i],
earlymat[3][i]};
ComputePanGains(target.Main, coeffs, earlyGain, mEarly.PanGain[i]);
}
for(size_t i{0u};i < NUM_LINES;i++)
{
- const float coeffs[MAX_AMBI_CHANNELS]{latemat[0][i], latemat[1][i], latemat[2][i],
+ const float coeffs[MaxAmbiChannels]{latemat[0][i], latemat[1][i], latemat[2][i],
latemat[3][i]};
ComputePanGains(target.Main, coeffs, lateGain, mLate.PanGain[i]);
}
diff --git a/alc/effects/vmorpher.cpp b/alc/effects/vmorpher.cpp
index 2adcab56..d8c71d16 100644
--- a/alc/effects/vmorpher.cpp
+++ b/alc/effects/vmorpher.cpp
@@ -124,7 +124,7 @@ struct VmorpherState final : public EffectState {
/* Effect gains for each channel */
float CurrentGains[MAX_OUTPUT_CHANNELS]{};
float TargetGains[MAX_OUTPUT_CHANNELS]{};
- } mChans[MAX_AMBI_CHANNELS];
+ } mChans[MaxAmbiChannels];
void (*mGetSamples)(float*RESTRICT, ALuint, const ALuint, size_t){};
@@ -241,7 +241,7 @@ void VmorpherState::update(const ALCcontext *context, const EffectSlot *slot,
}
mOutTarget = target.Main->Buffer;
- auto set_gains = [slot,target](auto &chan, al::span<const float,MAX_AMBI_CHANNELS> coeffs)
+ auto set_gains = [slot,target](auto &chan, al::span<const float,MaxAmbiChannels> coeffs)
{ ComputePanGains(target.Main, coeffs.data(), slot->Gain, chan.TargetGains); };
SetAmbiPanIdentity(std::begin(mChans), slot->Wet.Buffer.size(), set_gains);
}
diff --git a/alc/hrtf.cpp b/alc/hrtf.cpp
index 01dc342f..5f812318 100644
--- a/alc/hrtf.cpp
+++ b/alc/hrtf.cpp
@@ -278,8 +278,8 @@ std::unique_ptr<DirectHrtfState> DirectHrtfState::Create(size_t num_chans)
{ return std::unique_ptr<DirectHrtfState>{new(FamCount(num_chans)) DirectHrtfState{num_chans}}; }
void DirectHrtfState::build(const HrtfStore *Hrtf, const al::span<const AngularPoint> AmbiPoints,
- const float (*AmbiMatrix)[MAX_AMBI_CHANNELS],
- const al::span<const float,MAX_AMBI_ORDER+1> AmbiOrderHFGain)
+ const float (*AmbiMatrix)[MaxAmbiChannels],
+ const al::span<const float,MaxAmbiOrder+1> AmbiOrderHFGain)
{
using double2 = std::array<double,2>;
struct ImpulseResponse {
diff --git a/alc/hrtf.h b/alc/hrtf.h
index c26947de..33a6021f 100644
--- a/alc/hrtf.h
+++ b/alc/hrtf.h
@@ -102,8 +102,8 @@ struct DirectHrtfState {
* are ordered and scaled according to the matrix input.
*/
void build(const HrtfStore *Hrtf, const al::span<const AngularPoint> AmbiPoints,
- const float (*AmbiMatrix)[MAX_AMBI_CHANNELS],
- const al::span<const float,MAX_AMBI_ORDER+1> AmbiOrderHFGain);
+ const float (*AmbiMatrix)[MaxAmbiChannels],
+ const al::span<const float,MaxAmbiOrder+1> AmbiOrderHFGain);
static std::unique_ptr<DirectHrtfState> Create(size_t num_chans);
diff --git a/alc/panning.cpp b/alc/panning.cpp
index bfc640c0..24a303e5 100644
--- a/alc/panning.cpp
+++ b/alc/panning.cpp
@@ -60,15 +60,15 @@
#include "opthelpers.h"
-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<uint8_t,MAX_AMBI_CHANNELS> AmbiIndex::FromFuMa;
-constexpr std::array<uint8_t,MAX_AMBI2D_CHANNELS> AmbiIndex::FromFuMa2D;
-constexpr std::array<uint8_t,MAX_AMBI_CHANNELS> AmbiIndex::FromACN;
-constexpr std::array<uint8_t,MAX_AMBI2D_CHANNELS> AmbiIndex::From2D;
-constexpr std::array<uint8_t,MAX_AMBI_CHANNELS> AmbiIndex::OrderFromChannel;
-constexpr std::array<uint8_t,MAX_AMBI2D_CHANNELS> AmbiIndex::OrderFrom2DChannel;
+constexpr std::array<float,MaxAmbiChannels> AmbiScale::FromN3D;
+constexpr std::array<float,MaxAmbiChannels> AmbiScale::FromSN3D;
+constexpr std::array<float,MaxAmbiChannels> AmbiScale::FromFuMa;
+constexpr std::array<uint8_t,MaxAmbiChannels> AmbiIndex::FromFuMa;
+constexpr std::array<uint8_t,MaxAmbi2DChannels> AmbiIndex::FromFuMa2D;
+constexpr std::array<uint8_t,MaxAmbiChannels> AmbiIndex::FromACN;
+constexpr std::array<uint8_t,MaxAmbi2DChannels> AmbiIndex::From2D;
+constexpr std::array<uint8_t,MaxAmbiChannels> AmbiIndex::OrderFromChannel;
+constexpr std::array<uint8_t,MaxAmbi2DChannels> AmbiIndex::OrderFrom2DChannel;
namespace {
@@ -145,7 +145,7 @@ void AllocChannels(ALCdevice *device, const size_t main_chans, const size_t real
struct ChannelMap {
Channel ChanName;
- float Config[MAX_AMBI2D_CHANNELS];
+ float Config[MaxAmbi2DChannels];
};
bool MakeSpeakerMap(ALCdevice *device, const AmbDecConf *conf, ALuint (&speakermap)[MAX_OUTPUT_CHANNELS])
@@ -228,8 +228,8 @@ bool MakeSpeakerMap(ALCdevice *device, const AmbDecConf *conf, ALuint (&speakerm
void InitNearFieldCtrl(ALCdevice *device, float ctrl_dist, ALuint order, bool is3d)
{
- static const ALuint chans_per_order2d[MAX_AMBI_ORDER+1]{ 1, 2, 2, 2 };
- static const ALuint chans_per_order3d[MAX_AMBI_ORDER+1]{ 1, 3, 5, 7 };
+ static const ALuint chans_per_order2d[MaxAmbiOrder+1]{ 1, 2, 2, 2 };
+ static const ALuint chans_per_order3d[MaxAmbiOrder+1]{ 1, 3, 5, 7 };
/* NFC is only used when AvgSpeakerDist is greater than 0. */
const char *devname{device->DeviceName.c_str()};
@@ -304,21 +304,21 @@ void InitDistanceComp(ALCdevice *device, const AmbDecConf *conf,
}
-auto GetAmbiScales(DevAmbiScaling scaletype) noexcept -> const std::array<float,MAX_AMBI_CHANNELS>&
+auto GetAmbiScales(DevAmbiScaling scaletype) noexcept -> const std::array<float,MaxAmbiChannels>&
{
if(scaletype == DevAmbiScaling::FuMa) return AmbiScale::FromFuMa;
if(scaletype == DevAmbiScaling::SN3D) return AmbiScale::FromSN3D;
return AmbiScale::FromN3D;
}
-auto GetAmbiLayout(DevAmbiLayout layouttype) noexcept -> const std::array<uint8_t,MAX_AMBI_CHANNELS>&
+auto GetAmbiLayout(DevAmbiLayout layouttype) noexcept -> const std::array<uint8_t,MaxAmbiChannels>&
{
if(layouttype == DevAmbiLayout::FuMa) return AmbiIndex::FromFuMa;
return AmbiIndex::FromACN;
}
-using ChannelCoeffs = std::array<float,MAX_AMBI2D_CHANNELS>;
+using ChannelCoeffs = std::array<float,MaxAmbi2DChannels>;
enum DecoderMode : bool {
SingleBand = false,
DualBand = true
@@ -331,7 +331,7 @@ template<size_t N>
struct DecoderConfig<SingleBand, N> {
ALuint mOrder;
std::array<Channel,N> mChannels;
- std::array<float,MAX_AMBI_ORDER+1> mOrderGain;
+ std::array<float,MaxAmbiOrder+1> mOrderGain;
std::array<ChannelCoeffs,N> mCoeffs;
};
@@ -339,9 +339,9 @@ template<size_t N>
struct DecoderConfig<DualBand, N> {
ALuint mOrder;
std::array<Channel,N> mChannels;
- std::array<float,MAX_AMBI_ORDER+1> mOrderGain;
+ std::array<float,MaxAmbiOrder+1> mOrderGain;
std::array<ChannelCoeffs,N> mCoeffs;
- std::array<float,MAX_AMBI_ORDER+1> mOrderGainLF;
+ std::array<float,MaxAmbiOrder+1> mOrderGainLF;
std::array<ChannelCoeffs,N> mCoeffsLF;
};
@@ -496,8 +496,8 @@ void InitPanning(ALCdevice *device, const bool hqdec=false, const bool stablize=
if(device->FmtChans == DevFmtAmbi3D)
{
const char *devname{device->DeviceName.c_str()};
- const std::array<uint8_t,MAX_AMBI_CHANNELS> &acnmap = GetAmbiLayout(device->mAmbiLayout);
- const std::array<float,MAX_AMBI_CHANNELS> &n3dscale = GetAmbiScales(device->mAmbiScale);
+ const std::array<uint8_t,MaxAmbiChannels> &acnmap = GetAmbiLayout(device->mAmbiLayout);
+ const std::array<float,MaxAmbiChannels> &n3dscale = GetAmbiScales(device->mAmbiScale);
/* For DevFmtAmbi3D, the ambisonic order is already set. */
const size_t count{AmbiChannelsFromOrder(device->mAmbiOrder)};
@@ -527,7 +527,7 @@ void InitPanning(ALCdevice *device, const bool hqdec=false, const bool stablize=
}
chancoeffs.resize(maxz(chancoeffs.size(), idx+1u), ChannelDec{});
- al::span<float,MAX_AMBI_CHANNELS> coeffs{chancoeffs[idx]};
+ al::span<float,MaxAmbiChannels> coeffs{chancoeffs[idx]};
size_t start{0};
for(ALuint o{0};o <= decoder.mOrder;++o)
{
@@ -606,12 +606,12 @@ void InitCustomPanning(ALCdevice *device, const bool hqdec, const bool stablize,
ERR("Basic renderer uses the high-frequency matrix as single-band (xover_freq = %.0fhz)\n",
conf->XOverFreq);
- const ALuint order{(conf->ChanMask > AMBI_2ORDER_MASK) ? 3u :
- (conf->ChanMask > AMBI_1ORDER_MASK) ? 2u : 1u};
+ const ALuint order{(conf->ChanMask > Ambi2OrderMask) ? 3u :
+ (conf->ChanMask > Ambi1OrderMask) ? 2u : 1u};
device->mAmbiOrder = order;
size_t count;
- if((conf->ChanMask&AMBI_PERIPHONIC_MASK))
+ if((conf->ChanMask&AmbiPeriphonicMask))
{
count = AmbiChannelsFromOrder(order);
std::transform(AmbiIndex::FromACN.begin(), AmbiIndex::FromACN.begin()+count,
@@ -661,9 +661,9 @@ void InitCustomPanning(ALCdevice *device, const bool hqdec, const bool stablize,
TRACE("Enabling %s-band %s-order%s ambisonic decoder\n",
(!hqdec || conf->FreqBands == 1) ? "single" : "dual",
- (conf->ChanMask > AMBI_2ORDER_MASK) ? "third" :
- (conf->ChanMask > AMBI_1ORDER_MASK) ? "second" : "first",
- (conf->ChanMask&AMBI_PERIPHONIC_MASK) ? " periphonic" : ""
+ (conf->ChanMask > Ambi2OrderMask) ? "third" :
+ (conf->ChanMask > Ambi1OrderMask) ? "second" : "first",
+ (conf->ChanMask&AmbiPeriphonicMask) ? " periphonic" : ""
);
device->AmbiDecoder = BFormatDec::Create(conf, hqdec, count, device->Frequency, speakermap,
std::move(stablizer));
@@ -673,7 +673,7 @@ void InitCustomPanning(ALCdevice *device, const bool hqdec, const bool stablize,
const float avg_dist{
std::accumulate(conf->Speakers.begin(), conf->Speakers.end(), 0.0f, accum_spkr_dist) /
static_cast<float>(conf->Speakers.size())};
- InitNearFieldCtrl(device, avg_dist, order, !!(conf->ChanMask&AMBI_PERIPHONIC_MASK));
+ InitNearFieldCtrl(device, avg_dist, order, !!(conf->ChanMask&AmbiPeriphonicMask));
InitDistanceComp(device, conf, speakermap);
}
@@ -719,7 +719,7 @@ void InitHrtfPanning(ALCdevice *device)
{ EvRadians{ Deg_21}, AzRadians{ 0.0f} },
{ EvRadians{-Deg_21}, AzRadians{ 0.0f} },
};
- static const float AmbiMatrix1O[][MAX_AMBI_CHANNELS]{
+ static const float AmbiMatrix1O[][MaxAmbiChannels]{
{ 1.250000000e-01f, 1.250000000e-01f, 1.250000000e-01f, 1.250000000e-01f },
{ 1.250000000e-01f, 1.250000000e-01f, 1.250000000e-01f, -1.250000000e-01f },
{ 1.250000000e-01f, -1.250000000e-01f, 1.250000000e-01f, 1.250000000e-01f },
@@ -728,7 +728,7 @@ void InitHrtfPanning(ALCdevice *device)
{ 1.250000000e-01f, 1.250000000e-01f, -1.250000000e-01f, -1.250000000e-01f },
{ 1.250000000e-01f, -1.250000000e-01f, -1.250000000e-01f, 1.250000000e-01f },
{ 1.250000000e-01f, -1.250000000e-01f, -1.250000000e-01f, -1.250000000e-01f },
- }, AmbiMatrix2O[][MAX_AMBI_CHANNELS]{
+ }, AmbiMatrix2O[][MaxAmbiChannels]{
{ 5.000000000e-02f, 5.000000000e-02f, -5.000000000e-02f, 5.000000000e-02f, 6.454972244e-02f, -6.454972244e-02f, 0.000000000e+00f, -6.454972244e-02f, 0.000000000e+00f },
{ 5.000000000e-02f, 5.000000000e-02f, -5.000000000e-02f, -5.000000000e-02f, -6.454972244e-02f, -6.454972244e-02f, 0.000000000e+00f, 6.454972244e-02f, 0.000000000e+00f },
{ 5.000000000e-02f, 5.000000000e-02f, 5.000000000e-02f, -5.000000000e-02f, -6.454972244e-02f, 6.454972244e-02f, 0.000000000e+00f, -6.454972244e-02f, 0.000000000e+00f },
@@ -750,9 +750,9 @@ void InitHrtfPanning(ALCdevice *device)
{ 5.000000000e-02f, 0.000000000e+00f, 3.090169944e-02f, 8.090169944e-02f, 0.000000000e+00f, 0.000000000e+00f, -3.454915028e-02f, 6.454972244e-02f, 8.449668365e-02f },
{ 5.000000000e-02f, 0.000000000e+00f, -3.090169944e-02f, 8.090169944e-02f, 0.000000000e+00f, 0.000000000e+00f, -3.454915028e-02f, -6.454972244e-02f, 8.449668365e-02f },
};
- static const float AmbiOrderHFGain1O[MAX_AMBI_ORDER+1]{
+ static const float AmbiOrderHFGain1O[MaxAmbiOrder+1]{
2.000000000e+00f, 1.154700538e+00f
- }, AmbiOrderHFGain2O[MAX_AMBI_ORDER+1]{
+ }, AmbiOrderHFGain2O[MaxAmbiOrder+1]{
2.357022604e+00f, 1.825741858e+00f, 9.428090416e-01f
};
@@ -804,8 +804,8 @@ void InitHrtfPanning(ALCdevice *device)
device->HrtfName.c_str());
al::span<const AngularPoint> AmbiPoints{AmbiPoints1O};
- const float (*AmbiMatrix)[MAX_AMBI_CHANNELS]{AmbiMatrix1O};
- al::span<const float,MAX_AMBI_ORDER+1> AmbiOrderHFGain{AmbiOrderHFGain1O};
+ const float (*AmbiMatrix)[MaxAmbiChannels]{AmbiMatrix1O};
+ al::span<const float,MaxAmbiOrder+1> AmbiOrderHFGain{AmbiOrderHFGain1O};
if(ambi_order >= 2)
{
AmbiPoints = AmbiPoints2O;
@@ -891,9 +891,9 @@ void aluInitRenderer(ALCdevice *device, int hrtf_id, HrtfRequestMode hrtf_appreq
else if(conf.Speakers.size() > MAX_OUTPUT_CHANNELS)
ERR("Unsupported speaker count %zu (max %d)\n", conf.Speakers.size(),
MAX_OUTPUT_CHANNELS);
- else if(conf.ChanMask > AMBI_3ORDER_MASK)
+ else if(conf.ChanMask > Ambi3OrderMask)
ERR("Unsupported channel mask 0x%04x (max 0x%x)\n", conf.ChanMask,
- AMBI_3ORDER_MASK);
+ Ambi3OrderMask);
else if(MakeSpeakerMap(device, &conf, speakermap))
pconf = &conf;
}
@@ -1092,10 +1092,10 @@ void aluInitEffectPanning(ALeffectslot *slot, ALCcontext *context)
}
-std::array<float,MAX_AMBI_CHANNELS> CalcAmbiCoeffs(const float y, const float z, const float x,
+std::array<float,MaxAmbiChannels> CalcAmbiCoeffs(const float y, const float z, const float x,
const float spread)
{
- std::array<float,MAX_AMBI_CHANNELS> coeffs;
+ std::array<float,MaxAmbiChannels> coeffs;
/* Zeroth-order */
coeffs[0] = 1.0f; /* ACN 0 = 1 */
diff --git a/alc/voice.cpp b/alc/voice.cpp
index 8b5cd02f..600fe80e 100644
--- a/alc/voice.cpp
+++ b/alc/voice.cpp
@@ -412,7 +412,7 @@ void DoNfcMix(const al::span<const float> samples, FloatBufferLine *OutBuffer, D
const float *TargetGains, const uint Counter, const uint OutPos, ALCdevice *Device)
{
using FilterProc = void (NfcFilter::*)(const al::span<const float>, float*);
- static constexpr FilterProc NfcProcess[MAX_AMBI_ORDER+1]{
+ static constexpr FilterProc NfcProcess[MaxAmbiOrder+1]{
nullptr, &NfcFilter::process1, &NfcFilter::process2, &NfcFilter::process3};
float *CurrentGains{parms.Gains.Current.data()};
@@ -430,7 +430,7 @@ void DoNfcMix(const al::span<const float> samples, FloatBufferLine *OutBuffer, D
OutBuffer += chancount;
CurrentGains += chancount;
TargetGains += chancount;
- if(++order == MAX_AMBI_ORDER+1)
+ if(++order == MaxAmbiOrder+1)
break;
}
}