Commit cfa00924 authored by vaillancour's avatar vaillancour
Browse files

fixes SWB switching content...

parent a1754579
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -1342,7 +1342,9 @@ static Word16 shb_DTX_fx(
    DTX_ENC_HANDLE  hDtxEnc = st_fx->hDtxEnc;
    TD_CNG_ENC_HANDLE  hTdCngEnc = st_fx->hTdCngEnc;
    TD_BWE_ENC_HANDLE hBWE_TD = st_fx->hBWE_TD;

#ifdef BASOP_NOGLOB
    Flag Overflow = 0;
#endif
    shb_new_speech_fx = shb_old_speech_fx + (ACELP_LOOK_12k8 + L_SUBFR) * 5/4;
    Copy(hBWE_TD->old_speech_shb_fx, shb_old_speech_fx, (ACELP_LOOK_12k8 + L_SUBFR) * 5/4 );
    Copy( shb_speech_fx, shb_new_speech_fx, L_FRAME16k );
@@ -1359,7 +1361,11 @@ static Word16 shb_DTX_fx(
    wb_ener_fx = L_deposit_l(0);
    FOR ( i=0; i<st_fx->L_frame_fx; i++ )
    {
#ifdef BASOP_NOGLOB
        wb_ener_fx = L_mac_o(wb_ener_fx, syn_12k8_16k[i], syn_12k8_16k[i], &Overflow);
#else
        wb_ener_fx = L_mac(wb_ener_fx, syn_12k8_16k[i], syn_12k8_16k[i]);
#endif
    }

    wb_ener_fx = L_add(Mpy_32_16_1(wb_ener_fx, 128), 1); /* 128 in Q15, wb_ener_fx in Q1 */
@@ -1368,8 +1374,11 @@ static Word16 shb_DTX_fx(
    fra = Log2_norm_lc(L_shl(wb_ener_fx, exp));
    exp = sub(30-1, exp);
    wb_ener_fx = Mpy_32_16(exp, fra, LG10);
#ifdef BASOP_NOGLOB
    log_wb_ener_fx = round_fx_o(L_shl_o(wb_ener_fx, 10, &Overflow), &Overflow); /* log_wb_ener_fx in Q8 */
#else
    log_wb_ener_fx = round_fx(L_shl(wb_ener_fx, 10)); /* log_wb_ener_fx in Q8 */

#endif
    exp = norm_l(shb_ener_fx);
    fra = Log2_norm_lc(L_shl(shb_ener_fx, exp));
    exp = sub(30-1, exp);
@@ -1391,8 +1400,11 @@ static Word16 shb_DTX_fx(
        move16();
    }

#ifdef BASOP_NOGLOB
    log_shb_ener_fx = sub_o(round_fx_o(L_shl_o(shb_ener_fx, 10, &Overflow), &Overflow), att, &Overflow); /* log_shb_ener_fx in Q8 */
#else
    log_shb_ener_fx = sub(round_fx(L_shl(shb_ener_fx, 10)), att); /* log_shb_ener_fx in Q8 */

#endif
    IF (hDtxEnc->first_CNG_fx == 0 )
    {
        hTdCngEnc->mov_wb_cng_ener_fx = log_wb_ener_fx;