Loading lib_com/count.c +45 −50 Original line number Diff line number Diff line Loading @@ -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 */ Loading Loading @@ -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 ); Loading @@ -334,7 +335,7 @@ int getCounterId( const char *objectNameArg ) } #if WMOPS #ifdef WMOPS int readCounterId() { return currCounter; Loading @@ -351,7 +352,7 @@ char *readCounterIdName() void setCounter( int counterId ) { #if WMOPS #ifdef WMOPS if ( ( counterId > maxCounter ) || ( counterId < 0 ) ) { currCounter = 0; Loading @@ -367,7 +368,7 @@ void setCounter( int counterId ) void incrementNbTimeObjectIsCalled( int counterId ) { #if WMOPS #ifdef WMOPS if ( ( counterId > maxCounter ) || ( counterId < 0 ) ) { nbTimeObjectIsCalled[0]++; Loading @@ -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 Loading Loading @@ -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++ ) Loading @@ -444,7 +445,7 @@ void ClearNbTimeObjectsAreCalled() Word32 TotalWeightedOperation() { #if WMOPS #ifdef WMOPS Word16 i; Word32 tot, *ptr; const Word32 *ptr2; Loading @@ -467,7 +468,7 @@ Word32 TotalWeightedOperation() Word32 DeltaWeightedOperation() { #if WMOPS #ifdef WMOPS Word32 NewWOper, delta; NewWOper = TotalWeightedOperation(); Loading @@ -484,7 +485,7 @@ Word32 DeltaWeightedOperation() void Init_WMOPS_counter( void ) { #if WMOPS #ifdef WMOPS Word16 i; /* reset function weight operation counter variable */ Loading Loading @@ -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 */ Loading Loading @@ -557,7 +558,7 @@ Word32 Reset_WMOPS_counter( void ) Word32 fwc( void ) { /* function worst case */ #if WMOPS #ifdef WMOPS Word32 tot; tot = DeltaWeightedOperation(); Loading @@ -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; Loading Loading @@ -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; Loading Loading @@ -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; Loading Loading @@ -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; Loading Loading @@ -930,7 +926,7 @@ void BASOP_frame_update( void ) void printStack( char *text, char *Id ) { #if WMOPS #ifdef WMOPS int i; if ( !Id ) return; Loading @@ -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; Loading Loading @@ -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 Loading Loading @@ -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 */ Loading @@ -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; Loading Loading @@ -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; Loading Loading @@ -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; Loading @@ -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 ) Loading @@ -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; } Loading
lib_com/count.c +45 −50 Original line number Diff line number Diff line Loading @@ -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 */ Loading Loading @@ -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 ); Loading @@ -334,7 +335,7 @@ int getCounterId( const char *objectNameArg ) } #if WMOPS #ifdef WMOPS int readCounterId() { return currCounter; Loading @@ -351,7 +352,7 @@ char *readCounterIdName() void setCounter( int counterId ) { #if WMOPS #ifdef WMOPS if ( ( counterId > maxCounter ) || ( counterId < 0 ) ) { currCounter = 0; Loading @@ -367,7 +368,7 @@ void setCounter( int counterId ) void incrementNbTimeObjectIsCalled( int counterId ) { #if WMOPS #ifdef WMOPS if ( ( counterId > maxCounter ) || ( counterId < 0 ) ) { nbTimeObjectIsCalled[0]++; Loading @@ -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 Loading Loading @@ -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++ ) Loading @@ -444,7 +445,7 @@ void ClearNbTimeObjectsAreCalled() Word32 TotalWeightedOperation() { #if WMOPS #ifdef WMOPS Word16 i; Word32 tot, *ptr; const Word32 *ptr2; Loading @@ -467,7 +468,7 @@ Word32 TotalWeightedOperation() Word32 DeltaWeightedOperation() { #if WMOPS #ifdef WMOPS Word32 NewWOper, delta; NewWOper = TotalWeightedOperation(); Loading @@ -484,7 +485,7 @@ Word32 DeltaWeightedOperation() void Init_WMOPS_counter( void ) { #if WMOPS #ifdef WMOPS Word16 i; /* reset function weight operation counter variable */ Loading Loading @@ -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 */ Loading Loading @@ -557,7 +558,7 @@ Word32 Reset_WMOPS_counter( void ) Word32 fwc( void ) { /* function worst case */ #if WMOPS #ifdef WMOPS Word32 tot; tot = DeltaWeightedOperation(); Loading @@ -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; Loading Loading @@ -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; Loading Loading @@ -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; Loading Loading @@ -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; Loading Loading @@ -930,7 +926,7 @@ void BASOP_frame_update( void ) void printStack( char *text, char *Id ) { #if WMOPS #ifdef WMOPS int i; if ( !Id ) return; Loading @@ -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; Loading Loading @@ -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 Loading Loading @@ -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 */ Loading @@ -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; Loading Loading @@ -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; Loading Loading @@ -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; Loading @@ -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 ) Loading @@ -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; }