Recognize Headset formfactors as headphones
[openal-soft.git] / Alc / mixer_defs.h
blob1572ac36f74eedf2cc77e3a39142de23961aeffd
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 *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen);
16 const ALfloat *Resample_point32_C(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen);
17 const ALfloat *Resample_lerp32_C(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen);
18 const ALfloat *Resample_fir4_32_C(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen);
19 const ALfloat *Resample_fir8_32_C(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen);
20 const ALfloat *Resample_bsinc32_C(const BsincState *state, const ALfloat *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 struct MixGains *Gains, ALuint Counter, ALuint OutPos, ALuint BufferSize);
34 void MixRow_C(ALfloat *OutBuffer, const ALfloat *Gains, ALfloat (*restrict data)[BUFFERSIZE],
35 ALuint InChans, ALuint BufferSize);
37 /* SSE mixers */
38 void MixHrtf_SSE(ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALuint lidx, ALuint ridx,
39 const ALfloat *data, ALuint Counter, ALuint Offset, ALuint OutPos,
40 const ALuint IrSize, const struct MixHrtfParams *hrtfparams,
41 struct HrtfState *hrtfstate, ALuint BufferSize);
42 void MixDirectHrtf_SSE(ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALuint lidx, ALuint ridx,
43 const ALfloat *data, ALuint Offset, const ALuint IrSize,
44 ALfloat (*restrict Coeffs)[2], ALfloat (*restrict Values)[2],
45 ALuint BufferSize);
46 void Mix_SSE(const ALfloat *data, ALuint OutChans, ALfloat (*restrict OutBuffer)[BUFFERSIZE],
47 struct MixGains *Gains, ALuint Counter, ALuint OutPos, ALuint BufferSize);
48 void MixRow_SSE(ALfloat *OutBuffer, const ALfloat *Gains, ALfloat (*restrict data)[BUFFERSIZE],
49 ALuint InChans, ALuint BufferSize);
51 /* SSE resamplers */
52 inline void InitiatePositionArrays(ALuint frac, ALuint increment, ALuint *frac_arr, ALuint *pos_arr, ALuint size)
54 ALuint i;
56 pos_arr[0] = 0;
57 frac_arr[0] = frac;
58 for(i = 1;i < size;i++)
60 ALuint frac_tmp = frac_arr[i-1] + increment;
61 pos_arr[i] = pos_arr[i-1] + (frac_tmp>>FRACTIONBITS);
62 frac_arr[i] = frac_tmp&FRACTIONMASK;
66 const ALfloat *Resample_bsinc32_SSE(const BsincState *state, const ALfloat *src, ALuint frac,
67 ALuint increment, ALfloat *restrict dst, ALuint dstlen);
69 const ALfloat *Resample_lerp32_SSE2(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment,
70 ALfloat *restrict dst, ALuint numsamples);
71 const ALfloat *Resample_lerp32_SSE41(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment,
72 ALfloat *restrict dst, ALuint numsamples);
74 const ALfloat *Resample_fir4_32_SSE3(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment,
75 ALfloat *restrict dst, ALuint numsamples);
76 const ALfloat *Resample_fir4_32_SSE41(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment,
77 ALfloat *restrict dst, ALuint numsamples);
79 const ALfloat *Resample_fir8_32_SSE3(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment,
80 ALfloat *restrict dst, ALuint numsamples);
81 const ALfloat *Resample_fir8_32_SSE41(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment,
82 ALfloat *restrict dst, ALuint numsamples);
84 /* Neon mixers */
85 void MixHrtf_Neon(ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALuint lidx, ALuint ridx,
86 const ALfloat *data, ALuint Counter, ALuint Offset, ALuint OutPos,
87 const ALuint IrSize, const struct MixHrtfParams *hrtfparams,
88 struct HrtfState *hrtfstate, ALuint BufferSize);
89 void MixDirectHrtf_Neon(ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALuint lidx, ALuint ridx,
90 const ALfloat *data, ALuint Offset, const ALuint IrSize,
91 ALfloat (*restrict Coeffs)[2], ALfloat (*restrict Values)[2],
92 ALuint BufferSize);
93 void Mix_Neon(const ALfloat *data, ALuint OutChans, ALfloat (*restrict OutBuffer)[BUFFERSIZE],
94 struct MixGains *Gains, ALuint Counter, ALuint OutPos, ALuint BufferSize);
95 void MixRow_Neon(ALfloat *OutBuffer, const ALfloat *Gains, ALfloat (*restrict data)[BUFFERSIZE],
96 ALuint InChans, ALuint BufferSize);
98 #endif /* MIXER_DEFS_H */