9 static __inline ALfloat
point32(const ALfloat
*vals
, ALint step
, ALint frac
)
10 { return vals
[0]; (void)step
; (void)frac
; }
11 static __inline ALfloat
lerp32(const ALfloat
*vals
, ALint step
, ALint frac
)
12 { return lerp(vals
[0], vals
[step
], frac
* (1.0f
/FRACTIONONE
)); }
13 static __inline ALfloat
cubic32(const ALfloat
*vals
, ALint step
, ALint frac
)
14 { return cubic(vals
[-step
], vals
[0], vals
[step
], vals
[step
+step
],
15 frac
* (1.0f
/FRACTIONONE
)); }
17 #define DECL_TEMPLATE(Sampler) \
18 void Resample_##Sampler##_C(const ALfloat *data, ALuint frac, \
19 ALuint increment, ALuint NumChannels, ALfloat *RESTRICT OutBuffer, \
26 for(i = 0;i < BufferSize+1;i++) \
28 value = Sampler(data + pos*NumChannels, NumChannels, frac); \
29 OutBuffer[i] = value; \
32 pos += frac>>FRACTIONBITS; \
33 frac &= FRACTIONMASK; \
37 DECL_TEMPLATE(point32
)
39 DECL_TEMPLATE(cubic32
)
44 static __inline
void ApplyCoeffsStep(ALuint Offset
, ALfloat (*RESTRICT Values
)[2],
46 ALfloat (*RESTRICT Coeffs
)[2],
47 ALfloat (*RESTRICT CoeffStep
)[2],
48 ALfloat left
, ALfloat right
)
51 for(c
= 0;c
< IrSize
;c
++)
53 const ALuint off
= (Offset
+c
)&HRIR_MASK
;
54 Values
[off
][0] += Coeffs
[c
][0] * left
;
55 Values
[off
][1] += Coeffs
[c
][1] * right
;
56 Coeffs
[c
][0] += CoeffStep
[c
][0];
57 Coeffs
[c
][1] += CoeffStep
[c
][1];
61 static __inline
void ApplyCoeffs(ALuint Offset
, ALfloat (*RESTRICT Values
)[2],
63 ALfloat (*RESTRICT Coeffs
)[2],
64 ALfloat left
, ALfloat right
)
67 for(c
= 0;c
< IrSize
;c
++)
69 const ALuint off
= (Offset
+c
)&HRIR_MASK
;
70 Values
[off
][0] += Coeffs
[c
][0] * left
;
71 Values
[off
][1] += Coeffs
[c
][1] * right
;
77 #include "mixer_inc.c"