diff --git a/lib_com/options.h b/lib_com/options.h index 4badd652f02cb6df63161e5b70bc286401a3e3d8..4fcc4a03e0675b9d6b50efb249851fe25e6534ef 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -100,5 +100,6 @@ #define FIX_1762_COMPILER_ISSUE /* 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 */ #endif diff --git a/lib_com/tools_fx.c b/lib_com/tools_fx.c index a83dfb56bd8bc2c069ee026f6c7e401f7b2be201..b2974696a47e39bbbd38332b2cadcd7f69be09d6 100644 --- a/lib_com/tools_fx.c +++ b/lib_com/tools_fx.c @@ -3144,7 +3144,11 @@ void add_vec_fx( { FOR( i = 0; i < N; i++ ) { +#ifdef ISSUE_1770_replace_shr_ro + y[i] = add_o( x1[i], shr_r_sat( x2[i], Qyx2 ), &Overflow ); +#else y[i] = add_o( x1[i], shr_ro( x2[i], Qyx2, &Overflow ), &Overflow ); +#endif move16(); } } @@ -3152,7 +3156,11 @@ void add_vec_fx( { FOR( i = 0; i < N; i++ ) { +#ifdef ISSUE_1770_replace_shr_ro + y[i] = add_o( shr_r_sat( x1[i], Qyx1 ), shr_r_sat( x2[i], Qyx2 ), &Overflow ); +#else y[i] = add_o( shr_ro( x1[i], Qyx1, &Overflow ), shr_ro( x2[i], Qyx2, &Overflow ), &Overflow ); +#endif move16(); } } diff --git a/lib_enc/find_uv_fx.c b/lib_enc/find_uv_fx.c index 61de9ca7d6d5a41fc5ac31197d075d2d8fde199a..9dcd8386bb4b405c607d3e02acc083e119c75f3b 100644 --- a/lib_enc/find_uv_fx.c +++ b/lib_enc/find_uv_fx.c @@ -32,9 +32,11 @@ static Word16 find_ener_decrease_fx( /* o : maximum Word16 wtmp0, wtmp1; Word32 maxEnr, minEnr; Word16 dE2, exp0, exp1; +#ifndef ISSUE_1770_replace_shr_ro #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); +#endif #endif dE2 = 0; @@ -76,7 +78,11 @@ static Word16 find_ener_decrease_fx( /* o : maximum exp1 = sub( norm_l( maxEnr ), 1 ); wtmp1 = extract_h( L_shl( maxEnr, exp1 ) ); wtmp1 = div_s( wtmp1, wtmp0 ); +#ifdef ISSUE_1770_replace_shr_ro + dE2 = shr_r_sat( wtmp1, add( sub( exp1, exp0 ), 15 - 10 ) ); /*Q10*/ +#else dE2 = shr_ro( wtmp1, add( sub( exp1, exp0 ), 15 - 10 ), &Overflow ); /*Q10*/ +#endif return dE2; }