Rename the bsinc resampler to bsinc12
[openal-soft.git] / Alc / mixer_defs.h
blob364bbf7a30936d960c80660afbc508a04c239795
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_copy_C(const InterpState *state, const ALfloat *restrict src, ALsizei frac, ALint increment, ALfloat *restrict dst, ALsizei dstlen);
16 const ALfloat *Resample_point_C(const InterpState *state, const ALfloat *restrict src, ALsizei frac, ALint increment, ALfloat *restrict dst, ALsizei dstlen);
17 const ALfloat *Resample_lerp_C(const InterpState *state, const ALfloat *restrict src, ALsizei frac, ALint increment, ALfloat *restrict dst, ALsizei dstlen);
18 const ALfloat *Resample_fir4_C(const InterpState *state, const ALfloat *restrict src, ALsizei frac, ALint increment, ALfloat *restrict dst, ALsizei dstlen);
19 const ALfloat *Resample_bsinc_C(const InterpState *state, const ALfloat *restrict src, ALsizei frac, ALint increment, ALfloat *restrict dst, ALsizei dstlen);
22 /* C mixers */
23 void MixHrtf_C(ALfloat *restrict LeftOut, ALfloat *restrict RightOut,
24 const ALfloat *data, ALsizei Offset, ALsizei OutPos,
25 const ALsizei IrSize, struct MixHrtfParams *hrtfparams,
26 struct HrtfState *hrtfstate, ALsizei BufferSize);
27 void MixHrtfBlend_C(ALfloat *restrict LeftOut, ALfloat *restrict RightOut,
28 const ALfloat *data, ALsizei Offset, ALsizei OutPos,
29 const ALsizei IrSize, const HrtfParams *oldparams,
30 MixHrtfParams *newparams, HrtfState *hrtfstate,
31 ALsizei BufferSize);
32 void MixDirectHrtf_C(ALfloat *restrict LeftOut, ALfloat *restrict RightOut,
33 const ALfloat *data, ALsizei Offset, const ALsizei IrSize,
34 const ALfloat (*restrict Coeffs)[2], ALfloat (*restrict Values)[2],
35 ALsizei BufferSize);
36 void Mix_C(const ALfloat *data, ALsizei OutChans, ALfloat (*restrict OutBuffer)[BUFFERSIZE],
37 ALfloat *CurrentGains, const ALfloat *TargetGains, ALsizei Counter, ALsizei OutPos,
38 ALsizei BufferSize);
39 void MixRow_C(ALfloat *OutBuffer, const ALfloat *Gains,
40 const ALfloat (*restrict data)[BUFFERSIZE], ALsizei InChans,
41 ALsizei InPos, ALsizei BufferSize);
43 /* SSE mixers */
44 void MixHrtf_SSE(ALfloat *restrict LeftOut, ALfloat *restrict RightOut,
45 const ALfloat *data, ALsizei Offset, ALsizei OutPos,
46 const ALsizei IrSize, struct MixHrtfParams *hrtfparams,
47 struct HrtfState *hrtfstate, ALsizei BufferSize);
48 void MixHrtfBlend_SSE(ALfloat *restrict LeftOut, ALfloat *restrict RightOut,
49 const ALfloat *data, ALsizei Offset, ALsizei OutPos,
50 const ALsizei IrSize, const HrtfParams *oldparams,
51 MixHrtfParams *newparams, HrtfState *hrtfstate,
52 ALsizei BufferSize);
53 void MixDirectHrtf_SSE(ALfloat *restrict LeftOut, ALfloat *restrict RightOut,
54 const ALfloat *data, ALsizei Offset, const ALsizei IrSize,
55 const ALfloat (*restrict Coeffs)[2], ALfloat (*restrict Values)[2],
56 ALsizei BufferSize);
57 void Mix_SSE(const ALfloat *data, ALsizei OutChans, ALfloat (*restrict OutBuffer)[BUFFERSIZE],
58 ALfloat *CurrentGains, const ALfloat *TargetGains, ALsizei Counter, ALsizei OutPos,
59 ALsizei BufferSize);
60 void MixRow_SSE(ALfloat *OutBuffer, const ALfloat *Gains,
61 const ALfloat (*restrict data)[BUFFERSIZE], ALsizei InChans,
62 ALsizei InPos, ALsizei BufferSize);
64 /* SSE resamplers */
65 inline void InitiatePositionArrays(ALsizei frac, ALint increment, ALsizei *restrict frac_arr, ALint *restrict pos_arr, ALsizei size)
67 ALsizei i;
69 pos_arr[0] = 0;
70 frac_arr[0] = frac;
71 for(i = 1;i < size;i++)
73 ALint frac_tmp = frac_arr[i-1] + increment;
74 pos_arr[i] = pos_arr[i-1] + (frac_tmp>>FRACTIONBITS);
75 frac_arr[i] = frac_tmp&FRACTIONMASK;
79 const ALfloat *Resample_lerp_SSE2(const InterpState *state, const ALfloat *restrict src,
80 ALsizei frac, ALint increment, ALfloat *restrict dst,
81 ALsizei numsamples);
82 const ALfloat *Resample_lerp_SSE41(const InterpState *state, const ALfloat *restrict src,
83 ALsizei frac, ALint increment, ALfloat *restrict dst,
84 ALsizei numsamples);
86 const ALfloat *Resample_fir4_SSE3(const InterpState *state, const ALfloat *restrict src,
87 ALsizei frac, ALint increment, ALfloat *restrict dst,
88 ALsizei numsamples);
89 const ALfloat *Resample_fir4_SSE41(const InterpState *state, const ALfloat *restrict src,
90 ALsizei frac, ALint increment, ALfloat *restrict dst,
91 ALsizei numsamples);
93 const ALfloat *Resample_bsinc_SSE(const InterpState *state, const ALfloat *restrict src,
94 ALsizei frac, ALint increment, ALfloat *restrict dst,
95 ALsizei dstlen);
97 /* Neon mixers */
98 void MixHrtf_Neon(ALfloat *restrict LeftOut, ALfloat *restrict RightOut,
99 const ALfloat *data, ALsizei Offset, ALsizei OutPos,
100 const ALsizei IrSize, struct MixHrtfParams *hrtfparams,
101 struct HrtfState *hrtfstate, ALsizei BufferSize);
102 void MixHrtfBlend_Neon(ALfloat *restrict LeftOut, ALfloat *restrict RightOut,
103 const ALfloat *data, ALsizei Offset, ALsizei OutPos,
104 const ALsizei IrSize, const HrtfParams *oldparams,
105 MixHrtfParams *newparams, HrtfState *hrtfstate,
106 ALsizei BufferSize);
107 void MixDirectHrtf_Neon(ALfloat *restrict LeftOut, ALfloat *restrict RightOut,
108 const ALfloat *data, ALsizei Offset, const ALsizei IrSize,
109 const ALfloat (*restrict Coeffs)[2], ALfloat (*restrict Values)[2],
110 ALsizei BufferSize);
111 void Mix_Neon(const ALfloat *data, ALsizei OutChans, ALfloat (*restrict OutBuffer)[BUFFERSIZE],
112 ALfloat *CurrentGains, const ALfloat *TargetGains, ALsizei Counter, ALsizei OutPos,
113 ALsizei BufferSize);
114 void MixRow_Neon(ALfloat *OutBuffer, const ALfloat *Gains,
115 const ALfloat (*restrict data)[BUFFERSIZE], ALsizei InChans,
116 ALsizei InPos, ALsizei BufferSize);
118 /* Neon resamplers */
119 const ALfloat *Resample_lerp_Neon(const InterpState *state, const ALfloat *restrict src,
120 ALsizei frac, ALint increment, ALfloat *restrict dst,
121 ALsizei numsamples);
122 const ALfloat *Resample_fir4_Neon(const InterpState *state, const ALfloat *restrict src,
123 ALsizei frac, ALint increment, ALfloat *restrict dst,
124 ALsizei numsamples);
125 const ALfloat *Resample_bsinc_Neon(const InterpState *state, const ALfloat *restrict src,
126 ALsizei frac, ALint increment, ALfloat *restrict dst,
127 ALsizei dstlen);
129 #endif /* MIXER_DEFS_H */