aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--alc/alu.cpp18
-rw-r--r--alc/effects/dedicated.cpp4
-rw-r--r--alc/panning.cpp2
-rw-r--r--core/device.h18
4 files changed, 21 insertions, 21 deletions
diff --git a/alc/alu.cpp b/alc/alu.cpp
index 7aefcfb5..203bd7cf 100644
--- a/alc/alu.cpp
+++ b/alc/alu.cpp
@@ -279,8 +279,8 @@ ResamplerFunc PrepareResampler(Resampler resampler, uint increment, InterpState
void DeviceBase::ProcessHrtf(const size_t SamplesToDo)
{
/* HRTF is stereo output only. */
- const uint lidx{RealOut.ChannelIndex[FrontLeft]};
- const uint ridx{RealOut.ChannelIndex[FrontRight]};
+ const size_t lidx{RealOut.ChannelIndex[FrontLeft]};
+ const size_t ridx{RealOut.ChannelIndex[FrontRight]};
MixDirectHrtf(RealOut.Buffer[lidx], RealOut.Buffer[ridx], Dry.Buffer, HrtfAccumData,
mHrtfState->mTemp.data(), mHrtfState->mChannels.data(), mHrtfState->mIrSize, SamplesToDo);
@@ -294,9 +294,9 @@ void DeviceBase::ProcessAmbiDec(const size_t SamplesToDo)
void DeviceBase::ProcessAmbiDecStablized(const size_t SamplesToDo)
{
/* Decode with front image stablization. */
- const uint lidx{RealOut.ChannelIndex[FrontLeft]};
- const uint ridx{RealOut.ChannelIndex[FrontRight]};
- const uint cidx{RealOut.ChannelIndex[FrontCenter]};
+ const size_t lidx{RealOut.ChannelIndex[FrontLeft]};
+ const size_t ridx{RealOut.ChannelIndex[FrontRight]};
+ const size_t cidx{RealOut.ChannelIndex[FrontCenter]};
AmbiDecoder->processStablize(RealOut.Buffer, Dry.Buffer.data(), lidx, ridx, cidx,
SamplesToDo);
@@ -305,8 +305,8 @@ void DeviceBase::ProcessAmbiDecStablized(const size_t SamplesToDo)
void DeviceBase::ProcessUhj(const size_t SamplesToDo)
{
/* UHJ is stereo output only. */
- const uint lidx{RealOut.ChannelIndex[FrontLeft]};
- const uint ridx{RealOut.ChannelIndex[FrontRight]};
+ const size_t lidx{RealOut.ChannelIndex[FrontLeft]};
+ const size_t ridx{RealOut.ChannelIndex[FrontRight]};
/* Encode to stereo-compatible 2-channel UHJ output. */
mUhjEncoder->encode(RealOut.Buffer[lidx].data(), RealOut.Buffer[ridx].data(),
@@ -319,8 +319,8 @@ void DeviceBase::ProcessBs2b(const size_t SamplesToDo)
AmbiDecoder->process(RealOut.Buffer, Dry.Buffer.data(), SamplesToDo);
/* BS2B is stereo output only. */
- const uint lidx{RealOut.ChannelIndex[FrontLeft]};
- const uint ridx{RealOut.ChannelIndex[FrontRight]};
+ const size_t lidx{RealOut.ChannelIndex[FrontLeft]};
+ const size_t ridx{RealOut.ChannelIndex[FrontRight]};
/* Now apply the BS2B binaural/crossfeed filter. */
bs2b_cross_feed(Bs2b.get(), RealOut.Buffer[lidx].data(), RealOut.Buffer[ridx].data(),
diff --git a/alc/effects/dedicated.cpp b/alc/effects/dedicated.cpp
index 9ac68bec..a9131bfa 100644
--- a/alc/effects/dedicated.cpp
+++ b/alc/effects/dedicated.cpp
@@ -74,7 +74,7 @@ void DedicatedState::update(const ContextBase*, const EffectSlot *slot,
if(slot->EffectType == EffectSlotType::DedicatedLFE)
{
- const uint idx{target.RealOut ? target.RealOut->ChannelIndex[LFE] : InvalidChannelIndex};
+ const size_t idx{target.RealOut ? target.RealOut->ChannelIndex[LFE] : InvalidChannelIndex};
if(idx != InvalidChannelIndex)
{
mOutTarget = target.RealOut->Buffer;
@@ -85,7 +85,7 @@ void DedicatedState::update(const ContextBase*, const EffectSlot *slot,
{
/* Dialog goes to the front-center speaker if it exists, otherwise it
* plays from the front-center location. */
- const uint idx{target.RealOut ? target.RealOut->ChannelIndex[FrontCenter]
+ const size_t idx{target.RealOut ? target.RealOut->ChannelIndex[FrontCenter]
: InvalidChannelIndex};
if(idx != InvalidChannelIndex)
{
diff --git a/alc/panning.cpp b/alc/panning.cpp
index 871fef65..b512a42a 100644
--- a/alc/panning.cpp
+++ b/alc/panning.cpp
@@ -677,7 +677,7 @@ void InitPanning(ALCdevice *device, const bool hqdec=false, const bool stablize=
/* Only enable the stablizer if the decoder does not output to the
* front-center channel.
*/
- const auto cidx = device->RealOut.ChannelIndex[FrontCenter];
+ const size_t cidx{device->RealOut.ChannelIndex[FrontCenter]};
bool hasfc{false};
if(cidx < chancoeffs.size())
{
diff --git a/core/device.h b/core/device.h
index b088e130..b1ffc9ce 100644
--- a/core/device.h
+++ b/core/device.h
@@ -94,7 +94,7 @@ struct DistanceComp {
};
-constexpr uint InvalidChannelIndex{~0u};
+constexpr uint8_t InvalidChannelIndex{static_cast<uint8_t>(~0u)};
struct BFChannelConfig {
float Scale;
@@ -112,8 +112,8 @@ struct MixParams {
* source is expected to be a 3D ACN/N3D ambisonic buffer, and for each
* channel [0...count), the given functor is called with the source channel
* index, destination channel index, and the gain for that channel. If the
- * destination channel is INVALID_CHANNEL_INDEX, the given source channel
- * is not used for output.
+ * destination channel is InvalidChannelIndex, the given source channel is
+ * not used for output.
*/
template<typename F>
void setAmbiMixParams(const MixParams &inmix, const float gainbase, F func) const
@@ -122,14 +122,14 @@ struct MixParams {
const size_t numOut{Buffer.size()};
for(size_t i{0};i < numIn;++i)
{
- auto idx = InvalidChannelIndex;
- auto gain = 0.0f;
+ uint8_t idx{InvalidChannelIndex};
+ float gain{0.0f};
for(size_t j{0};j < numOut;++j)
{
if(AmbiMap[j].Index == inmix.AmbiMap[i].Index)
{
- idx = static_cast<uint>(j);
+ idx = static_cast<uint8_t>(j);
gain = AmbiMap[j].Scale * gainbase;
break;
}
@@ -141,7 +141,7 @@ struct MixParams {
struct RealMixParams {
al::span<const InputRemixMap> RemixMap;
- std::array<uint,MaxChannels> ChannelIndex{};
+ std::array<uint8_t,MaxChannels> ChannelIndex{};
al::span<FloatBufferLine> Buffer;
};
@@ -329,9 +329,9 @@ struct DeviceBase {
/**
* Returns the index for the given channel name (e.g. FrontCenter), or
- * INVALID_CHANNEL_INDEX if it doesn't exist.
+ * InvalidChannelIndex if it doesn't exist.
*/
- uint channelIdxByName(Channel chan) const noexcept
+ uint8_t channelIdxByName(Channel chan) const noexcept
{ return RealOut.ChannelIndex[chan]; }
DISABLE_ALLOC()