Commit c663a060 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Fix for 3gpp issue 848

[x] Fix for SBA decoder crashes on LTV test vectors
parent b2f48acd
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3146,8 +3146,8 @@ void GenShapedSHBExcitation_ivas_fx(

        /* calculate pow22 */
        /* pow22=0.00001f */
        tmp = sub( shl( sub( Q_excTmp2, NOISE_QADJ ), 1 ), 31 );
        pow22 = L_shl( 21475l /*0.00001f Q31*/, tmp ); /* 0.00001f in 2*(Q_excTmp2-NOISE_QADJ) */
        tmp = sub( shl( sub( *Q_bwe_exc, NOISE_QADJ ), 1 ), 31 );
        pow22 = L_shl( 21475l /*0.00001f Q31*/, tmp ); /* 0.00001f in 2*(*Q_bwe_exc-NOISE_QADJ) */
        tmp = sub( NOISE_QFAC, 5 );
        FOR( k = 0; k < L_FRAME16k; k++ )
        {
+6 −8
Original line number Diff line number Diff line
@@ -2193,7 +2193,7 @@ static void ivas_subst_spec_fx(
    Word32 *pCorrPhase;
    Word16 cos_F, sin_F, tmp;
    Word16 Lprot, m, i, e, im_ind, delta_corr_up, delta_corr_dn, delta_tmp;
    UWord16 lsb;
    Word32 tmp1;
    Word16 j, re, im, *pReX, *pImX, lastPeak, lprotBy2Minus1, segmentLen;
    Word16 pkLocation_1, pkLocation, pkLocation1;
    const Word16 *pPlocs;
@@ -2251,15 +2251,13 @@ static void ivas_subst_spec_fx(
        tmp = sub( tmp, ph_ecu_lookahead );
        tmp = add( tmp, sub( Lecu, shr( sub( Lecu, Lprot ), 1 ) ) );
        tmp = sub( tmp, shr( output_frame, 1 ) );
        tmp = add( tmp, time_offs );
        tmp = round_fx( L_shl( L_mult0( tmp, Lprot_inv ), 4 ) ); /* 0+22+4-16=10 */
        tmp1 = L_add( L_mult0( tmp, Lprot_inv ), L_mult0( time_offs, Lprot_inv ) ); /* Q22 */

        pPlocsi = plocsi;
        pCorrPhase = corr_phase;
        FOR( m = 0; m < *num_plocs; m++ )
        {
            Mpy_32_16_ss( *pPlocsi++, tmp, &acc, &lsb ); /* plocsi[] in Q16, tmp in Q10 and tmp does not include 2*PI. */
            acc = L_add( L_shl( acc, 5 ), lshr( (Word16) lsb, 11 ) );
            acc = L_shl( Mpy_32_32( *pPlocsi++, tmp1 ), 9 ); /* 16+22+9-31 = 16*/
            *pCorrPhase++ = acc;                             /* in Q16. 2*PI is not included. */
            move32();
        }
@@ -4958,7 +4956,7 @@ static void ivas_hq_phase_ecu_fx(
    }
    ELSE
    {
        *time_offs = add( *time_offs, output_frame );
        *time_offs = add_sat( *time_offs, output_frame );
        move16();
        offset = sub( shl( output_frame, 1 ), lprot );
        trans_ana_fx( prevsynth + offset, mag_chg, &ph_dith, mag_chg_1st, output_frame, *time_offs, env_stab,
@@ -4972,7 +4970,7 @@ static void ivas_hq_phase_ecu_fx(
    move16();
    IF( *num_p > 0 )
    {
        seed = add( seed, plocs[sub( *num_p, 1 )] );
        seed = extract_l( L_add( L_deposit_l( seed ), L_deposit_l( plocs[sub( *num_p, 1 )] ) ) );
    }

    ivas_subst_spec_fx( plocs, plocsi, num_p, *time_offs, X, mag_chg, ph_dith, old_is_transient, output_frame, &seed,