From 0b9a1eb3c03b5788852a149a8702814a4e9ea429 Mon Sep 17 00:00:00 2001 From: Manuel Jander Date: Mon, 20 Apr 2026 12:44:40 +0200 Subject: [PATCH] Add NONBE_FIX_2507, make if statement the same as in float. --- lib_com/options.h | 1 + lib_enc/tcx_utils_enc_fx.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index c09e1ff3d..56595cc02 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -91,6 +91,7 @@ #define NONBE_FIX_ISSUE_2206_AVOID_OVERFLOW_SWB_fenv_fx2 /* FhG: Avoid overflow of SWB_fenv_fx in SWB_BWE_encoding_fx because of very small energies. */ #define NONBE_FIX_ISSUE_2206_AVOID_OVERFLOW_MSVQ_Interpol_Tran_fx /* FhG: Fix saturation crash in MSVQ_Interpol_Tran_fx() */ #define NONBE_FIX_ISSUE_2206_SWB_EXPERIMENT_FIX_2527 /* Fix crash from issue #2527 */ +#define NONBE_FIX_2507 /* Fix porting error in SQ_gain_estimate_fx() */ #define FIX_FLOAT_1539_G192_FORMAT_SWITCH /* VA/Nokia: reintroduce format switching for g192 bitstreams */ #define HARMONIZE_2499_CONFIGUREFDCNGDEC /* FhG: basop issue 2499: harmonoize configureFdCngDec */ #define FIX_BASOP_2530_IVAS_DECISION_MAT /* VA: Fix ambiguous usage of extract_l() */ diff --git a/lib_enc/tcx_utils_enc_fx.c b/lib_enc/tcx_utils_enc_fx.c index db3c828d5..2b18e783f 100644 --- a/lib_enc/tcx_utils_enc_fx.c +++ b/lib_enc/tcx_utils_enc_fx.c @@ -1237,6 +1237,15 @@ Word16 SQ_gain_estimate_fx( if ( GT_32( tmp32, 0xFF20 ) ) /* 0xFF20 -> 0.3*log2(10); */ { ener = L_add( ener, tmp32 ); +#ifdef NONBE_FIX_2507 + /* if SNR is above target -> break and increase offset */ + IF( GT_32( ener, target ) ) + { + offset = L_add( offset, fac ); + BREAK; + } + } +#else } /* if SNR is above target -> break and increase offset */ @@ -1245,6 +1254,7 @@ Word16 SQ_gain_estimate_fx( offset = L_add( offset, fac ); BREAK; } +#endif } } -- GitLab