Commit 28884a5b authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch 'bug_fixes_3' into 'main'

Fix for wrong q-updation for LEtot in analy_sp, ltv crash fix

See merge request !1664
parents 7901bdd1 73cf73e9
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -5971,7 +5971,7 @@ void non_linearity_ivas_fx(
    }


    IF( GT_16( max_val, shl( 1, Q_inp ) ) )
    IF( GT_16( max_val, shl_sat( 1, Q_inp ) ) )
    {
        exp = norm_s( max_val );
        tmp = div_s( shl( 1, sub( 14, exp ) ), max_val );                    /* Q(29-exp-Q_inp) */
@@ -6045,7 +6045,7 @@ void non_linearity_ivas_fx(
        max_val = s_max( max_val, tmp );
    }

    IF( GT_16( max_val, shl( 1, Q_inp ) ) )
    IF( GT_16( max_val, shl_sat( 1, Q_inp ) ) )
    {
        exp = norm_s( max_val );
        tmp = div_s( shl( 1, sub( 14, exp ) ), max_val );                                 /* Q(29-exp-Q_inp) */
+1 −1
Original line number Diff line number Diff line
@@ -860,7 +860,7 @@ static void ivas_find_enr(
     * Find the total energy over the input bandwidth
     *-----------------------------------------------------------------*/

    etot = *LEtot; // *q_band
    etot = *LEtot; // *q_band+1
    move64();
    FOR( i = min_band; i <= max_band; i++ )
    {
+1 −1
Original line number Diff line number Diff line
@@ -1453,7 +1453,7 @@ ivas_error pre_proc_front_ivas_fx(
    test();
    IF( lr_vad_enabled && st->idchan == 0 )
    {
        ivas_long_enr_fx( st, -1, localVAD_HE_SAD, high_lpn_flag, hCPE->hFrontVad, CPE_CHANNELS, localVAD_HE_SAD_LR, Etot_LR_fx );
        ivas_long_enr_fx( st, -256 /*-1 q8*/, localVAD_HE_SAD, high_lpn_flag, hCPE->hFrontVad, CPE_CHANNELS, localVAD_HE_SAD_LR, Etot_LR_fx );

        Copy32( fr_bands_LR_fx[0] + NB_BANDS, hCPE->hFrontVad[0]->hNoiseEst->enrO_fx, NB_BANDS ); // fr_bands_LR_fx_q
        hCPE->hFrontVad[0]->hNoiseEst->q_enrO = fr_bands_LR_fx_q[0];
+1 −1
Original line number Diff line number Diff line
@@ -758,7 +758,7 @@ ivas_error front_vad_spar_fx(
        ivas_smc_gmm_fx( st, NULL, localVAD_HE_SAD[0], Etot_fx_0, lsp_new_fx, cor_map_sum_fx, epsP_fx, PS_fx, non_sta_fx, relE_fx, &high_lpn_flag, flag_spitch, Qfact_PS, Q_esp, hSpMusClas->past_PS_Q );

        /* long-term energy update */
        ivas_long_enr_fx( st, -1, localVAD_HE_SAD[0], high_lpn_flag, &hFrontVad, 1, localVAD_HE_SAD, Etot_fx );
        ivas_long_enr_fx( st, -256 /*-1 q8*/, localVAD_HE_SAD[0], high_lpn_flag, &hFrontVad, 1, localVAD_HE_SAD, Etot_fx );

        /* increase ini_frame counter */
        hFrontVad->ini_frame = s_min( add( hFrontVad->ini_frame, 1 ), MAX_FRAME_COUNTER ); /* Q0 */