diff --git a/lib_com/options.h b/lib_com/options.h index 1a7b596d5309b846680d83f511711c50f1bc7674..bf41d29d99d211ff01b32f975fd52f0dee733e72 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -96,7 +96,7 @@ #define FIX_2015_PREMPH_SAT_ALT_PART2 /* VA: Add missing scaling factor to be passed to AVQ_cod() */ #define FIX_2253_CORRECT_GSC_MINIMUM_PIT_SEARCH /* VA: Fix Issue 2253 where the encoder and decoder could get out of sync */ #define NONBE_FIX_1967_SBA_DECODER_MONO_OUT_BIG_DIFFERENCES /* Dolby: Fix basop issue 1967 */ - +#define FIX_2261_REMOVE_LP_RESCALING /* VA: Remove of unnecessary lpc coefficient rescaling */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_enc/acelp_core_enc_fx.c b/lib_enc/acelp_core_enc_fx.c index ff4c684e838c33e383021cd56e61be3292302b23..6fe47c6dddd2e4460c9d01de774f800f9d48bba4 100644 --- a/lib_enc/acelp_core_enc_fx.c +++ b/lib_enc/acelp_core_enc_fx.c @@ -1099,11 +1099,13 @@ ivas_error acelp_core_enc_ivas_fx( move16(); st->hLPDmem->q_mem_syn = st->Q_syn; move16(); +#ifndef FIX_2261_REMOVE_LP_RESCALING // Scaling Aq to Q12 FOR( Word16 k = 0; k < NB_SUBFR16k; k++ ) { Scale_sig( &Aq[( M + 1 ) * k], M + 1, sub( norm_s( Aq[( M + 1 ) * k] ), 2 ) ); } +#endif /* synthesis at 12.8kHz sampling rate */ syn_12k8_fx( st->L_frame, Aq, exc3_fx, syn1_fx, hLPDmem->mem_syn3, 1, sub( Q_new, 1 ), st->Q_syn ); @@ -1244,11 +1246,13 @@ ivas_error acelp_core_enc_ivas_fx( st->stab_fac_fx = lsf_stab_fx( lsf_new_fx, st->lsf_old_fx, 0, st->L_frame ); // Q15 move16(); } +#ifndef FIX_2261_REMOVE_LP_RESCALING // Scaling Aq to Q12 FOR( Word16 k = 0; k < NB_SUBFR16k; k++ ) { Scale_sig( &Aq[( M + 1 ) * k], M + 1, sub( norm_s( Aq[( M + 1 ) * k] ), 2 ) ); } +#endif test(); IF( EQ_16( st->last_core, HQ_CORE ) && st->element_mode > EVS_MONO ) { diff --git a/lib_enc/ivas_core_enc_fx.c b/lib_enc/ivas_core_enc_fx.c index 96bbca887782fdb1e711c4ff9ae0b289ab940d66..e79c5bd4cf476b31b32df0967277c96985dba9e0 100644 --- a/lib_enc/ivas_core_enc_fx.c +++ b/lib_enc/ivas_core_enc_fx.c @@ -226,7 +226,9 @@ ivas_error ivas_core_enc_fx( // fft_buff_fx_exp = add(fft_buff_fx_exp,1); FOR( i = 0; i < st->nb_subfr; i++ ) { - Scale_sig( &A_fx[n][i * ( M + 1 )], M + 1, sub( norm_s( A_fx[n][i * ( M + 1 )] ), 2 ) ); // scaling to Q12 +#ifndef FIX_2261_REMOVE_LP_RESCALING + Scale_sig( &A_fx[n][i * ( M + 1 )], M + 1, sub( norm_s( A_fx[n][i * ( M + 1 )] ), 2 ) ); // scaling to Q12 +#endif Scale_sig( &Aw_fx[n][i * ( M + 1 )], M + 1, sub( norm_s( Aw_fx[n][i * ( M + 1 )] ), 2 ) ); // scaling to Q12 } IF( EQ_32( ivas_format, SBA_FORMAT ) ) @@ -334,10 +336,12 @@ ivas_error ivas_core_enc_fx( test(); IF( ( EQ_16( st->core, TCX_20_CORE ) || EQ_16( st->core, TCX_10_CORE ) ) && NE_16( st->element_mode, IVAS_CPE_MDCT ) ) { +#ifndef FIX_2261_REMOVE_LP_RESCALING FOR( i = 0; i < st->nb_subfr; i++ ) { Scale_sig( &Aw_fx[n][i * ( M + 1 )], M + 1, sub( norm_s( Aw_fx[n][i * ( M + 1 )] ), 2 ) ); // scaling to Q12 } +#endif TCX_ENC_HANDLE hTcxEnc = st->hTcxEnc; Word16 Q_spec_old, L_spec; diff --git a/lib_enc/ivas_front_vad_fx.c b/lib_enc/ivas_front_vad_fx.c index 35400f652ca47ba8e9f04a4e195a6af7edad38f1..f3809f43600195235f4d23efe94b15dbc2fa1091 100644 --- a/lib_enc/ivas_front_vad_fx.c +++ b/lib_enc/ivas_front_vad_fx.c @@ -636,8 +636,9 @@ ivas_error front_vad_spar_fx( } relE_fx = sub( Etot_fx[0], extract_h( st->lp_speech_32fx ) ); +#ifndef FIX_2261_REMOVE_LP_RESCALING Scale_sig( A_fx, ( L_FRAME / L_SUBFR ) * ( M + 1 ), -2 ); // Q12 - +#endif st->mem_wsp_fx = (Word16) shl_sat( st->mem_wsp_fx, Q_inp_12k8 - st->mem_wsp_q ); /* Q_inp_12k8 */ st->mem_wsp_q = Q_inp_12k8; move16(); diff --git a/lib_enc/ivas_ism_enc_fx.c b/lib_enc/ivas_ism_enc_fx.c index ea509dd1020653f78a9ad5a0835f270b027a92fe..6a1d1e676c216fad45623c06bfc1e4bfce34bacf 100644 --- a/lib_enc/ivas_ism_enc_fx.c +++ b/lib_enc/ivas_ism_enc_fx.c @@ -238,11 +238,12 @@ ivas_error ivas_ism_enc_fx( /*----------------------------------------------------------------* * Front Pre-processing *----------------------------------------------------------------*/ +#ifndef FIX_2261_REMOVE_LP_RESCALING FOR( i = 0; i < hSCE->hCoreCoder[0]->nb_subfr; i++ ) { Scale_sig( &A_fx[sce_id][0][i * ( M + 1 )], M + 1, sub( norm_s( A_fx[sce_id][0][i * ( M + 1 )] ), 2 ) ); // scaling to Q12 } - +#endif set16_fx( old_wsp_fx[sce_id][0], 0, L_WSP ); q_old_wsp = Q15; move16(); diff --git a/lib_enc/updt_enc_fx.c b/lib_enc/updt_enc_fx.c index 62af228a0c75fac8ba24e23c64a406ec0c29b2d5..a9b15cfe4b5cc49fe884a86dee4c1fa0ad3b3432 100644 --- a/lib_enc/updt_enc_fx.c +++ b/lib_enc/updt_enc_fx.c @@ -141,6 +141,7 @@ void updt_enc_fx( } /* core switching updates */ Copy( &Aq[( st->L_frame / L_SUBFR - 1 ) * ( M + 1 )], st->old_Aq_12_8_fx, M + 1 ); + st->old_Es_pred_fx = Es_pred; move16();