From 1ca42b70bd2ae6c9f206ce14de1a152c1ca7ed3b Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 22 Aug 2025 14:45:35 +0200 Subject: [PATCH] port MR --- lib_com/options.h | 1 + lib_dec/hq_lr_dec_fx.c | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index a9501c3a9..07272984b 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -167,6 +167,7 @@ #define NONBE_1214_PLC_LSF_MEMORY /* VA: issue 1224: reset ACELP PLC FEC memory in case of switching from MDCT stereo to TD/DFT stereo */ #define NONBE_1293_SR_HRTF /* VA: issue 1293: add support of external HRTFs in split rendering */ #define NONBE_1220_OMASA_JBM_BRATE_SW_FLUSH /* VA: issue 1220: fix bug in renderer flush in OMASA 1ISM JBM bitrate switching */ +#define NONBE_1118_EVS_LR_HQ_BITERROR /* VA: issue 1118: fix EVS decoder crash in LR-HQ in case of bit errors */ #define FIX_1139_REV_COLORATION_SHORT_T60 /* Nokia,FhG: Fix issue 1139, prevent sound coloration artefacts at very low reverberation times */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_dec/hq_lr_dec_fx.c b/lib_dec/hq_lr_dec_fx.c index 7d5d6a34b..f7fc6440d 100644 --- a/lib_dec/hq_lr_dec_fx.c +++ b/lib_dec/hq_lr_dec_fx.c @@ -629,10 +629,33 @@ void hq_lr_dec_fx( IF( GE_16( i, highband ) ) { + +#ifdef NONBE_1118_EVS_LR_HQ_BITERROR + /* safety check in case of bit errors */ + IF( GT_32( Ep_fx[i], 536788991 /* max(Q30) */ ) ) + { + st_fx->BER_detect = 1; + move16(); + set32_fx( L_yout, 0, inner_frame ); + return; + } + +#endif enerH_fx = L_add_sat( enerH_fx, L_shl_sat( Ep_fx[i], 2 ) ); /*Q0 */ } ELSE IF( GE_16( i, lowband ) ) { +#ifdef NONBE_1118_EVS_LR_HQ_BITERROR + /* safety check in case of bit errors */ + IF( GT_32( Ep_fx[i], 536788991 /* max(Q30) */ ) ) + { + st_fx->BER_detect = 1; + move16(); + set32_fx( L_yout, 0, inner_frame ); + return; + } + +#endif enerL_fx = L_add_sat( enerL_fx, L_shl_sat( Ep_fx[i], 2 ) ); /*Q0 */ } } -- GitLab