aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/alu.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-06-05 18:54:17 -0700
committerChris Robinson <[email protected]>2019-06-05 18:54:17 -0700
commit410a5ca62129f03ba7cfc091fa63fc451cdfc24f (patch)
tree6f14211e49659360cae962653eb78a739ec9c9c6 /Alc/alu.cpp
parent5f26205f8fb504c5f6fec3e2b02f0009a4f24be2 (diff)
Make RealMixParams channel count unsigned
Diffstat (limited to 'Alc/alu.cpp')
-rw-r--r--Alc/alu.cpp25
1 files changed, 11 insertions, 14 deletions
diff --git a/Alc/alu.cpp b/Alc/alu.cpp
index 00867810..fbafd021 100644
--- a/Alc/alu.cpp
+++ b/Alc/alu.cpp
@@ -691,8 +691,7 @@ void CalcPanningAndFilters(ALvoice *voice, const ALfloat xpos, const ALfloat ypo
/* Direct source channels always play local. Skip the virtual channels
* and write inputs to the matching real outputs.
*/
- voice->mDirect.Buffer = {Device->RealOut.Buffer,
- static_cast<size_t>(Device->RealOut.NumChannels)};
+ voice->mDirect.Buffer = {Device->RealOut.Buffer, Device->RealOut.NumChannels};
for(ALsizei c{0};c < num_channels;c++)
{
@@ -721,8 +720,7 @@ void CalcPanningAndFilters(ALvoice *voice, const ALfloat xpos, const ALfloat ypo
/* Full HRTF rendering. Skip the virtual channels and render to the
* real outputs.
*/
- voice->mDirect.Buffer = {Device->RealOut.Buffer,
- static_cast<size_t>(Device->RealOut.NumChannels)};
+ voice->mDirect.Buffer = {Device->RealOut.Buffer, Device->RealOut.NumChannels};
if(Distance > std::numeric_limits<float>::epsilon())
{
@@ -1469,8 +1467,8 @@ void ProcessContext(ALCcontext *ctx, const ALsizei SamplesToDo)
}
-void ApplyStablizer(FrontStablizer *Stablizer, FloatBufferLine *Buffer, const int lidx,
- const int ridx, const int cidx, const ALsizei SamplesToDo, const ALsizei NumChannels)
+void ApplyStablizer(FrontStablizer *Stablizer, FloatBufferLine *Buffer, const ALuint lidx,
+ const ALuint ridx, const ALuint cidx, const ALsizei SamplesToDo, const ALuint NumChannels)
{
ASSUME(SamplesToDo > 0);
ASSUME(NumChannels > 0);
@@ -1478,7 +1476,7 @@ void ApplyStablizer(FrontStablizer *Stablizer, FloatBufferLine *Buffer, const in
/* Apply a delay to all channels, except the front-left and front-right, so
* they maintain correct timing.
*/
- for(ALsizei i{0};i < NumChannels;i++)
+ for(ALuint i{0};i < NumChannels;i++)
{
if(i == lidx || i == ridx)
continue;
@@ -1562,12 +1560,12 @@ void ApplyStablizer(FrontStablizer *Stablizer, FloatBufferLine *Buffer, const in
}
void ApplyDistanceComp(FloatBufferLine *Samples, const DistanceComp &distcomp,
- const ALsizei SamplesToDo, const ALsizei numchans)
+ const ALsizei SamplesToDo, const ALuint numchans)
{
ASSUME(SamplesToDo > 0);
ASSUME(numchans > 0);
- for(ALsizei c{0};c < numchans;c++)
+ for(ALuint c{0};c < numchans;c++)
{
const ALfloat gain{distcomp[c].Gain};
const ALsizei base{distcomp[c].Length};
@@ -1593,7 +1591,7 @@ void ApplyDistanceComp(FloatBufferLine *Samples, const DistanceComp &distcomp,
}
void ApplyDither(FloatBufferLine *Samples, ALuint *dither_seed, const ALfloat quant_scale,
- const ALsizei SamplesToDo, const ALsizei numchans)
+ const ALsizei SamplesToDo, const ALuint numchans)
{
ASSUME(numchans > 0);
@@ -1652,12 +1650,11 @@ template<> inline ALubyte SampleConv(ALfloat val) noexcept
{ return SampleConv<ALbyte>(val) + 128; }
template<DevFmtType T>
-void Write(const FloatBufferLine *InBuffer, ALvoid *OutBuffer, const ALsizei Offset,
- const ALsizei SamplesToDo, const ALsizei numchans)
+void Write(const FloatBufferLine *InBuffer, ALvoid *OutBuffer, const size_t Offset,
+ const ALsizei SamplesToDo, const ALuint numchans)
{
using SampleType = typename DevFmtTypeTraits<T>::Type;
- ASSUME(Offset >= 0);
ASSUME(numchans > 0);
SampleType *outbase = static_cast<SampleType*>(OutBuffer) + Offset*numchans;
auto conv_channel = [&outbase,SamplesToDo,numchans](const FloatBufferLine &inbuf) -> void
@@ -1751,7 +1748,7 @@ void aluMixData(ALCdevice *device, ALvoid *OutBuffer, ALsizei NumSamples)
if(LIKELY(OutBuffer))
{
FloatBufferLine *Buffer{device->RealOut.Buffer};
- ALsizei Channels{device->RealOut.NumChannels};
+ ALuint Channels{device->RealOut.NumChannels};
/* Finally, interleave and convert samples, writing to the device's
* output buffer.