Commit 5b9eecaf authored by vaillancour's avatar vaillancour
Browse files

Fix more overflows with that command line : 64000 16 stv16c.INP

parent ac40e16f
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -657,7 +657,11 @@ void gain_enc_SQ_fx(
    L_tmp1 = L_mult(coeff[0],coeff[2]); /*Q31*/
    exp1 = add(exp_coeff[0], exp_coeff[2]);

#ifdef BASOP_NOGLOB
    L_tmp2 = L_mult_o(coeff[4],coeff[4], &Overflow); /*Q31*/
#else
    L_tmp2 = L_mult(coeff[4],coeff[4]); /*Q31*/
#endif
    exp2 = add(exp_coeff[4], exp_coeff[4]);

    IF(GT_16(exp1,exp2))
@@ -710,7 +714,7 @@ void gain_enc_SQ_fx(
    exp_div = sub(exp_num,exp_den);

#ifdef BASOP_NOGLOB
    *gain_pit = round_fx(L_shl_o(L_div,add(exp,exp_div), &Overflow)); /*Q14*/
    *gain_pit = round_fx_o(L_shl_o(L_div,add(exp,exp_div), &Overflow), &Overflow); /*Q14*/
#else /* BASOP_NOGLOB */
    *gain_pit = round_fx(L_shl(L_div,add(exp,exp_div))); /*Q14*/
#endif /* BASOP_NOGLOB */
+4 −0
Original line number Diff line number Diff line
@@ -964,7 +964,11 @@ void norm_corr_fx(
        L_tmp = L_mac(1, excf[0], excf[0]);
        FOR (i = 1; i < L_subfr; i++)
        {
#ifdef BASOP_NOGLOB
            L_tmp = L_mac_o(L_tmp, excf[i], excf[i], &Overflow);
#else
            L_tmp = L_mac(L_tmp, excf[i], excf[i]);
#endif
        }

        exp = norm_l(L_tmp);
+7 −2
Original line number Diff line number Diff line
@@ -45,7 +45,9 @@ void update_average_rate_fx(
    Word16 tmp;
    Word32 L_tmp;
    Word32 L_tmp1,L_tmp2;

#ifdef BASOP_NOGLOB
    Flag Overflow = 0;
#endif
    Word16 exp, recip, Qrecip;

    IF ( EQ_16(hSC_VBR->numactive_fx,RATEWIN))  /* goes into rate control only the numactive ==RATEWIN. So rate control is triggered after each RATEWIN avtive frames */
@@ -237,8 +239,11 @@ void update_average_rate_fx(
    /* sum the total number of bits (in kbytes) * 10 here */
    /*st->sum_of_rates += (hSC_VBR->core_brate_fx / 1000.0f) * 10; */
    L_tmp  = L_shl(Mult_32_16(core_brate_fx ,20972),7);
#ifdef BASOP_NOGLOB
    hSC_VBR->sum_of_rates_fx = L_add_o(hSC_VBR->sum_of_rates_fx  ,L_tmp, &Overflow);
#else
    hSC_VBR->sum_of_rates_fx = L_add(hSC_VBR->sum_of_rates_fx  ,L_tmp);

#endif
    return;
}