aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/bformatdec.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-12-10 21:30:22 -0800
committerChris Robinson <[email protected]>2018-12-10 21:30:22 -0800
commite87eb07db411a0ecd02b5b5c50a4a721150e846e (patch)
treed10c52d9f2266c62e5b73d1b6b5c549bbe729a45 /Alc/bformatdec.h
parented18fd76c5546b295731fc5bbd9adcca896106e2 (diff)
A bit more cleanup
Diffstat (limited to 'Alc/bformatdec.h')
-rw-r--r--Alc/bformatdec.h45
1 files changed, 42 insertions, 3 deletions
diff --git a/Alc/bformatdec.h b/Alc/bformatdec.h
index f2cdcdfb..d855041d 100644
--- a/Alc/bformatdec.h
+++ b/Alc/bformatdec.h
@@ -29,9 +29,48 @@ struct AmbDecConf;
/* NOTE: These are scale factors as applied to Ambisonics content. Decoder
* coefficients should be divided by these values to get proper N3D scalings.
*/
-extern const ALfloat N3D2N3DScale[MAX_AMBI_COEFFS];
-extern const ALfloat SN3D2N3DScale[MAX_AMBI_COEFFS];
-extern const ALfloat FuMa2N3DScale[MAX_AMBI_COEFFS];
+struct AmbiScale {
+ static constexpr float N3D2N3D[MAX_AMBI_COEFFS]{
+ 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,
+ 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f
+ };
+ static constexpr float SN3D2N3D[MAX_AMBI_COEFFS]{
+ 1.000000000f, /* ACN 0 (W), sqrt(1) */
+ 1.732050808f, /* ACN 1 (Y), sqrt(3) */
+ 1.732050808f, /* ACN 2 (Z), sqrt(3) */
+ 1.732050808f, /* ACN 3 (X), sqrt(3) */
+ 2.236067978f, /* ACN 4 (V), sqrt(5) */
+ 2.236067978f, /* ACN 5 (T), sqrt(5) */
+ 2.236067978f, /* ACN 6 (R), sqrt(5) */
+ 2.236067978f, /* ACN 7 (S), sqrt(5) */
+ 2.236067978f, /* ACN 8 (U), sqrt(5) */
+ 2.645751311f, /* ACN 9 (Q), sqrt(7) */
+ 2.645751311f, /* ACN 10 (O), sqrt(7) */
+ 2.645751311f, /* ACN 11 (M), sqrt(7) */
+ 2.645751311f, /* ACN 12 (K), sqrt(7) */
+ 2.645751311f, /* ACN 13 (L), sqrt(7) */
+ 2.645751311f, /* ACN 14 (N), sqrt(7) */
+ 2.645751311f, /* ACN 15 (P), sqrt(7) */
+ };
+ static constexpr float FuMa2N3D[MAX_AMBI_COEFFS]{
+ 1.414213562f, /* ACN 0 (W), sqrt(2) */
+ 1.732050808f, /* ACN 1 (Y), sqrt(3) */
+ 1.732050808f, /* ACN 2 (Z), sqrt(3) */
+ 1.732050808f, /* ACN 3 (X), sqrt(3) */
+ 1.936491673f, /* ACN 4 (V), sqrt(15)/2 */
+ 1.936491673f, /* ACN 5 (T), sqrt(15)/2 */
+ 2.236067978f, /* ACN 6 (R), sqrt(5) */
+ 1.936491673f, /* ACN 7 (S), sqrt(15)/2 */
+ 1.936491673f, /* ACN 8 (U), sqrt(15)/2 */
+ 2.091650066f, /* ACN 9 (Q), sqrt(35/8) */
+ 1.972026594f, /* ACN 10 (O), sqrt(35)/3 */
+ 2.231093404f, /* ACN 11 (M), sqrt(224/45) */
+ 2.645751311f, /* ACN 12 (K), sqrt(7) */
+ 2.231093404f, /* ACN 13 (L), sqrt(224/45) */
+ 1.972026594f, /* ACN 14 (N), sqrt(35)/3 */
+ 2.091650066f, /* ACN 15 (P), sqrt(35/8) */
+ };
+};
class BFormatDec {