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

Reduce usage of BASOP_Util_Add_Mant32Exp in MCT path

Changes are under macro OPT_MCT_ENC_V1_NBE
WMOPs reduction of ~130. Tested config: Multi-Channel 7.1+4,48kbps FB
parent 1b3a4eac
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -77,6 +77,7 @@
#define FIX_1379_MASA_ANGLE_ROUND

/* Note: each compile switch (FIX_1101_...) is independent from the other ones */
#define OPT_MCT_ENC_V1_NBE
#define OPT_SBA_REND_V1_BE
#define OPT_HEAD_ROT_REND_V1_BE
#define OPT_SBA_DEC_V2_BE
+36 −1
Original line number Diff line number Diff line
@@ -2085,6 +2085,41 @@ static void compute_cov_mtx_fx(
)
{
    Word16 i, j;
#ifdef OPT_MCT_ENC_V1_NBE
    Word64 temp64_1, temp64_2;
    Word16 tmp_16, max_exp;
    Word16 temp_exp = shl( inp_exp, 1 );
    FOR( i = 0; i < N; i++ )
    {
        FOR( j = i; j < N; j++ )
        {
            temp64_1 = W_mac_32_32( W_mult_32_32( sr[i][freq], sr[j][freq] ), si[i][freq], si[j][freq] ); // exp:2*inp_exp
            temp64_2 = W_deposit32_h( COVls->xr_fx[i][j] );                                               // exp:COVls->xr_e[i][j]
            max_exp = s_max( COVls->xr_e[i][j], temp_exp );
            temp64_2 = W_shl( temp64_2, sub( COVls->xr_e[i][j], max_exp ) ); // exp:max_exp
            temp64_1 = W_shl( temp64_1, sub( temp_exp, max_exp ) );          // exp:max_exp
            temp64_1 = W_add( temp64_1, temp64_2 );                          // exp:max_exp
            tmp_16 = W_norm( temp64_1 );

            COVls->xr_fx[i][j] = W_extract_h( W_shl( temp64_1, tmp_16 ) ); // exp:max_exp-tmp_16
            COVls->xr_e[i][j] = sub( max_exp, tmp_16 );
            move32();
            move16();

            temp64_1 = W_sub( W_mult_32_32( si[i][freq], sr[j][freq] ), W_mult_32_32( sr[i][freq], si[j][freq] ) ); // exp :2*inp_exp
            temp64_2 = W_deposit32_h( COVls->xi_fx[i][j] );                                                         // exp:COVls->xi_e[i][j]
            max_exp = s_max( COVls->xi_e[i][j], temp_exp );
            temp64_2 = W_shl( temp64_2, sub( COVls->xi_e[i][j], max_exp ) ); // exp:max_exp
            temp64_1 = W_shl( temp64_1, sub( temp_exp, max_exp ) );          // exp:max_exp
            temp64_1 = W_add( temp64_1, temp64_2 );                          // exp:max_exp
            tmp_16 = W_norm( temp64_1 );

            COVls->xi_fx[i][j] = W_extract_h( W_shl( temp64_1, tmp_16 ) ); // exp:max_exp-tmp_16
            COVls->xi_e[i][j] = sub( max_exp, tmp_16 );
            move32();
        }
    }
#else
    Word32 a, b, c, d;
    Word32 temp;
    Word16 norm_a, norm_b, norm_c, norm_d;
@@ -2117,7 +2152,7 @@ static void compute_cov_mtx_fx(
            move32();
        }
    }

#endif
    return;
}