I guess -1 isn't allowed for the output
[openal-soft.git] / Alc / hrtf.h
blob0c47ded92bfece9c7ff32cc6c2c816b7d3b985e2
1 #ifndef ALC_HRTF_H
2 #define ALC_HRTF_H
4 #include "AL/al.h"
5 #include "AL/alc.h"
7 #include "alMain.h"
8 #include "alstring.h"
9 #include "atomic.h"
12 /* The maximum number of virtual speakers used to generate HRTF coefficients
13 * for decoding B-Format.
15 #define HRTF_AMBI_MAX_CHANNELS 16
18 struct HrtfEntry;
20 struct Hrtf {
21 RefCount ref;
23 ALuint sampleRate;
24 ALsizei irSize;
25 ALubyte evCount;
27 const ALubyte *azCount;
28 const ALushort *evOffset;
29 const ALfloat (*coeffs)[2];
30 const ALubyte (*delays)[2];
34 void FreeHrtfs(void);
36 vector_EnumeratedHrtf EnumerateHrtf(const_al_string devname);
37 void FreeHrtfList(vector_EnumeratedHrtf *list);
38 struct Hrtf *GetLoadedHrtf(struct HrtfEntry *entry);
39 void Hrtf_IncRef(struct Hrtf *hrtf);
40 void Hrtf_DecRef(struct Hrtf *hrtf);
42 void GetHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat azimuth, ALfloat spread, ALfloat (*coeffs)[2], ALsizei *delays);
44 /**
45 * Produces HRTF filter coefficients for decoding B-Format, given a set of
46 * virtual speaker positions and HF/LF matrices for decoding to them. The
47 * returned coefficients are ordered and scaled according to the matrices.
49 void BuildBFormatHrtf(const struct Hrtf *Hrtf, DirectHrtfState *state, ALsizei NumChannels, const ALfloat (*restrict AmbiPoints)[2], const ALfloat (*restrict AmbiMatrix)[2][MAX_AMBI_COEFFS], ALsizei AmbiCount);
51 #endif /* ALC_HRTF_H */