From 0a678182cf333d033acb77b09787bc71bb0b77ab Mon Sep 17 00:00:00 2001 From: Fabian Bauer Date: Fri, 8 May 2026 13:07:47 +0200 Subject: [PATCH] add macro and code HARMONIZATION_2583_open_decoder_LPD --- lib_com/options.h | 1 + lib_com/prot_fx.h | 40 ++++++++++++++++++++++-------------- lib_dec/core_dec_init_fx.c | 40 ++++++++++++++++++++++-------------- lib_dec/core_dec_switch_fx.c | 8 ++++++++ lib_dec/init_dec_fx.c | 8 ++++++++ 5 files changed, 67 insertions(+), 30 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index c357e4d4d..6bd0eff23 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -107,6 +107,7 @@ #define FIX_1585_ASAN_FORMAT_SW_ALT /* VA,FhG: float issues 1585,1593: alternative fix memory leaks with format switching */ #define FIX_BASOP_2573_RF_MODE_UPDATE /* FhG: BASOP issue 2573: remove duplicated update of rf_mode parameters from evs_enc_fx(); was already done in updt_enc_common_fx() */ #define FIX_2570_BUF_OVFL /* Orange: basop issue 2570: global-buffer-overflow in lib_rend/ivas_objectRenderer_sources_fx.c */ +#define HARMONIZATION_2583_open_decoder_LPD /* FhG: harmonize open_decoder_LPD between EVS and IVAS versions */ /* #################### End BE switches ################################## */ diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index 7d541d076..7e8713d9a 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -7108,29 +7108,39 @@ ivas_error ppp_quarter_decoder_fx( DTFS_STRUCTURE PREV_CW_D_FX, /* i : Previous DTFS */ Decoder_State *st_fx ); +#ifndef HARMONIZATION_2583_open_decoder_LPD void open_decoder_LPD_fx( Decoder_State *st, const Word32 total_brate, /* Q0 */ const Word16 bwidth, /* Q0 */ const Word16 is_init /* i : indicate call during initialization */ ); +#endif +#ifdef HARMONIZATION_2583_open_decoder_LPD +void open_decoder_LPD_fx( +#else void open_decoder_LPD_ivas_fx( - Decoder_State *st, /* i/o: decoder state structure */ - const Word32 total_brate, /* i : total bitrate Q0*/ - const Word32 last_total_brate, /* i : last total bitrate Q0*/ - const Word16 bwidth, /* i : audio bandwidth Q0*/ - const Word16 MCT_flag, /* i : hMCT handle allocated (1) or not (0) Q0*/ - const Word16 last_element_mode, /* i : last element mode Q0*/ - const Word16 is_init, /* i : indicate call from init_decoder() to avoid double TC initialization Q0*/ - Word16 *Q_syn_Overl_TDAC, - Word16 *Q_fer_samples, - Word16 *Q_syn_Overl, - Word16 *Q_syn_Overl_TDACFB, - Word16 *Q_syn_OverlFB, - Word16 *Q_old_out, - Word16 *Q_old_outLB, - Word16 *Q_old_Aq_12_8 ); +#endif + Decoder_State *st, /* i/o: decoder state structure */ + const Word32 total_brate, /* i : total bitrate Q0*/ + const Word32 last_total_brate, + /*EVS:0 */ /* i : last total bitrate Q0*/ + const Word16 bwidth, /* i : audio bandwidth Q0*/ + const Word16 MCT_flag, + /*EVS:0 */ /* i : hMCT handle allocated (1) or not (0) Q0*/ + const Word16 last_element_mode, + /*EVS:0 */ /* i : last element mode Q0*/ + const Word16 is_init, /* i : indicate call from init_decoder() to avoid double TC initialization Q0*/ + Word16 *Q_syn_Overl_TDAC, /*EVS:0 */ + Word16 *Q_fer_samples, /*EVS:0 */ + Word16 *Q_syn_Overl, /*EVS:0 */ + Word16 *Q_syn_Overl_TDACFB, /*EVS:0 */ + Word16 *Q_syn_OverlFB, /*EVS:0 */ + Word16 *Q_old_out, /*EVS:0 */ + Word16 *Q_old_outLB, /*EVS:0 */ + Word16 *Q_old_Aq_12_8 /*EVS:0 */ +); void reset_tcx_overl_buf_fx( TCX_DEC_HANDLE hTcxDec /* i/o: TCX decoder handle */ diff --git a/lib_dec/core_dec_init_fx.c b/lib_dec/core_dec_init_fx.c index dbffbcc02..aa13483ad 100644 --- a/lib_dec/core_dec_init_fx.c +++ b/lib_dec/core_dec_init_fx.c @@ -17,6 +17,7 @@ * * Initialization of state variables *-----------------------------------------------------------------------*/ +#ifndef HARMONIZATION_2583_open_decoder_LPD void open_decoder_LPD_fx( Decoder_State *st, const Word32 total_brate, /* Q0 */ @@ -964,6 +965,7 @@ void open_decoder_LPD_fx( } return; } +#endif void tcxltp_dec_init_fx( TCX_LTP_DEC_HANDLE hTcxLtpDec, /* Q0 */ @@ -1073,22 +1075,30 @@ void acelp_plc_mdct_transition_fx( return; } +#ifdef HARMONIZATION_2583_open_decoder_LPD +void open_decoder_LPD_fx( +#else void open_decoder_LPD_ivas_fx( - Decoder_State *st, /* i/o: decoder state structure */ - const Word32 total_brate, /* i : total bitrate Q0*/ - const Word32 last_total_brate, /* i : last total bitrate Q0*/ - const Word16 bwidth, /* i : audio bandwidth Q0*/ - const Word16 MCT_flag, /* i : hMCT handle allocated (1) or not (0) Q0*/ - const Word16 last_element_mode, /* i : last element mode Q0*/ - const Word16 is_init, /* i : indicate call from init_decoder() to avoid double TC initialization Q0*/ - Word16 *Q_syn_Overl_TDAC, - Word16 *Q_fer_samples, - Word16 *Q_syn_Overl, - Word16 *Q_syn_Overl_TDACFB, - Word16 *Q_syn_OverlFB, - Word16 *Q_old_out, - Word16 *Q_old_outLB, - Word16 *Q_old_Aq_12_8 ) +#endif + Decoder_State *st, /* i/o: decoder state structure */ + const Word32 total_brate, /* i : total bitrate Q0*/ + const Word32 last_total_brate, + /*EVS:0 */ /* i : last total bitrate Q0*/ + const Word16 bwidth, /* i : audio bandwidth Q0*/ + const Word16 MCT_flag, + /*EVS:0 */ /* i : hMCT handle allocated (1) or not (0) Q0*/ + const Word16 last_element_mode, + /*EVS:0 */ /* i : last element mode Q0*/ + const Word16 is_init, /* i : indicate call from init_decoder() to avoid double TC initialization Q0*/ + Word16 *Q_syn_Overl_TDAC, /*EVS:0 */ + Word16 *Q_fer_samples, /*EVS:0 */ + Word16 *Q_syn_Overl, /*EVS:0 */ + Word16 *Q_syn_Overl_TDACFB, /*EVS:0 */ + Word16 *Q_syn_OverlFB, /*EVS:0 */ + Word16 *Q_old_out, /*EVS:0 */ + Word16 *Q_old_outLB, /*EVS:0 */ + Word16 *Q_old_Aq_12_8 /*EVS:0 */ +) { Word16 i; Word16 mem_syn_r_size_new; diff --git a/lib_dec/core_dec_switch_fx.c b/lib_dec/core_dec_switch_fx.c index a9d9d24d7..119aec443 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 HARMONIZATION_2583_open_decoder_LPD + open_decoder_LPD_fx( st, total_brate, 0, bwidth, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ); +#else open_decoder_LPD_fx( st, total_brate, bwidth, 0 ); +#endif } ELSE { @@ -323,7 +327,11 @@ void mode_switch_decoder_LPD_ivas_fx( assert( (Word16) ( st->sr_core / FRAMES_PER_SEC ) == extract_l( Mult_32_16( st->sr_core, INV_FRAME_PER_SEC_Q15 ) ) ); IF( NE_16( fscale, st->fscale ) || switchWB || bSwitchFromAmrwbIO || EQ_16( st->last_codec_mode, MODE1 ) || st->force_lpd_reset ) { +#ifdef HARMONIZATION_2583_open_decoder_LPD + open_decoder_LPD_fx( st, total_brate, last_total_brate, bwidth, MCT_flag, last_element_mode, 0, Q_syn_Overl_TDAC, Q_fer_samples, Q_syn_Overl, Q_syn_Overl_TDACFB, Q_syn_OverlFB, Q_old_out, Q_old_outLB, Q_old_Aq_12_8 ); +#else open_decoder_LPD_ivas_fx( st, total_brate, last_total_brate, bwidth, MCT_flag, last_element_mode, 0, Q_syn_Overl_TDAC, Q_fer_samples, Q_syn_Overl, Q_syn_Overl_TDACFB, Q_syn_OverlFB, Q_old_out, Q_old_outLB, Q_old_Aq_12_8 ); +#endif } ELSE { diff --git a/lib_dec/init_dec_fx.c b/lib_dec/init_dec_fx.c index 9ab72547b..ed85e3648 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 HARMONIZATION_2583_open_decoder_LPD + open_decoder_LPD_fx( st_fx, st_fx->total_brate, 0, st_fx->bwidth, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 ); +#else open_decoder_LPD_fx( st_fx, st_fx->total_brate, st_fx->bwidth, 1 ); +#endif } ELSE { @@ -894,7 +898,11 @@ ivas_error init_decoder_fx( move16(); move16(); move16(); +#ifdef HARMONIZATION_2583_open_decoder_LPD + open_decoder_LPD_fx( st_fx, st_fx->total_brate, st_fx->last_total_brate, st_fx->bwidth, 0, st_fx->element_mode, 1, &Q_syn_Overl_TDAC, &Q_fer_samples, &Q_syn_Overl, &Q_syn_Overl_TDACFB, &Q_syn_OverlFB, &Q_old_out, &Q_old_outLB, &Q_old_Aq_12_8 ); +#else open_decoder_LPD_ivas_fx( st_fx, st_fx->total_brate, st_fx->last_total_brate, st_fx->bwidth, 0, st_fx->element_mode, 1, &Q_syn_Overl_TDAC, &Q_fer_samples, &Q_syn_Overl, &Q_syn_Overl_TDACFB, &Q_syn_OverlFB, &Q_old_out, &Q_old_outLB, &Q_old_Aq_12_8 ); +#endif } /* PLC mode initialization */ -- GitLab