🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
2.2 KiB

  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. struct DirectHrtfState;
  11. struct CTag { };
  12. struct SSETag { };
  13. struct SSE2Tag { };
  14. struct SSE3Tag { };
  15. struct SSE4Tag { };
  16. struct NEONTag { };
  17. struct CopyTag { };
  18. struct PointTag { };
  19. struct LerpTag { };
  20. struct CubicTag { };
  21. struct BSincTag { };
  22. template<typename TypeTag, typename InstTag>
  23. const ALfloat *Resample_(const InterpState *state, const ALfloat *RESTRICT src, ALsizei frac, ALint increment, ALfloat *RESTRICT dst, ALsizei dstlen);
  24. template<typename InstTag>
  25. void Mix_(const ALfloat *data, const ALsizei OutChans, ALfloat (*OutBuffer)[BUFFERSIZE], ALfloat *CurrentGains, const ALfloat *TargetGains, const ALsizei Counter, const ALsizei OutPos, const ALsizei BufferSize);
  26. template<typename InstTag>
  27. void MixRow_(ALfloat *OutBuffer, const ALfloat *Gains, const ALfloat (*data)[BUFFERSIZE], const ALsizei InChans, const ALsizei InPos, const ALsizei BufferSize);
  28. template<typename InstTag>
  29. void MixHrtf_(ALfloat *RESTRICT LeftOut, ALfloat *RESTRICT RightOut, const ALfloat *data, float2 *RESTRICT AccumSamples, const ALsizei OutPos, const ALsizei IrSize, MixHrtfParams *hrtfparams, const ALsizei BufferSize);
  30. template<typename InstTag>
  31. void MixHrtfBlend_(ALfloat *RESTRICT LeftOut, ALfloat *RESTRICT RightOut, const ALfloat *data, float2 *RESTRICT AccumSamples, const ALsizei OutPos, const ALsizei IrSize, const HrtfParams *oldparams, MixHrtfParams *newparams, const ALsizei BufferSize);
  32. template<typename InstTag>
  33. void MixDirectHrtf_(ALfloat *RESTRICT LeftOut, ALfloat *RESTRICT RightOut, const ALfloat (*data)[BUFFERSIZE], float2 *RESTRICT AccumSamples, DirectHrtfState *State, const ALsizei NumChans, const ALsizei BufferSize);
  34. /* Vectorized resampler helpers */
  35. inline void InitiatePositionArrays(ALsizei frac, ALint increment, ALsizei *RESTRICT frac_arr, ALsizei *RESTRICT pos_arr, ALsizei size)
  36. {
  37. pos_arr[0] = 0;
  38. frac_arr[0] = frac;
  39. for(ALsizei i{1};i < size;i++)
  40. {
  41. ALint frac_tmp = frac_arr[i-1] + increment;
  42. pos_arr[i] = pos_arr[i-1] + (frac_tmp>>FRACTIONBITS);
  43. frac_arr[i] = frac_tmp&FRACTIONMASK;
  44. }
  45. }
  46. #endif /* MIXER_DEFS_H */