diff --git a/lib_com/options.h b/lib_com/options.h index 583a9d0dcd8fccca8454e3cef0124ee209c9e555..9e4dd7e51ccb8257914ad20e37926cdedc532bde 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -113,6 +113,7 @@ #define FIX_2313_HF_RESET_16KHZ /* VA: basop issue 2313: Call hf_synth_reset_fx() also for 16 kHz output_Fs */ #define OPT_2308_FIND_TARGET /* VA: Issue 2308, Speeds up computation and improve accuracy of the impulse response */ #define OPT_NBE_2311_HARM_GSC_GAIN /* VA: issue 2311: non-BE part of the GSC gain harmonization */ +#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 25928d3d23c577c1108cc23aeef0229c274b9c7a..93b4b46e31a3bab62512842a247bbb1831a8310c 100644 --- a/lib_enc/acelp_core_enc_fx.c +++ b/lib_enc/acelp_core_enc_fx.c @@ -1053,13 +1053,13 @@ ivas_error acelp_core_enc_ivas_fx( move16(); st->hLPDmem->q_mem_syn = st->Q_syn; move16(); - - /* Scaling Aq to Q12 */ +#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 ); @@ -1198,13 +1198,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(); } - - /* Scaling Aq to Q12 */ +#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 2e278752b88dfaf4888937344cdf8213b5b910ab..b6437ad4207c24056de5e88572dcfe227d50940a 100644 --- a/lib_enc/ivas_core_enc_fx.c +++ b/lib_enc/ivas_core_enc_fx.c @@ -225,7 +225,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 ) ) @@ -333,10 +335,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 f58f48e97ff8cad4ff29fa927b1e2ed9acbdbb4b..6323f8cde8d2b94162238b6baad73d90ba8c3c91 100644 --- a/lib_enc/ivas_front_vad_fx.c +++ b/lib_enc/ivas_front_vad_fx.c @@ -630,8 +630,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 138312847e1ec6ef1ae551f686b824f936e0bc0a..95026eead2560960d75c0e196b30d5f8c92d4386 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();