Clean up some ringbuffer atomic calls
[openal-soft.git] / Alc / mixer_defs.h
blob2491600258215144f47288c9802bd56c9a138d58
1 #ifndef MIXER_DEFS_H
2 #define MIXER_DEFS_H
4 #include "AL/alc.h"
5 #include "AL/al.h"
6 #include "alMain.h"
7 #include "alu.h"
9 struct MixGains;
11 struct MixHrtfParams;
12 struct HrtfState;
14 /* C resamplers */
15 const ALfloat *Resample_copy32_C(const BsincState *state, const ALfloat *restrict src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen);
16 const ALfloat *Resample_point32_C(const BsincState *state, const ALfloat *restrict src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen);
17 const ALfloat *Resample_lerp32_C(const BsincState *state, const ALfloat *restrict src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen);
18 const ALfloat *Resample_fir4_32_C(const BsincState *state, const ALfloat *restrict src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen);
19 const ALfloat *Resample_fir8_32_C(const BsincState *state, const ALfloat *restrict src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen);
20 const ALfloat *Resample_bsinc32_C(const BsincState *state, const ALfloat *restrict src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen);
23 /* C mixers */
24 void MixHrtf_C(ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALuint lidx, ALuint ridx,
25 const ALfloat *data, ALuint Counter, ALuint Offset, ALuint OutPos,
26 const ALuint IrSize, const struct MixHrtfParams *hrtfparams,
27 struct HrtfState *hrtfstate, ALuint BufferSize);
28 void MixDirectHrtf_C(ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALuint lidx, ALuint ridx,
29 const ALfloat *data, ALuint Offset, const ALuint IrSize,
30 ALfloat (*restrict Coeffs)[2], ALfloat (*restrict Values)[2],
31 ALuint BufferSize);
32 void Mix_C(const ALfloat *data, ALuint OutChans, ALfloat (*restrict OutBuffer)[BUFFERSIZE],
33 ALfloat *CurrentGains, const ALfloat *TargetGains, ALuint Counter, ALuint OutPos,
34 ALuint BufferSize);
35 void MixRow_C(ALfloat *OutBuffer, const ALfloat *Gains,
36 const ALfloat (*restrict data)[BUFFERSIZE], ALuint InChans,
37 ALuint InPos, ALuint BufferSize);
39 /* SSE mixers */
40 void MixHrtf_SSE(ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALuint lidx, ALuint ridx,
41 const ALfloat *data, ALuint Counter, ALuint Offset, ALuint OutPos,
42 const ALuint IrSize, const struct MixHrtfParams *hrtfparams,
43 struct HrtfState *hrtfstate, ALuint BufferSize);
44 void MixDirectHrtf_SSE(ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALuint lidx, ALuint ridx,
45 const ALfloat *data, ALuint Offset, const ALuint IrSize,
46 ALfloat (*restrict Coeffs)[2], ALfloat (*restrict Values)[2],
47 ALuint BufferSize);
48 void Mix_SSE(const ALfloat *data, ALuint OutChans, ALfloat (*restrict OutBuffer)[BUFFERSIZE],
49 ALfloat *CurrentGains, const ALfloat *TargetGains, ALuint Counter, ALuint OutPos,
50 ALuint BufferSize);
51 void MixRow_SSE(ALfloat *OutBuffer, const ALfloat *Gains,
52 const ALfloat (*restrict data)[BUFFERSIZE], ALuint InChans,
53 ALuint InPos, ALuint BufferSize);
55 /* SSE resamplers */
56 inline void InitiatePositionArrays(ALuint frac, ALuint increment, ALuint *restrict frac_arr, ALuint *restrict pos_arr, ALuint size)
58 ALuint i;
60 pos_arr[0] = 0;
61 frac_arr[0] = frac;
62 for(i = 1;i < size;i++)
64 ALuint frac_tmp = frac_arr[i-1] + increment;
65 pos_arr[i] = pos_arr[i-1] + (frac_tmp>>FRACTIONBITS);
66 frac_arr[i] = frac_tmp&FRACTIONMASK;
70 const ALfloat *Resample_bsinc32_SSE(const BsincState *state, const ALfloat *restrict src, ALuint frac,
71 ALuint increment, ALfloat *restrict dst, ALuint dstlen);
73 const ALfloat *Resample_lerp32_SSE2(const BsincState *state, const ALfloat *restrict src,
74 ALuint frac, ALuint increment, ALfloat *restrict dst,
75 ALuint numsamples);
76 const ALfloat *Resample_lerp32_SSE41(const BsincState *state, const ALfloat *restrict src,
77 ALuint frac, ALuint increment, ALfloat *restrict dst,
78 ALuint numsamples);
80 const ALfloat *Resample_fir4_32_SSE3(const BsincState *state, const ALfloat *restrict src,
81 ALuint frac, ALuint increment, ALfloat *restrict dst,
82 ALuint numsamples);
83 const ALfloat *Resample_fir4_32_SSE41(const BsincState *state, const ALfloat *restrict src,
84 ALuint frac, ALuint increment, ALfloat *restrict dst,
85 ALuint numsamples);
87 const ALfloat *Resample_fir8_32_SSE3(const BsincState *state, const ALfloat *restrict src,
88 ALuint frac, ALuint increment, ALfloat *restrict dst,
89 ALuint numsamples);
90 const ALfloat *Resample_fir8_32_SSE41(const BsincState *state, const ALfloat *restrict src,
91 ALuint frac, ALuint increment, ALfloat *restrict dst,
92 ALuint numsamples);
94 /* Neon mixers */
95 void MixHrtf_Neon(ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALuint lidx, ALuint ridx,
96 const ALfloat *data, ALuint Counter, ALuint Offset, ALuint OutPos,
97 const ALuint IrSize, const struct MixHrtfParams *hrtfparams,
98 struct HrtfState *hrtfstate, ALuint BufferSize);
99 void MixDirectHrtf_Neon(ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALuint lidx, ALuint ridx,
100 const ALfloat *data, ALuint Offset, const ALuint IrSize,
101 ALfloat (*restrict Coeffs)[2], ALfloat (*restrict Values)[2],
102 ALuint BufferSize);
103 void Mix_Neon(const ALfloat *data, ALuint OutChans, ALfloat (*restrict OutBuffer)[BUFFERSIZE],
104 ALfloat *CurrentGains, const ALfloat *TargetGains, ALuint Counter, ALuint OutPos,
105 ALuint BufferSize);
106 void MixRow_Neon(ALfloat *OutBuffer, const ALfloat *Gains,
107 const ALfloat (*restrict data)[BUFFERSIZE], ALuint InChans,
108 ALuint InPos, ALuint BufferSize);
110 #endif /* MIXER_DEFS_H */