Loading apps/decoder.c +0 −3 Original line number Diff line number Diff line Loading @@ -2525,9 +2525,6 @@ static ivas_error decodeG192( { update_wmops(); update_mem(); #ifdef MEM_COUNT_DETAILS export_mem( "mem_analysis.csv" ); #endif } #endif } Loading lib_com/options.h +2 −0 Original line number Diff line number Diff line Loading @@ -166,8 +166,10 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ #define NON_BE_1055_RESET_LP_MEMORIES /* VA: issue 1055: Correctly reset LP filter MA and AR memories in bitrate switching */ #define NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM /* FhG: issue 1058: do not initialize EFAP when IntSetup is HOA3 */ /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ Loading lib_debug/wmc_auto.c +74 −25 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ #include <stdlib.h> #include <string.h> #include <stdint.h> #include <stdarg.h> #include <sys/stat.h> #ifndef _MSC_VER Loading @@ -36,9 +37,9 @@ * Complexity counting tool *--------------------------------------------------------------------*/ #define MAX_FUNCTION_NAME_LENGTH 50 /* Maximum length of the function name */ #define MAX_PARAMS_LENGTH 50 /* Maximum length of the function parameter string */ #define MAX_NUM_RECORDS 300 /* Initial maximum number of records -> mightb be increased during runtime, if needed */ #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 Loading Loading @@ -125,7 +126,7 @@ void reset_wmops( void ) exit( -1 ); } /* initilize the list of wmops records */ /* initilize the list of WMOPS records */ /* initilize the BASOP WMOPS counters */ for ( i = 0; i < max_num_wmops_records; i++ ) { Loading Loading @@ -188,35 +189,84 @@ void reset_wmops( void ) return; } void push_wmops( const char *label ) void push_wmops_fct( const char *label, ... ) { int new_flag; int i, j; int i, j, index_record; unsigned int *ptr; va_list arg; char func_name[MAX_FUNCTION_NAME_LENGTH] = ""; /* concatenate all function name labels into a single string */ va_start( arg, label ); while ( label ) { strcat( func_name, label ); label = va_arg( arg, const char * ); } va_end( arg ); /* Check, if this is a new function label */ new_flag = 1; for ( i = 0; i < num_wmops_records; i++ ) { if ( strcmp( wmops[i].label, label ) == 0 ) if ( strcmp( wmops[i].label, func_name ) == 0 ) { new_flag = 0; break; } } index_record = i; /* Create a new record in the list */ if ( new_flag ) { if ( num_wmops_records >= max_num_wmops_records ) { /* There is no room for a new wmops record -> reallocate the list */ /* There is no room for a new WMOPS record -> reallocate the list */ max_num_wmops_records += MAX_NUM_RECORDS_REALLOC_STEP; wmops = realloc( wmops, max_num_wmops_records * sizeof( wmops_record ) ); multiCounter = realloc( multiCounter, max_num_wmops_records * sizeof( BASIC_OP ) ); /* initilize newly created WMOPS records */ for ( i = num_wmops_records; i < max_num_wmops_records; i++ ) { strcpy( &wmops[i].label[0], "\0" ); wmops[i].call_number = 0; wmops[i].update_cnt = 0; for ( j = 0; j < MAX_CALL_TREE_DEPTH; j++ ) { wmops[i].call_tree[j] = -1; } wmops[i].start_selfcnt = 0.0; wmops[i].current_selfcnt = 0.0; wmops[i].max_selfcnt = 0.0; wmops[i].min_selfcnt = DOUBLE_MAX; wmops[i].tot_selfcnt = 0.0; wmops[i].start_cnt = 0.0; wmops[i].current_cnt = 0.0; wmops[i].max_cnt = 0.0; wmops[i].min_cnt = DOUBLE_MAX; wmops[i].tot_cnt = 0.0; #ifdef WMOPS_WC_FRAME_ANALYSIS wmops[i].wc_cnt = 0.0; wmops[i].wc_selfcnt = 0.0; wmops[i].current_call_number = 0; wmops[i].wc_call_number = -1; #endif /* initialize BASOP WMOPS counters */ ptr = (unsigned int *) &multiCounter[i]; for ( j = 0; j < (int) ( sizeof( BASIC_OP ) / sizeof( unsigned int ) ); j++ ) { *ptr++ = 0; } wmops[i].LastWOper = 0; } strcpy( wmops[i].label, label ); } strcpy( wmops[index_record].label, func_name ); num_wmops_records++; } Loading @@ -238,29 +288,29 @@ void push_wmops( const char *label ) /* update call tree */ for ( j = 0; j < MAX_CALL_TREE_DEPTH; j++ ) { if ( wmops[i].call_tree[j] == current_record ) if ( wmops[index_record].call_tree[j] == current_record ) { break; } else if ( wmops[i].call_tree[j] == -1 ) else if ( wmops[index_record].call_tree[j] == -1 ) { wmops[i].call_tree[j] = current_record; wmops[index_record].call_tree[j] = current_record; break; } } } /* update the current context info */ current_record = i; wmops[current_record].start_selfcnt = ops_cnt; wmops[current_record].start_cnt = ops_cnt; wmops[current_record].call_number++; current_record = index_record; 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[current_record].current_call_number++; wmops[index_record].current_call_number++; #endif /* set the ID of BASOP functions counters */ Set_BASOP_WMOPS_counter( current_record ); Set_BASOP_WMOPS_counter( index_record ); return; } Loading Loading @@ -1097,7 +1147,7 @@ void *mem_alloc( #ifdef MEM_COUNT_DETAILS /* Export heap memory allocation record to the .csv file */ fprintf( fid_csv_filename, "A,%d,%s,%d,%d\n", update_cnt, ptr_record->name, ptr_record->lineno, ptr_record->block_size ); fprintf( fid_csv_filename, "A,%ld,%s,%d,%d\n", update_cnt, ptr_record->name, ptr_record->lineno, ptr_record->block_size ); #endif if ( ptr_record->frame_allocated != -1 ) Loading Loading @@ -1395,8 +1445,8 @@ allocator_record *get_mem_record( unsigned long *hash, const char *func_name, in /*-------------------------------------------------------------------* * mem_free() * * This function de-allocatesd the memory block and frees the mphysical memory with free(). * It also updates actual and average usage of the memory block. * This function de-allocates memory blocks and frees physical memory with free(). * It also updates the actual and average usage of memory blocks. * * Note: The record is not removed from the list and may be reused later on in mem_alloc()! *--------------------------------------------------------------------*/ Loading Loading @@ -1437,7 +1487,7 @@ void mem_free( const char *func_name, int func_lineno, void *ptr ) #ifdef MEM_COUNT_DETAILS /* Export heap memory de-allocation record to the .csv file */ fprintf( fid_csv_filename, "D,%d,%s,%d,%d\n", update_cnt, ptr_record->name, ptr_record->lineno, ptr_record->block_size ); fprintf( fid_csv_filename, "D,%ld,%s,%d,%d\n", update_cnt, ptr_record->name, ptr_record->lineno, ptr_record->block_size ); #endif /* De-Allocate Memory Block */ Loading Loading @@ -1697,7 +1747,7 @@ static void mem_count_summary( void ) allocator_record *ptr_record, *ptr; /* Prepare format string */ sprintf( format_str, "%%-%ds %%5s %%6s %%-%ds %%20s %%6s ", MAX_FUNCTION_NAME_LENGTH, MAX_PARAMS_LENGTH ); sprintf( format_str, "%%-%d.%ds %%5.5s %%6.6s %%-%d.%ds %%20.20s %%6.6s ", 50, 50, 50, 50 ); if ( n_items_wc_intra_frame_heap > 0 ) { Loading Loading @@ -2169,4 +2219,3 @@ void Reset_BASOP_WMOPS_counter( void ) #endif lib_debug/wmc_auto.h +7 −7 Original line number Diff line number Diff line Loading @@ -563,7 +563,8 @@ extern double prom_cnt; extern double inst_cnt[NUM_INST]; void reset_wmops( void ); void push_wmops( const char *label ); #define push_wmops( ... ) push_wmops_fct( __VA_ARGS__, NULL ) void push_wmops_fct( const char *label, ... ); void pop_wmops( void ); void update_wmops( void ); void update_mem( void ); Loading Loading @@ -1019,11 +1020,11 @@ int push_stack( const char *filename, const char *fctname ); int pop_stack( const char *filename, const char *fctname ); #ifdef WMOPS_DETAIL #define STACK_DEPTH_FCT_CALL ( push_wmops( __FUNCTION__ " [WMC_AUTO]" ), push_stack( __FILE__, __FUNCTION__ ) ) /* add push_wmops() in all function calls */ #define STACK_DEPTH_FCT_RETURN ( pop_wmops(), pop_stack( __FILE__, __FUNCTION__ ) ) /* add pop_wmops() in all function returns */ #define STACK_DEPTH_FCT_CALL ( push_wmops( __func__, "[WMC_AUTO]" ), push_stack( __FILE__, __func__ ) ) /* add push_wmops() in all function calls */ #define STACK_DEPTH_FCT_RETURN ( pop_wmops(), pop_stack( __FILE__, __func__ ) ) /* add pop_wmops() in all function returns */ #else #define STACK_DEPTH_FCT_CALL push_stack( __FILE__, __FUNCTION__ ) #define STACK_DEPTH_FCT_RETURN pop_stack( __FILE__, __FUNCTION__ ) #define STACK_DEPTH_FCT_RETURN pop_stack( __FILE__, __func__ ) #endif void reset_stack( void ); Loading Loading @@ -1445,4 +1446,3 @@ static __inline void incrGoto( void) { #endif /* WMOPS_H */ lib_dec/updt_dec.c +4 −0 Original line number Diff line number Diff line Loading @@ -521,7 +521,11 @@ void updt_dec_common( st->stab_fac_smooth_lt = ENV_SMOOTH_FAC * st->stab_fac + ( 1.0f - ENV_SMOOTH_FAC ) * st->stab_fac_smooth_lt; } #ifdef NON_BE_1055_RESET_LP_MEMORIES if ( ( st->core_brate <= SID_2k40 && st->cng_type == FD_CNG ) || ( st->tcxonly && ( st->codec_mode == MODE2 || st->element_mode > EVS_MONO ) ) ) #else if ( ( st->core_brate <= SID_2k40 && st->cng_type == FD_CNG ) || ( st->tcxonly && st->codec_mode == MODE2 ) ) #endif { /* reset LP memories */ set_zero( st->mem_MA, M ); Loading Loading
apps/decoder.c +0 −3 Original line number Diff line number Diff line Loading @@ -2525,9 +2525,6 @@ static ivas_error decodeG192( { update_wmops(); update_mem(); #ifdef MEM_COUNT_DETAILS export_mem( "mem_analysis.csv" ); #endif } #endif } Loading
lib_com/options.h +2 −0 Original line number Diff line number Diff line Loading @@ -166,8 +166,10 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ #define NON_BE_1055_RESET_LP_MEMORIES /* VA: issue 1055: Correctly reset LP filter MA and AR memories in bitrate switching */ #define NONBE_FIX_1058_DECODER_ERROR_WITH_REVERB_ROOM /* FhG: issue 1058: do not initialize EFAP when IntSetup is HOA3 */ /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ Loading
lib_debug/wmc_auto.c +74 −25 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ #include <stdlib.h> #include <string.h> #include <stdint.h> #include <stdarg.h> #include <sys/stat.h> #ifndef _MSC_VER Loading @@ -36,9 +37,9 @@ * Complexity counting tool *--------------------------------------------------------------------*/ #define MAX_FUNCTION_NAME_LENGTH 50 /* Maximum length of the function name */ #define MAX_PARAMS_LENGTH 50 /* Maximum length of the function parameter string */ #define MAX_NUM_RECORDS 300 /* Initial maximum number of records -> mightb be increased during runtime, if needed */ #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 Loading Loading @@ -125,7 +126,7 @@ void reset_wmops( void ) exit( -1 ); } /* initilize the list of wmops records */ /* initilize the list of WMOPS records */ /* initilize the BASOP WMOPS counters */ for ( i = 0; i < max_num_wmops_records; i++ ) { Loading Loading @@ -188,35 +189,84 @@ void reset_wmops( void ) return; } void push_wmops( const char *label ) void push_wmops_fct( const char *label, ... ) { int new_flag; int i, j; int i, j, index_record; unsigned int *ptr; va_list arg; char func_name[MAX_FUNCTION_NAME_LENGTH] = ""; /* concatenate all function name labels into a single string */ va_start( arg, label ); while ( label ) { strcat( func_name, label ); label = va_arg( arg, const char * ); } va_end( arg ); /* Check, if this is a new function label */ new_flag = 1; for ( i = 0; i < num_wmops_records; i++ ) { if ( strcmp( wmops[i].label, label ) == 0 ) if ( strcmp( wmops[i].label, func_name ) == 0 ) { new_flag = 0; break; } } index_record = i; /* Create a new record in the list */ if ( new_flag ) { if ( num_wmops_records >= max_num_wmops_records ) { /* There is no room for a new wmops record -> reallocate the list */ /* There is no room for a new WMOPS record -> reallocate the list */ max_num_wmops_records += MAX_NUM_RECORDS_REALLOC_STEP; wmops = realloc( wmops, max_num_wmops_records * sizeof( wmops_record ) ); multiCounter = realloc( multiCounter, max_num_wmops_records * sizeof( BASIC_OP ) ); /* initilize newly created WMOPS records */ for ( i = num_wmops_records; i < max_num_wmops_records; i++ ) { strcpy( &wmops[i].label[0], "\0" ); wmops[i].call_number = 0; wmops[i].update_cnt = 0; for ( j = 0; j < MAX_CALL_TREE_DEPTH; j++ ) { wmops[i].call_tree[j] = -1; } wmops[i].start_selfcnt = 0.0; wmops[i].current_selfcnt = 0.0; wmops[i].max_selfcnt = 0.0; wmops[i].min_selfcnt = DOUBLE_MAX; wmops[i].tot_selfcnt = 0.0; wmops[i].start_cnt = 0.0; wmops[i].current_cnt = 0.0; wmops[i].max_cnt = 0.0; wmops[i].min_cnt = DOUBLE_MAX; wmops[i].tot_cnt = 0.0; #ifdef WMOPS_WC_FRAME_ANALYSIS wmops[i].wc_cnt = 0.0; wmops[i].wc_selfcnt = 0.0; wmops[i].current_call_number = 0; wmops[i].wc_call_number = -1; #endif /* initialize BASOP WMOPS counters */ ptr = (unsigned int *) &multiCounter[i]; for ( j = 0; j < (int) ( sizeof( BASIC_OP ) / sizeof( unsigned int ) ); j++ ) { *ptr++ = 0; } wmops[i].LastWOper = 0; } strcpy( wmops[i].label, label ); } strcpy( wmops[index_record].label, func_name ); num_wmops_records++; } Loading @@ -238,29 +288,29 @@ void push_wmops( const char *label ) /* update call tree */ for ( j = 0; j < MAX_CALL_TREE_DEPTH; j++ ) { if ( wmops[i].call_tree[j] == current_record ) if ( wmops[index_record].call_tree[j] == current_record ) { break; } else if ( wmops[i].call_tree[j] == -1 ) else if ( wmops[index_record].call_tree[j] == -1 ) { wmops[i].call_tree[j] = current_record; wmops[index_record].call_tree[j] = current_record; break; } } } /* update the current context info */ current_record = i; wmops[current_record].start_selfcnt = ops_cnt; wmops[current_record].start_cnt = ops_cnt; wmops[current_record].call_number++; current_record = index_record; 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[current_record].current_call_number++; wmops[index_record].current_call_number++; #endif /* set the ID of BASOP functions counters */ Set_BASOP_WMOPS_counter( current_record ); Set_BASOP_WMOPS_counter( index_record ); return; } Loading Loading @@ -1097,7 +1147,7 @@ void *mem_alloc( #ifdef MEM_COUNT_DETAILS /* Export heap memory allocation record to the .csv file */ fprintf( fid_csv_filename, "A,%d,%s,%d,%d\n", update_cnt, ptr_record->name, ptr_record->lineno, ptr_record->block_size ); fprintf( fid_csv_filename, "A,%ld,%s,%d,%d\n", update_cnt, ptr_record->name, ptr_record->lineno, ptr_record->block_size ); #endif if ( ptr_record->frame_allocated != -1 ) Loading Loading @@ -1395,8 +1445,8 @@ allocator_record *get_mem_record( unsigned long *hash, const char *func_name, in /*-------------------------------------------------------------------* * mem_free() * * This function de-allocatesd the memory block and frees the mphysical memory with free(). * It also updates actual and average usage of the memory block. * This function de-allocates memory blocks and frees physical memory with free(). * It also updates the actual and average usage of memory blocks. * * Note: The record is not removed from the list and may be reused later on in mem_alloc()! *--------------------------------------------------------------------*/ Loading Loading @@ -1437,7 +1487,7 @@ void mem_free( const char *func_name, int func_lineno, void *ptr ) #ifdef MEM_COUNT_DETAILS /* Export heap memory de-allocation record to the .csv file */ fprintf( fid_csv_filename, "D,%d,%s,%d,%d\n", update_cnt, ptr_record->name, ptr_record->lineno, ptr_record->block_size ); fprintf( fid_csv_filename, "D,%ld,%s,%d,%d\n", update_cnt, ptr_record->name, ptr_record->lineno, ptr_record->block_size ); #endif /* De-Allocate Memory Block */ Loading Loading @@ -1697,7 +1747,7 @@ static void mem_count_summary( void ) allocator_record *ptr_record, *ptr; /* Prepare format string */ sprintf( format_str, "%%-%ds %%5s %%6s %%-%ds %%20s %%6s ", MAX_FUNCTION_NAME_LENGTH, MAX_PARAMS_LENGTH ); sprintf( format_str, "%%-%d.%ds %%5.5s %%6.6s %%-%d.%ds %%20.20s %%6.6s ", 50, 50, 50, 50 ); if ( n_items_wc_intra_frame_heap > 0 ) { Loading Loading @@ -2169,4 +2219,3 @@ void Reset_BASOP_WMOPS_counter( void ) #endif
lib_debug/wmc_auto.h +7 −7 Original line number Diff line number Diff line Loading @@ -563,7 +563,8 @@ extern double prom_cnt; extern double inst_cnt[NUM_INST]; void reset_wmops( void ); void push_wmops( const char *label ); #define push_wmops( ... ) push_wmops_fct( __VA_ARGS__, NULL ) void push_wmops_fct( const char *label, ... ); void pop_wmops( void ); void update_wmops( void ); void update_mem( void ); Loading Loading @@ -1019,11 +1020,11 @@ int push_stack( const char *filename, const char *fctname ); int pop_stack( const char *filename, const char *fctname ); #ifdef WMOPS_DETAIL #define STACK_DEPTH_FCT_CALL ( push_wmops( __FUNCTION__ " [WMC_AUTO]" ), push_stack( __FILE__, __FUNCTION__ ) ) /* add push_wmops() in all function calls */ #define STACK_DEPTH_FCT_RETURN ( pop_wmops(), pop_stack( __FILE__, __FUNCTION__ ) ) /* add pop_wmops() in all function returns */ #define STACK_DEPTH_FCT_CALL ( push_wmops( __func__, "[WMC_AUTO]" ), push_stack( __FILE__, __func__ ) ) /* add push_wmops() in all function calls */ #define STACK_DEPTH_FCT_RETURN ( pop_wmops(), pop_stack( __FILE__, __func__ ) ) /* add pop_wmops() in all function returns */ #else #define STACK_DEPTH_FCT_CALL push_stack( __FILE__, __FUNCTION__ ) #define STACK_DEPTH_FCT_RETURN pop_stack( __FILE__, __FUNCTION__ ) #define STACK_DEPTH_FCT_RETURN pop_stack( __FILE__, __func__ ) #endif void reset_stack( void ); Loading Loading @@ -1445,4 +1446,3 @@ static __inline void incrGoto( void) { #endif /* WMOPS_H */
lib_dec/updt_dec.c +4 −0 Original line number Diff line number Diff line Loading @@ -521,7 +521,11 @@ void updt_dec_common( st->stab_fac_smooth_lt = ENV_SMOOTH_FAC * st->stab_fac + ( 1.0f - ENV_SMOOTH_FAC ) * st->stab_fac_smooth_lt; } #ifdef NON_BE_1055_RESET_LP_MEMORIES if ( ( st->core_brate <= SID_2k40 && st->cng_type == FD_CNG ) || ( st->tcxonly && ( st->codec_mode == MODE2 || st->element_mode > EVS_MONO ) ) ) #else if ( ( st->core_brate <= SID_2k40 && st->cng_type == FD_CNG ) || ( st->tcxonly && st->codec_mode == MODE2 ) ) #endif { /* reset LP memories */ set_zero( st->mem_MA, M ); Loading