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

High MLD cases fixes, LTV crash fixes, precision optimization for changes in MR!521

[x] High MLD cases fixed for OMASA format with scaling changes in
dec_tcx_fx
[x] Fix for LTV crash issues after BASOP addition
[x] Enhancing precision in Decimate_allpass_steep_fx32
parent 85d5260e
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -774,8 +774,8 @@ void Decimate_allpass_steep_fx32(
    move32();

    mem[2 * ALLPASSSECTIONS_STEEP - 1] = L_sub( temp[ALLPASSSECTIONS_STEEP - 2], Mpy_32_16_1( temp[ALLPASSSECTIONS_STEEP - 1], AP2_STEEP_FX[ALLPASSSECTIONS_STEEP - 1] ) );
    out[0] = L_shr( L_add( out[0], temp[ALLPASSSECTIONS_STEEP - 1] ), 1 );
    move32();
    out[0] = W_round48_L( W_mac_32_16( W_mult_32_16( out[0], 16384 ), temp[ALLPASSSECTIONS_STEEP - 1], 16384 ) );
    move32();

    FOR( k = 1; k < N / 2; k++ )
@@ -802,7 +802,7 @@ void Decimate_allpass_steep_fx32(
        move32();
        mem[2 * ALLPASSSECTIONS_STEEP - 1] = L_sub( temp[ALLPASSSECTIONS_STEEP - 2], Mpy_32_16_1( temp[ALLPASSSECTIONS_STEEP - 1], AP2_STEEP_FX[ALLPASSSECTIONS_STEEP - 1] ) );
        move32();
        out[k] = L_shr( L_add( out[k], temp[ALLPASSSECTIONS_STEEP - 1] ), 1 );
        out[k] = W_round48_L( W_mac_32_16( W_mult_32_16( out[k], 16384 ), temp[ALLPASSSECTIONS_STEEP - 1], 16384 ) );
        move32();
    }

+4 −2
Original line number Diff line number Diff line
@@ -181,8 +181,10 @@ static Word16 ivas_imax2_jacobsen_mag_fx(

    /* prepare denominator real and imaginary parts */

    D_re = sub( sub( shl( y_0_re, 1 ), y_m1_re ), y_p1_re );
    D_im = sub( sub( shl( y_0_im, 1 ), y_m1_im ), y_p1_im );
    /* D_re = 2 * y_0_re - y_m1_re - y_p1_re */
    D_re = add( sub( y_0_re, y_m1_re ), sub( y_0_re, y_p1_re ) );
    /* D_im = 2 * y_0_im - y_m1_im - y_p1_im */
    D_im = add( sub( y_0_im, y_m1_im ), sub( y_0_im, y_p1_im ) );

    /* REAL part of complex division  */
    numer = L_add( L_mult0( N_re, D_re ), L_mult0( N_im, D_im ) );
+4 −2
Original line number Diff line number Diff line
@@ -3838,8 +3838,10 @@ void decoder_tcx_ivas_fx(
    Scale_sig( synth_fx, L_frame_glob, negate( st->Q_syn ) );
    Scale_sig( synthFB_fx, L_frameTCX_glob, negate( st->Q_syn ) );
    Scale_sig( st->hTcxDec->syn_Overl, L_FRAME32k / 2, 1 );
    Scale_sig( st->hHQ_core->old_out_LB_fx, L_FRAME32k, ( sub( st->hHQ_core->Q_old_wtda, st->Q_syn ) ) );
    Scale_sig( st->hHQ_core->old_out_fx, L_FRAME48k, ( sub( st->hHQ_core->Q_old_wtda, st->Q_syn ) ) );
    st->hHQ_core->Q_old_wtda = st->Q_syn;
    // Scale_sig( st->hHQ_core->old_out_LB_fx, L_FRAME32k, ( sub( st->hHQ_core->Q_old_wtda, st->Q_syn ) ) );
    st->hHQ_core->Q_old_wtda_LB = st->Q_syn;
    // Scale_sig( st->hHQ_core->old_out_fx, L_FRAME48k, ( sub( st->hHQ_core->Q_old_wtda, st->Q_syn ) ) );
    Scale_sig( st->hTcxDec->old_syn_Overl, 320, ( -2 + st->Q_syn ) ); // Scaling to Q-2
}
#endif
+2 −2
Original line number Diff line number Diff line
@@ -2006,7 +2006,7 @@ void generate_masking_noise_ivas_fx(
            rand_gauss_fx( &fftBuffer_fx[0], seed, *exp_out ); // Q15
            ptr_r_fx = fftBuffer_fx + 2;
            Word16 exp1;
            exp1 = sub( 32, hFdCngCom->cngNoiseLevelExp );
            exp1 = add( hFdCngCom->cngNoiseLevelExp, 1 );
            Word32 mpy1;
            mpy1 = Sqrt32( Mpy_32_32( scale_fx, *ptr_level_fx ), &exp1 );                   // Q = noise_exp-1
            mpy1 = L_shl( mpy1, exp1 );                                                     // Q31
@@ -2026,7 +2026,7 @@ void generate_masking_noise_ivas_fx(
            /* Real part in FFT bins */
            rand_gauss_fx( ptr_r_fx, seed, *exp_out ); // Q15
            Word16 exp2;
            exp2 = sub( 32, hFdCngCom->cngNoiseLevelExp );
            exp2 = add( hFdCngCom->cngNoiseLevelExp, 1 );
            Word32 mpy2;
            mpy2 = Sqrt32( L_shr( Mpy_32_32( scale_fx, *ptr_level_fx ), 1 ), &exp2 ); // Q = noise_exp-1
            ( *ptr_r_fx ) = L_shl( Mpy_32_32( *ptr_r_fx, mpy2 ), exp2 );              // Q = Q15
+2 −1
Original line number Diff line number Diff line
@@ -2925,7 +2925,7 @@ void perform_noise_estimation_dec_ivas_fx(
                    IF( GT_16( hFdCngDec->ms_cnt_bw_up, 0 ) && GT_16( p, 55 ) )
                    {
                        alpha = Inv16( add( hFdCngDec->ms_cnt_bw_up, 1 ), &i_e );
                        IF( i_e <= 0 )
                        IF( i_e < 0 )
                        {
                            alpha = shr( alpha, negate( i_e ) ); // Q15
                        }
@@ -3092,6 +3092,7 @@ void perform_noise_estimation_dec_ivas_fx(
                    IF( ( tmp_q <= 0 ) )
                    {
                        diff = min_q;
                        move16();
                    }
                    ELSE
                    {
Loading