diff --git a/lib_com/options.h b/lib_com/options.h index c357e4d4dd2e9b3c620b3af24d3826d88fc7f4ac..6bd0eff23e1e6b47990fe45c82dc03398ee46ef2 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 7d541d076f4dd6b8b77823483077bf91514954b8..7e8713d9a117534f62bd9d8cf855b1a31aafbbb4 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 dbffbcc02e8d2f4e0eea3c4a974039ceba8118e7..aa13483ad4f7b8911d99f19b93beee77d6fda534 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 a9d9d24d7d8eee81332d99d00a8bd2e558b173f8..119aec443456b395d468bcd794ca3bd1e7771163 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 9ab72547bb6918c76b1b55aceb2e1dfca2260996..ed85e36489b6c5805e3d9c8934328b02ae0e7c73 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 */