From 65e5f7eac7013394310ef1d065377ac330d80c06 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Tue, 6 May 2025 15:00:40 +0200 Subject: [PATCH] port MR 1344 from float --- lib_com/options.h | 2 +- lib_dec/igf_scf_dec.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index fd1c9f6e8..2b00669d8 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -186,7 +186,7 @@ #define FIX_955_FASTCONV_REND_IN_ISM /* VA: put FastConv rendering call under DEBUGGING */ #define NONBE_FIX_967_ISM_MONO_DMX /* FhG: issue 967: accumulating energies in ISM mono DMX */ #define NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX /* FhG : issue #968: differences between 5ms and 20ms rendering for discrete ISM with BRIR and head rotation*/ - +#define FIX_969_USAN_IGF_ARITH /* FhG: issue 969: fix USAN error in igf_sce_dec; same issue as #962 */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_dec/igf_scf_dec.c b/lib_dec/igf_scf_dec.c index 67c4fe0a1..c0e7584a2 100644 --- a/lib_dec/igf_scf_dec.c +++ b/lib_dec/igf_scf_dec.c @@ -211,7 +211,12 @@ static void decode_sfe_vector( | c b | e --> t */ +#ifdef FIX_969_USAN_IGF_ARITH + int16_t pred; + uint16_t pred_tmp; +#else uint16_t pred; +#endif int16_t f, ctx, ctx_f, ctx_t; for ( f = 0; f < length; f++ ) @@ -221,7 +226,12 @@ static void decode_sfe_vector( if ( f == 0 ) { /* decode one of the IGF_SYMBOLS_IN_TABLE == 27 alphabet symbols using the new raw AC function */ +#ifdef FIX_969_USAN_IGF_ARITH + ari_decode_14bits_s27_ext( st, &pred_tmp, &hPrivateData->acState, hPrivateData->cf_se00 ); + pred = (int16_t) pred_tmp; +#else ari_decode_14bits_s27_ext( st, &pred, &hPrivateData->acState, hPrivateData->cf_se00 ); +#endif x[f] = pred << 2; x[f] += arith_decode_bits( &hPrivateData->acState, st, 2 ); /* LSBs as 2 bit raw */ } -- GitLab