Avoid redundantly storing distance model settings
[openal-soft.git] / Alc / mixer_defs.h
blob5db804b1c4c41581f9f49577bb4440406f681eeb
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 Mix_C(const ALfloat *data, ALuint OutChans, ALfloat (*restrict OutBuffer)[BUFFERSIZE],
29 struct MixGains *Gains, ALuint Counter, ALuint OutPos, ALuint BufferSize);
31 /* SSE mixers */
32 void MixHrtf_SSE(ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALuint lidx, ALuint ridx,
33 const ALfloat *data, ALuint Counter, ALuint Offset, ALuint OutPos,
34 const ALuint IrSize, const struct MixHrtfParams *hrtfparams,
35 struct HrtfState *hrtfstate, ALuint BufferSize);
36 void Mix_SSE(const ALfloat *data, ALuint OutChans, ALfloat (*restrict OutBuffer)[BUFFERSIZE],
37 struct MixGains *Gains, ALuint Counter, ALuint OutPos, ALuint BufferSize);
39 /* SSE resamplers */
40 inline void InitiatePositionArrays(ALuint frac, ALuint increment, ALuint *frac_arr, ALuint *pos_arr, ALuint size)
42 ALuint i;
44 pos_arr[0] = 0;
45 frac_arr[0] = frac;
46 for(i = 1;i < size;i++)
48 ALuint frac_tmp = frac_arr[i-1] + increment;
49 pos_arr[i] = pos_arr[i-1] + (frac_tmp>>FRACTIONBITS);
50 frac_arr[i] = frac_tmp&FRACTIONMASK;
54 const ALfloat *Resample_bsinc32_SSE(const BsincState *state, const ALfloat *src, ALuint frac,
55 ALuint increment, ALfloat *restrict dst, ALuint dstlen);
57 const ALfloat *Resample_lerp32_SSE2(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment,
58 ALfloat *restrict dst, ALuint numsamples);
59 const ALfloat *Resample_lerp32_SSE41(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment,
60 ALfloat *restrict dst, ALuint numsamples);
62 const ALfloat *Resample_fir4_32_SSE3(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment,
63 ALfloat *restrict dst, ALuint numsamples);
64 const ALfloat *Resample_fir4_32_SSE41(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment,
65 ALfloat *restrict dst, ALuint numsamples);
67 const ALfloat *Resample_fir8_32_SSE3(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment,
68 ALfloat *restrict dst, ALuint numsamples);
69 const ALfloat *Resample_fir8_32_SSE41(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment,
70 ALfloat *restrict dst, ALuint numsamples);
72 /* Neon mixers */
73 void MixHrtf_Neon(ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALuint lidx, ALuint ridx,
74 const ALfloat *data, ALuint Counter, ALuint Offset, ALuint OutPos,
75 const ALuint IrSize, const struct MixHrtfParams *hrtfparams,
76 struct HrtfState *hrtfstate, ALuint BufferSize);
77 void Mix_Neon(const ALfloat *data, ALuint OutChans, ALfloat (*restrict OutBuffer)[BUFFERSIZE],
78 struct MixGains *Gains, ALuint Counter, ALuint OutPos, ALuint BufferSize);
80 #endif /* MIXER_DEFS_H */