From 677922eb8c8cfc12f660c72aa9ca619e79f85af5 Mon Sep 17 00:00:00 2001 From: Tommy Vaillancourt Date: Fri, 13 Dec 2024 15:09:33 -0500 Subject: [PATCH] potential fix to 1100 --- lib_com/options.h | 2 ++ lib_dec/acelp_core_dec_ivas_fx.c | 10 ++++++++++ lib_dec/swb_tbe_dec.c | 2 ++ 3 files changed, 14 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 9ae9b3a40..a914c8e66 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -100,4 +100,6 @@ #define FIX_1009_OPT_PARAMMC_RENDER /* FhG: Optimize ivas_param_mc_dec_render_fx() */ #define FIX_1109_OPTIM_MCT_STEREO_IGF_DEC /* FhG: optimize mctStereoIGF_dec_fx() */ #define FIX_1110_OPTIM_DIRAC_DECORR_PROC /* FhG: optimize ivas_dirac_dec_decorr_process() */ +#define FIX_1100_REMOVE_LPC_RESCALING /* VA: Remove the rescaling of LPC coefficient to Q12 as residu and syn-filt are already taking care of it*/ + #endif diff --git a/lib_dec/acelp_core_dec_ivas_fx.c b/lib_dec/acelp_core_dec_ivas_fx.c index 4d3a91a93..49b329783 100644 --- a/lib_dec/acelp_core_dec_ivas_fx.c +++ b/lib_dec/acelp_core_dec_ivas_fx.c @@ -628,12 +628,14 @@ ivas_error acelp_core_dec_ivas_fx( IF( st->cng_type == LP_CNG ) { CNG_dec_ivas_fx( st, last_element_mode, Aq_fx, lsp_new_fx, lsf_new_fx, &allow_cn_step, sid_bw, q_env_fx ); +#ifndef FIX_1100_REMOVE_LPC_RESCALING FOR( Word32 nsf = 0; nsf < NB_SUBFR16k; nsf++ ) { Scale_sig( Aq_fx + imult3216( nsf, ( M + 1 ) ), M + 1, sub( norm_s( Aq_fx[nsf * ( M + 1 )] ), Q2 ) ); Aq_fx[nsf * ( M + 1 )] = ONE_IN_Q12; move16(); } +#endif Copy( Aq_fx, st->Aq_cng, add( M, 1 ) ); /* comfort noise generation */ @@ -761,7 +763,9 @@ ivas_error acelp_core_dec_ivas_fx( /* synthesis at 12.8kHz sampling rate */ +#ifndef FIX_1100_REMOVE_LPC_RESCALING Aq_fx[0] = ONE_IN_Q12; +#endif move16(); syn_12k8_fx( st->L_frame, Aq_fx, exc2_fx, psyn_fx, st->mem_syn2_fx, 1, st->Q_exc, st->Q_syn ); syn_12k8_fx( st->L_frame, Aq_fx, exc3_fx, syn1_fx, st->mem_syn3_fx, 1, st->Q_exc, st->Q_syn ); @@ -909,6 +913,7 @@ ivas_error acelp_core_dec_ivas_fx( st->stab_fac_fx = lsf_stab_ivas_fx( lsf_new_fx, st->lsf_old_fx, 0, st->L_frame ); move16(); } +#ifndef FIX_1100_REMOVE_LPC_RESCALING #ifndef MSAN_FIX for ( int nsf = 0; nsf < NB_SUBFR16k; nsf++ ) #else @@ -919,6 +924,7 @@ ivas_error acelp_core_dec_ivas_fx( Aq_fx[nsf * ( M + 1 )] = ONE_IN_Q12; move16(); } +#endif test(); IF( EQ_16( st->last_core, HQ_CORE ) && st->element_mode > EVS_MONO ) { @@ -1254,6 +1260,7 @@ ivas_error acelp_core_dec_ivas_fx( lsf_dec_bfi( MODE1, lsf_new_fx, st->lsf_old_fx, st->lsf_adaptive_mean_fx, NULL, st->mem_MA_fx, st->mem_AR_fx, st->stab_fac_fx, st->last_coder_type, st->L_frame, st->last_good, st->nbLostCmpt, 0, NULL, NULL, NULL, st->hGSCDec->Last_GSC_pit_band_idx, st->Opt_AMR_WB, 0, st->bwidth ); FEC_lsf2lsp_interp( st, st->L_frame, Aq_fx, lsf_new_fx, lsp_new_fx ); +#ifndef FIX_1100_REMOVE_LPC_RESCALING #ifndef MSAN_FIX for ( int nsf = 0; nsf < NB_SUBFR16k; nsf++ ) #else @@ -1264,6 +1271,7 @@ ivas_error acelp_core_dec_ivas_fx( Aq_fx[nsf * ( M + 1 )] = ONE_IN_Q12; move16(); } +#endif IF( EQ_16( st->nelp_mode_dec, 1 ) ) { /* SC-VBR */ @@ -2191,11 +2199,13 @@ ivas_error acelp_core_dec_ivas_fx( #else Copy_Scale_sig_32_16( synth_fx, synth_fx16, L_FRAME48k, 0 ); #endif +#ifndef FIX_1100_REMOVE_LPC_RESCALING if ( st->hFdCngDec ) { st->hFdCngDec->hFdCngCom->A_cng[0] = ONE_IN_Q12; move16(); } +#endif } pop_wmops(); diff --git a/lib_dec/swb_tbe_dec.c b/lib_dec/swb_tbe_dec.c index d73f17fd7..8c2387e53 100644 --- a/lib_dec/swb_tbe_dec.c +++ b/lib_dec/swb_tbe_dec.c @@ -1239,10 +1239,12 @@ void ivas_swb_tbe_dec_fx( tmp = i_mult( j, ( LPC_SHB_ORDER + 1 ) ); /* convert LSPs to LP coefficients */ E_LPC_f_lsp_a_conversion( lsp_temp_fx, lpc_shb_sf_fx + tmp, LPC_SHB_ORDER ); +#ifndef FIX_1100_REMOVE_LPC_RESCALING /* Bring the LPCs to Q12 */ Copy_Scale_sig( lpc_shb_sf_fx + tmp, lpc_shb_sf_fx + tmp, LPC_SHB_ORDER + 1, sub( norm_s( lpc_shb_sf_fx[tmp] ), 2 ) ); lpc_shb_sf_fx[i_mult( j, ( LPC_SHB_ORDER + 1 ) )] = ONE_IN_Q12; // recheck this move16(); +#endif } } -- GitLab