Commit 93cdb82c authored by malenov's avatar malenov
Browse files

rename ops_cnt_wmc back to ops_cnt

parent a6e61ec2
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -152,9 +152,7 @@
    <ClCompile Include="..\lib_com\codec_tcx_common_flt.c" />
    <ClCompile Include="..\lib_com\codec_tcx_common.c" />
    <ClCompile Include="..\lib_com\complex_basop.c" />
    <ClCompile Include="..\lib_com\control.c" />
    <ClCompile Include="..\lib_com\core_com_config.c" />
    <ClCompile Include="..\lib_com\count.c" />
    <ClCompile Include="..\lib_com\deemph.c" />
    <ClCompile Include="..\lib_com\delay_comp.c" />
    <ClCompile Include="..\lib_com\disclaimer.c" />
+0 −4
Original line number Diff line number Diff line
@@ -103,9 +103,6 @@
    <ClCompile Include="..\lib_com\ivas_lfe_com.c">
      <Filter>common_ivas_c</Filter>
    </ClCompile>
    <ClCompile Include="..\lib_com\control.c">
      <Filter>common_all_c</Filter>
    </ClCompile>
    <ClCompile Include="..\lib_com\enh64.c">
      <Filter>common_all_c</Filter>
    </ClCompile>
@@ -521,7 +518,6 @@
    <ClCompile Include="..\lib_com\window_ola.c" />
    <ClCompile Include="..\lib_com\wtda.c" />
    <ClCompile Include="..\lib_com\gs_bitallocation_ivas_fx.c" />
    <ClCompile Include="..\lib_com\count.c" />
    <ClCompile Include="..\lib_com\ivas_stereo_ica_com_fx.c" />
  </ItemGroup>
  <ItemGroup>
+12 −23
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ typedef struct
#endif
} wmops_record;

double ops_cnt_wmc;
double ops_cnt;
double prom_cnt_wmc;
double inst_cnt[NUM_INST];

@@ -108,7 +108,7 @@ void reset_wmops( void )
    max_cnt = 0.0;
    min_cnt = DOUBLE_MAX;
    start_cnt = 0.0;
    ops_cnt_wmc = 0.0;
    ops_cnt = 0.0;

    /* allocate the list of WMOPS records */
    if ( wmops == NULL )
@@ -134,17 +134,6 @@ void reset_wmops( void )
        exit( -1 );
    }

    //BASOP_init

    //setFrameRate( 32000, 640 );
    //Init_WMOPS_counter(); /* 20ms frames */


    //for ( i = 0; i < MAX_HASH_TABLE_SIZE; i++ )
    //{
    //    lookup_table[i] = -1;
    //}

    /* initilize the list of WMOPS records */
    /* initilize the BASOP WMOPS counters */
    for ( i = 0; i < max_num_wmops_records; i++ )
@@ -301,7 +290,7 @@ void push_wmops_fct( const char *label, ... )
        wmops_caller_stack[wmops_caller_stack_index++] = current_record;

        /* accumulate op counts */
        wmops[current_record].current_selfcnt += ops_cnt_wmc - wmops[current_record].start_selfcnt;
        wmops[current_record].current_selfcnt += ops_cnt - wmops[current_record].start_selfcnt;

        /* update call tree */
        for ( j = 0; j < MAX_CALL_TREE_DEPTH; j++ )
@@ -320,8 +309,8 @@ void push_wmops_fct( const char *label, ... )

    /* update the current context info */
    current_record = index_record;
    wmops[index_record].start_selfcnt = ops_cnt_wmc;
    wmops[index_record].start_cnt = ops_cnt_wmc;
    wmops[index_record].start_selfcnt = ops_cnt;
    wmops[index_record].start_cnt = ops_cnt;
    wmops[index_record].call_number++;
#ifdef WMOPS_WC_FRAME_ANALYSIS
    wmops[index_record].current_call_number++;
@@ -347,17 +336,17 @@ void pop_wmops( void )

    /* add the BASOP complexity to the counter */
    tot = DeltaWeightedOperation();
    ops_cnt_wmc += tot;
    ops_cnt += tot;

    /* update count of current record */
    wmops[current_record].current_selfcnt += ops_cnt_wmc - wmops[current_record].start_selfcnt;
    wmops[current_record].current_cnt += ops_cnt_wmc - wmops[current_record].start_cnt;
    wmops[current_record].current_selfcnt += ops_cnt - wmops[current_record].start_selfcnt;
    wmops[current_record].current_cnt += ops_cnt - wmops[current_record].start_cnt;

    /* Get back previous context from stack */
    if ( wmops_caller_stack_index > 0 )
    {
        current_record = wmops_caller_stack[--wmops_caller_stack_index];
        wmops[current_record].start_selfcnt = ops_cnt_wmc;
        wmops[current_record].start_selfcnt = ops_cnt;

        /* set the ID of the previous BASOP counter */
        Set_BASOP_WMOPS_counter( current_record );
@@ -463,7 +452,7 @@ void update_wmops( void )
        Reset_BASOP_WMOPS_counter();
    }

    current_cnt = ops_cnt_wmc - start_cnt;
    current_cnt = ops_cnt - start_cnt;
    if ( current_cnt > max_cnt )
    {
        max_cnt = current_cnt;
@@ -486,7 +475,7 @@ void update_wmops( void )
        inst_cnt[i] = 0.0;
    }

    start_cnt = ops_cnt_wmc;
    start_cnt = ops_cnt;

    /* increment frame counter */
    update_cnt++;
@@ -539,7 +528,7 @@ void print_wmops( void )
    }

    fprintf( stdout, sfmts, max_label_len, "---------------", "------", "------", "------", "------" );
    fprintf( stdout, dfmts, max_label_len, "total", (float) update_cnt, update_cnt == 0 ? 0 : FAC * min_cnt, FAC * max_cnt, update_cnt == 0 ? 0 : FAC * ops_cnt_wmc / update_cnt );
    fprintf( stdout, dfmts, max_label_len, "total", (float) update_cnt, update_cnt == 0 ? 0 : FAC * min_cnt, FAC * max_cnt, update_cnt == 0 ? 0 : FAC * ops_cnt / update_cnt );
    fprintf( stdout, "\n" );

#ifdef WMOPS_WC_FRAME_ANALYSIS
+33 −41
Original line number Diff line number Diff line
@@ -110,7 +110,7 @@ enum instructions
#define ADD( x )                                    \
    {                                               \
        {                                           \
            ops_cnt_wmc += ( _ADD_C * ( x ) );          \
            ops_cnt += ( _ADD_C * ( x ) );          \
            inst_cnt[_ADD] += ( x );                \
            {                                       \
                static int pcnt;                    \
@@ -125,7 +125,7 @@ enum instructions
#define ABS( x )                                    \
    {                                               \
        {                                           \
            ops_cnt_wmc += ( _ABS_C * ( x ) );          \
            ops_cnt += ( _ABS_C * ( x ) );          \
            inst_cnt[_ABS] += ( x );                \
            {                                       \
                static int pcnt;                    \
@@ -140,7 +140,7 @@ enum instructions
#define MULT( x )                                    \
    {                                                \
        {                                            \
            ops_cnt_wmc += ( _MULT_C * ( x ) );          \
            ops_cnt += ( _MULT_C * ( x ) );          \
            inst_cnt[_MULT] += ( x );                \
            {                                        \
                static int pcnt;                     \
@@ -155,7 +155,7 @@ enum instructions
#define MAC( x )                                    \
    {                                               \
        {                                           \
            ops_cnt_wmc += ( _MAC_C * ( x ) );          \
            ops_cnt += ( _MAC_C * ( x ) );          \
            inst_cnt[_MAC] += ( x );                \
            {                                       \
                static int pcnt;                    \
@@ -170,7 +170,7 @@ enum instructions
#define MOVE( x )                                    \
    {                                                \
        {                                            \
            ops_cnt_wmc += ( _MOVE_C * ( x ) );          \
            ops_cnt += ( _MOVE_C * ( x ) );          \
            inst_cnt[_MOVE] += ( x );                \
            {                                        \
                static int pcnt;                     \
@@ -185,7 +185,7 @@ enum instructions
#define STORE( x )                                    \
    {                                                 \
        {                                             \
            ops_cnt_wmc += ( _STORE_C * ( x ) );          \
            ops_cnt += ( _STORE_C * ( x ) );          \
            inst_cnt[_STORE] += ( x );                \
            {                                         \
                static int pcnt;                      \
@@ -200,7 +200,7 @@ enum instructions
#define LOGIC( x )                                    \
    {                                                 \
        {                                             \
            ops_cnt_wmc += ( _LOGIC_C * ( x ) );          \
            ops_cnt += ( _LOGIC_C * ( x ) );          \
            inst_cnt[_LOGIC] += ( x );                \
            {                                         \
                static int pcnt;                      \
@@ -215,7 +215,7 @@ enum instructions
#define SHIFT( x )                                    \
    {                                                 \
        {                                             \
            ops_cnt_wmc += ( _SHIFT_C * ( x ) );          \
            ops_cnt += ( _SHIFT_C * ( x ) );          \
            inst_cnt[_SHIFT] += ( x );                \
            {                                         \
                static int pcnt;                      \
@@ -230,7 +230,7 @@ enum instructions
#define BRANCH( x )                                    \
    {                                                  \
        {                                              \
            ops_cnt_wmc += ( _BRANCH_C * ( x ) );          \
            ops_cnt += ( _BRANCH_C * ( x ) );          \
            inst_cnt[_BRANCH] += ( x );                \
            {                                          \
                static int pcnt;                       \
@@ -245,7 +245,7 @@ enum instructions
#define DIV( x )                                    \
    {                                               \
        {                                           \
            ops_cnt_wmc += ( _DIV_C * ( x ) );          \
            ops_cnt += ( _DIV_C * ( x ) );          \
            inst_cnt[_DIV] += ( x );                \
            {                                       \
                static int pcnt;                    \
@@ -260,7 +260,7 @@ enum instructions
#define SQRT( x )                                    \
    {                                                \
        {                                            \
            ops_cnt_wmc += ( _SQRT_C * ( x ) );          \
            ops_cnt += ( _SQRT_C * ( x ) );          \
            inst_cnt[_SQRT] += ( x );                \
            {                                        \
                static int pcnt;                     \
@@ -275,7 +275,7 @@ enum instructions
#define TRANS( x )                                    \
    {                                                 \
        {                                             \
            ops_cnt_wmc += ( _TRANS_C * ( x ) );          \
            ops_cnt += ( _TRANS_C * ( x ) );          \
            inst_cnt[_TRANS] += ( x );                \
            {                                         \
                static int pcnt;                      \
@@ -290,7 +290,7 @@ enum instructions
#define LOOP( x )                                    \
    {                                                \
        {                                            \
            ops_cnt_wmc += ( _LOOP_C * ( x ) );          \
            ops_cnt += ( _LOOP_C * ( x ) );          \
            inst_cnt[_LOOP] += ( x );                \
            {                                        \
                static int pcnt;                     \
@@ -305,7 +305,7 @@ enum instructions
#define INDIRECT( x )                                    \
    {                                                    \
        {                                                \
            ops_cnt_wmc += ( _INDIRECT_C * ( x ) );          \
            ops_cnt += ( _INDIRECT_C * ( x ) );          \
            inst_cnt[_INDIRECT] += ( x );                \
            {                                            \
                static int pcnt;                         \
@@ -320,7 +320,7 @@ enum instructions
#define PTR_INIT( x )                                    \
    {                                                    \
        {                                                \
            ops_cnt_wmc += ( _PTR_INIT_C * ( x ) );          \
            ops_cnt += ( _PTR_INIT_C * ( x ) );          \
            inst_cnt[_PTR_INIT] += ( x );                \
            {                                            \
                static int pcnt;                         \
@@ -335,7 +335,7 @@ enum instructions
#define TEST( x )                                    \
    {                                                \
        {                                            \
            ops_cnt_wmc += ( _TEST_C * ( x ) );          \
            ops_cnt += ( _TEST_C * ( x ) );          \
            inst_cnt[_TEST] += ( x );                \
            {                                        \
                static int pcnt;                     \
@@ -350,7 +350,7 @@ enum instructions
#define POWER( x )                                    \
    {                                                 \
        {                                             \
            ops_cnt_wmc += ( _POWER_C * ( x ) );          \
            ops_cnt += ( _POWER_C * ( x ) );          \
            inst_cnt[_POWER] += ( x );                \
            {                                         \
                static int pcnt;                      \
@@ -365,7 +365,7 @@ enum instructions
#define LOG( x )                                    \
    {                                               \
        {                                           \
            ops_cnt_wmc += ( _LOG_C * ( x ) );          \
            ops_cnt += ( _LOG_C * ( x ) );          \
            inst_cnt[_LOG] += ( x );                \
            {                                       \
                static int pcnt;                    \
@@ -380,7 +380,7 @@ enum instructions
#define MISC( x )                                    \
    {                                                \
        {                                            \
            ops_cnt_wmc += ( _MISC_C * ( x ) );          \
            ops_cnt += ( _MISC_C * ( x ) );          \
            inst_cnt[_MISC] += ( x );                \
            {                                        \
                static int pcnt;                     \
@@ -396,7 +396,7 @@ enum instructions
#define FUNC( x )                                              \
    {                                                          \
        {                                                      \
            ops_cnt_wmc += ( _FUNC_C + _MOVE_C * ( x ) );          \
            ops_cnt += ( _FUNC_C + _MOVE_C * ( x ) );          \
            inst_cnt[_FUNC]++;                                 \
            inst_cnt[_MOVE] += ( x );                          \
            {                                                  \
@@ -413,7 +413,7 @@ enum instructions
#define DADD( x )                                   \
    {                                               \
        {                                           \
            ops_cnt_wmc += ( 2 * _ADD_C * ( x ) );      \
            ops_cnt += ( 2 * _ADD_C * ( x ) );      \
            inst_cnt[_ADD] += ( x );                \
            {                                       \
                static int pcnt;                    \
@@ -428,7 +428,7 @@ enum instructions
#define DMULT( x )                                   \
    {                                                \
        {                                            \
            ops_cnt_wmc += ( 2 * _MULT_C * ( x ) );      \
            ops_cnt += ( 2 * _MULT_C * ( x ) );      \
            inst_cnt[_MULT] += ( x );                \
            {                                        \
                static int pcnt;                     \
@@ -443,7 +443,7 @@ enum instructions
#define DMAC( x )                                   \
    {                                               \
        {                                           \
            ops_cnt_wmc += ( 2 * _MAC_C * ( x ) );      \
            ops_cnt += ( 2 * _MAC_C * ( x ) );      \
            inst_cnt[_MAC] += ( x );                \
            {                                       \
                static int pcnt;                    \
@@ -458,7 +458,7 @@ enum instructions
#define DMOVE( x )                                   \
    {                                                \
        {                                            \
            ops_cnt_wmc += ( 2 * _MOVE_C * ( x ) );      \
            ops_cnt += ( 2 * _MOVE_C * ( x ) );      \
            inst_cnt[_MOVE] += ( x );                \
            {                                        \
                static int pcnt;                     \
@@ -473,7 +473,7 @@ enum instructions
#define DSTORE( x )                                   \
    {                                                 \
        {                                             \
            ops_cnt_wmc += ( 2 * _STORE_C * ( x ) );      \
            ops_cnt += ( 2 * _STORE_C * ( x ) );      \
            inst_cnt[_STORE] += ( x );                \
            {                                         \
                static int pcnt;                      \
@@ -488,7 +488,7 @@ enum instructions
#define DLOGIC( x )                                   \
    {                                                 \
        {                                             \
            ops_cnt_wmc += ( 2 * _LOGIC_C * ( x ) );      \
            ops_cnt += ( 2 * _LOGIC_C * ( x ) );      \
            inst_cnt[_LOGIC] += ( x );                \
            {                                         \
                static int pcnt;                      \
@@ -503,7 +503,7 @@ enum instructions
#define DSHIFT( x )                                   \
    {                                                 \
        {                                             \
            ops_cnt_wmc += ( 2 * _SHIFT_C * ( x ) );      \
            ops_cnt += ( 2 * _SHIFT_C * ( x ) );      \
            inst_cnt[_SHIFT] += ( x );                \
            {                                         \
                static int pcnt;                      \
@@ -518,7 +518,7 @@ enum instructions
#define DDIV( x )                                   \
    {                                               \
        {                                           \
            ops_cnt_wmc += ( 2 * _DIV_C * ( x ) );      \
            ops_cnt += ( 2 * _DIV_C * ( x ) );      \
            inst_cnt[_DIV] += ( x );                \
            {                                       \
                static int pcnt;                    \
@@ -533,7 +533,7 @@ enum instructions
#define DSQRT( x )                                   \
    {                                                \
        {                                            \
            ops_cnt_wmc += ( 2 * _SQRT_C * ( x ) );      \
            ops_cnt += ( 2 * _SQRT_C * ( x ) );      \
            inst_cnt[_SQRT] += ( x );                \
            {                                        \
                static int pcnt;                     \
@@ -548,7 +548,7 @@ enum instructions
#define DTRANS( x )                                   \
    {                                                 \
        {                                             \
            ops_cnt_wmc += ( 2 * _TRANS_C * ( x ) );      \
            ops_cnt += ( 2 * _TRANS_C * ( x ) );      \
            inst_cnt[_TRANS] += ( x );                \
            {                                         \
                static int pcnt;                      \
@@ -561,7 +561,7 @@ enum instructions
        }                                             \
    }

extern double ops_cnt_wmc;
extern double ops_cnt;
extern double prom_cnt_wmc;
extern double inst_cnt[NUM_INST];

@@ -640,8 +640,8 @@ extern int cntr_push_pop;

#else

/* '*ops_cnt_ptr' is Used to Avoid: "warning: operation on 'ops_cnt_wmc' may be undefined" with Cygwin gcc Compiler */
static double *ops_cnt_ptr = &ops_cnt_wmc;
/* '*ops_cnt_ptr' is Used to Avoid: "warning: operation on 'ops_cnt' may be undefined" with Cygwin gcc Compiler */
static double *ops_cnt_ptr = &ops_cnt;
#define OP_COUNT_( op, x )            ( *ops_cnt_ptr += ( op##_C * ( x ) ), inst_cnt[op] += ( x ) )

/******************************************************************/
@@ -1305,14 +1305,6 @@ extern int funcId_where_last_call_to_else_occurred;
extern long funcid_total_wmops_at_last_call_to_else;
extern int call_occurred;

#define MAX_FUNCTION_NAME_LENGTH     200 /* Maximum length of the function name */
#define MAX_PARAMS_LENGTH            200 /* Maximum length of the function parameter string */
#define MAX_NUM_RECORDS              300 /* Initial maximum number of records -> might be increased during runtime, if needed */
#define MAX_NUM_RECORDS_REALLOC_STEP 50  /* When re-allocating the list of records, increase the number of records by this number */
#define MAX_CALL_TREE_DEPTH          100 /* maximum depth of the function call tree */
#define DOUBLE_MAX                   0x80000000
#define FAC                          ( FRAMES_PER_SECOND / 1e6 )

long TotalWeightedOperation( void );
long DeltaWeightedOperation( void );