Apply HRTF mixer coefficients with stepping using SSE
[openal-soft.git] / Alc / mixer_c.c
blobeeb75bf449cd51dcbc837d77b82484191a63c222
1 #include "config.h"
3 #include "AL/al.h"
4 #include "AL/alc.h"
5 #include "alMain.h"
6 #include "alu.h"
9 static __inline void ApplyCoeffsStep(ALuint Offset, ALfloat (*RESTRICT Values)[2],
10 ALfloat (*RESTRICT Coeffs)[2],
11 ALfloat (*RESTRICT CoeffStep)[2],
12 ALfloat left, ALfloat right)
14 ALuint c;
15 for(c = 0;c < HRIR_LENGTH;c++)
17 const ALuint off = (Offset+c)&HRIR_MASK;
18 Values[off][0] += Coeffs[c][0] * left;
19 Values[off][1] += Coeffs[c][1] * right;
20 Coeffs[c][0] += CoeffStep[c][0];
21 Coeffs[c][1] += CoeffStep[c][1];
25 static __inline void ApplyCoeffs(ALuint Offset, ALfloat (*RESTRICT Values)[2],
26 ALfloat (*RESTRICT Coeffs)[2],
27 ALfloat left, ALfloat right)
29 ALuint c;
30 for(c = 0;c < HRIR_LENGTH;c++)
32 const ALuint off = (Offset+c)&HRIR_MASK;
33 Values[off][0] += Coeffs[c][0] * left;
34 Values[off][1] += Coeffs[c][1] * right;
38 #define SUFFIX C
39 #define SAMPLER point32
40 #include "mixer_inc.c"
41 #undef SAMPLER
42 #define SAMPLER lerp32
43 #include "mixer_inc.c"
44 #undef SAMPLER
45 #define SAMPLER cubic32
46 #include "mixer_inc.c"
47 #undef SAMPLER
48 #undef SUFFIX