From bf3f63fb4c5faa45784d7433d68b7013e29ee2c1 Mon Sep 17 00:00:00 2001
From: Chris Robinson <chris.kcat@gmail.com>
Date: Wed, 31 Aug 2022 08:29:55 -0700
Subject: Don't apply the HF scaling for "upsampling" ambisonics

Not sure if this is best, but it fixes the issue of upsampling lower orders to
higher orders multiple times (mixing lower order to higher order, cutting back
to lower order by dropping the extra channels, then upsampling again, applying
the HF scale multiple times and messing up the high frequencies/energy vector),
as well as having too-strong high frequencies of upsampled content in general.

As it is, with the new upsampling method, the lower order signal contributes to
some higher order channels, which helps offset the high frequency scaling
difference (except first- to second-order, which adds nothing).
---
 core/ambidefs.cpp | 19 -------------------
 1 file changed, 19 deletions(-)

(limited to 'core/ambidefs.cpp')

diff --git a/core/ambidefs.cpp b/core/ambidefs.cpp
index a7248974..87df1932 100644
--- a/core/ambidefs.cpp
+++ b/core/ambidefs.cpp
@@ -370,22 +370,3 @@ const std::array<AmbiChannelFloatArray,9> AmbiScale::SecondOrder2DUp{CalcSecondO
 const std::array<AmbiChannelFloatArray,16> AmbiScale::ThirdOrderUp{CalcThirdOrderUp()};
 const std::array<AmbiChannelFloatArray,16> AmbiScale::ThirdOrder2DUp{CalcThirdOrder2DUp()};
 const std::array<AmbiChannelFloatArray,25> AmbiScale::FourthOrder2DUp{CalcFourthOrder2DUp()};
-
-const std::array<float,MaxAmbiOrder+1> AmbiScale::DecoderHFScale1O{{
-    2.000000000e+00f, 1.154700538e+00f
-}};
-const std::array<float,MaxAmbiOrder+1> AmbiScale::DecoderHFScale1O2D{{
-    1.414213562e+00f, 1.000000000e+00f
-}};
-const std::array<float,MaxAmbiOrder+1> AmbiScale::DecoderHFScale2O{{
-    1.972026594e+00f, 1.527525232e+00f, 7.888106377e-01f
-}};
-const std::array<float,MaxAmbiOrder+1> AmbiScale::DecoderHFScale2O2D{{
-    1.414213562e+00f, 1.224744871e+00f, 7.071067812e-01f
-}};
-const std::array<float,MaxAmbiOrder+1> AmbiScale::DecoderHFScale3O{{
-    1.865086714e+00f, 1.606093894e+00f, 1.142055301e+00f, 5.683795528e-01f
-}};
-const std::array<float,MaxAmbiOrder+1> AmbiScale::DecoderHFScale3O2D{{
-    1.414213562e+00f, 1.306562965e+00f, 1.000000000e+00f, 5.411961001e-01f
-}};
-- 
cgit v1.2.3