aboutsummaryrefslogtreecommitdiffstats
path: root/alc
diff options
context:
space:
mode:
Diffstat (limited to 'alc')
-rw-r--r--alc/alu.cpp9
-rw-r--r--alc/effects/convolution.cpp3
-rw-r--r--alc/effects/reverb.cpp2
-rw-r--r--alc/panning.cpp7
4 files changed, 15 insertions, 6 deletions
diff --git a/alc/alu.cpp b/alc/alu.cpp
index edafabff..bc39b108 100644
--- a/alc/alu.cpp
+++ b/alc/alu.cpp
@@ -919,7 +919,8 @@ void CalcPanningAndFilters(Voice *voice, const float xpos, const float ypos, con
* channels should be non-0).
*/
if(Device->mAmbiOrder > voice->mAmbiOrder
- || (Device->mAmbiOrder >= 2 && Is2DAmbisonic(voice->mFmtChannels)))
+ || (Device->mAmbiOrder >= 2 && !Device->m2DMixing
+ && Is2DAmbisonic(voice->mFmtChannels)))
{
if(voice->mAmbiOrder == 1)
{
@@ -940,8 +941,10 @@ void CalcPanningAndFilters(Voice *voice, const float xpos, const float ypos, con
UpsampleBFormatTransform(Device->mAmbiOrder, upsampler, shrot);
}
else if(voice->mAmbiOrder == 4)
- UpsampleBFormatTransform(Device->mAmbiOrder, AmbiScale::FourthOrder2DUp,
- shrot);
+ {
+ auto&& upsampler = AmbiScale::FourthOrder2DUp;
+ UpsampleBFormatTransform(Device->mAmbiOrder, upsampler, shrot);
+ }
}
/* Convert the rotation matrix for input ordering and scaling, and
diff --git a/alc/effects/convolution.cpp b/alc/effects/convolution.cpp
index 26a99ef9..f655cf89 100644
--- a/alc/effects/convolution.cpp
+++ b/alc/effects/convolution.cpp
@@ -420,7 +420,8 @@ void ConvolutionState::update(const ContextBase *context, const EffectSlot *slot
if(device->mAmbiOrder > mAmbiOrder)
{
mMix = &ConvolutionState::UpsampleMix;
- const auto scales = AmbiScale::GetHFOrderScales(mAmbiOrder, device->mAmbiOrder, false);
+ const auto scales = AmbiScale::GetHFOrderScales(mAmbiOrder, device->mAmbiOrder,
+ device->m2DMixing);
(*mChans)[0].mHfScale = scales[0];
for(size_t i{1};i < mChans->size();++i)
(*mChans)[i].mHfScale = scales[1];
diff --git a/alc/effects/reverb.cpp b/alc/effects/reverb.cpp
index 554fb341..dd89dccd 100644
--- a/alc/effects/reverb.cpp
+++ b/alc/effects/reverb.cpp
@@ -686,7 +686,7 @@ void ReverbState::deviceUpdate(const DeviceBase *device, const Buffer&)
if(device->mAmbiOrder > 1)
{
mUpmixOutput = true;
- mOrderScales = AmbiScale::GetHFOrderScales(1, device->mAmbiOrder, false);
+ mOrderScales = AmbiScale::GetHFOrderScales(1, device->mAmbiOrder, device->m2DMixing);
}
else
{
diff --git a/alc/panning.cpp b/alc/panning.cpp
index 121a8526..678a2639 100644
--- a/alc/panning.cpp
+++ b/alc/panning.cpp
@@ -611,6 +611,7 @@ void InitPanning(ALCdevice *device, const bool hqdec=false, const bool stablize=
[&n3dscale](const uint8_t &acn) noexcept -> BFChannelConfig
{ return BFChannelConfig{1.0f/n3dscale[acn], acn}; });
AllocChannels(device, count, 0);
+ device->m2DMixing = false;
float avg_dist{};
if(auto distopt = device->configValue<float>("decoder", "speaker-dist"))
@@ -667,6 +668,7 @@ void InitPanning(ALCdevice *device, const bool hqdec=false, const bool stablize=
/* For non-DevFmtAmbi3D, set the ambisonic order. */
device->mAmbiOrder = decoder.mOrder;
+ device->m2DMixing = !decoder.mIs3D;
const size_t ambicount{decoder.mIs3D ? AmbiChannelsFromOrder(decoder.mOrder) :
Ambi2DChannelsFromOrder(decoder.mOrder)};
@@ -906,6 +908,7 @@ void InitHrtfPanning(ALCdevice *device)
AmbiOrderHFGain = AmbiOrderHFGain2O;
}
device->mAmbiOrder = ambi_order;
+ device->m2DMixing = false;
const size_t count{AmbiChannelsFromOrder(ambi_order)};
std::transform(AmbiIndex::FromACN().begin(), AmbiIndex::FromACN().begin()+count,
@@ -929,8 +932,9 @@ void InitUhjPanning(ALCdevice *device)
constexpr size_t count{Ambi2DChannelsFromOrder(1)};
device->mAmbiOrder = 1;
+ device->m2DMixing = true;
- auto acnmap_begin = AmbiIndex::FromFuMa().begin();
+ auto acnmap_begin = AmbiIndex::FromFuMa2D().begin();
std::transform(acnmap_begin, acnmap_begin + count, std::begin(device->Dry.AmbiMap),
[](const uint8_t &acn) noexcept -> BFChannelConfig
{ return BFChannelConfig{1.0f/AmbiScale::FromUHJ()[acn], acn}; });
@@ -949,6 +953,7 @@ void aluInitRenderer(ALCdevice *device, int hrtf_id, al::optional<StereoEncoding
device->mIrSize = 0;
device->mHrtfName.clear();
device->mXOverFreq = 400.0f;
+ device->m2DMixing = false;
device->mRenderMode = RenderMode::Normal;
if(device->FmtChans != DevFmtStereo)