diff --git a/lib_com/options.h b/lib_com/options.h index 4769d3de8dec2f0578c290133f19cb02804fbd13..2924ec7eb41ad0763d5255928b56799542a91157 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -130,6 +130,7 @@ #define NONBE_FIX_981_PARAMBIN_DEFAULT_EARLY_PART /* Nokia: Set default early part energy correction to unity for BINAURAL_ROOM_REVERB */ #define NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR /* Nokia: Fix issue 1174 by removing the unnecessary inner loop causing problems. */ #define NONBE_FIX_1052_SBA_EXT_FIX /* VA: SBA external output support fix - do not overwrite "output_config" parameter */ +#define NONBE_FIX_1110_STEREO_DTX_BRATE_SWITCHING /* VA: issue 1110: fix encoder crash in the stereo DTX bitrate switching condition */ #define NONBE_1894_OSBA_SCALING /* FhG: do not scale OSBA inputs by 0.5 any more */ diff --git a/lib_dec/ivas_stereo_cng_dec_fx.c b/lib_dec/ivas_stereo_cng_dec_fx.c index 463032467ed8b90f0d9c942ea1e135f50617ea8a..c214b36fc9e1c9d58e3d81730e4bf0b23f791f9b 100644 --- a/lib_dec/ivas_stereo_cng_dec_fx.c +++ b/lib_dec/ivas_stereo_cng_dec_fx.c @@ -1373,6 +1373,7 @@ static void FindEmEs_fx( /* long-term estimate */ *lt_es_em_fx = L_add( Mpy_32_32( 858993459, *lt_es_em_fx ), Mpy_32_32( 1288490188, es_em_fx ) ); /* Q24 */ move32(); + return; } @@ -1422,13 +1423,17 @@ void stereo_cna_update_params_fx( { FindEmEs_fx( output_fx[0], output_fx[1], output_frame, &hCPE->lt_es_em_fx ); - hCPE->hStereoCng->first_SID_after_TD = 1; /* Q0 */ move16(); stereo_cng_compute_LRcorr_fx( hCPE, output_fx, output_frame, tdm_ratio_idx ); } ELSE { +#ifdef NONBE_FIX_1110_STEREO_DTX_BRATE_SWITCHING + hFdCngDec->first_cna_noise_updated = 0; + move16(); +#endif + return; } @@ -1568,7 +1573,6 @@ void stereo_cna_update_params_fx( set16_fx( hFdCngDec->cna_cm_fx, hFdCngDec->cna_LR_LT_fx, hFdCngDec->cna_nbands ); } - /* Soft VAD for stereo CNA */ test(); IF( EQ_16( hCPE->element_mode, IVAS_CPE_TD ) || EQ_16( hCPE->element_mode, IVAS_CPE_DFT ) ) diff --git a/lib_dec/ivas_stereo_switching_dec_fx.c b/lib_dec/ivas_stereo_switching_dec_fx.c index 57f631204777984c44b613c1b08fdffed3590fcf..fe99711e2f721b3eaa28ebe870d97c159c4259fb 100644 --- a/lib_dec/ivas_stereo_switching_dec_fx.c +++ b/lib_dec/ivas_stereo_switching_dec_fx.c @@ -1986,6 +1986,12 @@ void stereo_switching_dec( Copy( sts[0]->lsf_old_fx, sts[1]->lsf_old_fx, M ); /* Q2.56 */ Copy( sts[0]->lsp_old_fx, sts[1]->lsp_old_fx, M ); /* Q15 */ + +#ifdef NONBE_FIX_1110_STEREO_DTX_BRATE_SWITCHING + sts[1]->last_core_brate = sts[0]->last_core_brate; + move16(); +#endif + IF( EQ_16( hCPE->element_mode, IVAS_CPE_MDCT ) ) { sts[1]->last_core = sts[0]->last_core; /* Q0 */ @@ -1993,7 +1999,6 @@ void stereo_switching_dec( sts[1]->last_coder_type = sts[0]->last_coder_type; /* Q0 */ move16(); - // 32bit buffer Copy32( sts[0]->hHQ_core->old_out_fx32, sts[1]->hHQ_core->old_out_fx32, L_FRAME48k ); /* exp(exp_old_out) */ Copy32( sts[0]->delay_buf_out32_fx, sts[1]->delay_buf_out32_fx, HQ_DELTA_MAX * HQ_DELAY_COMP ); /* Q11 */ diff --git a/lib_enc/ivas_stereo_switching_enc_fx.c b/lib_enc/ivas_stereo_switching_enc_fx.c index a54e56fb9a42651b8f8a61ea9c092cb971cd0b1d..21f0bfeb137b81743795295c003af7ccbcf08885 100644 --- a/lib_enc/ivas_stereo_switching_enc_fx.c +++ b/lib_enc/ivas_stereo_switching_enc_fx.c @@ -906,8 +906,14 @@ void stereo_switching_enc_fx( Copy( sts[0]->lsf_old1_fx, sts[1]->lsf_old1_fx, M ); /* Qlog2(2.56) */ Copy( sts[0]->lsp_old1_fx, sts[1]->lsp_old1_fx, M ); /* Q15 */ +#ifdef NONBE_FIX_1110_STEREO_DTX_BRATE_SWITCHING + sts[1]->last_core_brate = sts[0]->last_core_brate; + move16(); +#endif + sts[1]->GSC_noisy_speech = 0; move16(); + IF( EQ_16( hCPE->element_mode, IVAS_CPE_MDCT ) ) { /* cross-fade overlap region of DFT Stereo downmix and original stereo channels */