Commit a764500d authored by vaillancour's avatar vaillancour
Browse files

Fix more overflows with that command line : 7200 16 stv16n2.INP

parent e7dbca87
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -260,8 +260,11 @@ void stat_noise_uv_mod_fx(
        L_tmp_res = Mult_32_16(*ge_sm, tmp_res);        /* Q_stat_noise_ge+45-Q_local-Q_ge-tmp_shift-15 */
        L_tmp_res = Mult_32_16(L_tmp_res, sub(32767, beta)); /*30-Q_local-tmp_shift+15-15         */
        L_tmp_res = L_add(L_shl(L_tmp_res, sub(add(Q_local, tmp_shift), 15)), beta); /* Q15 */
#ifdef BASOP_NOGLOB
        tmp_res = extract_h(L_shl_o(L_tmp_res, 15, &Overflow));  /* 15+15-16=14 */
#else
        tmp_res = extract_h(L_shl(L_tmp_res, 15));  /* 15+15-16=14 */

#endif
        Noimix_fract = extract_l(Mult_32_16(L_tmp_res, Noimix_fract));    /*15+15-15 */

        FOR (i=0; i<L_FRAME; i++)
+7 −1
Original line number Diff line number Diff line
@@ -102,6 +102,9 @@ void encod_gen_voic_fx(
    Word16 shift_wsp;
    Word16 harm_flag_acelp;
    Word16 lp_select, lp_flag, L_frame;
#ifdef BASOP_NOGLOB
    Flag Overflow = 0;
#endif
    SC_VBR_ENC_HANDLE  hSC_VBR = st_fx->hSC_VBR;
    BSTR_ENC_HANDLE hBstr = st_fx->hBstr;
    SP_MUS_CLAS_HANDLE hSpMusClas = st_fx->hSpMusClas;
@@ -230,8 +233,11 @@ void encod_gen_voic_fx(
        }

        /*st_fx->lowrate_pitchGain = 0.9f * st_fx->lowrate_pitchGain + 0.1f * gain_pit_fx;*/
#ifdef BASOP_NOGLOB
        hSpMusClas->lowrate_pitchGain = round_fx_o(L_mac_o(L_mult(29491, hSpMusClas->lowrate_pitchGain), 6554, gain_pit_fx, &Overflow), &Overflow); /*Q14*Q16(0.1) + Q15 -> Q15*/
#else
        hSpMusClas->lowrate_pitchGain = round_fx(L_mac(L_mult(29491, hSpMusClas->lowrate_pitchGain), 6554, gain_pit_fx)); /*Q14*Q16(0.1) + Q15 -> Q15*/

#endif
        /*-----------------------------------------------------------------*
         * Transform domain contribution encoding - active frames
         *-----------------------------------------------------------------*/