From 3b1b44ffea0416e5e3933e6ba469da8af052f8e7 Mon Sep 17 00:00:00 2001 From: rhb Date: Thu, 15 Jun 2023 14:35:06 +0200 Subject: [PATCH] fix discontinuities in DFT Stereo when switching from TCX concealment to a good frame with ACELP_CORE --- lib_com/options.h | 2 +- lib_dec/ivas_post_proc.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) mode change 100644 => 100755 lib_dec/ivas_post_proc.c diff --git a/lib_com/options.h b/lib_com/options.h index 63f528e346..cb0a72d7c1 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -157,7 +157,7 @@ #define FIX_529_BWD_ISSUE /* VA: issue 529: fix Bandwidth Detector not working reliably for Music and Generic Audio */ - +#define FIX_558_PLC_DISCONT /* FhG: issue 558: fix discontinuities in DFT Stereo when switching from TCX concealment to ACELP */ /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_dec/ivas_post_proc.c b/lib_dec/ivas_post_proc.c old mode 100644 new mode 100755 index 0321a646f9..7f1c84983b --- a/lib_dec/ivas_post_proc.c +++ b/lib_dec/ivas_post_proc.c @@ -208,7 +208,11 @@ void stereo_dft_dec_core_switching( lerp( hCPE->input_mem_BPF[0], hCPE->input_mem_BPF[0], NS2SA( st->L_frame * FRAMES_PER_SEC, STEREO_DFT32MS_OVL_NS ), NS2SA( st->last_L_frame * FRAMES_PER_SEC, STEREO_DFT32MS_OVL_NS ) ); } +#ifdef FIX_558_PLC_DISCONT + if ( st->prev_bfi && !( st->last_core_bfi == ACELP_CORE && st->last_con_tcx == 1 ) ) +#else if ( st->prev_bfi ) +#endif { /* last_core needed for correctly decoding ACELP->TCX/HQ switching frames in ivas_core_dec(). In the following steps the decoder needs to consider if the core was changed due to a lost frame to apply the correct transition */ @@ -414,6 +418,7 @@ void stereo_dft_dec_core_switching( { lerp( hCPE->input_mem[0], hCPE->input_mem_LB[0], NS2SA( st->L_frame * FRAMES_PER_SEC, STEREO_DFT32MS_OVL_NS ), NS2SA( output_frame * FRAMES_PER_SEC, STEREO_DFT32MS_OVL_NS ) ); } + /* ACELP synthesis @ internal sampling rate */ stereo_dft_dec_analyze( hCPE, output, DFT, 0, st->L_frame, output_frame, DFT_STEREO_DEC_ANA_LB, 0, 0 ); @@ -436,6 +441,7 @@ void stereo_dft_dec_core_switching( } #endif + /*----------------------------------------------------------------* * enhanced stereo filling: allpass filter *----------------------------------------------------------------*/ -- GitLab