aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/mixvoice.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-03-10 10:30:33 -0700
committerChris Robinson <[email protected]>2019-03-10 10:30:33 -0700
commit12721f94a72b94c9eab0fc861ad021d915fc0228 (patch)
tree971778d9143ba4233cc5654e834c0bb3f4ebf3e1 /Alc/mixvoice.cpp
parent6a95189ef66bee5dc600f33c5518a60de042a225 (diff)
Add a method to apply an HF scale without band-splitting
Diffstat (limited to 'Alc/mixvoice.cpp')
-rw-r--r--Alc/mixvoice.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/Alc/mixvoice.cpp b/Alc/mixvoice.cpp
index 3366aa61..756b69ee 100644
--- a/Alc/mixvoice.cpp
+++ b/Alc/mixvoice.cpp
@@ -612,13 +612,14 @@ void MixSource(ALvoice *voice, const ALuint SourceID, ALCcontext *Context, const
* be desirable.
*/
const ALfloat hfscale{(chan==0) ? voice->AmbiScales[0] : voice->AmbiScales[1]};
- ALfloat (&hfbuf)[BUFFERSIZE] = Device->FilteredData;
- ALfloat (&lfbuf)[BUFFERSIZE] = Device->ResampledData;
-
- voice->AmbiSplitter[chan].process(hfbuf, lfbuf, ResampledData, DstBufferSize);
- MixRowSamples(lfbuf, &hfscale, &hfbuf, 1, 0, DstBufferSize);
-
- ResampledData = lfbuf;
+ /* Beware the evil const_cast. It's safe since it's pointing to
+ * either SrcData or Device->ResampledData (both non-const),
+ * but the resample method takes its input as const float* and
+ * may return it without copying to output, making it currently
+ * unavoidable.
+ */
+ voice->AmbiSplitter[chan].applyHfScale(const_cast<ALfloat*>(ResampledData),
+ hfscale, DstBufferSize);
}
/* Now filter and mix to the appropriate outputs. */