aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/bformatdec.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-07-03 22:59:29 -0700
committerChris Robinson <[email protected]>2019-07-03 22:59:29 -0700
commit9a51ca0a782764c97c5c393b799ff76b7b6fb75f (patch)
treec71351893f172c282918a9ca9262a95a2b038d72 /Alc/bformatdec.cpp
parent0a0704071a74bb2350bc2735c0b7c554e2bf3a9a (diff)
Pass a span to BFormatDec::process
Diffstat (limited to 'Alc/bformatdec.cpp')
-rw-r--r--Alc/bformatdec.cpp33
1 files changed, 18 insertions, 15 deletions
diff --git a/Alc/bformatdec.cpp b/Alc/bformatdec.cpp
index 9c0c72ec..6ef398ec 100644
--- a/Alc/bformatdec.cpp
+++ b/Alc/bformatdec.cpp
@@ -146,12 +146,9 @@ BFormatDec::BFormatDec(const ALuint inchans, const ALsizei chancount,
}
-void BFormatDec::process(FloatBufferLine *OutBuffer, const ALuint OutChannels,
+void BFormatDec::process(const al::span<FloatBufferLine> OutBuffer,
const FloatBufferLine *InSamples, const ALsizei SamplesToDo)
{
- ASSUME(OutChannels > 0);
- ASSUME(mNumChannels > 0);
-
if(mDualBand)
{
for(ALuint i{0};i < mNumChannels;i++)
@@ -160,24 +157,30 @@ void BFormatDec::process(FloatBufferLine *OutBuffer, const ALuint OutChannels,
const al::span<const FloatBufferLine> hfsamples{mSamplesHF, mNumChannels};
const al::span<const FloatBufferLine> lfsamples{mSamplesLF, mNumChannels};
- for(ALuint chan{0};chan < OutChannels;chan++)
+ ALfloat (*mixmtx)[sNumBands][MAX_AMBI_CHANNELS]{mMatrix.Dual};
+ ALuint enabled{mEnabled};
+ for(FloatBufferLine &outbuf : OutBuffer)
{
- if(UNLIKELY(!(mEnabled&(1<<chan))))
- continue;
-
- MixRowSamples(OutBuffer[chan], mMatrix.Dual[chan][sHFBand], hfsamples, 0, SamplesToDo);
- MixRowSamples(OutBuffer[chan], mMatrix.Dual[chan][sLFBand], lfsamples, 0, SamplesToDo);
+ if(LIKELY(enabled&1))
+ {
+ MixRowSamples(outbuf, (*mixmtx)[sHFBand], hfsamples, 0, SamplesToDo);
+ MixRowSamples(outbuf, (*mixmtx)[sLFBand], lfsamples, 0, SamplesToDo);
+ }
+ ++mixmtx;
+ enabled >>= 1;
}
}
else
{
const al::span<const FloatBufferLine> insamples{InSamples, mNumChannels};
- for(ALuint chan{0};chan < OutChannels;chan++)
+ ALfloat (*mixmtx)[MAX_AMBI_CHANNELS]{mMatrix.Single};
+ ALuint enabled{mEnabled};
+ for(FloatBufferLine &outbuf : OutBuffer)
{
- if(UNLIKELY(!(mEnabled&(1<<chan))))
- continue;
-
- MixRowSamples(OutBuffer[chan], mMatrix.Single[chan], insamples, 0, SamplesToDo);
+ if(LIKELY(enabled&1))
+ MixRowSamples(outbuf, *mixmtx, insamples, 0, SamplesToDo);
+ ++mixmtx;
+ enabled >>= 1;
}
}
}