From f8c27690162b45dc58d8b51cefe2b6fad1488aca Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Sun, 20 Jul 2025 21:29:10 +0200 Subject: [PATCH 1/2] BE fix --- lib_com/options.h | 1 + lib_enc/find_tilt_fx.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 14b1c5eb8..13b8eeaff 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -121,6 +121,7 @@ #define NONBE_FIX_864_JBM_RENDER_FRAMESIZE /* FhG: issue #864: fix different behaviour of JBM TSM with different render frame sizes */ #define FIX_1762_COMPILER_ISSUE /* FhG: fix compiler issues with W_mac_32_32() + ONE_IN_Q30 */ +#define FIX_1762_COMPILER_ISSUE_NEW /* FhG: fix compiler issues with W_mac_32_32() + ONE_IN_Q30 */ #define ISSUE_1751_replace_shl_ro /*FhG: replace shl_ro by overflow-free alternatives*/ #define ISSUE_1770_replace_shr_ro /* FhG: replace by non-overflow-alternative - BE */ #define ISSUE_1772_replace_shr_o /* FhG: replace by non-overflow-alternative - BE */ diff --git a/lib_enc/find_tilt_fx.c b/lib_enc/find_tilt_fx.c index a49955e6c..59fe87841 100644 --- a/lib_enc/find_tilt_fx.c +++ b/lib_enc/find_tilt_fx.c @@ -366,7 +366,11 @@ void find_tilt_ivas_fx( FOR( i = 0; i < 2; i++ ) { /*hp_E[i] = 0.5f * (hf_bands[max_band-1] + hf_bands[max_band]) - hp_bckr; */ /* averaged E in last 2 critical bands */ +#ifndef FIX_1762_COMPILER_ISSUE_NEW Ltmp = W_extract_h( W_mac_32_32( W_mult_32_32( hf_bands[max_band - 1], ONE_IN_Q30 ), hf_bands[max_band], ONE_IN_Q30 ) ); // q_fr_bands +#else + Ltmp = W_extract_h( W_shl( W_add( W_deposit32_l( hf_bands[max_band - 1] ), W_deposit32_l( hf_bands[max_band] ) ), 31 ) ); // q_fr_bands +#endif Ltmp = L_sub( Ltmp, hp_bckr ); // q_fr_bands Ltmp2 = L_max( Ltmp, L_shl_sat( 1, q_fr_bands ) ); // q_fr_bands, saturation is added because q_fr_bands is limited to 31 -- GitLab From dd40c1780ee7f6c3042da1021093e1a6812fadb6 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Sun, 20 Jul 2025 21:34:04 +0200 Subject: [PATCH 2/2] fix formatting --- lib_enc/find_tilt_fx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_enc/find_tilt_fx.c b/lib_enc/find_tilt_fx.c index 59fe87841..811da5864 100644 --- a/lib_enc/find_tilt_fx.c +++ b/lib_enc/find_tilt_fx.c @@ -327,7 +327,7 @@ void find_tilt_ivas_fx( #ifndef FIX_1762_COMPILER_ISSUE hp_bckr = W_extract_h( W_mac_32_32( W_mult_32_32( bckr[max_band - 1], ONE_IN_Q30 ), bckr[max_band], ONE_IN_Q30 ) ); // q_bckr #else - hp_bckr = W_extract_h( W_shl( W_add( W_deposit32_l( bckr[max_band - 1] ), W_deposit32_l( bckr[max_band] ) ), 31 ) ); // q_bckr + hp_bckr = W_extract_h( W_shl( W_add( W_deposit32_l( bckr[max_band - 1] ), W_deposit32_l( bckr[max_band] ) ), 31 ) ); // q_bckr #endif if ( hp_bckr == 0 ) /* Avoid division by zero. */ { @@ -365,13 +365,13 @@ void find_tilt_ivas_fx( FOR( i = 0; i < 2; i++ ) { - /*hp_E[i] = 0.5f * (hf_bands[max_band-1] + hf_bands[max_band]) - hp_bckr; */ /* averaged E in last 2 critical bands */ + /*hp_E[i] = 0.5f * (hf_bands[max_band-1] + hf_bands[max_band]) - hp_bckr; */ /* averaged E in last 2 critical bands */ #ifndef FIX_1762_COMPILER_ISSUE_NEW Ltmp = W_extract_h( W_mac_32_32( W_mult_32_32( hf_bands[max_band - 1], ONE_IN_Q30 ), hf_bands[max_band], ONE_IN_Q30 ) ); // q_fr_bands #else Ltmp = W_extract_h( W_shl( W_add( W_deposit32_l( hf_bands[max_band - 1] ), W_deposit32_l( hf_bands[max_band] ) ), 31 ) ); // q_fr_bands #endif - Ltmp = L_sub( Ltmp, hp_bckr ); // q_fr_bands + Ltmp = L_sub( Ltmp, hp_bckr ); // q_fr_bands Ltmp2 = L_max( Ltmp, L_shl_sat( 1, q_fr_bands ) ); // q_fr_bands, saturation is added because q_fr_bands is limited to 31 if ( Opt_vbr_mode == 0 ) -- GitLab