Commit 7e422aff authored by multrus's avatar multrus
Browse files

[cleanup] accept OPT_MCT_ENC_V3_BE

parent 0166087b
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -606,9 +606,6 @@ Word64 dot_product_cholesky_fixed(
{
    Word16 i, j;
    Word64 suma, tmp_sum;
#ifndef OPT_MCT_ENC_V3_BE
    Word32 mul;
#endif
    Word32 tmp;
    const Word32 *pt_x, *pt_A;
    pt_A = A;
@@ -623,20 +620,10 @@ Word64 dot_product_cholesky_fixed(

        FOR( j = 0; j <= i; j++ )
        {
#ifdef OPT_MCT_ENC_V3_BE
            tmp_sum = W_add( tmp_sum, Mpy_32_32( *pt_x++, *pt_A++ ) );
#else
            mul = Mpy_32_32( *pt_x++, *pt_A++ );
            tmp_sum = W_add( tmp_sum, W_deposit32_l( mul ) );
#endif
        }

#ifdef OPT_MCT_ENC_V3_BE
        tmp = W_shl_sat_l( tmp_sum, -4 ); // to make sure that the tmp_sum will not overflow
#else
        tmp_sum = W_shr( tmp_sum, 4 ); // to make sure that the tmp_sum will not overflow
        tmp = W_extract_l( tmp_sum );
#endif
        suma = W_mac_32_32( suma, tmp, tmp );
    }

+0 −1
Original line number Diff line number Diff line
@@ -72,7 +72,6 @@
#endif

/* Note: each compile switch (FIX_1101_...) is independent from the other ones */
#define OPT_MCT_ENC_V3_BE
#define OPT_BIN_REND_V2_NBE

#define FIX_1348_BIT_PRECISION_IMPROVEMENT
+0 −20
Original line number Diff line number Diff line
@@ -719,9 +719,7 @@ static void ivas_find_enr(
    Word32 min_ener;
    Word16 shift = 0;
    move16();
#ifdef OPT_MCT_ENC_V3_BE
    Word16 tmp_shift;
#endif

    ptR = &data[1];         /* first real */
    ptI = &data[L_FFT - 1]; /* first imaginary */
@@ -751,20 +749,14 @@ static void ivas_find_enr(

    freq = BIN_FREQ_FX;
    move16();
#ifdef OPT_MCT_ENC_V3_BE
    tmp_shift = sub( -Q16, shift ); // 16 - shift - 32
#endif
    FOR( i = 0; i < voic_band; i++ ) /* up to maximum allowed voiced critical band  */
    {
        band_ener = 0;
        move64();
        start_freq = freq;
        move16();
#ifdef OPT_MCT_ENC_V3_BE
        FOR( ; LE_32( freq, crit_bands_fx[i] ); )
#else
        WHILE( LE_32( freq, crit_bands_fx[i] ) )
#endif
        {
            /*
               *ptE = *ptR * *ptR + *ptI * *ptI;
@@ -797,11 +789,7 @@ static void ivas_find_enr(
            freq = add( freq, BIN_FREQ_FX );
        }

#ifdef OPT_MCT_ENC_V3_BE
        band[i] = W_shl_sat_l( band_ener, tmp_shift ); // *q_band
#else
        band[i] = W_extract_h( W_shl( band_ener, sub( Q16, shift ) ) ); // *q_band
#endif
        move32();

        band_energies[i] = band[i]; /* per band energy without E_MIN   */ // *q_band
@@ -826,11 +814,7 @@ static void ivas_find_enr(
            move64();
            start_freq = freq;
            move16();
#ifdef OPT_MCT_ENC_V3_BE
            FOR( ; LE_32( freq, crit_bands_fx[i] ); )
#else
            WHILE( LE_32( freq, crit_bands_fx[i] ) )
#endif
            {
                /*
                  *Bin_E = *ptR * *ptR + *ptI * *ptI;
@@ -861,11 +845,7 @@ static void ivas_find_enr(
                freq = add( freq, BIN_FREQ_FX );
            }

#ifdef OPT_MCT_ENC_V3_BE
            band[i] = W_shl_sat_l( band_ener, tmp_shift ); // *q_band
#else
            band[i] = W_extract_h( W_shl_nosat( band_ener, sub( Q16, shift ) ) ); // *q_band
#endif
            move32();

            band_energies[i] = band[i]; /* per band energy without E_MIN   */ // *q_band
+0 −4
Original line number Diff line number Diff line
@@ -135,11 +135,7 @@ static Word16 IGF_getCrest_new_fx(
    {
        x = logSpec[i];
        move16();
#ifdef OPT_MCT_ENC_V3_BE
        x_eff = L_mac0( x_eff, x, x );
#else
        x_eff = L_add( x_eff, L_mult0( x, x ) );
#endif

        if ( GT_16( x, x_max ) )
        {
+0 −30
Original line number Diff line number Diff line
@@ -3588,10 +3588,8 @@ Word16 tcx_res_Q_spec_ivas_fx(
    Word16 s, s2, lf_deemph_factor;
    Word16 c;
    Word32 thres;
#ifdef OPT_MCT_ENC_V3_BE
    Word16 cmp_1, cmp_2;
    Word32 tmp32_1, tmp32_2;
#endif

    /* Limit the number of residual bits */
    sqTargetBits = s_min( sqTargetBits, NPRM_RESQ );
@@ -3607,28 +3605,18 @@ Word16 tcx_res_Q_spec_ivas_fx(
    move16();
    s2 = sub( x_Q_e, 1 );

#ifdef OPT_MCT_ENC_V3_BE
    cmp_1 = sub( sqTargetBits, kMaxEstimatorUndershoot );
    cmp_2 = s_min( NPRM_RESQ, add( sqTargetBits, kMaxEstimatorOvershoot ) );
#endif
    FOR( i = 0; i < L_frame; i++ )
    {
#ifdef OPT_MCT_ENC_V3_BE
        IF( GE_16( bits, cmp_1 ) )
#else
        IF( GE_16( bits, sub( sqTargetBits, kMaxEstimatorUndershoot ) ) )
#endif
        {
            fac_m = 0;
            move16();
            fac_p = 0;
            move16();

#ifdef OPT_MCT_ENC_V3_BE
            IF( GE_16( bits, cmp_2 ) )
#else
            IF( GE_16( bits, s_min( NPRM_RESQ, add( sqTargetBits, kMaxEstimatorOvershoot ) ) ) )
#endif
            {
                BREAK;
            }
@@ -3695,17 +3683,8 @@ Word16 tcx_res_Q_spec_ivas_fx(
    /*Quantize zeroed-line of the spectrum*/
    c = sub( 21627 /*0.66f Q15*/, mult_r( sq_round, 21627 /*0.66f Q15*/ ) );

#ifdef OPT_MCT_ENC_V3_BE
    FOR( i = 0; ( i < L_frame ) && ( bits < ( sqTargetBits - 2 ) ); i++ )
    {
#else
    FOR( i = 0; i < L_frame; i++ )
    {
        IF( GE_16( bits, sub( sqTargetBits, 2 ) ) )
        {
            BREAK;
        }
#endif

        test();
        test();
@@ -3722,15 +3701,10 @@ Word16 tcx_res_Q_spec_ivas_fx(

            tmp1 = Mpy_32_16_1( thres, sqGain );

#ifdef OPT_MCT_ENC_V3_BE
            tmp32_1 = L_shl( x_orig[i], sub( x_orig_e, shift_tmp ) );
            tmp32_2 = L_shl( tmp1, sub( sqGain_e, shift_tmp ) );
            IF( GT_32( tmp32_1, tmp32_2 ) )
            {
#else
            IF( GT_32( L_shl( x_orig[i], sub( x_orig_e, shift_tmp ) ), L_shl( tmp1, sub( sqGain_e, shift_tmp ) ) ) )
            {
#endif
                prm[bits] = 1;
                move16();
                bits = add( bits, 1 );
@@ -3742,11 +3716,7 @@ Word16 tcx_res_Q_spec_ivas_fx(
                x_Q[i] = L_shl( thres, sub( 1, x_Q_e ) );
                move32();
            }
#ifdef OPT_MCT_ENC_V3_BE
            ELSE IF( L_add( tmp32_1, tmp32_2 ) < 0 )
#else
            ELSE IF( L_add( L_shl( x_orig[i], sub( x_orig_e, shift_tmp ) ), L_shl( tmp1, sub( sqGain_e, shift_tmp ) ) ) < 0 )
#endif
            {
                prm[bits] = 1;
                move16();