From a66caa038784ef8e68adbb152a31c9f9fe36337d Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 26 May 2025 17:27:45 +0200 Subject: [PATCH] port FIX_1038_OFFSET_TO_NULL_PTR_IN_EVS_TCX_BFI --- lib_com/options.h | 1 + lib_dec/dec_LPD.c | 8 ++++++++ lib_dec/dec_tcx.c | 25 ++++++++++++++++++++++++- 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index e91b5a9af..17a6e2e54 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -228,6 +228,7 @@ #define FIX_1003_PARAMISM_BINAURAL_RECONFIG_USAN /* FhG: fix for #1003: fix USAN caused by ParamISM reconfig */ #define FIX_1001_ARI_HM_OVERFLOW /* FhG: fix for undef behaviour in in the harmonic TCX model arithmetic coder */ #define NONBE_FIX_1005_MC_RS_TCBUFFER_UPDATE /* FhG: issue #1005: fix TC Buffer update at a MC rate switch */ +#define FIX_1038_OFFSET_TO_NULL_PTR_IN_EVS_TCX_BFI /* FhG: move setting of pointers for parameter decoding so they are skipped in lost frames when they are not needed */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_dec/dec_LPD.c b/lib_dec/dec_LPD.c index 9bc22f4b5..1ce388ce9 100644 --- a/lib_dec/dec_LPD.c +++ b/lib_dec/dec_LPD.c @@ -604,12 +604,20 @@ void decoder_LPD( for ( k = 0; k < 2; k++ ) { +#ifndef FIX_1038_OFFSET_TO_NULL_PTR_IN_EVS_TCX_BFI /* Set pointer to parameters */ prm = param + ( k * DEC_NPRM_DIV ); /* Stability Factor */ +#endif if ( !bfi ) { +#ifdef FIX_1038_OFFSET_TO_NULL_PTR_IN_EVS_TCX_BFI + /* Set pointer to parameters */ + prm = param + ( k * DEC_NPRM_DIV ); + + /* Stability Factor */ +#endif st->stab_fac = lsf_stab( &lsf[( k + 1 ) * M], &lsf[k * M], 0, st->L_frame ); } diff --git a/lib_dec/dec_tcx.c b/lib_dec/dec_tcx.c index f68ba522b..c0a31b6f7 100644 --- a/lib_dec/dec_tcx.c +++ b/lib_dec/dec_tcx.c @@ -93,6 +93,9 @@ void decoder_tcx( tmp_concealment_method = 0; nf_seed = 0; fUseTns = 0; /* flag that is set if TNS data is present */ +#ifdef FIX_1038_OFFSET_TO_NULL_PTR_IN_EVS_TCX_BFI + prm_sqQ = NULL; +#endif set_f( xn_buf, 0, L_MDCT_OVLP_MAX + L_FRAME_PLUS + L_MDCT_OVLP_MAX ); @@ -730,7 +733,15 @@ void decoder_tcx_invQ( TCX_CONFIG_HANDLE hTcxCfg = st->hTcxCfg; tnsSize = 0; +#ifndef FIX_1038_OFFSET_TO_NULL_PTR_IN_EVS_TCX_BFI prm_target = NULL; /* just to suppress MSVC warnigs */ +#else + /* just to suppress MSVC warnigs */ + prm_target = NULL; + prm_ltp = NULL; + prm_tns = NULL; + prm_sqQ = NULL; +#endif /*-----------------------------------------------------------------* * Initializations @@ -750,8 +761,10 @@ void decoder_tcx_invQ( noiseFillingSize = st->hIGFDec->infoIGFStartLine; } +#ifndef FIX_1038_OFFSET_TO_NULL_PTR_IN_EVS_TCX_BFI prm_ltp = &prm[1 + NOISE_FILL_RANGES]; prm_tns = prm_ltp + LTPSIZE; +#endif /*-----------------------------------------------------------* * Read TCX parameters * @@ -762,7 +775,10 @@ void decoder_tcx_invQ( if ( !bfi ) { index = prm[0]; - +#ifdef FIX_1038_OFFSET_TO_NULL_PTR_IN_EVS_TCX_BFI + prm_ltp = &prm[1 + NOISE_FILL_RANGES]; + prm_tns = prm_ltp + LTPSIZE; +#endif /* read noise level (fac_ns) */ st->hTcxDec->noise_filling_index[frame_cnt] = prm[1]; } @@ -777,9 +793,11 @@ void decoder_tcx_invQ( *fUseTns = 0; } +#ifndef FIX_1038_OFFSET_TO_NULL_PTR_IN_EVS_TCX_BFI prm_hm = prm_tns + tnsSize; prm_sqQ = prm_hm + NPRM_CTX_HM; *prm_sqQ1 = prm_sqQ; +#endif /*-----------------------------------------------------------* * Spectrum data * @@ -787,6 +805,11 @@ void decoder_tcx_invQ( if ( !bfi ) { +#ifdef FIX_1038_OFFSET_TO_NULL_PTR_IN_EVS_TCX_BFI + prm_hm = prm_tns + tnsSize; + prm_sqQ = prm_hm + NPRM_CTX_HM; + *prm_sqQ1 = prm_sqQ; +#endif /*-----------------------------------------------------------* * Context HM * *-----------------------------------------------------------*/ -- GitLab