mixer_defs.h 4.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #ifndef MIXER_DEFS_H
  2. #define MIXER_DEFS_H
  3. #include "AL/alc.h"
  4. #include "AL/al.h"
  5. #include "alMain.h"
  6. #include "alu.h"
  7. struct MixGains;
  8. struct HrtfParams;
  9. struct HrtfState;
  10. /* C resamplers */
  11. const ALfloat *Resample_copy32_C(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen);
  12. const ALfloat *Resample_point32_C(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen);
  13. const ALfloat *Resample_lerp32_C(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen);
  14. const ALfloat *Resample_fir4_32_C(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen);
  15. const ALfloat *Resample_fir8_32_C(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen);
  16. const ALfloat *Resample_bsinc32_C(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen);
  17. /* C mixers */
  18. void MixHrtf_C(ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *data,
  19. ALuint Counter, ALuint Offset, ALuint OutPos, const ALuint IrSize,
  20. const struct HrtfParams *hrtfparams, struct HrtfState *hrtfstate,
  21. ALuint BufferSize);
  22. void Mix_C(const ALfloat *data, ALuint OutChans, ALfloat (*restrict OutBuffer)[BUFFERSIZE],
  23. struct MixGains *Gains, ALuint Counter, ALuint OutPos, ALuint BufferSize);
  24. /* SSE mixers */
  25. void MixHrtf_SSE(ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *data,
  26. ALuint Counter, ALuint Offset, ALuint OutPos, const ALuint IrSize,
  27. const struct HrtfParams *hrtfparams, struct HrtfState *hrtfstate,
  28. ALuint BufferSize);
  29. void Mix_SSE(const ALfloat *data, ALuint OutChans, ALfloat (*restrict OutBuffer)[BUFFERSIZE],
  30. struct MixGains *Gains, ALuint Counter, ALuint OutPos, ALuint BufferSize);
  31. /* SSE resamplers */
  32. inline void InitiatePositionArrays(ALuint frac, ALuint increment, ALuint *frac_arr, ALuint *pos_arr, ALuint size)
  33. {
  34. ALuint i;
  35. pos_arr[0] = 0;
  36. frac_arr[0] = frac;
  37. for(i = 1;i < size;i++)
  38. {
  39. ALuint frac_tmp = frac_arr[i-1] + increment;
  40. pos_arr[i] = pos_arr[i-1] + (frac_tmp>>FRACTIONBITS);
  41. frac_arr[i] = frac_tmp&FRACTIONMASK;
  42. }
  43. }
  44. const ALfloat *Resample_bsinc32_SSE(const BsincState *state, const ALfloat *src, ALuint frac,
  45. ALuint increment, ALfloat *restrict dst, ALuint dstlen);
  46. const ALfloat *Resample_lerp32_SSE2(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment,
  47. ALfloat *restrict dst, ALuint numsamples);
  48. const ALfloat *Resample_lerp32_SSE41(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment,
  49. ALfloat *restrict dst, ALuint numsamples);
  50. const ALfloat *Resample_fir4_32_SSE3(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment,
  51. ALfloat *restrict dst, ALuint numsamples);
  52. const ALfloat *Resample_fir4_32_SSE41(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment,
  53. ALfloat *restrict dst, ALuint numsamples);
  54. const ALfloat *Resample_fir8_32_SSE3(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment,
  55. ALfloat *restrict dst, ALuint numsamples);
  56. const ALfloat *Resample_fir8_32_SSE41(const BsincState *state, const ALfloat *src, ALuint frac, ALuint increment,
  57. ALfloat *restrict dst, ALuint numsamples);
  58. /* Neon mixers */
  59. void MixHrtf_Neon(ALfloat (*restrict OutBuffer)[BUFFERSIZE], const ALfloat *data,
  60. ALuint Counter, ALuint Offset, ALuint OutPos, const ALuint IrSize,
  61. const struct HrtfParams *hrtfparams, struct HrtfState *hrtfstate,
  62. ALuint BufferSize);
  63. void Mix_Neon(const ALfloat *data, ALuint OutChans, ALfloat (*restrict OutBuffer)[BUFFERSIZE],
  64. struct MixGains *Gains, ALuint Counter, ALuint OutPos, ALuint BufferSize);
  65. #endif /* MIXER_DEFS_H */