Commit c9460164 authored by multrus's avatar multrus
Browse files

replace BASOP_Util_Divide3232_Scale_cadence() by BASOP_Util_Divide3232_Scale_newton()

parent 004bf201
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2614,7 +2614,7 @@ void ivas_dirac_dec_render_sf_fx(
                    hDirACRend->h_output_synthesis_psd_state.direct_power_factor_fx[i] = L_add( hDirACRend->h_output_synthesis_psd_state.direct_power_factor_fx[i], surCohEner_fx ); // Q29
                    move32();

                    surCohRatio_fx[i] = BASOP_Util_Divide3232_Scale_cadence( surCohEner_fx, ( L_add( EPSILLON_FX, L_add( dirEne_fx, surCohEner_fx ) ) ), &temp_q );
                    surCohRatio_fx[i] = BASOP_Util_Divide3232_Scale_newton( surCohEner_fx, ( L_add( EPSILLON_FX, L_add( dirEne_fx, surCohEner_fx ) ) ), &temp_q );
                    move32();
                    surCohRatio_fx[i] = L_shl( surCohRatio_fx[i], sub( temp_q, 16 ) ); // Q15
                    move32();
+6 −6
Original line number Diff line number Diff line
@@ -1751,7 +1751,7 @@ Word16 computeMixingMatricesISM_fx(
        IF( svd_s_buffer_fx[i] )
        {
            Word32 reg_fac;
            reg_fac = BASOP_Util_Divide3232_Scale_cadence( MAX_32, svd_s_buffer_fx[i], &temp_e[i] );
            reg_fac = BASOP_Util_Divide3232_Scale_newton( MAX_32, svd_s_buffer_fx[i], &temp_e[i] );
            Kx_reg_inv_fx[i] = reg_fac;
            move32();
            temp_e[i] = sub( temp_e[i], svd_s_buffer_fx_e );
@@ -1760,7 +1760,7 @@ Word16 computeMixingMatricesISM_fx(
        ELSE
        {
            Word32 reg_fac;
            reg_fac = BASOP_Util_Divide3232_Scale_cadence( MAX_32, EPSILON_FX_M, &temp_e[i] );
            reg_fac = BASOP_Util_Divide3232_Scale_newton( MAX_32, EPSILON_FX_M, &temp_e[i] );
            Kx_reg_inv_fx[i] = reg_fac;
            move32();
            temp_e[i] = sub( temp_e[i], EPSILON_FX_E );
@@ -1837,7 +1837,7 @@ Word16 computeMixingMatricesISM_fx(
        {
            IF( Cy_hat_diag_fx[i] )
            {
                G_hat_fx[i] = BASOP_Util_Divide3232_Scale_cadence( Cy_diag_fx[i], Cy_hat_diag_fx[i], &temp_e[i] );
                G_hat_fx[i] = BASOP_Util_Divide3232_Scale_newton( Cy_diag_fx[i], Cy_hat_diag_fx[i], &temp_e[i] );
                move32();
                temp_e[i] = add( temp_e[i], sub( Cy_diag_e, Cy_hat_diag_e ) );
                move16();
@@ -1846,7 +1846,7 @@ Word16 computeMixingMatricesISM_fx(
            }
            ELSE
            {
                G_hat_fx[i] = BASOP_Util_Divide3232_Scale_cadence( Cy_diag_fx[i], EPSILON_FX_M, &temp_e[i] );
                G_hat_fx[i] = BASOP_Util_Divide3232_Scale_newton( Cy_diag_fx[i], EPSILON_FX_M, &temp_e[i] );
                move32();
                temp_e[i] = add( temp_e[i], sub( Cy_diag_e, EPSILON_FX_E ) );
                move16();
@@ -1949,7 +1949,7 @@ Word16 computeMixingMatricesISM_fx(
                {
                    IF( Cy_tilde_p_fx[i + ( i * lengthCy )] )
                    {
                        adj_fx[i] = BASOP_Util_Divide3232_Scale_cadence( Cy_diag_fx[i], Cy_tilde_p_fx[i + ( i * lengthCy )], &temp_e[i] );
                        adj_fx[i] = BASOP_Util_Divide3232_Scale_newton( Cy_diag_fx[i], Cy_tilde_p_fx[i + ( i * lengthCy )], &temp_e[i] );
                        move32();
                        temp_e[i] = add( temp_e[i], sub( Cy_diag_e, mat_mult_buffer2_e ) );
                        move16();
@@ -1958,7 +1958,7 @@ Word16 computeMixingMatricesISM_fx(
                    }
                    ELSE
                    {
                        adj_fx[i] = BASOP_Util_Divide3232_Scale_cadence( Cy_diag_fx[i], EPSILON_FX_M, &temp_e[i] );
                        adj_fx[i] = BASOP_Util_Divide3232_Scale_newton( Cy_diag_fx[i], EPSILON_FX_M, &temp_e[i] );
                        move32();
                        temp_e[i] = add( temp_e[i], sub( Cy_diag_e, EPSILON_FX_E ) );
                        move16();
+2 −2
Original line number Diff line number Diff line
@@ -225,7 +225,7 @@ static Word16 lfeplc_lev_dur_fx(
    a_out_q_fx[0] = 30;
    move16();

    rc_fx[0] = BASOP_Util_Divide3232_Scale_cadence( -r_fx[1], r_fx[0], &temp_q2 );
    rc_fx[0] = BASOP_Util_Divide3232_Scale_newton( -r_fx[1], r_fx[0], &temp_q2 );
    move32();
    rc_q_fx[0] = add( sub( r_q_fx[1], r_q_fx[0] ), sub( 31, temp_q2 ) );
    move16();
@@ -387,7 +387,7 @@ static Word16 lfeplc_lev_dur_fx(
        s = W_extract_h( W_shl( s_fx, exp1 ) );
        s_q_fx = sub( add( s_q_fx, exp1 ), 32 );

        rc_fx[i - 1] = L_shr( BASOP_Util_Divide3232_Scale_cadence( L_negate( s ), err_fx, &temp_q2 ), 1 );
        rc_fx[i - 1] = L_shr( BASOP_Util_Divide3232_Scale_newton( L_negate( s ), err_fx, &temp_q2 ), 1 );
        move32();
        rc_q_fx[i - 1] = sub( add( sub( s_q_fx, err_q_fx ), sub( 31, temp_q2 ) ), 1 );
        move16();
+3 −3
Original line number Diff line number Diff line
@@ -1330,7 +1330,7 @@ static ivas_error ivas_mc_dec_reconfig_fx(
        new_brate_SCE = 0;
        move32();
        Word16 temp_e;
        Word32 L_temp = BASOP_Util_Divide3232_Scale_cadence( ivas_total_brate, sub( st_ivas->nchan_transport, 1 ), &temp_e );
        Word32 L_temp = BASOP_Util_Divide3232_Scale_newton( ivas_total_brate, sub( st_ivas->nchan_transport, 1 ), &temp_e );
        L_temp = L_shr( L_temp, sub( 31, temp_e ) );
        new_brate_CPE = L_shl( L_temp, 1 ) /*CPE_CHANNELS*/;
    }
@@ -1339,7 +1339,7 @@ static ivas_error ivas_mc_dec_reconfig_fx(
        new_brate_SCE = 0;
        move32();
        Word16 temp_e;
        Word32 L_temp = BASOP_Util_Divide3232_Scale_cadence( ivas_total_brate, sub( st_ivas->nchan_transport, 1 ), &temp_e );
        Word32 L_temp = BASOP_Util_Divide3232_Scale_newton( ivas_total_brate, sub( st_ivas->nchan_transport, 1 ), &temp_e );
        L_temp = L_shr( L_temp, sub( 31, temp_e ) );
        new_brate_CPE = L_shl( L_temp, 1 ) /*CPE_CHANNELS*/;
    }
@@ -1348,7 +1348,7 @@ static ivas_error ivas_mc_dec_reconfig_fx(
        new_brate_SCE = 0; /* ivas_total_brate / st_ivas->nchan_transport;*/
        move32();
        Word16 temp_e;
        Word32 L_temp = BASOP_Util_Divide3232_Scale_cadence( ivas_total_brate, st_ivas->nchan_transport, &temp_e );
        Word32 L_temp = BASOP_Util_Divide3232_Scale_newton( ivas_total_brate, st_ivas->nchan_transport, &temp_e );
        L_temp = L_shr( L_temp, sub( 31, temp_e ) );
        new_brate_CPE = L_shl( L_temp, 1 ) /*CPE_CHANNELS*/;
    }
+3 −3
Original line number Diff line number Diff line
@@ -316,7 +316,7 @@ static void stereo_dft_generate_comfort_noise_fx(

        // lp_ener_fx will be in Q6 at this point.
        // So applying appropriate left shift on the denominator.
        factor = L_shr( BASOP_Util_Divide3232_Scale_cadence( st->lp_ener_fx, L_shl( st->L_frame, Q6 ), &q_div ), 1 ); /* fixed factor  in the loop below */ /* q_div */
        factor = L_shr( BASOP_Util_Divide3232_Scale_newton( st->lp_ener_fx, L_shl( st->L_frame, Q6 ), &q_div ), 1 ); /* fixed factor  in the loop below */ /* q_div */
        factor = Sqrt32( factor, &q_div );
        q_div = add( q_div, 1 );

@@ -399,7 +399,7 @@ static void stereo_dft_generate_comfort_noise_fx(
                assert( ftmp > 0 );
                q_div = 0;
                move16();
                ftmp = BASOP_Util_Divide3232_Scale_cadence( L_shl( 1, q_tmp ), ftmp, &q_div ); /* q_div */
                ftmp = BASOP_Util_Divide3232_Scale_newton( L_shl( 1, q_tmp ), ftmp, &q_div ); /* q_div */
                /* in float:
                both a = "div"=(1/(x^2+y^2) and sqrt(a)  is used and summed up in the same loop.

@@ -672,7 +672,7 @@ static void stereo_dft_generate_comfort_noise_fx(
                move16();
                FOR( k = 0; k < ( hFdCngCom->nFFTpart - 2 ); k++ )
                {
                    factor = BASOP_Util_Divide3232_Scale_cadence( L_add( hFdCngCom->sidNoiseEstLp[k], DELTA_FX ), L_add( st->hFdCngDec->partNoiseShape[k], DELTA_FX ), &q_div ); /* q_div */
                    factor = BASOP_Util_Divide3232_Scale_newton( L_add( hFdCngCom->sidNoiseEstLp[k], DELTA_FX ), L_add( st->hFdCngDec->partNoiseShape[k], DELTA_FX ), &q_div ); /* q_div */
                    q_div = add( q_div, sub( hFdCngCom->sidNoiseEstExp, st->hFdCngDec->partNoiseShape_exp ) );
                    IF( q_div < 0 )
                    {
Loading