aboutsummaryrefslogtreecommitdiffstats
path: root/alc/alu.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-08-25 17:54:36 -0700
committerChris Robinson <[email protected]>2019-08-25 17:54:36 -0700
commit164626a7be1cd0a9b92d34b9bb7f5c891fe57fae (patch)
tree993608d71dc619472d017775b9f25e3c601f7222 /alc/alu.cpp
parentb93098f7df73b877d40303ce3d9e4d9776a9c245 (diff)
Pass unsigned sample count to aluMixData
Diffstat (limited to 'alc/alu.cpp')
-rw-r--r--alc/alu.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/alc/alu.cpp b/alc/alu.cpp
index c961f5d5..ba42c21f 100644
--- a/alc/alu.cpp
+++ b/alc/alu.cpp
@@ -1343,7 +1343,7 @@ void ProcessParamUpdates(ALCcontext *ctx, const ALeffectslotArray &slots,
IncrementRef(ctx->mUpdateCount);
}
-void ProcessContext(ALCcontext *ctx, const ALsizei SamplesToDo)
+void ProcessContext(ALCcontext *ctx, const ALuint SamplesToDo)
{
ASSUME(SamplesToDo > 0);
@@ -1424,7 +1424,7 @@ void ProcessContext(ALCcontext *ctx, const ALsizei SamplesToDo)
void ApplyStablizer(FrontStablizer *Stablizer, const al::span<FloatBufferLine> Buffer,
- const ALuint lidx, const ALuint ridx, const ALuint cidx, const ALsizei SamplesToDo)
+ const ALuint lidx, const ALuint ridx, const ALuint cidx, const ALuint SamplesToDo)
{
ASSUME(SamplesToDo > 0);
@@ -1439,7 +1439,7 @@ void ApplyStablizer(FrontStablizer *Stablizer, const al::span<FloatBufferLine> B
auto &DelayBuf = Stablizer->DelayBuf[i];
auto buffer_end = Buffer[i].begin() + SamplesToDo;
- if LIKELY(SamplesToDo >= ALsizei{FrontStablizer::DelayLength})
+ if LIKELY(SamplesToDo >= ALuint{FrontStablizer::DelayLength})
{
auto delay_end = std::rotate(Buffer[i].begin(),
buffer_end - FrontStablizer::DelayLength, buffer_end);
@@ -1489,7 +1489,7 @@ void ApplyStablizer(FrontStablizer *Stablizer, const al::span<FloatBufferLine> B
apply_splitter(Buffer[lidx], Stablizer->DelayBuf[lidx], Stablizer->LFilter, lsplit);
apply_splitter(Buffer[ridx], Stablizer->DelayBuf[ridx], Stablizer->RFilter, rsplit);
- for(ALsizei i{0};i < SamplesToDo;i++)
+ for(ALuint i{0};i < SamplesToDo;i++)
{
ALfloat lfsum{lsplit[0][i] + rsplit[0][i]};
ALfloat hfsum{lsplit[1][i] + rsplit[1][i]};
@@ -1515,7 +1515,7 @@ void ApplyStablizer(FrontStablizer *Stablizer, const al::span<FloatBufferLine> B
}
}
-void ApplyDistanceComp(const al::span<FloatBufferLine> Samples, const ALsizei SamplesToDo,
+void ApplyDistanceComp(const al::span<FloatBufferLine> Samples, const ALuint SamplesToDo,
const DistanceComp::DistData *distcomp)
{
ASSUME(SamplesToDo > 0);
@@ -1523,7 +1523,7 @@ void ApplyDistanceComp(const al::span<FloatBufferLine> Samples, const ALsizei Sa
for(auto &chanbuffer : Samples)
{
const ALfloat gain{distcomp->Gain};
- const ALsizei base{distcomp->Length};
+ const ALuint base{distcomp->Length};
ALfloat *distbuf{al::assume_aligned<16>(distcomp->Buffer)};
++distcomp;
@@ -1547,7 +1547,7 @@ void ApplyDistanceComp(const al::span<FloatBufferLine> Samples, const ALsizei Sa
}
void ApplyDither(const al::span<FloatBufferLine> Samples, ALuint *dither_seed,
- const ALfloat quant_scale, const ALsizei SamplesToDo)
+ const ALfloat quant_scale, const ALuint SamplesToDo)
{
/* Dithering. Generate whitenoise (uniform distribution of random values
* between -1 and +1) and add it to the sample values, after scaling up to
@@ -1605,7 +1605,7 @@ template<> inline ALubyte SampleConv(ALfloat val) noexcept
template<DevFmtType T>
void Write(const al::span<const FloatBufferLine> InBuffer, ALvoid *OutBuffer, const size_t Offset,
- const ALsizei SamplesToDo)
+ const ALuint SamplesToDo)
{
using SampleType = typename DevFmtTypeTraits<T>::Type;
@@ -1629,12 +1629,12 @@ void Write(const al::span<const FloatBufferLine> InBuffer, ALvoid *OutBuffer, co
} // namespace
-void aluMixData(ALCdevice *device, ALvoid *OutBuffer, ALsizei NumSamples)
+void aluMixData(ALCdevice *device, ALvoid *OutBuffer, const ALuint NumSamples)
{
FPUCtl mixer_mode{};
- for(ALsizei SamplesDone{0};SamplesDone < NumSamples;)
+ for(ALuint SamplesDone{0u};SamplesDone < NumSamples;)
{
- const ALsizei SamplesToDo{mini(NumSamples-SamplesDone, BUFFERSIZE)};
+ const ALuint SamplesToDo{minu(NumSamples-SamplesDone, BUFFERSIZE)};
/* Clear main mixing buffers. */
std::for_each(device->MixBuffer.begin(), device->MixBuffer.end(),