aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/alu.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-06-08 01:39:28 -0700
committerChris Robinson <[email protected]>2019-06-08 01:39:28 -0700
commit91b7e8142caf297b97d6b403ee79ba2dcbcda09f (patch)
tree5b6d15b3d37af929436a00fa772d4102fb719e73 /Alc/alu.cpp
parent7988bc6e91899179a71650bd2534d7749f2a68c3 (diff)
Simplify DistanceComp somewhat
Diffstat (limited to 'Alc/alu.cpp')
-rw-r--r--Alc/alu.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/Alc/alu.cpp b/Alc/alu.cpp
index 9a1958b6..e570c2ad 100644
--- a/Alc/alu.cpp
+++ b/Alc/alu.cpp
@@ -1540,22 +1540,22 @@ void ApplyStablizer(FrontStablizer *Stablizer, FloatBufferLine *Buffer, const AL
}
}
-void ApplyDistanceComp(FloatBufferLine *Samples, const DistanceComp &distcomp,
- const ALsizei SamplesToDo, const ALuint numchans)
+void ApplyDistanceComp(const al::span<FloatBufferLine> Samples, const ALsizei SamplesToDo,
+ const DistanceComp::DistData *distcomp)
{
ASSUME(SamplesToDo > 0);
- ASSUME(numchans > 0);
- for(ALuint c{0};c < numchans;c++)
+ for(auto &chanbuffer : Samples)
{
- const ALfloat gain{distcomp[c].Gain};
- const ALsizei base{distcomp[c].Length};
- ALfloat *distbuf{al::assume_aligned<16>(distcomp[c].Buffer)};
+ const ALfloat gain{distcomp->Gain};
+ const ALsizei base{distcomp->Length};
+ ALfloat *distbuf{al::assume_aligned<16>(distcomp->Buffer)};
+ ++distcomp;
if(base < 1)
continue;
- ALfloat *inout{al::assume_aligned<16>(Samples[c].data())};
+ ALfloat *inout{al::assume_aligned<16>(chanbuffer.data())};
auto inout_end = inout + SamplesToDo;
if(LIKELY(SamplesToDo >= base))
{
@@ -1716,8 +1716,8 @@ void aluMixData(ALCdevice *device, ALvoid *OutBuffer, ALsizei NumSamples)
comp->process(SamplesToDo, device->RealOut.Buffer);
/* Apply delays and attenuation for mismatched speaker distances. */
- ApplyDistanceComp(device->RealOut.Buffer, device->ChannelDelay, SamplesToDo,
- device->RealOut.NumChannels);
+ ApplyDistanceComp({device->RealOut.Buffer, device->RealOut.NumChannels}, SamplesToDo,
+ device->ChannelDelay.as_span().cbegin());
/* Apply dithering. The compressor should have left enough headroom for
* the dither noise to not saturate.