diff options
author | Chris Robinson <[email protected]> | 2019-08-20 00:27:28 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-08-20 00:27:28 -0700 |
commit | 8fd90334a13608a781e36fc830cd79bf746edd42 (patch) | |
tree | cefd2023a67138e29db07a32d114dd1ed5a00b9a /alc/effects/reverb.cpp | |
parent | 34a61122f64d6295f50508cc6945350a5be04924 (diff) |
Pass the MixRow buffer size as a span
Diffstat (limited to 'alc/effects/reverb.cpp')
-rw-r--r-- | alc/effects/reverb.cpp | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/alc/effects/reverb.cpp b/alc/effects/reverb.cpp index 8ff4feac..5f8daabe 100644 --- a/alc/effects/reverb.cpp +++ b/alc/effects/reverb.cpp @@ -421,19 +421,20 @@ struct ReverbState final : public EffectState { ASSUME(todo > 0); /* Convert back to B-Format, and mix the results to output. */ + const al::span<float> tmpspan{mTempLine.begin(), mTempLine.begin()+todo}; for(size_t c{0u};c < NUM_LINES;c++) { - std::fill_n(mTempLine.begin(), todo, 0.0f); - MixRowSamples(mTempLine.data(), {A2B[c], NUM_LINES}, mEarlySamples[0].data(), - mEarlySamples[0].size(), todo); + std::fill(tmpspan.begin(), tmpspan.end(), 0.0f); + MixRowSamples(tmpspan, {A2B[c], NUM_LINES}, mEarlySamples[0].data(), + mEarlySamples[0].size()); MixSamples(mTempLine.data(), samplesOut, mEarly.CurrentGain[c], mEarly.PanGain[c], counter, offset, todo); } for(size_t c{0u};c < NUM_LINES;c++) { - std::fill_n(mTempLine.begin(), todo, 0.0f); - MixRowSamples(mTempLine.data(), {A2B[c], NUM_LINES}, mLateSamples[0].data(), - mLateSamples[0].size(), todo); + std::fill(tmpspan.begin(), tmpspan.end(), 0.0f); + MixRowSamples(tmpspan, {A2B[c], NUM_LINES}, mLateSamples[0].data(), + mLateSamples[0].size()); MixSamples(mTempLine.data(), samplesOut, mLate.CurrentGain[c], mLate.PanGain[c], counter, offset, todo); } @@ -444,11 +445,12 @@ struct ReverbState final : public EffectState { { ASSUME(todo > 0); + const al::span<float> tmpspan{mTempLine.begin(), mTempLine.begin()+todo}; for(size_t c{0u};c < NUM_LINES;c++) { - std::fill_n(mTempLine.begin(), todo, 0.0f); - MixRowSamples(mTempLine.data(), {A2B[c], NUM_LINES}, mEarlySamples[0].data(), - mEarlySamples[0].size(), todo); + std::fill(tmpspan.begin(), tmpspan.end(), 0.0f); + MixRowSamples(tmpspan, {A2B[c], NUM_LINES}, mEarlySamples[0].data(), + mEarlySamples[0].size()); /* Apply scaling to the B-Format's HF response to "upsample" it to * higher-order output. @@ -461,9 +463,9 @@ struct ReverbState final : public EffectState { } for(size_t c{0u};c < NUM_LINES;c++) { - std::fill_n(mTempLine.begin(), todo, 0.0f); - MixRowSamples(mTempLine.data(), {A2B[c], NUM_LINES}, mLateSamples[0].data(), - mLateSamples[0].size(), todo); + std::fill(tmpspan.begin(), tmpspan.end(), 0.0f); + MixRowSamples(tmpspan, {A2B[c], NUM_LINES}, mLateSamples[0].data(), + mLateSamples[0].size()); const ALfloat hfscale{(c==0) ? mOrderScales[0] : mOrderScales[1]}; mAmbiSplitter[1][c].applyHfScale(mTempLine.data(), hfscale, todo); @@ -1457,11 +1459,11 @@ void ReverbState::process(const ALsizei samplesToDo, const FloatBufferLine *REST ASSUME(offset >= 0); /* Convert B-Format to A-Format for processing. */ + const al::span<float> tmpspan{mTempLine.begin(), mTempLine.begin()+samplesToDo}; for(size_t c{0u};c < NUM_LINES;c++) { - std::fill_n(mTempLine.begin(), samplesToDo, 0.0f); - MixRowSamples(mTempLine.data(), {B2A[c], B2A[c]+numInput}, samplesIn->data(), - samplesIn->size(), samplesToDo); + std::fill(tmpspan.begin(), tmpspan.end(), 0.0f); + MixRowSamples(tmpspan, {B2A[c], B2A[c]+numInput}, samplesIn->data(), samplesIn->size()); /* Band-pass the incoming samples and feed the initial delay line. */ mFilter[c].Lp.process(mTempLine.data(), mTempLine.data(), samplesToDo); |