Commit 63584e7f authored by Sandesh Venkatesh's avatar Sandesh Venkatesh Committed by Fabian Bauer
Browse files

Fix for 3GPP issue 1130: Encoder crash for McMASA 5.1 at 13.2-32 kbps WB encoding

Link #1130
parent aa2e71f8
Loading
Loading
Loading
Loading
+13 −8
Original line number Diff line number Diff line
@@ -204,11 +204,13 @@ void wb_pre_proc_ivas_fx(
    Word16 Q_wb_sp, i, max_wb;
    Word16 fSwitchFromIO = 0;
    Word16 ppp_mode;
    Word32 temp1 = 0;
    Word32 temp2 = 0;
    Word64 temp1 = 0;
    Word64 temp2 = 0;
    Word32 tmp1, tmp2;
    Word16 norm;
    move16();
    move32();
    move32();
    move64();
    move64();


    TD_BWE_ENC_HANDLE hBWE_TD = st_fx->hBWE_TD;
@@ -258,14 +260,17 @@ void wb_pre_proc_ivas_fx(
    Q_wb_sp = norm_s( max_wb );

    Copy_Scale_sig( new_inp_resamp16k, temp_buf, L_FRAME16k, -3 );
    temp1 = L_mac0( temp1, temp_buf[0], temp_buf[0] );
    temp1 = W_mac_32_32( temp1, temp_buf[0], temp_buf[0] );
    FOR( i = 1; i < L_FRAME16k; i++ )
    {
        temp1 = L_mac0( temp1, temp_buf[i], temp_buf[i] );
        temp2 = L_mac0( temp2, temp_buf[i - 1], temp_buf[i] );
        temp1 = W_mac_32_32( temp1, temp_buf[i], temp_buf[i] );
        temp2 = W_mac_32_32( temp2, temp_buf[i - 1], temp_buf[i] );
    }
    norm = s_min( W_norm( temp1 ), W_norm( temp2 ) );
    tmp1 = W_extract_h( W_shl( temp1, norm ) );
    tmp2 = W_extract_h( W_shl( temp2, norm ) );

    if ( LT_32( temp2, Mpy_32_16_1( temp1, 31129 /*0.95f*/ ) ) )
    IF( LT_32( tmp2, Mpy_32_16_1( tmp1, 31129 /*0.95f*/ ) ) )
    {
        Q_wb_sp = sub( Q_wb_sp, 3 ); /* leave 3 bit headroom */
    }
+1 −1
Original line number Diff line number Diff line
@@ -1363,7 +1363,7 @@ void wb_tbe_enc_ivas_fx(
        FOR( j = 0; j < L_SUBFR16k; j = j + 4 )
        {
            L_tmp = L_mult( hb_old_speech[i], ola_win_shb_switch_fold_fx[j] );
            hb_old_speech[i] = mac_r( L_tmp, hb_speech[k], ola_win_shb_switch_fold_fx[L_SUBFR16k - 4 - j] );
            hb_old_speech[i] = mac_ro( L_tmp, hb_speech[k], ola_win_shb_switch_fold_fx[L_SUBFR16k - 4 - j], &Overflow );
            move16();
            i = sub( i, 1 );
            k = add( k, 1 );