Commit a36bbe45 authored by malenov's avatar malenov
Browse files

update to WMC tool v1.6

parent 7b797379
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -30,8 +30,9 @@

*******************************************************************************************************/

#include "lib_enc.h"
#include <string.h>
#include "options.h"
#include "lib_enc.h"
#include "cmdl_tools.h"
#include "audio_file_reader.h"
#include "bitstream_writer.h"
@@ -39,8 +40,6 @@
#include "jbm_file_reader.h"
#include "masa_file_reader.h"
#include "wmc_auto.h"
#include "options.h"
#include "stl.h"


#define WMC_TOOL_SKIP
+5 −0
Original line number Diff line number Diff line
@@ -35,6 +35,11 @@

#include "stl.h"


int funcId_where_last_call_to_else_occurred;
long funcid_total_wmops_at_last_call_to_else;
int call_occurred;

/*****************************************************************************
 *
 *  Function Name : FOR
+1 −1
Original line number Diff line number Diff line
@@ -445,7 +445,7 @@ void Init_WMOPS_counter( void )
    total_sum[currCounter] = 0.0;

    /* initially clear all counters */
    WMOPS_clearMultiCounter();
    //WMOPS_clearMultiCounter();
    LastWOper[currCounter] = 0;
    funcid[currCounter] = 0;

+23 −23
Original line number Diff line number Diff line
@@ -131,8 +131,6 @@ void reset_wmops( void )
        exit( -1 );
    }

    BASOP_init

    /* initilize the list of WMOPS records */
    /* initilize the BASOP WMOPS counters */
    for ( i = 0; i < max_num_wmops_records; i++ )
@@ -190,8 +188,10 @@ void reset_wmops( void )
    }

    /* initialize auxiliary BASOP WMOPS variables */
    //call_occurred = 1;
    //funcId_where_last_call_to_else_occurred = INT_MAX;
    call_occurred_wmc = 1;
    funcId_where_last_call_to_else_occurred_wmc = INT_MAX;

    BASOP_init

    return;
}
@@ -316,7 +316,7 @@ void push_wmops_fct( const char *label, ... )
#endif

    /* set the ID of BASOP functions counters */
    //Set_BASOP_WMOPS_counter( index_record );
    Set_BASOP_WMOPS_counter( index_record );

    BASOP_push_wmops( func_name );

@@ -350,7 +350,7 @@ void pop_wmops( void )
        wmops[current_record].start_selfcnt = ops_cnt_wmc;

        /* set the ID of the previous BASOP counter */
        //Set_BASOP_WMOPS_counter( current_record );
        Set_BASOP_WMOPS_counter( current_record );
    }
    else
    {
@@ -451,8 +451,8 @@ void update_wmops( void )
#endif

        /* update the WC of all BASOP counters */
        //Set_BASOP_WMOPS_counter( i );
        //Reset_BASOP_WMOPS_counter();
        Set_BASOP_WMOPS_counter( i );
        Reset_BASOP_WMOPS_counter();
    }

    current_cnt = ops_cnt_wmc - start_cnt;
@@ -2137,9 +2137,9 @@ int cntr_push_pop = 0; /* global counter for checking balanced push_wmops()/pop_
/* Global counter for the calculation of BASOP complexity */
BASIC_OP *multiCounter = NULL;
int currCounter = 0;
int funcId_where_last_call_to_else_occurred;
long funcid_total_wmops_at_last_call_to_else;
int call_occurred = 1;
int funcId_where_last_call_to_else_occurred_wmc;
long funcid_total_wmops_at_last_call_to_else_wmc;
int call_occurred_wmc = 1;

const BASIC_OP op_weight = {
    1, 1, 1, 1, 1,
@@ -2195,13 +2195,13 @@ const BASIC_OP op_weight = {
/* Set the counter group to use, default is zero */
void Set_BASOP_WMOPS_counter( int counterId )
{
    if ( ( counterId > num_wmops_records ) || ( counterId < 0 ) )
    {
        currCounter = 0;
        return;
    }
    currCounter = counterId;
    call_occurred = 1;
    //if ( ( counterId > num_wmops_records ) || ( counterId < 0 ) )
    //{
    //    currCounter = 0;
    //    return;
    //}
    //currCounter = counterId;
    call_occurred_wmc = 1;
}

/* Resets the current BASOP WMOPS counter */
@@ -2211,11 +2211,11 @@ void Reset_BASOP_WMOPS_counter( void )
    long *ptr;

    /* clear the current BASOP operation counter before new frame begins */
    ptr = (long *) &multiCounter[currCounter];
    for ( i = 0; i < (int) ( sizeof( multiCounter[currCounter] ) / sizeof( long ) ); i++ )
    {
        *ptr++ = 0;
    }
    //ptr = (long *) &multiCounter[currCounter];
    //for ( i = 0; i < (int) ( sizeof( multiCounter[currCounter] ) / sizeof( long ) ); i++ )
    //{
    //    *ptr++ = 0;
    //}

    wmops[currCounter].LastWOper = 0;

+3 −3
Original line number Diff line number Diff line
@@ -1330,9 +1330,9 @@ extern int currCounter;
   *   }
   */
    
extern int funcId_where_last_call_to_else_occurred;
extern long funcid_total_wmops_at_last_call_to_else;
extern int call_occurred;
extern int funcId_where_last_call_to_else_occurred_wmc;
extern long funcid_total_wmops_at_last_call_to_else_wmc;
extern int call_occurred_wmc;

extern const BASIC_OP op_weight;

Loading