From 87d27a4126050e66821ed448743d4599bfcfd4bd Mon Sep 17 00:00:00 2001 From: rhb Date: Tue, 18 Jul 2023 15:23:49 +0200 Subject: [PATCH 1/4] set input memory of DFT analysis for BPF to zero for HQ core to avoid a potential issue with PLC and bitrate switching --- lib_com/options.h | 1 + lib_dec/ivas_post_proc.c | 11 +++++++++++ 2 files changed, 12 insertions(+) mode change 100644 => 100755 lib_com/options.h diff --git a/lib_com/options.h b/lib_com/options.h old mode 100644 new mode 100755 index 4eaa7bb31e..e99f954e71 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -173,6 +173,7 @@ #define NONBE_FIX_589_JBM_TC_OFFSETS /* FhG: issue 589: wrong offset into the TC buffers is used in some rendering paths in the JBM main rendering function */ #define FIX_MEM_REALLOC_IND_LIST /* VA: issue 601: failure of the automatic memory re-allocation mechanism when ind_list[] buffer is depleted in MASA mode with 2 TC*/ #define FIX_581_CLANG_OFFSET_TO_NULL /* FhG: issue 581: fix CLANG error about applying an offset to a NULL pointer */ +#define FIX_586_BPF_DFT_MEM /* FhG: issue 586: set input memory of DFT analysis of BPF signal to zero for HQ core to fix issue with PLC and bitrate switching */ /* ################## End BE DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_post_proc.c b/lib_dec/ivas_post_proc.c index 7f1c84983b..8c43590e10 100755 --- a/lib_dec/ivas_post_proc.c +++ b/lib_dec/ivas_post_proc.c @@ -230,10 +230,21 @@ void stereo_dft_dec_core_switching( mvr2r( &output[st->L_frame - NS2SA( st->L_frame * FRAMES_PER_SEC, STEREO_DFT32MS_OVL_NS )], hCPE->hStereoDft->buff_LBTCX_mem, NS2SA( st->L_frame * FRAMES_PER_SEC, STEREO_DFT32MS_OVL_NS ) ); /* BPF */ +#ifdef FIX_586_BPF_DFT_MEM + if ( st->p_bpf_noise_buf && st->core != HQ_CORE ) +#else if ( st->p_bpf_noise_buf ) +#endif { stereo_dft_dec_analyze( hCPE, st->p_bpf_noise_buf, DFT, 0, st->L_frame, output_frame, DFT_STEREO_DEC_ANA_BPF, 2, 0 ); } +#ifdef FIX_586_BPF_DFT_MEM + /* st->p_bpf_noise_buf not updated for HQ core -> skip analysis and set input memory to zero */ + else if ( st->p_bpf_noise_buf && st->core == HQ_CORE ) + { + set_zero( hCPE->input_mem_BPF[0], STEREO_DFT32MS_OVL_16k ); + } +#endif /* TCX */ stereo_dft_dec_analyze( hCPE, synth, DFT, 0, L_frameTCX, output_frame, DFT_STEREO_DEC_ANA_FB, 0, 0 ); -- GitLab From 00f6642dc46bafe9fde5beb0aa6f53f1c0f5bac2 Mon Sep 17 00:00:00 2001 From: rhb Date: Wed, 19 Jul 2023 11:08:12 +0200 Subject: [PATCH 2/4] put switch in non-BE CR category --- lib_com/options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index e99f954e71..65a37cb239 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -173,7 +173,6 @@ #define NONBE_FIX_589_JBM_TC_OFFSETS /* FhG: issue 589: wrong offset into the TC buffers is used in some rendering paths in the JBM main rendering function */ #define FIX_MEM_REALLOC_IND_LIST /* VA: issue 601: failure of the automatic memory re-allocation mechanism when ind_list[] buffer is depleted in MASA mode with 2 TC*/ #define FIX_581_CLANG_OFFSET_TO_NULL /* FhG: issue 581: fix CLANG error about applying an offset to a NULL pointer */ -#define FIX_586_BPF_DFT_MEM /* FhG: issue 586: set input memory of DFT analysis of BPF signal to zero for HQ core to fix issue with PLC and bitrate switching */ /* ################## End BE DEVELOPMENT switches ######################### */ @@ -181,6 +180,7 @@ /* #################### Start NON-BE CR switches ########################## */ /* any switch which is non-be wrt operation points tested in selection */ /* all switches in this category should start with "CR_" */ +#define FIX_586_BPF_DFT_MEM /* FhG: issue 586: set input memory of DFT analysis of BPF signal to zero for HQ core to fix issue with PLC and bitrate switching */ /* ##################### End NON-BE CR switches ########################### */ -- GitLab From 15e40262b7755550e38a9e2555a61eeeb610e7de Mon Sep 17 00:00:00 2001 From: rhb Date: Tue, 25 Jul 2023 13:23:41 +0200 Subject: [PATCH 3/4] add CR_ signifier to switch in options.h --- lib_com/options.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 65a37cb239..206c3d0c9f 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -180,7 +180,7 @@ /* #################### Start NON-BE CR switches ########################## */ /* any switch which is non-be wrt operation points tested in selection */ /* all switches in this category should start with "CR_" */ -#define FIX_586_BPF_DFT_MEM /* FhG: issue 586: set input memory of DFT analysis of BPF signal to zero for HQ core to fix issue with PLC and bitrate switching */ +#define CR_FIX_586_BPF_DFT_MEM /* FhG: issue 586: set input memory of DFT analysis of BPF signal to zero for HQ core to fix issue with PLC and bitrate switching */ /* ##################### End NON-BE CR switches ########################### */ -- GitLab From fe171a0a9e64212ba27aac377932af79ccf89fc7 Mon Sep 17 00:00:00 2001 From: rhb Date: Tue, 1 Aug 2023 11:17:42 +0200 Subject: [PATCH 4/4] add CR_ to switch name for all occurrences of switch --- lib_dec/ivas_post_proc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_post_proc.c b/lib_dec/ivas_post_proc.c index 8c43590e10..c22b896147 100755 --- a/lib_dec/ivas_post_proc.c +++ b/lib_dec/ivas_post_proc.c @@ -230,7 +230,7 @@ void stereo_dft_dec_core_switching( mvr2r( &output[st->L_frame - NS2SA( st->L_frame * FRAMES_PER_SEC, STEREO_DFT32MS_OVL_NS )], hCPE->hStereoDft->buff_LBTCX_mem, NS2SA( st->L_frame * FRAMES_PER_SEC, STEREO_DFT32MS_OVL_NS ) ); /* BPF */ -#ifdef FIX_586_BPF_DFT_MEM +#ifdef CR_FIX_586_BPF_DFT_MEM if ( st->p_bpf_noise_buf && st->core != HQ_CORE ) #else if ( st->p_bpf_noise_buf ) @@ -238,7 +238,7 @@ void stereo_dft_dec_core_switching( { stereo_dft_dec_analyze( hCPE, st->p_bpf_noise_buf, DFT, 0, st->L_frame, output_frame, DFT_STEREO_DEC_ANA_BPF, 2, 0 ); } -#ifdef FIX_586_BPF_DFT_MEM +#ifdef CR_FIX_586_BPF_DFT_MEM /* st->p_bpf_noise_buf not updated for HQ core -> skip analysis and set input memory to zero */ else if ( st->p_bpf_noise_buf && st->core == HQ_CORE ) { -- GitLab