Minor cleanups for mixer_inc
[openal-soft.git] / Alc / mixer_c.c
bloba7d47840579969aa97b2851a4042b9fae3aef008
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;
39 static __inline void ApplyValue(ALfloat *RESTRICT Output, ALfloat value, const ALfloat *DrySend)
41 ALuint c;
42 for(c = 0;c < MaxChannels;c++)
43 Output[c] += value*DrySend[c];
47 #define SUFFIX C
48 #define Sampler point32
49 #include "mixer_inc.c"
50 #undef Sampler
51 #define Sampler lerp32
52 #include "mixer_inc.c"
53 #undef Sampler
54 #define Sampler cubic32
55 #include "mixer_inc.c"
56 #undef Sampler
57 #undef SUFFIX