From 4087bb7d42ee3666f62597e0b5dbea9ad63f184e Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 12 Feb 2026 11:01:11 +0100 Subject: [PATCH 1/4] FIX_2432_ISM_SPIKES_16KHZ --- lib_com/options.h | 2 ++ lib_dec/ivas_core_dec.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index c289efb2a4..e41f356941 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -168,6 +168,8 @@ /* #################### Start NON-BE switches ############################ */ /* any switch which is non-be wrt. TS 26.258 V3.0 */ +#define FIX_2432_ISM_SPIKES_16KHZ /* VA: basop issue 2432: fix spikes in ISM decoding at 16kHz output sampling rate */ + /* ##################### End NON-BE switches ########################### */ /* ################## End MAINTENANCE switches ######################### */ diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index 04105f2796..96dd9121fe 100644 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -532,7 +532,11 @@ ivas_error ivas_core_dec( swb_bwe_dec( st, output[n], synth[n], hb_synth[n], use_cldfb_for_dft, output_frame ); } +#ifdef FIX_2432_ISM_SPIKES_16KHZ + if ( ( st->core == ACELP_CORE && ( st->extl == -1 || st->extl == SWB_CNG || ( st->extl == WB_BWE && st->bws_cnt > 0 ) ) ) && flag_bwe_bws == 0 ) +#else if ( ( st->core == ACELP_CORE && ( st->extl == -1 || st->extl == SWB_CNG ) ) && flag_bwe_bws == 0 ) +#endif { set_f( hb_synth[n], 0.0f, L_FRAME48k ); } -- GitLab From 94349a38da7471ee63ca2c2c5f52a02b630abf24 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 12 Feb 2026 11:54:48 +0100 Subject: [PATCH 2/4] FIX_2432_ISM_SPIKES_16KHZ --- lib_dec/ivas_core_dec.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index 96dd9121fe..147953efcb 100644 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -76,7 +76,11 @@ ivas_error ivas_core_dec( float tmp_buffer[L_FRAME48k]; int16_t tmps, incr; float *bwe_exc_extended[CPE_CHANNELS] = { NULL, NULL }; +#ifdef FIX_2432_ISM_SPIKES_16KHZ + int16_t flag_bwe_bws, flaf_swb_tbe; +#else int16_t flag_bwe_bws; +#endif float voice_factors[CPE_CHANNELS][NB_SUBFR16k]; int16_t core_switching_flag[CPE_CHANNELS]; float old_syn_12k8_16k[CPE_CHANNELS][L_FRAME16k]; @@ -513,9 +517,16 @@ ivas_error ivas_core_dec( * SWB(FB) BWE decoding *---------------------------------------------------------------------*/ +#ifdef FIX_2432_ISM_SPIKES_16KHZ + flaf_swb_tbe = ( st->extl == SWB_TBE || st->extl == FB_TBE || ( st->coder_type != AUDIO && st->coder_type != INACTIVE && st->core_brate >= SID_2k40 && st->core == ACELP_CORE && !st->con_tcx && output_Fs >= 32000 && st->bwidth > NB && st->bws_cnt > 0 ) ); +#endif flag_bwe_bws = ( output_Fs >= 32000 && st->core == ACELP_CORE && st->bwidth > NB && st->bws_cnt > 0 && st->bfi == 0 ); +#ifdef FIX_2432_ISM_SPIKES_16KHZ + if( flaf_swb_tbe ) +#else if ( st->extl == SWB_TBE || st->extl == FB_TBE || ( st->coder_type != AUDIO && st->coder_type != INACTIVE && st->core_brate >= SID_2k40 && st->core == ACELP_CORE && !st->con_tcx && output_Fs >= 32000 && st->bwidth > NB && st->bws_cnt > 0 ) ) +#endif { /* SWB TBE decoder */ swb_tbe_dec( st, hStereoICBWE, bwe_exc_extended[n], voice_factors[n], old_syn_12k8_16k[n], tmp_buffer /*fb_exc*/, hb_synth[n], pitch_buf[n] ); @@ -533,7 +544,8 @@ ivas_error ivas_core_dec( } #ifdef FIX_2432_ISM_SPIKES_16KHZ - if ( ( st->core == ACELP_CORE && ( st->extl == -1 || st->extl == SWB_CNG || ( st->extl == WB_BWE && st->bws_cnt > 0 ) ) ) && flag_bwe_bws == 0 ) + /* set hb_synth[n] buffer to zeros in case of no BWE decoding */ + if ( ( st->core == ACELP_CORE && ( st->extl == -1 || st->extl == SWB_CNG || ( st->extl == WB_BWE && st->bws_cnt > 0 && flaf_swb_tbe == 0) ) ) && flag_bwe_bws == 0 ) #else if ( ( st->core == ACELP_CORE && ( st->extl == -1 || st->extl == SWB_CNG ) ) && flag_bwe_bws == 0 ) #endif -- GitLab From 017ec54015c5387040d5717fc26cb06a6d5f8285 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 12 Feb 2026 11:56:57 +0100 Subject: [PATCH 3/4] clang-format --- lib_dec/ivas_core_dec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index 147953efcb..460bcdeabe 100644 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -523,7 +523,7 @@ ivas_error ivas_core_dec( flag_bwe_bws = ( output_Fs >= 32000 && st->core == ACELP_CORE && st->bwidth > NB && st->bws_cnt > 0 && st->bfi == 0 ); #ifdef FIX_2432_ISM_SPIKES_16KHZ - if( flaf_swb_tbe ) + if ( flaf_swb_tbe ) #else if ( st->extl == SWB_TBE || st->extl == FB_TBE || ( st->coder_type != AUDIO && st->coder_type != INACTIVE && st->core_brate >= SID_2k40 && st->core == ACELP_CORE && !st->con_tcx && output_Fs >= 32000 && st->bwidth > NB && st->bws_cnt > 0 ) ) #endif @@ -545,7 +545,7 @@ ivas_error ivas_core_dec( #ifdef FIX_2432_ISM_SPIKES_16KHZ /* set hb_synth[n] buffer to zeros in case of no BWE decoding */ - if ( ( st->core == ACELP_CORE && ( st->extl == -1 || st->extl == SWB_CNG || ( st->extl == WB_BWE && st->bws_cnt > 0 && flaf_swb_tbe == 0) ) ) && flag_bwe_bws == 0 ) + if ( ( st->core == ACELP_CORE && ( st->extl == -1 || st->extl == SWB_CNG || ( st->extl == WB_BWE && st->bws_cnt > 0 && flaf_swb_tbe == 0 ) ) ) && flag_bwe_bws == 0 ) #else if ( ( st->core == ACELP_CORE && ( st->extl == -1 || st->extl == SWB_CNG ) ) && flag_bwe_bws == 0 ) #endif -- GitLab From 87f5e8bfb11d2210fad89f572bc685f0a2af5d85 Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Thu, 19 Feb 2026 08:27:23 -0500 Subject: [PATCH 4/4] replacing flaf_swb_tbe by flag_swb_tbe --- lib_dec/ivas_core_dec.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index 460bcdeabe..fd9ae141e5 100644 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -77,7 +77,7 @@ ivas_error ivas_core_dec( int16_t tmps, incr; float *bwe_exc_extended[CPE_CHANNELS] = { NULL, NULL }; #ifdef FIX_2432_ISM_SPIKES_16KHZ - int16_t flag_bwe_bws, flaf_swb_tbe; + int16_t flag_bwe_bws, flag_swb_tbe; #else int16_t flag_bwe_bws; #endif @@ -518,12 +518,12 @@ ivas_error ivas_core_dec( *---------------------------------------------------------------------*/ #ifdef FIX_2432_ISM_SPIKES_16KHZ - flaf_swb_tbe = ( st->extl == SWB_TBE || st->extl == FB_TBE || ( st->coder_type != AUDIO && st->coder_type != INACTIVE && st->core_brate >= SID_2k40 && st->core == ACELP_CORE && !st->con_tcx && output_Fs >= 32000 && st->bwidth > NB && st->bws_cnt > 0 ) ); + flag_swb_tbe = ( st->extl == SWB_TBE || st->extl == FB_TBE || ( st->coder_type != AUDIO && st->coder_type != INACTIVE && st->core_brate >= SID_2k40 && st->core == ACELP_CORE && !st->con_tcx && output_Fs >= 32000 && st->bwidth > NB && st->bws_cnt > 0 ) ); #endif flag_bwe_bws = ( output_Fs >= 32000 && st->core == ACELP_CORE && st->bwidth > NB && st->bws_cnt > 0 && st->bfi == 0 ); #ifdef FIX_2432_ISM_SPIKES_16KHZ - if ( flaf_swb_tbe ) + if ( flag_swb_tbe ) #else if ( st->extl == SWB_TBE || st->extl == FB_TBE || ( st->coder_type != AUDIO && st->coder_type != INACTIVE && st->core_brate >= SID_2k40 && st->core == ACELP_CORE && !st->con_tcx && output_Fs >= 32000 && st->bwidth > NB && st->bws_cnt > 0 ) ) #endif @@ -545,7 +545,7 @@ ivas_error ivas_core_dec( #ifdef FIX_2432_ISM_SPIKES_16KHZ /* set hb_synth[n] buffer to zeros in case of no BWE decoding */ - if ( ( st->core == ACELP_CORE && ( st->extl == -1 || st->extl == SWB_CNG || ( st->extl == WB_BWE && st->bws_cnt > 0 && flaf_swb_tbe == 0 ) ) ) && flag_bwe_bws == 0 ) + if ( ( st->core == ACELP_CORE && ( st->extl == -1 || st->extl == SWB_CNG || ( st->extl == WB_BWE && st->bws_cnt > 0 && flag_swb_tbe == 0 ) ) ) && flag_bwe_bws == 0 ) #else if ( ( st->core == ACELP_CORE && ( st->extl == -1 || st->extl == SWB_CNG ) ) && flag_bwe_bws == 0 ) #endif -- GitLab