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

Merge branch '3gpp_issue_1448_fix' into 'main'

Fix for 3GPP issue 1448: Complexity measurement crashes: StereoDmxEVS

See merge request !1362
parents c0ccde3f 5bd27bba
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3579,8 +3579,8 @@ Word16 erb_diff_search_fx( Word16 *prev_erb, const Word16 *curr_erb, Word16 *dif
            }
            ELSE
            {
                dh = sub( dif_erb[i + offset], cb_fx[j * cb_dim + i] ); /* Q13 */
                Ltemp1 = L_mult( dh, dh );                              /* Q27 */
                dh = sub_sat( dif_erb[i + offset], cb_fx[j * cb_dim + i] ); /* Q13 */
                Ltemp1 = L_mult_sat( dh, dh );                              /* Q27 */
                dh = extract_h( Ltemp1 );
                dl = extract_l( Ltemp1 );

+5 −5
Original line number Diff line number Diff line
@@ -2901,11 +2901,11 @@ void quant_target_fx( DTFS_STRUCTURE *X_fx, const Word16 *curr_lpc, Word16 *w, W
    Ltemp1 = log10_fx( Ltemp1 );

    /*  subtract 10log10(2)*(2Q-13), Q23 */
    Ltemp1 = L_sub( Ltemp1, Ltemp3 );
    Ltemp1 = L_sub_sat( Ltemp1, Ltemp3 );
    Ltemp1 = L_max( 0, Ltemp1 );
    Ltemp2 = getSpEngyFromResAmp_fx( X_fx, 2828, X_fx->upper_cut_off_freq_fx, curr_lpc, sin_tab, cos_tab );
    Ltemp2 = log10_fx( Ltemp2 );          /*  Ltemp1=10log10(eng_hb), Q23, need to adjust for Q factor of energy (2Q-13) */
    Ltemp2 = L_sub( Ltemp2, Ltemp3 ); /*  Ltemp2 in Q23 */
    Ltemp2 = L_sub_sat( Ltemp2, Ltemp3 ); /*  Ltemp2 in Q23 */

    Ltemp2 = L_max( 0, Ltemp2 );

@@ -2929,10 +2929,10 @@ void quant_target_fx( DTFS_STRUCTURE *X_fx, const Word16 *curr_lpc, Word16 *w, W
    tmp = round_fx( Ltemp );            /*  tmp in Q(22-n) */
    Ltemp1 = Mult_32_16( Ltemp1, tmp ); /*  Q(30-n) */
    n = sub( 8, exp );
    w[0] = round_fx( L_shl( Ltemp1, n ) ); /*  w[0] in Q15 */
    w[0] = round_fx_sat( L_shl_sat( Ltemp1, n ) ); /*  w[0] in Q15 */
    move16();
    Ltemp2 = Mult_32_16( Ltemp2, tmp );
    w[1] = round_fx( L_shl( Ltemp2, n ) ); /*  w[1] in Q15 */
    w[1] = round_fx_sat( L_shl_sat( Ltemp2, n ) ); /*  w[1] in Q15 */
    move16();

    logLag = log10_fx( X_fx->lag_fx );                       /*  logLag=10*log10(lag), Q23 */
+2 −2
Original line number Diff line number Diff line
@@ -171,8 +171,8 @@ void core_encode_update_cng_fx(

    tmp = sub( st->wspeech_enc[-1], shl( hLPDmem->mem_w0, shift ) );
    E_UTIL_deemph2( negate( shift ), wsyn, st->preemph_fac, st->L_frame, &tmp );
    hLPDmem->mem_w0 = sub( st->wspeech_enc[st->L_frame - 1], tmp );
    hLPDmem->mem_w0 = shr( hLPDmem->mem_w0, shift );
    hLPDmem->mem_w0 = sub_sat( st->wspeech_enc[st->L_frame - 1], tmp );
    hLPDmem->mem_w0 = shr_sat( hLPDmem->mem_w0, shift );
    move16();
    move16();
    /* Update LPC-related memories */
+1 −1
Original line number Diff line number Diff line
@@ -2066,7 +2066,7 @@ Word16 cng_energy_fx(
            L_tmp = L_mult0( tmp16, tmp16 );
            pt_res++;
            tmp16 = shl( *pt_res, scale );
            L_tmp = L_mac0( L_tmp, tmp16, tmp16 ); /* 2*(Q_new+scale) */
            L_tmp = L_mac0_sat( L_tmp, tmp16, tmp16 ); /* 2*(Q_new+scale) */
            pt_res++;
            L_ener = L_add( L_ener, L_shr( Mult_32_16( L_tmp, 26214 /* 256/320, Q15 */ ), 7 ) ); /* 2*(Q_new+scale)+15+1-16+1, divide by L_frame done here */
        }
+1 −1
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ Word16 gaus_encode_fx(

    exp_code = sub( exp_code, 18 + 6 ); /* exp: -18 (code in Q9), -6 (L_subfr = 64) */
    Ltmp = Isqrt_lc( Ltmp, &exp_code );
    *gain_inov = extract_h( L_shl( Ltmp, sub( exp_code, 3 ) ) ); /* g_code_inov in Q12 */
    *gain_inov = extract_h( L_shl_sat( Ltmp, sub( exp_code, 3 ) ) ); /* g_code_inov in Q12 */

    nb_bits = st_fx->acelp_cfg.gains_mode[tmp_idx]; /* Q0 */
    move16();
Loading