From 903f7d3dfbb232e828a7da0d8821396dcb02e4b0 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Thu, 14 Nov 2024 14:42:56 +0530 Subject: [PATCH] Fix for 3GPP issue 1008: Serious clicks in ISM + FER at higher bitrates link #1008, #1032 [x] Fixes #1032 as well. --- lib_dec/ivas_tcx_core_dec.c | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/lib_dec/ivas_tcx_core_dec.c b/lib_dec/ivas_tcx_core_dec.c index 4ac2bc814..25d6b9fea 100644 --- a/lib_dec/ivas_tcx_core_dec.c +++ b/lib_dec/ivas_tcx_core_dec.c @@ -316,7 +316,7 @@ void stereo_tcx_core_dec_fx( Word32 L_tmp, mod; /*LPC*/ - Word16 lsf_fx[( NB_DIV + 1 ) * M], lsp_fx[( NB_DIV + 1 ) * M], lspmid_fx[M], lsfmid_fx[M]; + Word16 lsf_fx[( NB_DIV + 1 ) * M], lsp_fx[( NB_DIV + 1 ) * M], lspmid_fx[M], lsfmid_fx[M], lsf_tmp_fx[( NB_DIV + 1 ) * M]; Word16 lspnew_uw_fx[NB_DIV * M], lsfnew_uw_fx[NB_DIV * M]; Word16 Aq_fx[( NB_SUBFR16k + 1 ) * ( M + 1 )]; Word16 pit_gain_fx[NB_SUBFR16k]; @@ -530,17 +530,32 @@ void stereo_tcx_core_dec_fx( hTcxDec->envWeighted = 0; move16(); - Copy( st->lspold_uw, lsp_fx, M ); /* Q15 */ - Copy( st->lsfold_uw, lsf_fx, M ); /* Q2.56 */ + Copy( st->lspold_uw, lsp_fx, M ); /* Q15 */ + Copy( st->lsfold_uw, lsf_fx, M ); /* Q2.56 */ + Copy( st->lsfold_uw, lsf_tmp_fx, M ); /* Q2.56 */ + + Word16 tmp; + Word16 sr_core_ratio = BASOP_Util_Divide3232_Scale( st->sr_core, INT_FS_12k8, &tmp ); FOR( k = 0; k < st->numlpc; k++ ) { - Copy( &lsfnew_uw_fx[k * M], &lsf_fx[( k + 1 ) * M], M ); /* Q2.56 */ + Copy( &lsfnew_uw_fx[k * M], &lsf_fx[( k + 1 ) * M], M ); /* Q2.56 */ + Copy( &lsfnew_uw_fx[k * M], &lsf_tmp_fx[( k + 1 ) * M], M ); /* Q2.56 */ - lsf2lsp_fx( &lsf_fx[( k + 1 ) * M], &lsp_fx[( k + 1 ) * M], M, st->sr_core ); /* Q2.56 */ - lsf2lsp_fx( st->lsf_q_cng, st->lsp_q_cng, M, st->sr_core ); /* Q2.56 */ + v_multc_fixed_16_16( &lsf_tmp_fx[( k + 1 ) * M], sr_core_ratio, &lsf_tmp_fx[( k + 1 ) * M], M ); + Scale_sig( &lsf_tmp_fx[( k + 1 ) * M], M, tmp ); + test(); + IF( !st->lpcQuantization && EQ_32( st->sr_core, INT_FS_16k_FX ) ) + { + lsf2lsp_fx( &lsf_tmp_fx[( k + 1 ) * M], &lsp_fx[( k + 1 ) * M], M, st->sr_core ); + } + ELSE + { + lsf2lsp_fx( &lsf_fx[( k + 1 ) * M], &lsp_fx[( k + 1 ) * M], M, st->sr_core ); + } + lsf2lsp_fx( st->lsf_q_cng, st->lsp_q_cng, M, st->sr_core ); - Copy( &lsp_fx[( k + 1 ) * M], &lspnew_uw_fx[k * M], M ); /* Q2.56 */ + Copy( &lsp_fx[( k + 1 ) * M], &lspnew_uw_fx[k * M], M ); /* Q15 */ } } -- GitLab