aboutsummaryrefslogtreecommitdiffstats
path: root/core/mixer/hrtfbase.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2022-03-31 05:59:14 -0700
committerChris Robinson <[email protected]>2022-03-31 06:11:47 -0700
commit9d240becad5652521c480d662cc5fe80d2223149 (patch)
tree701c51276a641c9c96c3b2351fb039cc8eae269c /core/mixer/hrtfbase.h
parentd91b68ef8ee57bcda7cda37a374e984a1a4245b3 (diff)
Make and use a processHfScale function with a separate output
Diffstat (limited to 'core/mixer/hrtfbase.h')
-rw-r--r--core/mixer/hrtfbase.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/core/mixer/hrtfbase.h b/core/mixer/hrtfbase.h
index ade6f693..606f9d4e 100644
--- a/core/mixer/hrtfbase.h
+++ b/core/mixer/hrtfbase.h
@@ -96,12 +96,11 @@ inline void MixDirectHrtfBase(const FloatBufferSpan LeftOut, const FloatBufferSp
* the high frequency response. The band-splitter applies this scaling
* with a consistent phase shift regardless of the scale amount.
*/
- al::span<float> tempbuf{al::assume_aligned<16>(TempBuf), BufferSize};
- std::copy(input.begin(), input.begin()+BufferSize, tempbuf.begin());
-
- ChanState->mSplitter.processHfScale(tempbuf, ChanState->mHfScale);
+ ChanState->mSplitter.processHfScale({input.data(), BufferSize}, TempBuf,
+ ChanState->mHfScale);
/* Now apply the HRIR coefficients to this channel. */
+ const float *RESTRICT tempbuf{al::assume_aligned<16>(TempBuf)};
const ConstHrirSpan Coeffs{ChanState->mCoeffs};
for(size_t i{0u};i < BufferSize;++i)
{
@@ -113,10 +112,12 @@ inline void MixDirectHrtfBase(const FloatBufferSpan LeftOut, const FloatBufferSp
}
/* Add the HRTF signal to the existing "direct" signal. */
+ float *RESTRICT left{al::assume_aligned<16>(LeftOut.data())};
+ float *RESTRICT right{al::assume_aligned<16>(RightOut.data())};
for(size_t i{0u};i < BufferSize;++i)
- LeftOut[i] += AccumSamples[i][0];
+ left[i] += AccumSamples[i][0];
for(size_t i{0u};i < BufferSize;++i)
- RightOut[i] += AccumSamples[i][1];
+ right[i] += AccumSamples[i][1];
/* Copy the new in-progress accumulation values to the front and clear the
* following samples for the next mix.