aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/bformatdec.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-01-24 19:03:51 -0800
committerChris Robinson <[email protected]>2017-01-24 19:03:51 -0800
commit1ebfce4cac35731f1df5702ce613eada81f6ffa5 (patch)
tree088280e9029af29f73a0a4949256f99d84074bc5 /Alc/bformatdec.h
parentf4d52f43d87c02769c7649b91ba4afc967e121d2 (diff)
Improve the ambisonic upscaling methods
This now takes advantage of the differences seen in generated decoder matrices for first-order compared to second- and third-order, such that with the appropriate frequency-dependent scaling applied to first-order content, the result is identical with a higher-order decoder matrix compared to a first- order matrix for the same layout.
Diffstat (limited to 'Alc/bformatdec.h')
-rw-r--r--Alc/bformatdec.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/Alc/bformatdec.h b/Alc/bformatdec.h
index 3f240e54..7024b003 100644
--- a/Alc/bformatdec.h
+++ b/Alc/bformatdec.h
@@ -3,6 +3,24 @@
#include "alMain.h"
+
+/* These are the necessary scales for first-order HF responses to play over
+ * higher-order 2D (non-periphonic) decoders.
+ */
+#define W_SCALE2D_SECOND 1.224744871f /* sqrt(1.5) */
+#define XYZ_SCALE2D_SECOND 1.0f
+#define W_SCALE2D_THIRD 1.414213562f /* sqrt(2) */
+#define XYZ_SCALE2D_THIRD 1.082392196f
+
+/* These are the necessary scales for first-order HF responses to play over
+ * higher-order 3D (periphonic) decoders.
+ */
+#define W_SCALE3D_SECOND 1.341640787f /* sqrt(1.8) */
+#define XYZ_SCALE3D_SECOND 1.0f
+#define W_SCALE3D_THIRD 1.695486018f
+#define XYZ_SCALE3D_THIRD 1.136697713f
+
+
struct AmbDecConf;
struct BFormatDec;
struct AmbiUpsampler;