diff options
author | Chris Robinson <[email protected]> | 2014-11-24 22:26:42 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-11-24 22:26:42 -0800 |
commit | 8e6c131b364e674429c20a03a54a7aac487ec704 (patch) | |
tree | b339b9c4f375fb930b97f0153b4293465daaa839 /Alc/mixer_sse.c | |
parent | cbe22763eec9391bce03ebc2294ec742be1f381b (diff) |
Use a separate method to set initial HRTF coefficients
Diffstat (limited to 'Alc/mixer_sse.c')
-rw-r--r-- | Alc/mixer_sse.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Alc/mixer_sse.c b/Alc/mixer_sse.c index d86cf749..75f50f88 100644 --- a/Alc/mixer_sse.c +++ b/Alc/mixer_sse.c @@ -19,6 +19,23 @@ #include "mixer_defs.h" +static inline void SetupCoeffs(ALfloat (*restrict OutCoeffs)[2], + const HrtfParams *hrtfparams, + ALuint IrSize, ALuint Counter) +{ + const __m128 counter4 = _mm_set1_ps((float)Counter); + __m128 coeffs, step4; + ALuint i; + + for(i = 0;i < IrSize;i += 2) + { + step4 = _mm_load_ps(&hrtfparams->CoeffStep[i][0]); + coeffs = _mm_load_ps(&hrtfparams->Coeffs[i][0]); + coeffs = _mm_sub_ps(coeffs, _mm_mul_ps(step4, counter4)); + _mm_store_ps(&OutCoeffs[i][0], coeffs); + } +} + static inline void ApplyCoeffsStep(ALuint Offset, ALfloat (*restrict Values)[2], const ALuint IrSize, ALfloat (*restrict Coeffs)[2], |