#ifndef MIXER_DEFS_H #define MIXER_DEFS_H #include "AL/al.h" #include "alcmain.h" #include "alspan.h" #include "alu.h" #include "hrtf.h" enum InstSetType { CTag, SSETag, SSE2Tag, SSE3Tag, SSE4Tag, NEONTag }; enum ResampleType { CopyTag, PointTag, LerpTag, CubicTag, BSincTag }; template const ALfloat *Resample_(const InterpState *state, const ALfloat *RESTRICT src, ALuint frac, ALuint increment, const al::span dst); template void Mix_(const al::span InSamples, const al::span OutBuffer, float *CurrentGains, const float *TargetGains, const size_t Counter, const size_t OutPos); template void MixRow_(const al::span OutBuffer, const al::span Gains, const float *InSamples, const size_t InStride); template void MixHrtf_(FloatBufferLine &LeftOut, FloatBufferLine &RightOut, const ALfloat *InSamples, float2 *AccumSamples, const size_t OutPos, const ALsizei IrSize, MixHrtfFilter *hrtfparams, const size_t BufferSize); template void MixHrtfBlend_(FloatBufferLine &LeftOut, FloatBufferLine &RightOut, const ALfloat *InSamples, float2 *AccumSamples, const size_t OutPos, const ALsizei IrSize, const HrtfFilter *oldparams, MixHrtfFilter *newparams, const size_t BufferSize); template void MixDirectHrtf_(FloatBufferLine &LeftOut, FloatBufferLine &RightOut, const al::span InSamples, float2 *AccumSamples, DirectHrtfState *State, const size_t BufferSize); /* Vectorized resampler helpers */ inline void InitPosArrays(ALuint frac, ALuint increment, ALuint *frac_arr, ALuint *pos_arr, size_t size) { pos_arr[0] = 0; frac_arr[0] = frac; for(size_t i{1};i < size;i++) { const ALuint frac_tmp{frac_arr[i-1] + increment}; pos_arr[i] = pos_arr[i-1] + (frac_tmp>>FRACTIONBITS); frac_arr[i] = frac_tmp&FRACTIONMASK; } } #endif /* MIXER_DEFS_H */