diff options
author | Chris Robinson <[email protected]> | 2022-08-31 08:29:55 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2022-08-31 09:06:53 -0700 |
commit | bf3f63fb4c5faa45784d7433d68b7013e29ee2c1 (patch) | |
tree | 14067933535ae809ab42c62e8c53d993df756fc7 /alc/effects/convolution.cpp | |
parent | 042c3d4a4241d03f7a2368d8744f93a3a4fb7565 (diff) |
Don't apply the HF scaling for "upsampling" ambisonics
Not sure if this is best, but it fixes the issue of upsampling lower orders to
higher orders multiple times (mixing lower order to higher order, cutting back
to lower order by dropping the extra channels, then upsampling again, applying
the HF scale multiple times and messing up the high frequencies/energy vector),
as well as having too-strong high frequencies of upsampled content in general.
As it is, with the new upsampling method, the lower order signal contributes to
some higher order channels, which helps offset the high frequency scaling
difference (except first- to second-order, which adds nothing).
Diffstat (limited to 'alc/effects/convolution.cpp')
-rw-r--r-- | alc/effects/convolution.cpp | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/alc/effects/convolution.cpp b/alc/effects/convolution.cpp index 90220a50..f72695bd 100644 --- a/alc/effects/convolution.cpp +++ b/alc/effects/convolution.cpp @@ -194,8 +194,6 @@ struct ConvolutionState final : public EffectState { struct ChannelData { alignas(16) FloatBufferLine mBuffer{}; - float mHfScale{}; - BandSplitter mFilter{}; float Current[MAX_OUTPUT_CHANNELS]{}; float Target[MAX_OUTPUT_CHANNELS]{}; }; @@ -235,7 +233,6 @@ void ConvolutionState::UpsampleMix(const al::span<FloatBufferLine> samplesOut, for(auto &chan : *mChans) { const al::span<float> src{chan.mBuffer.data(), samplesToDo}; - chan.mFilter.processHfScale(src, chan.mHfScale); MixSamples(src, samplesOut, chan.Current, chan.Target, samplesToDo, 0); } } @@ -280,10 +277,6 @@ void ConvolutionState::deviceUpdate(const DeviceBase *device, const Buffer &buff (uint64_t{buffer.storage->mSampleLen}*device->Frequency+(buffer.storage->mSampleRate-1)) / buffer.storage->mSampleRate); - const BandSplitter splitter{device->mXOverFreq / static_cast<float>(device->Frequency)}; - for(auto &e : *mChans) - e.mFilter = splitter; - mFilter.resize(numChannels, {}); mOutput.resize(numChannels, {}); @@ -418,13 +411,7 @@ void ConvolutionState::update(const ContextBase *context, const EffectSlot *slot { DeviceBase *device{context->mDevice}; if(device->mAmbiOrder > mAmbiOrder) - { mMix = &ConvolutionState::UpsampleMix; - const auto scales = AmbiScale::GetHFOrderScales(mAmbiOrder, true); - (*mChans)[0].mHfScale = scales[0]; - for(size_t i{1};i < mChans->size();++i) - (*mChans)[i].mHfScale = scales[1]; - } mOutTarget = target.Main->Buffer; auto&& scales = GetAmbiScales(mAmbiScaling); |