Commit 802cd057 authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_ISSUE_1795_Q3_OVERFLOW

parent 5e6afd91
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -95,7 +95,6 @@
 * The issue is fixed by simply casting one of the product operands to Word32 in lib_com/basop32.c
 * The issue is fixed by simply casting one of the product operands to Word32 in lib_com/basop32.c
 */
 */


#define FIX_ISSUE_1795_Q3_OVERFLOW              /* FhG: Q3 overflow in function WB_BWE_gain_pred_fx (EVS legacy code) BE, MR1855 */
#define NONBE_FIX_1748_SPAR_DIV_OPT                      /*Dlb: issue 1748: SPAR common div optimizations*/
#define NONBE_FIX_1748_SPAR_DIV_OPT                      /*Dlb: issue 1748: SPAR common div optimizations*/


#define FIX_ISSUE_1801_NOISE_FLOOR_REDUCTION    /* FhG: Fixed getScalefactor usage */
#define FIX_ISSUE_1801_NOISE_FLOOR_REDUCTION    /* FhG: Fixed getScalefactor usage */
+0 −10
Original line number Original line Diff line number Diff line
@@ -242,25 +242,15 @@ Word16 WB_BWE_gain_pred_fx(


    enerL = L_deposit_l( enerL_16 );
    enerL = L_deposit_l( enerL_16 );
    enerL = L_shl( enerL, 6 ); /*Q6 */
    enerL = L_shl( enerL, 6 ); /*Q6 */
#ifdef FIX_ISSUE_1795_Q3_OVERFLOW
    /* Here, we do not multiply L_tmp by 3 to avoid overflow */
    /* Here, we do not multiply L_tmp by 3 to avoid overflow */
    L_tmp = L_mult0( WB_fenv[0], WB_fenv[0] ); /* Q6 */
    L_tmp = L_mult0( WB_fenv[0], WB_fenv[0] ); /* Q6 */
#else
    /* Here, we have not enough headroom for mult with 3, so we get some overflow */
    tmp1 = i_mult_sat( 3, WB_fenv[0] );  /*Q3 */
    L_tmp = L_mult0( tmp1, WB_fenv[0] ); /*Q6 */
#endif


    test();
    test();
    test();
    test();
    test();
    test();
#ifdef FIX_ISSUE_1795_Q3_OVERFLOW
#define ONE_DIV_3 ( (Word32) 0x2AAAAAAA )
#define ONE_DIV_3 ( (Word32) 0x2AAAAAAA )
    /* Here, L_tmp is not pre-multiplied with 3, we multiply enerL with 1/3 */
    /* Here, L_tmp is not pre-multiplied with 3, we multiply enerL with 1/3 */
    IF( GT_16( shr( enerL_16, 3 ), tmp ) && GT_32( Mpy_32_32( ONE_DIV_3, enerL ), L_tmp ) && NE_16( prev_coder_type, UNVOICED ) && WB_fenv[0] != 0 )
    IF( GT_16( shr( enerL_16, 3 ), tmp ) && GT_32( Mpy_32_32( ONE_DIV_3, enerL ), L_tmp ) && NE_16( prev_coder_type, UNVOICED ) && WB_fenv[0] != 0 )
#else
    IF( GT_16( shr( enerL_16, 3 ), tmp ) && GT_32( enerL, L_tmp ) && NE_16( prev_coder_type, UNVOICED ) && WB_fenv[0] != 0 )
#endif
    {
    {
        env_var_flag = 1;
        env_var_flag = 1;
        move16();
        move16();