From db5c28eb4068e28ca9a170af99ed93518ccdb00c Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 8 Apr 2026 12:04:54 +0200 Subject: [PATCH] harmonize TCX config within open_decoder_LPD() and make sure st->hTcxCfg->psychParamsCurrent gets initialized --- lib_com/options.h | 1 + lib_com/prot_fx.h | 7 ++++++- lib_dec/core_dec_init_fx.c | 31 ++++++++++++++++++++++++++++++- lib_dec/core_dec_switch_fx.c | 4 ++++ lib_dec/init_dec_fx.c | 4 ++++ 5 files changed, 45 insertions(+), 2 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index e628cf13d..51fa0e91c 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -103,6 +103,7 @@ #define HARMONIZE_DCT /* VA: removal of duplicated DCT functions */ #define FIX_2489_HARMONIZE_FdCng_encodeSID /* FhG: harmonize FdCng_encodeSID_fx() and FdCng_encodeSID_ivas_fx() */ #define FIX_1527_CMR_BITRATE_IDX /* Fix for incorrect bitrate idx packed in rtp CMR E-byte */ +#define FIX_BASOP_2509_EVS_CONCEAL_UNINIT_MEM /* FhG: BASOP 2509: st->hTcxCfg->psychParamsCurrent is not initialized */ /* #################### End BE switches ################################## */ diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index 1df946613..e8bd2b3ef 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -7290,7 +7290,12 @@ ivas_error ppp_quarter_decoder_fx( void open_decoder_LPD_fx( Decoder_State *st, const Word32 total_brate, /* Q0 */ - const Word16 bwidth /* Q0 */ +#ifndef FIX_BASOP_2509_EVS_CONCEAL_UNINIT_MEM + const Word16 bwidth /* Q0 */ +#else + const Word16 bwidth, /* Q0 */ + const Word16 is_init /* i : indicate call during initialization */ +#endif ); void open_decoder_LPD_ivas_fx( diff --git a/lib_dec/core_dec_init_fx.c b/lib_dec/core_dec_init_fx.c index dd3115fb7..357a57f0b 100644 --- a/lib_dec/core_dec_init_fx.c +++ b/lib_dec/core_dec_init_fx.c @@ -20,7 +20,12 @@ void open_decoder_LPD_fx( Decoder_State *st, const Word32 total_brate, /* Q0 */ - const Word16 bwidth /* Q0 */ +#ifndef FIX_BASOP_2509_EVS_CONCEAL_UNINIT_MEM + const Word16 bwidth /* Q0 */ +#else + const Word16 bwidth, /* Q0 */ + const Word16 is_init /* i : indicate call during initialization */ +#endif ) { Word16 i; @@ -206,6 +211,29 @@ void open_decoder_LPD_fx( set16_fx( hBWE_TD->cur_sub_Aq_fx, 0, M + 1 ); /* Q12 */ } +#ifdef FIX_BASOP_2509_EVS_CONCEAL_UNINIT_MEM + IF( st->hIGFDec != NULL ) + { + test(); + IF( !is_init || NE_16( st->element_mode, IVAS_CPE_MDCT ) ) + { + init_tcx_cfg_fx( st->hTcxCfg, total_brate, st->sr_core, st->output_Fs, st->L_frame, st->bwidth, st->hTcxDec->L_frameTCX, st->fscale, st->preemph_fac, st->tcxonly, st->rf_flag, st->igf, st->hIGFDec->infoIGFStopFreq, st->element_mode, st->ini_frame, MCT_flag, fscaleFB ); + } + ELSE + { + st->hTcxCfg->tcx_curr_overlap_mode = st->hTcxCfg->tcx_last_overlap_mode = ALDO_WINDOW; + move16(); + move16(); + st->hTcxCfg->last_aldo = 1; + move16(); + } + } + + IF( st->hTECDec != NULL ) + { + resetTecDec_Fx( st->hTECDec ); + } +#else /*TCX config*/ st->hTcxCfg->preemph_fac = st->preemph_fac; move16(); @@ -269,6 +297,7 @@ void open_decoder_LPD_fx( /* Initialize decoder delay */ +#endif if ( NE_16( st->element_mode, IVAS_SCE ) ) { diff --git a/lib_dec/core_dec_switch_fx.c b/lib_dec/core_dec_switch_fx.c index 142609fff..ea55dd251 100644 --- a/lib_dec/core_dec_switch_fx.c +++ b/lib_dec/core_dec_switch_fx.c @@ -89,7 +89,11 @@ void mode_switch_decoder_LPD_fx( test(); IF( NE_16( fscale, st->fscale ) || ( switchWB != 0 ) || ( bSwitchFromAmrwbIO != 0 ) || EQ_16( st->last_codec_mode, MODE1 ) || st->force_lpd_reset ) { +#ifdef FIX_BASOP_2509_EVS_CONCEAL_UNINIT_MEM + open_decoder_LPD_fx( st, total_brate, bwidth, 0 ); +#else open_decoder_LPD_fx( st, total_brate, bwidth ); +#endif } ELSE { diff --git a/lib_dec/init_dec_fx.c b/lib_dec/init_dec_fx.c index bae2638e1..d3b61ab39 100644 --- a/lib_dec/init_dec_fx.c +++ b/lib_dec/init_dec_fx.c @@ -881,7 +881,11 @@ ivas_error init_decoder_fx( /* Init Decoder */ IF( st_fx->element_mode == EVS_MONO ) { +#ifdef FIX_BASOP_2509_EVS_CONCEAL_UNINIT_MEM + open_decoder_LPD_fx( st_fx, st_fx->total_brate, st_fx->bwidth, 1 ); +#else open_decoder_LPD_fx( st_fx, st_fx->total_brate, st_fx->bwidth ); +#endif } ELSE { -- GitLab