mixer_defs.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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 MixHrtfParams;
  9. struct HrtfState;
  10. /* C resamplers */
  11. const ALfloat *Resample_copy32_C(const BsincState *state, const ALfloat *restrict src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen);
  12. const ALfloat *Resample_point32_C(const BsincState *state, const ALfloat *restrict src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen);
  13. const ALfloat *Resample_lerp32_C(const BsincState *state, const ALfloat *restrict src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen);
  14. const ALfloat *Resample_fir4_32_C(const BsincState *state, const ALfloat *restrict src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen);
  15. const ALfloat *Resample_fir8_32_C(const BsincState *state, const ALfloat *restrict src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen);
  16. const ALfloat *Resample_bsinc32_C(const BsincState *state, const ALfloat *restrict src, ALuint frac, ALuint increment, ALfloat *restrict dst, ALuint dstlen);
  17. /* C mixers */
  18. void MixHrtf_C(ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALuint lidx, ALuint ridx,
  19. const ALfloat *data, ALuint Counter, ALuint Offset, ALuint OutPos,
  20. const ALuint IrSize, const struct MixHrtfParams *hrtfparams,
  21. struct HrtfState *hrtfstate, ALuint BufferSize);
  22. void MixDirectHrtf_C(ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALuint lidx, ALuint ridx,
  23. const ALfloat *data, ALuint Offset, const ALuint IrSize,
  24. ALfloat (*restrict Coeffs)[2], ALfloat (*restrict Values)[2],
  25. ALuint BufferSize);
  26. void Mix_C(const ALfloat *data, ALuint OutChans, ALfloat (*restrict OutBuffer)[BUFFERSIZE],
  27. ALfloat *CurrentGains, const ALfloat *TargetGains, ALuint Counter, ALuint OutPos,
  28. ALuint BufferSize);
  29. void MixRow_C(ALfloat *OutBuffer, const ALfloat *Gains,
  30. const ALfloat (*restrict data)[BUFFERSIZE], ALuint InChans,
  31. ALuint InPos, ALuint BufferSize);
  32. /* SSE mixers */
  33. void MixHrtf_SSE(ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALuint lidx, ALuint ridx,
  34. const ALfloat *data, ALuint Counter, ALuint Offset, ALuint OutPos,
  35. const ALuint IrSize, const struct MixHrtfParams *hrtfparams,
  36. struct HrtfState *hrtfstate, ALuint BufferSize);
  37. void MixDirectHrtf_SSE(ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALuint lidx, ALuint ridx,
  38. const ALfloat *data, ALuint Offset, const ALuint IrSize,
  39. ALfloat (*restrict Coeffs)[2], ALfloat (*restrict Values)[2],
  40. ALuint BufferSize);
  41. void Mix_SSE(const ALfloat *data, ALuint OutChans, ALfloat (*restrict OutBuffer)[BUFFERSIZE],
  42. ALfloat *CurrentGains, const ALfloat *TargetGains, ALuint Counter, ALuint OutPos,
  43. ALuint BufferSize);
  44. void MixRow_SSE(ALfloat *OutBuffer, const ALfloat *Gains,
  45. const ALfloat (*restrict data)[BUFFERSIZE], ALuint InChans,
  46. ALuint InPos, ALuint BufferSize);
  47. /* SSE resamplers */
  48. inline void InitiatePositionArrays(ALuint frac, ALuint increment, ALuint *restrict frac_arr, ALuint *restrict pos_arr, ALuint size)
  49. {
  50. ALuint i;
  51. pos_arr[0] = 0;
  52. frac_arr[0] = frac;
  53. for(i = 1;i < size;i++)
  54. {
  55. ALuint frac_tmp = frac_arr[i-1] + increment;
  56. pos_arr[i] = pos_arr[i-1] + (frac_tmp>>FRACTIONBITS);
  57. frac_arr[i] = frac_tmp&FRACTIONMASK;
  58. }
  59. }
  60. const ALfloat *Resample_bsinc32_SSE(const BsincState *state, const ALfloat *restrict src, ALuint frac,
  61. ALuint increment, ALfloat *restrict dst, ALuint dstlen);
  62. const ALfloat *Resample_lerp32_SSE2(const BsincState *state, const ALfloat *restrict src,
  63. ALuint frac, ALuint increment, ALfloat *restrict dst,
  64. ALuint numsamples);
  65. const ALfloat *Resample_lerp32_SSE41(const BsincState *state, const ALfloat *restrict src,
  66. ALuint frac, ALuint increment, ALfloat *restrict dst,
  67. ALuint numsamples);
  68. const ALfloat *Resample_fir4_32_SSE3(const BsincState *state, const ALfloat *restrict src,
  69. ALuint frac, ALuint increment, ALfloat *restrict dst,
  70. ALuint numsamples);
  71. const ALfloat *Resample_fir4_32_SSE41(const BsincState *state, const ALfloat *restrict src,
  72. ALuint frac, ALuint increment, ALfloat *restrict dst,
  73. ALuint numsamples);
  74. const ALfloat *Resample_fir8_32_SSE3(const BsincState *state, const ALfloat *restrict src,
  75. ALuint frac, ALuint increment, ALfloat *restrict dst,
  76. ALuint numsamples);
  77. const ALfloat *Resample_fir8_32_SSE41(const BsincState *state, const ALfloat *restrict src,
  78. ALuint frac, ALuint increment, ALfloat *restrict dst,
  79. ALuint numsamples);
  80. /* Neon mixers */
  81. void MixHrtf_Neon(ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALuint lidx, ALuint ridx,
  82. const ALfloat *data, ALuint Counter, ALuint Offset, ALuint OutPos,
  83. const ALuint IrSize, const struct MixHrtfParams *hrtfparams,
  84. struct HrtfState *hrtfstate, ALuint BufferSize);
  85. void MixDirectHrtf_Neon(ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALuint lidx, ALuint ridx,
  86. const ALfloat *data, ALuint Offset, const ALuint IrSize,
  87. ALfloat (*restrict Coeffs)[2], ALfloat (*restrict Values)[2],
  88. ALuint BufferSize);
  89. void Mix_Neon(const ALfloat *data, ALuint OutChans, ALfloat (*restrict OutBuffer)[BUFFERSIZE],
  90. ALfloat *CurrentGains, const ALfloat *TargetGains, ALuint Counter, ALuint OutPos,
  91. ALuint BufferSize);
  92. void MixRow_Neon(ALfloat *OutBuffer, const ALfloat *Gains,
  93. const ALfloat (*restrict data)[BUFFERSIZE], ALuint InChans,
  94. ALuint InPos, ALuint BufferSize);
  95. #endif /* MIXER_DEFS_H */