aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mixer/hrtfbase.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-05-29 17:32:16 -0700
committerChris Robinson <[email protected]>2019-05-29 17:32:16 -0700
commitba449d2b087f791ad84394c22b4d4ec528da390b (patch)
treeec077a8dd6e4581ec2965e66d3801fb4cf2fc9c7 /Alc/mixer/hrtfbase.h
parentd0f0a5fdca87f74ef46ad26cb79975e1c6cda8f0 (diff)
Pass a span to MixDirectHrtf instead of a pointer+size
Diffstat (limited to 'Alc/mixer/hrtfbase.h')
-rw-r--r--Alc/mixer/hrtfbase.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/Alc/mixer/hrtfbase.h b/Alc/mixer/hrtfbase.h
index 571cdc89..bce9e573 100644
--- a/Alc/mixer/hrtfbase.h
+++ b/Alc/mixer/hrtfbase.h
@@ -102,22 +102,21 @@ inline void MixHrtfBlendBase(FloatBufferLine &LeftOut, FloatBufferLine &RightOut
template<ApplyCoeffsT &ApplyCoeffs>
inline void MixDirectHrtfBase(FloatBufferLine &LeftOut, FloatBufferLine &RightOut,
- const FloatBufferLine *InSamples, float2 *RESTRICT AccumSamples, DirectHrtfState *State,
- const ALsizei NumChans, const ALsizei BufferSize)
+ const al::span<const FloatBufferLine> InSamples, float2 *RESTRICT AccumSamples,
+ DirectHrtfState *State, const ALsizei BufferSize)
{
- ASSUME(NumChans > 0);
ASSUME(BufferSize > 0);
const ALsizei IrSize{State->IrSize};
ASSUME(IrSize >= 4);
- for(ALsizei c{0};c < NumChans;++c)
+ auto chanstate = State->Chan.begin();
+ for(const FloatBufferLine &input : InSamples)
{
- const FloatBufferLine &input = InSamples[c];
- const auto &Coeffs = State->Chan[c].Coeffs;
+ const auto &Coeffs = chanstate->Coeffs;
- auto accum_iter = std::copy_n(State->Chan[c].Values.begin(),
- State->Chan[c].Values.size(), AccumSamples);
+ auto accum_iter = std::copy_n(chanstate->Values.begin(),
+ chanstate->Values.size(), AccumSamples);
std::fill_n(accum_iter, BufferSize, float2{});
for(ALsizei i{0};i < BufferSize;++i)
@@ -130,8 +129,9 @@ inline void MixDirectHrtfBase(FloatBufferLine &LeftOut, FloatBufferLine &RightOu
for(ALsizei i{0};i < BufferSize;++i)
RightOut[i] += AccumSamples[i][1];
- std::copy_n(AccumSamples + BufferSize, State->Chan[c].Values.size(),
- State->Chan[c].Values.begin());
+ std::copy_n(AccumSamples + BufferSize, chanstate->Values.size(),
+ chanstate->Values.begin());
+ ++chanstate;
}
}