aboutsummaryrefslogtreecommitdiffstats
path: root/core/ambidefs.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2022-08-25 23:22:45 -0700
committerChris Robinson <[email protected]>2022-08-25 23:22:45 -0700
commite48c294a69c60cfa5b83b9a27e96caa2c207cd46 (patch)
treed574cd57b88a7a01a7116ec4c2bf781fd343a307 /core/ambidefs.h
parent298318bd8a44c8bbc8875aabb50b936dc14e8626 (diff)
Create and use 2D upsampling matrices
Diffstat (limited to 'core/ambidefs.h')
-rw-r--r--core/ambidefs.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/core/ambidefs.h b/core/ambidefs.h
index 001edc5b..20b3942e 100644
--- a/core/ambidefs.h
+++ b/core/ambidefs.h
@@ -114,20 +114,26 @@ struct AmbiScale {
}
/* Retrieves per-order HF scaling factors for "upsampling" ambisonic data. */
- static std::array<float,MaxAmbiOrder+1> GetHFOrderScales(const uint order) noexcept
+ static std::array<float,MaxAmbiOrder+1> GetHFOrderScales(const uint order, const bool is3D) noexcept
{
- if(order >= 3) return DecoderHFScale3O;
- if(order == 2) return DecoderHFScale2O;
- return DecoderHFScale10;
+ if(order >= 3) return is3D ? DecoderHFScale3O : DecoderHFScale3O2D;
+ if(order == 2) return is3D ? DecoderHFScale2O : DecoderHFScale2O2D;
+ return is3D ? DecoderHFScale10 : DecoderHFScale1O2D;
}
static const std::array<float,MaxAmbiOrder+1> DecoderHFScale10;
+ static const std::array<float,MaxAmbiOrder+1> DecoderHFScale1O2D;
static const std::array<float,MaxAmbiOrder+1> DecoderHFScale2O;
+ static const std::array<float,MaxAmbiOrder+1> DecoderHFScale2O2D;
static const std::array<float,MaxAmbiOrder+1> DecoderHFScale3O;
+ static const std::array<float,MaxAmbiOrder+1> DecoderHFScale3O2D;
static const std::array<std::array<float,MaxAmbiChannels>,4> FirstOrderUp;
+ static const std::array<std::array<float,MaxAmbiChannels>,4> FirstOrder2DUp;
static const std::array<std::array<float,MaxAmbiChannels>,9> SecondOrderUp;
+ static const std::array<std::array<float,MaxAmbiChannels>,9> SecondOrder2DUp;
static const std::array<std::array<float,MaxAmbiChannels>,16> ThirdOrderUp;
+ static const std::array<std::array<float,MaxAmbiChannels>,16> ThirdOrder2DUp;
};
struct AmbiIndex {