From 154655090009ce7b37fb71734c27c5d5e4e1f8e6 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Tue, 27 May 2025 10:27:03 +0200 Subject: [PATCH 1/3] port float MR 1498 --- lib_com/options.h | 5 +++-- lib_dec/waveadjust_fec_dec_fx.c | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 34a9e4858..caad90fb8 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -123,9 +123,10 @@ #define NONBE_FIX_947_STEREO_DMX_FADOPT /* Orange: Fading optimisation */ #endif #define NONBE_FIX_999_JBM_MCT_FLUSH /* FhG: issue #999: fix wrong flushing for MCT at a JBM rate switch */ -#define FIX_1003_PARAMISM_BINAURAL_RECONFIG_USAN /* FhG: fix for #1003: fix USAN caused by ParamISM reconfig */ -#define FIX_1001_ARI_HM_OVERFLOW /* FhG: (no changes needed in BASOP) fix for undef behaviour in in the harmonic TCX model arithmetic coder */ +#define FIX_1003_PARAMISM_BINAURAL_RECONFIG_USAN /* FhG: fix for #1003: fix USAN caused by ParamISM reconfig */ +#define FIX_1001_ARI_HM_OVERFLOW /* FhG: (no changes needed in BASOP) 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 NON_BE_FIX_EVS_USAN_ERR_IN_WAVEADJUST /* FhG: address issue 1037 */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_dec/waveadjust_fec_dec_fx.c b/lib_dec/waveadjust_fec_dec_fx.c index 75a514cc2..42b297903 100644 --- a/lib_dec/waveadjust_fec_dec_fx.c +++ b/lib_dec/waveadjust_fec_dec_fx.c @@ -930,8 +930,23 @@ void concealment_decode_fix( /* sign randomization */ FOR( i = 0; i < N; i++ ) { +#ifdef NON_BE_FIX_EVS_USAN_ERR_IN_WAVEADJUST + Word16 rnd; + rnd = own_random_fix( seed ); + IF ( GE_16(rnd,0) ) + { + sign = 1; + move16(); + } + ELSE IF( LT_16(rnd, 0) ) + { + sign = -1; + move16(); + } +#else sign = add( shl( shr( own_random_fix( seed ), 15 ), 1 ), 1 ); - if ( EQ_16( sign, -1 ) ) +#endif + if ( EQ_16( sign, -1 ) ) { invkoef[i] = L_negate( invkoef[i] ); move32(); -- GitLab From 9c78c2e9d4eb5b001f11495a6b96faac63d3df27 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Tue, 27 May 2025 10:27:39 +0200 Subject: [PATCH 2/3] fix formatting --- lib_dec/waveadjust_fec_dec_fx.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib_dec/waveadjust_fec_dec_fx.c b/lib_dec/waveadjust_fec_dec_fx.c index 42b297903..0e5898d64 100644 --- a/lib_dec/waveadjust_fec_dec_fx.c +++ b/lib_dec/waveadjust_fec_dec_fx.c @@ -931,22 +931,22 @@ void concealment_decode_fix( FOR( i = 0; i < N; i++ ) { #ifdef NON_BE_FIX_EVS_USAN_ERR_IN_WAVEADJUST - Word16 rnd; - rnd = own_random_fix( seed ); - IF ( GE_16(rnd,0) ) - { - sign = 1; - move16(); - } - ELSE IF( LT_16(rnd, 0) ) - { - sign = -1; - move16(); - } + Word16 rnd; + rnd = own_random_fix( seed ); + IF( GE_16( rnd, 0 ) ) + { + sign = 1; + move16(); + } + ELSE IF( LT_16( rnd, 0 ) ) + { + sign = -1; + move16(); + } #else sign = add( shl( shr( own_random_fix( seed ), 15 ), 1 ), 1 ); #endif - if ( EQ_16( sign, -1 ) ) + if ( EQ_16( sign, -1 ) ) { invkoef[i] = L_negate( invkoef[i] ); move32(); -- GitLab From 3ace968fd0ecc07f2ada5201f57474ddbb2aeac5 Mon Sep 17 00:00:00 2001 From: Dominik Weckbecker Date: Wed, 28 May 2025 09:11:00 +0200 Subject: [PATCH 3/3] delete move16 where it is not required --- lib_dec/waveadjust_fec_dec_fx.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib_dec/waveadjust_fec_dec_fx.c b/lib_dec/waveadjust_fec_dec_fx.c index 0e5898d64..e0c599e23 100644 --- a/lib_dec/waveadjust_fec_dec_fx.c +++ b/lib_dec/waveadjust_fec_dec_fx.c @@ -936,12 +936,10 @@ void concealment_decode_fix( IF( GE_16( rnd, 0 ) ) { sign = 1; - move16(); } ELSE IF( LT_16( rnd, 0 ) ) { sign = -1; - move16(); } #else sign = add( shl( shr( own_random_fix( seed ), 15 ), 1 ), 1 ); -- GitLab