Apply the source's AL_AIR_ABSORPTION_FACTOR to send paths
[openal-soft.git] / core / mixer / hrtfdefs.h
blob3c903ed891f4ffd7ceaa0a8b9e9278b17f894aa7
1 #ifndef CORE_MIXER_HRTFDEFS_H
2 #define CORE_MIXER_HRTFDEFS_H
4 #include <array>
6 #include "alspan.h"
7 #include "core/ambidefs.h"
8 #include "core/bufferline.h"
9 #include "core/filters/splitter.h"
12 using float2 = std::array<float,2>;
13 using ubyte = unsigned char;
14 using ubyte2 = std::array<ubyte,2>;
15 using ushort = unsigned short;
16 using uint = unsigned int;
17 using uint2 = std::array<uint,2>;
19 constexpr uint HrtfHistoryBits{6};
20 constexpr uint HrtfHistoryLength{1 << HrtfHistoryBits};
21 constexpr uint HrtfHistoryMask{HrtfHistoryLength - 1};
23 constexpr uint HrirBits{7};
24 constexpr uint HrirLength{1 << HrirBits};
25 constexpr uint HrirMask{HrirLength - 1};
27 constexpr uint MinIrLength{8};
29 using HrirArray = std::array<float2,HrirLength>;
30 using HrirSpan = al::span<float2,HrirLength>;
31 using ConstHrirSpan = al::span<const float2,HrirLength>;
33 struct MixHrtfFilter {
34 const ConstHrirSpan Coeffs;
35 uint2 Delay;
36 float Gain;
37 float GainStep;
40 struct HrtfFilter {
41 alignas(16) HrirArray Coeffs;
42 uint2 Delay;
43 float Gain;
47 struct HrtfChannelState {
48 BandSplitter mSplitter;
49 float mHfScale{};
50 alignas(16) HrirArray mCoeffs{};
53 #endif /* CORE_MIXER_HRTFDEFS_H */