diff options
author | Chris Robinson <chris.kcat@gmail.com> | 2022-08-16 13:00:03 -0700 |
---|---|---|
committer | Chris Robinson <chris.kcat@gmail.com> | 2022-08-16 13:00:03 -0700 |
commit | 90f02176dd46f0754ed0c5f1e95b9ba9917839bb (patch) | |
tree | e3a792bbbe31939abae8b01a3bf66344b2aa9380 /core/ambidefs.cpp | |
parent | 832ccd7f489f7db763a164c663d730f4cadb71bc (diff) |
Inline a function and remove an unnecessary parameter
Diffstat (limited to 'core/ambidefs.cpp')
-rw-r--r-- | core/ambidefs.cpp | 37 |
1 files changed, 10 insertions, 27 deletions
diff --git a/core/ambidefs.cpp b/core/ambidefs.cpp index f5f4289e..22507c8a 100644 --- a/core/ambidefs.cpp +++ b/core/ambidefs.cpp @@ -13,25 +13,6 @@ namespace { using AmbiChannelFloatArray = std::array<float,MaxAmbiChannels>; -constexpr std::array<float,MaxAmbiOrder+1> Ambi3DDecoderHFScale10{{ - 2.000000000e+00f, 1.154700538e+00f -}}; -constexpr std::array<float,MaxAmbiOrder+1> Ambi3DDecoderHFScale2O{{ - 1.972026594e+00f, 1.527525232e+00f, 7.888106377e-01f -}}; -/* TODO: Set properly when making the third-order upsampler decoder. */ -constexpr std::array<float,MaxAmbiOrder+1> Ambi3DDecoderHFScale3O{{ - 1.000000000e+00f, 1.000000000e+00f, 1.000000000e+00f, 1.000000000e+00f -}}; - -inline auto& GetDecoderHFScales(uint order) noexcept -{ - if(order >= 3) return Ambi3DDecoderHFScale3O; - if(order == 2) return Ambi3DDecoderHFScale2O; - return Ambi3DDecoderHFScale10; -} - - /* Copied from mixer.cpp. */ constexpr auto CalcAmbiCoeffs(const float y, const float z, const float x) { @@ -195,11 +176,13 @@ const std::array<AmbiChannelFloatArray,4> AmbiScale::FirstOrderUp{CalcFirstOrder const std::array<AmbiChannelFloatArray,9> AmbiScale::SecondOrderUp{CalcSecondOrderUp()}; const std::array<AmbiChannelFloatArray,16> AmbiScale::ThirdOrderUp{CalcThirdOrderUp()}; - -auto AmbiScale::GetHFOrderScales(const uint in_order, const uint out_order) noexcept - -> std::array<float,MaxAmbiOrder+1> -{ - if(unlikely(in_order >= out_order)) - return {1.0f, 1.0f, 1.0f, 1.0f}; - return GetDecoderHFScales(in_order); -} +const std::array<float,MaxAmbiOrder+1> AmbiScale::DecoderHFScale10{{ + 2.000000000e+00f, 1.154700538e+00f +}}; +const std::array<float,MaxAmbiOrder+1> AmbiScale::DecoderHFScale2O{{ + 1.972026594e+00f, 1.527525232e+00f, 7.888106377e-01f +}}; +/* TODO: Set properly when making the third-order upsampler decoder. */ +const std::array<float,MaxAmbiOrder+1> AmbiScale::DecoderHFScale3O{{ + 1.000000000e+00f, 1.000000000e+00f, 1.000000000e+00f, 1.000000000e+00f +}}; |