From 018322d6e02720037f50f6f003a858057f4a81cf Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Thu, 13 Feb 2025 16:33:45 +0530 Subject: [PATCH] Fix for 3GPP issue 1291: Wrong use of imult1616() in ACELP rescaling Link #1291 --- lib_com/cnst.h | 1 + lib_com/options.h | 1 + lib_dec/acelp_core_dec_ivas_fx.c | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/lib_com/cnst.h b/lib_com/cnst.h index a5030ac9c..197fbd3c4 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -1536,6 +1536,7 @@ enum #define SHB_OVERLAP_LEN ( L_FRAME16k - L_SHB_LAHEAD ) / ( NUM_SHB_SUBFR - 1 ) #define QUANT_DIST_INIT ( 10000000000.0f ) /* Quantiser search distance initialisation */ #define HIBND_ACB_L_FAC 5 / 2 /* SHB Interpolation Factor */ +#define HIBND_ACB_L_FAC_Q1 ( 5 ) /* SHB Interpolation Factor Q1 */ #define NUM_HILBERTS 2 #define HILBERT_ORDER1 5 #define HILBERT_ORDER2 4 diff --git a/lib_com/options.h b/lib_com/options.h index d6bbaf88a..5f585d891 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -155,6 +155,7 @@ #define FIX_ISSUE_1214 /* Ittiam: Fix for issue 1214: Energy leakage in IGF tiles for MDCT-stereo @64kbps SWB*/ #define FIX_881_HILBERT_FILTER /* VA: improve the precision of the Hilbert filter to remove 2kHz unwanted tone */ #define FIX_ISSUE_1245 /* Ittiam: Fix for issue 1245: Basop Encoder: Audible noise for silent Stereo input DTX on @24.4 kbps, @32 kbps*/ +#define FIX_ISSUE_1291 /* Ittiam: Wrong use of imult1616() in ACELP rescaling */ #define FIX_920_IGF_INIT_ERROR /* FhG: issue 920: fix bitrate mismatch in initial IGF config to avoid error message in same cases */ #define FIX_MINOR_SVD_WMOPS_MR1010X /* FhG: Minor WMOPS tuning, bit-exact to previous version, saves about 8.2 WMOPS for MR1010 */ #define SVD_WMOPS_OPT /* Ittiam : SVD related optimizations */ diff --git a/lib_dec/acelp_core_dec_ivas_fx.c b/lib_dec/acelp_core_dec_ivas_fx.c index e52c52c7c..165594e77 100644 --- a/lib_dec/acelp_core_dec_ivas_fx.c +++ b/lib_dec/acelp_core_dec_ivas_fx.c @@ -748,7 +748,11 @@ ivas_error acelp_core_dec_ivas_fx( IF( st->hMusicPF && st->hGSCDec ) { Rescale_exc( st->hMusicPF->dct_post_old_exc_fx, exc_fx, bwe_exc_fx, st->hGSCDec->last_exc_dct_in_fx, st->L_frame, +#ifdef FIX_ISSUE_1291 + shr( imult1616( st->L_frame, HIBND_ACB_L_FAC_Q1 ), 1 ), 0, &( st->Q_exc ), st->Q_subfr, NULL, 0, INACTIVE ); +#else imult1616( st->L_frame, HIBND_ACB_L_FAC ), 0, &( st->Q_exc ), st->Q_subfr, NULL, 0, INACTIVE ); +#endif } IF( st->hPFstat != NULL ) { -- GitLab