1 #ifndef CORE_MIXER_HRTFDEFS_H
2 #define CORE_MIXER_HRTFDEFS_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 constexpr uint HrtfDirectDelay
{256};
31 using HrirArray
= std::array
<float2
,HrirLength
>;
32 using HrirSpan
= al::span
<float2
,HrirLength
>;
33 using ConstHrirSpan
= al::span
<const float2
,HrirLength
>;
35 struct MixHrtfFilter
{
36 const ConstHrirSpan Coeffs
;
43 alignas(16) HrirArray Coeffs
;
49 struct HrtfChannelState
{
50 std::array
<float,HrtfDirectDelay
> mDelay
{};
51 BandSplitter mSplitter
;
53 alignas(16) HrirArray mCoeffs
{};
56 #endif /* CORE_MIXER_HRTFDEFS_H */