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 al::vector
<EnumeratedHrtf
> EnumerateHrtf(const char *devname
);
69 struct Hrtf
*GetLoadedHrtf(struct HrtfEntry
*entry
);
70 void Hrtf_IncRef(struct Hrtf
*hrtf
);
71 void Hrtf_DecRef(struct Hrtf
*hrtf
);
73 void GetHrtfCoeffs(const struct Hrtf
*Hrtf
, ALfloat elevation
, ALfloat azimuth
, ALfloat spread
, ALfloat (*RESTRICT coeffs
)[2], ALsizei
*delays
);
76 * Produces HRTF filter coefficients for decoding B-Format, given a set of
77 * virtual speaker positions, a matching decoding matrix, and per-order high-
78 * frequency gains for the decoder. The calculated impulse responses are
79 * ordered and scaled according to the matrix input.
81 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
);
83 #endif /* ALC_HRTF_H */