From b90b8a81fa7e76f57d8579e4d1a6af4a70db6207 Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Tue, 21 May 2024 18:56:25 -0400 Subject: [PATCH] Fix proposal for 747 to solve energy burst within TDBWE --- lib_com/options.h | 1 + lib_dec/core_switching_dec_fx.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 0c348e36b..8a960be74 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -134,6 +134,7 @@ #define FIX_737_HQ_ACELP_SWITCH_SCALING_ERROR /* Eri: Proposed fix for issue 737: scaling error in excitation memory after HQ->ACELP switch */ #define FIX_736_BWE_SECT_C // Solves an issue where the BWE was disappearing, problem related to wrong scaling in ic-BWE #define FIX_734_MISSING_SUBFR_LOW_RATE_ACELP +#define FIX_747_TDBWE_ENERGY_BURST /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_dec/core_switching_dec_fx.c b/lib_dec/core_switching_dec_fx.c index 2cf9bcc3a..55dfe2f50 100644 --- a/lib_dec/core_switching_dec_fx.c +++ b/lib_dec/core_switching_dec_fx.c @@ -2012,9 +2012,18 @@ ivas_error core_switching_post_dec_ivas_fx( test(); test(); test(); + +#ifdef FIX_747_TDBWE_ENERGY_BURST + IF( ( ( EQ_16( st_fx->extl, SWB_TBE ) || EQ_16( st_fx->extl, FB_TBE ) || EQ_16( st_fx->extl, SWB_CNG ) ) && + ( NE_16( st_fx->L_frame, st_fx->last_L_frame ) || ( NE_16( st_fx->last_extl, SWB_TBE ) && NE_16( st_fx->last_extl, FB_TBE ) && NE_16( st_fx->last_core, TCX_20_CORE ) && NE_16( st_fx->last_core, TCX_10_CORE ) ) || EQ_16( st_fx->last_core, HQ_CORE ) ) ) || + ( LT_16( st_fx->bwidth, st_fx->last_bwidth ) && NE_16( st_fx->last_extl, SWB_TBE ) ) || st_fx->old_ppp_mode || ( ( EQ_16( st_fx->prev_coder_type, AUDIO ) || EQ_16( st_fx->prev_coder_type, INACTIVE ) ) && st_fx->bws_cnt > 0 ) + || ( st_fx->bws_cnt == 0 && EQ_16( st_fx->prev_bws_cnt, N_WS2N_FRAMES ) ) ) +#else IF( ( ( EQ_16( st_fx->extl, SWB_TBE ) || EQ_16( st_fx->extl, FB_TBE ) || EQ_16( st_fx->extl, SWB_CNG ) ) && ( NE_16( st_fx->L_frame, st_fx->last_L_frame ) || ( NE_16( st_fx->last_extl, SWB_TBE ) && NE_16( st_fx->last_extl, FB_TBE ) ) || EQ_16( st_fx->last_core, HQ_CORE ) ) ) || ( LT_16( st_fx->bwidth, st_fx->last_bwidth ) && NE_16( st_fx->last_extl, SWB_TBE ) ) || st_fx->old_ppp_mode || ( ( EQ_16( st_fx->prev_coder_type, AUDIO ) || EQ_16( st_fx->prev_coder_type, INACTIVE ) ) && st_fx->bws_cnt > 0 ) || ( st_fx->bws_cnt == 0 && EQ_16( st_fx->prev_bws_cnt, N_WS2N_FRAMES ) ) ) + +#endif { swb_tbe_reset_fx( hBWE_TD->mem_csfilt_fx, hBWE_TD->mem_genSHBexc_filt_down_shb_fx, hBWE_TD->state_lpc_syn_fx, hBWE_TD->syn_overlap_fx, hBWE_TD->state_syn_shbexc_fx, &( hBWE_TD->tbe_demph_fx ), &( hBWE_TD->tbe_premph_fx ), hBWE_TD->mem_stp_swb_fx, &( hBWE_TD->gain_prec_swb_fx ) ); -- GitLab