diff --git a/lib_dec/ivas_dirac_dec_fx.c b/lib_dec/ivas_dirac_dec_fx.c index bbd4641b1184a7fc71cd906b5968738001a30bef..064185e478e555cdf82dadfbfec159430732586b 100644 --- a/lib_dec/ivas_dirac_dec_fx.c +++ b/lib_dec/ivas_dirac_dec_fx.c @@ -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(); diff --git a/lib_dec/ivas_dirac_output_synthesis_cov_fx.c b/lib_dec/ivas_dirac_output_synthesis_cov_fx.c index 114083fad8e0da38d7156682e4fd78b2bc58b7df..6d367538d26d575e27d55756a9222a5c96d5c322 100644 --- a/lib_dec/ivas_dirac_output_synthesis_cov_fx.c +++ b/lib_dec/ivas_dirac_output_synthesis_cov_fx.c @@ -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(); diff --git a/lib_dec/ivas_lfe_plc_fx.c b/lib_dec/ivas_lfe_plc_fx.c index d98603d2a567052962051810bce287bbb9e3cedb..a480ce7bebdcb58eb606d72f4f76374b1747370a 100644 --- a/lib_dec/ivas_lfe_plc_fx.c +++ b/lib_dec/ivas_lfe_plc_fx.c @@ -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(); diff --git a/lib_dec/ivas_mct_dec_fx.c b/lib_dec/ivas_mct_dec_fx.c index 7e1597749a396bbd8c33a1681718233659958922..32403b11a032c798ae52da7a70721396466c7f6f 100644 --- a/lib_dec/ivas_mct_dec_fx.c +++ b/lib_dec/ivas_mct_dec_fx.c @@ -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*/; } diff --git a/lib_dec/ivas_stereo_cng_dec.c b/lib_dec/ivas_stereo_cng_dec.c index 478f96dc13a31a20d67b3971274c47eac5291b07..6b8a8f949435c9e234e51f8e02128cb8ba4073de 100644 --- a/lib_dec/ivas_stereo_cng_dec.c +++ b/lib_dec/ivas_stereo_cng_dec.c @@ -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 ) { diff --git a/lib_dec/ivas_stereo_dft_dec.c b/lib_dec/ivas_stereo_dft_dec.c index f0fd1978b2e03862de5a38a572aff48efa0c3002..92ae9159cd99b32fcbf18839bed6508bc7bcbe70 100644 --- a/lib_dec/ivas_stereo_dft_dec.c +++ b/lib_dec/ivas_stereo_dft_dec.c @@ -281,7 +281,7 @@ void stereo_dft_dec_analyze_fx( move16(); NFFT = NS2SA_FX2( inputFs, STEREO_DFT32MS_N_NS ); Word16 qfac_fx; - fac_fx = BASOP_Util_Divide3232_Scale_cadence( hStereoDft->NFFT, NFFT, &qfac_fx ); /* qfac_fx */ + fac_fx = BASOP_Util_Divide3232_Scale_newton( hStereoDft->NFFT, NFFT, &qfac_fx ); /* qfac_fx */ qfac_fx = sub( 31, qfac_fx ); ovl2 = NS2SA_FX2( inputFs, STEREO_DFT32MS_OVL2_NS ); move16(); diff --git a/lib_dec/ivas_stereo_mdct_stereo_dec_fx.c b/lib_dec/ivas_stereo_mdct_stereo_dec_fx.c index 5248839f578a0a79046150a737378c5b56e418e6..8842a6792a8c866cbcc17e6b0b0a9f1a32f7392d 100644 --- a/lib_dec/ivas_stereo_mdct_stereo_dec_fx.c +++ b/lib_dec/ivas_stereo_mdct_stereo_dec_fx.c @@ -433,7 +433,7 @@ void stereo_decoder_tcx_fx( IF( !mct_on ) { - tmp_32 = BASOP_Util_Divide3232_Scale_cadence( SMDCT_ILD_RANGE << 16, L_deposit_h( hStereoMdct->global_ild[k] ), &tmp_e ); + tmp_32 = BASOP_Util_Divide3232_Scale_newton( SMDCT_ILD_RANGE << 16, L_deposit_h( hStereoMdct->global_ild[k] ), &tmp_e ); tmp_32 = L_shr( tmp_32, sub( 5, tmp_e ) ); /* nrgRatio = nrg[1]/nrg[0] */ // Q26 nrgRatio = L_sub( tmp_32, ONE_IN_Q26 ); // Q26 @@ -488,7 +488,7 @@ void stereo_decoder_tcx_fx( } ELSE IF( ( LT_32( nrgRatio, ONE_IN_Q26 ) ) && ( LT_16( k, tmp2 ) ) ) { - inv_nrgRatio = BASOP_Util_Divide3232_Scale_cadence( ONE_IN_Q26, nrgRatio, &tmp_e ); + inv_nrgRatio = BASOP_Util_Divide3232_Scale_newton( ONE_IN_Q26, nrgRatio, &tmp_e ); shift = sub( 5, tmp_e ); v_multc_fixed( spec_l[k], inv_nrgRatio, spec_l[k], L_frameTCX_l ); /* spec_r will be in Qx - tmp_e */ Scale_sig32( spec_l[k], L_frameTCX_l, sub( 5, shift ) ); /* Qx */ diff --git a/lib_dec/ivas_stereo_switching_dec_fx.c b/lib_dec/ivas_stereo_switching_dec_fx.c index 1a6ea257b242ed2bf27adbe3933573bae47eb539..bcf714352d2e72e7f4c890d442651bd05648976f 100644 --- a/lib_dec/ivas_stereo_switching_dec_fx.c +++ b/lib_dec/ivas_stereo_switching_dec_fx.c @@ -2361,7 +2361,7 @@ static Word32 ncross_corr_self_fx( Word16 q_cc = W_norm( c_c_fx ); Word32 num = W_extract_h( W_shl( c_c_fx, q_cc ) ); // Q(23 + q_cc - 32) -> e(40 - q_cc) Word16 quo_e; - num = BASOP_Util_Divide3232_Scale_cadence( num, energy, &quo_e ); + num = BASOP_Util_Divide3232_Scale_newton( num, energy, &quo_e ); quo_e = add( sub( sub( 40, q_cc ), q_prod ), quo_e ); c_c_fx_return = L_shl_sat( num, quo_e ); // Q31 } diff --git a/lib_dec/ivas_svd_dec_fx.c b/lib_dec/ivas_svd_dec_fx.c index 8a9224ffaa374843f095b736cf8be93e80416f84..4b052288430d888a2b29857d24ec105999397042 100644 --- a/lib_dec/ivas_svd_dec_fx.c +++ b/lib_dec/ivas_svd_dec_fx.c @@ -628,7 +628,7 @@ static void ApplyQRTransform_fx( L_temp1 = BASOP_Util_Add_Mant32Exp( r, r_e, r, r_e, &L_temp1_e ); /* exp(L_temp1_e) */ L_temp1 = maxWithSign_fx( Mpy_32_32( L_temp1, x_split ) ); /* exp(L_temp1_e + x_split_e) */ L_temp1_e = add( L_temp1_e, x_split_e ); - d = BASOP_Util_Divide3232_Scale_cadence( d, L_temp1, &temp_exp ); /* temp_exp + d_e - L_temp1_e */ + d = BASOP_Util_Divide3232_Scale_newton( d, L_temp1, &temp_exp ); /* temp_exp + d_e - L_temp1_e */ d_e = add( temp_exp, sub( d_e, L_temp1_e ) ); g = GivensRotation_fx( MAX_32, 0, d, d_e, &g_e ); @@ -646,7 +646,7 @@ static void ApplyQRTransform_fx( L_temp1_e = g_e; move16(); L_temp2 = maxWithSign_fx( BASOP_Util_Add_Mant32Exp( d, d_e, L_temp1, L_temp1_e, &L_temp2_e ) ); /* exp(L_temp2_e) */ - mu = BASOP_Util_Divide3232_Scale_cadence( x_split, L_temp2, &mu_e ); /* exp(mu_e + (x-plit_e - L_temp2_e)) */ + mu = BASOP_Util_Divide3232_Scale_newton( x_split, L_temp2, &mu_e ); /* exp(mu_e + (x-plit_e - L_temp2_e)) */ mu_e = add( mu_e, sub( x_split_e, L_temp2_e ) ); mu = BASOP_Util_Add_Mant32Exp( mu, mu_e, L_negate( r ), r_e, &mu_e ); /* exp(mu_e) */ @@ -654,7 +654,7 @@ static void ApplyQRTransform_fx( L_temp1 = BASOP_Util_Add_Mant32Exp( x_ii, x_ii_e, x_kk, x_kk_e, &L_temp1_e ); /* exp(L_temp1_e) */ L_temp2 = BASOP_Util_Add_Mant32Exp( x_ii, x_ii_e, L_negate( x_kk ), x_kk_e, &L_temp2_e ); /* exp(L_temp2_e) */ d = BASOP_Util_Add_Mant32Exp( Mpy_32_32( L_temp1, L_temp2 ), add( L_temp1_e, L_temp2_e ), Mpy_32_32( r, mu ), add( r_e, mu_e ), &d_e ); /* exp(d_e) */ - d = BASOP_Util_Divide3232_Scale_cadence( d, maxWithSign_fx( x_ii ), &temp_exp ); /* exp(temp_exp + (d_e - x_ii_e) */ + d = BASOP_Util_Divide3232_Scale_newton( d, maxWithSign_fx( x_ii ), &temp_exp ); /* exp(temp_exp + (d_e - x_ii_e) */ d_e = add( temp_exp, sub( d_e, x_ii_e ) ); /*QR transformation*/ @@ -917,7 +917,7 @@ static void biDiagonalReductionLeft_fx( { Word16 invVal_e; Word32 invVal; - invVal = BASOP_Util_Divide3232_Scale_cadence( MAXVAL_WORD32, maxWithSign_fx( *sig_x ), &invVal_e ); + invVal = BASOP_Util_Divide3232_Scale_newton( MAXVAL_WORD32, maxWithSign_fx( *sig_x ), &invVal_e ); norm_x = 0; move32(); norm_x_e = 0; @@ -954,7 +954,7 @@ static void biDiagonalReductionLeft_fx( singularVectors[currChannel][idx] = BASOP_Util_Add_Mant32Exp( singularVectors[currChannel][idx], singularVectors2_e[currChannel][idx], -( *g ), 0, &singularVectors2_e[currChannel][idx] ); /* sing_exp */ move32(); - invVal = BASOP_Util_Divide3232_Scale_cadence( MAXVAL_WORD32, maxWithSign_fx( r ), &invVal_e ); + invVal = BASOP_Util_Divide3232_Scale_newton( MAXVAL_WORD32, maxWithSign_fx( r ), &invVal_e ); FOR( iCh = currChannel + 1; iCh < nChannelsC; iCh++ ) /* nChannelsC */ { @@ -1046,7 +1046,7 @@ static void biDiagonalReductionRight_fx( Word16 invVal_e, temp_e; Word32 invVal; - invVal = BASOP_Util_Divide3232_Scale_cadence( MAXVAL_WORD32, maxWithSign_fx( *sig_x ), &invVal_e ); + invVal = BASOP_Util_Divide3232_Scale_newton( MAXVAL_WORD32, maxWithSign_fx( *sig_x ), &invVal_e ); FOR( jCh = idx; jCh < nChannelsC; jCh++ ) /*nChannelsC */ { temp_e = norm_l( singularVectors[currChannel][jCh] ); @@ -1082,7 +1082,7 @@ static void biDiagonalReductionRight_fx( singularVectors[currChannel][idx] = BASOP_Util_Add_Mant32Exp( singularVectors[currChannel][idx], singularVectors2_e[currChannel][idx], -( *g ), 0, &singularVectors2_e[currChannel][idx] ); /* exp(sing_exp) */ move32(); - invVal = BASOP_Util_Divide3232_Scale_cadence( MAXVAL_WORD32, maxWithSign_fx( r ), &invVal_e ); + invVal = BASOP_Util_Divide3232_Scale_newton( MAXVAL_WORD32, maxWithSign_fx( r ), &invVal_e ); FOR( jCh = idx; jCh < nChannelsC; jCh++ ) /* nChannelsC */ { @@ -1162,10 +1162,10 @@ static void singularVectorsAccumulationLeft_fx( IF( t_ii ) /*if (fabsf(t_ii) > EPSILON *fabsf(t_ii)) {*/ { - t_ii = BASOP_Util_Divide3232_Scale_cadence( MAXVAL_WORD32, maxWithSign_fx( t_ii ), &temp_exp ); + t_ii = BASOP_Util_Divide3232_Scale_newton( MAXVAL_WORD32, maxWithSign_fx( t_ii ), &temp_exp ); t_ii_e = sub( temp_exp, t_ii_e ); Word16 tempe; - Word32 temp = BASOP_Util_Divide3232_Scale_cadence( t_ii, maxWithSign_fx( singularVectors_Left[nCh][nCh] ), &tempe ); + Word32 temp = BASOP_Util_Divide3232_Scale_newton( t_ii, maxWithSign_fx( singularVectors_Left[nCh][nCh] ), &tempe ); tempe = add( tempe, sub( t_ii_e, singularVectors_Left_e[nCh][nCh] ) ); // fprintf( fp, "%e\n", me2f( t_ii, t_ii_e ) ); FOR( iCh = nCh + 1; iCh < nChannelsC; iCh++ ) /* nChannelsC */ diff --git a/lib_dec/jbm_jb4sb.c b/lib_dec/jbm_jb4sb.c index 002b4bc109985558a4bf8769317309d597cb8aca..d1f782b55c18b79990c3ea00b920f1cda41a6f13 100644 --- a/lib_dec/jbm_jb4sb.c +++ b/lib_dec/jbm_jb4sb.c @@ -911,7 +911,7 @@ static void JB4_adaptActivePlayout( ELSE { Word16 exp; - Word32 temp = BASOP_Util_Divide3232_Scale_cadence( W_extract_l( W_sub( dropRateMax, dropRateMin ) ), W_extract_l( dropGapMax ), &exp ); + Word32 temp = BASOP_Util_Divide3232_Scale_newton( W_extract_l( W_sub( dropRateMax, dropRateMin ) ), W_extract_l( dropGapMax ), &exp ); /* limit gap to [gapMin,gapMax] and calculate current drop rate from gap */ Word64 temp2 = W_mult0_32_32( W_extract_l( JB4_MIN( gap, dropGapMax ) ), temp ); Word64 temp3 = W_shr( temp2, sub( 31, exp ) );