diff options
author | Chris Robinson <[email protected]> | 2019-10-02 22:38:19 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-10-02 22:38:19 -0700 |
commit | b350ae3766f0f85183c410b4c77ac9a0eb388511 (patch) | |
tree | 49b70ba082ac4daba2b8404638386b07d3d87354 /alc/mixer/mixer_neon.cpp | |
parent | bce6889173245031cf1440d70858180cc2716adf (diff) |
Remove the Offset parameter from ApplyCoeffs
Diffstat (limited to 'alc/mixer/mixer_neon.cpp')
-rw-r--r-- | alc/mixer/mixer_neon.cpp | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/alc/mixer/mixer_neon.cpp b/alc/mixer/mixer_neon.cpp index c0fc1651..ae782897 100644 --- a/alc/mixer/mixer_neon.cpp +++ b/alc/mixer/mixer_neon.cpp @@ -13,6 +13,32 @@ #include "hrtfbase.h" +namespace { + +inline void ApplyCoeffs(float2 *RESTRICT Values, const ALuint IrSize, const HrirArray &Coeffs, + const float left, const float right) +{ + float32x4_t leftright4; + { + float32x2_t leftright2 = vdup_n_f32(0.0); + leftright2 = vset_lane_f32(left, leftright2, 0); + leftright2 = vset_lane_f32(right, leftright2, 1); + leftright4 = vcombine_f32(leftright2, leftright2); + } + + ASSUME(IrSize >= 4); + for(ALuint c{0};c < IrSize;c += 2) + { + float32x4_t vals = vld1q_f32(&Values[c][0]); + float32x4_t coefs = vld1q_f32(&Coeffs[c][0]); + + vals = vmlaq_f32(vals, coefs, leftright4); + + vst1q_f32(&Values[c][0], vals); + } +} + +} // namespace template<> const ALfloat *Resample_<LerpTag,NEONTag>(const InterpState*, const ALfloat *RESTRICT src, @@ -163,30 +189,6 @@ const ALfloat *Resample_<FastBSincTag,NEONTag>(const InterpState *state, } -static inline void ApplyCoeffs(size_t /*Offset*/, float2 *RESTRICT Values, const ALuint IrSize, - const HrirArray &Coeffs, const float left, const float right) -{ - ASSUME(IrSize >= 4); - - float32x4_t leftright4; - { - float32x2_t leftright2 = vdup_n_f32(0.0); - leftright2 = vset_lane_f32(left, leftright2, 0); - leftright2 = vset_lane_f32(right, leftright2, 1); - leftright4 = vcombine_f32(leftright2, leftright2); - } - - for(ALuint c{0};c < IrSize;c += 2) - { - float32x4_t vals = vld1q_f32(&Values[c][0]); - float32x4_t coefs = vld1q_f32(&Coeffs[c][0]); - - vals = vmlaq_f32(vals, coefs, leftright4); - - vst1q_f32(&Values[c][0], vals); - } -} - template<> void MixHrtf_<NEONTag>(FloatBufferLine &LeftOut, FloatBufferLine &RightOut, const float *InSamples, float2 *AccumSamples, const size_t OutPos, const ALuint IrSize, |