aboutsummaryrefslogtreecommitdiffstats
path: root/core/ambidefs.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2021-07-13 06:31:13 -0700
committerChris Robinson <[email protected]>2021-07-13 06:31:13 -0700
commitd998c03a2761920b1edc4f1da09a04072af83d7e (patch)
treeede3bda406061fe8b47072b3d459b0ead2e879e8 /core/ambidefs.h
parentfb2cb2bd064c681defda5f1019faa5189ec3bb34 (diff)
Add a UHJ-specific coefficient scaling array
Diffstat (limited to 'core/ambidefs.h')
-rw-r--r--core/ambidefs.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/ambidefs.h b/core/ambidefs.h
index 22739359..3339c28f 100644
--- a/core/ambidefs.h
+++ b/core/ambidefs.h
@@ -97,6 +97,18 @@ struct AmbiScale {
}};
return ret;
}
+ static auto& FromUHJ() noexcept
+ {
+ static constexpr const std::array<float,MaxAmbiChannels> ret{{
+ 1.000000000f, /* ACN 0 (W), sqrt(1) */
+ 1.224744916f, /* ACN 1 (Y), sqrt(3/2) */
+ 1.224744916f, /* ACN 2 (Z), sqrt(3/2) */
+ 1.224744916f, /* ACN 3 (X), sqrt(3/2) */
+ /* Higher orders not relevant for UHJ. */
+ 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,
+ }};
+ return ret;
+ }
/* Retrieves per-order HF scaling factors for "upsampling" ambisonic data. */
static std::array<float,MaxAmbiOrder+1> GetHFOrderScales(const uint in_order,