12 #define HRTF_HISTORY_BITS (6)
13 #define HRTF_HISTORY_LENGTH (1<<HRTF_HISTORY_BITS)
14 #define HRTF_HISTORY_MASK (HRTF_HISTORY_LENGTH-1)
17 #define HRIR_LENGTH (1<<HRIR_BITS)
18 #define HRIR_MASK (HRIR_LENGTH-1)
32 const ALubyte
*azCount
;
33 const ALushort
*evOffset
;
34 const ALfloat (*coeffs
)[2];
35 const ALubyte (*delays
)[2];
39 typedef struct HrtfState
{
40 alignas(16) ALfloat History
[HRTF_HISTORY_LENGTH
];
41 alignas(16) ALfloat Values
[HRIR_LENGTH
][2];
44 typedef struct HrtfParams
{
45 alignas(16) ALfloat Coeffs
[HRIR_LENGTH
][2];
50 typedef struct DirectHrtfState
{
51 /* HRTF filter state for dry buffer content */
55 alignas(16) ALfloat Values
[HRIR_LENGTH
][2];
56 alignas(16) ALfloat Coeffs
[HRIR_LENGTH
][2];
68 vector_EnumeratedHrtf
EnumerateHrtf(const_al_string devname
);
69 void FreeHrtfList(vector_EnumeratedHrtf
*list
);
70 struct Hrtf
*GetLoadedHrtf(struct HrtfEntry
*entry
);
71 void Hrtf_IncRef(struct Hrtf
*hrtf
);
72 void Hrtf_DecRef(struct Hrtf
*hrtf
);
74 void GetHrtfCoeffs(const struct Hrtf
*Hrtf
, ALfloat elevation
, ALfloat azimuth
, ALfloat spread
, ALfloat (*coeffs
)[2], ALsizei
*delays
);
77 * Produces HRTF filter coefficients for decoding B-Format, given a set of
78 * virtual speaker positions, a matching decoding matrix, and per-order high-
79 * frequency gains for the decoder. The calculated impulse responses are
80 * ordered and scaled according to the matrix input.
82 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
);
84 #endif /* ALC_HRTF_H */