diff --git a/lib_com/options.h b/lib_com/options.h index c663516d0b847a5552d39c783c6e1ad1634862ae..bbe3cb8d57fae1ed375e5f9589981a76d48c6ca5 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -154,6 +154,7 @@ #define NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING /* Ericsson: issue 1180, corrected long term mute loop attnuation after 200ms in PhECU-PLC */ #define FIX_1179_USAN_PHASEECU /* Eri: issue 1179: better handling of 16 bit wrap around for very long(>200ms) FER-bursts */ #define NONBE_1200_ISM_JBM_BRATE_SW_FLUSH /* VA: issue 1200: fix bug in renderer flush in ISM JBM bitrate switching */ +#define FIX_1384_MSAN_stereo_tcx_core_enc /* VA: issue 1384: fix use-of-uninitialized value in stereo_tcx_core_enc() */ // object-editing feature porting #define OBJ_EDITING_API /* object editing changes related to the API */ diff --git a/lib_dec/ivas_tcx_core_dec_fx.c b/lib_dec/ivas_tcx_core_dec_fx.c index af35143c262ede95611fea4b1546eebe8cf691d7..afe1b71db8c37411bbb890c45b45399d118b6185 100644 --- a/lib_dec/ivas_tcx_core_dec_fx.c +++ b/lib_dec/ivas_tcx_core_dec_fx.c @@ -337,7 +337,7 @@ void stereo_tcx_core_dec_fx( } /*--------------------------------------------------------------------------------* - * LPC PARAMETERS + * LPC envelope decoding *--------------------------------------------------------------------------------*/ st->acelp_cfg.midLpc = 0; @@ -349,6 +349,10 @@ void stereo_tcx_core_dec_fx( { Word16 tcx_lpc_cdk; +#ifdef FIX_1384_MSAN_stereo_tcx_core_enc + tcx_lpc_cdk = tcxlpc_get_cdk( st->coder_type ); + move16(); +#else test(); test(); IF( bfi && st->use_partial_copy && EQ_16( st->rf_frame_type, RF_TCXFD ) ) @@ -361,6 +365,7 @@ void stereo_tcx_core_dec_fx( tcx_lpc_cdk = tcxlpc_get_cdk( st->coder_type ); /* Q0 */ move16(); } +#endif Copy( st->lsf_old_fx, &lsf_fx[0], M ); /* Q2.56 */ Copy( st->lsp_old_fx, &lsp_fx[0], M ); /* Q15 */ @@ -485,13 +490,14 @@ void stereo_tcx_core_dec_fx( E_LPC_f_lsp_a_conversion( st->lsp_old_fx, st->old_Aq_12_8_fx, M ); } +#ifndef FIX_1384_MSAN_stereo_tcx_core_enc test(); if ( st->enablePlcWaveadjust && bfi ) { st->hPlcInfo->nbLostCmpt = add( st->hPlcInfo->nbLostCmpt, 1 ); /* Q0 */ move16(); } - +#endif /*--------------------------------------------------------------------------------* * TD-TCX concealment *--------------------------------------------------------------------------------*/ @@ -630,6 +636,7 @@ void stereo_tcx_core_dec_fx( test(); IF( EQ_16( st->core, TCX_10_CORE ) || EQ_16( st->core, TCX_20_CORE ) ) { +#ifndef FIX_1384_MSAN_stereo_tcx_core_enc test(); test(); IF( st->enablePlcWaveadjust || /* bfi */ @@ -660,7 +667,7 @@ void stereo_tcx_core_dec_fx( } } } - +#endif IF( !bfi && st->hTonalMDCTConc != NULL ) { TonalMDCTConceal_SaveTimeSignal_ivas_fx( st->hTonalMDCTConc, synthFB_fx, 0, hTcxDec->L_frameTCX ); @@ -828,12 +835,13 @@ void stereo_tcx_core_dec_fx( IF( !bfi ) { +#ifndef FIX_1384_MSAN_stereo_tcx_core_enc if ( st->enablePlcWaveadjust ) { st->hPlcInfo->nbLostCmpt = 0; move16(); } - +#endif IF( param[1 + NOISE_FILL_RANGES] != 0 ) { Word32 tcxltp_pitch_tmp = L_add( L_deposit_h( hTcxLtpDec->tcxltp_pitch_int ), L_shl( L_deposit_l( div_s( hTcxLtpDec->tcxltp_pitch_fr, st->pit_res_max ) ), 1 ) ); /*15Q16*/ @@ -1017,8 +1025,12 @@ static void dec_prm_tcx_ivas_fx( getTCXMode_ivas_fx( st, st, 0 /* <- MCT_flag */ ); /* last_core for error concealment */ +#ifdef FIX_1384_MSAN_stereo_tcx_core_enc + IF( NE_16( st->element_mode, IVAS_CPE_MDCT ) ) +#else test(); IF( !st->use_partial_copy && NE_16( st->element_mode, IVAS_CPE_MDCT ) ) +#endif { st->last_core_from_bs = get_next_indice_fx( st, 1 ); /* Store decoder memory of last_core Q0*/ move16(); @@ -1063,8 +1075,10 @@ static void dec_prm_tcx_ivas_fx( } } +#ifndef FIX_1384_MSAN_stereo_tcx_core_enc IF( !st->use_partial_copy ) { +#endif IF( NE_16( st->element_mode, IVAS_CPE_MDCT ) ) { getTCXWindowing_ivas_fx( st->core, st->last_core, st->element_mode, st->hTcxCfg, st ); @@ -1077,8 +1091,9 @@ static void dec_prm_tcx_ivas_fx( st->dec_glr_idx = -1; move16(); } +#ifndef FIX_1384_MSAN_stereo_tcx_core_enc } - +#endif /*--------------------------------------------------------------------------------* * LPC parameters @@ -1093,6 +1108,20 @@ static void dec_prm_tcx_ivas_fx( * TCX20/10 parameters *--------------------------------------------------------------------------------*/ +#ifdef FIX_1384_MSAN_stereo_tcx_core_enc + getTCXparam_fx( st, st, hm_cfg, param, bits_common, start_bit_pos, NULL, NULL, NULL, -1 ); + + IF( LT_16( sub( *total_nbbits, bitsRead[0] ), sub( st->next_bit_pos, start_bit_pos ) ) ) + { + st->BER_detect = 1; + move16(); + st->next_bit_pos = add( start_bit_pos, sub( *total_nbbits, bitsRead[0] ) ); /* Q0 */ + move16(); + } + + bitsRead[0] = sub( st->next_bit_pos, start_bit_pos ); /* Q0 */ + move16(); +#else IF( st->use_partial_copy == 0 ) { getTCXparam_fx( st, st, hm_cfg, param, bits_common, start_bit_pos, NULL, NULL, NULL, -1 ); @@ -1111,6 +1140,7 @@ static void dec_prm_tcx_ivas_fx( bitsRead[0] = sub( st->next_bit_pos, start_bit_pos ); /* Q0 */ move16(); } +#endif return; } diff --git a/lib_enc/ivas_tcx_core_enc_fx.c b/lib_enc/ivas_tcx_core_enc_fx.c index 623c6c7cff64ecd295db37ffaa4d1850a93efc2e..52cc9db8308401ab6eb97c7c01d2ff51d4e9bae0 100644 --- a/lib_enc/ivas_tcx_core_enc_fx.c +++ b/lib_enc/ivas_tcx_core_enc_fx.c @@ -408,6 +408,10 @@ void stereo_tcx_core_enc( st->hLPDmem->q_lpd_syn = st->Q_syn; move16(); + /*--------------------------------------------------------------* + * LPC Envelope Quantization and FDNS + *---------------------------------------------------------------*/ + IF( !st->enableTcxLpc ) { IF( st->envWeighted ) @@ -432,6 +436,10 @@ void stereo_tcx_core_enc( } } +#ifdef FIX_1384_MSAN_stereo_tcx_core_enc + st->acelp_cfg.midLpc = 0; + move16(); +#endif last_core_orig = st->last_core; move16();