From 1ebfce4cac35731f1df5702ce613eada81f6ffa5 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 24 Jan 2017 19:03:51 -0800 Subject: 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. --- Alc/bformatdec.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'Alc/bformatdec.h') 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; -- cgit v1.2.3