Commit 7180890b authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_1959_assert_in_gain_enc_mless_fx

parent 5d33ebef
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -150,7 +150,6 @@
#define NONBE_1118_EVS_LR_HQ_BITERROR                   /* VA: issue 1118: fix EVS decoder crash in LR-HQ in case of bit errors */
#define FIX_1139_REV_COLORATION_SHORT_T60               /* Nokia,FhG: Fix issue 1139, prevent sound coloration artefacts at very low reverberation times */

#define FIX_1959_assert_in_gain_enc_mless_fx            /* VA: Fix saturation introduced by the usage of the non-EVS basop operators =, the saturation was expected */
#define NONBE_1328_FIX_NON_LINEARITY                    /* VA: Fix possible issue when computing bwe_exc_extended and previous frame were almost 0, float issue 1328  */

/* #################### End BASOP porting switches ############################ */
+0 −16
Original line number Diff line number Diff line
@@ -275,7 +275,6 @@ void gain_enc_mless_fx(
    /* gain_inov = 1.0f / sqrt((dot_product(code, code, L_SUBFR) + 0.01) / L_SUBFR) */
    L_tmp = Dot_product12( code, code, L_SUBFR, &exp_code );
    exp_inov = sub( exp_code, 18 + 6 );
#ifdef FIX_1959_assert_in_gain_enc_mless_fx
    // To avoid crash in case code value is 0,
    test();
    IF( EQ_16( BASOP_Util_Cmp_Mant32Exp( L_tmp, exp_inov, 21474836, 0 ), -1 ) && element_mode > EVS_MONO )
@@ -287,7 +286,6 @@ void gain_enc_mless_fx(
        move16();
    }
    ELSE
#endif
    {

        exp_code = sub( exp_code, 30 );
@@ -302,10 +300,6 @@ void gain_enc_mless_fx(
        tmp = add( 30 - 18 - 6 - 1, sub( exp_code, tmp ) ); /* exp: -18 (code in Q9), -6 (/L_SUBFR) */
        L_tmp1 = Mpy_32_16( tmp, frac, 12330 );             /* Q13 */
        Ei = round_fx( L_shl( L_tmp1, 11 ) );               /* Q8 */
#ifndef FIX_1959_assert_in_gain_enc_mless_fx
        /* predicted codebook gain */
        gcode0 = sub( Es_pred, Ei ); /* Q8 */
#endif
        /*---------------------------------------------------------------*
         * Decode codebook gain and the adaptive excitation low-pass
         * filtering factor (Finalize computation )
@@ -315,10 +309,8 @@ void gain_enc_mless_fx(
        *gain_inov = extract_h( L_shl( L_tmp, sub( exp_inov, 3 ) ) ); /* gain_inov in Q12 */
        move16();
    }
#ifdef FIX_1959_assert_in_gain_enc_mless_fx
    /* predicted codebook gain */
    gcode0 = sub( Es_pred, Ei ); /* Q8 */
#endif
    /* gcode0 = pow(10, 0.05 * (Es_pred - Ei)) */
    /*----------------------------------------------------------------*
     * gcode0 = pow(10.0, gcode0/20)
@@ -358,18 +350,10 @@ void gain_enc_mless_fx(
                          = ((-0.5*g_corr[3]*g_corr[0]) - (-0.25*g_corr[1]*g_corr[4]))/tmp1;
                          = ((0.25*g_corr[1]*g_corr[4]) - (0.5*g_corr[0]*g_corr[3]))/tmp1; */

#ifdef FIX_1959_assert_in_gain_enc_mless_fx
        L_tmp1 = L_mult_sat( coeff[0], coeff[2] ); /*Q31*/
#else
        L_tmp1 = L_mult( coeff[0], coeff[2] );                     /*Q31*/
#endif
        exp1 = add( exp_coeff[0], exp_coeff[2] );

#ifdef FIX_1959_assert_in_gain_enc_mless_fx
        L_tmp2 = L_shr( L_mult_sat( coeff[4], coeff[4] ), 2 ); /*Q31*/
#else
        L_tmp2 = L_shr( L_mult( coeff[4], coeff[4] ), 2 );         /*Q31*/
#endif
        exp2 = add( exp_coeff[4], exp_coeff[4] );

        IF( GT_16( exp1, exp2 ) )