diff --git a/lib_com/options.h b/lib_com/options.h index bcb56c66efd5d4891d02a7d1ab9a1246b6a12a20..e91b203b76a97271e28b7642ccc6758caef0e6b9 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -208,6 +208,7 @@ #define FIX_1349_TNS_CRASH /* FhG: Fix crash in TNS entropy coding, in case order of joint TNS coding is reduced to 0 */ #define NONBE_FIX_1180_HQMDCT_PHECU_LT_MUTING /* Ericsson: issue 1180, corrected long term mute loop attnuation after 200ms in PhECU-PLC */ #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.c b/lib_dec/ivas_tcx_core_dec.c index 62eabd32a4f88579e478734415d9aceec132904a..ee4e4598ecd3949af3c29c36437659c2138ed2d7 100644 --- a/lib_dec/ivas_tcx_core_dec.c +++ b/lib_dec/ivas_tcx_core_dec.c @@ -285,7 +285,7 @@ void stereo_tcx_core_dec( } /*--------------------------------------------------------------------------------* - * LPC PARAMETERS + * LPC envelope decoding *--------------------------------------------------------------------------------*/ st->acelp_cfg.midLpc = 0; @@ -296,6 +296,9 @@ void stereo_tcx_core_dec( { int16_t tcx_lpc_cdk; +#ifdef FIX_1384_MSAN_stereo_tcx_core_enc + tcx_lpc_cdk = tcxlpc_get_cdk( st->coder_type ); +#else if ( bfi && st->use_partial_copy && st->rf_frame_type == RF_TCXFD ) { tcx_lpc_cdk = tcxlpc_get_cdk( GENERIC ); @@ -304,6 +307,7 @@ void stereo_tcx_core_dec( { tcx_lpc_cdk = tcxlpc_get_cdk( st->coder_type ); } +#endif mvr2r( st->lsf_old, &lsf[0], M ); mvr2r( st->lsp_old, &lsp[0], M ); @@ -402,11 +406,12 @@ void stereo_tcx_core_dec( lsp2a_stab( st->lsp_old, st->old_Aq_12_8, M ); } +#ifndef FIX_1384_MSAN_stereo_tcx_core_enc if ( st->enablePlcWaveadjust && bfi ) { st->hPlcInfo->nbLostCmpt++; } - +#endif /*--------------------------------------------------------------------------------* * TD-TCX concealment *--------------------------------------------------------------------------------*/ @@ -528,6 +533,7 @@ void stereo_tcx_core_dec( if ( st->core == TCX_10_CORE || st->core == TCX_20_CORE ) { +#ifndef FIX_1384_MSAN_stereo_tcx_core_enc if ( st->enablePlcWaveadjust || /* bfi */ ( st->last_total_brate >= HQ_48k && /* recovery */ st->last_codec_mode == MODE2 ) ) @@ -545,7 +551,7 @@ void stereo_tcx_core_dec( } } } - +#endif if ( !bfi && st->hTonalMDCTConc != NULL ) { TonalMDCTConceal_SaveTimeSignal( st->hTonalMDCTConc, synthFB, hTcxDec->L_frameTCX ); @@ -669,11 +675,12 @@ void stereo_tcx_core_dec( if ( !bfi ) { +#ifndef FIX_1384_MSAN_stereo_tcx_core_enc if ( st->enablePlcWaveadjust ) { st->hPlcInfo->nbLostCmpt = 0; } - +#endif if ( param[1 + NOISE_FILL_RANGES] != 0 ) { set_f( pitch_buf, hTcxLtpDec->tcxltp_pitch_int + (float) hTcxLtpDec->tcxltp_pitch_fr / (float) st->pit_res_max, NB_SUBFR16k ); @@ -830,7 +837,11 @@ static void dec_prm_tcx( getTCXMode( st, st, 0 /* <- MCT_flag */ ); /* last_core for error concealment */ +#ifdef FIX_1384_MSAN_stereo_tcx_core_enc + if ( st->element_mode != IVAS_CPE_MDCT ) +#else if ( !st->use_partial_copy && st->element_mode != IVAS_CPE_MDCT ) +#endif { st->last_core_from_bs = get_next_indice( st, 1 ); /* Store decoder memory of last_core */ if ( st->last_core == ACELP_CORE && st->last_core_from_bs != ACELP_CORE ) @@ -856,8 +867,10 @@ static void dec_prm_tcx( } } +#ifndef FIX_1384_MSAN_stereo_tcx_core_enc if ( !st->use_partial_copy ) { +#endif if ( st->element_mode != IVAS_CPE_MDCT ) { getTCXWindowing( st->core, st->last_core, st->element_mode, st->hTcxCfg, st ); @@ -868,7 +881,9 @@ static void dec_prm_tcx( { st->dec_glr_idx = -1; } +#ifndef FIX_1384_MSAN_stereo_tcx_core_enc } +#endif #ifdef DEBUG_MODE_TCX fprintf( pF, "\t TCX Header: %d bits: %d %d %d %d\n", st->next_bit_pos - start_bit_pos, st->tcxonly, st->core, st->tcxonly ? st->clas_dec : st->hTcxCfg->coder_type, st->hTcxCfg->tcx_curr_overlap_mode ); @@ -891,6 +906,17 @@ static void dec_prm_tcx( * TCX20/10 parameters *--------------------------------------------------------------------------------*/ +#ifdef FIX_1384_MSAN_stereo_tcx_core_enc + getTCXparam( st, st, hm_cfg, param, bits_common, start_bit_pos, NULL, NULL, NULL, -1 ); + + if ( *total_nbbits - bitsRead[0] < ( st->next_bit_pos - start_bit_pos ) ) + { + st->BER_detect = 1; + st->next_bit_pos = start_bit_pos + *total_nbbits - bitsRead[0]; + } + + bitsRead[0] = st->next_bit_pos - start_bit_pos; +#else if ( st->use_partial_copy == 0 ) { getTCXparam( st, st, hm_cfg, param, bits_common, start_bit_pos, NULL, NULL, NULL, -1 ); @@ -906,6 +932,7 @@ static void dec_prm_tcx( bitsRead[0] = st->next_bit_pos - start_bit_pos; } +#endif return; } diff --git a/lib_enc/ivas_tcx_core_enc.c b/lib_enc/ivas_tcx_core_enc.c index 91adac9a0fbe1c49d145762b1c825190f0dc7533..175dedd085dee9493466513b1401624dae9b62bb 100644 --- a/lib_enc/ivas_tcx_core_enc.c +++ b/lib_enc/ivas_tcx_core_enc.c @@ -310,7 +310,7 @@ void stereo_tcx_core_enc( } /*--------------------------------------------------------------* - * Envelope Quantization and FDNS + * LPC Envelope Quantization and FDNS *---------------------------------------------------------------*/ if ( !st->enableTcxLpc ) @@ -336,6 +336,10 @@ void stereo_tcx_core_enc( } } + +#ifdef FIX_1384_MSAN_stereo_tcx_core_enc + st->acelp_cfg.midLpc = 0; +#endif last_core_orig = st->last_core; for ( n = 0; n < n_subframes; n++ ) {