diff --git a/lib_com/options.h b/lib_com/options.h index c09e1ff3d56e7459bd22070d9bf45b84d1830eb0..56595cc02a1f427e27ff341f7720c85a252628be 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 db3c828d52bb2d82b9d5c4ec1024da803afa06f3..2b18e783f0c8204d5d87d8271f9c30181d53ccc1 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 } }