From 7e5dd4196846f61307e156d55ae0fc12fbd29512 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 8 Aug 2022 03:44:25 -0700 Subject: Add an option for higher quality UHJ filters --- core/voice.cpp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'core/voice.cpp') diff --git a/core/voice.cpp b/core/voice.cpp index 15230726..4030fc5b 100644 --- a/core/voice.cpp +++ b/core/voice.cpp @@ -854,13 +854,29 @@ void Voice::prepare(DeviceBase *device) if(mFmtChannels == FmtSuperStereo) { - mDecoder = std::make_unique>(); - mDecoderPadding = UhjStereoDecoder::sFilterDelay; + if(UhjQuality >= UhjLengthHq) + { + mDecoder = std::make_unique>(); + mDecoderPadding = UhjStereoDecoder::sFilterDelay; + } + else + { + mDecoder = std::make_unique>(); + mDecoderPadding = UhjStereoDecoder::sFilterDelay; + } } else if(IsUHJ(mFmtChannels)) { - mDecoder = std::make_unique>(); - mDecoderPadding = UhjDecoder::sFilterDelay; + if(UhjQuality >= UhjLengthHq) + { + mDecoder = std::make_unique>(); + mDecoderPadding = UhjDecoder::sFilterDelay; + } + else + { + mDecoder = std::make_unique>(); + mDecoderPadding = UhjDecoder::sFilterDelay; + } } else { -- cgit v1.2.3