Commit 7b84b1dd authored by malenov's avatar malenov
Browse files

cleanup

parent 8f24108a
Loading
Loading
Loading
Loading
+45 −50
Original line number Diff line number Diff line
@@ -58,28 +58,29 @@ static double frameRate = FRAME_RATE; /* default value : 10 ms */
#define MAX_STACK   64
#define MAX_CHAR    64

struct wmops_record
{
    char label[MAX_CHAR];
    long call_number;
    long update_cnt;
    int call_tree[MAX_RECORDS];
    double start_selfcnt;
    double current_selfcnt;
    double max_selfcnt;
    double min_selfcnt;
    double tot_selfcnt;
    double start_cnt; /* The following take into account the decendants */
    double current_cnt;
    double max_cnt;
    double min_cnt;
    double tot_cnt;
};

static struct wmops_record wmops[MAX_RECORDS];
//struct wmops_record
//{
//    char label[MAX_CHAR];
//    long call_number;
//    long update_cnt;
//    int call_tree[MAX_RECORDS];
//    double start_selfcnt;
//    double current_selfcnt;
//    double max_selfcnt;
//    double min_selfcnt;
//    double tot_selfcnt;
//    double start_cnt; /* The following take into account the decendants */
//    double current_cnt;
//    double max_cnt;
//    double min_cnt;
//    double tot_cnt;
//};
//
//static struct wmops_record wmops[MAX_RECORDS];

static int stack[MAX_STACK];
static int sptr;
static int sum_stack[MAX_STACK];

/* Global counter variable for calculation of complexity weight */
/* Some enhancement written by Vail., GJR and M.Mul. during EVS time */
@@ -320,7 +321,7 @@ static char *my_strdup( const char *s )

int getCounterId( const char *objectNameArg )
{
#if WMOPS
#ifdef WMOPS
    if ( maxCounter >= MAXCOUNTERS - 1 )
        return 0;
    objectName[++maxCounter] = my_strdup( objectNameArg );
@@ -334,7 +335,7 @@ int getCounterId( const char *objectNameArg )
}


#if WMOPS
#ifdef WMOPS
int readCounterId()
{
    return currCounter;
@@ -351,7 +352,7 @@ char *readCounterIdName()

void setCounter( int counterId )
{
#if WMOPS
#ifdef WMOPS
    if ( ( counterId > maxCounter ) || ( counterId < 0 ) )
    {
        currCounter = 0;
@@ -367,7 +368,7 @@ void setCounter( int counterId )

void incrementNbTimeObjectIsCalled( int counterId )
{
#if WMOPS
#ifdef WMOPS
    if ( ( counterId > maxCounter ) || ( counterId < 0 ) )
    {
        nbTimeObjectIsCalled[0]++;
@@ -380,7 +381,7 @@ void incrementNbTimeObjectIsCalled( int counterId )
}


#if WMOPS
#ifdef WMOPS
static Word32 WMOPS_frameStat( void )
{
    /* calculate the WMOPS seen so far and update the global
@@ -432,7 +433,7 @@ static void WMOPS_clearMultiCounter( void )

void ClearNbTimeObjectsAreCalled()
{
#if WMOPS
#ifdef WMOPS
    Word16 i;

    for ( i = 0; i < (Word16) ( sizeof( multiCounter[currCounter] ) / sizeof( Word32 ) ); i++ )
@@ -444,7 +445,7 @@ void ClearNbTimeObjectsAreCalled()

Word32 TotalWeightedOperation()
{
#if WMOPS
#ifdef WMOPS
    Word16 i;
    Word32 tot, *ptr;
    const Word32 *ptr2;
@@ -467,7 +468,7 @@ Word32 TotalWeightedOperation()

Word32 DeltaWeightedOperation()
{
#if WMOPS
#ifdef WMOPS
    Word32 NewWOper, delta;

    NewWOper = TotalWeightedOperation();
@@ -484,7 +485,7 @@ Word32 DeltaWeightedOperation()

void Init_WMOPS_counter( void )
{
#if WMOPS
#ifdef WMOPS
    Word16 i;

    /* reset function weight operation counter variable */
@@ -529,7 +530,7 @@ void Init_WMOPS_counter( void )

Word32 Reset_WMOPS_counter( void )
{
#if WMOPS
#ifdef WMOPS
    Word32 tot = WMOPS_frameStat();

    /* increase the frame counter --> a frame is counted WHEN IT BEGINS */
@@ -557,7 +558,7 @@ Word32 Reset_WMOPS_counter( void )
Word32 fwc( void )
{
/* function worst case */
#if WMOPS
#ifdef WMOPS
    Word32 tot;

    tot = DeltaWeightedOperation();
@@ -583,7 +584,7 @@ Word32 fwc( void )

void WMOPS_output( Word16 dtx_mode )
{
#if WMOPS
#ifdef WMOPS
    Word16 i;
    Word32 tot, tot_wm, tot_wc;

@@ -618,7 +619,7 @@ void WMOPS_output( Word16 dtx_mode )

void WMOPS_output_avg( Word16 dtx_mode, Word32 *tot_wm, Word32 *num_frames )
{
#if WMOPS
#ifdef WMOPS
    Word16 i;
    Word32 tot, tot_wc;

@@ -654,7 +655,7 @@ void WMOPS_output_avg( Word16 dtx_mode, Word32 *tot_wm, Word32 *num_frames )

void generic_WMOPS_output( Word16 dtx_mode, char *test_file_name )
{
#if WMOPS
#ifdef WMOPS
    int saved_value;
    Word16 i;
    Word32 tot, tot_wm, tot_wc, *ptr;
@@ -800,17 +801,12 @@ void generic_WMOPS_output( Word16 dtx_mode, char *test_file_name )
}
/* FROM_EVS_DEV */

#define MAX_STACK 64
#if WMOPS
static int stack[MAX_STACK];
static int sptr;
static int sum_stack[MAX_STACK];
#endif


/* jdr 20120117: add FLC similar functions */
void BASOP_frame_update( void )
{
#if WMOPS
#ifdef WMOPS
    int i, current;
#if MAX_CALLERS_SAVED_FRAMES
    int k;
@@ -930,7 +926,7 @@ void BASOP_frame_update( void )

void printStack( char *text, char *Id )
{
#if WMOPS
#ifdef WMOPS
    int i;
    if ( !Id )
        return;
@@ -950,7 +946,7 @@ void printStack( char *text, char *Id )

void BASOP_push_wmops( const char *label )
{
#if WMOPS
#ifdef WMOPS
    int new_flag, prev_counter;
    int i, j;

@@ -1027,7 +1023,7 @@ void BASOP_push_wmops( const char *label )

Word32 BASOP_pop_wmops( void )
{
#if WMOPS
#ifdef WMOPS
    Word32 ops_cnt;

#ifdef DEBUG_COUNTER
@@ -1074,13 +1070,13 @@ Word32 BASOP_get_wops( void )
}


#if WMOPS
#ifdef WMOPS
static Word32 prom_cnt = 0;
#endif

void WMOPS_destroy( void )
{
#if WMOPS
#ifdef WMOPS
    int i;

    /* release the memory allocated for the objectName array */
@@ -1102,7 +1098,7 @@ void WMOPS_destroy( void )

void WMOPS_output_all( Word16 dtx_mode )
{
#if WMOPS
#ifdef WMOPS
    float ops_cnt = 0.0f;
    int i;

@@ -1256,7 +1252,7 @@ void WMOPS_output_all( Word16 dtx_mode )
}
void WMOPS_output_all_std( Word16 dtx_mode )
{
#if WMOPS
#ifdef WMOPS
    float ops_cnt = 0.0f;
    int i;

@@ -1358,7 +1354,7 @@ void WMOPS_output_all_std( Word16 dtx_mode )

void Reset_all_WMOPS_counter( void )
{
#if WMOPS
#ifdef WMOPS
    int i;
    int currCounterSave;

@@ -1379,7 +1375,7 @@ void Reset_all_WMOPS_counter( void )
/* Returns the total min/max/avg WMOPS values like printed in BASOP_end(). */
void BASOP_get_total_wmops( double *min, double *max, double *avg )
{
#if WMOPS
#ifdef WMOPS
    if ( min != NULL )
        *min = frameRate * glob_bc[0];
    if ( max != NULL )
@@ -1399,4 +1395,3 @@ void BASOP_get_total_wmops( double *min, double *max, double *avg )
}
/* end of file */
#undef WMC_TOOL_SKIP
/*AddedByWMC_Tool*/ int PROM_Size_Func( count ) { return 131; }