From dc41f276d8a7c6c870aebe6123b25e3de4a32545 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 16 Apr 2020 01:47:33 -0700 Subject: Get rid of the specialized MixRow_ methods --- alc/mixer/defs.h | 3 --- alc/mixer/mixer_c.cpp | 24 ------------------------ alc/mixer/mixer_neon.cpp | 31 ------------------------------- alc/mixer/mixer_sse.cpp | 31 ------------------------------- 4 files changed, 89 deletions(-) (limited to 'alc/mixer') diff --git a/alc/mixer/defs.h b/alc/mixer/defs.h index 6e270fb4..0f3a0f3d 100644 --- a/alc/mixer/defs.h +++ b/alc/mixer/defs.h @@ -18,9 +18,6 @@ const float *Resample_(const InterpState *state, const float *RESTRICT src, ALui template void Mix_(const al::span InSamples, const al::span OutBuffer, float *CurrentGains, const float *TargetGains, const size_t Counter, const size_t OutPos); -template -void MixRow_(const al::span OutBuffer, const al::span Gains, - const float *InSamples, const size_t InStride); template void MixHrtf_(const float *InSamples, float2 *AccumSamples, const ALuint IrSize, diff --git a/alc/mixer/mixer_c.cpp b/alc/mixer/mixer_c.cpp index 716f2c4d..9858a4b4 100644 --- a/alc/mixer/mixer_c.cpp +++ b/alc/mixer/mixer_c.cpp @@ -196,27 +196,3 @@ void Mix_(const al::span InSamples, const al::span -void MixRow_(const al::span OutBuffer, const al::span Gains, - const float *InSamples, const size_t InStride) -{ - for(const float gain : Gains) - { - const float *RESTRICT input{InSamples}; - InSamples += InStride; - - if(!(std::fabs(gain) > GAIN_SILENCE_THRESHOLD)) - continue; - - auto do_mix = [gain](const float cur, const float src) noexcept -> float - { return cur + src*gain; }; - std::transform(OutBuffer.begin(), OutBuffer.end(), input, OutBuffer.begin(), do_mix); - } -} diff --git a/alc/mixer/mixer_neon.cpp b/alc/mixer/mixer_neon.cpp index 760ac58e..ee5b11a2 100644 --- a/alc/mixer/mixer_neon.cpp +++ b/alc/mixer/mixer_neon.cpp @@ -296,34 +296,3 @@ void Mix_(const al::span InSamples, const al::span -void MixRow_(const al::span OutBuffer, const al::span Gains, - const float *InSamples, const size_t InStride) -{ - for(const float gain : Gains) - { - const float *RESTRICT input{InSamples}; - InSamples += InStride; - - if(!(std::fabs(gain) > GAIN_SILENCE_THRESHOLD)) - continue; - - auto out_iter = OutBuffer.begin(); - if(size_t todo{OutBuffer.size() >> 2}) - { - const float32x4_t gain4{vdupq_n_f32(gain)}; - do { - const float32x4_t val4 = vld1q_f32(input); - float32x4_t dry4 = vld1q_f32(out_iter); - dry4 = vmlaq_f32(dry4, val4, gain4); - vst1q_f32(out_iter, dry4); - out_iter += 4; input += 4; - } while(--todo); - } - - auto do_mix = [gain](const float cur, const float src) noexcept -> float - { return cur + src*gain; }; - std::transform(out_iter, OutBuffer.end(), input, out_iter, do_mix); - } -} diff --git a/alc/mixer/mixer_sse.cpp b/alc/mixer/mixer_sse.cpp index 3ec14541..db60776d 100644 --- a/alc/mixer/mixer_sse.cpp +++ b/alc/mixer/mixer_sse.cpp @@ -268,34 +268,3 @@ void Mix_(const al::span InSamples, const al::span -void MixRow_(const al::span OutBuffer, const al::span Gains, - const float *InSamples, const size_t InStride) -{ - for(const float gain : Gains) - { - const float *RESTRICT input{InSamples}; - InSamples += InStride; - - if(!(std::fabs(gain) > GAIN_SILENCE_THRESHOLD)) - continue; - - auto out_iter = OutBuffer.begin(); - if(size_t todo{OutBuffer.size() >> 2}) - { - const __m128 gain4 = _mm_set1_ps(gain); - do { - const __m128 val4{_mm_load_ps(input)}; - __m128 dry4{_mm_load_ps(out_iter)}; - dry4 = _mm_add_ps(dry4, _mm_mul_ps(val4, gain4)); - _mm_store_ps(out_iter, dry4); - out_iter += 4; input += 4; - } while(--todo); - } - - auto do_mix = [gain](const float cur, const float src) noexcept -> float - { return cur + src*gain; }; - std::transform(out_iter, OutBuffer.end(), input, out_iter, do_mix); - } -} -- cgit v1.2.3