diff --git a/lib_com/options.h b/lib_com/options.h index fe16a0ce78a943799a01bd35220e16192ebe2578..242a02acd4ba1be867778e279d1fb37c817c4104 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -135,6 +135,8 @@ #define FIX_1559 /* Eri/FhG: fix for Issue 1559 in FD CNG with bitrate/bw switching */ #define NONBE_FIX_2575 /* Fhg: Fix issue 2575, precision loss in FD CNG */ +#define FIX_2556_ALIGN_CONDITIONS /* VA: Fix different conditions that were not exact between float and fix, BE on self-test */ + /* ##################### End NON-BE switches ########################### */ /* ################## End MAINTENANCE switches ######################### */ diff --git a/lib_dec/FEC_scale_syn_fx.c b/lib_dec/FEC_scale_syn_fx.c index 32d7b569ab3b063edc3e827a3b4b9e1b5930ad9f..fc9b1bc4b7126b86e5475459eff502b919e08986 100644 --- a/lib_dec/FEC_scale_syn_fx.c +++ b/lib_dec/FEC_scale_syn_fx.c @@ -265,7 +265,11 @@ void FEC_scale_syn_fx( ener_max = *lp_ener_FEC_max; /*Q0*/ move32(); test(); +#ifdef FIX_2556_ALIGN_CONDITIONS + if ( ( LE_16( clas, VOICED_TRANSITION ) && element_mode > EVS_MONO ) || EQ_16( clas, VOICED_TRANSITION ) || ( GE_16( clas, INACTIVE_CLAS ) ) ) +#else if ( EQ_16( clas, VOICED_TRANSITION ) || ( GE_16( clas, INACTIVE_CLAS ) ) ) +#endif { ener_max = *lp_ener_FEC_av; /*Q0*/ move32(); diff --git a/lib_dec/core_switching_dec_fx.c b/lib_dec/core_switching_dec_fx.c index 7fa00ef857eb960f517cdd8cd95bfb837266b9ed..913611eae952d161bdde016b26eba459be9ab4b5 100644 --- a/lib_dec/core_switching_dec_fx.c +++ b/lib_dec/core_switching_dec_fx.c @@ -1838,7 +1838,11 @@ ivas_error core_switching_pre_dec_fx( { hHQ_core->pastpre = sub( hHQ_core->pastpre, 1 ); move16(); +#ifdef FIX_2556_ALIGN_CONDITIONS + IF( hHQ_core->pastpre <= 0 ) +#else IF( hHQ_core->pastpre < 0 ) +#endif { reset_preecho_dec_fx( hHQ_core ); } diff --git a/lib_dec/dec_uv_fx.c b/lib_dec/dec_uv_fx.c index a2d59c08ab6f35b3d19e10ae8c85e6d38d278040..3bdb5e106fcc9482013c84e25ac40c78725fc48c 100644 --- a/lib_dec/dec_uv_fx.c +++ b/lib_dec/dec_uv_fx.c @@ -182,9 +182,12 @@ void decod_unvoiced_fx( } voice_factors_fx[tmp_idx] = 0; move16(); - - interp_code_5over2_fx( &exc_fx[i_subfr_fx], &bwe_exc_fx[( ( i_subfr_fx * 2 * HIBND_ACB_L_FAC ) >> 1 )], L_SUBFR ); - +#ifdef FIX_2556_ALIGN_CONDITIONS + IF( st_fx->hBWE_TD != NULL ) +#endif + { + interp_code_5over2_fx( &exc_fx[i_subfr_fx], &bwe_exc_fx[( ( i_subfr_fx * 2 * HIBND_ACB_L_FAC ) >> 1 )], L_SUBFR ); + } p_Aq_fx += ( M + 1 ); pt_pitch_fx++; st_fx->tilt_code_dec_fx[tmp_idx] = st_fx->tilt_code_fx; diff --git a/lib_enc/ivas_stereo_td_analysis_fx.c b/lib_enc/ivas_stereo_td_analysis_fx.c index 61aa03ab842b3eaea1d476a798637889d1eff207..97b1e62bf985687668be87a046fc7d88ad2e0f0a 100644 --- a/lib_enc/ivas_stereo_td_analysis_fx.c +++ b/lib_enc/ivas_stereo_td_analysis_fx.c @@ -242,7 +242,11 @@ Word16 stereo_tdm_ener_analysis_fx( { test(); test(); +#ifdef FIX_2556_ALIGN_CONDITIONS + if ( ( EQ_16( hCPE->hStereoClassif->lrtd_mode, 1 ) || EQ_16( hCPE->hStereoTD->prev_fr_LRTD_TD_dec, 1 ) ) && ( LT_32( L_add( L_sub( hCPE->element_brate, 50 * FRAMES_PER_SEC ), L_add( hCPE->brate_surplus, hCPE->brate_surplus ) ), IVAS_BRATE_OMASA_STEREO_SW_THR ) ) ) +#else if ( ( EQ_16( hCPE->hStereoClassif->lrtd_mode, 1 ) || EQ_16( hCPE->hStereoTD->prev_fr_LRTD_TD_dec, 1 ) ) && ( LE_32( L_add( L_sub( hCPE->element_brate, 50 * FRAMES_PER_SEC ), L_add( hCPE->brate_surplus, hCPE->brate_surplus ) ), IVAS_BRATE_OMASA_STEREO_SW_THR ) ) ) +#endif { hStereoTD->prev_fr_LRTD_TD_dec = 0; move16(); diff --git a/lib_enc/ivas_stereo_td_enc_fx.c b/lib_enc/ivas_stereo_td_enc_fx.c index 0629c027994e62fbd0e801132bfb8e30297c4fb1..dd817a415b867a765421833835e5f48acf0f5dee 100644 --- a/lib_enc/ivas_stereo_td_enc_fx.c +++ b/lib_enc/ivas_stereo_td_enc_fx.c @@ -641,7 +641,11 @@ void tdm_configure_enc_fx( test(); IF( EQ_16( sts[0]->coder_type, GENERIC ) && EQ_16( loc_coder_tyape_raw0, UNVOICED ) ) { +#ifdef FIX_2556_ALIGN_CONDITIONS + if ( LE_32( sts[0]->total_brate, MAX_UNVOICED_BRATE ) ) +#else if ( LT_32( sts[0]->total_brate, MAX_UNVOICED_BRATE ) ) +#endif { sts[0]->coder_type = UNVOICED; move16();