aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2022-08-14 00:56:38 -0700
committerChris Robinson <[email protected]>2022-08-14 00:56:38 -0700
commit4f346caea37b112d07e2c22a178c0bdc141c7d01 (patch)
tree58f6aa6bf040ee20f1f9446248e91244b4e3517a
parent5f6b7f9166119bf1dd01be2ec7afe26c61e03a25 (diff)
Update some arrays in preparation for fourth order support
-rw-r--r--alc/panning.cpp4
-rw-r--r--core/ambidefs.cpp13
2 files changed, 11 insertions, 6 deletions
diff --git a/alc/panning.cpp b/alc/panning.cpp
index ea716e4d..c2eef3cf 100644
--- a/alc/panning.cpp
+++ b/alc/panning.cpp
@@ -331,7 +331,8 @@ DecoderView MakeDecoderView(ALCdevice *device, const AmbDecConf *conf,
{
DecoderView ret{};
- decoder.mOrder = (conf->ChanMask > Ambi2OrderMask) ? uint8_t{3} :
+ decoder.mOrder = (conf->ChanMask > Ambi3OrderMask) ? uint8_t{4} :
+ (conf->ChanMask > Ambi2OrderMask) ? uint8_t{3} :
(conf->ChanMask > Ambi1OrderMask) ? uint8_t{2} : uint8_t{1};
decoder.mIs3D = (conf->ChanMask&AmbiPeriphonicMask) != 0;
@@ -704,6 +705,7 @@ void InitPanning(ALCdevice *device, const bool hqdec=false, const bool stablize=
TRACE("Enabling %s-band %s-order%s ambisonic decoder\n",
!dual_band ? "single" : "dual",
+ (decoder.mOrder > 3) ? "fourth" :
(decoder.mOrder > 2) ? "third" :
(decoder.mOrder > 1) ? "second" : "first",
decoder.mIs3D ? " periphonic" : "");
diff --git a/core/ambidefs.cpp b/core/ambidefs.cpp
index 2725748e..de3c3b81 100644
--- a/core/ambidefs.cpp
+++ b/core/ambidefs.cpp
@@ -8,21 +8,24 @@
namespace {
-constexpr std::array<float,MaxAmbiOrder+1> Ambi3DDecoderHFScale{{
- 1.00000000e+00f, 1.00000000e+00f
+constexpr std::array<float,MaxAmbiOrder+1> Ambi3DDecoderHFScale10{{
+ 1.000000000e+00f, 5.773502692e-01f
}};
constexpr std::array<float,MaxAmbiOrder+1> Ambi3DDecoderHFScale2O{{
- 7.45355990e-01f, 1.00000000e+00f, 1.00000000e+00f
+ 9.128709292e-01f, 7.071067812e-01f, 3.651483717e-01f
}};
constexpr std::array<float,MaxAmbiOrder+1> Ambi3DDecoderHFScale3O{{
- 5.89792205e-01f, 8.79693856e-01f, 1.00000000e+00f, 1.00000000e+00f
+ 8.340921354e-01f, 7.182670250e-01f, 5.107426573e-01f, 2.541870634e-01f
}};
+/*constexpr std::array<float,MaxAmbiOrder+1> Ambi3DDecoderHFScale4O{{
+ 1.727324867e-02f, 3.238734126e-02f, 8.245277297e-02f, 2.360733547e-01f, 7.127761153e-01f
+}};*/
inline auto& GetDecoderHFScales(uint order) noexcept
{
if(order >= 3) return Ambi3DDecoderHFScale3O;
if(order == 2) return Ambi3DDecoderHFScale2O;
- return Ambi3DDecoderHFScale;
+ return Ambi3DDecoderHFScale10;
}
} // namespace