aboutsummaryrefslogtreecommitdiffstats
path: root/core/voice.cpp
diff options
context:
space:
mode:
authorChris Robinson <chris.kcat@gmail.com>2022-08-25 23:22:45 -0700
committerChris Robinson <chris.kcat@gmail.com>2022-08-25 23:22:45 -0700
commite48c294a69c60cfa5b83b9a27e96caa2c207cd46 (patch)
treed574cd57b88a7a01a7116ec4c2bf781fd343a307 /core/voice.cpp
parent298318bd8a44c8bbc8875aabb50b936dc14e8626 (diff)
Create and use 2D upsampling matrices
Diffstat (limited to 'core/voice.cpp')
-rw-r--r--core/voice.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/core/voice.cpp b/core/voice.cpp
index bda4a113..5263202e 100644
--- a/core/voice.cpp
+++ b/core/voice.cpp
@@ -899,7 +899,7 @@ void Voice::prepare(DeviceBase *device)
{
const uint8_t *OrderFromChan{Is2DAmbisonic(mFmtChannels) ?
AmbiIndex::OrderFrom2DChannel().data() : AmbiIndex::OrderFromChannel().data()};
- const auto scales = AmbiScale::GetHFOrderScales(mAmbiOrder);
+ const auto scales = AmbiScale::GetHFOrderScales(mAmbiOrder, !Is2DAmbisonic(mFmtChannels));
const BandSplitter splitter{device->mXOverFreq / static_cast<float>(device->Frequency)};
for(auto &chandata : mChans)
@@ -915,17 +915,19 @@ void Voice::prepare(DeviceBase *device)
* use different shelf filters after mixing it and with any old speaker
* setup the user has. To make this work, we apply the expected shelf
* filters for decoding UHJ2 to quad (only needs LF scaling), and act
- * as if those 4 quad channels are encoded right back onto first-order
- * B-Format, which then upsamples to higher order as normal (only needs
- * HF scaling).
+ * as if those 4 quad channels are encoded right back onto higher-order
+ * B-Format.
*
* This isn't perfect, but without an entirely separate and limited
* UHJ2 path, it's better than nothing.
*/
if(mFmtChannels == FmtUHJ2)
{
+ mChans[0].mAmbiHFScale = 1.0f;
mChans[0].mAmbiLFScale = UhjDecoder<UhjLengthStd>::sWLFScale;
+ mChans[1].mAmbiHFScale = 1.0f;
mChans[1].mAmbiLFScale = UhjDecoder<UhjLengthStd>::sXYLFScale;
+ mChans[2].mAmbiHFScale = 1.0f;
mChans[2].mAmbiLFScale = UhjDecoder<UhjLengthStd>::sXYLFScale;
}
mFlags.set(VoiceIsAmbisonic);