13 #define HRTF_HISTORY_BITS (6)
14 #define HRTF_HISTORY_LENGTH (1<<HRTF_HISTORY_BITS)
15 #define HRTF_HISTORY_MASK (HRTF_HISTORY_LENGTH-1)
18 #define HRIR_LENGTH (1<<HRIR_BITS)
19 #define HRIR_MASK (HRIR_LENGTH-1)
33 const ALubyte
*azCount
;
34 const ALushort
*evOffset
;
35 const ALfloat (*coeffs
)[2];
36 const ALubyte (*delays
)[2];
41 alignas(16) ALfloat History
[HRTF_HISTORY_LENGTH
];
42 alignas(16) ALfloat Values
[HRIR_LENGTH
][2];
46 alignas(16) ALfloat Coeffs
[HRIR_LENGTH
][2];
51 struct DirectHrtfState
{
52 /* HRTF filter state for dry buffer content */
56 alignas(16) ALfloat Values
[HRIR_LENGTH
][2];
57 alignas(16) ALfloat Coeffs
[HRIR_LENGTH
][2];
60 DirectHrtfState() noexcept
{ }
73 al::vector
<EnumeratedHrtf
> EnumerateHrtf(const char *devname
);
74 struct Hrtf
*GetLoadedHrtf(struct HrtfEntry
*entry
);
75 void Hrtf_IncRef(struct Hrtf
*hrtf
);
76 void Hrtf_DecRef(struct Hrtf
*hrtf
);
78 void GetHrtfCoeffs(const struct Hrtf
*Hrtf
, ALfloat elevation
, ALfloat azimuth
, ALfloat spread
, ALfloat (*RESTRICT coeffs
)[2], ALsizei
*delays
);
81 * Produces HRTF filter coefficients for decoding B-Format, given a set of
82 * virtual speaker positions, a matching decoding matrix, and per-order high-
83 * frequency gains for the decoder. The calculated impulse responses are
84 * ordered and scaled according to the matrix input.
86 void BuildBFormatHrtf(const struct Hrtf
*Hrtf
, DirectHrtfState
*state
, ALsizei NumChannels
, const struct AngularPoint
*AmbiPoints
, const ALfloat (*RESTRICT AmbiMatrix
)[MAX_AMBI_COEFFS
], ALsizei AmbiCount
, const ALfloat
*RESTRICT AmbiOrderHFGain
);
88 #endif /* ALC_HRTF_H */