From a2399575fed3cae66b2328b7ee21e041de606d28 Mon Sep 17 00:00:00 2001 From: malenov Date: Mon, 18 Nov 2024 13:35:24 +0100 Subject: [PATCH 1/4] fix Hilbert filter issue by improving precision --- lib_com/options.h | 1 + lib_com/swb_tbe_com.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 24f21262e..cfc240323 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -150,4 +150,5 @@ #define FIX_ISSUE_1237 /* VA: replacement of Copy_Scale_sig_16_32_DEPREC() that are doing 16 bits left shift by Copy_Scale_sig_16_32_no_sat() */ #define FIX_ISSUE_1237_KEEP_EVS_BE /* VA: Fix to keep EVS bitexactness to 26.444 */ #define FIX_ISSUE_1214 /* Ittiam: Fix for issue 1214: Energy leakage in IGF tiles for MDCT-stereo @64kbps SWB*/ +#define FIX_881_HILBERT_FILTER /* VA: improve the precision of the Hilbert filter to remove 2kHz unwanted tone */ #endif diff --git a/lib_com/swb_tbe_com.c b/lib_com/swb_tbe_com.c index 9b20512a2..4809e419d 100644 --- a/lib_com/swb_tbe_com.c +++ b/lib_com/swb_tbe_com.c @@ -69,7 +69,40 @@ void GenSHBSynth_fx_32( Word32 speech_buf_32k[L_FRAME32k]; Word16 i; +#ifdef FIX_881_HILBERT_FILTER + Word16 shift = 0; + Word32 maxm32, input_synspeech_temp[L_FRAME16k]; + + /* find the maximum value and derive the shift to improve precision of the Hilber filter */ + maxm32 = L_deposit_l( 0 ); + FOR( i = 0; i < L_FRAME16k; i++ ) + { + maxm32 = L_max( maxm32, L_abs( input_synspeech[i] ) ); + } + + FOR( i = 0; i < 2 * ALLPASSSECTIONS_STEEP; i++ ) + { + maxm32 = L_max( maxm32, L_abs( state_lsyn_filt_shb_local[i] ) ); + } + + FOR( i = 0; i < HILBERT_MEM_SIZE; i++ ) + { + maxm32 = L_max( maxm32, L_abs( Hilbert_Mem[i] ) ); + } + + IF ( maxm32 != 0 ) + { + shift = sub( norm_l( maxm32 ), 3 ); + + Copy_Scale_sig32( input_synspeech, input_synspeech_temp, L_FRAME16k, shift ); + Scale_sig32( state_lsyn_filt_shb_local, 2 * ALLPASSSECTIONS_STEEP, shift ); + Scale_sig32( Hilbert_Mem, HILBERT_MEM_SIZE, shift ); + } + + Interpolate_allpass_steep_32( input_synspeech_temp, state_lsyn_filt_shb_local, L_FRAME16k, speech_buf_32k ); +#else Interpolate_allpass_steep_32( input_synspeech, state_lsyn_filt_shb_local, L_FRAME16k, speech_buf_32k ); +#endif IF( EQ_16( L_frame, L_FRAME ) ) { @@ -92,6 +125,15 @@ void GenSHBSynth_fx_32( } } +#ifdef FIX_881_HILBERT_FILTER + IF ( maxm32 != 0 ) + { + Scale_sig32( shb_syn_speech_32k, L_FRAME32k, -shift ); + Scale_sig32( state_lsyn_filt_shb_local, 2 * ALLPASSSECTIONS_STEEP, -shift ); + Scale_sig32( Hilbert_Mem, HILBERT_MEM_SIZE, -shift ); + } +#endif + return; } void ScaleShapedSHB_32( -- GitLab From 45f33c0e717baa722e379b3a33dd79ff35cced70 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Mon, 18 Nov 2024 14:19:42 +0100 Subject: [PATCH 2/4] clang format --- lib_com/swb_tbe_com.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_com/swb_tbe_com.c b/lib_com/swb_tbe_com.c index 4809e419d..6368c0b2d 100644 --- a/lib_com/swb_tbe_com.c +++ b/lib_com/swb_tbe_com.c @@ -90,7 +90,7 @@ void GenSHBSynth_fx_32( maxm32 = L_max( maxm32, L_abs( Hilbert_Mem[i] ) ); } - IF ( maxm32 != 0 ) + IF( maxm32 != 0 ) { shift = sub( norm_l( maxm32 ), 3 ); @@ -126,7 +126,7 @@ void GenSHBSynth_fx_32( } #ifdef FIX_881_HILBERT_FILTER - IF ( maxm32 != 0 ) + IF( maxm32 != 0 ) { Scale_sig32( shb_syn_speech_32k, L_FRAME32k, -shift ); Scale_sig32( state_lsyn_filt_shb_local, 2 * ALLPASSSECTIONS_STEEP, -shift ); -- GitLab From 140433d16fadbfcbdffb22902754ef2921d12f52 Mon Sep 17 00:00:00 2001 From: malenov Date: Fri, 10 Jan 2025 14:28:52 +0100 Subject: [PATCH 3/4] just copy signal to temp buffer when maxm32 is 0 --- lib_com/swb_tbe_com.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib_com/swb_tbe_com.c b/lib_com/swb_tbe_com.c index 6368c0b2d..bc5538aeb 100644 --- a/lib_com/swb_tbe_com.c +++ b/lib_com/swb_tbe_com.c @@ -73,7 +73,7 @@ void GenSHBSynth_fx_32( Word16 shift = 0; Word32 maxm32, input_synspeech_temp[L_FRAME16k]; - /* find the maximum value and derive the shift to improve precision of the Hilber filter */ + /* find the maximum value and derive the shift to improve precision of the Hilbert filter */ maxm32 = L_deposit_l( 0 ); FOR( i = 0; i < L_FRAME16k; i++ ) { @@ -98,6 +98,10 @@ void GenSHBSynth_fx_32( Scale_sig32( state_lsyn_filt_shb_local, 2 * ALLPASSSECTIONS_STEEP, shift ); Scale_sig32( Hilbert_Mem, HILBERT_MEM_SIZE, shift ); } + else + { + Copy32( input_synspeech, input_synspeech_temp, L_FRAME16k ); + } Interpolate_allpass_steep_32( input_synspeech_temp, state_lsyn_filt_shb_local, L_FRAME16k, speech_buf_32k ); #else -- GitLab From 37fd2578548f0d2e979b9137bb19b93afc092aab Mon Sep 17 00:00:00 2001 From: norvell Date: Wed, 5 Feb 2025 12:00:37 +0000 Subject: [PATCH 4/4] Adding init of SKIP_REGRESSION_CHECK --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8aa6a8af5..cc2153f89 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -32,6 +32,7 @@ variables: INSTR_DIR: "scripts/c-code_instrument" BUILD_WITH_DEBUG_MODE_INFO: "" ENCODER_TEST: "" + SKIP_REGRESSION_CHECK: "" MANUAL_PIPELINE_TYPE: description: "Type for the manual pipeline run. Use 'pytest-compare' to run comparison test against reference float codec." value: 'default' -- GitLab