Handle loopback devices when deciding to use HRTF
[openal-soft.git] / Alc / mixer_defs.h
blob62dad9dc81341366407c2e775aa416cecb84c915
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 HrtfParams;
12 struct HrtfState;
14 /* C resamplers */
15 const ALfloat *Resample_copy32_C(const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen);
16 const ALfloat *Resample_point32_C(const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen);
17 const ALfloat *Resample_lerp32_C(const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen);
18 const ALfloat *Resample_cubic32_C(const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen);
21 /* C mixers */
22 void MixHrtf_C(ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *data,
23 ALuint Offset, const ALuint IrSize, const struct HrtfParams *hrtfparams,
24 struct HrtfState *hrtfstate, ALuint BufferSize);
25 void Mix_C(const ALfloat *data, ALuint OutChans, ALfloat (*restrict OutBuffer)[BUFFERSIZE],
26 struct MixGains *Gains, ALuint Counter, ALuint OutPos, ALuint BufferSize);
28 /* SSE mixers */
29 void MixHrtf_SSE(ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *data,
30 ALuint Offset, const ALuint IrSize, const struct HrtfParams *hrtfparams,
31 struct HrtfState *hrtfstate, ALuint BufferSize);
32 void Mix_SSE(const ALfloat *data, ALuint OutChans, ALfloat (*restrict OutBuffer)[BUFFERSIZE],
33 struct MixGains *Gains, ALuint Counter, ALuint OutPos, ALuint BufferSize);
35 /* SSE resamplers */
36 inline void InitiatePositionArrays(ALuint frac, ALuint increment, ALuint *frac_arr, ALuint *pos_arr, ALuint size)
38 ALuint i;
40 pos_arr[0] = 0;
41 frac_arr[0] = frac;
42 for(i = 1;i < size;i++)
44 ALuint frac_tmp = frac_arr[i-1] + increment;
45 pos_arr[i] = pos_arr[i-1] + (frac_tmp>>FRACTIONBITS);
46 frac_arr[i] = frac_tmp&FRACTIONMASK;
50 const ALfloat *Resample_lerp32_SSE2(const ALfloat *src, ALuint frac, ALuint increment,
51 ALfloat *restrict dst, ALuint numsamples);
52 const ALfloat *Resample_lerp32_SSE41(const ALfloat *src, ALuint frac, ALuint increment,
53 ALfloat *restrict dst, ALuint numsamples);
55 /* Neon mixers */
56 void MixHrtf_Neon(ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *data,
57 ALuint Offset, const ALuint IrSize, const struct HrtfParams *hrtfparams,
58 struct HrtfState *hrtfstate, ALuint BufferSize);
59 void Mix_Neon(const ALfloat *data, ALuint OutChans, ALfloat (*restrict OutBuffer)[BUFFERSIZE],
60 struct MixGains *Gains, ALuint Counter, ALuint OutPos, ALuint BufferSize);
62 #endif /* MIXER_DEFS_H */