From 13d6e049860d5fdd108de4f1fd4e52f9071bccd0 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Wed, 13 May 2026 22:23:08 -0400 Subject: [PATCH] fix wrong scaling for comparison in edge_detect_fx() --- lib_com/options.h | 1 + lib_enc/ivas_stereo_classifier_fx.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 09025f757..e3dfe6c62 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -151,6 +151,7 @@ #define FIX_ISSUE_1966_F0_32BIT /* FhG: Basop issue 1966: use 32-bit variables for F0 and thresholdModification */ #define FIX_BASOP_2519_TCA_LA_ZERO_EXP /* FhG: BASOP #2519: Exclude zero samples from exp_com calculation in tcaTargetCh_LA_fx */ #define FIX_BASOP_2519_ICBWE_DEC_Q_TRACK /* FhG: BASOP #2519: Track Q-format of dec_2over3_mem_fx across frames in stereo_icBWE_preproc_fx */ +#define FIX_BASOP_2591_EDGE_DETECT_COMP /* FhG: BASOP #2591: Wrong comparison in edge_detect_fx() */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_enc/ivas_stereo_classifier_fx.c b/lib_enc/ivas_stereo_classifier_fx.c index 621a00bd4..f38e7c915 100644 --- a/lib_enc/ivas_stereo_classifier_fx.c +++ b/lib_enc/ivas_stereo_classifier_fx.c @@ -1583,7 +1583,11 @@ static void edge_detect_fx( set_zero_fx( edge, EDGE_MAX_LEN ); /* set error at 0th index */ +#ifdef FIX_BASOP_2591_EDGE_DETECT_COMP + IF( GT_32( L_shr( inp[0], 3 ), inp_max ) ) +#else IF( GT_32( L_shr( inp[0], 6 ), inp_max ) ) +#endif { err0 = 0; move32(); -- GitLab