aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/hrtf.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-01-18 19:16:24 -0800
committerChris Robinson <[email protected]>2017-01-18 19:16:24 -0800
commitaa56af1ecbf30b9f41d1cf9b0ede1c50f5757639 (patch)
tree99511fda64821eb0b92353077a006e069dfc27a3 /Alc/hrtf.h
parente8ac0e5bfd659a88538abed66e13e52b40f3ad12 (diff)
Move the B-Format HRTF virtual speaker stuff to InitHrtfPanning
This keeps the decoder matrices and coefficient mapping together for if it changes in the future.
Diffstat (limited to 'Alc/hrtf.h')
-rw-r--r--Alc/hrtf.h27
1 files changed, 12 insertions, 15 deletions
diff --git a/Alc/hrtf.h b/Alc/hrtf.h
index 5ac4a03d..83cc64d1 100644
--- a/Alc/hrtf.h
+++ b/Alc/hrtf.h
@@ -4,6 +4,7 @@
#include "AL/al.h"
#include "AL/alc.h"
+#include "alMain.h"
#include "alstring.h"
@@ -21,20 +22,15 @@ struct Hrtf {
struct Hrtf *next;
};
-typedef struct HrtfEntry {
- al_string name;
-
- const struct Hrtf *hrtf;
-} HrtfEntry;
-TYPEDEF_VECTOR(HrtfEntry, vector_HrtfEntry)
-
-#define HRIR_BITS (7)
-#define HRIR_LENGTH (1<<HRIR_BITS)
-#define HRIR_MASK (HRIR_LENGTH-1)
#define HRTFDELAY_BITS (20)
#define HRTFDELAY_FRACONE (1<<HRTFDELAY_BITS)
#define HRTFDELAY_MASK (HRTFDELAY_FRACONE-1)
+/* The maximum number of virtual speakers used to generate HRTF coefficients
+ * for decoding B-Format.
+ */
+#define HRTF_AMBI_MAX_CHANNELS 16
+
void FreeHrtfs(void);
vector_HrtfEntry EnumerateHrtf(const_al_string devname);
@@ -42,11 +38,12 @@ void FreeHrtfList(vector_HrtfEntry *list);
void GetHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat azimuth, ALfloat spread, ALfloat gain, ALfloat (*coeffs)[2], ALsizei *delays);
-/* Produces HRTF filter coefficients for decoding B-Format. The result will
- * have ACN ordering with N3D normalization. NumChannels must currently be 4,
- * for first-order. Returns the maximum impulse-response length of the
- * generated coefficients.
+/**
+ * Produces HRTF filter coefficients for decoding B-Format, given a set of
+ * virtual speaker positions and HF/LF matrices for decoding to them. The
+ * returned coefficients are ordered and scaled according to the matrices.
+ * Returns the maximum impulse-response length of the generated coefficients.
*/
-ALsizei BuildBFormatHrtf(const struct Hrtf *Hrtf, ALfloat (*coeffs)[HRIR_LENGTH][2], ALsizei NumChannels, const ALsizei *AmbiMap);
+ALsizei BuildBFormatHrtf(const struct Hrtf *Hrtf, ALfloat (*coeffs)[HRIR_LENGTH][2], ALsizei NumChannels, const ALfloat (*restrict AmbiPoints)[2], const ALfloat (*restrict AmbiMatrix)[2][MAX_AMBI_COEFFS], ALsizei AmbiCount);
#endif /* ALC_HRTF_H */