diff options
Diffstat (limited to 'alc/mixer')
-rw-r--r-- | alc/mixer/defs.h | 2 | ||||
-rw-r--r-- | alc/mixer/mixer_c.cpp | 11 | ||||
-rw-r--r-- | alc/mixer/mixer_neon.cpp | 11 | ||||
-rw-r--r-- | alc/mixer/mixer_sse.cpp | 11 |
4 files changed, 19 insertions, 16 deletions
diff --git a/alc/mixer/defs.h b/alc/mixer/defs.h index 55de2e67..19fb42d0 100644 --- a/alc/mixer/defs.h +++ b/alc/mixer/defs.h @@ -32,7 +32,7 @@ const ALfloat *Resample_(const InterpState *state, const ALfloat *RESTRICT src, template<InstSetType InstTag> void Mix_(const ALfloat *data, const al::span<FloatBufferLine> OutBuffer, ALfloat *CurrentGains, const ALfloat *TargetGains, const ALsizei Counter, const ALsizei OutPos, const ALsizei BufferSize); template<InstSetType InstTag> -void MixRow_(ALfloat *OutBuffer, const ALfloat *Gains, const al::span<const FloatBufferLine> InSamples, const ALsizei InPos, const ALsizei BufferSize); +void MixRow_(ALfloat *OutBuffer, const al::span<const ALfloat> Gains, const ALfloat *InSamples, const ALsizei InStride, const ALsizei BufferSize); template<InstSetType InstTag> void MixHrtf_(FloatBufferLine &LeftOut, FloatBufferLine &RightOut, const ALfloat *InSamples, float2 *AccumSamples, const ALsizei OutPos, const ALsizei IrSize, MixHrtfFilter *hrtfparams, const ALsizei BufferSize); diff --git a/alc/mixer/mixer_c.cpp b/alc/mixer/mixer_c.cpp index ff20bb2b..4985933c 100644 --- a/alc/mixer/mixer_c.cpp +++ b/alc/mixer/mixer_c.cpp @@ -189,15 +189,16 @@ void Mix_<CTag>(const ALfloat *data, const al::span<FloatBufferLine> OutBuffer, * stepping is necessary. */ template<> -void MixRow_<CTag>(ALfloat *OutBuffer, const ALfloat *Gains, - const al::span<const FloatBufferLine> InSamples, const ALsizei InPos, const ALsizei BufferSize) +void MixRow_<CTag>(ALfloat *OutBuffer, const al::span<const ALfloat> Gains, + const ALfloat *InSamples, const ALsizei InStride, const ALsizei BufferSize) { ASSUME(BufferSize > 0); - for(const FloatBufferLine &input : InSamples) + for(const ALfloat gain : Gains) { - const ALfloat *RESTRICT src{input.data()+InPos}; - const ALfloat gain{*(Gains++)}; + const ALfloat *RESTRICT src{InSamples}; + InSamples += InStride; + if(!(std::fabs(gain) > GAIN_SILENCE_THRESHOLD)) continue; diff --git a/alc/mixer/mixer_neon.cpp b/alc/mixer/mixer_neon.cpp index 40cbdb23..c6ea2c60 100644 --- a/alc/mixer/mixer_neon.cpp +++ b/alc/mixer/mixer_neon.cpp @@ -276,15 +276,16 @@ void Mix_<NEONTag>(const ALfloat *data, const al::span<FloatBufferLine> OutBuffe } template<> -void MixRow_<NEONTag>(ALfloat *OutBuffer, const ALfloat *Gains, - const al::span<const FloatBufferLine> InSamples, const ALsizei InPos, const ALsizei BufferSize) +void MixRow_<NEONTag>(ALfloat *OutBuffer, const al::span<const ALfloat> Gains, + const ALfloat *InSamples, const ALsizei InStride, const ALsizei BufferSize) { ASSUME(BufferSize > 0); - for(const FloatBufferLine &input : InSamples) + for(const ALfloat gain : Gains) { - const ALfloat *RESTRICT src{al::assume_aligned<16>(input.data()+InPos)}; - const ALfloat gain{*(Gains++)}; + const ALfloat *RESTRICT src{InSamples}; + InSamples += InStride; + if(!(std::fabs(gain) > GAIN_SILENCE_THRESHOLD)) continue; diff --git a/alc/mixer/mixer_sse.cpp b/alc/mixer/mixer_sse.cpp index 6c7715fc..b5958c8e 100644 --- a/alc/mixer/mixer_sse.cpp +++ b/alc/mixer/mixer_sse.cpp @@ -229,15 +229,16 @@ void Mix_<SSETag>(const ALfloat *data, const al::span<FloatBufferLine> OutBuffer } template<> -void MixRow_<SSETag>(ALfloat *OutBuffer, const ALfloat *Gains, - const al::span<const FloatBufferLine> InSamples, const ALsizei InPos, const ALsizei BufferSize) +void MixRow_<SSETag>(ALfloat *OutBuffer, const al::span<const ALfloat> Gains, + const ALfloat *InSamples, const ALsizei InStride, const ALsizei BufferSize) { ASSUME(BufferSize > 0); - for(const FloatBufferLine &input : InSamples) + for(const ALfloat gain : Gains) { - const ALfloat *RESTRICT src{al::assume_aligned<16>(input.data()+InPos)}; - const ALfloat gain{*(Gains++)}; + const ALfloat *RESTRICT src{InSamples}; + InSamples += InStride; + if(!(std::fabs(gain) > GAIN_SILENCE_THRESHOLD)) continue; |