diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3ac60dac7eebde8b0aa57989f1d887313b272037..7ba0eecec437e9de5149b763ad5b7ccd9a15be45 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -147,7 +147,7 @@ stages: .build-job-linux: stage: build - timeout: "2 minutes" + timeout: "4 minutes" tags: - ivas-linux diff --git a/Workspace_msvc/lib_debug.vcxproj b/Workspace_msvc/lib_debug.vcxproj index 59221f7427f81eef55b4fe1fee4bc150630dfdbe..8a14cbdd31a94c0c1a8bdd4e55df18145f74c557 100644 --- a/Workspace_msvc/lib_debug.vcxproj +++ b/Workspace_msvc/lib_debug.vcxproj @@ -143,19 +143,16 @@ - - - + - - + diff --git a/apps/decoder.c b/apps/decoder.c index f031aca0187a702520912303031f8c28f21c71aa..11d70adf280950564f4c3003f937038c5e128d50 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -30,6 +30,10 @@ *******************************************************************************************************/ +#include +#include +#include +#include "options.h" #include "lib_dec.h" #include "cmdl_tools.h" #include "audio_file_writer.h" @@ -41,25 +45,14 @@ #include "head_rotation_file_reader.h" #include "jbm_file_writer.h" #include "evs_rtp_payload.h" -#include -#include -#ifdef WMOPS -#include "PROM_Size_lib_com.h" -#include "PROM_Size_lib_dec.h" -#include "wmops.h" -#endif -#ifdef RAM_COUNTING_TOOL -#include "mem_count.h" -#else -#include -#endif #ifdef DEBUGGING #include "debug.h" #endif +#include "wmc_auto.h" #include "render_config_reader.h" -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP /*------------------------------------------------------------------------------------------* * Local constants, enums, structures @@ -137,41 +130,6 @@ static IVAS_DEC_FORCED_REND_MODE parseForcedRendModeDec( char *forcedRendModeCha #endif -#ifdef WMOPS -/*------------------------------------------------------------------------------------------* - * Function to print complexity & memory estimates at the decoder - *------------------------------------------------------------------------------------------*/ - -extern int16_t *ptr_base_stack; -extern int16_t *ptr_base_stack; -extern int16_t *ptr_max_stack; -extern int32_t wc_frame; -extern char location_max_stack[256]; -void print_stack_call_tree( void ); - -static void print_mem_dec( size_t SRAM_size ) -{ - fprintf( stdout, "\n\n --- Decoder memory usage --- \n\n" ); - - fprintf( stdout, "PROM size (decoder): %d words (or instructions)\n", PROM_Size_lib_dec ); - fprintf( stdout, "PROM size (common): %d words (or instructions)\n", PROM_Size_lib_com ); - fprintf( stdout, "Stack size (decoder): %ld words in %s() in frame #%d\n", ( ( ptr_base_stack - ptr_max_stack ) * sizeof( int16_t ) ) / sizeof( float ), location_max_stack, wc_frame ); - fprintf( stdout, "Table ROM size (decoder): %ld words\n", ( Const_Data_Size_rom_dec() + Const_Data_Size_ivas_rom_dec() ) / sizeof( float ) ); - fprintf( stdout, "Table ROM size (binaural renderer): %ld words\n", ( Const_Data_Size_ivas_rom_binauralRen() + Const_Data_Size_ivas_rom_TdBinauralR() + Const_Data_Size_ivas_rom_binaural_cr() ) / sizeof( float ) ); - fprintf( stdout, "Table ROM size (common): %ld words\n", ( Const_Data_Size_rom_com() + Const_Data_Size_ivas_rom_com() ) / sizeof( float ) ); -#ifdef RAM_COUNTING_TOOL - fprintf( stdout, "Static RAM size (decoder): %ld words\n\n", SRAM_size ); -#endif - print_stack_call_tree(); - - fprintf( stdout, "Note: this is an optimistic estimate of the memory consumption assuming\n" ); - fprintf( stdout, " that each variable (short, long or float) in the codec requires\n" ); - fprintf( stdout, " 32 bits of memory and may therefore be represented by 1 word.\n" ); - fprintf( stdout, " The following formula is used: sizeof('memory array')/sizeof(float)\n\n" ); -} -#endif - - /*------------------------------------------------------------------------------------------* * main() * @@ -200,18 +158,12 @@ int main( #endif #endif -#ifdef WMOPS - size_t SRAM_size = 0; - reset_stack(); - reset_wmops(); -#endif - #ifdef DEBUGGING dbgargs( &argc, argv ); #endif - -#ifdef RAM_COUNTING_TOOL - mem_count_init( 0, USE_32BITS ); +#ifdef WMOPS + reset_wmops(); + reset_mem( USE_32BITS ); #endif /*------------------------------------------------------------------------------------------* @@ -575,15 +527,9 @@ cleanup: fprintf( stderr, "\nError while closing file: %s\nContinuing...\n\n", arg.inputBitstreamFilename ); } -#ifdef RAM_COUNTING_TOOL -#ifdef WMOPS - SRAM_size = -#endif - mem_count_summary( USE_DEFAULT ); -#endif #ifdef WMOPS print_wmops(); - print_mem_dec( SRAM_size ); + print_mem( NULL ); #endif if ( !arg.quietModeEnabled ) @@ -1672,10 +1618,8 @@ static ivas_error decodeG192( } #ifdef WMOPS update_wmops(); -#endif -#ifdef DEBUGGING -#ifdef RAM_ANALYSIS - mem_analyze(); +#ifdef MEM_COUNT_DETAILS + export_mem( "mem_analysis.csv" ); #endif #endif } @@ -2241,10 +2185,8 @@ static ivas_error decodeVoIP( #ifdef WMOPS update_wmops(); -#endif -#ifdef DEBUGGING -#ifdef RAM_ANALYSIS - mem_analyze(); +#ifdef MEM_COUNT_DETAILS + export_mem( "mem_analysis.csv" ); #endif #endif } diff --git a/apps/encoder.c b/apps/encoder.c index 0be04d7c8e4b8b476e67a8d3a4e667f66b541db3..c5fab82453a039d709f959088aaef299c1f669e1 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -30,6 +30,10 @@ *******************************************************************************************************/ +#include +#include +#include +#include "options.h" #include "lib_enc.h" #include "cmdl_tools.h" #include "audio_file_reader.h" @@ -37,24 +41,12 @@ #include "jbm_file_reader.h" #include "masa_file_reader.h" #include "ism_file_reader.h" -#include -#include -#ifdef WMOPS -#include "PROM_Size_lib_com.h" -#include "PROM_Size_lib_enc.h" -#include "wmops.h" -#endif -#ifdef RAM_COUNTING_TOOL -#include "mem_count.h" -#else -#include -#endif #ifdef DEBUGGING #include "debug.h" #endif +#include "wmc_auto.h" -#define WMC_TOOL_MAN - +#define WMC_TOOL_SKIP /*------------------------------------------------------------------------------------------* * Local constants, enums, structures @@ -154,40 +146,6 @@ static IVAS_ENC_FORCED_MODE parseForcedMode( char *forcedModeChar ); #endif -#ifdef WMOPS -/*------------------------------------------------------------------------------------------* - * Function to print complexity & memory estimates at the encoder - *------------------------------------------------------------------------------------------*/ - -extern int16_t *ptr_base_stack; -extern int16_t *ptr_base_stack; -extern int16_t *ptr_max_stack; -extern int32_t wc_frame; -extern char location_max_stack[256]; -void print_stack_call_tree( void ); - -static void print_mem_enc( size_t SRAM_size ) -{ - fprintf( stdout, "\n\n --- Encoder memory usage --- \n\n" ); - - fprintf( stdout, "PROM size (encoder): %d words (or instructions)\n", PROM_Size_lib_enc ); - fprintf( stdout, "PROM size (common): %d words (or instructions)\n", PROM_Size_lib_com ); - fprintf( stdout, "Stack size (encoder): %ld words in %s() in frame #%d\n", ( ( ptr_base_stack - ptr_max_stack ) * sizeof( int16_t ) ) / sizeof( float ), location_max_stack, wc_frame ); - fprintf( stdout, "Table ROM size (encoder): %ld words\n", ( Const_Data_Size_rom_enc() + Const_Data_Size_ivas_rom_enc() ) / sizeof( float ) ); - fprintf( stdout, "Table ROM size (common): %ld words\n", ( Const_Data_Size_rom_com() + Const_Data_Size_ivas_rom_com() ) / sizeof( float ) ); -#ifdef RAM_COUNTING_TOOL - fprintf( stdout, "Static RAM size (encoder): %ld words\n\n", SRAM_size ); -#endif - print_stack_call_tree(); - - fprintf( stdout, "Note: this is an optimistic estimate of the memory consumption assuming\n" ); - fprintf( stdout, " that each variable (short, long or float) in the codec requires\n" ); - fprintf( stdout, " 32 bits of memory and may therefore be represented by 1 word.\n" ); - fprintf( stdout, " The following formula is used: sizeof('memory array')/sizeof(float)\n\n" ); -} -#endif - - /*------------------------------------------------------------------------------------------* * main() * @@ -224,18 +182,12 @@ int main( #endif #endif -#ifdef WMOPS - size_t SRAM_size = 0; - reset_wmops(); - reset_stack(); -#endif - #ifdef DEBUGGING dbgargs( &argc, argv ); #endif - -#ifdef RAM_COUNTING_TOOL - mem_count_init( 0, USE_32BITS ); +#ifdef WMOPS + reset_wmops(); + reset_mem( USE_32BITS ); #endif initArgStruct( &arg ); @@ -765,10 +717,8 @@ int main( #ifdef WMOPS update_wmops(); -#endif -#ifdef DEBUGGING -#ifdef RAM_ANALYSIS - mem_analyze(); +#ifdef MEM_COUNT_DETAILS + export_mem( "mem_analysis.csv" ); #endif #endif } @@ -834,15 +784,9 @@ cleanup: IVAS_ENC_Close( &hIvasEnc ); -#ifdef RAM_COUNTING_TOOL -#ifdef WMOPS - SRAM_size = -#endif - mem_count_summary( USE_DEFAULT ); -#endif #ifdef WMOPS print_wmops(); - print_mem_enc( SRAM_size ); + print_mem( NULL ); #endif #ifdef DEBUGGING diff --git a/apps/renderer.c b/apps/renderer.c index 486ed4275728ab0bd99b5510e6c8497f5d92e6dc..6084b9f46a2fa15c99bb6dff7712e878c1f63410 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -30,6 +30,13 @@ *******************************************************************************************************/ +#include +#include +#include +#include +#include +#include +#include #include "options.h" #include "audio_file_reader.h" #include "audio_file_writer.h" @@ -44,23 +51,7 @@ #include "masa_file_reader.h" #include "prot.h" #include "render_config_reader.h" -#ifdef WMOPS -#include "PROM_Size_lib_rend.h" -#include "wmops.h" -#endif -#ifdef DEBUGGING -#include "debug.h" -#endif -#ifdef RAM_COUNTING_TOOL -#include "mem_count.h" -#endif -#include -#include -#include -#include -#include -#include -#include +#include "wmc_auto.h" #define RENDERER_MAX_CLI_ARG_LENGTH ( FILENAME_MAX ) @@ -78,37 +69,6 @@ static #define SEP_FOLDER '/' #endif -#ifdef WMOPS -void print_stack_call_tree( void ); -int Const_Data_Size_ivas_rom_rend( void ); -extern int16_t *ptr_base_stack; -extern int16_t *ptr_max_stack; -extern int32_t wc_frame; -extern char location_max_stack[256]; - -/*------------------------------------------------------------------------------------------* - * Function to print complexity & memory estimates - *------------------------------------------------------------------------------------------*/ -static void print_mem_renderer( size_t SRAM_size ) -{ - fprintf( stdout, "\n\n --- Renderer memory usage --- \n\n" ); - - fprintf( stdout, "PROM size (renderer): %d words (or instructions)\n", PROM_Size_lib_rend ); - fprintf( stdout, "Stack size: %d words in %s() in frame #%d\n", ( ptr_base_stack - ptr_max_stack ) * sizeof( int16_t ) / sizeof( float ), location_max_stack, wc_frame ); - fprintf( stdout, "Table ROM size(renderer): %d words\n", ( Const_Data_Size_ivas_rom_rend() ) / sizeof( float ) ); - fprintf( stdout, "Table ROM size (binaural renderer): %ld words\n", ( Const_Data_Size_ivas_rom_binauralRen() + Const_Data_Size_ivas_rom_TdBinauralR() + Const_Data_Size_ivas_rom_binaural_cr() ) / sizeof( float ) ); -#ifdef RAM_COUNTING_TOOL - fprintf( stdout, "Static RAM size: %d words\n\n", SRAM_size ); -#endif - print_stack_call_tree(); - - fprintf( stdout, "Note: this is an optimistic estimate of the memory consumption assuming\n" ); - fprintf( stdout, " that each variable (short, long or float) in the codec requires\n" ); - fprintf( stdout, " 32 bits of memory and may therefore be represented by 1 word.\n" ); - fprintf( stdout, " The following formula is used: sizeof('memory array')/sizeof(float)\n\n" ); -} -#endif - typedef struct { uint32_t frameCounter; @@ -571,17 +531,10 @@ int main( int32_t delayTimeScale = 0; int16_t i, numChannels; ivas_error error = IVAS_ERR_OK; -#ifdef WMOPS - size_t SRAM_size; -#endif #ifdef WMOPS reset_wmops(); - reset_stack(); -#endif - -#ifdef RAM_COUNTING_TOOL - mem_count_init( 0, USE_32BITS ); + reset_mem( USE_32BITS ); #endif for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i ) @@ -809,10 +762,10 @@ int main( inBufferSize = frameSize_smpls * totalNumInChannels; outBufferSize = frameSize_smpls * numOutChannels; - inpInt16Buffer = count_malloc( inBufferSize * sizeof( int16_t ) ); - inFloatBuffer = count_malloc( inBufferSize * sizeof( float ) ); - outInt16Buffer = count_malloc( outBufferSize * sizeof( int16_t ) ); - outFloatBuffer = count_malloc( outBufferSize * sizeof( float ) ); + inpInt16Buffer = malloc( inBufferSize * sizeof( int16_t ) ); + inFloatBuffer = malloc( inBufferSize * sizeof( float ) ); + outInt16Buffer = malloc( outBufferSize * sizeof( int16_t ) ); + outFloatBuffer = malloc( outBufferSize * sizeof( float ) ); inBuffer.config.numSamplesPerChannel = (int16_t) frameSize_smpls; inBuffer.config.numChannels = (int16_t) totalNumInChannels; @@ -823,6 +776,7 @@ int main( outBuffer.data = outFloatBuffer; #ifdef WMOPS + reset_stack(); reset_wmops(); #endif @@ -1013,6 +967,9 @@ int main( #ifdef WMOPS update_wmops(); +#ifdef MEM_COUNT_DETAILS + export_mem( "mem_analysis.csv" ); +#endif #endif } @@ -1044,10 +1001,10 @@ int main( #endif /* === Close === */ - count_free( inpInt16Buffer ); - count_free( inFloatBuffer ); - count_free( outInt16Buffer ); - count_free( outFloatBuffer ); + free( inpInt16Buffer ); + free( inFloatBuffer ); + free( outInt16Buffer ); + free( outFloatBuffer ); for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i ) { MasaFileReader_close( &masaReaders[i] ); @@ -1060,15 +1017,9 @@ int main( IsmPositionProvider_close( positionProvider ); RenderConfigReader_close( &renderConfigReader ); -#ifdef RAM_COUNTING_TOOL -#ifdef WMOPS - SRAM_size = -#endif - mem_count_summary( USE_DEFAULT ); -#endif #ifdef WMOPS print_wmops(); - print_mem_renderer( SRAM_size ); + print_mem( NULL ); #endif return 0; @@ -1597,7 +1548,7 @@ IsmPositionProvider *IsmPositionProvider_open( IsmPositionProvider *ipp; uint16_t i; - ipp = (IsmPositionProvider *) count_malloc( sizeof( IsmPositionProvider ) ); + ipp = (IsmPositionProvider *) malloc_( sizeof( IsmPositionProvider ) ); ipp->frameCounter = 0; ipp->numObjects = 0; @@ -1714,16 +1665,16 @@ void IsmPositionProvider_close( IsmPositionProvider *positionProvider ) if ( positionProvider->positions[i] != NULL ) { - count_free( positionProvider->positions[i] ); + free( positionProvider->positions[i] ); } if ( positionProvider->positionDurations[i] != NULL ) { - count_free( positionProvider->positionDurations[i] ); + free( positionProvider->positionDurations[i] ); } } - count_free( positionProvider ); + free( positionProvider ); return; } @@ -1972,8 +1923,8 @@ static void parseIsm( if ( parseUint32( line, &numberOfObjectPositionsToRead ) == 0 ) { positionProvider->numPositions[idx] = numberOfObjectPositionsToRead; - positionProvider->positions[idx] = count_malloc( numberOfObjectPositionsToRead * sizeof( IVAS_REND_AudioObjectPosition ) ); - positionProvider->positionDurations[idx] = count_malloc( numberOfObjectPositionsToRead * sizeof( uint16_t ) ); + positionProvider->positions[idx] = malloc_( numberOfObjectPositionsToRead * sizeof( IVAS_REND_AudioObjectPosition ) ); + positionProvider->positionDurations[idx] = malloc_( numberOfObjectPositionsToRead * sizeof( uint16_t ) ); for ( i = 0; i < numberOfObjectPositionsToRead; ++i ) { diff --git a/ci/complexity_measurements/genWebpageData_Prom.csh b/ci/complexity_measurements/genWebpageData_Prom.csh deleted file mode 100755 index d6e716f0c5455228478c620a759148b00a6aacc5..0000000000000000000000000000000000000000 --- a/ci/complexity_measurements/genWebpageData_Prom.csh +++ /dev/null @@ -1,220 +0,0 @@ -#!/bin/tcsh - -# (C) 2022 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, -# Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., -# Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, -# Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other -# contributors to this repository. All Rights Reserved. - -# This software is protected by copyright law and by international treaties. -# The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, -# Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., -# Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, -# Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other -# contributors to this repository retain full ownership rights in their respective contributions in -# the software. This notice grants no license of any kind, including but not limited to patent -# license, nor is any license granted by implication, estoppel or otherwise. - -# Contributors are required to enter into the IVAS codec Public Collaboration agreement before making -# contributions. - -# This software is provided "AS IS", without any express or implied warranties. The software is in the -# development stage. It is intended exclusively for experts who have experience with such software and -# solely for the purpose of inspection. All implied warranties of non-infringement, merchantability -# and fitness for a particular purpose are hereby disclaimed and excluded. - -# Any dispute, controversy or claim arising under or in relation to providing this software shall be -# submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in -# accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and -# the United Nations Convention on Contracts on the International Sales of Goods. - -set maxValues = 40 - -if (${#argv} != 3) then - echo usage: $0 \ \ \ - exit -endif - -set srcFile1 = $1 - -set file_final = $2 -set file = ${file_final}_new_$$ - -set graphName = $3 - -set tmpBase = `basename $0` -set tmpFile1 = /tmp/${tmpBase}1_$$ -rm -f ${tmpFile1} -cat ${srcFile1} | tail -n ${maxValues} > ${tmpFile1} -set nLines1 = `cat ${tmpFile1} | wc -l` -set maxNumWordsLine = 7 - -rm -f $file -touch $file - -echo "var $graphName = {" >> $file -echo ' prom_worstcase: {' >> $file -echo ' description: "Worst Case PROM",' >> $file -echo ' direction: -1,' >> $file -echo ' runs: [' >> $file - - -@ i = 0 -foreach line ( "`cat ${tmpFile1}`" ) - @ i++ - set separator = "," - if ( $i == $nLines1 ) then - set separator = "" - endif - - set tmp = ( $line ) - - set numWords = `echo $tmp | wc -w` - if ( $numWords < $maxNumWordsLine ) then - continue - endif - - set revision = $tmp[1] - set shortDate = `echo $tmp[2] | sed -e "s/_/\ /g"` - set fullDate = `echo $tmp[3] | sed -e "s/_/\ /g"` - set logFileFlc = $tmp[5] - set logFileBasop = $tmp[7] - - echo ' {' >> $file - echo ' fullDate: "'${fullDate}'",' >> $file - echo ' shortDate: "'${shortDate}'",' >> $file - echo ' revision: "'${revision}'",' >> $file - echo ' logFileFlc: "'${logFileFlc}'",' >> $file - echo ' logFileBasop: "'${logFileBasop}'",' >> $file - echo ' }'${separator} >> $file - -end -echo ' ],' >> $file - -# begin displays -echo ' displays: [' >> $file - -# requirement PROM -echo ' {' >> $file -echo ' lines: { show: false },' >> $file -echo ' points: { show: false, fillColor: "#ffffff" },' >> $file -echo ' borderWidth: 1.5,' >> $file -echo ' borderColor: "#BEBEBE",' >> $file -echo ' markingsLineWidth: .75,' >> $file -echo ' hoverable: true,' >> $file -echo ' clickable: true,' >> $file -echo ' shadowSize: 0,' >> $file -echo ' color: "#000000",' >> $file -echo ' id: "requirementProm",' >> $file -echo ' data: [' >> $file - -@ i = 0 -foreach line ( "`cat ${tmpFile1}`" ) - set separator = "," - if ( $i == $nLines1 - 1 ) then - set separator = "" - endif - - set tmp = ( $line ) - - set numWords = `echo $tmp | wc -w` - if ( $numWords < $maxNumWordsLine ) then - continue - endif - - # TODO: add real requirement once decided on - set score = 0 - - echo ' ['"${i}, ${score}"']'${separator} >> $file - @ i++ - -end - -echo ' ]' >> $file -echo ' },' >> $file -# requirement ROM - -# measured ops FLC -echo ' {' >> $file -echo ' lines: { show: true },' >> $file -echo ' points: { show: true, fillColor: "#ffffff" },' >> $file -echo ' borderWidth: 1.5,' >> $file -echo ' borderColor: "#BEBEBE",' >> $file -echo ' markingsLineWidth: .75,' >> $file -echo ' hoverable: true,' >> $file -echo ' clickable: true,' >> $file -echo ' shadowSize: 0,' >> $file -echo ' color: "#FF8000",' >> $file -echo ' id: "promOpsFlc",' >> $file -echo ' data: [' >> $file - -@ i = 0 -foreach line ( "`cat ${tmpFile1}`" ) - set separator = "," - if ( $i == $nLines1 - 1 ) then - set separator = "" - endif - - set tmp = ( $line ) - - set numWords = `echo $tmp | wc -w` - if ( $numWords < $maxNumWordsLine ) then - continue - endif - - set score = $tmp[4] - - echo ' ['"${i}, ${score}"']'${separator} >> $file - @ i++ - -end - -echo ' ]' >> $file -echo ' },' >> $file -# measured ops FLC - -# measured ops BASOP -echo ' {' >> $file -echo ' lines: { show: false },' >> $file -echo ' points: { show: false, fillColor: "#ffffff" },' >> $file -echo ' borderWidth: 1.5,' >> $file -echo ' borderColor: "#BEBEBE",' >> $file -echo ' markingsLineWidth: .75,' >> $file -echo ' hoverable: true,' >> $file -echo ' clickable: true,' >> $file -echo ' shadowSize: 0,' >> $file -echo ' color: "#0080FF",' >> $file -echo ' id: "promOpsBasop",' >> $file -echo ' data: [' >> $file - -@ i = 0 -foreach line ( "`cat ${tmpFile1}`" ) - set separator = "," - if ( $i == $nLines1 - 1 ) then - set separator = "" - endif - - set tmp = ( $line ) - - set numWords = `echo $tmp | wc -w` - if ( $numWords < $maxNumWordsLine ) then - continue - endif - - set score = $tmp[6] - - echo ' ['"${i}, ${score}"']'${separator} >> $file - @ i++ - -end - -echo ' ]' >> $file -echo ' }' >> $file - -echo ' ]' >> $file - -echo ' }' >> $file -echo '};' >> $file - -mv -f $file $file_final -rm -f ${tmpFile1} diff --git a/ci/complexity_measurements/genWebpageData_Ram.csh b/ci/complexity_measurements/genWebpageData_Ram.csh index a8dbc0e2f9dedf8c6758b1e2dd93d1660ad61bc7..f5cc50aab41523f375b889af08cfe808a030e8da 100755 --- a/ci/complexity_measurements/genWebpageData_Ram.csh +++ b/ci/complexity_measurements/genWebpageData_Ram.csh @@ -77,10 +77,10 @@ foreach line ( "`cat ${tmpFile}`" ) set fullDate = `echo $tmp[3] | sed -e "s/_/\ /g"` set maxTotalRamEnc = $tmp[5] set maxTotalRamDec = $tmp[7] - set maxDynamicRamEnc = $tmp[10] - set maxDynamicRamDec = $tmp[12] - set maxStaticRamEnc = $tmp[15] - set maxStaticRamDec = $tmp[17] + set maxStackEnc = $tmp[10] + set maxStackDec = $tmp[12] + set maxHeapEnc = $tmp[15] + set maxHeapDec = $tmp[17] set logFile = $tmp[19] echo ' {' >> $file @@ -89,10 +89,10 @@ foreach line ( "`cat ${tmpFile}`" ) echo ' revision: "'${revision}'",' >> $file echo ' maxTotalRamEnc: "'${maxTotalRamEnc}'",' >> $file echo ' maxTotalRamDec: "'${maxTotalRamDec}'",' >> $file - echo ' maxDynamicRamEnc: "'${maxDynamicRamEnc}'",' >> $file - echo ' maxDynamicRamDec: "'${maxDynamicRamDec}'",' >> $file - echo ' maxStaticRamEnc: "'${maxStaticRamEnc}'",' >> $file - echo ' maxStaticRamDec: "'${maxStaticRamDec}'",' >> $file + echo ' maxStackEnc: "'${maxStackEnc}'",' >> $file + echo ' maxStackDec: "'${maxStackDec}'",' >> $file + echo ' maxHeapEnc: "'${maxHeapEnc}'",' >> $file + echo ' maxHeapDec: "'${maxHeapDec}'",' >> $file echo ' logFile: "'${logFile}'"' >> $file echo ' }'${separator} >> $file @@ -259,7 +259,7 @@ echo ' ]' >> $file echo ' },' >> $file # maxTotalRamDecScore -# maxDynamicRamCodecScore +# maxStackCodecScore echo ' {' >> $file echo ' lines: { show: true },' >> $file echo ' points: { show: true, fillColor: "#ffffff" },' >> $file @@ -270,7 +270,7 @@ echo ' hoverable: true,' >> $file echo ' clickable: true,' >> $file echo ' shadowSize: 0,' >> $file echo ' color: "#004000",' >> $file -echo ' id: "maxDynamicRamCodecScore",' >> $file +echo ' id: "maxStackCodecScore",' >> $file echo ' data: [' >> $file @ i = 0 @@ -296,10 +296,10 @@ end echo ' ]' >> $file echo ' },' >> $file -# maxDynamicRamCodecScore +# maxStackCodecScore -# maxDynamicRamEncScore +# maxStackEncScore echo ' {' >> $file echo ' lines: { show: true },' >> $file echo ' points: { show: true, fillColor: "#ffffff" },' >> $file @@ -310,7 +310,7 @@ echo ' hoverable: true,' >> $file echo ' clickable: true,' >> $file echo ' shadowSize: 0,' >> $file echo ' color: "#008000",' >> $file -echo ' id: "maxDynamicRamEncScore",' >> $file +echo ' id: "maxStackEncScore",' >> $file echo ' data: [' >> $file @ i = 0 @@ -336,9 +336,9 @@ end echo ' ]' >> $file echo ' },' >> $file -# maxDynamicRamEncScore +# maxStackEncScore -# maxDynamicRamDecScore +# maxStackDecScore echo ' {' >> $file echo ' lines: { show: true },' >> $file echo ' points: { show: true, fillColor: "#ffffff" },' >> $file @@ -349,7 +349,7 @@ echo ' hoverable: true,' >> $file echo ' clickable: true,' >> $file echo ' shadowSize: 0,' >> $file echo ' color: "#00FF00",' >> $file -echo ' id: "maxDynamicRamDecScore",' >> $file +echo ' id: "maxStackDecScore",' >> $file echo ' data: [' >> $file @ i = 0 @@ -375,9 +375,9 @@ end echo ' ]' >> $file echo ' },' >> $file -# maxDynamicRamDecScore +# maxStackDecScore -# maxStaticRamCodecScore +# maxHeapCodecScore echo ' {' >> $file echo ' lines: { show: true },' >> $file echo ' points: { show: true, fillColor: "#ffffff" },' >> $file @@ -388,7 +388,7 @@ echo ' hoverable: true,' >> $file echo ' clickable: true,' >> $file echo ' shadowSize: 0,' >> $file echo ' color: "#800080",' >> $file -echo ' id: "maxStaticRamCodecScore",' >> $file +echo ' id: "maxHeapCodecScore",' >> $file echo ' data: [' >> $file @ i = 0 @@ -414,9 +414,9 @@ end echo ' ]' >> $file echo ' },' >> $file -# maxStaticRamCodecScore +# maxHeapCodecScore -# maxStaticRamEncScore +# maxHeapEncScore echo ' {' >> $file echo ' lines: { show: true },' >> $file echo ' points: { show: true, fillColor: "#ffffff" },' >> $file @@ -427,7 +427,7 @@ echo ' hoverable: true,' >> $file echo ' clickable: true,' >> $file echo ' shadowSize: 0,' >> $file echo ' color: "#0000FF",' >> $file -echo ' id: "maxStaticRamEncScore",' >> $file +echo ' id: "maxHeapEncScore",' >> $file echo ' data: [' >> $file @ i = 0 @@ -453,9 +453,9 @@ end echo ' ]' >> $file echo ' },' >> $file -# maxStaticRamEncScore +# maxHeapEncScore -# maxStaticRamDecScore +# maxHeapDecScore echo ' {' >> $file echo ' lines: { show: true },' >> $file echo ' points: { show: true, fillColor: "#ffffff" },' >> $file @@ -466,7 +466,7 @@ echo ' hoverable: true,' >> $file echo ' clickable: true,' >> $file echo ' shadowSize: 0,' >> $file echo ' color: "#0080C0",' >> $file -echo ' id: "maxStaticRamDecScore",' >> $file +echo ' id: "maxHeapDecScore",' >> $file echo ' data: [' >> $file @ i = 0 @@ -492,7 +492,7 @@ end echo ' ]' >> $file echo ' }' >> $file -# maxStaticRamDecScore +# maxHeapDecScore echo ' ]' >> $file # end displays diff --git a/ci/complexity_measurements/genWebpageData_Rom.csh b/ci/complexity_measurements/genWebpageData_Rom.csh index d2ef2daf15fb02538a1e7f553b68ec95468b3805..ba34df31693118ea80a60d703d4f4495dfb9f8eb 100755 --- a/ci/complexity_measurements/genWebpageData_Rom.csh +++ b/ci/complexity_measurements/genWebpageData_Rom.csh @@ -31,61 +31,100 @@ set maxValues = 40 if (${#argv} != 3) then - echo usage: $0 \ \ \ \ + echo usage: $0 \ \ \ exit endif -set srcFile1 = $1 - +set srcFile = $1 set file_final = $2 set file = ${file_final}_new_$$ set graphName = $3 set tmpBase = `basename $0` -set tmpFile1 = /tmp/${tmpBase}1_$$ -set tmpFile2 = /tmp/${tmpBase}2_$$ -rm -f ${tmpFile1} ${tmpFile2} -cat ${srcFile1} | tail -n ${maxValues} > ${tmpFile1} -set nLines1 = `cat ${tmpFile1} | wc -l` -set maxNumWordsLine1 = 5 -set maxNumWordsLine2 = 5 +set tmpFile = /tmp/${tmpBase}_$$ +rm -f ${tmpFile} +cat ${srcFile} | tail -n ${maxValues} > ${tmpFile} +set nLines = `cat ${tmpFile} | wc -l` +set maxNumWordsLine = 21 rm -f $file touch $file echo "var $graphName = {" >> $file echo ' rom_worstcase: {' >> $file -echo ' description: "Worst Case ROM",' >> $file +echo ' description: "ROM",' >> $file echo ' direction: -1,' >> $file echo ' runs: [' >> $file - @ i = 0 -foreach line ( "`cat ${tmpFile1}`" ) +foreach line ( "`cat ${tmpFile}`" ) @ i++ set separator = "," - if ( $i == $nLines1 ) then + if ( $i == $nLines ) then set separator = "" endif set tmp = ( $line ) set numWords = `echo $tmp | wc -w` - if ( $numWords < $maxNumWordsLine1 ) then + if ( $numWords < $maxNumWordsLine ) then continue endif + + # 1 revision, + # 2 shortDate, + # 3 fullDate, + + # 4 max_total_encdec[1], + + # 5 max_prom_enc[0], + # 6 max_prom_enc[1], + # 7 max_prom_dec[0], + # 8 max_prom_dec[1], + # 9 max_prom_com[0], + # 10 max_prom_com[1], + # 11 max_prom_rend[0], + # 12 max_prom_rend[1], + + # 13 max_trom_enc[0], + # 14 max_trom_enc[1], + # 15 max_trom_dec[0], + # 16 max_trom_dec[1], + # 17 max_trom_com[0], + # 18 max_trom_com[1], + # 19 max_trom_rend[0], + # 20 max_trom_rend[1], + + # 21 newsletterFilenameLast, + + set revision = $tmp[1] set shortDate = `echo $tmp[2] | sed -e "s/_/\ /g"` set fullDate = `echo $tmp[3] | sed -e "s/_/\ /g"` - set logFileFlc = $tmp[5] + set PromEnc = $tmp[5] + set PromDec = $tmp[7] + set PromCom = $tmp[9] + set PromRend = $tmp[11] + set TromEnc = $tmp[13] + set TromDec = $tmp[15] + set TromCom = $tmp[17] + set TromRend = $tmp[19] + set logFile = $tmp[21] echo ' {' >> $file echo ' fullDate: "'${fullDate}'",' >> $file echo ' shortDate: "'${shortDate}'",' >> $file echo ' revision: "'${revision}'",' >> $file - echo ' logFileFlc: "'${logFileFlc}'",' >> $file -# echo ' logFileBasop: "'${logFileBasop[$i]}'"' >> $file + echo ' PromEnc: "'${PromEnc}'",' >> $file + echo ' PromDec: "'${PromDec}'",' >> $file + echo ' PromCom: "'${PromCom}'",' >> $file + echo ' PromRend: "'${PromRend}'",' >> $file + echo ' TromEnc: "'${TromEnc}'",' >> $file + echo ' TromDec: "'${TromDec}'",' >> $file + echo ' TromCom: "'${TromCom}'",' >> $file + echo ' TromRend: "'${TromRend}'",' >> $file + echo ' logFile: "'${logFile}'"' >> $file echo ' }'${separator} >> $file end @@ -94,7 +133,7 @@ echo ' ],' >> $file # begin displays echo ' displays: [' >> $file -# requirement ROM +# requirement ROM echo ' {' >> $file echo ' lines: { show: false },' >> $file echo ' points: { show: false, fillColor: "#ffffff" },' >> $file @@ -109,16 +148,16 @@ echo ' id: "requirementRom",' >> $file echo ' data: [' >> $file @ i = 0 -foreach line ( "`cat ${tmpFile1}`" ) +foreach line ( "`cat ${tmpFile}`" ) set separator = "," - if ( $i == $nLines1 - 1 ) then + if ( $i == $nLines - 1 ) then set separator = "" endif set tmp = ( $line ) set numWords = `echo $tmp | wc -w` - if ( $numWords < $maxNumWordsLine1 ) then + if ( $numWords < $maxNumWordsLine ) then continue endif @@ -134,7 +173,7 @@ echo ' ]' >> $file echo ' },' >> $file # requirement ROM -# maxTablesizeCodecScore FLC +# TotalRomCodecScore echo ' {' >> $file echo ' lines: { show: true },' >> $file echo ' points: { show: true, fillColor: "#ffffff" },' >> $file @@ -144,21 +183,21 @@ echo ' markingsLineWidth: .75,' >> $file echo ' hoverable: true,' >> $file echo ' clickable: true,' >> $file echo ' shadowSize: 0,' >> $file -echo ' color: "#FF8000",' >> $file -echo ' id: "maxRomFlc",' >> $file +echo ' color: "#FF0000",' >> $file +echo ' id: "TotalRomCodecScore",' >> $file echo ' data: [' >> $file @ i = 0 -foreach line ( "`cat ${tmpFile1}`" ) +foreach line ( "`cat ${tmpFile}`" ) set separator = "," - if ( $i == $nLines1 - 1 ) then + if ( $i == $nLines - 1 ) then set separator = "" endif set tmp = ( $line ) set numWords = `echo $tmp | wc -w` - if ( $numWords < $maxNumWordsLine1 ) then + if ( $numWords < $maxNumWordsLine ) then continue endif @@ -169,9 +208,323 @@ foreach line ( "`cat ${tmpFile1}`" ) end +echo ' ]' >> $file +echo ' },' >> $file +# TotalRomCodecScore + +# maxPROMEncScore +echo ' {' >> $file +echo ' lines: { show: true },' >> $file +echo ' points: { show: true, fillColor: "#ffffff" },' >> $file +echo ' borderWidth: 1.5,' >> $file +echo ' borderColor: "#BEBEBE",' >> $file +echo ' markingsLineWidth: .75,' >> $file +echo ' hoverable: true,' >> $file +echo ' clickable: true,' >> $file +echo ' shadowSize: 0,' >> $file +echo ' color: "#FF8000",' >> $file +echo ' id: "maxPROMEncScore",' >> $file +echo ' data: [' >> $file + +@ i = 0 +foreach line ( "`cat ${tmpFile}`" ) + set separator = "," + if ( $i == $nLines - 1 ) then + set separator = "" + endif + + set tmp = ( $line ) + + set numWords = `echo $tmp | wc -w` + if ( $numWords < $maxNumWordsLine ) then + continue + endif + + set score = $tmp[6] + + echo ' ['"${i}, ${score}"']'${separator} >> $file + @ i++ + +end + +echo ' ]' >> $file +echo ' },' >> $file +# maxPROMEncScore + +# maxPROMDecScore +echo ' {' >> $file +echo ' lines: { show: true },' >> $file +echo ' points: { show: true, fillColor: "#ffffff" },' >> $file +echo ' borderWidth: 1.5,' >> $file +echo ' borderColor: "#BEBEBE",' >> $file +echo ' markingsLineWidth: .75,' >> $file +echo ' hoverable: true,' >> $file +echo ' clickable: true,' >> $file +echo ' shadowSize: 0,' >> $file +echo ' color: "#FFFF00",' >> $file +echo ' id: "maxPROMDecScore",' >> $file +echo ' data: [' >> $file + +@ i = 0 +foreach line ( "`cat ${tmpFile}`" ) + set separator = "," + if ( $i == $nLines - 1 ) then + set separator = "" + endif + + set tmp = ( $line ) + + set numWords = `echo $tmp | wc -w` + if ( $numWords < $maxNumWordsLine ) then + continue + endif + + set score = $tmp[8] + + echo ' ['"${i}, ${score}"']'${separator} >> $file + @ i++ + +end + +echo ' ]' >> $file +echo ' },' >> $file +# maxPROMEncScore + +# maxPROMComScore +echo ' {' >> $file +echo ' lines: { show: true },' >> $file +echo ' points: { show: true, fillColor: "#ffffff" },' >> $file +echo ' borderWidth: 1.5,' >> $file +echo ' borderColor: "#BEBEBE",' >> $file +echo ' markingsLineWidth: .75,' >> $file +echo ' hoverable: true,' >> $file +echo ' clickable: true,' >> $file +echo ' shadowSize: 0,' >> $file +echo ' color: "#800080",' >> $file +echo ' id: "maxPROMComScore",' >> $file +echo ' data: [' >> $file + +@ i = 0 +foreach line ( "`cat ${tmpFile}`" ) + set separator = "," + if ( $i == $nLines - 1 ) then + set separator = "" + endif + + set tmp = ( $line ) + + set numWords = `echo $tmp | wc -w` + if ( $numWords < $maxNumWordsLine ) then + continue + endif + + set score = $tmp[10] + + echo ' ['"${i}, ${score}"']'${separator} >> $file + @ i++ + +end + +echo ' ]' >> $file +echo ' },' >> $file +# maxPROMComScore + + +# maxPROMRendScore +echo ' {' >> $file +echo ' lines: { show: true },' >> $file +echo ' points: { show: true, fillColor: "#ffffff" },' >> $file +echo ' borderWidth: 1.5,' >> $file +echo ' borderColor: "#BEBEBE",' >> $file +echo ' markingsLineWidth: .75,' >> $file +echo ' hoverable: true,' >> $file +echo ' clickable: true,' >> $file +echo ' shadowSize: 0,' >> $file +echo ' color: "#0000FF",' >> $file +echo ' id: "maxPROMRendScore",' >> $file +echo ' data: [' >> $file + +@ i = 0 +foreach line ( "`cat ${tmpFile}`" ) + set separator = "," + if ( $i == $nLines - 1 ) then + set separator = "" + endif + + set tmp = ( $line ) + + set numWords = `echo $tmp | wc -w` + if ( $numWords < $maxNumWordsLine ) then + continue + endif + + set score = $tmp[12] + + echo ' ['"${i}, ${score}"']'${separator} >> $file + @ i++ + +end + +echo ' ]' >> $file +echo ' },' >> $file +# maxPROMRendScore + +# maxTROMEncScore +echo ' {' >> $file +echo ' lines: { show: true },' >> $file +echo ' points: { show: true, fillColor: "#ffffff" },' >> $file +echo ' borderWidth: 1.5,' >> $file +echo ' borderColor: "#BEBEBE",' >> $file +echo ' markingsLineWidth: .75,' >> $file +echo ' hoverable: true,' >> $file +echo ' clickable: true,' >> $file +echo ' shadowSize: 0,' >> $file +echo ' color: "#0080C0",' >> $file +echo ' id: "maxTROMEncScore",' >> $file +echo ' data: [' >> $file + +@ i = 0 +foreach line ( "`cat ${tmpFile}`" ) + set separator = "," + if ( $i == $nLines - 1 ) then + set separator = "" + endif + + set tmp = ( $line ) + + set numWords = `echo $tmp | wc -w` + if ( $numWords < $maxNumWordsLine ) then + continue + endif + + set score = $tmp[14] + + echo ' ['"${i}, ${score}"']'${separator} >> $file + @ i++ + +end + +echo ' ]' >> $file +echo ' },' >> $file +# maxTROMEncScore + +# maxTROMDecScore +echo ' {' >> $file +echo ' lines: { show: true },' >> $file +echo ' points: { show: true, fillColor: "#ffffff" },' >> $file +echo ' borderWidth: 1.5,' >> $file +echo ' borderColor: "#BEBEBE",' >> $file +echo ' markingsLineWidth: .75,' >> $file +echo ' hoverable: true,' >> $file +echo ' clickable: true,' >> $file +echo ' shadowSize: 0,' >> $file +echo ' color: "#004000",' >> $file +echo ' id: "maxTROMDecScore",' >> $file +echo ' data: [' >> $file + +@ i = 0 +foreach line ( "`cat ${tmpFile}`" ) + set separator = "," + if ( $i == $nLines - 1 ) then + set separator = "" + endif + + set tmp = ( $line ) + + set numWords = `echo $tmp | wc -w` + if ( $numWords < $maxNumWordsLine ) then + continue + endif + + set score = $tmp[16] + + echo ' ['"${i}, ${score}"']'${separator} >> $file + @ i++ + +end + +echo ' ]' >> $file +echo ' },' >> $file +# maxTROMDecScore + +# maxTROMComScore +echo ' {' >> $file +echo ' lines: { show: true },' >> $file +echo ' points: { show: true, fillColor: "#ffffff" },' >> $file +echo ' borderWidth: 1.5,' >> $file +echo ' borderColor: "#BEBEBE",' >> $file +echo ' markingsLineWidth: .75,' >> $file +echo ' hoverable: true,' >> $file +echo ' clickable: true,' >> $file +echo ' shadowSize: 0,' >> $file +echo ' color: "#008000",' >> $file +echo ' id: "maxTROMComScore",' >> $file +echo ' data: [' >> $file + +@ i = 0 +foreach line ( "`cat ${tmpFile}`" ) + set separator = "," + if ( $i == $nLines - 1 ) then + set separator = "" + endif + + set tmp = ( $line ) + + set numWords = `echo $tmp | wc -w` + if ( $numWords < $maxNumWordsLine ) then + continue + endif + + set score = $tmp[18] + + echo ' ['"${i}, ${score}"']'${separator} >> $file + @ i++ + +end + +echo ' ]' >> $file +echo ' },' >> $file +# maxTROMComScore + +# maxTROMRendScore +echo ' {' >> $file +echo ' lines: { show: true },' >> $file +echo ' points: { show: true, fillColor: "#ffffff" },' >> $file +echo ' borderWidth: 1.5,' >> $file +echo ' borderColor: "#BEBEBE",' >> $file +echo ' markingsLineWidth: .75,' >> $file +echo ' hoverable: true,' >> $file +echo ' clickable: true,' >> $file +echo ' shadowSize: 0,' >> $file +echo ' color: "#00FF00",' >> $file +echo ' id: "maxTROMRendScore",' >> $file +echo ' data: [' >> $file + +@ i = 0 +foreach line ( "`cat ${tmpFile}`" ) + set separator = "," + if ( $i == $nLines - 1 ) then + set separator = "" + endif + + set tmp = ( $line ) + + set numWords = `echo $tmp | wc -w` + if ( $numWords < $maxNumWordsLine ) then + continue + endif + + set score = $tmp[20] + + echo ' ['"${i}, ${score}"']'${separator} >> $file + @ i++ + +end + echo ' ]' >> $file echo ' }' >> $file -# maxTablesizeCodecScore FLC +# maxTROMRendScore + echo ' ]' >> $file # end displays @@ -179,4 +532,4 @@ echo ' }' >> $file echo '};' >> $file mv -f $file $file_final -rm -f $tmpFile1 +rm -f $tmpFile diff --git a/ci/complexity_measurements/getWmops.sh b/ci/complexity_measurements/getWmops.sh index b14933c91eb67a5db4f298dc6f9132f9ff985924..77a01e0d3a9b7bc0aa555b0296bcc504b5e65636 100755 --- a/ci/complexity_measurements/getWmops.sh +++ b/ci/complexity_measurements/getWmops.sh @@ -40,7 +40,7 @@ output_format=$2 date=`date +%Y%m%d` # used for log-file file ending shortDate=`date "+%b %d" | sed -e "s/\ /_/g"` # stored in the log-file fullDate=`date "+%c" | sed -e "s/\ /_/g"` # stored in the log-file - + commit_sha=`git rev-parse --short HEAD` destDir="." @@ -56,37 +56,31 @@ wmopsFilenameFlc=${destDir}/wmops/logs/${wmopsFilenameFlcLast} # instrument and build ./scripts/IvasBuildAndRunChecks.py -p $config_file --checks COMPLEXITY --create_complexity_tables ${wmopsFilenameFlc} -C $ivas_format -f ${ep} --oc $output_format -# now get the info on worst case operating point: WMOPS number, enc-operating mode, dec-operating mode +# get the info on worst-case operating point: WMOPS number, enc-operating mode, dec-operating mode ### WMOPS ${scriptDir}/parseNewsletterWmops.py ${wmopsFilenameFlc}_WMOPS.csv ${wmopsFilenameFlcLast}_WMOPS.csv ${commit_sha} ${shortDate} ${fullDate} >> ${destDir}/wmops/log_wmops_all.txt # now update the webpage -tcsh ${scriptDir}/genWebpageData_WMOPS.csh ${destDir}/wmops/log_wmops_all.txt ${destDir}/wmops/graphs_wmops_flc.js Graphs_WMOPS +tcsh ${scriptDir}/genWebpageData_WMOPS.csh ${destDir}/wmops/log_wmops_all.txt ${destDir}/wmops/graphs_wmops_flc.js Graphs_WMOPS # per mode graph -tcsh ${scriptDir}/genWebpageData_WmopPerOperatingpoint.csh ${wmopsFilenameFlc}_WMOPS.csv ${destDir}/wmops/graphs_wmops_flc_perOP.js Graphs_WMOPS_perOP +tcsh ${scriptDir}/genWebpageData_WmopPerOperatingpoint.csh ${wmopsFilenameFlc}_WMOPS.csv ${destDir}/wmops/graphs_wmops_flc_perOP.js Graphs_WMOPS_perOP + # get memory info for webpage ### RAM -${scriptDir}/mergeNewsletterRam.py ${wmopsFilenameFlc}_SRAM.csv ${wmopsFilenameFlc}_DRAM.csv > ${wmopsFilenameFlc}_RAM.csv -${scriptDir}/parseNewsletterRam.py ${wmopsFilenameFlc}_SRAM.csv ${wmopsFilenameFlc}_DRAM.csv ${wmopsFilenameFlcLast}_RAM.csv ${commit_sha} ${shortDate} ${fullDate} >> ${destDir}/wmops/log_ram_all.txt +${scriptDir}/mergeNewsletterRam.py ${wmopsFilenameFlc}_HEAP.csv ${wmopsFilenameFlc}_STACK.csv > ${wmopsFilenameFlc}_RAM.csv +${scriptDir}/parseNewsletterRam.py ${wmopsFilenameFlc}_HEAP.csv ${wmopsFilenameFlc}_STACK.csv ${wmopsFilenameFlcLast}_RAM.csv ${commit_sha} ${shortDate} ${fullDate} >> ${destDir}/wmops/log_ram_all.txt # generate java script from database tcsh ${scriptDir}/genWebpageData_Ram.csh ${destDir}/wmops/log_ram_all.txt ${destDir}/wmops/graphs_ram_flc.js Graphs_RAM ### ROM -${scriptDir}/parseNewsletterRom.py ${wmopsFilenameFlc}_TABLES.csv ${wmopsFilenameFlcLast}_TABLES.csv ${commit_sha} ${shortDate} ${fullDate} >> ${destDir}/wmops/log_rom_all.txt + +${scriptDir}/mergeNewsletterRom.py ${wmopsFilenameFlc}_PROM.csv ${wmopsFilenameFlc}_TROM.csv > ${wmopsFilenameFlc}_ROM.csv +${scriptDir}/parseNewsletterRom.py ${wmopsFilenameFlc}_PROM.csv ${wmopsFilenameFlc}_TROM.csv ${wmopsFilenameFlcLast}_ROM.csv ${commit_sha} ${shortDate} ${fullDate} >> ${destDir}/wmops/log_rom_all.txt # generate java script from database tcsh ${scriptDir}/genWebpageData_Rom.csh ${destDir}/wmops/log_rom_all.txt ${destDir}/wmops/graphs_rom_flc.js Graphs_ROM -# now go on with BASOP -promFilenameBasopLast="null" -promScoreBasop=0 - -### PROM -${scriptDir}/parseNewsletterProm.py ${wmopsFilenameFlc}_PROM.csv ${wmopsFilenameFlcLast}_PROM.csv ${commit_sha} ${shortDate} ${fullDate} ${promScoreBasop} ${promFilenameBasopLast} >> ${destDir}/wmops/log_prom_all.txt - -# generate java script from database -tcsh ${scriptDir}/genWebpageData_Prom.csh ${destDir}/wmops/log_prom_all.txt ${destDir}/wmops/graphs_prom_flc.js Graphs_PROM diff --git a/ci/complexity_measurements/index_complexity.html b/ci/complexity_measurements/index_complexity.html index a131f56662034dcf7b31d61748c50a5fb1f7c9b3..23a1a68aed02c01754ac9f1fcbe5e70641153a6c 100755 --- a/ci/complexity_measurements/index_complexity.html +++ b/ci/complexity_measurements/index_complexity.html @@ -52,7 +52,6 @@ - @@ -103,30 +102,6 @@ - - - -
  • PROM - - - - - -
  • - - -
  • FAQ
  • @@ -226,25 +201,25 @@
    • Max. total RAM Codec: - Dynamic + Static RAM, 32 bit words, Encoder + Decoder
    • -
    • Max. total RAM - Encoder: Dynamic + Static RAM, 32 bit words, Encoder only
    • -
    • Max. total RAM - Decoder: Dynamic + Static RAM, 32 bit words, Decoder only
    • + 32 bit words, Encoder + Decoder +
    • Max. total RAM Encoder: + 32 bit words, Encoder only
    • +
    • Max. total RAM Decoder: + 32 bit words, Decoder only
    • -
    • Max. static RAM Codec: - Static RAM, 32 bit words, Encoder + Decoder
    • -
    • Max. static RAM - Encoder: Static RAM, 32 bit words,, Encoder only
    • -
    • Max. static RAM - Decoder: Static RAM, 32 bit words, Decoder only
    • +
    • Max. HEAP Codec: + 32 bit words, Encoder + Decoder
    • +
    • Max. HEAP Encoder + 32 bit words, Encoder only
    • +
    • Max. HEAP Decoder + 32 bit words, Decoder only
    • -
    • Max. dynamic RAM - Codec: Dynamic RAM, 32 bit words, Encoder + Decoder
    • -
    • Max. dynamic RAM - Encoder: Dynamic RAM, 32 bit words, Encoder only
    • -
    • Max. dynamic RAM - Decoder: Dynamic RAM, 32 bit words, Decoder only
    • +
    • Max. STACK Codec: + 32 bit words, max(Encoder, Decoder)
    • +
    • Max. STACK Encoder: + 32 bit words, Encoder only
    • +
    • Max. STACK Decoder: + 32 bit words, Decoder only
    @@ -284,8 +259,17 @@
      -
    • Measured ROM table size, 32 - bit words (Float)
    • +
    • Max. total ROM Codec: Encoder + Decoder
    • + +
    • Max. max PROM Encoder Library: lib_enc only
    • +
    • Max. max PROM Decoder Library: lib_dec only
    • +
    • Max. max PROM Common Library: lib_com only/li> +
    • Max. max PROM Ext Renderer Library: lib_ren only
    • + +
    • Max. Table ROM Encoder Library: lib_enc only
    • +
    • Max. Table ROM Decoder Library: lib_dec only
    • +
    • Max. Table ROM Common Library: lib_com only
    • +
    • Max. Table ROM Ext Renderer Library: lib_rend only
    @@ -308,22 +292,6 @@
    --> -

    IVAS FORMAT - Worst Case PROM Demand

    - -
    -
    -
    - -
    -
      -
    • Measured PROM (Float, - trunk)
    • - -
    -
    - -
    -

    FAQ

    Q:
    What is the meaning of these funny symbols in the navigation box, in the left upper corner of this page?
    @@ -821,25 +789,25 @@ function RAM() { if( item.series.id == "maxTotalRamDecScore" ){ text += "Max. total RAM dec: " + graph.runs[x].maxTotalRamDec + "
    "; } - if( item.series.id == "maxDynamicRamCodecScore" ){ - text += "Max. dynamic RAM enc: " + graph.runs[x].maxDynamicRamEnc + "
    "; - text += "Max. dynamic RAM dec: " + graph.runs[x].maxDynamicRamDec + "
    "; + if( item.series.id == "maxStackCodecScore" ){ + text += "Max. Stack enc: " + graph.runs[x].maxStackEnc + "
    "; + text += "Max. Stack dec: " + graph.runs[x].maxStackDec + "
    "; } - if( item.series.id == "maxDynamicRamEncScore" ){ - text += "Max. dynamic RAM enc: " + graph.runs[x].maxDynamicRamEnc + "
    "; + if( item.series.id == "maxStackEncScore" ){ + text += "Max. Stack enc: " + graph.runs[x].maxStackEnc + "
    "; } - if( item.series.id == "maxDynamicRamDecScore" ){ - text += "Max. dynamic RAM dec: " + graph.runs[x].maxDynamicRamDec + "
    "; + if( item.series.id == "maxStackDecScore" ){ + text += "Max. Stack dec: " + graph.runs[x].maxStackDec + "
    "; } - if( item.series.id == "maxStaticRamCodecScore" ){ - text += "Max. static RAM enc: " + graph.runs[x].maxStaticRamEnc + "
    "; - text += "Max. static RAM dec: " + graph.runs[x].maxStaticRamDec + "
    "; + if( item.series.id == "maxHeapCodecScore" ){ + text += "Max. Heap enc: " + graph.runs[x].maxHeapEnc + "
    "; + text += "Max. Heap dec: " + graph.runs[x].maxHeapDec + "
    "; } - if( item.series.id == "maxStaticRamEncScore" ){ - text += "Max. static RAM enc: " + graph.runs[x].maxStaticRamEnc + "
    "; + if( item.series.id == "maxHeapEncScore" ){ + text += "Max. Heap enc: " + graph.runs[x].maxHeapEnc + "
    "; } - if( item.series.id == "maxStaticRamDecScore" ){ - text += "Max. static RAM dec: " + graph.runs[x].maxStaticRamDec + "
    "; + if( item.series.id == "maxHeapDecScore" ){ + text += "Max. Heap dec: " + graph.runs[x].maxHeapDec + "
    "; } text += "
    " @@ -941,7 +909,8 @@ function ROM() { previousPoint = item.datapoint; $("#tooltip").remove(); - if(item.series.id != "requirementRom"){ + if(item.series.id != "requirementRom") + { var x = item.datapoint[0]; var y = item.datapoint[1]; var text = 'Score: ' + y; @@ -971,13 +940,49 @@ function ROM() { } } +/* + if( item.series.id == "TotalRomCodecScore" ){ + text += "Worst case enc: " + graph.runs[x].TotalRomEnc + "
    "; + text += "Worst case dec: " + graph.runs[x].TotalRomDec + "
    "; + } + if( item.series.id == "TotalRomEncScore" ){ + text += "Worst case enc: " + graph.runs[x].TotalRomEnc + "
    "; + } + if( item.series.id == "TotalRomDecScore" ){ + text += "Worst case dec: " + graph.runs[x].TotalRomDec + "
    "; + } + if( item.series.id == "PROMCodecScore" ){ + text += "Worst case enc: " + graph.runs[x].PromEnc + "
    "; + text += "Worst case dec: " + graph.runs[x].PromDec + "
    "; + } + if( item.series.id == "PROMEncScore" ){ + text += "Worst case enc: " + graph.runs[x].PromEnc + "
    "; + } + if( item.series.id == "PROMDecScore" ){ + text += "Worst case dec: " + graph.runs[x].PromDec + "
    "; + } + if( item.series.id == "TROMCodecScore" ){ + text += "Worst case enc: " + graph.runs[x].TromEnc + "
    "; + text += "Worst case dec: " + graph.runs[x].TromDec + "
    "; + } + if( item.series.id == "TROMEncScore" ){ + text += "Worst case enc: " + graph.runs[x].TromEnc + "
    "; + } + if( item.series.id == "TROMDecScore" ){ + text += "Worst case dec: " + graph.runs[x].TromDec + "
    "; + } +*/ + text += "
    " text += "Revision: " + graph.runs[x].revision + "
    "; text += "Date: " + graph.runs[x].fullDate + "

    "; + text += "Logfile
    "; + /* if( item.series.id == "maxRomFlc" ){ text += "Logfile
    "; } + */ /* if( item.series.id == "maxRomBasop" ){ @@ -1056,182 +1061,11 @@ function ROM() { */ } - - -function PROM() { - - var previousPoint = null; - - function drawGraph(elt, graph, max_val) { - var options = { - yaxis: { - min: 0, - max: max_val, - tickFormatter: function (v, axis) { - if (graph.direction == -1) - return v + " Ops"; - return v; - }, - invert: graph.direction == 1 - }, - xaxis: { - tickFormatter: function (v, axis) { - v = Math.round(v); - if (!(v in graph.runs)) - return ''; - return graph.runs[v].shortDate; - } - }, - legend: { show: false }, - grid: { - hoverable: true, - clickable: true - } - }; - - $.plot(elt, graph.displays, options); - - elt.bind("plothover", function (event, pos, item) { - if (!item) { - // only remove if not in tooltip anymore - if ($('#tooltip:hover').length == 0) { - $("#tooltip").remove(); - } - previousPoint = null; - return; - } - - if (previousPoint && - (previousPoint[0] == item.datapoint[0]) && - (previousPoint[1] == item.datapoint[1])) { - return; - } - - previousPoint = item.datapoint; - $("#tooltip").remove(); - - if(item.series.id != "requirementProm"){ - var x = item.datapoint[0]; - var y = item.datapoint[1]; - var text = 'Score: ' + y; - - if (graph.direction == -1) - text += " Ops"; - text += "
    "; - - if (x > 0) { - var thisValue = parseFloat(y); - var prevValue = parseFloat(item.series.data[x - 1, x - 1][1]); - var diff = Math.round((thisValue - prevValue) * 100) / 100; - var pdiff = calcPercentDiff(thisValue, prevValue); - var better; - if ((pdiff < 0 && graph.direction == -1) || - (pdiff > 0 && graph.direction == 1)) { - better = "worse"; - } else { - better = "better"; - } - pdiff = Math.abs(pdiff); - if (diff === diff) { - text += String.fromCharCode(916) + ": " + diff; - if (graph.direction == -1) - text += " Ops"; - text += " (" + pdiff + "% " + better + ")
    "; - } - } - - text += "
    " - text += "Revision: " + graph.runs[x].revision + "
    "; - text += "Date: " + graph.runs[x].fullDate + "

    "; - - if( item.series.id == "promOpsFlc" ){ - text += "Logfile
    "; - } - - if( item.series.id == "promOpsBasop" ){ - text += "Logfile
    "; - } - if( item.series.id == "promOpsBasopFlc" ){ - text += "Logfile
    "; - } - - } else { - text = "PROM requirement: 54260 Ops"; - } - - showToolTip(item.pageX, item.pageY, text); - - }); - } - - $(document).ready(function () { - var max = get_max_y_val_for_plotting(Graphs_PROM.prom_worstcase.displays, 50000); - drawGraph($("#prom-graph"), Graphs_PROM.prom_worstcase, max); - }); - - - /* FLC */ - var testData = Graphs_PROM.prom_worstcase.displays[1]; - var refData = Graphs_PROM.prom_worstcase.displays[0]; - var nEntries = testData.data.length; - - if( testData.data[nEntries-1][1] > refData.data[nEntries-1][1] ) { - document.getElementById("prom_tl_l").style.color="#FF0000"; - } else if( testData.data[nEntries-1][1] > 0.97 * refData.data[nEntries-1][1] ) { - document.getElementById("prom_tl_c").style.color="#FFFF00"; - } else { - document.getElementById("prom_tl_r").style.color="#00FF00"; - } - - if(nEntries > 1) { - if( testData.data[nEntries-1][1] > 1.01 * testData.data[nEntries-2][1] ) { - document.getElementById("prom_trend").innerHTML="↑"; - document.getElementById("prom_trend").style.color="#FF0000"; - } else if( testData.data[nEntries-1][1] < 0.99 * testData.data[nEntries-2][1] ) { - document.getElementById("prom_trend").innerHTML="↓"; - document.getElementById("prom_trend").style.color="#00FF00"; - } else { - document.getElementById("prom_trend").innerHTML="→"; - document.getElementById("prom_trend").style.color="#FFFFFF"; - } - } - - - /* BASOP */ - var testData = Graphs_PROM.prom_worstcase.displays[2]; - var refData = Graphs_PROM.prom_worstcase.displays[0]; - var nEntries = testData.data.length; - - if( testData.data[nEntries-1][1] > refData.data[nEntries-1][1] ) { - document.getElementById("prom_basop_tl_l").style.color="#FF0000"; - } else if( testData.data[nEntries-1][1] > 0.97 * refData.data[nEntries-1][1] ) { - document.getElementById("prom_basop_tl_c").style.color="#FFFF00"; - } else { - document.getElementById("prom_basop_tl_r").style.color="#00FF00"; - } - - if(nEntries > 1) { - if( testData.data[nEntries-1][1] > 1.01 * testData.data[nEntries-2][1] ) { - document.getElementById("prom_basop_trend").innerHTML="↑"; - document.getElementById("prom_basop_trend").style.color="#FF0000"; - } else if( testData.data[nEntries-1][1] < 0.99 * testData.data[nEntries-2][1] ) { - document.getElementById("prom_basop_trend").innerHTML="↓"; - document.getElementById("prom_basop_trend").style.color="#00FF00"; - } else { - document.getElementById("prom_basop_trend").innerHTML="→"; - document.getElementById("prom_basop_trend").style.color="#FFFFFF"; - } - } - -} - - WMOPS(); WMOPS_perOP(); RAM(); ROM(); - PROM(); diff --git a/ci/complexity_measurements/mergeNewsletterRam.py b/ci/complexity_measurements/mergeNewsletterRam.py index c5e61a98548b481cd6712f7c4263ae2bcd81603b..44dbe9b8487b5610cda78e40f195e00e4f0e1512 100755 --- a/ci/complexity_measurements/mergeNewsletterRam.py +++ b/ci/complexity_measurements/mergeNewsletterRam.py @@ -39,23 +39,23 @@ shortDate = "" fullDate = "" if __name__ == "__main__": - newsletterFilenameSram = sys.argv[1] - newsletterFilenameDram = sys.argv[2] + newsletterFilenameHEAP = sys.argv[1] + newsletterFilenameSTACK = sys.argv[2] ram_table = {} -with open(newsletterFilenameSram, "r") as csvfile: - SRAM = csv.reader(csvfile, delimiter=";") - for row in SRAM: +with open(newsletterFilenameHEAP, "r") as csvfile: + HEAP = csv.reader(csvfile, delimiter=";") + for row in HEAP: if row[0] == "conf": continue key = row[0] lst = row[1:] ram_table[key] = lst -with open(newsletterFilenameDram, "r") as csvfile: - DRAM = csv.reader(csvfile, delimiter=";") - for row in DRAM: +with open(newsletterFilenameSTACK, "r") as csvfile: + STACK = csv.reader(csvfile, delimiter=";") + for row in STACK: if row[0] == "conf": continue key = row[0] @@ -63,13 +63,13 @@ with open(newsletterFilenameDram, "r") as csvfile: ram_table[key] += lst # now we have the following format -# SRAM enc, SRAM dec, SRAM total, DRAM enc, DRAM dec, DRAM max(enc, dec) +# HEAP enc, HEAP dec, HEAP total, STACK enc, STACK dec, STACK max(enc, dec) -print("conf;sram enc;sram dec;sram total;dram enc;dram dec;dram max;total") +print("conf;HEAP enc;HEAP dec;HEAP total;STACK enc;STACK dec;STACK max;total") for key in ram_table: ram = ram_table[key] - total = int(ram[1]) + int(ram[2]) + int(ram[5]) + total = int(ram[0]) + int(ram[1]) + int(ram[5]) print( key, ";", diff --git a/ci/complexity_measurements/mergeNewsletterRom.py b/ci/complexity_measurements/mergeNewsletterRom.py new file mode 100755 index 0000000000000000000000000000000000000000..57b3ec1bd403b6a00f6b7de8eb3840f7e8d3ad48 --- /dev/null +++ b/ci/complexity_measurements/mergeNewsletterRom.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python3 +# coding: utf-8 + +# (C) 2022 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, +# Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., +# Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, +# Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other +# contributors to this repository. All Rights Reserved. + +# This software is protected by copyright law and by international treaties. +# The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, +# Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., +# Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, +# Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other +# contributors to this repository retain full ownership rights in their respective contributions in +# the software. This notice grants no license of any kind, including but not limited to patent +# license, nor is any license granted by implication, estoppel or otherwise. + +# Contributors are required to enter into the IVAS codec Public Collaboration agreement before making +# contributions. + +# This software is provided "AS IS", without any express or implied warranties. The software is in the +# development stage. It is intended exclusively for experts who have experience with such software and +# solely for the purpose of inspection. All implied warranties of non-infringement, merchantability +# and fitness for a particular purpose are hereby disclaimed and excluded. + +# Any dispute, controversy or claim arising under or in relation to providing this software shall be +# submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in +# accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and +# the United Nations Convention on Contracts on the International Sales of Goods. +import csv +import sys +import re + +newsletterFilename = "" +newsletterFilenameLast = "" +revision = "" +shortDate = "" +fullDate = "" + +if __name__ == "__main__": + newsletterFilenamePROM = sys.argv[1] + newsletterFilenameTROM = sys.argv[2] + +rom_table = {} + +with open(newsletterFilenamePROM, "r") as csvfile: + PROM = csv.reader(csvfile, delimiter=";") + for row in PROM: + if row[0] == "conf": + continue + key = row[0] + lst = row[1:] + rom_table[key] = lst + +with open(newsletterFilenameTROM, "r") as csvfile: + TROM = csv.reader(csvfile, delimiter=";") + for row in TROM: + if row[0] == "conf": + continue + key = row[0] + lst = row[1:] + rom_table[key] += lst + +# now we have the following format +# PROM enc, PROM dec, PROM com, PROM rend, PROM total, TROM enc, TROM dec, TROM com, TROM rend, TROM total + +print("conf;PROM enc;PROM dec;PROM com;PROM rend;PROM total;TROM enc;TROM dec;TROM com;TROM rend;TROM total;total") + +for key in rom_table: + rom = rom_table[key] + total = int(rom[4]) + int(rom[9]) + print( + key, + ";", + rom[0], + ";", + rom[1], + ";", + rom[2], + ";", + rom[3], + ";", + rom[4], + ";", + rom[5], + ";", + rom[6], + ";", + rom[7], + ";", + rom[8], + ";", + rom[9], + ";", + total, + sep="", + ) diff --git a/ci/complexity_measurements/parseNewsletterRam.py b/ci/complexity_measurements/parseNewsletterRam.py index b099fb450f955bccb69bb683ddcdc025192f633a..ccf338ea3cf00ebe75277709523ea85a8db46b49 100755 --- a/ci/complexity_measurements/parseNewsletterRam.py +++ b/ci/complexity_measurements/parseNewsletterRam.py @@ -41,8 +41,8 @@ shortDate = "" fullDate = "" if __name__ == "__main__": - newsletterFilenameSram = sys.argv[1] - newsletterFilenameDram = sys.argv[2] + newsletterFilenameHEAP = sys.argv[1] + newsletterFilenameSTACK = sys.argv[2] newsletterFilenameLast = sys.argv[3] revision = sys.argv[4] shortDate = sys.argv[5] @@ -52,28 +52,28 @@ max_total_enc = ["", 0] max_total_dec = ["", 0] max_total_encdec = ["", 0] -max_dynamic_enc = ["", 0] -max_dynamic_dec = ["", 0] -max_dynamic_encdec = ["", 0] +max_stack_enc = ["", 0] +max_stack_dec = ["", 0] +max_stack_encdec = ["", 0] -max_static_enc = ["", 0] -max_static_dec = ["", 0] -max_static_encdec = ["", 0] +max_heap_enc = ["", 0] +max_heap_dec = ["", 0] +max_heap_encdec = ["", 0] ram_table = {} -with open(newsletterFilenameSram, "r") as csvfile: - SRAM = csv.reader(csvfile, delimiter=";") - for row in SRAM: +with open(newsletterFilenameHEAP, "r") as csvfile: + HEAP = csv.reader(csvfile, delimiter=";") + for row in HEAP: if row[0] == "conf": continue key = row[0] lst = row[1:] ram_table[key] = lst -with open(newsletterFilenameDram, "r") as csvfile: - DRAM = csv.reader(csvfile, delimiter=";") - for row in DRAM: +with open(newsletterFilenameSTACK, "r") as csvfile: + STACK = csv.reader(csvfile, delimiter=";") + for row in STACK: if row[0] == "conf": continue key = row[0] @@ -81,76 +81,82 @@ with open(newsletterFilenameDram, "r") as csvfile: ram_table[key] += lst # now we have the following format -# SRAM enc, SRAM dec, SRAM total, DRAM enc, DRAM dec, DRAM max(enc, dec) +# HEAP enc, HEAP dec, HEAP total, STACK enc, STACK dec, STACK max(enc, dec), total for key in ram_table: ram = ram_table[key] - static_enc = int(ram[0]) - static_dec = int(ram[1]) - static_encdec = static_enc + static_dec + heap_enc = int(ram[0]) + heap_dec = int(ram[1]) + heap_encdec = heap_enc + heap_dec - dynamic_enc = int(ram[3]) - dynamic_dec = int(ram[4]) - dynamic_encdec = int(ram[5]) + stack_enc = int(ram[3]) + stack_dec = int(ram[4]) + stack_encdec = int(ram[5]) - total_enc = static_enc + dynamic_enc - total_dec = static_dec + dynamic_dec - total_encdec = static_encdec + dynamic_encdec + total_enc = heap_enc + stack_enc + total_dec = heap_dec + stack_dec + total_encdec = heap_encdec + stack_encdec - if static_enc > max_static_enc[1]: - max_static_enc[0] = re.sub(" ", "_", key) - max_static_enc[1] = static_enc + if heap_enc > max_heap_enc[1]: + max_heap_enc[0] = re.sub(" ", "_", key) + max_heap_enc[1] = heap_enc - if static_dec > max_static_dec[1]: - max_static_dec[0] = re.sub(" ", "_", key) - max_static_dec[1] = static_dec + if heap_dec > max_heap_dec[1]: + max_heap_dec[0] = re.sub(" ", "_", key) + max_heap_dec[1] = heap_dec - if static_encdec > max_static_encdec[1]: - max_static_encdec[0] = re.sub(" ", "_", key) - max_static_encdec[1] = static_encdec + if heap_encdec > max_heap_encdec[1]: + max_heap_encdec[0] = re.sub(" ", "_", key) + max_heap_encdec[1] = heap_encdec - if dynamic_enc > max_dynamic_enc[1]: - max_dynamic_enc[0] = re.sub(" ", "_", key) - max_dynamic_enc[1] = dynamic_enc + if stack_enc > max_stack_enc[1]: + max_stack_enc[0] = re.sub(" ", "_", key) + max_stack_enc[1] = stack_enc - if dynamic_dec > max_dynamic_dec[1]: - max_dynamic_dec[0] = re.sub(" ", "_", key) - max_dynamic_dec[1] = dynamic_dec + if stack_dec > max_stack_dec[1]: + max_stack_dec[0] = re.sub(" ", "_", key) + max_stack_dec[1] = stack_dec - if dynamic_encdec > max_dynamic_encdec[1]: - max_dynamic_encdec[0] = re.sub(" ", "_", key) - max_dynamic_encdec[1] = dynamic_encdec + if stack_encdec > max_stack_encdec[1]: + max_stack_encdec[0] = re.sub(" ", "_", key) + max_stack_encdec[1] = stack_encdec if total_enc > max_total_enc[1]: max_total_enc[0] = re.sub(" ", "_", key) max_total_enc[1] = total_enc - if total_dec > max_static_dec[1]: + if total_dec > max_total_dec[1]: max_total_dec[0] = re.sub(" ", "_", key) max_total_dec[1] = total_dec - if total_encdec > max_static_encdec[1]: + if total_encdec > max_total_encdec[1]: max_total_encdec[0] = re.sub(" ", "_", key) max_total_encdec[1] = total_encdec + print( - revision, - shortDate, - fullDate, - max_total_encdec[1], - max_total_enc[0], - max_total_enc[1], - max_total_dec[0], - max_total_dec[1], - max_dynamic_encdec[1], - max_dynamic_encdec[0], - max_dynamic_enc[1], - max_dynamic_dec[0], - max_dynamic_dec[1], - max_static_enc[1] + max_static_dec[1], - max_static_enc[0], - max_static_enc[1], - max_static_dec[0], - max_static_dec[1], - newsletterFilenameLast, + revision, # string revision $tmp[1] + shortDate, # string shortDate $tmp[2] + fullDate, # string fullDate $tmp[3] + + max_total_encdec[1], # value maxTotalRamCodecScore $tmp[4] + + max_total_enc[0], # string maxTotalRamEnc $tmp[5] + max_total_enc[1], # value maxTotalRamEnc $tmp[6] + max_total_dec[0], # string maxTotalRamDec $tmp[7] + max_total_dec[1], # value maxTotalRamDecScore $tmp[8] + + max_stack_encdec[1], # value maxStackCodecScore $tmp[9] + max_stack_enc[0], # string maxStackEnc $tmp[10] + max_stack_enc[1], # value maxStackEncScore $tmp[11] + max_stack_dec[0], # string maxStackDec $tmp[12] + max_stack_dec[1], # value maxStackDecScore $tmp[13] + + max_heap_encdec[1], # value maxHeapCodecScore $tmp[14] + max_heap_enc[0], # string maxHeapEnc $tmp[15] + max_heap_enc[1], # value maxHeapEncScore $tmp[16] + max_heap_dec[0], # string maxHeapDec $tmp[17] + max_heap_dec[1], # value maxHeapDecScore $tmp[19] + + newsletterFilenameLast, # string logFile $tmp[19] ) diff --git a/ci/complexity_measurements/parseNewsletterRom.py b/ci/complexity_measurements/parseNewsletterRom.py index aeb7ee26507afecf3c2f5f3b54add17e2a61fd5a..d16de8cb1e637ce75bcec9822a17052d39ff4d03 100755 --- a/ci/complexity_measurements/parseNewsletterRom.py +++ b/ci/complexity_measurements/parseNewsletterRom.py @@ -42,21 +42,127 @@ shortDate = "" fullDate = "" if __name__ == "__main__": - newsletterFilename = sys.argv[1] - newsletterFilenameLast = sys.argv[2] - revision = sys.argv[3] - shortDate = sys.argv[4] - fullDate = sys.argv[5] + newsletterFilenamePROM = sys.argv[1] + newsletterFilenameTROM = sys.argv[2] + newsletterFilenameLast = sys.argv[3] + revision = sys.argv[4] + shortDate = sys.argv[5] + fullDate = sys.argv[6] -max_total = ["", 0] +max_prom_enc = ["", 0] +max_prom_dec = ["", 0] +max_prom_com = ["", 0] +max_prom_rend = ["", 0] +max_prom_total = ["", 0] -with open(newsletterFilename, "r") as csvfile: - rom = csv.reader(csvfile, delimiter=";") - for row in rom: +max_trom_enc = ["", 0] +max_trom_dec = ["", 0] +max_trom_com = ["", 0] +max_trom_rend = ["", 0] +max_trom_total = ["", 0] + +max_total_encdec = ["", 0] + +rom_table = {} + +with open(newsletterFilenamePROM, "r") as csvfile: + PROM = csv.reader(csvfile, delimiter=";") + for row in PROM: + if row[0] == "conf": + continue + key = row[0] + lst = row[1:] + rom_table[key] = lst + +with open(newsletterFilenameTROM, "r") as csvfile: + TROM = csv.reader(csvfile, delimiter=";") + for row in TROM: if row[0] == "conf": continue - if int(row[4]) > max_total[1]: - max_total[0] = re.sub(" ", "_", row[0]) - max_total[1] = int(row[4]) + key = row[0] + lst = row[1:] + rom_table[key] += lst + +# now we have the following format +# PROM enc, PROM dec, PROM com, PROM rend, PROM total, TROM enc, TROM dec, TROM com, TROM rend, TROM total, total + +for key in rom_table: + rom = rom_table[key] + prom_enc = int(rom[0]) + prom_dec = int(rom[1]) + prom_com = int(rom[2]) + prom_rend = int(rom[3]) + prom_total = int(rom[4]) + + trom_enc = int(rom[5]) + trom_dec = int(rom[6]) + trom_com = int(rom[7]) + trom_rend = int(rom[8]) + trom_total = int(rom[9]) + + total_encdec = prom_total + trom_total + + if prom_enc > max_prom_enc[1]: + max_prom_enc[0] = re.sub(" ", "_", key) + max_prom_enc[1] = prom_enc + + if prom_dec > max_prom_dec[1]: + max_prom_dec[0] = re.sub(" ", "_", key) + max_prom_dec[1] = prom_dec + + if prom_com > max_prom_com[1]: + max_prom_com[0] = re.sub(" ", "_", key) + max_prom_com[1] = prom_com + + if prom_rend > max_prom_rend[1]: + max_prom_rend[0] = re.sub(" ", "_", key) + max_prom_rend[1] = prom_rend + + if trom_enc > max_trom_enc[1]: + max_trom_enc[0] = re.sub(" ", "_", key) + max_trom_enc[1] = trom_enc + + if trom_dec > max_trom_dec[1]: + max_trom_dec[0] = re.sub(" ", "_", key) + max_trom_dec[1] = trom_dec + + if trom_com > max_trom_com[1]: + max_trom_com[0] = re.sub(" ", "_", key) + max_trom_com[1] = trom_com + + if trom_rend > max_trom_rend[1]: + max_trom_rend[0] = re.sub(" ", "_", key) + max_trom_rend[1] = trom_rend + + if total_encdec > max_total_encdec[1]: + max_total_encdec[0] = re.sub(" ", "_", key) + max_total_encdec[1] = total_encdec + -print(revision, shortDate, fullDate, max_total[1], newsletterFilenameLast) +print( + revision, # string revision $tmp[1] + shortDate, # string shortDate $tmp[2] + fullDate, # string fullDate $tmp[3] + + max_total_encdec[1], # value maxTotalRomCodecScore $tmp[4] + + max_prom_enc[0], # string maxPROMEnc $tmp[5] + max_prom_enc[1], # value maxPROMEncScore $tmp[6] + max_prom_dec[0], # string maxPROMDec $tmp[7] + max_prom_dec[1], # value maxPROMDecScore $tmp[8] + max_prom_com[0], # string maxPROMCom $tmp[9] + max_prom_com[1], # value maxPROMComScore $tmp[10] + max_prom_rend[0], # string maxPROMRend $tmp[11] + max_prom_rend[1], # value maxPROMRendScore $tmp[12] + + max_trom_enc[0], # string maxTROMEnc $tmp[13] + max_trom_enc[1], # value maxTROMEncScore $tmp[14] + max_trom_dec[0], # string maxTROMDec $tmp[15] + max_trom_dec[1], # value maxTROMDecScore $tmp[16] + max_trom_com[0], # string maxTROMCom $tmp[17] + max_trom_com[1], # value maxTROMComScore $tmp[18] + max_trom_rend[0], # string maxTROMRend $tmp[19] + max_trom_rend[1], # value maxTROMRendScore $tmp[20] + + newsletterFilenameLast, # string logFile $tmp[21] +) diff --git a/lib_com/ACcontextMapping.c b/lib_com/ACcontextMapping.c index 27c51eb17920d51fee780f4f08c09838b6e38a51..d9170b7ea0ce931d81a23ab45f461894b1a77175 100644 --- a/lib_com/ACcontextMapping.c +++ b/lib_com/ACcontextMapping.c @@ -41,7 +41,7 @@ #endif #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * get_next_coeff_mapped() diff --git a/lib_com/ari.c b/lib_com/ari.c index 3b7ccfd9a41b3688e587d3237e0d04f7f1b48d05..55d88af2552563d68a4544dc95ab7887382faf4a 100644 --- a/lib_com/ari.c +++ b/lib_com/ari.c @@ -39,7 +39,7 @@ #include "prot.h" #include "basop_util.h" #include "cnst.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------- diff --git a/lib_com/ari_hm.c b/lib_com/ari_hm.c index 78e639ea91d95dbcfe2904ff15a2722d6f957659..1c3961b3ae10e50744ba71318ce81ac3d5fe958b 100644 --- a/lib_com/ari_hm.c +++ b/lib_com/ari_hm.c @@ -42,7 +42,7 @@ #include "basop_util.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * UnmapIndex() @@ -196,7 +196,7 @@ int16_t CountIndexBits( return 8; } -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP /*-------------------------------------------------------------------* * tcx_hm_render() @@ -301,3 +301,5 @@ void tcx_hm_modify_envelope( return; } + +#undef WMC_TOOL_SKIP diff --git a/lib_com/arith_coder.c b/lib_com/arith_coder.c index e534a23e04a7b57ddcac4d93293daf4ad812c59d..67fbb93691a3d23c1e2762a64c1903b7f77e093f 100644 --- a/lib_com/arith_coder.c +++ b/lib_com/arith_coder.c @@ -45,10 +45,11 @@ #include "prot.h" #include "basop_util.h" #include "basop_proto_func.h" -#include "wmops.h" +#include "wmc_auto.h" -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP + /*-------------------------------------------------------* * expfp() * @@ -573,3 +574,5 @@ void tcx_arith_render_envelope( return; } + +#undef WMC_TOOL_SKIP diff --git a/lib_com/basop32.c b/lib_com/basop32.c index b12e336e9c7aff2c033587ac3294198520160919..ec66c332813f393dc9f0ba9a345f0d33bf2dd9ce 100644 --- a/lib_com/basop32.c +++ b/lib_com/basop32.c @@ -30,7 +30,6 @@ *******************************************************************************************************/ -/* WMC_TOOL_SKIP_FILE (basic ops file) */ /* v.2.3 - 30.Nov.2009 ============================================================================= @@ -167,6 +166,8 @@ HISTORY: #include "ivas_error.h" #include "ivas_error_utils.h" +#define WMC_TOOL_SKIP + #ifdef _MSC_VER #pragma warning( disable : 4310 ) #endif @@ -3203,4 +3204,4 @@ Word32 L_msu0( Word32 L_var3, Word16 var1, Word16 var2 ) #endif /* ! BASOP_NOGLOB */ -/* end of file */ +#undef WMC_TOOL_SKIP diff --git a/lib_com/basop_com_lpc.c b/lib_com/basop_com_lpc.c index a24c100d54194aea6d1e68ffa944180ed912fa50..c0667f96f68253c462ab1b72360f8e5647f733a7 100644 --- a/lib_com/basop_com_lpc.c +++ b/lib_com/basop_com_lpc.c @@ -33,7 +33,6 @@ /*==================================================================================== EVS Codec 3GPP TS26.443 Nov 04, 2021. Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0 ====================================================================================*/ -/* WMC_TOOL_SKIP_FILE (basic ops file) */ #include #include @@ -41,10 +40,11 @@ #include "typedef.h" #include "basop_proto_func.h" #include "cnst.h" - #include "basop_util.h" #include "stl.h" +#define WMC_TOOL_SKIP + #define UNROLL_CHEBYSHEV_INNER_LOOP #define NC_MAX 8 #define GUESS_TBL_SZ 256 @@ -259,3 +259,5 @@ void basop_lsf2lsp( const Word16 lsf[], Word16 lsp[] ) return; } + +#undef WMC_TOOL_SKIP diff --git a/lib_com/basop_lsf_tools.c b/lib_com/basop_lsf_tools.c index 7a7e655f8105b17a8fc431af6a03010356774dfa..eeb42df4913d819c6e2604aebc89191d4922fb14 100644 --- a/lib_com/basop_lsf_tools.c +++ b/lib_com/basop_lsf_tools.c @@ -33,7 +33,6 @@ /*==================================================================================== EVS Codec 3GPP TS26.443 Nov 04, 2021. Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0 ====================================================================================*/ -/* WMC_TOOL_SKIP_FILE (basic ops file) */ #include #include @@ -42,6 +41,8 @@ #include "control.h" #include "basop_util.h" +#define WMC_TOOL_SKIP + #define NC_MAX 8 static Word16 E_LPC_f_lsp_pol_get( const Word16 lsp[], Word32 f[], const Word16 n, const Word16 past_Ovf, const Word16 isMODE1 ); @@ -309,3 +310,5 @@ static Word16 E_LPC_f_lsp_pol_get( } return Ovf; } + +#undef WMC_TOOL_SKIP diff --git a/lib_com/basop_mpy.c b/lib_com/basop_mpy.c index 478dff4cfe26010a55d055919b511f43f72b34d5..8c55d25e794dbbacfa23d05e0cd2a25481b23d9c 100644 --- a/lib_com/basop_mpy.c +++ b/lib_com/basop_mpy.c @@ -33,7 +33,6 @@ /*==================================================================================== EVS Codec 3GPP TS26.443 Nov 04, 2021. Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0 ====================================================================================*/ -/* WMC_TOOL_SKIP_FILE (basic ops file) */ #include "basop_mpy.h" #include @@ -42,6 +41,8 @@ #include "debug.h" #endif +#define WMC_TOOL_SKIP + Word32 Mpy_32_16_1( Word32 x, Word16 y ) { Word32 mh; @@ -87,3 +88,5 @@ Word32 Mpy_32_32( Word32 x, Word32 y ) return ( mh ); } + +#undef WMC_TOOL_SKIP diff --git a/lib_com/basop_tcx_utils.c b/lib_com/basop_tcx_utils.c index ea306d34b28018d647bfd7d523711e814f9641ff..5e744c2906a11d3bd28114a5908a02047e28def3 100644 --- a/lib_com/basop_tcx_utils.c +++ b/lib_com/basop_tcx_utils.c @@ -33,7 +33,6 @@ /*==================================================================================== EVS Codec 3GPP TS26.443 Nov 04, 2021. Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0 ====================================================================================*/ -/* WMC_TOOL_SKIP_FILE (basic ops file) */ #include #include @@ -47,6 +46,8 @@ #include "prot.h" #include "rom_com.h" +#define WMC_TOOL_SKIP + /* compare two positive normalized 16 bit mantissa/exponent values */ /* return value: positive if first value greater, negative if second value greater, zero if equal */ static Word16 compMantExp16Unorm( Word16 m1, Word16 e1, Word16 m2, Word16 e2 ) @@ -436,3 +437,5 @@ void basop_PsychAdaptLowFreqDeemph( Word32 x[], const Word16 lpcGains[], const W } } } + +#undef WMC_TOOL_SKIP diff --git a/lib_com/basop_util.c b/lib_com/basop_util.c index 71feed1276a96d36445669b05d6d1f4b4ac1f541..660de7cb9a2f3d594bc73af3a870f84988901e80 100644 --- a/lib_com/basop_util.c +++ b/lib_com/basop_util.c @@ -33,7 +33,6 @@ /*==================================================================================== EVS Codec 3GPP TS26.443 Nov 04, 2021. Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0 ====================================================================================*/ -/* WMC_TOOL_SKIP_FILE (basic ops file) */ #include #include @@ -48,6 +47,8 @@ #include "control.h" #include "cnst.h" +#define WMC_TOOL_SKIP + extern const Word32 SqrtTable[32]; extern const Word16 SqrtDiffTable[32]; @@ -1107,3 +1108,5 @@ Word32 Sqrt_l( return ( L_y ); } + +#undef WMC_TOOL_SKIP diff --git a/lib_com/bitalloc.c b/lib_com/bitalloc.c index 97acd28c58324406a85e835da7b3b30ff6159b23..3ee65a036b960f3eb65be793f981848da4286d57 100644 --- a/lib_com/bitalloc.c +++ b/lib_com/bitalloc.c @@ -44,7 +44,7 @@ #include "prot.h" #include "basop_util.h" #include "basop_proto_func.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------------- * bitalloc() @@ -221,7 +221,8 @@ void bitalloc( } -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP + /*-------------------------------------------------------------------* * BitAllocF() * @@ -1020,3 +1021,5 @@ int16_t BitAllocWB( return (Word16) t_fx; } + +#undef WMC_TOOL_SKIP diff --git a/lib_com/bitallocsum.c b/lib_com/bitallocsum.c index 124bf69fe5119fce2093c315560956749d49017a..99d409675899467b991a0f031795bbfd6c84595c 100644 --- a/lib_com/bitallocsum.c +++ b/lib_com/bitallocsum.c @@ -41,7 +41,7 @@ #endif #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------------- * bitallocsum() diff --git a/lib_com/bits_alloc.c b/lib_com/bits_alloc.c index e9f9878853d553b4b6439ba1f2a3905643dd256d..6217037c352993c80c72d86bc9dc8ceef520b444 100644 --- a/lib_com/bits_alloc.c +++ b/lib_com/bits_alloc.c @@ -43,7 +43,7 @@ #include "prot.h" #include "ivas_cnst.h" #include "ivas_rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local function prototypes diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index bb35fae4007f5bfe112c4a0bfff6745113cf0257..c75d192a34d62b2ad9e7aa45918e2a50f7d6be38 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -49,7 +49,7 @@ #include "ivas_prot.h" #include "ivas_cnst.h" #include "ivas_rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" #ifdef DEBUGGING @@ -622,7 +622,7 @@ uint16_t get_indice_1( return st->bit_stream[pos]; } -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP /*-------------------------------------------------------------------* * reset_indices_enc() @@ -2975,4 +2975,4 @@ void dtx_read_padding_bits( return; } -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP diff --git a/lib_com/calc_st_com.c b/lib_com/calc_st_com.c index 5f1c3776d9aa45174e3e60b2587d82d3810a3ade..642f6159fe8ffe37c28c3ab56cd059cf99821b4b 100644 --- a/lib_com/calc_st_com.c +++ b/lib_com/calc_st_com.c @@ -42,7 +42,7 @@ #include #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------------- diff --git a/lib_com/cb_shape.c b/lib_com/cb_shape.c index b44c46ab0f341c445e2495abfc250f4fd93616e5..306d1c9a458b60399f4175f61a6a002c4627793b 100644 --- a/lib_com/cb_shape.c +++ b/lib_com/cb_shape.c @@ -41,7 +41,7 @@ #endif #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * cb_shape() diff --git a/lib_com/cldfb.c b/lib_com/cldfb.c index 1d9fefcebb61432c0d2ecb4e47a917423e33b404..40c6db15bb6a086c481a09b29fce66aaca2b731b 100644 --- a/lib_com/cldfb.c +++ b/lib_com/cldfb.c @@ -44,7 +44,7 @@ #include "stat_dec.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" #if __STDC_VERSION__ >= 199901L #if defined __ICL @@ -706,7 +706,7 @@ ivas_error openCldfb( HANDLE_CLDFB_FILTER_BANK hs; int16_t buf_len; - hs = (HANDLE_CLDFB_FILTER_BANK) count_malloc( sizeof( CLDFB_FILTER_BANK ) ); + hs = (HANDLE_CLDFB_FILTER_BANK) malloc( sizeof( CLDFB_FILTER_BANK ) ); if ( hs == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for CLDFB" ); @@ -728,7 +728,7 @@ ivas_error openCldfb( buf_len = hs->p_filter_length; } - hs->cldfb_state = (float *) count_malloc( buf_len * sizeof( float ) ); + hs->cldfb_state = (float *) malloc( buf_len * sizeof( float ) ); if ( hs->cldfb_state == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for CLDFB" ); @@ -889,9 +889,9 @@ void deleteCldfb( { if ( hs->cldfb_state ) { - count_free( hs->cldfb_state ); + free( hs->cldfb_state ); } - count_free( hs ); + free( hs ); *h_cldfb = NULL; } @@ -1148,7 +1148,7 @@ ivas_error cldfb_save_memory( hs->memory_length = hs->p_filter_length; } - hs->memory = (float *) count_malloc( hs->memory_length * sizeof( float ) ); + hs->memory = (float *) malloc( hs->memory_length * sizeof( float ) ); if ( hs->memory == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CLDFB\n" ); @@ -1199,7 +1199,7 @@ void cldfb_restore_memory( } hs->memory_length = 0; - count_free( hs->memory ); + free( hs->memory ); hs->memory = NULL; return; diff --git a/lib_com/cng_exc.c b/lib_com/cng_exc.c index 62955ee95505a58be0c88b3c36a2b7336c7cae6a..58f6fa87beda1b69d684c90213aa3e6dc24e11ac 100644 --- a/lib_com/cng_exc.c +++ b/lib_com/cng_exc.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * Local constants diff --git a/lib_com/codec_tcx_common.c b/lib_com/codec_tcx_common.c index 98a2fb4bd012eed1c32bdb46233fc398d5ac6542..16bf165bbf4bed921e19d2c59c3c1e7602fe9af7 100644 --- a/lib_com/codec_tcx_common.c +++ b/lib_com/codec_tcx_common.c @@ -41,7 +41,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * tcxGetNoiseFillingTilt() diff --git a/lib_com/core_com_config.c b/lib_com/core_com_config.c index 7ffb4f0e9fd1fa702f962a5eb0a4fb38e81a1372..d6a2ce9adac5f485dbd0666298da950941116a8d 100644 --- a/lib_com/core_com_config.c +++ b/lib_com/core_com_config.c @@ -42,7 +42,7 @@ #endif #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" #include "ivas_prot.h" diff --git a/lib_com/deemph.c b/lib_com/deemph.c index 20b5c43719ffb01913991cc2508412b8549b4e85..4cfff30ba46887675eabf4235e7cc9138bb4fda0 100644 --- a/lib_com/deemph.c +++ b/lib_com/deemph.c @@ -40,7 +40,7 @@ #include "debug.h" #endif #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * deemph() diff --git a/lib_com/delay_comp.c b/lib_com/delay_comp.c index 6aa6a4d245219869622dd6b5f7a349f5e3c249b4..695cf01ff5de6643b812887ec15fc83d2cef9ec9 100644 --- a/lib_com/delay_comp.c +++ b/lib_com/delay_comp.c @@ -41,7 +41,7 @@ #endif #include "prot.h" #include "ivas_cnst.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------------- * get_delay() diff --git a/lib_com/disclaimer.c b/lib_com/disclaimer.c index 749f9fcce2541ad6b9f4c73f3c2e5c7dda36fbe1..8e55138dd8ed498df7ebf4efe03fdb720eb203ee 100644 --- a/lib_com/disclaimer.c +++ b/lib_com/disclaimer.c @@ -33,7 +33,6 @@ /*==================================================================================== EVS Codec 3GPP TS26.443 Nov 04, 2021. Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0 ====================================================================================*/ -/* WMC_TOOL_SKIP_FILE (basic ops file) */ #include #include "options.h" @@ -42,6 +41,8 @@ #endif #include "prot.h" +#define WMC_TOOL_SKIP + int16_t print_disclaimer( FILE *fPtr ) { diff --git a/lib_com/dlpc_bfi.c b/lib_com/dlpc_bfi.c index 33ba286c3c3312ca87ce46948cb5f287a6087b50..8adefe60a21e2cf2704be956514c55449c1f6573 100644 --- a/lib_com/dlpc_bfi.c +++ b/lib_com/dlpc_bfi.c @@ -42,7 +42,7 @@ #endif #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * routine: dlpc_bfi() diff --git a/lib_com/edct.c b/lib_com/edct.c index 8fe84049a60c56c19ede56a66e94db1ce988684e..9321b838a70d8ed83c5b7a5823ef3964747f5243 100644 --- a/lib_com/edct.c +++ b/lib_com/edct.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" #include /* for cosf, sinf */ static ivas_error get_edct_table( diff --git a/lib_com/enh1632.c b/lib_com/enh1632.c index 985398eec9fa3c98d02bec048df21178fefcb913..4f1373b84559f9674b13e834107576fc73123630 100644 --- a/lib_com/enh1632.c +++ b/lib_com/enh1632.c @@ -30,7 +30,6 @@ *******************************************************************************************************/ -/* WMC_TOOL_SKIP_FILE (basic ops file) */ /* =========================================================================== File: ENH1632.C v.2.3 - 30.Nov.2009 @@ -90,6 +89,8 @@ #include #include "stl.h" +#define WMC_TOOL_SKIP + /***************************************************************************** * * Constants and Globals @@ -629,5 +630,4 @@ Word32 L_rotl( Word32 L_var1, Word16 var2, Word16 *var3 ) return ( L_var_out ); } - -/* end of file */ +#undef WMC_TOOL_SKIP diff --git a/lib_com/enh40.c b/lib_com/enh40.c index 777bfffd8f0a41b3b72f65540c2afe4e5f00c915..1d987ce84cdbc1b64372decffd05d709d3bd7edd 100644 --- a/lib_com/enh40.c +++ b/lib_com/enh40.c @@ -30,7 +30,6 @@ *******************************************************************************************************/ -/* WMC_TOOL_SKIP_FILE (basic ops file) */ /* =========================================================================== File: ENH40.C v.2.3 - 30.Nov.2009 @@ -93,6 +92,7 @@ * Include-Files * *****************************************************************************/ + #include #include #include "stl.h" @@ -100,6 +100,8 @@ #include #endif /* BASOP_NOGLOB */ +#define WMC_TOOL_SKIP + #ifdef _MSC_VER #pragma warning( disable : 4310 ) #endif @@ -161,7 +163,6 @@ #ifndef BASOP_NOGLOB Word40 L40_shl( Word40 L40_var1, Word16 var2 ) #else /* BASOP_NOGLOB */ - Word40 L40_shl_o( Word40 L40_var1, Word16 var2, Flag *Overflow ) #endif /* BASOP_NOGLOB */ { @@ -189,11 +190,10 @@ Word40 L40_shl_o( Word40 L40_var1, Word16 var2, Flag *Overflow ) { #if defined( _MSC_VER ) && ( _MSC_VER <= 1200 ) if ( L40_var_out > 0x003fffffffff ) - { #else if ( L40_var_out > 0x003fffffffffLL ) - { #endif + { #ifndef BASOP_NOGLOB Overflow = 1; exit( 1 ); @@ -258,11 +258,10 @@ Word40 L40_shl( Word40 L40_var1, Word16 var2 ) { #if defined( _MSC_VER ) && ( _MSC_VER <= 1200 ) if ( L40_var_out > 0x003fffffffff ) - { #else if ( L40_var_out > 0x003fffffffffLL ) - { #endif + { assert( 0 ); L40_var_out = MAX_40; break; @@ -542,7 +541,6 @@ Word40 L40_add( Word40 L40_var1, Word40 L40_var2 ) #ifndef BASOP_NOGLOB Word40 L40_sub( Word40 L40_var1, Word40 L40_var2 ) #else /* BASOP_NOGLOB */ - Word40 L40_sub_o( Word40 L40_var1, Word40 L40_var2, Flag *Overflow ) #endif /* BASOP_NOGLOB */ { @@ -1308,4 +1306,4 @@ Word40 L40_shl_r( Word40 L40_var1, Word16 var2 ) } -/* end of file */ +#undef WMC_TOOL_SKIP diff --git a/lib_com/enhancer.c b/lib_com/enhancer.c index 2ed4271c05d55d80c41af33c08433d0b45134ab9..964f2845b72d61e60683185d68ccf4d3619011cb 100644 --- a/lib_com/enhancer.c +++ b/lib_com/enhancer.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * Local function prototypes diff --git a/lib_com/enr_1_az.c b/lib_com/enr_1_az.c index f5f88ed55c1d77fcfadf828948264bcd6bc21415..6c99e673b7129a57924bc31b6eece64a22c06db6 100644 --- a/lib_com/enr_1_az.c +++ b/lib_com/enr_1_az.c @@ -41,7 +41,7 @@ #endif #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * enr_1_Az() diff --git a/lib_com/env_adj.c b/lib_com/env_adj.c index a169311615a49f6a4cdf4147d930d28823667fd4..3f7fa94d8e1eb690507de0af438ee2bf33781739 100644 --- a/lib_com/env_adj.c +++ b/lib_com/env_adj.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------* * env_adj() diff --git a/lib_com/env_stab.c b/lib_com/env_stab.c index abe93eddcef7cfcfa6bff8996dc8f74ab216b693..d07c74874dffe00f06a5aab66a93b80288683071 100644 --- a/lib_com/env_stab.c +++ b/lib_com/env_stab.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" #ifdef DEBUGGING #include "assert.h" #endif diff --git a/lib_com/env_stab_trans.c b/lib_com/env_stab_trans.c index 6a8ca2b26645aae233641c08c60e5bd516eb053f..58ef2843d2034250eeab99554fd9cf8b59db3a39 100644 --- a/lib_com/env_stab_trans.c +++ b/lib_com/env_stab_trans.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------* * env_stab_transient_detect() diff --git a/lib_com/est_tilt.c b/lib_com/est_tilt.c index e126f761f8fc00c7b5cf8376be9e066a1381e543..8089d546ddedbeab32029b57d6f164e3db9a7a7b 100644 --- a/lib_com/est_tilt.c +++ b/lib_com/est_tilt.c @@ -41,7 +41,7 @@ #endif #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * est_tilt() diff --git a/lib_com/fd_cng_com.c b/lib_com/fd_cng_com.c index 98b5a3df750b16c2bc1bfc6a32848f768b804d5a..39431dca36e0c841b7e116c06eb951907739eb7b 100644 --- a/lib_com/fd_cng_com.c +++ b/lib_com/fd_cng_com.c @@ -43,7 +43,7 @@ #include #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------- @@ -68,7 +68,7 @@ ivas_error createFdCngCom( HANDLE_FD_CNG_COM hs; /* Allocate memory */ - hs = (HANDLE_FD_CNG_COM) count_malloc( sizeof( FD_CNG_COM ) ); + hs = (HANDLE_FD_CNG_COM) malloc( sizeof( FD_CNG_COM ) ); if ( hs == NULL ) { @@ -162,7 +162,7 @@ void deleteFdCngCom( if ( hsCom != NULL ) { - count_free( hsCom ); + free( hsCom ); *hFdCngCom = NULL; } diff --git a/lib_com/fft.c b/lib_com/fft.c index ed0d6604e6760440e4af923480a19f957c73cc70..8ce6b73a5ffd4031b3cc44806630dafeb812371b 100644 --- a/lib_com/fft.c +++ b/lib_com/fft.c @@ -44,7 +44,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" #ifdef _MSC_VER #pragma warning( disable : 4310 ) @@ -6393,7 +6393,7 @@ void rfft( } -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP #define SCALEFACTOR8 ( 4 ) #define SCALEFACTOR64 ( 7 ) @@ -6766,3 +6766,5 @@ void BASOP_cfft( return; } + +#undef WMC_TOOL_SKIP diff --git a/lib_com/fft_cldfb.c b/lib_com/fft_cldfb.c index 6967f87bcde8a7e6066b60991560e2044f991767..b2dcab8954395191c3dc4ff497368aef478b6225 100644 --- a/lib_com/fft_cldfb.c +++ b/lib_com/fft_cldfb.c @@ -39,7 +39,7 @@ #include #include "prot.h" #include "ivas_cnst.h" -#include "wmops.h" +#include "wmc_auto.h" #if __STDC_VERSION__ >= 199901L #if defined __ICL diff --git a/lib_com/fft_rel.c b/lib_com/fft_rel.c index a8b96e8217f50bf751bb0cb79c741bd5671b4489..e9d12d41a999a7752d8af72f9a61ff329bd767a3 100644 --- a/lib_com/fft_rel.c +++ b/lib_com/fft_rel.c @@ -41,7 +41,7 @@ #endif #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * Local constants diff --git a/lib_com/fill_spectrum.c b/lib_com/fill_spectrum.c index a3dbcf304b640025fe0ebb48970a45c796946fdf..e6923efc6a45922dcd50b4d6892d56d567248ff5 100644 --- a/lib_com/fill_spectrum.c +++ b/lib_com/fill_spectrum.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------* * fill_spectrum() diff --git a/lib_com/findpulse.c b/lib_com/findpulse.c index e26980d2250907d667ee5654508e695d733f135b..4b8acee231afefa2f8072c187f060a1a54ec1fc6 100644 --- a/lib_com/findpulse.c +++ b/lib_com/findpulse.c @@ -42,7 +42,7 @@ #include #include "prot.h" #include "cnst.h" -#include "wmops.h" +#include "wmc_auto.h" /*----------------------------------------------------------------------------------* * findpulse() diff --git a/lib_com/fine_gain_bits.c b/lib_com/fine_gain_bits.c index 240b174bef0d4b04836a4afff69b3b213a1ab367..8977479814f012679fe49bb4f1ff850c61150831 100644 --- a/lib_com/fine_gain_bits.c +++ b/lib_com/fine_gain_bits.c @@ -42,7 +42,7 @@ #include "rom_com.h" #include "prot.h" #include -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------------- * subband_gain_bits() diff --git a/lib_com/frame_ener.c b/lib_com/frame_ener.c index d5c38e6640fbbfd54e85cb79d07a83c47b3be320..ff10a6e9148259c3c8a1dbd015caf7e99909a22f 100644 --- a/lib_com/frame_ener.c +++ b/lib_com/frame_ener.c @@ -42,7 +42,7 @@ #include #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*----------------------------------------------------------------------------------* * fer_energy() diff --git a/lib_com/get_gain.c b/lib_com/get_gain.c index 320d5ad12ce246927b50b8f5da73f9a01848f0ab..0cc12d448225f341d29fe0754af0d424158b90de 100644 --- a/lib_com/get_gain.c +++ b/lib_com/get_gain.c @@ -40,7 +40,7 @@ #include "debug.h" #endif #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*----------------------------------------------------------------------------------* * get_gain() diff --git a/lib_com/gs_bitallocation.c b/lib_com/gs_bitallocation.c index 8458fb754fdf0044c80e2595977de7c9a34fdc9e..5015a6219ac055b5ad7df9944350f2e811e3c1e5 100644 --- a/lib_com/gs_bitallocation.c +++ b/lib_com/gs_bitallocation.c @@ -44,7 +44,7 @@ #include "rom_com.h" #include "prot.h" #include "ivas_prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local function prototypes diff --git a/lib_com/gs_gains.c b/lib_com/gs_gains.c index ea23b2778149d5d69599fc3b020364ba9e552949..4cc66d04b324d76015d03b78e86b91375db63d2a 100644 --- a/lib_com/gs_gains.c +++ b/lib_com/gs_gains.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local function prototypes diff --git a/lib_com/gs_inact_switching.c b/lib_com/gs_inact_switching.c index a9d2a80046e93d125437f1a782088a52e1d2100a..f02816080769ea8baa49c484b732ce8dfdf73aa3 100644 --- a/lib_com/gs_inact_switching.c +++ b/lib_com/gs_inact_switching.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local constants diff --git a/lib_com/gs_noisefill.c b/lib_com/gs_noisefill.c index 2885f324cabf420859365cebb3ac84fa7aeeb28a..23205aa5aab1bf4444f628560a70dd54c83910e7 100644 --- a/lib_com/gs_noisefill.c +++ b/lib_com/gs_noisefill.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * gs_noisf() diff --git a/lib_com/gs_preech.c b/lib_com/gs_preech.c index b7ab89a879ec5ab5267ae3e05d277d18d9fe49df..9a323db597f1a9b8527e7ab9624751dcdc4f8cca 100644 --- a/lib_com/gs_preech.c +++ b/lib_com/gs_preech.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local constants diff --git a/lib_com/guided_plc_util.c b/lib_com/guided_plc_util.c index cb14c503c895980513c8ac8a8c4e8b83cf389342..0c962db3af75af84c307f08d9f8fc6be6003ff16 100644 --- a/lib_com/guided_plc_util.c +++ b/lib_com/guided_plc_util.c @@ -38,7 +38,7 @@ #include "options.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local function prototypes diff --git a/lib_com/hp50.c b/lib_com/hp50.c index 58b15a4211759df7ce791dac0f6bd95e76704cf1..50287d78a91892936b640611f512395899239f92 100644 --- a/lib_com/hp50.c +++ b/lib_com/hp50.c @@ -41,7 +41,7 @@ #include "debug.h" #endif #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /* diff --git a/lib_com/hq2_bit_alloc.c b/lib_com/hq2_bit_alloc.c index 270c1306175779e042f4fc34728630f0a6e861dd..45bad10eb011673251ad6b1c78a64347abec90dc 100644 --- a/lib_com/hq2_bit_alloc.c +++ b/lib_com/hq2_bit_alloc.c @@ -45,9 +45,9 @@ #include "basop_util.h" #include "basop_mpy.h" #include "stl.h" -#include "wmops.h" +#include "wmc_auto.h" -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP /*------------------------------------------------------------------- * Local constants @@ -1046,3 +1046,5 @@ void hq2_bit_alloc( } return; } + +#undef WMC_TOOL_SKIP diff --git a/lib_com/hq2_core_com.c b/lib_com/hq2_core_com.c index 33411f9334f4a4be4fa4610b232538658a9a38c3..c02380af3897d562bd282caf3936d4e307407eea 100644 --- a/lib_com/hq2_core_com.c +++ b/lib_com/hq2_core_com.c @@ -45,7 +45,7 @@ #include "prot.h" #include "basop_util.h" #include "basop_proto_func.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------* * mdct_spectrum_denorm() @@ -306,7 +306,7 @@ void reverse_transient_frame_energies( return; } -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP void bit_allocation_second_fx( Word32 *Rk, Word32 *Rk_sort, @@ -415,7 +415,7 @@ void bit_allocation_second_fx( return; } -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP /*--------------------------------------------------------------------------* * spt_shorten_domain_pre() diff --git a/lib_com/hq2_noise_inject.c b/lib_com/hq2_noise_inject.c index 3eac77d81bb5c6ee6257879450b658d7cac9177a..5c112b60d9b45bc87c0f61d166505f8f6e2afe83 100644 --- a/lib_com/hq2_noise_inject.c +++ b/lib_com/hq2_noise_inject.c @@ -41,7 +41,7 @@ #endif #include #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------* * hq2_noise_inject() diff --git a/lib_com/hq_bit_allocation.c b/lib_com/hq_bit_allocation.c index fbb655e4f32d46e895bdc1aab14b9c3c6fbac152..221178d5b10c09b9fbf061aa752ed6c36f16edc0 100644 --- a/lib_com/hq_bit_allocation.c +++ b/lib_com/hq_bit_allocation.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------* * hq_bit_allocation() diff --git a/lib_com/hq_conf.c b/lib_com/hq_conf.c index ed548171a16629c02424cc01f78da39ddcc77cea..3a08d0de1ce7052d0bcebf287ce6eea4ed4eea48 100644 --- a/lib_com/hq_conf.c +++ b/lib_com/hq_conf.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------* * hq_configure() diff --git a/lib_com/hq_tools.c b/lib_com/hq_tools.c index 7a154a00a695890085459225c2f49727be3e789f..627590dd4210a7a5ce3d66b3914867f2b750dfeb 100644 --- a/lib_com/hq_tools.c +++ b/lib_com/hq_tools.c @@ -42,7 +42,7 @@ #include #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------* * Local function prototypes diff --git a/lib_com/hvq_pvq_bitalloc.c b/lib_com/hvq_pvq_bitalloc.c index 9357a37964c7ef055b42e156a329ab7f29e915ab..6004e35baaf8d6bb55fea1dd1b791344284443fe 100644 --- a/lib_com/hvq_pvq_bitalloc.c +++ b/lib_com/hvq_pvq_bitalloc.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------*/ /* Function hvq_pvq_bitalloc */ diff --git a/lib_com/ifft_rel.c b/lib_com/ifft_rel.c index d0200f87be07faf57c7d7b1976863b08be4d6f4d..ab3d68ac039305cd5a046a48ae8a04303ffd8522 100644 --- a/lib_com/ifft_rel.c +++ b/lib_com/ifft_rel.c @@ -41,7 +41,7 @@ #endif #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------* * Local constants diff --git a/lib_com/igf_base.c b/lib_com/igf_base.c index 70b202770a9c4188e3fcf44c6368cd5ebaa61afe..4d4c63f835e831328e2f82ea1447ce45e33bb8a7 100644 --- a/lib_com/igf_base.c +++ b/lib_com/igf_base.c @@ -42,7 +42,7 @@ #endif #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * IGF_ApplyTransFac() diff --git a/lib_com/index_pvq_opt.c b/lib_com/index_pvq_opt.c index e09c831dab77b5331c7809644c6925b9e469f162..e51906f02b859bd9f26bfacff2273b2f0bd9d1df 100644 --- a/lib_com/index_pvq_opt.c +++ b/lib_com/index_pvq_opt.c @@ -44,7 +44,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * LOCAL DEFINITIONS @@ -89,8 +89,7 @@ static int16_t local_norm_l_opt( { int16_t l32res; -#define WMC_TOOL_MAN - MAC( 1 ); +#define WMC_TOOL_SKIP if ( l32var == (int32_t) MINNEG ) { @@ -115,7 +114,7 @@ static int16_t local_norm_l_opt( } } } -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP return ( l32res ); } diff --git a/lib_com/int_lsp.c b/lib_com/int_lsp.c index 5e1175ab1e2dc944f230f3fb1ea763dc43bb25ce..d4d05d5f73c5c138cd772b57f7e3119bd5b0a02b 100644 --- a/lib_com/int_lsp.c +++ b/lib_com/int_lsp.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * int_lsp() diff --git a/lib_com/interleave_spectrum.c b/lib_com/interleave_spectrum.c index ae1432a1eb7b7d6527cebfd4ba3142fd5e3ede63..a6bc325189505a73999b63adbc043eda3340b6d2 100644 --- a/lib_com/interleave_spectrum.c +++ b/lib_com/interleave_spectrum.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------* * interleave_spectrum() diff --git a/lib_com/interpol.c b/lib_com/interpol.c index da4b41a9f9d593c4f7903f1a659d4f1366a78601..1fbd14cde50472ba6f56a315ba032b19eb0ff1e0 100644 --- a/lib_com/interpol.c +++ b/lib_com/interpol.c @@ -40,7 +40,7 @@ #include "debug.h" #endif #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * interpolation() @@ -70,10 +70,10 @@ float interpolation( for ( i = 0; i < nb_coef; i++ ) { s += ( *x1-- ) * ( *c1 ) + ( *x2++ ) * ( *c2 ); -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP c1 += up_samp; c2 += up_samp; -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP } return s; diff --git a/lib_com/isf_dec_amr_wb.c b/lib_com/isf_dec_amr_wb.c index 79eeda7b5464df8acbb1d41f7f32a656b60aa24e..6a4dd2d96c8bc31f9166fd90e76657280df06567 100644 --- a/lib_com/isf_dec_amr_wb.c +++ b/lib_com/isf_dec_amr_wb.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * isf_dec_amr_wb() diff --git a/lib_com/ivas_agc_com.c b/lib_com/ivas_agc_com.c index b02853555b0be40eb3a9e173628419269c9ae3ed..3716d3fa19253a20505f021df0143903dd0322be 100644 --- a/lib_com/ivas_agc_com.c +++ b/lib_com/ivas_agc_com.c @@ -39,7 +39,7 @@ #include "debug.h" #endif #include -#include "wmops.h" +#include "wmc_auto.h" #include "prot.h" /*------------------------------------------------------------------------------------------* diff --git a/lib_com/ivas_arith.c b/lib_com/ivas_arith.c index 9edbf5f53c1dd7cd031c1d7466a6d9b82a0c1c78..00fb12db2281ae6f8ddd5f548c45441b2e402f4b 100644 --- a/lib_com/ivas_arith.c +++ b/lib_com/ivas_arith.c @@ -35,7 +35,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" #include "prot.h" #include "ivas_prot.h" #include "stat_dec.h" diff --git a/lib_com/ivas_avq_pos_reorder_com.c b/lib_com/ivas_avq_pos_reorder_com.c index 66152d26fd6f84b861bc7190939ed3474030dfe4..79e31e9aaca3e704e28f39e065140378863d85e5 100644 --- a/lib_com/ivas_avq_pos_reorder_com.c +++ b/lib_com/ivas_avq_pos_reorder_com.c @@ -36,7 +36,7 @@ #include "debug.h" #endif #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------* * ordr_esti() diff --git a/lib_com/ivas_cov_smooth.c b/lib_com/ivas_cov_smooth.c index eaaec6a9821d9b554aa7e1f63cd7a1207aa796e0..842c97e8ee85087ee40b383ce76adce116645cb7 100644 --- a/lib_com/ivas_cov_smooth.c +++ b/lib_com/ivas_cov_smooth.c @@ -36,7 +36,7 @@ #include "debug.h" #endif #include "ivas_prot.h" -#include "wmops.h" +#include "wmc_auto.h" #include "prot.h" @@ -93,12 +93,12 @@ ivas_error ivas_spar_covar_smooth_enc_open( ivas_cov_smooth_state_t *hCovState; int16_t i, j; - if ( ( hCovState = (ivas_cov_smooth_state_t *) count_malloc( sizeof( ivas_cov_smooth_state_t ) ) ) == NULL ) + if ( ( hCovState = (ivas_cov_smooth_state_t *) malloc( sizeof( ivas_cov_smooth_state_t ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR COV encoder" ); } - if ( ( hCovState->pSmoothing_factor = (float *) count_malloc( sizeof( float ) * cov_smooth_cfg->max_bands ) ) == NULL ) + if ( ( hCovState->pSmoothing_factor = (float *) malloc( sizeof( float ) * cov_smooth_cfg->max_bands ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR COV encoder" ); } @@ -107,7 +107,7 @@ ivas_error ivas_spar_covar_smooth_enc_open( { for ( j = 0; j < nchan_inp; j++ ) { - if ( ( hCovState->pPrior_cov_real[i][j] = (float *) count_malloc( sizeof( float ) * cov_smooth_cfg->max_bands ) ) == NULL ) + if ( ( hCovState->pPrior_cov_real[i][j] = (float *) malloc( sizeof( float ) * cov_smooth_cfg->max_bands ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR COV encoder" ); } @@ -141,19 +141,19 @@ void ivas_spar_covar_smooth_enc_close( if ( hCovState != NULL ) { - count_free( hCovState->pSmoothing_factor ); + free( hCovState->pSmoothing_factor ); hCovState->pSmoothing_factor = NULL; for ( i = 0; i < nchan_inp; i++ ) { for ( j = 0; j < nchan_inp; j++ ) { - count_free( hCovState->pPrior_cov_real[i][j] ); + free( hCovState->pPrior_cov_real[i][j] ); hCovState->pPrior_cov_real[i][j] = NULL; } } - count_free( hCovState ); + free( hCovState ); hCovState_out = NULL; } diff --git a/lib_com/ivas_dirac_com.c b/lib_com/ivas_dirac_com.c index afb71a727898deeda4428000eeae55dc69b146d0..95f31b671a6100da2dbbba93c2a749746c822ac8 100644 --- a/lib_com/ivas_dirac_com.c +++ b/lib_com/ivas_dirac_com.c @@ -39,7 +39,7 @@ #include "ivas_prot.h" #include "prot.h" #include "cnst.h" -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------------* diff --git a/lib_com/ivas_entropy_coder_common.c b/lib_com/ivas_entropy_coder_common.c index 1bc72598e2734fa51940ca33ae269bfd1a1f187b..5bb17f455567efce47aee8828d2fe4d4585b0d0b 100644 --- a/lib_com/ivas_entropy_coder_common.c +++ b/lib_com/ivas_entropy_coder_common.c @@ -39,7 +39,7 @@ #include "ivas_rom_com.h" #include "math.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------------------------------* diff --git a/lib_com/ivas_fb_mixer.c b/lib_com/ivas_fb_mixer.c index 84bbdf09035a082a9e9884a0b0a120fc88c43d4c..8b48f60190c002ee142fd3ed40dd9f2963b7c6b3 100644 --- a/lib_com/ivas_fb_mixer.c +++ b/lib_com/ivas_fb_mixer.c @@ -40,7 +40,7 @@ #include "ivas_prot.h" #include "ivas_rom_com.h" #include -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------------------------* @@ -110,7 +110,7 @@ ivas_error ivas_fb_set_cfg( { IVAS_FB_CFG *pFb_cfg; - if ( ( pFb_cfg = (IVAS_FB_CFG *) count_malloc( sizeof( IVAS_FB_CFG ) ) ) == NULL ) + if ( ( pFb_cfg = (IVAS_FB_CFG *) malloc( sizeof( IVAS_FB_CFG ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer config" ); } @@ -187,14 +187,14 @@ ivas_error ivas_FB_mixer_open( frame_len = (int16_t) ( sampling_rate / FRAMES_PER_SEC ); - if ( ( hFbMixer = (IVAS_FB_MIXER_HANDLE) count_malloc( sizeof( IVAS_FB_MIXER_DATA ) ) ) == NULL ) + if ( ( hFbMixer = (IVAS_FB_MIXER_HANDLE) malloc( sizeof( IVAS_FB_MIXER_DATA ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer encoder" ); } if ( fb_cfg->num_out_chans > 0 ) { - if ( ( hFbMixer->pFb = (ivas_filterbank_t *) count_malloc( sizeof( ivas_filterbank_t ) ) ) == NULL ) + if ( ( hFbMixer->pFb = (ivas_filterbank_t *) malloc( sizeof( ivas_filterbank_t ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer encoder" ); } @@ -227,12 +227,12 @@ ivas_error ivas_FB_mixer_open( { j = fb_cfg->remix_order[i]; - if ( ( hFbMixer->ppFilterbank_inFR_re[j] = (float *) count_malloc( sizeof( float ) * frame_len ) ) == NULL ) + if ( ( hFbMixer->ppFilterbank_inFR_re[j] = (float *) malloc( sizeof( float ) * frame_len ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer encoder" ); } - if ( ( hFbMixer->ppFilterbank_inFR_im[j] = (float *) count_malloc( sizeof( float ) * frame_len ) ) == NULL ) + if ( ( hFbMixer->ppFilterbank_inFR_im[j] = (float *) malloc( sizeof( float ) * frame_len ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer encoder" ); } @@ -249,7 +249,7 @@ ivas_error ivas_FB_mixer_open( } for ( i = 0; i < num_chs_alloc; i++ ) { - if ( ( hFbMixer->ppFilterbank_prior_input[i] = (float *) count_malloc( sizeof( float ) * fb_cfg->prior_input_length ) ) == NULL ) + if ( ( hFbMixer->ppFilterbank_prior_input[i] = (float *) malloc( sizeof( float ) * fb_cfg->prior_input_length ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer encoder" ); } @@ -260,7 +260,7 @@ ivas_error ivas_FB_mixer_open( { float *pTemp_mem; - if ( ( pTemp_mem = (float *) count_malloc( sizeof( float ) * fb_cfg->num_out_chans * fb_cfg->num_in_chans * IVAS_MAX_NUM_BANDS ) ) == NULL ) + if ( ( pTemp_mem = (float *) malloc( sizeof( float ) * fb_cfg->num_out_chans * fb_cfg->num_in_chans * IVAS_MAX_NUM_BANDS ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer" ); } @@ -287,7 +287,7 @@ ivas_error ivas_FB_mixer_open( { for ( i = 0; i < num_bands; i++ ) { - if ( ( hFbMixer->pFb->fb_bin_to_band.pFb_bin_to_band[i] = (float *) count_malloc( sizeof( float ) * pActive_bins_per_band_abs[i] ) ) == NULL ) + if ( ( hFbMixer->pFb->fb_bin_to_band.pFb_bin_to_band[i] = (float *) malloc( sizeof( float ) * pActive_bins_per_band_abs[i] ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer encoder" ); } @@ -305,12 +305,12 @@ ivas_error ivas_FB_mixer_open( for ( j = start_diff_band_non48k; j < num_bands; j++ ) { - if ( ( hFbMixer->pFb->fb_consts.ppFilterbank_FRs_non48k[0][j] = (float *) count_malloc( sizeof( float ) * pActive_bins_per_band[j] ) ) == NULL ) + if ( ( hFbMixer->pFb->fb_consts.ppFilterbank_FRs_non48k[0][j] = (float *) malloc( sizeof( float ) * pActive_bins_per_band[j] ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer encoder" ); } - if ( ( hFbMixer->pFb->fb_consts.ppFilterbank_FRs_non48k[1][j] = (float *) count_malloc( sizeof( float ) * pActive_bins_per_band[j] ) ) == NULL ) + if ( ( hFbMixer->pFb->fb_consts.ppFilterbank_FRs_non48k[1][j] = (float *) malloc( sizeof( float ) * pActive_bins_per_band[j] ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer encoder" ); } @@ -377,10 +377,10 @@ void ivas_FB_mixer_close( { j = fb_cfg->remix_order[i]; - count_free( hFbMixer->ppFilterbank_inFR_re[j] ); + free( hFbMixer->ppFilterbank_inFR_re[j] ); hFbMixer->ppFilterbank_inFR_re[j] = NULL; - count_free( hFbMixer->ppFilterbank_inFR_im[j] ); + free( hFbMixer->ppFilterbank_inFR_im[j] ); hFbMixer->ppFilterbank_inFR_im[j] = NULL; } } @@ -395,13 +395,13 @@ void ivas_FB_mixer_close( } for ( i = 0; i < num_chs_alloc; i++ ) { - count_free( hFbMixer->ppFilterbank_prior_input[i] ); + free( hFbMixer->ppFilterbank_prior_input[i] ); hFbMixer->ppFilterbank_prior_input[i] = NULL; } if ( ( fb_cfg->active_w_mixing != -1 ) && ( fb_cfg->num_out_chans > 0 ) ) { - count_free( hFbMixer->prior_mixer[0][0] ); + free( hFbMixer->prior_mixer[0][0] ); hFbMixer->prior_mixer[0][0] = NULL; } @@ -413,7 +413,7 @@ void ivas_FB_mixer_close( { for ( i = 0; i < num_bands; i++ ) { - count_free( hFbMixer->pFb->fb_bin_to_band.pFb_bin_to_band[i] ); + free( hFbMixer->pFb->fb_bin_to_band.pFb_bin_to_band[i] ); hFbMixer->pFb->fb_bin_to_band.pFb_bin_to_band[i] = NULL; } } @@ -425,10 +425,10 @@ void ivas_FB_mixer_close( for ( j = start_diff_band_non48k; j < num_bands; j++ ) { - count_free( hFbMixer->pFb->fb_consts.ppFilterbank_FRs_non48k[0][j] ); + free( hFbMixer->pFb->fb_consts.ppFilterbank_FRs_non48k[0][j] ); hFbMixer->pFb->fb_consts.ppFilterbank_FRs_non48k[0][j] = NULL; - count_free( hFbMixer->pFb->fb_consts.ppFilterbank_FRs_non48k[1][j] ); + free( hFbMixer->pFb->fb_consts.ppFilterbank_FRs_non48k[1][j] ); hFbMixer->pFb->fb_consts.ppFilterbank_FRs_non48k[1][j] = NULL; } } @@ -436,17 +436,17 @@ void ivas_FB_mixer_close( if ( hFbMixer->pFb != NULL ) { - count_free( hFbMixer->pFb ); + free( hFbMixer->pFb ); hFbMixer->pFb = NULL; } if ( hFbMixer->fb_cfg != NULL ) { - count_free( hFbMixer->fb_cfg ); + free( hFbMixer->fb_cfg ); hFbMixer->fb_cfg = NULL; } - count_free( hFbMixer ); + free( hFbMixer ); hFbMixer = NULL; } diff --git a/lib_com/ivas_filters.c b/lib_com/ivas_filters.c index 898ba7fe896ddd2b031f849d583229e060834233..ae37910c6653697f914d0d1d3b051c8877810667 100644 --- a/lib_com/ivas_filters.c +++ b/lib_com/ivas_filters.c @@ -38,7 +38,7 @@ #include "ivas_prot.h" #include "ivas_cnst.h" #include "ivas_stat_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------------------------* diff --git a/lib_com/ivas_ism_config.c b/lib_com/ivas_ism_config.c index bf782e2a395498c4cba9cbb9f9ef46e20d64107f..a666c5594e719b912965786aebfe02757cd2a6a0 100644 --- a/lib_com/ivas_ism_config.c +++ b/lib_com/ivas_ism_config.c @@ -41,7 +41,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------------* diff --git a/lib_com/ivas_masa_com.c b/lib_com/ivas_masa_com.c index f98dcd8414a94f1b52c4b04337e0d5d4b3321e7b..5bec680806d253165b3409ca1406d1c8cf3d891f 100644 --- a/lib_com/ivas_masa_com.c +++ b/lib_com/ivas_masa_com.c @@ -42,7 +42,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------- * Local constants diff --git a/lib_com/ivas_mc_com.c b/lib_com/ivas_mc_com.c index a6ee0069ffff3b9b3d68f8dd7ddccf1ff1a5d0ae..f9f3803a28e2ea4e647cda95bfbfd2a9319cc682 100644 --- a/lib_com/ivas_mc_com.c +++ b/lib_com/ivas_mc_com.c @@ -39,7 +39,7 @@ #include #include "prot.h" #include "ivas_prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------- diff --git a/lib_com/ivas_mc_param_com.c b/lib_com/ivas_mc_param_com.c index 424e7cc4b98a289c5e79d59098e2fc0e5087dbb3..1102c3385ee74dda8d6f312c7c40dd855e160133 100644 --- a/lib_com/ivas_mc_param_com.c +++ b/lib_com/ivas_mc_param_com.c @@ -42,7 +42,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------- @@ -218,7 +218,7 @@ void ivas_param_mc_metadata_close( { if ( hMetadataPMC->icc_map_full[i] ) { - count_free( hMetadataPMC->icc_map_full[i] ); + free( hMetadataPMC->icc_map_full[i] ); hMetadataPMC->icc_map_full[i] = NULL; } } @@ -276,7 +276,7 @@ void ivas_param_mc_create_full_icc_mapping( /* allocate memory for the map */ for ( i = 0; i < 2; i++ ) { - icc_map[i] = (int16_t *) count_malloc( *icc_map_size_full * sizeof( int16_t ) ); + icc_map[i] = (int16_t *) malloc( *icc_map_size_full * sizeof( int16_t ) ); } /* create map (non-LFE ICCs) */ diff --git a/lib_com/ivas_mcmasa_com.c b/lib_com/ivas_mcmasa_com.c index 4c0f014bb0b00dbc357d554f032e23c5586b8447..3e63d721be88f1158c367bdd850ac15b569eb40d 100644 --- a/lib_com/ivas_mcmasa_com.c +++ b/lib_com/ivas_mcmasa_com.c @@ -36,7 +36,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------* diff --git a/lib_com/ivas_mct_com.c b/lib_com/ivas_mct_com.c index 97d7636a036a2fcbd4d912d50aefcfceb953b10b..33b9c975ee92e6372bdb7e67a3d5daba55a8f996 100644 --- a/lib_com/ivas_mct_com.c +++ b/lib_com/ivas_mct_com.c @@ -35,7 +35,7 @@ #include "ivas_cnst.h" #include "ivas_prot.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" #include diff --git a/lib_com/ivas_mdct_core_com.c b/lib_com/ivas_mdct_core_com.c index fd80b2d0547f92ebaec5ef7e06dca424ef405c24..32dba0ca7aea7084964e525da4c686506d0f04ec 100644 --- a/lib_com/ivas_mdct_core_com.c +++ b/lib_com/ivas_mdct_core_com.c @@ -35,7 +35,7 @@ #include "ivas_cnst.h" #include "ivas_prot.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------* * ivas_mdct_tcx10_bit_distribution() diff --git a/lib_com/ivas_mdct_imdct.c b/lib_com/ivas_mdct_imdct.c index 06b393acb3913df17f16146129e639487baafb07..71fbde2e4834f9da806ab5c502e6f3da76319f23 100644 --- a/lib_com/ivas_mdct_imdct.c +++ b/lib_com/ivas_mdct_imdct.c @@ -38,7 +38,7 @@ #include "debug.h" #endif #include "ivas_stat_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------------------------* diff --git a/lib_com/ivas_mdft_imdft.c b/lib_com/ivas_mdft_imdft.c index 61797d6746defa488ae35dc037f3607b59d9a5a4..c4e77186a502b4445dde4d7156448331cd3ea550 100644 --- a/lib_com/ivas_mdft_imdft.c +++ b/lib_com/ivas_mdft_imdft.c @@ -39,7 +39,7 @@ #endif #include "ivas_rom_com.h" #include -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------------------------------* diff --git a/lib_com/ivas_pca_tools.c b/lib_com/ivas_pca_tools.c index 21f3c0c1ecec0f0509d50a80db22aaec7094d582..62a6f543ff30c390ade226cdeae4aa47e3e9312d 100644 --- a/lib_com/ivas_pca_tools.c +++ b/lib_com/ivas_pca_tools.c @@ -40,7 +40,7 @@ #include #include #include "ivas_rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" #include "prot.h" diff --git a/lib_com/ivas_qmetadata_com.c b/lib_com/ivas_qmetadata_com.c index ee8cfd2f2f10de073c8647b8cfe7d740594752e6..86b0cf7c3e9b592b225e7b5e4f7072f264260a92 100644 --- a/lib_com/ivas_qmetadata_com.c +++ b/lib_com/ivas_qmetadata_com.c @@ -39,7 +39,7 @@ #include "ivas_prot.h" #include "prot.h" #include "cnst.h" -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------------* * Local constants @@ -65,7 +65,7 @@ ivas_error ivas_qmetadata_open( ) { /* allocate MetaData handle */ - if ( ( *hQMetaData = (IVAS_QMETADATA_HANDLE) count_malloc( sizeof( IVAS_QMETADATA ) ) ) == NULL ) + if ( ( *hQMetaData = (IVAS_QMETADATA_HANDLE) malloc( sizeof( IVAS_QMETADATA ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for Q MetaData" ); } @@ -126,7 +126,7 @@ ivas_error ivas_qmetadata_allocate_memory( hQMetaData->no_directions = ndirs; hQMetaData->coherence_flag = coherence_flag; - hQMetaData->q_direction = (IVAS_QDIRECTION *) count_malloc( sizeof( IVAS_QDIRECTION ) * ndirs ); + hQMetaData->q_direction = (IVAS_QDIRECTION *) malloc( sizeof( IVAS_QDIRECTION ) * ndirs ); reservationFailed = hQMetaData->q_direction == NULL; if ( !reservationFailed ) @@ -140,7 +140,7 @@ ivas_error ivas_qmetadata_allocate_memory( } else { - hQMetaData->q_direction[dir].band_data = (IVAS_QDIRECTION_BAND_DATA *) count_malloc( sizeof( IVAS_QDIRECTION_BAND_DATA ) * hQMetaData->q_direction[dir].cfg.nbands ); + hQMetaData->q_direction[dir].band_data = (IVAS_QDIRECTION_BAND_DATA *) malloc( sizeof( IVAS_QDIRECTION_BAND_DATA ) * hQMetaData->q_direction[dir].cfg.nbands ); { int16_t j; for ( j = 0; j < nbands; j++ ) @@ -156,7 +156,7 @@ ivas_error ivas_qmetadata_allocate_memory( if ( coherence_flag ) { - hQMetaData->q_direction[dir].coherence_band_data = (IVAS_QDIRECTION_BAND_COHERENCE_DATA *) count_malloc( sizeof( IVAS_QDIRECTION_BAND_COHERENCE_DATA ) * hQMetaData->q_direction[dir].cfg.nbands ); + hQMetaData->q_direction[dir].coherence_band_data = (IVAS_QDIRECTION_BAND_COHERENCE_DATA *) malloc( sizeof( IVAS_QDIRECTION_BAND_COHERENCE_DATA ) * hQMetaData->q_direction[dir].cfg.nbands ); reservationFailed |= hQMetaData->q_direction[dir].coherence_band_data == NULL; } else @@ -173,7 +173,7 @@ ivas_error ivas_qmetadata_allocate_memory( if ( coherence_flag ) { - hQMetaData->surcoh_band_data = (IVAS_SURROUND_COHERENCE_BAND_DATA *) count_malloc( sizeof( IVAS_SURROUND_COHERENCE_BAND_DATA ) * hQMetaData->q_direction[0].cfg.nbands ); + hQMetaData->surcoh_band_data = (IVAS_SURROUND_COHERENCE_BAND_DATA *) malloc( sizeof( IVAS_SURROUND_COHERENCE_BAND_DATA ) * hQMetaData->q_direction[0].cfg.nbands ); reservationFailed |= hQMetaData->surcoh_band_data == NULL; } else @@ -215,23 +215,23 @@ static void ivas_qmetadata_free_memory( { if ( hQMetaData->q_direction[dir].band_data != NULL ) { - count_free( hQMetaData->q_direction[dir].band_data ); + free( hQMetaData->q_direction[dir].band_data ); hQMetaData->q_direction[dir].band_data = NULL; } if ( hQMetaData->q_direction[dir].coherence_band_data != NULL ) { - count_free( hQMetaData->q_direction[dir].coherence_band_data ); + free( hQMetaData->q_direction[dir].coherence_band_data ); hQMetaData->q_direction[dir].coherence_band_data = NULL; } } - count_free( hQMetaData->q_direction ); + free( hQMetaData->q_direction ); hQMetaData->q_direction = NULL; } if ( hQMetaData->surcoh_band_data != NULL ) { - count_free( hQMetaData->surcoh_band_data ); + free( hQMetaData->surcoh_band_data ); hQMetaData->surcoh_band_data = NULL; } @@ -256,7 +256,7 @@ void ivas_qmetadata_close( ivas_qmetadata_free_memory( *hQMetaData ); - count_free( *hQMetaData ); + free( *hQMetaData ); *hQMetaData = NULL; return; diff --git a/lib_com/ivas_qspherical_com.c b/lib_com/ivas_qspherical_com.c index cf88d4da30c009c3a3e0744dc56d6b64c51f08e1..b5cd6060af38e284133e4c263fc5a57311225cf5 100644 --- a/lib_com/ivas_qspherical_com.c +++ b/lib_com/ivas_qspherical_com.c @@ -39,7 +39,7 @@ #include "ivas_prot.h" #include "prot.h" #include "cnst.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------- diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index c824c94a40f126a1adb3159a08c28d23e54b0d28..4de517508d30eeecb5c00ad99869d6e65b17c757 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -39,7 +39,7 @@ #include "cnst.h" #include "ivas_cnst.h" #include "ivas_rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /* clang-format off */ diff --git a/lib_com/ivas_sba_config.c b/lib_com/ivas_sba_config.c index 6fff0e49ddf9f4f25acdbbe2ff7f510a3ef9657c..64a8d94bd8709a8fdc1cfd5027c88b71b2b07767 100644 --- a/lib_com/ivas_sba_config.c +++ b/lib_com/ivas_sba_config.c @@ -44,7 +44,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* diff --git a/lib_com/ivas_sns_com.c b/lib_com/ivas_sns_com.c index cc0f07ffe0ec7bd32ab611bd4fb91989f23e540a..052486f97e5f8e57b09b7b638a656d4d5951e751 100644 --- a/lib_com/ivas_sns_com.c +++ b/lib_com/ivas_sns_com.c @@ -41,7 +41,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------- diff --git a/lib_com/ivas_spar_com.c b/lib_com/ivas_spar_com.c index c71dd97088e81b1578abe8dbe3dcd8f3bcd3746c..7aa02134c90c2ade2e390ae182bebf2e1751ba24 100644 --- a/lib_com/ivas_spar_com.c +++ b/lib_com/ivas_spar_com.c @@ -43,7 +43,7 @@ #include "ivas_rom_com.h" #include "cnst.h" #include -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------------------------* diff --git a/lib_com/ivas_spar_com_quant_util.c b/lib_com/ivas_spar_com_quant_util.c index c095e2010791f4b6865dadd13ad60c51f781b51a..7a6b0d2d8599263946351e7dd6ba56b9c095561e 100644 --- a/lib_com/ivas_spar_com_quant_util.c +++ b/lib_com/ivas_spar_com_quant_util.c @@ -40,7 +40,7 @@ #include "ivas_prot.h" #include "ivas_rom_com.h" #include -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------------------------------* * Function ivas_quantise_real_values() diff --git a/lib_com/ivas_stereo_dft_com.c b/lib_com/ivas_stereo_dft_com.c index 2b889dde0a9747fd6d95f07347e1c0a294972917..d541e0ed306583957abd1a0c704c830f7adbc156 100644 --- a/lib_com/ivas_stereo_dft_com.c +++ b/lib_com/ivas_stereo_dft_com.c @@ -38,7 +38,7 @@ #include "ivas_prot.h" #include "prot.h" #include "cnst.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------- * stereo_dft_config() diff --git a/lib_com/ivas_stereo_eclvq_com.c b/lib_com/ivas_stereo_eclvq_com.c index 76fcff139573a788984419435de761abd45fb3df..d0e87c5875c92c3430cd14dac65075fa77ea50a1 100644 --- a/lib_com/ivas_stereo_eclvq_com.c +++ b/lib_com/ivas_stereo_eclvq_com.c @@ -37,7 +37,7 @@ #include "ivas_cnst.h" #include #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------- * ECSQ_init_instance() diff --git a/lib_com/ivas_stereo_ica_com.c b/lib_com/ivas_stereo_ica_com.c index b35c438d2edee59b51bc853ecc3d5427fd0f73d2..1796cb88d1b071f7cbab2d88ae9f7114171577ba 100644 --- a/lib_com/ivas_stereo_ica_com.c +++ b/lib_com/ivas_stereo_ica_com.c @@ -40,7 +40,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" #include "rom_com.h" #include "ivas_rom_com.h" diff --git a/lib_com/ivas_stereo_mdct_bands_com.c b/lib_com/ivas_stereo_mdct_bands_com.c index 445eec09f9799a5455aec56705f58c092d215f23..5e51f944546730cc16a43fb46210328247065ee6 100644 --- a/lib_com/ivas_stereo_mdct_bands_com.c +++ b/lib_com/ivas_stereo_mdct_bands_com.c @@ -38,7 +38,7 @@ #include "ivas_prot.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local union diff --git a/lib_com/ivas_stereo_mdct_stereo_com.c b/lib_com/ivas_stereo_mdct_stereo_com.c index cbb1423cd1c6c7e735923fb6ee869965e5b790c8..13aac9de7089bb32dde7def1923ec872355dc367 100644 --- a/lib_com/ivas_stereo_mdct_stereo_com.c +++ b/lib_com/ivas_stereo_mdct_stereo_com.c @@ -34,7 +34,7 @@ #include "options.h" #include "ivas_cnst.h" #include "ivas_prot.h" -#include "wmops.h" +#include "wmc_auto.h" #include /*-------------------------------------------------------------------* diff --git a/lib_com/ivas_stereo_psychlpc_com.c b/lib_com/ivas_stereo_psychlpc_com.c index 8a50caaa29ce34a5b8eadd8fb577f926a276cd3e..52df610e791bdff8ad70ee07e912142c7bbda0b9 100644 --- a/lib_com/ivas_stereo_psychlpc_com.c +++ b/lib_com/ivas_stereo_psychlpc_com.c @@ -36,7 +36,7 @@ #include "ivas_prot.h" #include "prot.h" #include "ivas_prot.h" -#include "wmops.h" +#include "wmc_auto.h" #include /*-------------------------------------------------------------------* diff --git a/lib_com/ivas_stereo_td_bit_alloc.c b/lib_com/ivas_stereo_td_bit_alloc.c index 7d5b0afb5574e170a248273848f8925ce0ab090f..167cbafccd9bcff02071695cabe821323d1b5a38 100644 --- a/lib_com/ivas_stereo_td_bit_alloc.c +++ b/lib_com/ivas_stereo_td_bit_alloc.c @@ -42,7 +42,7 @@ #include "ivas_rom_com.h" #include "ivas_cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* diff --git a/lib_com/ivas_tools.c b/lib_com/ivas_tools.c index b8fbaa833ff71f8a22d5fb270b93b3f4a5e05d9e..15defd670ab53ed7c7eb97be1ef29ecf8b8109f8 100644 --- a/lib_com/ivas_tools.c +++ b/lib_com/ivas_tools.c @@ -39,7 +39,7 @@ #include #include "prot.h" #include "ivas_prot.h" -#include "wmops.h" +#include "wmc_auto.h" #include "ivas_rom_com.h" /*--------------------------------------------------------------- diff --git a/lib_com/ivas_transient_det.c b/lib_com/ivas_transient_det.c index 0b398ec9d156f7c5bb9bebf9e4d8e6fa0172e2c0..54e42ab8ffcf307de6562fe8dfa7a1758f311cf4 100644 --- a/lib_com/ivas_transient_det.c +++ b/lib_com/ivas_transient_det.c @@ -36,7 +36,7 @@ #include "debug.h" #endif #include "math.h" -#include "wmops.h" +#include "wmc_auto.h" #include "prot.h" #include "ivas_cnst.h" #include "ivas_prot.h" @@ -171,7 +171,7 @@ ivas_error ivas_spar_transient_det_open( { ivas_trans_det_state_t *hTranDet; - if ( ( hTranDet = (ivas_trans_det_state_t *) count_malloc( sizeof( ivas_trans_det_state_t ) ) ) == NULL ) + if ( ( hTranDet = (ivas_trans_det_state_t *) malloc( sizeof( ivas_trans_det_state_t ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR TD\n" ); } @@ -199,7 +199,7 @@ void ivas_spar_transient_det_close( return; } - count_free( *hTranDet ); + free( *hTranDet ); *hTranDet = NULL; return; diff --git a/lib_com/lag_wind.c b/lib_com/lag_wind.c index dba9f04de489a7a62cc79b107d121838f32a0e1b..3e5a10bcfa02c436d2456ce017873762c0d5255d 100644 --- a/lib_com/lag_wind.c +++ b/lib_com/lag_wind.c @@ -43,7 +43,7 @@ #include "prot.h" #include "cnst.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local constants diff --git a/lib_com/lerp.c b/lib_com/lerp.c index 4708dc5ca46a8c9159fb728662830596da90d7ad..0336ee0bb80a5b372b1f31499d72b48077301983 100644 --- a/lib_com/lerp.c +++ b/lib_com/lerp.c @@ -37,7 +37,7 @@ #include #include "options.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------* diff --git a/lib_com/limit_t0.c b/lib_com/limit_t0.c index 33a3ba42316a8c64a178dfffe4ae7482f3bdcb42..305d972626f65230589dbd9e302c1339af7f900b 100644 --- a/lib_com/limit_t0.c +++ b/lib_com/limit_t0.c @@ -41,7 +41,7 @@ #endif #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------* * Local constants diff --git a/lib_com/logqnorm.c b/lib_com/logqnorm.c index 50ecd83898ee302a758ddb6c91b9e74de9382158..788249e2f3de6e0e201995d0bcc16d13828b8530 100644 --- a/lib_com/logqnorm.c +++ b/lib_com/logqnorm.c @@ -44,7 +44,7 @@ #include "prot.h" #include "rom_com.h" #include "prot.h" /* Function prototypes */ -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------------- * logqnorm() diff --git a/lib_com/longarith.c b/lib_com/longarith.c index 2e5604d277ce8282485ac3b3e0fa3ded09c7ffb1..c8da255345cb3ea88344a8698e253fe5d08e55b5 100644 --- a/lib_com/longarith.c +++ b/lib_com/longarith.c @@ -38,7 +38,7 @@ #include #include "options.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* diff --git a/lib_com/low_rate_band_att.c b/lib_com/low_rate_band_att.c index 2ff62af41b8485eb9c0b751ec4beb7d14e51088f..5a13fe5f14f34b8c1ef8a3d4a327d83c72f5b3ac 100644 --- a/lib_com/low_rate_band_att.c +++ b/lib_com/low_rate_band_att.c @@ -42,7 +42,7 @@ #include #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------* * fine_gain_pred() diff --git a/lib_com/lpc_tools.c b/lib_com/lpc_tools.c index 7e84d83fb21f6e548a137dd855b90e3736759c8b..191374577d75f9d6d0fc86ca0acef139a785c95c 100644 --- a/lib_com/lpc_tools.c +++ b/lib_com/lpc_tools.c @@ -44,7 +44,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------* * Local constants diff --git a/lib_com/lsf_dec_bfi.c b/lib_com/lsf_dec_bfi.c index f6da9ffb21143c504ad7174b61d2169951dab5ba..4b4492aeba8140ef0ebdcc17d6b827a8561d954b 100644 --- a/lib_com/lsf_dec_bfi.c +++ b/lib_com/lsf_dec_bfi.c @@ -40,7 +40,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * routine: lsf_dec_bfi() diff --git a/lib_com/lsf_msvq_ma.c b/lib_com/lsf_msvq_ma.c index 0f091463bd87ee0edca0a245912fe8d657fe4a9c..ac98c88293d1e5431f7c5426604baeca859c2f48 100644 --- a/lib_com/lsf_msvq_ma.c +++ b/lib_com/lsf_msvq_ma.c @@ -45,7 +45,7 @@ #include "rom_com.h" #include "stl.h" #include "basop_proto_func.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * midlsf_dec() diff --git a/lib_com/lsf_tools.c b/lib_com/lsf_tools.c index 3fc93a05f7ed6915b47b871eb53857c80c9a4510..be9d2c0837ae37321f0a2063b9ac56286ba4e3c3 100644 --- a/lib_com/lsf_tools.c +++ b/lib_com/lsf_tools.c @@ -44,7 +44,7 @@ #include "prot.h" #include "rom_com.h" #include "basop_proto_func.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local function prototypes @@ -2079,7 +2079,7 @@ void msvq_dec( start = 0; } -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP v_add( uq + start, cb[i] + Idx[i] * maxn, uq + start, n ); IF( uq_ind != NULL ) @@ -2090,7 +2090,7 @@ void msvq_dec( uq_ind[start + j] = add( uq_ind[start + j], (Word16) ( cb[i][Idx[i] * maxn + j] * 2.0f * 1.28f ) ); } } -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP } return; diff --git a/lib_com/lsp_conv_poly.c b/lib_com/lsp_conv_poly.c index 1f882b5e904eb0556dbb31dc1f83d55f8a34f95d..7b3529202a005b74485dc88eefc5131227e15bc6 100644 --- a/lib_com/lsp_conv_poly.c +++ b/lib_com/lsp_conv_poly.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local constants diff --git a/lib_com/modif_fs.c b/lib_com/modif_fs.c index a817f0c34865d17ebe2c0da4cb255179d0df3046..d2618fd36d8dde33a3f5a8853ef5bf10564c6dc4 100644 --- a/lib_com/modif_fs.c +++ b/lib_com/modif_fs.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * modify_Fs() @@ -113,7 +113,7 @@ int16_t modify_Fs( } } -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP /* Retrieve and/or calculate the resampling parameters */ fac_num = cfg_ptr->fac_num; fac_den = (int16_t) ( ( cfg_ptr->fin * fac_num ) / cfg_ptr->fout ); @@ -133,7 +133,7 @@ int16_t modify_Fs( signal = signal_tab + 2 * L_FILT_MAX + L_FRAME48k - mem_len - lg; signal_ana = signal; mem_len_ana = mem_len; -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP } /*-------------------------------------------------------------------* diff --git a/lib_com/mslvq_com.c b/lib_com/mslvq_com.c index 4d0593ce56e3242437dea0cdbf349df50222493a..72db553cf3c134f0adae9ec3eff7bb8db64b12c8 100644 --- a/lib_com/mslvq_com.c +++ b/lib_com/mslvq_com.c @@ -39,7 +39,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" #include "ivas_prot.h" /*-----------------------------------------------------------------* diff --git a/lib_com/nelp.c b/lib_com/nelp.c index 63489ea27e74c0a5170bd68fb151784f369957a8..4c1243d31c2cab453d8a54c6252d95a37968cfa2 100644 --- a/lib_com/nelp.c +++ b/lib_com/nelp.c @@ -39,7 +39,7 @@ #include #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * dequantize_uvg() diff --git a/lib_com/options.h b/lib_com/options.h index 71bc0a070f56ba241cc9ae9b5e7b28c51bdacab3..5bf0435c0c5a16156c2e74409bc84309b8597b21 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -41,7 +41,6 @@ /* ################### Start compiler switches ######################## */ #define SUPPORT_JBM_TRACEFILE /* support for JBM tracefile, which is needed for 3GPP objective/subjective testing, but not relevant for real-world implementations */ -#define RAM_COUNTING_TOOL /* tool to automatically count the dynamically alocated static memory consumption */ /* #################### End compiler switches ######################### */ @@ -51,16 +50,14 @@ #ifndef RELEASE #define DEBUGGING /* Activate debugging part of the code */ #endif -/*#define WMOPS*/ /* Activate complexity and memory counters (! the codec must be already instrumented with the WMC Tool (use /ic and /op options) !) */ -/*#define WMOPS_PER_FRAME*/ /* Output complexity in WMOPS per frame to the file "res/wmops" (one float value per frame) */ -/*#define WMOPS_DETAIL*/ /* Activate complexity detail printout for every function. Increases runtime overhead */ -/*#define WMOPS_WC_FRAME_ANALYSIS*/ /* Output WMOPS analysis for worst case frame */ -/*#define RAM_ANALYSIS*/ /* Output memory allocated with count_malloc each frame. Can be parsed and plotted with scripts/mem_analysis.m */ +/*#define WMOPS*/ /* Activate complexity and memory counters */ +/*#define WMOPS_PER_FRAME*/ /* Output per-frame complexity (writes one float value per frame to the file "wmops_analysis") */ +/*#define WMOPS_DETAIL*/ /* Output detailed complexity printout for every function. Increases runtime overhead */ +/*#define WMOPS_WC_FRAME_ANALYSIS*/ /* Output detailed complexity analysis for the worst-case frame */ +/*#define MEM_COUNT_DETAILS*/ /* Output detailed memory analysis for the worst-case frame (writes to the file "mem_analysis.csv") */ #ifdef DEBUGGING -/*#define MEM_COUNT_DETAILS*/ /* RAM counting tool: print per sub-structure details */ - /*#define DEBUG_MODE_INFO*/ /* output most important parameters to the subdirectory "res/" */ #ifdef DEBUG_MODE_INFO /*#define DEBUG_MODE_ACELP*/ /* output most important ACELP core parameters to the subdirectory "res/" */ diff --git a/lib_com/parameter_bitmaping.c b/lib_com/parameter_bitmaping.c index 95d5b77bbe53f2295900696a6a533c959f642452..786e85e2fa5cb51d3786e63a4dedf4f9ba48f07f 100644 --- a/lib_com/parameter_bitmaping.c +++ b/lib_com/parameter_bitmaping.c @@ -42,7 +42,7 @@ #endif #include "stat_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /********************************/ @@ -117,9 +117,9 @@ void GetParameters( { ParamBitMap const *const param = ¶msBitMap->params[iParam]; -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP pSubStruct = param->GetParamValue( pParameter, index, &value ); -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP /* If a function for encoding/decoding value is defined than it should take care of 0 */ if ( param->fZeroAllowed || ( param->EncodeValue != NULL ) ) { @@ -130,9 +130,9 @@ void GetParameters( *( *pStream )++ = value - 1; } ++*pnSize; -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP *pnBits += ( param->nBits != 0 ) ? param->nBits : param->GetNumberOfBits( value, index ); -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP if ( ( param->pSubParamBitMap != NULL ) && ( value > 0 ) ) { GetParameters( param->pSubParamBitMap, value, ( pSubStruct != NULL ) ? pSubStruct : pParameter, pStream, pnSize, pnBits ); @@ -167,9 +167,9 @@ void SetParameters( /* If a function for encoding/decoding value is defined than it should take care of 0 */ value = *( *pStream )++ + ( param->fZeroAllowed || ( param->EncodeValue != NULL ) ? 0 : 1 ); -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP pSubStruct = param->SetParamValue( pParameter, index, value ); -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP ++*pnSize; if ( ( param->pSubParamBitMap != NULL ) && ( value > 0 ) ) { @@ -207,9 +207,9 @@ void WriteToBitstream( TEncodeValue EncodeValue; int16_t value; -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP nBits = ( param->nBits != 0 ) ? param->nBits : param->GetNumberOfBits( **pStream, index ); -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP fShiftValue = !param->fZeroAllowed && ( param->EncodeValue == NULL ); EncodeValue = ( param->EncodeValue == NULL ) ? &FixedWidthEncoding : param->EncodeValue; value = PutIntoBitstream( pStream, EncodeValue, index, hBstr, nBits ) + ( fShiftValue ? 1 : 0 ); diff --git a/lib_com/phase_dispersion.c b/lib_com/phase_dispersion.c index 7e1a1a4b14fcf8ff5589d52887ac5b81f4fe6c43..a61ff20f2b27714bd00d9d61967a3e884685786b 100644 --- a/lib_com/phase_dispersion.c +++ b/lib_com/phase_dispersion.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------------* * phase_dispersion() diff --git a/lib_com/ppp.c b/lib_com/ppp.c index 9008e1b441cb5b74d6ef64f9f3eeacd2c2b32684..d8dbc2363879e835288145d5b0bf8087093cc895 100644 --- a/lib_com/ppp.c +++ b/lib_com/ppp.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Interpol_delay() diff --git a/lib_com/pred_lt4.c b/lib_com/pred_lt4.c index 3226c31b5793929dbe65385bef3286b52550aca4..d319ae17cb3f36545695ccc3a2c7251433e3047c 100644 --- a/lib_com/pred_lt4.c +++ b/lib_com/pred_lt4.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * pred_lt4() diff --git a/lib_com/preemph.c b/lib_com/preemph.c index 32283198cdf420e3ed4531c0100e87cb2f8942d4..000c828444bb39ca5030f689684af47fbc179713 100644 --- a/lib_com/preemph.c +++ b/lib_com/preemph.c @@ -40,7 +40,7 @@ #include "debug.h" #endif #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------* * preemph() diff --git a/lib_com/prot.h b/lib_com/prot.h index 873db191454b90c898d08e5a2ca07780927ac9cf..24a74a72c44a80ad2301ad6012230a62aa42d8d8 100644 --- a/lib_com/prot.h +++ b/lib_com/prot.h @@ -37,15 +37,13 @@ #ifndef PROT_H #define PROT_H +#include +#include #include #include "options.h" #ifdef DEBUGGING #include "debug.h" #endif -#include -#ifndef RAM_COUNTING_TOOL -#include -#endif #include "typedef.h" #include "stat_enc.h" #include "stat_dec.h" @@ -55,28 +53,8 @@ #include "ivas_stat_dec.h" #include "cnst.h" #include "stl.h" -#ifdef RAM_COUNTING_TOOL -#include "mem_count.h" -#endif #include "ivas_error_utils.h" -/*----------------------------------------------------------------------------------* - * Prototypes of RAM counting tool macros - *----------------------------------------------------------------------------------*/ - -#ifdef RAM_COUNTING_TOOL -#define count_malloc( n1 ) MALLOC_FCT_CALL( n1 ) -#define count_calloc( n1, n2 ) CALLOC_FCT_CALL( n1, n2 ) -#define count_free( ptr ) FREE_FCT_CALL( ptr ) -#else -#define count_malloc( n1 ) malloc( n1 ) -#define count_calloc( n1, n2 ) calloc( n1, n2 ) -#define count_free( ptr ) free( ptr ) -#endif - -#define dynamic_malloc( n1 ) malloc( n1 ) -#define dynamic_calloc( n1, n2 ) calloc( n1, n2 ) -#define dynamic_free( n1 ) free( n1 ) /*----------------------------------------------------------------------------------* * Prototypes of global macros diff --git a/lib_com/pvq_com.c b/lib_com/pvq_com.c index 750c20adb9eb8c1450d7e3dc43cf444d5e3b2807..c45217f3543656e4ebf5405665616e96de31975e 100644 --- a/lib_com/pvq_com.c +++ b/lib_com/pvq_com.c @@ -44,7 +44,7 @@ #include "rom_com.h" #include "prot.h" #include "stl.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local definitions @@ -691,6 +691,8 @@ void srt_vec_ind_f( return; } +#define WMC_TOOL_SKIP + /*-------------------------------------------------------------------* * UMult_32_32() * @@ -814,7 +816,6 @@ Word16 atan2_fx( Word16 man, expo, reciprocal; Word16 angle, w, z; -#define WMC_TOOL_MAN IF( L_sub( x, 0 ) == 0 ) { return 25736; /* EVS_PI/2 in Q14 */ @@ -973,3 +974,5 @@ Word16 atan2_fx( return angle; /* Q14 between 0 and EVS_PI/2 radian. */ } + +#undef WMC_TOOL_SKIP diff --git a/lib_com/range_com.c b/lib_com/range_com.c index 083b95edbb4a68e23b43b9d81c5c80acbc7e5e6a..57c6de705b8844ce715554ce5b4f9033510ecd14 100644 --- a/lib_com/range_com.c +++ b/lib_com/range_com.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * rc_get_bits2() diff --git a/lib_com/re8_ppv.c b/lib_com/re8_ppv.c index ab48b24cedee2149923b35d5d0bde24d36f7871a..6239a1960d4782b36c6a5a20cf6cd9ca2c6d8916 100644 --- a/lib_com/re8_ppv.c +++ b/lib_com/re8_ppv.c @@ -41,8 +41,8 @@ #endif #include "cnst.h" #include "prot.h" -#include "wmops.h" -#include "wmops.h" +#include "wmc_auto.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local function prototypes diff --git a/lib_com/re8_util.c b/lib_com/re8_util.c index e4600774b4013e10bc8e25a5ae9423f365949ea4..c52bfdbd4c0bc8874cde5bb2b3ea629ff0f6c05c 100644 --- a/lib_com/re8_util.c +++ b/lib_com/re8_util.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* diff --git a/lib_com/realft.c b/lib_com/realft.c index 0c0b8236c56a600a27915a8fb73d58d7ede2d169..17db0602e79b5bc3698010d1e33dc77370b8e122 100644 --- a/lib_com/realft.c +++ b/lib_com/realft.c @@ -42,7 +42,7 @@ #endif #include #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * four1() diff --git a/lib_com/recovernorm.c b/lib_com/recovernorm.c index b5e35de26870acbf65af5f4c8965469e397c1b85..43ea89468cb0335d3c187d399d04028ed50922e4 100644 --- a/lib_com/recovernorm.c +++ b/lib_com/recovernorm.c @@ -42,7 +42,7 @@ #include "prot.h" #include "cnst.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------* * recovernorm() diff --git a/lib_com/reordvct.c b/lib_com/reordvct.c index a497f28e4a8b2a69b9ca0dbd4f67715a58fd88f4..0f517e1a0f7b0149ff4d590f818437c27f557ef1 100644 --- a/lib_com/reordvct.c +++ b/lib_com/reordvct.c @@ -40,7 +40,7 @@ #include "debug.h" #endif #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------* * reordvct() diff --git a/lib_com/residu.c b/lib_com/residu.c index a897f70f253baec9b0f38a79e762d2baa2eaa7e3..119057f9ca8499e6f0a687f020a92684f6242078 100644 --- a/lib_com/residu.c +++ b/lib_com/residu.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------* * residu() diff --git a/lib_com/rom_com.c b/lib_com/rom_com.c index e5f2b7ce0bdd3243104e9c1abc38e608e3f4ee4a..612d57713519c8b72f033208d3fe209128554e65 100644 --- a/lib_com/rom_com.c +++ b/lib_com/rom_com.c @@ -43,7 +43,7 @@ #include "rom_com.h" #include "prot.h" #include "basop_util.h" -#include "wmops.h" +#include "wmc_auto.h" /* clang-format off */ diff --git a/lib_com/stab_est.c b/lib_com/stab_est.c index 0ee40153a6207d0663b5df98c13098920c9c55eb..2ffadd655437afe45de581ca2c692604f9f71bfe 100644 --- a/lib_com/stab_est.c +++ b/lib_com/stab_est.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local constants diff --git a/lib_com/stat_noise_uv_mod.c b/lib_com/stat_noise_uv_mod.c index 72b843d1db418a5d348d2b7cde03f3bd8bfb5fae..0c37a663117317d21ec507bc563077d245448133 100644 --- a/lib_com/stat_noise_uv_mod.c +++ b/lib_com/stat_noise_uv_mod.c @@ -41,7 +41,7 @@ #endif #include #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * Local constants diff --git a/lib_com/swb_bwe_com.c b/lib_com/swb_bwe_com.c index 4e692fc22be61c7d46564faed3dad4ac07f6c834..9e9fc514057730c69fca25aab203497872ecd09c 100644 --- a/lib_com/swb_bwe_com.c +++ b/lib_com/swb_bwe_com.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * WB_BWE_gain_pred() diff --git a/lib_com/swb_bwe_com_hr.c b/lib_com/swb_bwe_com_hr.c index ebad781a99c4056a35e8c104f81913c28b7d25b0..4d4d67424868f19f4a93cc28d8d12564fc3f6576 100644 --- a/lib_com/swb_bwe_com_hr.c +++ b/lib_com/swb_bwe_com_hr.c @@ -41,7 +41,7 @@ #endif #include #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * swb_hr_nonzero_subband_noise_fill() diff --git a/lib_com/swb_bwe_com_lr.c b/lib_com/swb_bwe_com_lr.c index 963d881cb347378ab36d2eb03214795581872dea..15fe32156f21e7d4e87d5103de010845f1f6705c 100644 --- a/lib_com/swb_bwe_com_lr.c +++ b/lib_com/swb_bwe_com_lr.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * hf_parinitiz() diff --git a/lib_com/swb_tbe_com.c b/lib_com/swb_tbe_com.c index e30f5cc465e5a1673071f99108818f584779d888..feb5b68f1a136ac5c8047820ae1dae5db996f30b 100644 --- a/lib_com/swb_tbe_com.c +++ b/lib_com/swb_tbe_com.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" #include "ivas_prot.h" #include diff --git a/lib_com/syn_12k8.c b/lib_com/syn_12k8.c index 4323853f98348e1a3f4954f94931c427a9936dd1..96c462682afcbc4479df25e16842662ad807a1be 100644 --- a/lib_com/syn_12k8.c +++ b/lib_com/syn_12k8.c @@ -41,7 +41,7 @@ #endif #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------ * syn_12k8() diff --git a/lib_com/syn_filt.c b/lib_com/syn_filt.c index d571b9cb7f84ea8ae628bd18ada205b7295197e9..680fc55c5c5e46217fd921cb66b442bae5caac39 100644 --- a/lib_com/syn_filt.c +++ b/lib_com/syn_filt.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" #include /*------------------------------------------------------------------* diff --git a/lib_com/tcq_position_arith.c b/lib_com/tcq_position_arith.c index 4c3c49e197c0f94bfd0566d27e5e0e5116bc68df..ca8e26ae84b39746252b0c67f811a2c3b611a452 100644 --- a/lib_com/tcq_position_arith.c +++ b/lib_com/tcq_position_arith.c @@ -44,7 +44,7 @@ #include "rom_com.h" #include "basop_util.h" #include "basop_proto_func.h" -#include "wmops.h" +#include "wmc_auto.h" static void bitstream_save_bit( TCQ_PBITSTREAM pBS, const int16_t bit ); diff --git a/lib_com/tcx_ltp.c b/lib_com/tcx_ltp.c index 160a6e7875d79f59c00132a1739e153b15cf53cd..ef119c62cb96f391f64efd045044dc6310edf25b 100644 --- a/lib_com/tcx_ltp.c +++ b/lib_com/tcx_ltp.c @@ -42,7 +42,7 @@ #endif #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------- * Local constants diff --git a/lib_com/tcx_mdct.c b/lib_com/tcx_mdct.c index d9713c9cfcf16be802e9d5ef8e61640e72db0ed1..88ede107f44231e465d63f1d339345ec68f40332 100644 --- a/lib_com/tcx_mdct.c +++ b/lib_com/tcx_mdct.c @@ -39,7 +39,7 @@ #include #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * TCX_MDCT() diff --git a/lib_com/tcx_mdct_window.c b/lib_com/tcx_mdct_window.c index 2d1d474404858a9edc7438a2bbaadf2d9d710b35..c73f782c959756c68466557a46582b6cfe2fb93d 100644 --- a/lib_com/tcx_mdct_window.c +++ b/lib_com/tcx_mdct_window.c @@ -44,7 +44,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------- * mdct_window_sine() diff --git a/lib_com/tcx_utils.c b/lib_com/tcx_utils.c index 6e868add48f8ebdf4b92448318d2b017149bdb40..42c5bce0367beb3e00ebf832556f2353b1c999be 100644 --- a/lib_com/tcx_utils.c +++ b/lib_com/tcx_utils.c @@ -44,7 +44,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * tcx_get_windows() diff --git a/lib_com/tec_com.c b/lib_com/tec_com.c index 18b2e79b94e8f6500f345825dff9610813cb7631..0aa4294289e7919345a27e97f561f65c77d64256 100644 --- a/lib_com/tec_com.c +++ b/lib_com/tec_com.c @@ -41,7 +41,7 @@ #include "rom_com.h" #include "prot.h" #include "stat_dec.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------- * Local constants diff --git a/lib_com/tns_base.c b/lib_com/tns_base.c index 94b014b59bc64027ccf0296826cbdde8b66768ca..7327c6c9a9f8a9e0f128f47b2327b0e1fe779d46 100644 --- a/lib_com/tns_base.c +++ b/lib_com/tns_base.c @@ -41,7 +41,7 @@ #include "rom_com.h" #include "prot.h" #include "stat_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------------- diff --git a/lib_com/tools.c b/lib_com/tools.c index 2ab9952c0cf7ee4eee43e616cd7b1febde887380..6336de64c199b941aeda77106c25eb05e2e62977 100644 --- a/lib_com/tools.c +++ b/lib_com/tools.c @@ -41,7 +41,7 @@ #endif #include #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------* * own_random() @@ -1446,8 +1446,7 @@ void polezero_filter( return; } -#define WMC_TOOL_MAN - +#define WMC_TOOL_SKIP static float fleft_shift( float input, const int16_t shift ) { return ( input * (float) pow( 2.0, (double) shift ) ); @@ -1457,7 +1456,7 @@ static float fright_shift( float input, const int16_t shift ) { return ( input * (float) pow( 0.5, (double) shift ) ); } -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP /*--------------------------------------------------------------------------------* @@ -1487,7 +1486,7 @@ float root_a( return 0.0; } -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP /* This next piece of code implements a "norm" function */ /* and returns the shift needed to scale "a" to have a */ /* 1 in the (MSB-1) position. This is equivalent to */ @@ -1506,7 +1505,7 @@ float root_a( mod_a *= 2.0; shift_a++; } -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP shift_a &= 0xfffe; mod_a = fleft_shift( a, shift_a ); @@ -1554,21 +1553,23 @@ float root_a_over_b( { return 0.0; } -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP if ( isinf( a ) ) +#undef WMC_TOOL_SKIP { return FLT_MAX; } +#define WMC_TOOL_SKIP if ( isinf( b ) ) +#undef WMC_TOOL_SKIP { return 0.f; } -#undef WMC_TOOL_MAN a += 0x00000001; b += 0x00000001; -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP /* This next piece of code implements a "norm" function */ /* and returns the shift needed to scale "a" to have a */ /* 1 in the (MSB-1) position. This is equivalent to */ @@ -1587,12 +1588,12 @@ float root_a_over_b( mod_a *= 2.0; shift_a++; } -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP shift_a &= 0xfffe; mod_a = fleft_shift( a, shift_a ); -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP /* This next piece of code implements a "norm" function */ /* and returns the shift needed to scale "b" to have a */ /* 1 in the (MSB-1) position. This is equivalent to */ @@ -1611,7 +1612,7 @@ float root_a_over_b( mod_b *= 2.0; shift_b++; } -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP shift_b &= 0xfffe; mod_b = fleft_shift( b, shift_b ); diff --git a/lib_com/trans_direct.c b/lib_com/trans_direct.c index d6e35d583eda5bf7ccf39a7192f7c2ee84d207f9..2d65b87c528b7a86a9bd20ae4b25336d9a841369 100644 --- a/lib_com/trans_direct.c +++ b/lib_com/trans_direct.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------- * direct_transform() diff --git a/lib_com/trans_inv.c b/lib_com/trans_inv.c index 18c5fe0431e33607140874eb7d535d882eba935b..be153ab5695b3acd00a384458a65c11fcbebe7cc 100644 --- a/lib_com/trans_inv.c +++ b/lib_com/trans_inv.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------* * Local constants diff --git a/lib_com/vlpc_2st_com.c b/lib_com/vlpc_2st_com.c index 86fdf68c5ff96114e7cc32be3f1f420811c94d25..32a1bd85599c303fd99bd384ef5b59cc3d16807a 100644 --- a/lib_com/vlpc_2st_com.c +++ b/lib_com/vlpc_2st_com.c @@ -40,7 +40,7 @@ #include #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------* * lsf_weight_2st() diff --git a/lib_com/weight.c b/lib_com/weight.c index e50707b68821764d48b88c44799f57c09d8ae3ab..99b0c74927c6754421a7caede6e0e538a6648a78 100644 --- a/lib_com/weight.c +++ b/lib_com/weight.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------* * sfm2mqb() diff --git a/lib_com/weight_a.c b/lib_com/weight_a.c index 0eda2133cea20421320bb8ac3ef9ad1f735270c3..dccb61bcdaa49e9e845c79e2dc82cdf97a07d2b5 100644 --- a/lib_com/weight_a.c +++ b/lib_com/weight_a.c @@ -40,7 +40,7 @@ #include "debug.h" #endif #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------ * weight_a() diff --git a/lib_com/wi.c b/lib_com/wi.c index b0d16671b043d4e02e175df858bc9018af7df377..6cfc018aadb53e47ae7713ff5f493ddff5970e63 100644 --- a/lib_com/wi.c +++ b/lib_com/wi.c @@ -40,11 +40,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" - -#ifdef FIX_VBR_COMPLEXITY -#define WMC_TOOL_MAN -#endif +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local constants @@ -77,7 +73,7 @@ ivas_error DTFS_new( int16_t i; DTFS_STRUCTURE *dtfs = NULL; - dtfs = (DTFS_STRUCTURE *) dynamic_malloc( sizeof( DTFS_STRUCTURE ) ); + dtfs = (DTFS_STRUCTURE *) malloc( sizeof( DTFS_STRUCTURE ) ); if ( dtfs == NULL ) { @@ -85,10 +81,10 @@ ivas_error DTFS_new( } #ifdef FIX_VBR_COMPLEXITY +#define WMC_TOOL_SKIP MOVE( 2 ); LOOP( 1 ); MOVE( 2 ); -#endif dtfs->lag = 0; dtfs->nH = 0; dtfs->nH_4kHz = 0; @@ -103,6 +99,24 @@ ivas_error DTFS_new( dtfs->sampling_rate = -1; *dtfs_out = dtfs; +#undef WMC_TOOL_SKIP +#else + dtfs->lag = 0; + dtfs->nH = 0; + dtfs->nH_4kHz = 0; + dtfs->upper_cut_off_freq_of_interest = 3300.0; + dtfs->upper_cut_off_freq = 4000.0; + + for ( i = 0; i < MAXLAG_WI; i++ ) + { + dtfs->a[i] = dtfs->b[i] = 0.0; + } + + dtfs->sampling_rate = -1; + + *dtfs_out = dtfs; +#endif + return IVAS_ERR_OK; } @@ -120,6 +134,7 @@ void DTFS_copy( { int16_t k; #ifdef FIX_VBR_COMPLEXITY +#define WMC_TOOL_SKIP LOOP( 1 ); for ( k = 0; k < MAXLAG_WI; k++ ) { @@ -138,6 +153,7 @@ void DTFS_copy( Xout->nH_4kHz = Xinp.nH_4kHz; Xout->upper_cut_off_freq_of_interest = Xinp.upper_cut_off_freq_of_interest; Xout->upper_cut_off_freq = Xinp.upper_cut_off_freq; +#undef WMC_TOOL_SKIP #else for ( k = 0; k < MAXLAG_WI; k++ ) { @@ -174,6 +190,7 @@ void DTFS_sub( int16_t i; #ifdef FIX_VBR_COMPLEXITY +#define WMC_TOOL_SKIP MULT( 1 ); LOOP( 1 ); for ( i = 0; i <= X1.lag / 2; i++ ) @@ -199,6 +216,7 @@ void DTFS_sub( tmp->nH_4kHz = max( X1.nH_4kHz, X2.nH_4kHz ); tmp->upper_cut_off_freq_of_interest = X1.upper_cut_off_freq_of_interest; tmp->upper_cut_off_freq = X1.upper_cut_off_freq; +#undef WMC_TOOL_SKIP #else for ( i = 0; i <= X1.lag / 2; i++ ) { @@ -241,6 +259,7 @@ static void DTFS_fast_fs_inv( } #ifdef FIX_VBR_COMPLEXITY +#define WMC_TOOL_SKIP /* Populate the dbuf array */ dbuf[1] = X1_DTFS->a[0]; dbuf[2] = 0.0; @@ -276,6 +295,7 @@ static void DTFS_fast_fs_inv( ADD( 1 ); out[i - 1] = dbuf[i] / N_2; } +#undef WMC_TOOL_SKIP #else /* Populate the dbuf array */ dbuf[1] = X1_DTFS->a[0]; @@ -334,6 +354,7 @@ static float DTFS_alignment_weight( DTFS_STRUCTURE X1_DTFS; #ifdef FIX_VBR_COMPLEXITY +#define WMC_TOOL_SKIP FUNC( 2 ); DTFS_copy( &X1_DTFS, refX1_DTFS ); FUNC( 2 ); @@ -351,7 +372,6 @@ static float DTFS_alignment_weight( tmplpc[k] = LPC1[k] * ( tmp *= pwf ); } - FUNC( 3 ); DTFS_zeroFilter( &X1_DTFS, tmplpc, M + 1 ); FUNC( 3 ); @@ -421,6 +441,7 @@ static float DTFS_alignment_weight( maxcorr = wcorr; } } +#undef WMC_TOOL_SKIP #else DTFS_copy( &X1_DTFS, refX1_DTFS ); DTFS_adjustLag( &X1_DTFS, X2_DTFS.lag ); @@ -491,6 +512,7 @@ float DTFS_alignment_full( float maxcorr, corr, tmp, tmp1, fshift, n, diff; #ifdef FIX_VBR_COMPLEXITY +#define WMC_TOOL_SKIP LOGIC( 1 ); if ( X1_DTFS.lag < X2_DTFS.lag ) { @@ -536,6 +558,7 @@ float DTFS_alignment_full( maxcorr = corr; } } +#undef WMC_TOOL_SKIP #else if ( X1_DTFS.lag < X2_DTFS.lag ) { @@ -587,6 +610,7 @@ void DTFS_phaseShift( float tmp, tmp2 = 0.0f; #ifdef FIX_VBR_COMPLEXITY +#define WMC_TOOL_SKIP ADD( 1 ); LOOP( 1 ); for ( k = 0; k <= min( X->lag >> 1, X->nH ); k++, tmp2 += ph ) @@ -601,6 +625,7 @@ void DTFS_phaseShift( MAC( 1 ); X->b[k] = (float) ( tmp * sin( tmp2 ) + X->b[k] * cos( tmp2 ) ); } +#undef WMC_TOOL_SKIP #else for ( k = 0; k <= min( X->lag >> 1, X->nH ); k++, tmp2 += ph ) { @@ -629,10 +654,13 @@ void DTFS_zeroPadd( float diff; #ifdef FIX_VBR_COMPLEXITY +#define WMC_TOOL_SKIP LOGIC( 1 ); if ( N == X->lag ) { +#undef WMC_TOOL_SKIP return; +#define WMC_TOOL_SKIP } ADD( 1 ); LOOP( 1 ); @@ -655,6 +683,7 @@ void DTFS_zeroPadd( { X->nH++; } +#undef WMC_TOOL_SKIP #else if ( N == X->lag ) { @@ -719,6 +748,7 @@ void DTFS_to_fs( } #ifdef FIX_VBR_COMPLEXITY +#define WMC_TOOL_SKIP X->lag = N; MOVE( 1 ); MULT( 1 ); @@ -813,6 +843,7 @@ void DTFS_to_fs( } X->nH = nH_band; X->nH_4kHz = nH_4kHz; +#undef WMC_TOOL_SKIP #else X->lag = N; nH_band = (int16_t) floor( X->upper_cut_off_freq / ( 12800.0 / X->lag ) ); @@ -898,6 +929,7 @@ void DTFS_fs_inv( int16_t k, n; #ifdef FIX_VBR_COMPLEXITY +#define WMC_TOOL_SKIP LOOP( 1 ); for ( n = 0; n < N; n++ ) { @@ -915,6 +947,7 @@ void DTFS_fs_inv( x[n] += (float) ( X->a[k] * cos( tmp ) + X->b[k] * sin( tmp ) ); } } +#undef WMC_TOOL_SKIP #else for ( n = 0; n < N; n++ ) { @@ -977,6 +1010,7 @@ static void DTFS_transform( } #ifdef FIX_VBR_COMPLEXITY +#define WMC_TOOL_SKIP FUNC( 2 ); DTFS_copy( tmp1_dtfs, X ); FUNC( 2 ); @@ -1087,6 +1121,7 @@ static void DTFS_transform( out[i] = sum1; } +#undef WMC_TOOL_SKIP #else DTFS_copy( tmp1_dtfs, X ); DTFS_copy( tmp2_dtfs, X2 ); @@ -1180,9 +1215,9 @@ static void DTFS_transform( } #endif - dynamic_free( tmp1_dtfs ); - dynamic_free( tmp2_dtfs ); - dynamic_free( tmp3_dtfs ); + free( tmp1_dtfs ); + free( tmp2_dtfs ); + free( tmp3_dtfs ); return; } @@ -1204,6 +1239,7 @@ void DTFS_zeroFilter( int16_t k, n; #ifdef FIX_VBR_COMPLEXITY +#define WMC_TOOL_SKIP MOVE( 1 ); MULT( 1 ); tmp1 = (float) ( PI2 / X->lag ); @@ -1239,6 +1275,7 @@ void DTFS_zeroFilter( MAC( 1 ); X->b[k] = X->b[k] * sum1 + tmp * sum2; } +#undef WMC_TOOL_SKIP #else tmp1 = (float) ( PI2 / X->lag ); for ( k = 0; k <= min( X->lag >> 1, X->nH ); k++ ) @@ -1279,6 +1316,7 @@ void DTFS_poleFilter( int16_t k, n; #ifdef FIX_VBR_COMPLEXITY +#define WMC_TOOL_SKIP MOVE( 1 ); MULT( 1 ); tmp1 = (float) ( PI2 / X->lag ); @@ -1316,6 +1354,7 @@ void DTFS_poleFilter( ADD( 1 ); X->b[k] = ( -tmp * sum2 + X->b[k] * sum1 ) / tmp2; } +#undef WMC_TOOL_SKIP #else tmp1 = (float) ( PI2 / X->lag ); for ( k = 0; k <= min( X->lag >> 1, X->nH ); k++ ) @@ -1356,13 +1395,16 @@ static float DTFS_setEngy( float en1, tmp; #ifdef FIX_VBR_COMPLEXITY +#define WMC_TOOL_SKIP FUNC( 1 ); MOVE( 1 ); en1 = DTFS_getEngy( *X_DTFS ); LOGIC( 1 ); if ( en1 == 0.0 ) { +#undef WMC_TOOL_SKIP return 0.0; +#define WMC_TOOL_SKIP } MOVE( 1 ); DIV( 1 ); @@ -1376,6 +1418,7 @@ static float DTFS_setEngy( MULT( 1 ); X_DTFS->b[k] *= tmp; } +#undef WMC_TOOL_SKIP #else en1 = DTFS_getEngy( *X_DTFS ); if ( en1 == 0.0 ) @@ -1409,10 +1452,13 @@ void DTFS_adjustLag( float en, diff; #ifdef FIX_VBR_COMPLEXITY +#define WMC_TOOL_SKIP LOGIC( 1 ); if ( N == X_DTFS->lag ) { +#undef WMC_TOOL_SKIP return; +#define WMC_TOOL_SKIP } LOGIC( 1 ); @@ -1459,6 +1505,7 @@ void DTFS_adjustLag( X_DTFS->nH_4kHz++; } } +#undef WMC_TOOL_SKIP #else if ( N == X_DTFS->lag ) { @@ -1514,6 +1561,7 @@ float DTFS_getEngy( en = 0.0f; #ifdef FIX_VBR_COMPLEXITY +#define WMC_TOOL_SKIP LOOP( 1 ); for ( k = 1; k <= min( ( X.lag - 1 ) >> 1, X.nH ); k++ ) { @@ -1533,6 +1581,7 @@ float DTFS_getEngy( ADD( 1 ); en += X.a[k] * X.a[k] + X.b[k] * X.b[k]; } +#undef WMC_TOOL_SKIP #else for ( k = 1; k <= min( ( X.lag - 1 ) >> 1, X.nH ); k++ ) { @@ -1564,6 +1613,7 @@ void DTFS_car2pol( float tmp; #ifdef FIX_VBR_COMPLEXITY +#define WMC_TOOL_SKIP LOOP( 1 ); for ( k = 1; k <= min( ( X->lag - 1 ) >> 1, X->nH ); k++ ) { @@ -1587,6 +1637,7 @@ void DTFS_car2pol( MOVE( 1 ); X->b[k] = (float) atan2( X->b[k], tmp ); } +#undef WMC_TOOL_SKIP #else for ( k = 1; k <= min( ( X->lag - 1 ) >> 1, X->nH ); k++ ) { @@ -1621,6 +1672,7 @@ void DTFS_pol2car( float tmp; #ifdef FIX_VBR_COMPLEXITY +#define WMC_TOOL_SKIP LOOP( 1 ); for ( k = 1; k <= min( ( X->lag - 1 ) >> 1, X->nH ); k++ ) { @@ -1645,6 +1697,7 @@ void DTFS_pol2car( MULT( 1 ); X->a[k] = (float) ( X->a[k] * cos( tmp ) ); } +#undef WMC_TOOL_SKIP #else for ( k = 1; k <= min( ( X->lag - 1 ) >> 1, X->nH ); k++ ) { @@ -1690,6 +1743,7 @@ float DTFS_setEngyHarm( count = 0; #ifdef FIX_VBR_COMPLEXITY +#define WMC_TOOL_SKIP LOGIC( 1 ); if ( f1 == 0.0 ) { @@ -1767,6 +1821,7 @@ float DTFS_setEngyHarm( X->a[k] *= factor; } } +#undef WMC_TOOL_SKIP #else if ( f1 == 0.0 ) { @@ -1844,6 +1899,7 @@ static void cubicPhase( double diff; #ifdef FIX_VBR_COMPLEXITY +#define WMC_TOOL_SKIP ADD( 1 ); N -= (int16_t) L2; @@ -1911,6 +1967,7 @@ static void cubicPhase( ADD( 2 ); phOut[n] = (float) ( phOut[n - 1] + diff ); } +#undef WMC_TOOL_SKIP #else N -= (int16_t) L2; @@ -1978,6 +2035,7 @@ void DTFS_to_erb( } #ifdef FIX_VBR_COMPLEXITY +#define WMC_TOOL_SKIP LOOP( 1 ); for ( i = 0; i < num_erb; i++ ) { @@ -2027,6 +2085,7 @@ void DTFS_to_erb( out[i] /= count[i]; } } +#undef WMC_TOOL_SKIP #else for ( i = 0; i < num_erb; i++ ) { @@ -2101,6 +2160,7 @@ void erb_slot( } #ifdef FIX_VBR_COMPLEXITY +#define WMC_TOOL_SKIP MOVE( 1 ); MULT( 1 ); nH_band = (int16_t) floor( upper_cut_off_freq / ( 12800.0 / lag ) ); @@ -2160,6 +2220,7 @@ void erb_slot( mfreq[j] /= out[j]; } } +#undef WMC_TOOL_SKIP #else nH_band = (int16_t) floor( upper_cut_off_freq / ( 12800.0 / lag ) ); @@ -2240,6 +2301,7 @@ void DTFS_erb_inv( } #ifdef FIX_VBR_COMPLEXITY +#define WMC_TOOL_SKIP MOVE( 1 ); f[m] = 0.0; MOVE( 1 ); @@ -2312,6 +2374,7 @@ void DTFS_erb_inv( X->a[0] = 0.0f; } +#undef WMC_TOOL_SKIP #else f[m] = 0.0; amp[m] = 0.0; @@ -2386,6 +2449,7 @@ static void LPCPowSpect( int16_t i, k; #ifdef FIX_VBR_COMPLEXITY +#define WMC_TOOL_SKIP LOOP( 1 ); for ( k = 0; k < Nf; k++ ) { @@ -2414,6 +2478,7 @@ static void LPCPowSpect( DIV( 1 ); out[k] = 1.0f / ( Re * Re + Im * Im ); } +#undef WMC_TOOL_SKIP #else for ( k = 0; k < Nf; k++ ) { @@ -2466,6 +2531,7 @@ void erb_diff( } #ifdef FIX_VBR_COMPLEXITY +#define WMC_TOOL_SKIP FUNC( 3 ); erb_slot( l, cslot, mfreq, num_erb ); FUNC( 3 ); @@ -2702,6 +2768,7 @@ void erb_diff( MOVE( 1 ); index[1] = mmseindex; +#undef WMC_TOOL_SKIP #else erb_slot( l, cslot, mfreq, num_erb ); erb_slot( pl, pslot, t_prev_erb, num_erb ); @@ -2894,6 +2961,7 @@ void erb_add( } #ifdef FIX_VBR_COMPLEXITY +#define WMC_TOOL_SKIP FUNC( 3 ); erb_slot( l, cslot, t_prev_erb, num_erb ); FUNC( 3 ); @@ -3000,6 +3068,7 @@ void erb_add( curr_erb[i] = 0.0f; } } +#undef WMC_TOOL_SKIP #else erb_slot( l, cslot, t_prev_erb, num_erb ); erb_slot( pl, pslot, t_prev_erb, num_erb ); @@ -3106,7 +3175,7 @@ ivas_error WIsyn( error = IVAS_ERR_OK; - if ( ( phase = (float *) dynamic_malloc( N * sizeof( float ) ) ) == NULL ) + if ( ( phase = (float *) malloc( N * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for WI structure\n" ) ); } @@ -3117,6 +3186,7 @@ ivas_error WIsyn( } #ifdef FIX_VBR_COMPLEXITY +#define WMC_TOOL_SKIP FUNC( 2 ); DTFS_copy( CURRCW_DTFS, *CURRCW_DTFS_out ); @@ -3187,6 +3257,7 @@ ivas_error WIsyn( MOVE( 1 ); DIV( 1 ); *ph_offset = (float) fmod( (double) ( tmp ), PI2 ); +#undef WMC_TOOL_SKIP #else DTFS_copy( CURRCW_DTFS, *CURRCW_DTFS_out ); @@ -3233,12 +3304,8 @@ ivas_error WIsyn( *ph_offset = (float) fmod( (double) ( tmp ), PI2 ); #endif - dynamic_free( phase ); - dynamic_free( CURRCW_DTFS ); + free( phase ); + free( CURRCW_DTFS ); return error; } - -#ifdef FIX_VBR_COMPLEXITY -#undef WMC_TOOL_MAN -#endif diff --git a/lib_com/window.c b/lib_com/window.c index a3bf82ac7e98cd60ad5095dc4ae733729b94ec90..899ff8e4cebeb35d4c6a8d39e7c03e954c9c7b76 100644 --- a/lib_com/window.c +++ b/lib_com/window.c @@ -33,16 +33,17 @@ /*==================================================================================== EVS Codec 3GPP TS26.443 Nov 04, 2021. Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0 ====================================================================================*/ -/* WMC_TOOL_SKIP_FILE (basic ops file) */ #include +#include #include "options.h" #ifdef DEBUGGING #include "debug.h" #endif -#include #include "prot.h" +#define WMC_TOOL_SKIP + /*------------------------------------------------------------------- * ham_cos_window() * @@ -75,3 +76,5 @@ void ham_cos_window( return; } + +#undef WMC_TOOL_SKIP diff --git a/lib_com/window_ola.c b/lib_com/window_ola.c index 7a5b1536363e383e59e75686df7884a6eedc79c3..ec2c4b641a4dc8389064e4956838887c81e25158 100644 --- a/lib_com/window_ola.c +++ b/lib_com/window_ola.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------------- * window_ola() diff --git a/lib_com/wtda.c b/lib_com/wtda.c index cd8d588ed5493d566d7d990f1ddabde182670c74..2d5d4f93b5e60a2d8467ce97a380c062d43fe29d 100644 --- a/lib_com/wtda.c +++ b/lib_com/wtda.c @@ -43,7 +43,7 @@ #include "prot.h" #include "rom_com.h" #include -#include "wmops.h" +#include "wmc_auto.h" #ifdef DEBUG_PLOT #include "deb_out.h" #endif diff --git a/lib_debug/debug.c b/lib_debug/debug.c index 5ee8f10e31963161ba751ee449caae658d759e4b..c2f835b7273f8ad3f912f081a6e325adc8a7e3c8 100644 --- a/lib_debug/debug.c +++ b/lib_debug/debug.c @@ -53,7 +53,7 @@ #include #else #endif -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* diff --git a/lib_debug/mem_count.c b/lib_debug/mem_count.c deleted file mode 100755 index 07fb0083dfc34b469bfe36559aa0180c1b991b64..0000000000000000000000000000000000000000 --- a/lib_debug/mem_count.c +++ /dev/null @@ -1,934 +0,0 @@ -/* - * Memory Counting Tool - * - * Copyright 2022 VoiceAge Corporation. All Rights Reserved. - * - * This software is protected by copyright law and by international treaties. - * VoiceAge Corporation retains full ownership rights in their respective contributions in the software. - * No license of any kind, including but not limited to patent license, of any foregoing parties is - * hereby granted by implication, estoppel or otherwise. - * - * This software is provided "AS IS", without any express or implied warranties. The software is in the - * development stage. It is intended exclusively for experts who have experience with such software and - * solely for the purpose of inspection. All implied warranties of non-infringement, merchantability - * and/or fitness for a particular purpose are hereby disclaimed and excluded. - * - * Written by : Guy J. Richard - August 2017 - * - */ - -#include -#include "options.h" -#include "mem_count.h" - -#include /* for printf, ... */ -#include /* for stricmp, ... */ -#include /* for alloc, NULL, ... */ -#include /* for tolower */ - -/* Mostly to get a 'int32_t' */ -#if !defined( _MSC_VER ) || _MSC_VER >= 1600 -#include -#else -#include -#endif - -#ifdef RAM_COUNTING_TOOL - -#if defined( _MSC_VER ) && _MSC_VER < 1600 -typedef UINT32 uint32_t; -typedef INT32 int32_t; -typedef UINT64 uint64_t; -typedef INT64 int64_t; -#endif - -#ifndef TRUE -#define TRUE ( 0 == 0 ) -#endif -#ifndef FALSE -#define FALSE 0 -#endif - -#ifdef RAM_ANALYSIS -#include "debug.h" -#endif - -/* How to use the tool notes - ========================= - - The tool measure SRAM memory allocated by malloc(), calloc() and - deallocated by free(). - - In order to run the tool, one needs to: - 1) Prepend 'count_' to all calls to 'malloc', 'calloc' and 'free' except debug files. - 2) Add the following code into e.g. prot.h, so that all files with calls to these functions see it. - #ifdef RAM_COUNTING_TOOL - #define count_malloc(n1) MALLOC_FCT_CALL(n1) - #define count_calloc(n1,n2) CALLOC_FCT_CALL(n1, n2) - #define count_free(ptr) FREE_FCT_CALL(ptr) - #else - #define count_malloc(n1) malloc(n1) - #define count_calloc(n1,n2) calloc(n1, n2) - #define count_free(ptr) free(ptr) - #endif - 3) Call mem_count_init() at the beginning of encoding/decoding - - The first param allows to set a limit on the RAM that can be allocated. - While the codec is running, if memory is requested such that the maximum - is passed (Mem Alloc > Limit), the codec will stop and the summary will - be printed. - - The second param allows to decide the units (bytes, shorts or longs). - Please note that the unit specified is combined with the limit param to - produce the total size that can be allocated. Ex ..init(1000, USE_16BITS); - will set the limit to 1000 x 16 Bits Word (2000 bytes in total). - 4) Call mem_count_summary() at the end of encoding/decoding to print-out the results. - - The first parameter allows to overwrite the initial units configuration. - The Total size allocated (always in bytes internally) will be converted - to the unit selected before being reported. - - The switch 'RAM_COUNTING_TOOL' also has to be defined to enable memory counting. - - There is a define 'MEM_COUNT_DETAILS' in options.h that enables printing per - sub-structure details when DEBUGGING is activated. -*/ - -/*-------------------------------------------------------------------* - * LOCAL CONSTANTS - *-------------------------------------------------------------------*/ - -/* This is the maximum number of allocations for which to keep information. - It can be increased if required. */ -#ifdef SBA_BR_SWITCHING -#define MAX_INFO_RECORDS 8000 -#else -#define MAX_INFO_RECORDS 3000 -#endif - -/* This is the length after which the function name - will be truncated when the summary is printed. */ -#define MAX_FUNCTION_NAME_LENGTH 18 - -/* This is the length after which the parameter to - the allocating function will be truncated when - the summary is printed. */ -#define MAX_PARAMS_LENGTH 36 - -/* This is the value (in bytes) towards which the block size - is rounded. For example, a block of 123 bytes, when using - a 32 bits system, will end up taking 124 bytes since - the last unused byte cannot be used for another block. */ -#ifdef MEM_ALIGN_64BITS -#define BLOCK_ROUNDING 8 -#else /* Align on 32 Bits Instead */ -#define BLOCK_ROUNDING 4 -#endif - -#define N_32BITS_BLOCKS ( BLOCK_ROUNDING / sizeof( int32_t ) ) - -/* Special Value to See if Memory was ever written */ -#define MAGIC_VALUE_OOB 0x12A534F0 /* Put Before & After Buffer */ -#define MAGIC_VALUE_USED ( ~MAGIC_VALUE_OOB ) /* To Detect if Memory was Written */ -/* OOB Flags */ -#define OOB_START 0x1 -#define OOB_END 0x2 - -/*-------------------------------------------------------------------* - * LOCAL MACROS - *-------------------------------------------------------------------*/ - -#define ROUND_BLOCK_SIZE( n ) ( ( ( n ) + BLOCK_ROUNDING - 1 ) & ~( BLOCK_ROUNDING - 1 ) ) -#define IS_CALLOC( str ) ( ( size_str[0] ) == 'c' ) - -#define WARNING( msg ) \ - do \ - { \ - printf( "Fct=%s, Ln=%i: %s!\n", func_name, func_lineno, msg ); \ - } while ( 0 ) -#define ERROR( msg ) \ - do \ - { \ - WARNING( msg ); \ - exit( -1 ); \ - } while ( 0 ) - -/*-------------------------------------------------------------------* - * LOCAL TYPES - *-------------------------------------------------------------------*/ - -typedef struct -{ - void *block_ptr; - size_t block_size; - int lineno; - char name[MAX_FUNCTION_NAME_LENGTH + 1]; /* +1 for NUL */ - char params[1 + MAX_PARAMS_LENGTH + 1]; /* +1 for 'm'/'c' alloc & +1 for NUL */ - int used; - int OOB_Flag; - int seq_no; /* To Help Sorting by Order of Creation when all else is identical */ - int noccurances; -} allocator_record; - -typedef allocator_record allocation_list[MAX_INFO_RECORDS]; - -/*-------------------------------------------------------------------* - * LOCAL DATA - *-------------------------------------------------------------------*/ - -static allocation_list Current_Allocations, Peak_Allocations, Freed_Allocations; -static size_t RAM_Limit = NO_RAM_LIMIT; /* Always in Bytes */ -static size_t Current_RAM = 0, Peak_RAM = 0; /* In Bytes */ -static unsigned int Num_Records_Cur_RAM = 0, Num_Records_Peak_RAM = 0, Num_Records_Freed_RAM = 0; -static int Seq_No = 0; - -static size_t Stat_Cnt_Size = USE_BYTES; - -#ifndef DISABLE_NULL_PTR_FREE_WARNING -static allocation_list Missing_Allocations; -static unsigned int Num_Records_Missing_Alloc_Warnings = 0; -#endif - -/*-------------------------------------------------------------------* - * LOCAL CONST DATA - *-------------------------------------------------------------------*/ - -/* Suffix after numeral value printed in the summary */ -/* One char for each size */ -static const char Count_suffix[] = "BsL"; /* Using 's' because 'S' - looks a lot like '5'. */ -/* */ -static const char *Count_Name[] = { "Bytes", "Shorts", "Longs" }; - -/*-------------------------------------------------------------------* - * GLOBAL FUNCTIONS - *-------------------------------------------------------------------*/ - -/* It is not necessary to call dyn_mem_stats_init() since all static - variables are pre-initialised. It can be used to run stats again. */ -void mem_count_init( size_t limit, Counting_Size cnt_size ) -{ - if ( cnt_size != USE_DEFAULT ) - Stat_Cnt_Size = cnt_size; - Current_RAM = Peak_RAM = 0; - RAM_Limit = limit << Stat_Cnt_Size; - Num_Records_Cur_RAM = Num_Records_Peak_RAM = Num_Records_Freed_RAM = 0; -#ifndef DISABLE_NULL_PTR_FREE_WARNING - Num_Records_Missing_Alloc_Warnings = 0; -#endif - Seq_No = 0; -} - -/* This Function basically uses 'malloc' to allocate memory but also - records information about which functions allocated memory, the peak, ... - When, dyn_mem_print_stats() is called, all this info is printed as - well as the memory that has not been de-allocated; it is useful to - find memory leaks. */ -void *mem_alloc( - const char *func_name, - int func_lineno, - size_t size, - char *size_str /* the first char indicates m-alloc or c-alloc */ ) -{ - size_t rounded_size; - void *block_ptr; - char *tmp_ptr; - allocator_record *record_ptr; - size_t n, f; - int32_t fill_value; - int32_t *ptr32; - int32_t mask, temp; - unsigned int check; - - /* Do not Support Empty Requests */ - if ( size == 0 ) - { - ERROR( "Size of Zero not Supported" ); - } - - if ( Num_Records_Cur_RAM == MAX_INFO_RECORDS ) - { - ERROR( "Too Many Allocs. Increase 'MAX_INFO_RECORDS'" ); - } - - /* Round Up Block Size */ - rounded_size = ROUND_BLOCK_SIZE( size ); - - /* Allocate using the standard mem allocator. - Allocate a bit More to Have Room for Signature Values */ - block_ptr = malloc( rounded_size + BLOCK_ROUNDING * 2 ); - - /* the split line is to prevent a 'search/replace' adding a '_' to the name */ - /* We request more memory to have room to put signatures at the start - and end of the allocated buffer to check for OOBounds accesses. */ - /* Stop if it Failed */ - if ( block_ptr == NULL ) - { - ERROR( "Out of System RAM" ); - } - - /* Cannot use #if sizeof(int32_t) to catch this at compile time - because the preprocessor doesn't know anything about types - or sizes. */ - check = sizeof( int32_t ); - if ( check != 4 ) - { - ERROR( "Expecting 'int32_t' to be a 32 Bits Integer" ); - } - - /* Set Signatures and Fill (or Clear) Memory */ - ptr32 = (int32_t *) block_ptr; - /* Signature at Start of Block */ - n = N_32BITS_BLOCKS; - do - { - *ptr32++ = MAGIC_VALUE_OOB; - } while ( --n ); - /* Fill with Pattern or Clear Memory */ - fill_value = MAGIC_VALUE_USED; - if ( IS_CALLOC( size_str ) ) - { - fill_value = 0x00000000; - } - n = size / sizeof( int32_t ); - while ( n-- ) - { - *ptr32++ = fill_value; - } - n = rounded_size - size; - /* When Initializing with '0' */ - /* Need to Adapt the Magic Value */ - f = n % sizeof( int32_t ); - if ( f != 0 ) - { - /* For f=, shift by [1->24, 2->16, 3->8] */ - mask = 0xFFFFFFFF << ( ( sizeof( int32_t ) - f ) * 8 ); /* (1) */ - temp = MAGIC_VALUE_OOB & mask; - if ( fill_value != 0x0 ) - { /* Using M-Alloc */ - /* Merge Fill Value */ - temp += ( ~mask ) & MAGIC_VALUE_USED; - } /* for C-Alloc, the code in (1) hereabove already introduces zeros */ - *ptr32++ = temp; - } - n /= sizeof( int32_t ); - n += N_32BITS_BLOCKS; - /* Signature at End of Block */ - do - { - *ptr32++ = MAGIC_VALUE_OOB; - } while ( --n ); - - /* Adjust Pointer (Magic Value Before and After the Memory Region Requested) */ - tmp_ptr = (char *) block_ptr; - tmp_ptr += BLOCK_ROUNDING; - block_ptr = (void *) tmp_ptr; - - /* Save Information about Function Requesting the RAM */ - record_ptr = &Current_Allocations[Num_Records_Cur_RAM]; - - /* Save Name (and NUL Terminate it) */ - strncpy( record_ptr->name, func_name, MAX_FUNCTION_NAME_LENGTH ); - record_ptr->name[MAX_FUNCTION_NAME_LENGTH] = '\0'; - /* Save Params (and NUL Terminate it) - There string starts with a Marker (either 'm' or 'c') - that indicates the type of allocation requested. */ - strncpy( record_ptr->params, size_str, MAX_PARAMS_LENGTH ); - record_ptr->params[MAX_PARAMS_LENGTH] = '\0'; - /* Save Other Info */ - record_ptr->lineno = func_lineno; - record_ptr->block_ptr = block_ptr; - record_ptr->block_size = size; - record_ptr->used = -1; /* By default do not check mem usage */ - record_ptr->seq_no = ++Seq_No; - record_ptr->noccurances = 1; - - /* Increase # of Records */ - Num_Records_Cur_RAM++; - /* Update Amount of RAM Allocated */ - Current_RAM += rounded_size; - - /* Is this the Worst Case */ - if ( Peak_RAM < Current_RAM ) - { /* Yes */ - /* Update the Peak RAM */ - Peak_RAM = Current_RAM; - /* Keep the Information */ - memmove( Peak_Allocations, Current_Allocations, sizeof( allocator_record ) * Num_Records_Cur_RAM ); - Num_Records_Peak_RAM = Num_Records_Cur_RAM; - } - - /* Limit Busted? */ - if ( RAM_Limit != NO_RAM_LIMIT ) - { - if ( Current_RAM > RAM_Limit ) - { - char info_msg[100]; - - mem_count_summary( USE_DEFAULT ); - - sprintf( info_msg, "Alloc Limit of %lu %s was Passed", (unsigned long) RAM_Limit >> Stat_Cnt_Size, Count_Name[Stat_Cnt_Size] ); - ERROR( info_msg ); - } - } - - return block_ptr; -} - -/* Calculate Memory Usage of Block (Look for Signature) */ -static void mem_set_usage( allocator_record *record_ptr ) -{ - int total_bytes_used; - - size_t n; - int32_t *ptr32; - char *ptr8; - size_t total_bytes; - int32_t fill_value; - - fill_value = MAGIC_VALUE_USED; - if ( ( record_ptr->params[0] ) == 'c' ) - { - fill_value = 0x00000000; - } - - total_bytes = record_ptr->block_size; - - /* Check 4 bytes at a time */ - ptr32 = (int32_t *) record_ptr->block_ptr; - total_bytes_used = 0; - for ( n = total_bytes / sizeof( int32_t ); n > 0; n-- ) - { - if ( *ptr32++ != fill_value ) - total_bytes_used += sizeof( int32_t ); - } - - /* Check Remaining Bytes (If Applicable) */ - ptr8 = (char *) ptr32; - for ( n = total_bytes % sizeof( int32_t ); n > 0; n-- ) - { - if ( *ptr8++ != (char) fill_value ) - total_bytes_used++; - /* Update Value */ - fill_value >>= 8; - } - - /* Save Space Used */ - record_ptr->used = total_bytes_used; -} - -static void mem_check_OOB( allocator_record *record_ptr ) -{ - int32_t *ptr32; - unsigned int OOB_Flag = 0x0; - int32_t mask; - size_t i; - int f; - - ptr32 = (int32_t *) record_ptr->block_ptr - N_32BITS_BLOCKS; - /* Check at Beginning of Block */ - i = N_32BITS_BLOCKS; - do - { - if ( *ptr32++ ^ MAGIC_VALUE_OOB ) - OOB_Flag |= OOB_START; - } while ( --i ); - - /* Advance to End (Snap to lowest 32 Bits) */ - ptr32 += record_ptr->block_size / sizeof( int32_t ); - - /* Calculate Unused Space That has been - added to get to the rounded Block Size */ - i = ROUND_BLOCK_SIZE( record_ptr->block_size ) - record_ptr->block_size; - - /* Partial Check (For Block Size that have been rounded) */ - f = i % sizeof( int32_t ); - if ( f != 0 ) - { - mask = 0xFFFFFFFF << ( ( sizeof( int32_t ) - f ) * 8 ); - if ( ( *ptr32++ ^ MAGIC_VALUE_OOB ) & mask ) - OOB_Flag |= OOB_END; - } - - /* Full Check (all 32 Bits) for Remaining */ - i /= sizeof( int32_t ); - i += N_32BITS_BLOCKS; - do - { - if ( *ptr32++ ^ MAGIC_VALUE_OOB ) - OOB_Flag |= OOB_END; - } while ( --i ); - - record_ptr->OOB_Flag = OOB_Flag; -} - -/* Just to make the code cleaner */ -static int is_same_record( const allocator_record *record_ptr1, allocator_record *record_ptr2 ) -{ - return record_ptr2->block_size == record_ptr1->block_size && - record_ptr2->lineno == record_ptr1->lineno && - strcmp( record_ptr2->name, record_ptr1->name ) == 0 && - strcmp( record_ptr2->params, record_ptr1->params ) == 0 && - record_ptr2->OOB_Flag == record_ptr1->OOB_Flag - ? 1 - : 0; -} - -/* This Function basically uses 'free' and removes the - Information about the memory block from the list of - currently allocated Memory */ -void mem_free( const char *func_name, int func_lineno, void *ptr ) -{ - unsigned int i, j, k; - char *tmp_ptr; - allocator_record *record_ptr, *record_ptr2; - - char info_msg[100]; - - /* Search for the Block Pointer in the List */ - record_ptr = &Current_Allocations[0]; - for ( i = 0; i < Num_Records_Cur_RAM; i++ ) - { - /* Same Pointer? */ - if ( ptr == record_ptr->block_ptr ) - { /* Yes, Found it */ - if ( Num_Records_Freed_RAM == MAX_INFO_RECORDS ) - { - ERROR( "Too Many Allocs. Increase 'MAX_INFO_RECORDS'" ); - } - - for ( j = 0; j < Num_Records_Peak_RAM; j++ ) - { - /* Is this Block Part of the Peak RAM? */ - if ( memcmp( record_ptr, &Peak_Allocations[j], sizeof( *record_ptr ) ) == 0 ) - { - break; /* Stop the 'j' loop */ - } - } - - mem_set_usage( record_ptr ); - mem_check_OOB( record_ptr ); - - /* De-Allocated Block was Part of Peak RAM? */ - if ( j == Num_Records_Peak_RAM ) - { /* No */ - /* Here, in order to avoid filling this list with repetitive blocks */ - /* that are allocated and deallocated repeatedly, we look for a block */ - /* that has the same module, line #, size & same OOB characteristics. */ - /* We then just increase the # of occurances of this block definition. */ - /* The % used will be merged */ - record_ptr2 = &Freed_Allocations[0]; - for ( k = 0; k < Num_Records_Freed_RAM; k++ ) - { - /* Same Block but allocated many times */ - if ( is_same_record( record_ptr2, record_ptr ) ) - { - record_ptr2->noccurances++; - record_ptr2->used += record_ptr->used; - break; - } - record_ptr2++; - } - /* Found it */ - } - else - { - /* Force Add to List */ - k = Num_Records_Freed_RAM; - } - - if ( k == Num_Records_Freed_RAM ) - { /* No */ - /* Add to List */ - memmove( &Freed_Allocations[Num_Records_Freed_RAM], record_ptr, sizeof( allocator_record ) ); - /* Increase # of Records for Deallocated Block List */ - Num_Records_Freed_RAM++; - } - - /* De-Allocated Block was Part of Peak RAM? */ - if ( j != Num_Records_Peak_RAM ) - { /* Yes */ - /* Update Block Info There too (The Info here is Bytes Used and OOB Flags) */ - memmove( &Peak_Allocations[j], record_ptr, sizeof( *record_ptr ) ); - } - - /* First Adjust Pointer to Get to the Start of the Block */ - tmp_ptr = (char *) ptr; - tmp_ptr -= BLOCK_ROUNDING; - ptr = (void *) tmp_ptr; - /* De-allocate using the standard memory facilities */ - fr\ -ee( ptr ); /* the split line is to prevent a 'search/replace' adding a '_' to the name */ - - /* Decrease # of Records */ - Num_Records_Cur_RAM--; - /* Update (decrease) Amount of RAM Allocated */ - Current_RAM -= ROUND_BLOCK_SIZE( record_ptr->block_size ); - - /* Erase the entry (Move the Last One over it) */ - memmove( record_ptr, &Current_Allocations[Num_Records_Cur_RAM], sizeof( allocator_record ) ); - - return; - } - record_ptr++; - } - - /* Not Found, Problem! */ - if ( ptr != NULL ) - { - /* Stop */ - sprintf( info_msg, "Invalid Pointer: '%p'", ptr ); - ERROR( info_msg ); - } -#ifndef DISABLE_NULL_PTR_FREE_WARNING - else - { /* Warn about Freeing of NULL Pointers */ - /* Search to Warn Only Once. */ - record_ptr = &Missing_Allocations[0]; - for ( i = 0; i < Num_Records_Missing_Alloc_Warnings; i++ ) - { - /* Same Name? */ - if ( strncmp( record_ptr->name, func_name, MAX_FUNCTION_NAME_LENGTH ) == 0 ) - { /* Yes */ - /* Same Line Number? */ - if ( record_ptr->lineno == func_lineno ) - { /* Yes */ - /* No Need to Warn Again */ - return; - } - } - record_ptr++; - } - /* Save Name */ - strncpy( record_ptr->name, func_name, MAX_FUNCTION_NAME_LENGTH ); - record_ptr->name[MAX_FUNCTION_NAME_LENGTH] = '\0'; - - /* Save Line No */ - record_ptr->lineno = func_lineno; - /* Save Pointer */ - record_ptr->block_ptr = ptr; - /* Save Size */ - record_ptr->block_size = 0; /* It is an Unknown Block, so there is no size, we put a '0' */ - - Num_Records_Missing_Alloc_Warnings++; - - WARNING( "Trying to Free 'NULL' Pointer" ); - } -#endif -} - -#ifdef MEM_COUNT_DETAILS -/* Used to Sort Block Information Records */ -static int compare_mem_records( const void *ptr1, const void *ptr2 ) -{ - const allocator_record *record_ptr1 = (const allocator_record *) ptr1, - *record_ptr2 = (const allocator_record *) ptr2; - int result; - - /* Sort First by 'Name', then by 'Line No' and finaly by 'Block Size' */ - - /* Compare Function Name */ - result = strcmp( record_ptr1->name, record_ptr2->name ); - /* Same Function Name? */ - if ( result == 0 ) - { /* Yes */ - /* Compare Line Number */ - result = record_ptr1->lineno - record_ptr2->lineno; - /* Same Line Number */ - if ( result == 0 ) - { /* Yes */ - /* Compare Block Size */ - result = record_ptr1->block_size - record_ptr2->block_size; - /* Same Size? */ - if ( result == 0 ) - { - result = record_ptr1->seq_no - record_ptr2->seq_no; - } - } - } - - return result; -} - -static void mem_print_records( allocator_record *record_ptr, int num_records, Counting_Size cnt_size, int print_size ) -{ - int i, sum, total; - char *last_name = NULL; - int single_flag; - char chr = Count_suffix[cnt_size]; - size_t nwords, rounded_block_size; - char nblocks_str[22]; - char quantity_str[22]; - char format_str[50]; - char *tmp_ptr; - int nblocks; - - char *OOB_str[] = { "- ", "beg", "end", "b+e" }; - - strcpy( format_str, "\n %-*s %5i %-*s %3s %3.0f%% %8s" ); - if ( print_size != FALSE ) - strcat( format_str, " %6u" ); - - /* Sort it */ - qsort( record_ptr, num_records, sizeof( allocator_record ), compare_mem_records ); - - single_flag = 0; - - nblocks = 0; - - if ( num_records > 0 ) - { - /* Print Header */ - printf( " %-*s Ln No %-*s OOB Used Quantity%s", MAX_FUNCTION_NAME_LENGTH, "Function Name", MAX_PARAMS_LENGTH, "Parameters ('m' or 'c' alloc)", print_size != FALSE ? " Size" : "" ); - - total = sum = 0; - for ( i = num_records - 1; i >= 0; i-- ) - { - if ( sum == 0 ) - { - last_name = record_ptr->name; - } - - rounded_block_size = ROUND_BLOCK_SIZE( record_ptr->block_size ) >> cnt_size; - nwords = rounded_block_size * record_ptr->noccurances; - - /* Calc Usage (It has already been done for a De-Allocated Block - That was part of the Peak Mem. But not for a Block that is - still allocated (never freed). */ - if ( record_ptr->used < 0 ) - { - mem_set_usage( record_ptr ); - /* Check Out of Bounds Too */ - mem_check_OOB( record_ptr ); - } - - sprintf( quantity_str, "%i", record_ptr->noccurances ); - - /* Print Quantity x Size */ - tmp_ptr = strchr( quantity_str, '\0' ); - *tmp_ptr++ = 'x'; - sprintf( tmp_ptr, "%i", (int) rounded_block_size ); - - printf( format_str, MAX_FUNCTION_NAME_LENGTH, record_ptr->name, record_ptr->lineno, MAX_PARAMS_LENGTH, record_ptr->params, OOB_str[record_ptr->OOB_Flag], ( record_ptr->used * 100.0f / record_ptr->block_size / record_ptr->noccurances ), quantity_str, (uint32_t) nwords ); - /* Count $ of Blocks */ - nblocks += record_ptr->noccurances; - /* Add Size */ - sum += nwords; - /* Advance */ - record_ptr++; - - if ( print_size != FALSE ) - { - /* End Reached or New Function? */ - if ( i == 0 || strcmp( last_name, record_ptr->name ) != 0 ) - { - /* Cumulate Total */ - total += sum; - - if ( i == 0 && total == sum ) - single_flag = 1; -#ifdef MEM_COUNT_TOTAL_PER_FUNC - /* Print 'Total' on the Line if there is only one Function - that allocated all the RAM */ - printf( " %7i%c", sum, chr ); -#endif - /* Reset Sum */ - sum = 0; - } - } - } - /* Print the Total */ - if ( !single_flag && print_size != FALSE ) - { -#ifdef MEM_COUNT_TOTAL_PER_FUNC -#define SPACES 9 -#else -#define SPACES 0 -#endif - - sprintf( nblocks_str, "%i Blocks", nblocks ); - - printf( "\n %*s %*s %*s --------\n", MAX_FUNCTION_NAME_LENGTH, "", MAX_PARAMS_LENGTH, "", SPACES, "" ); - printf( " %-*s %-*s %*s%7i%c\n", MAX_FUNCTION_NAME_LENGTH, "Total", MAX_PARAMS_LENGTH, nblocks_str, SPACES, "", total, chr ); - } - else - printf( "\n" ); - } - else - { - printf( " \n" ); - } -} -#endif - -/* Print Memory Summary. - Return Peak Memory Used (according to Units Specified) */ -size_t mem_count_summary( Counting_Size cnt_size ) -{ - size_t size; -#ifdef MEM_COUNT_DETAILS - unsigned int i, j; - size_t num; - allocation_list Allocations; -#endif - if ( cnt_size == USE_DEFAULT ) - cnt_size = Stat_Cnt_Size; - - size = Peak_RAM >> cnt_size; -#ifdef MEM_COUNT_DETAILS - printf( "\n\n====== STATIC RAM COUNTING TOOL: MEMORY SUMMARY ======\n\n" ); - - printf( " NOTES\n" - " 1) %c = %s, %c = %s (16 Bits Words) & %c = %s (32 Bits Words).\n" - " 2) The '%%' of 'Used' memory is not very reliable for c-alloc.\n" - " 3) The Out Of Bounds (OOB) Checking is primitive as it checks\n" - " only for writing before and past the buffer when it is freed\n" - " or when the summary is printed.\n" - " 4) Quantity Filed format is N x Block Size.\n" - " When it is 1: Size = Block Size\n" - " Otherwise, Size = The Total Size Allocated for the 'N' Blocks.\n" - "\n", - Count_suffix[USE_BYTES], Count_Name[USE_BYTES], Count_suffix[USE_16BITS], Count_Name[USE_16BITS], Count_suffix[USE_32BITS], Count_Name[USE_32BITS] ); - - /* Create a Temporary List of Block to Print */ - /* from all the Block Allocated in the Peak */ - /* Scenario. We want to Merge Entries allocated */ - /* from the exact same code location and having */ - /* the same block size. In order to simplifiy the */ - /* printout. */ - num = 0; - for ( i = 0; i < Num_Records_Peak_RAM; i++ ) - { - /* Check if an Identical Block Before Adding to List */ - for ( j = 0; j < num; j++ ) - { - if ( is_same_record( &Peak_Allocations[i], &Allocations[j] ) ) - { - Allocations[j].noccurances++; - Allocations[j].used += Peak_Allocations[i].used; - break; - } - } - - /* Unique Block? */ - if ( j == num ) - { /* Yes */ - /* Add to List */ - memmove( &Allocations[num++], &Peak_Allocations[i], sizeof( allocator_record ) ); - } - } - /* Print the Peak Allocated */ - printf( " Peak Memory Allocated\n" ); - mem_print_records( &Allocations[0], num, cnt_size, TRUE ); - printf( "\n" ); - - /* Create a Temporary List of Block to Print */ - /* from all the Block Allocated BUT excluding */ - /* blocks that are part of the peak (and that */ - /* are already printed). */ - /* This is done every time the summary is printed */ - /* so that the code can continue to be executed */ - /* and the summary can be printed again with blocks */ - /* that are part of the peak having changed and thus */ - /* those that end up in this 'catch all' category. */ - num = 0; - for ( i = 0; i < Num_Records_Freed_RAM; i++ ) - { - /* Check if Record is in the Peak */ - for ( j = 0; j < Num_Records_Peak_RAM; j++ ) - { - /* Is this Block Part of the Peak RAM OR Still Allocated ? */ - if ( is_same_record( &Freed_Allocations[i], &Peak_Allocations[j] ) ) - { /* Yes */ - break; /* Stop the 'j' loop */ - } - } - /* If part of the Peak, skip it */ - if ( j == Num_Records_Peak_RAM ) - { /* Not Part of Peak */ - /* Check if an Identical Block Before Adding to List */ - for ( j = 0; j < num; j++ ) - { -#ifndef MEM_COUNT_SEPARATE_OTHER_BLOCKS - /* Just Check for Same Size, Params and OOB Result */ - if ( Freed_Allocations[i].block_size == Allocations[j].block_size && - strcmp( Freed_Allocations[i].params, Allocations[j].params ) == 0 && - Freed_Allocations[i].OOB_Flag == Allocations[j].OOB_Flag ) - { - Allocations[j].noccurances += Freed_Allocations[i].noccurances; - Allocations[j].used += Freed_Allocations[i].used; - /* Indicate that Locations are Multiple */ - strncpy( Allocations[j].name, "MULTIPLE LOCATIONS", MAX_FUNCTION_NAME_LENGTH ); - /* Wipe the Line # */ - Allocations[j].lineno = 0; - break; - } -#else - if ( is_same_record( &Freed_Allocations[i], &Allocations[j] ) ) - { - Allocations[j].noccurances++; - Allocations[j].used += Freed_Allocations[i].used; - break; - } -#endif - } - - /* Unique Block? */ - if ( j == num ) - { /* Yes */ - /* Add to List */ - memmove( &Allocations[num++], &Freed_Allocations[i], sizeof( allocator_record ) ); - } - } - } - - if ( num != 0 ) - { - /* Print all Other Block (Those that have been Freed but are not Part - of the Peak Memory). */ - printf( " Other Memory Allocated\n" ); - mem_print_records( &Allocations[0], num, cnt_size, FALSE /*Do not print the size column*/ ); - printf( "\n" ); - } - - /* If we have busted the RAM Limit, we will end up in the - summary function (here) and abort. Hence, no point printing - the memory still allocated, it will be the same as the Peak! */ - if ( RAM_Limit == 0 || Current_RAM <= RAM_Limit ) - { - /* Print the Not Deallocated */ - printf( " Memory Still Allocated\n" ); - mem_print_records( &Current_Allocations[0], Num_Records_Cur_RAM, cnt_size, TRUE ); - printf( "\n" ); - } -#endif - -#ifndef MEM_COUNT_DETAILS - if ( Num_Records_Cur_RAM > 0 ) - { - printf( "\nWarning: Part of the SRAM is still allocated! Activate MEM_COUNT_DETAILS for more details.\n" ); - } -#endif - printf( "Peak SRAM Allocated: %i%c\n\n\n", (int) size, Count_suffix[cnt_size] ); - - return size; -} - -#ifdef DEBUGGING -#ifdef RAM_ANALYSIS -void mem_analyze( void ) -{ - unsigned int i; - char buffer[1024]; - - for ( i = 0; i < Num_Records_Cur_RAM; i++ ) - { - sprintf( buffer, "%s:%d,%ld;", Current_Allocations[i].name, Current_Allocations[i].lineno, Current_Allocations[i].block_size ); - dbgwrite( buffer, sizeof( char ), strlen( buffer ), 1, "mem_analysis.csv" ); - } - sprintf( buffer, "\n" ); - dbgwrite( buffer, sizeof( char ), strlen( buffer ), 1, "mem_analysis.csv" ); - - return; -} -#endif -#endif - -#endif diff --git a/lib_debug/mem_count.h b/lib_debug/mem_count.h deleted file mode 100644 index 38ccb0bac6ca236d970888f4461281830fa9f235..0000000000000000000000000000000000000000 --- a/lib_debug/mem_count.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * mem_count.h - * - * Copyright 2022 VoiceAge Corporation. All Rights Reserved. - * - * This software is protected by copyright law and by international treaties. - * VoiceAge Corporation retains full ownership rights in their respective contributions in the software. - * No license of any kind, including but not limited to patent license, of any foregoing parties is - * hereby granted by implication, estoppel or otherwise. - * - * This software is provided "AS IS", without any express or implied warranties. The software is in the - * development stage. It is intended exclusively for experts who have experience with such software and - * solely for the purpose of inspection. All implied warranties of non-infringement, merchantability - * and/or fitness for a particular purpose are hereby disclaimed and excluded. - * - * Written by : Guy J. Richard - August 2017 - * - */ - -#ifndef __MEM_COUNT_H__ -#define __MEM_COUNT_H__ - -#include -#include "options.h" -#include /* for size_t, ... */ - -#ifdef RAM_COUNTING_TOOL -/*-------------------------------------------------------------------* - * Global Constants - *-------------------------------------------------------------------*/ - -#define NO_RAM_LIMIT 0 - -/* Define this when using 64 Bits values in the code (ex: double) */ -/*#define MEM_ALIGN_64BITS */ /* Will Align on 32 Bits if not Defined */ - -/*#define DISABLE_NULL_PTR_FREE_WARNING*/ - -/*#define MEM_COUNT_DETAILS*/ - -/*#define MEM_COUNT_SEPARATE_OTHER_BLOCKS */ /* Print separate lines with location details if the same block is allocated in multiple places and is not a part of the Peak memory */ - /* if not defined, MULTIPLE LOCATIONS is printed instead */ - -/*-------------------------------------------------------------------* - * Global Types - *-------------------------------------------------------------------*/ - -typedef enum -{ - USE_DEFAULT = -1, - USE_BYTES, - USE_16BITS, - USE_32BITS -} Counting_Size; - -/*-------------------------------------------------------------------* - * Global Macros - *-------------------------------------------------------------------*/ - -#define STRINGIFY( x ) #x -#define TO_STRING( x ) STRINGIFY( x ) - -#if ( defined( _WIN32 ) && ( _MSC_VER <= 1800 ) && ( _MSC_VER >= 1300 ) ) -#define __func__ __FUNCTION__ -#elif defined( __STDC_VERSION__ ) && __STDC_VERSION__ < 199901L -#if ( __GNUC__ >= 2 ) -#define __func__ __FUNCTION__ -#else -#define __func__ "" -#endif -#elif defined( __GNUC__ ) -#define __func__ __extension__ __FUNCTION__ -#endif - -/* MALLOC_FCT_CALL, FREE_FCT_CALL, ... are defined here because 'wmc_auto.h' uses */ -/* them to map malloc, free & calloc to a Memory Counting Mechanism. If the WMC Tool */ -/* is not used, then these definitions will have no effect and are harmless. */ -#define MALLOC_FCT_CALL( size ) mem_alloc( __func__, __LINE__, size, "m:" TO_STRING( size ) ) -#define FREE_FCT_CALL( ptr ) mem_free( __func__, __LINE__, ptr ) -#define CALLOC_FCT_CALL( n, sz ) mem_alloc( __func__, __LINE__, ( n ) * ( sz ), "c:" TO_STRING( n ) ", " TO_STRING( sz ) ) - - -/*-------------------------------------------------------------------* - * Prototypes - *-------------------------------------------------------------------*/ - -#ifdef __cplusplus -extern "C" -{ -#endif - - extern void mem_count_init( size_t limit, Counting_Size cnt_size ); - extern size_t mem_count_summary( Counting_Size cnt_size ); - - extern void *mem_alloc( const char *func_name, int func_lineno, size_t size, char *alloc_str ); - extern void mem_free( const char *func_name, int func_lineno, void *ptr ); - -#ifdef DEBUGGING -#ifdef RAM_ANALYSIS - extern void mem_analyze( void ); -#endif -#endif - -#ifdef __cplusplus -} -#endif - -#endif - -#endif diff --git a/lib_debug/memory.c b/lib_debug/memory.c deleted file mode 100644 index 27a6768080d4ff1f28e2dcbc29438048d7469da1..0000000000000000000000000000000000000000 --- a/lib_debug/memory.c +++ /dev/null @@ -1,189 +0,0 @@ -/****************************************************************************************************** - - (C) 2022 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository. All Rights Reserved. - - This software is protected by copyright law and by international treaties. - The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository retain full ownership rights in their respective contributions in - the software. This notice grants no license of any kind, including but not limited to patent - license, nor is any license granted by implication, estoppel or otherwise. - - Contributors are required to enter into the IVAS codec Public Collaboration agreement before making - contributions. - - This software is provided "AS IS", without any express or implied warranties. The software is in the - development stage. It is intended exclusively for experts who have experience with such software and - solely for the purpose of inspection. All implied warranties of non-infringement, merchantability - and fitness for a particular purpose are hereby disclaimed and excluded. - - Any dispute, controversy or claim arising under or in relation to providing this software shall be - submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in - accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and - the United Nations Convention on Contracts on the International Sales of Goods. - -*******************************************************************************************************/ - -#include "options.h" -#include -#include -#include -#include - -#include "prot.h" -#include "debug.h" -#include "wmops.h" -#include "rom_enc.h" -#include "rom_dec.h" -#include "rom_com.h" -#include "stat_enc.h" -#include "stat_dec.h" - -#ifdef WMOPS - -extern int32_t frame; - -/*-------------------------------------------------------------------* - * Memory counting tool - *--------------------------------------------------------------------*/ - -int16_t *ptr_base_stack = 0; /* Pointer to the bottom of stack (base pointer). Stack grows up. */ -int16_t *ptr_max_stack = 0; /* Pointer to the maximum stack pointer (the farest point from the bottom of stack) */ -int32_t wc_frame = 0; /* Frame corresponding to the worst-case stack usage */ -char location_max_stack[256] = "undefined"; -#define MAX_FCT_NAME_LENGTH 30 -typedef struct -{ - char function_name[MAX_FCT_NAME_LENGTH + 1]; - int16_t *stack_ptr; -} caller_info; -int current_calls = 0; -#define MAX_RECORDABLE_CALLS 40 -caller_info stack_callers[2][MAX_RECORDABLE_CALLS]; - - -/*-------------------------------------------------------------------* - * reset_stack() - * - * Initialize/reset the base stack counter.. - *--------------------------------------------------------------------*/ - -void reset_stack() -{ - int16_t something; - - ptr_base_stack = &something; - ptr_max_stack = ptr_base_stack; -} - -/*-------------------------------------------------------------------* - * push_stack() - * - * Check the current stack pointer and update the maximum stack pointer, if new maximum found. - *--------------------------------------------------------------------*/ - -int push_stack( const char *filename, const char *fctname ) -{ - int16_t something; - - (void) *filename; /* to avoid compilation warning */ - - /* Is there room to save the caller's information? */ - if ( current_calls >= MAX_RECORDABLE_CALLS ) - { /* No */ - fprintf( stderr, "memory.c: No more room to store call stack info. Please increase MAX_RECORDABLE_CALLS" ); - exit( -1 ); - } - /* Valid Function Name? */ - if ( fctname[0] == 0 ) - { /* No */ - fprintf( stderr, "memory.c: Invalid function name for call stack info." ); - exit( -1 ); - } - /* Save the Name of the Calling Function in the Table */ - strncpy( stack_callers[0][current_calls].function_name, fctname, MAX_FCT_NAME_LENGTH ); - stack_callers[0][current_calls].function_name[MAX_FCT_NAME_LENGTH] = 0; /* Nul Terminate */ - /* Save the Stack Pointer */ - stack_callers[0][current_calls].stack_ptr = &something; - /* Increase Stack Calling Tree Level */ - current_calls++; - /* Is this the First Time or the Worst Case? */ - if ( &something < ptr_max_stack || ptr_max_stack == NULL ) - { /* Yes */ - /* Save Info about it */ - ptr_max_stack = &something; - wc_frame = frame; - strncpy( location_max_stack, fctname, sizeof( location_max_stack ) - 1 ); - location_max_stack[sizeof( location_max_stack ) - 1] = '\0'; - - /* Save Call Tree */ - memmove( stack_callers[1], stack_callers[0], sizeof( caller_info ) * current_calls ); - - /* Terminate the List (Unless Full) */ - if ( current_calls < MAX_RECORDABLE_CALLS ) - { - stack_callers[1][current_calls].function_name[0] = 0; - } - } - return 0 /* for Now */; -} - -int pop_stack( const char *filename, const char *fctname ) -{ - caller_info *caller_info_ptr; - - (void) *filename; /* to avoid compilation warning */ - - /* Decrease Stack Calling */ - current_calls--; - - /* Get Pointer to Caller Information */ - caller_info_ptr = &stack_callers[0][current_calls]; - - /* Check if Names Match */ - if ( strncmp( caller_info_ptr->function_name, fctname, MAX_FCT_NAME_LENGTH ) != 0 ) - { - fprintf( stderr, "memory.c: Invalid pop_stack()" ); - exit( -1 ); - } - - /* Erase Entry */ - caller_info_ptr->function_name[0] = 0; - - return 0 /* for Now */; -} - -void print_stack_call_tree( void ) -{ - caller_info *caller_info_ptr; - int call_level; - - fprintf( stdout, "Stack Call Tree (frame #%5d) Stack Usage in words\n", wc_frame ); - caller_info_ptr = &stack_callers[1][0]; - for ( call_level = 0; call_level < MAX_RECORDABLE_CALLS; call_level++ ) - { - /* Done? */ - if ( caller_info_ptr->function_name[0] == 0 ) - break; - /* Print Name */ - fprintf( stdout, "%-42s", caller_info_ptr->function_name ); - /* Print Stack Usage (Based on Difference) */ - if ( call_level != 0 ) - { - fprintf( stdout, "%ld\n", ( ( caller_info_ptr - 1 )->stack_ptr - caller_info_ptr->stack_ptr ) * sizeof( int16_t ) / sizeof( float ) ); - } - else - fprintf( stdout, "\n" ); - /* Advance */ - caller_info_ptr++; - } - fprintf( stdout, "\n" ); -} - -#endif /* WMOPS */ diff --git a/lib_debug/sba_debug.c b/lib_debug/sba_debug.c index 68fd39f4c083e412ef023a1e357fd1fe52710608..b39a30f6f0630c576bd156eb0db698630a8eb7f2 100644 --- a/lib_debug/sba_debug.c +++ b/lib_debug/sba_debug.c @@ -40,7 +40,7 @@ #include "prot.h" #include "sba_debug.h" #include -#include "wmops.h" +#include "wmc_auto.h" #ifdef DEBUG_SBA #include #include "tinywaveout_c.h" diff --git a/ci/complexity_measurements/parseNewsletterProm.py b/lib_debug/segsnr.c old mode 100755 new mode 100644 similarity index 50% rename from ci/complexity_measurements/parseNewsletterProm.py rename to lib_debug/segsnr.c index 072cb03c21a7b022819ab63350d313f62e7c8182..b7733355fab99586dedd5909152bae6416fdc7cb --- a/ci/complexity_measurements/parseNewsletterProm.py +++ b/lib_debug/segsnr.c @@ -1,6 +1,5 @@ -#!/usr/bin/env python3 -# coding: utf-8 -""" +/****************************************************************************************************** + (C) 2022 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, @@ -28,46 +27,79 @@ submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and the United Nations Convention on Contracts on the International Sales of Goods. -""" -import csv -import sys -import re +*******************************************************************************************************/ -newsletterFilename = "" -newsletterFilenameLast = "" -revision = "" -shortDate = "" -fullDate = "" -maxPromOpsBasop = "" -logfileBasop = "" +#include +#ifdef DEBUGGING +#include "debug.h" +#endif +#include "wmc_auto.h" +#include +#include "options.h" +#include "prot.h" -if __name__ == "__main__": - newsletterFilename = sys.argv[1] - newsletterFilenameLast = sys.argv[2] - revision = sys.argv[3] - shortDate = sys.argv[4] - fullDate = sys.argv[5] - maxPromOpsBasop = sys.argv[6] - logfileBasop = sys.argv[7] +#define WMC_TOOL_SKIP -max_total = ["", 0] +#ifdef OUTPUT_SNR +/*_____________________________________________________________________ + | | + | FUNCTION NAME segsnr | + | Computes the segmential signal-to-noise ratio between the | + | signal x and its estimate xe of length n samples. The segment | + | length is nseg samples. | + | + | INPUT + | x[0:n-1] Signal of n samples. + | xe[0:n-1] Estimated signal of n samples. + | n Signal length. + | nseg Segment length, must be a submultiple of n. + | + | RETURN VALUE + | snr Segmential signal to noise ratio in dB. + |_____________________________________________________________________| +*/ -with open(newsletterFilename, "r") as csvfile: - prom = csv.reader(csvfile, delimiter=";") - for row in prom: - if row[0] == "conf": - continue - if int(row[4]) > max_total[1]: - max_total[0] = re.sub(" ", "_", row[0]) - max_total[1] = int(row[4]) +float segsnr( float x[], float xe[], int16_t n, int16_t nseg ) +{ + float snr = 0.0f; + float signal, noise, error, fac; + int16_t i, j; + LOOP( 1 ); + for ( i = 0; i < n; i += nseg ) + { + signal = 1e-6f; + MOVE( 2 ); + noise = 1e-6f; + LOOP( 1 ); + for ( j = 0; j < nseg; j++ ) + { + signal += ( *x ) * ( *x ); + MAC( 1 ); + error = *x++ - *xe++; + ADD( 1 ); + noise += error * error; + MAC( 1 ); + } + snr += (float) log10( signal / noise ); + TRANS( 1 ); + DIV( 1 ); + ADD( 1 ); + } + fac = ( (float) ( 10 * nseg ) ) / (float) n; + DIV( 1 ); + MULT( 1 ); + snr = fac * snr; + MULT( 1 ); + ADD( 1 ); + BRANCH( 1 ); + if ( snr < -99.0f ) + { + snr = -99.0f; + MOVE( 1 ); + } + return ( snr ); +} +#endif -print( - revision, - shortDate, - fullDate, - max_total[1], - newsletterFilenameLast, - maxPromOpsBasop, - logfileBasop, -) +#undef WMC_TOOL_SKIP diff --git a/lib_debug/snr.c b/lib_debug/snr.c index a524b35c26e6d5f6004cd8a3600f82060785e81e..f70b5f33eb3dda05124918d06a77b20453c9eb92 100644 --- a/lib_debug/snr.c +++ b/lib_debug/snr.c @@ -38,7 +38,7 @@ #endif #include #include -#include "wmops.h" +#include "wmc_auto.h" #include "cnst.h" #include "prot.h" diff --git a/lib_debug/wmc_auto.c b/lib_debug/wmc_auto.c new file mode 100644 index 0000000000000000000000000000000000000000..6c71a6d37df2e1ac66dd499dabbce96235524251 --- /dev/null +++ b/lib_debug/wmc_auto.c @@ -0,0 +1,1912 @@ +/* + * (C) 2022 copyright VoiceAge Corporation. All Rights Reserved. + * + * This software is protected by copyright law and by international treaties. The source code, and all of its derivations, + * is provided by VoiceAge Corporation under the "ITU-T Software Tools' General Public License". Please, read the license file + * or refer to ITU-T Recommendation G.191 on "SOFTWARE TOOLS FOR SPEECH AND AUDIO CODING STANDARDS". + * + * Any use of this software is permitted provided that this notice is not removed and that neither the authors nor + * VoiceAge Corporation are deemed to have made any representations as to the suitability of this software + * for any purpose nor are held responsible for any defects of this software. THERE IS NO WARRANTY FOR THIS SOFTWARE. + * + * Authors: Guy Richard, Vladimir Malenovsky (Vladimir.Malenovsky@USherbrooke.ca) + */ + +#include +#include +#include +#include +#include + +#ifndef _MSC_VER +#include +#include +#else +#include +#endif + +#include "options.h" +#include "wmc_auto.h" + + +#define WMC_TOOL_SKIP /* Skip the instrumentation of this file, if invoked by accident */ + +#ifdef WMOPS + +/*-------------------------------------------------------------------* + * Complexity counting tool + *--------------------------------------------------------------------*/ + +#define MAX_RECORDS 1024 +#define MAX_CHAR 64 +#define MAX_STACK 64 +#define DOUBLE_MAX 0x80000000 + +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; +#ifdef WMOPS_WC_FRAME_ANALYSIS + int32_t current_call_number; + double wc_cnt; + double wc_selfcnt; + int32_t wc_call_number; +#endif +}; + +double ops_cnt; +double prom_cnt; +double inst_cnt[NUM_INST]; + +static struct wmops_record wmops[MAX_RECORDS]; +static int stack[MAX_STACK]; +static int sptr; +static int num_records; +static int current_record; +static long update_cnt; +static double start_cnt; +static double max_cnt; +static double min_cnt; +static double inst_cnt_wc[NUM_INST]; +static long fnum_cnt_wc; + +static int *heap_allocation_call_tree = NULL, heap_allocation_call_tree_size = 0, heap_allocation_call_tree_max_size = 0; + + +void reset_wmops( void ) +{ + int i, j; + + for ( i = 0; i < MAX_RECORDS; i++ ) + { + strcpy( &wmops[i].label[0], "\0" ); + wmops[i].call_number = 0; + wmops[i].update_cnt = 0; + for ( j = 0; j < MAX_RECORDS; 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; +#endif + } + + for ( i = 0; i < MAX_STACK; i++ ) + { + stack[i] = -1; + } + sptr = 0; + num_records = 0; + current_record = -1; + update_cnt = 0; + + max_cnt = 0.0; + min_cnt = DOUBLE_MAX; + start_cnt = 0.0; + ops_cnt = 0.0; +} + + +void push_wmops( const char *label ) +{ + int new_flag; + int i, j; + + /* Check if new function record label */ + new_flag = 1; + for ( i = 0; i < num_records; i++ ) + { + if ( strcmp( wmops[i].label, label ) == 0 ) + { + new_flag = 0; + break; + } + } + + /* Configure new record */ + if ( new_flag ) + { + if ( num_records >= MAX_RECORDS ) + { + fprintf( stdout, "push_wmops(): exceeded MAX_RECORDS count.\n\n" ); + exit( -1 ); + } + strcpy( wmops[i].label, label ); + num_records++; + } + + /* Push current context onto stack */ + if ( current_record >= 0 ) + { + if ( sptr >= MAX_STACK ) + { + fprintf( stdout, "\r push_wmops(): stack exceeded, try inreasing MAX_STACK\n" ); + exit( -1 ); + } + stack[sptr++] = current_record; + + /* accumulate op counts */ + wmops[current_record].current_selfcnt += ops_cnt - wmops[current_record].start_selfcnt; + + /* update call tree */ + for ( j = 0; j < MAX_RECORDS; j++ ) + { + if ( wmops[i].call_tree[j] == current_record ) + { + break; + } + else if ( wmops[i].call_tree[j] == -1 ) + { + wmops[i].call_tree[j] = current_record; + break; + } + } + } + + /* init current record */ + current_record = i; + wmops[current_record].start_selfcnt = ops_cnt; + wmops[current_record].start_cnt = ops_cnt; + wmops[current_record].call_number++; +#ifdef WMOPS_WC_FRAME_ANALYSIS + wmops[current_record].current_call_number++; +#endif + + return; +} + + +void pop_wmops( void ) +{ + + /* Check for underflow */ + if ( current_record < 0 ) + { + fprintf( stdout, "\r pop_wmops(): stack underflow, too many calls to pop_wmops()\n" ); + exit( -1 ); + } + + /* update count of current record */ + 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 ( sptr > 0 ) + { + current_record = stack[--sptr]; + wmops[current_record].start_selfcnt = ops_cnt; + } + else + { + current_record = -1; + } + + return; +} + + +void update_wmops( void ) +{ + int i; + double current_cnt; +#ifdef WMOPS_PER_FRAME + static FILE *fid = NULL; + const char filename[] = "wmops_analysis"; + float tmpF; +#endif + + if ( sptr != 0 ) + { + fprintf( stdout, "update_wmops(): Stack must be empty!\n" ); + exit( -1 ); + } + +#ifdef WMOPS_PER_FRAME + /* Check, if the output file has already been opened */ + if ( fid == NULL ) + { + fid = fopen( filename, "wb" ); + + if ( fid == NULL ) + { + fprintf( stderr, "\nCannot open %s!\n\n", filename ); + exit( -1 ); + } + } + + /* Write current complexity to the external file */ + tmpF = (float) ( FAC * wmops[0].current_cnt ); + fwrite( &tmpF, sizeof( float ), 1, fid ); +#endif + +#ifdef WMOPS_WC_FRAME_ANALYSIS + if ( ops_cnt - start_cnt > max_cnt ) + { + for ( i = 0; i < num_records; i++ ) + { + wmops[i].wc_cnt = wmops[i].current_cnt; + wmops[i].wc_selfcnt = wmops[i].current_selfcnt; + wmops[i].wc_call_number = wmops[i].current_call_number; + } + } +#endif + + for ( i = 0; i < num_records; i++ ) + { + wmops[i].tot_selfcnt += wmops[i].current_selfcnt; + wmops[i].tot_cnt += wmops[i].current_cnt; + + if ( wmops[i].current_selfcnt > 0 ) + { + if ( wmops[i].current_selfcnt > wmops[i].max_selfcnt ) + { + wmops[i].max_selfcnt = wmops[i].current_selfcnt; + } + + if ( wmops[i].current_selfcnt < wmops[i].min_selfcnt ) + { + wmops[i].min_selfcnt = wmops[i].current_selfcnt; + } + } + + wmops[i].current_selfcnt = 0; + + if ( wmops[i].current_cnt > 0 ) + { + if ( wmops[i].current_cnt > wmops[i].max_cnt ) + { + wmops[i].max_cnt = wmops[i].current_cnt; + } + + if ( wmops[i].current_cnt < wmops[i].min_cnt ) + { + wmops[i].min_cnt = wmops[i].current_cnt; + } + + wmops[i].update_cnt++; + } + + wmops[i].current_cnt = 0; +#ifdef WMOPS_WC_FRAME_ANALYSIS + wmops[i].current_call_number = 0; +#endif + } + + current_cnt = ops_cnt - start_cnt; + if ( current_cnt > max_cnt ) + { + max_cnt = current_cnt; + + for ( i = 0; i < NUM_INST; i++ ) + { + inst_cnt_wc[i] = inst_cnt[i]; + } + + fnum_cnt_wc = update_cnt + 1; + } + + if ( current_cnt < min_cnt ) + { + min_cnt = current_cnt; + } + + for ( i = 0; i < NUM_INST; i++ ) + { + inst_cnt[i] = 0.0; + } + + start_cnt = ops_cnt; + + if ( heap_allocation_call_tree_size > 0 ) + { + /* update intra-frame heap memory and inter-frame heap memory*/ + update_mem(); + } + + /* increment frame counter */ + update_cnt++; + + return; +} + + +void print_wmops( void ) +{ + int i; + + char *sfmts = "%20s %8s %8s %7s %7s\n"; + char *dfmts = "%20s %8.2f %8.3f %7.3f %7.3f\n"; + char *sfmt = "%20s %8s %8s %7s %7s %7s %7s %7s\n"; + char *dfmt = "%20s %8.2f %8.3f %7.3f %7.3f %7.3f %7.3f %7.3f\n"; + +#ifdef WMOPS_WC_FRAME_ANALYSIS + int j, label_len, max_label_len; + char *sfmtt = "%20s %4s %15s\n"; + char *dfmtt = "%20s %4d "; +#endif + + fprintf( stdout, "\n\n --- Complexity analysis [WMOPS] --- \n\n" ); + + fprintf( stdout, "%54s %23s\n", "|------ SELF ------|", "|--- CUMULATIVE ---|" ); + fprintf( stdout, sfmt, " routine", " calls", " min ", " max ", " avg ", " min ", " max ", " avg " ); + fprintf( stdout, sfmt, "---------------", "------", "------", "------", "------", "------", "------", "------" ); + + for ( i = 0; i < num_records; i++ ) + { + fprintf( stdout, dfmt, wmops[i].label, update_cnt == 0 ? 0 : (float) wmops[i].call_number / update_cnt, + wmops[i].min_selfcnt == DOUBLE_MAX ? 0 : FAC * wmops[i].min_selfcnt, + FAC * wmops[i].max_selfcnt, + wmops[i].update_cnt == 0 ? 0 : FAC * wmops[i].tot_selfcnt / wmops[i].update_cnt, + wmops[i].min_cnt == DOUBLE_MAX ? 0 : FAC * wmops[i].min_cnt, + FAC * wmops[i].max_cnt, + wmops[i].update_cnt == 0 ? 0 : FAC * wmops[i].tot_cnt / wmops[i].update_cnt ); + } + + fprintf( stdout, sfmts, "---------------", "------", "------", "------", "------" ); + fprintf( stdout, dfmts, "total", (float) update_cnt, FAC * min_cnt, FAC * max_cnt, update_cnt == 0 ? 0 : FAC * ops_cnt / update_cnt ); + fprintf( stdout, "\n" ); + +#ifdef WMOPS_WC_FRAME_ANALYSIS + /* calculate maximum label length for compact prinout */ + max_label_len = 0; + for ( i = 0; i < num_records; i++ ) + { + label_len = strlen( wmops[i].label ); + if ( label_len > max_label_len ) + { + max_label_len = label_len; + } + } + max_label_len += 4; + + fprintf( stdout, "\nComplexity analysis for the worst-case frame %ld:\n", fnum_cnt_wc ); + fprintf( stdout, "%*s %8s %10s %12s\n", max_label_len, " routine", " calls", " SELF", " CUMULATIVE" ); + fprintf( stdout, "%*s %8s %10s %10s\n", max_label_len, "---------------", "------", "------", "----------" ); + + for ( i = 0; i < num_records; i++ ) + { + fprintf( stdout, "%*s %8d %10.3f %12.3f\n", max_label_len, wmops[i].label, wmops[i].wc_call_number, FAC * wmops[i].wc_selfcnt, FAC * wmops[i].wc_cnt ); + } + + fprintf( stdout, "\nCall Tree:\n\n" ); + fprintf( stdout, sfmtt, " function", "num", "called by: " ); + fprintf( stdout, sfmtt, "---------------", "---", "--------------" ); + + for ( i = 0; i < num_records; i++ ) + { + fprintf( stdout, dfmtt, wmops[i].label, i ); + for ( j = 0; wmops[i].call_tree[j] != -1; j++ ) + { + if ( j != 0 ) + { + fprintf( stdout, ", " ); + } + fprintf( stdout, "%d", wmops[i].call_tree[j] ); + } + fprintf( stdout, "\n" ); + } + + fprintf( stdout, sfmtt, "---------------", "---", "--------------" ); + fprintf( stdout, "\n\n" ); + + fprintf( stdout, "\nInstruction type analysis for the worst-case frame %ld:\n\n", fnum_cnt_wc ); /* added -- JPA */ + for ( i = 0; i < NUM_INST; i++ ) + { + switch ( (enum instructions) i ) + { + case _ADD: + fprintf( stdout, "\tAdds: %12.1f\n", inst_cnt_wc[i] ); + break; + case _ABS: + fprintf( stdout, "\tAbsolutes: %12.1f\n", inst_cnt_wc[i] ); + break; + case _MULT: + fprintf( stdout, "\tMultiplies: %12.1f\n", inst_cnt_wc[i] ); + break; + case _MAC: + fprintf( stdout, "\tMACs: %12.1f\n", inst_cnt_wc[i] ); + break; + case _MOVE: + fprintf( stdout, "\tMoves: %12.1f\n", inst_cnt_wc[i] ); + break; + case _STORE: + fprintf( stdout, "\tStores: %12.1f\n", inst_cnt_wc[i] ); + break; + case _LOGIC: + fprintf( stdout, "\tLogicals: %12.1f\n", inst_cnt_wc[i] ); + break; + case _SHIFT: + fprintf( stdout, "\tShifts: %12.1f\n", inst_cnt_wc[i] ); + break; + case _BRANCH: + fprintf( stdout, "\tBranches: %12.1f\n", inst_cnt_wc[i] ); + break; + case _DIV: + fprintf( stdout, "\tDivisions: %12.1f\n", inst_cnt_wc[i] ); + break; + case _SQRT: + fprintf( stdout, "\tSquare Root: %12.1f\n", inst_cnt_wc[i] ); + break; + case _TRANS: + fprintf( stdout, "\tTrans: %12.1f\n", inst_cnt_wc[i] ); + break; + case _FUNC: + fprintf( stdout, "\tFunc Call: %12.1f\n", inst_cnt_wc[i] ); + break; + case _LOOP: + fprintf( stdout, "\tLoop Init: %12.1f\n", inst_cnt_wc[i] ); + break; + case _INDIRECT: + fprintf( stdout, "\tIndirect Addr: %12.1f\n", inst_cnt_wc[i] ); + break; + case _PTR_INIT: + fprintf( stdout, "\tPointer Init: %12.1f\n", inst_cnt_wc[i] ); + break; + case _TEST: + fprintf( stdout, "\tExtra condit.: %12.1f\n", inst_cnt_wc[i] ); + break; + case _POWER: + fprintf( stdout, "\tExponential: %12.1f\n", inst_cnt_wc[i] ); + break; + case _LOG: + fprintf( stdout, "\tLogarithm: %12.1f\n", inst_cnt_wc[i] ); + break; + case _MISC: + fprintf( stdout, "\tAll other op.: %12.1f\n", inst_cnt_wc[i] ); + break; + default: + fprintf( stdout, "\tERROR: Invalid instruction type: %d\n\n", i ); + } + } +#endif + + return; +} + + +/*-------------------------------------------------------------------* + * Memory counting tool measuring RAM usage (stack and heap) + * + * Maximum RAM is measured by monitoring the total allocated memory (stack and heap) in each frame. + * + * Maximum stack is measured by monitoring the difference between the 'top' and 'bottom' of the stack. The 'bottom' of the stack is updated in each function + * with a macro 'func_start_' which is inserted automatically to all functions during the instrumentation process. + * + * Maximum heap is measured by summing the sizes of all memory blocks allocated by malloc() or calloc() and deallocated by free(). The maximum heap size is + * updated each time when the macros malloc_() or calloc_() is invoked. The macros 'malloc_ and calloc_' are inserted automatically during the instrumentation process. + * As part of heap measurements, intra-frame heap and inter-frame heap are measured separately. Intra-frame heap refers to heap memory which is allocated and deallocated + * within a single frame. Inter-frame heap, on the contrary, refers to heap memory which is reserved for more than one frame. + * + * In order to run the memory counting tool the function reset_mem(cnt_size) must be called at the beginning of the encoding/decoding process. + * The unit in which memory consumption is reported is set via the parameter 'cnt_size'. It can be set to 0 (bytes), 1 (32b words) or 2 (64b words). + * At the end of the encoding/decoding process, 'print_mem()' function may be called to print basic information about memory consumption. If the macro 'MEM_COUNT_DETAILS' + * is activated, detailed information is printed + * + * The macro 'WMOPS' needs to be activated to enable memory counting. To avoid the instrumentation of malloc()/calloc()/free() calls, use + * #define WMC_TOOL_SKIP ... #undef WMC_TOOL_SKIP macro pair around the malloc(), calloc() and free(). + *--------------------------------------------------------------------*/ + +#define MAX_RECORDABLE_CALLS 100 +#define MAX_FUNCTION_NAME_LENGTH 35 /* Maximum length that the function string will be truncated to */ +#define MAX_PARAMS_LENGTH 50 /* Maximum length that the parameter string will be truncated to */ +#define MAX_NUM_RECORDS 300 /* Initial maximum number of memory records -> mightb be increased during runtime, if needed */ +#define MAX_NUM_RECORDS_REALLOC_STEP 50 /* When re-allocating the list of memory records, increase the number of records by this number */ + +/* This is the value (in bytes) towards which the block size is rounded. For example, a block of 123 bytes, when using + a 32 bits system, will end up taking 124 bytes since the last unused byte cannot be used for another block. */ +#ifdef MEM_ALIGN_64BITS +#define BLOCK_ROUNDING 8 /* Align on 64 Bits */ +#else +#define BLOCK_ROUNDING 4 /* Align on 32 Bits */ +#endif + +#define N_32BITS_BLOCKS ( BLOCK_ROUNDING / sizeof( int32_t ) ) + +#define MAGIC_VALUE_OOB 0x12A534F0 /* Signature value which is inserted before and after each allocated memory block, used to detect out-of-bound access */ +#define MAGIC_VALUE_USED ( ~MAGIC_VALUE_OOB ) /* Value used to pre-fill allocated memory blocks, used to calculate actual memory usage */ +#define OOB_START 0x1 /* Flag indicating out-of-bounds access before memory block */ +#define OOB_END 0x2 /* Flag indicating out-of-bounds access after memory block */ + +#define ROUND_BLOCK_SIZE( n ) ( ( ( n ) + BLOCK_ROUNDING - 1 ) & ~( BLOCK_ROUNDING - 1 ) ) +#define IS_CALLOC( str ) ( str[0] == 'c' ) + +typedef struct +{ + char function_name[MAX_FUNCTION_NAME_LENGTH + 1]; + int16_t *stack_ptr; +} caller_info; + +caller_info stack_callers[2][MAX_RECORDABLE_CALLS]; + +typedef struct +{ + char name[MAX_FUNCTION_NAME_LENGTH + 1]; /* +1 for NUL */ + char params[1 + MAX_PARAMS_LENGTH + 1]; /* +1 for 'm'/'c' alloc & +1 for NUL */ + unsigned long hash; + int lineno; + void *block_ptr; + int block_size; + unsigned long total_block_size; /* Cumulative sum of the allocated size in the session */ + unsigned long total_used_size; /* Cumulative sum of the used size in the session */ + int wc_heap_size_intra_frame; /* Worst-Case Intra-Frame Heap Size */ + int wc_heap_size_inter_frame; /* Worst-Case Inter-Frame Heap Size */ + int frame_allocated; /* Frame number in which the Memory Block has been allocated (-1 if not allocated at the moment) */ + int OOB_Flag; + int noccurances; /* Number of times that the memory block has been allocated in a frame */ +} allocator_record; + +allocator_record *allocation_list = NULL; + +static int16_t *ptr_base_stack = 0; /* Pointer to the bottom of stack (base pointer). Stack grows up. */ +static int16_t *ptr_current_stack = 0; /* Pointer to the current stack pointer */ +static int16_t *ptr_max_stack = 0; /* Pointer to the maximum stack pointer (the farest point from the bottom of stack) */ +static int32_t wc_stack_frame = 0; /* Frame corresponding to the worst-case stack usage */ +static int32_t wc_ram_size, wc_ram_frame; +static int32_t current_heap_size; +static int current_calls = 0; +static char location_max_stack[256] = "undefined"; +static int Num_Records, Max_Num_Records; +static size_t Stat_Cnt_Size = USE_BYTES; +static const char *Count_Unit[] = { "bytes", "words", "words" }; + +static int *list_wc_intra_frame_heap, n_items_wc_intra_frame_heap, max_items_wc_intra_frame_heap, size_wc_intra_frame_heap, location_wc_intra_frame_heap; +static int *list_current_inter_frame_heap, n_items_current_inter_frame_heap, max_items_current_inter_frame_heap, size_current_inter_frame_heap; +static int *list_wc_inter_frame_heap, n_items_wc_inter_frame_heap, max_items_wc_inter_frame_heap, size_wc_inter_frame_heap, location_wc_inter_frame_heap; + +/* Local Functions */ +static unsigned long malloc_hash( const char *func_name, int func_lineno, char *size_str ); +allocator_record *get_mem_record( unsigned long *hash, const char *func_name, int func_lineno, char *size_str, int *index_record ); +static void *mem_alloc_block( size_t size, const char *size_str ); + +/*-------------------------------------------------------------------* + * reset_mem() + * + * Initialize/reset memory counting tool (stack and heap) + *--------------------------------------------------------------------*/ + +void reset_mem( Counting_Size cnt_size ) +{ + int16_t something; + size_t tmp_size; + + /* initialize stack pointers */ + ptr_base_stack = &something; + ptr_max_stack = ptr_base_stack; + ptr_current_stack = ptr_base_stack; + + Stat_Cnt_Size = cnt_size; + + /* Check, if sizeof(int32_t) is 4 bytes */ + tmp_size = sizeof( int32_t ); + if ( tmp_size != 4 ) + { + fprintf( stderr, "Error: Expecting 'int32_t' to be a 32 Bits Integer!" ); + exit( -1 ); + } + + /* create allocation list for malloc() memory blocks */ + if ( allocation_list == NULL ) + { + allocation_list = malloc( MAX_NUM_RECORDS * sizeof( allocator_record ) ); + } + + if ( allocation_list == NULL ) + { + fprintf( stderr, "Error: Unable to Create List of Memory Blocks!" ); + exit( -1 ); + } + + Num_Records = 0; + Max_Num_Records = MAX_NUM_RECORDS; + + wc_ram_size = 0; + wc_ram_frame = -1; + current_heap_size = 0; + + /* heap allocation tree */ + heap_allocation_call_tree_max_size = MAX_NUM_RECORDS; + if ( heap_allocation_call_tree == NULL ) + { + heap_allocation_call_tree = (int *) malloc( heap_allocation_call_tree_max_size * sizeof( int ) ); + memset( heap_allocation_call_tree, -1, heap_allocation_call_tree_max_size * sizeof( int ) ); + } + heap_allocation_call_tree_size = 0; + + /* wc intra-frame heap */ + max_items_wc_intra_frame_heap = MAX_NUM_RECORDS; + if ( list_wc_intra_frame_heap == NULL ) + { + list_wc_intra_frame_heap = (int *) malloc( max_items_wc_intra_frame_heap * sizeof( int ) ); + memset( list_wc_intra_frame_heap, -1, max_items_wc_intra_frame_heap * sizeof( int ) ); + } + n_items_wc_intra_frame_heap = 0; + size_wc_intra_frame_heap = 0; + location_wc_intra_frame_heap = -1; + + /* current inter-frame heap */ + max_items_current_inter_frame_heap = MAX_NUM_RECORDS; + if ( list_current_inter_frame_heap == NULL ) + { + list_current_inter_frame_heap = (int *) malloc( max_items_current_inter_frame_heap * sizeof( int ) ); + memset( list_current_inter_frame_heap, -1, max_items_current_inter_frame_heap * sizeof( int ) ); + } + n_items_current_inter_frame_heap = 0; + size_current_inter_frame_heap = 0; + + /* wc inter-frame heap */ + max_items_wc_inter_frame_heap = MAX_NUM_RECORDS; + if ( list_wc_inter_frame_heap == NULL ) + { + list_wc_inter_frame_heap = (int *) malloc( max_items_wc_inter_frame_heap * sizeof( int ) ); + memset( list_wc_inter_frame_heap, -1, max_items_wc_inter_frame_heap * sizeof( int ) ); + } + n_items_wc_inter_frame_heap = 0; + size_wc_inter_frame_heap = 0; + location_wc_inter_frame_heap = -1; + + return; +} + +/*-------------------------------------------------------------------* + * reset_stack() + * + * Reset stack pointer + *--------------------------------------------------------------------*/ + +void reset_stack( void ) +{ + int16_t something; + + /* initialize/reset stack pointers */ + ptr_base_stack = &something; + ptr_max_stack = ptr_base_stack; + ptr_current_stack = ptr_base_stack; + + return; +} + +/*-------------------------------------------------------------------* + * push_stack() + * + * Check the current stack pointer and update the maximum stack pointer, if new maximum found. + *--------------------------------------------------------------------*/ + +int push_stack( const char *filename, const char *fctname ) +{ + int16_t something; + int32_t current_stack_size; + + ptr_current_stack = &something; + + (void) *filename; /* to avoid compilation warning */ + + /* Is there room to save the caller's information? */ + if ( current_calls >= MAX_RECORDABLE_CALLS ) + { /* No */ + fprintf( stderr, "No more room to store call stack info. Please increase MAX_RECORDABLE_CALLS" ); + exit( -1 ); + } + + /* Valid Function Name? */ + if ( fctname[0] == 0 ) + { /* No */ + fprintf( stderr, "Invalid function name for call stack info." ); + exit( -1 ); + } + + /* Save the Name of the Calling Function in the Table */ + strncpy( stack_callers[0][current_calls].function_name, fctname, MAX_FUNCTION_NAME_LENGTH ); + stack_callers[0][current_calls].function_name[MAX_FUNCTION_NAME_LENGTH] = 0; /* Nul Terminate */ + + /* Save the Stack Pointer */ + stack_callers[0][current_calls].stack_ptr = ptr_current_stack; + + /* Increase Stack Calling Tree Level */ + current_calls++; + + /* Is this the First Time or the Worst Case? */ + if ( ptr_current_stack < ptr_max_stack || ptr_max_stack == NULL ) + { /* Yes */ + /* Save Info about it */ + ptr_max_stack = ptr_current_stack; + + wc_stack_frame = update_cnt; /* current frame number is stored in the variable update_cnt and updated in the function update_wmops() */ + strncpy( location_max_stack, fctname, sizeof( location_max_stack ) - 1 ); + location_max_stack[sizeof( location_max_stack ) - 1] = '\0'; + + /* Save Call Tree */ + memmove( stack_callers[1], stack_callers[0], sizeof( caller_info ) * current_calls ); + + /* Terminate the List (Unless Full) */ + if ( current_calls < MAX_RECORDABLE_CALLS ) + { + stack_callers[1][current_calls].function_name[0] = 0; + } + } + + /* Check, if This is the New Worst-Case RAM (stack + heap) */ + current_stack_size = (int32_t) ( ( ( ptr_base_stack - ptr_current_stack ) * sizeof( int16_t ) ) ); + + if ( current_stack_size < 0 ) + { + /* prevent negative stack size */ + current_stack_size = 0; + } + + if ( current_stack_size + current_heap_size > wc_ram_size ) + { + wc_ram_size = current_stack_size + current_heap_size; + wc_ram_frame = update_cnt; + } + + return 0 /* for Now */; +} + +/*-------------------------------------------------------------------* + * pop_stack() + * + * Remove stack caller entry from the list + *--------------------------------------------------------------------*/ + +int pop_stack( const char *filename, const char *fctname ) +{ + caller_info *caller_info_ptr; + + (void) *filename; /* to avoid compilation warning */ + + /* Decrease Stack Calling */ + current_calls--; + + /* Get Pointer to Caller Information */ + caller_info_ptr = &stack_callers[0][current_calls]; + + /* Check, if Names Match */ + if ( strncmp( caller_info_ptr->function_name, fctname, MAX_FUNCTION_NAME_LENGTH ) != 0 ) + { + fprintf( stderr, "Invalid usage of pop_stack()" ); + exit( -1 ); + } + + /* Erase Entry */ + caller_info_ptr->function_name[0] = 0; + + /* Retrieve previous stack pointer */ + if ( current_calls == 0 ) + { + ptr_current_stack = ptr_base_stack; + } + else + { + ptr_current_stack = stack_callers[0][current_calls - 1].stack_ptr; + } + + return 0 /* for Now */; +} + +#ifdef MEM_COUNT_DETAILS +/*-------------------------------------------------------------------* + * print_stack_call_tree() + * + * Print detailed information about worst-case stack usage + *--------------------------------------------------------------------*/ + +static void print_stack_call_tree( void ) +{ + caller_info *caller_info_ptr; + int call_level; + char fctname[MAX_FUNCTION_NAME_LENGTH + 1]; + + fprintf( stdout, "\nList of functions when maximum stack size is reached:\n\n" ); + + caller_info_ptr = &stack_callers[1][0]; + for ( call_level = 0; call_level < MAX_RECORDABLE_CALLS; call_level++ ) + { + /* Done? */ + if ( caller_info_ptr->function_name[0] == 0 ) + { + break; + } + + /* Print Name */ + strncpy( fctname, caller_info_ptr->function_name, MAX_FUNCTION_NAME_LENGTH ); + strcat( fctname, "()" ); + fprintf( stdout, "%-42s", fctname ); + + /* Print Stack Usage (Based on Difference) */ + if ( call_level != 0 ) + { + fprintf( stdout, "%lu %s\n", ( ( ( caller_info_ptr - 1 )->stack_ptr - caller_info_ptr->stack_ptr ) * sizeof( int16_t ) ) >> Stat_Cnt_Size, Count_Unit[Stat_Cnt_Size] ); + } + else + { + fprintf( stdout, "%lu %s\n", ( ( ptr_base_stack - caller_info_ptr->stack_ptr ) * sizeof( int16_t ) ) >> Stat_Cnt_Size, Count_Unit[Stat_Cnt_Size] ); + } + + /* Advance */ + caller_info_ptr++; + } + + fprintf( stdout, "\n" ); + + return; +} +#endif + + +/*-------------------------------------------------------------------* + * mem_alloc() + * + * Creates new record, stores auxiliary information about which function allocated the memory, line number, parameters, etc. + * Finally, it allocates physical memory using malloc() + * The function also updates worst-case heap size and worst-case RAM size + *--------------------------------------------------------------------*/ + +void *mem_alloc( + const char *func_name, + int func_lineno, + size_t size, + char *size_str /* the first char indicates m-alloc or c-alloc */ ) +{ + int index_record; + int32_t current_stack_size; + unsigned long hash; + allocator_record *ptr_record; + + if ( size == 0 ) + { + fprintf( stderr, "Fct=%s, Ln=%i: %s!\n", func_name, func_lineno, "Size of Zero not Supported" ); + exit( -1 ); + } + + /* Search for an existing record (that has been de-allocated before) */ + index_record = 0; + while ( ( ptr_record = get_mem_record( &hash, func_name, func_lineno, size_str, &index_record ) ) != NULL ) + { + if ( ptr_record->frame_allocated == -1 ) + { + break; + } + else + { + index_record++; + } + } + + /* Create new record */ + if ( ptr_record == NULL ) + { + if ( Num_Records >= Max_Num_Records ) + { + /* There is no room for a new record -> reallocate memory */ + Max_Num_Records += MAX_NUM_RECORDS_REALLOC_STEP; + allocation_list = realloc( allocation_list, Max_Num_Records * sizeof( allocator_record ) ); + } + + ptr_record = &( allocation_list[Num_Records] ); + + /* Initialize new record */ + ptr_record->hash = hash; + ptr_record->noccurances = 0; + ptr_record->total_block_size = 0; + ptr_record->total_used_size = 0; + ptr_record->frame_allocated = -1; + ptr_record->OOB_Flag = 0; + ptr_record->wc_heap_size_intra_frame = -1; + ptr_record->wc_heap_size_inter_frame = -1; + + index_record = Num_Records; + Num_Records++; + } + + /* Allocate memory block for the new record, add signature before the beginning and after the memory block and fill it with magic value */ + ptr_record->block_ptr = mem_alloc_block( size, size_str ); + + if ( ptr_record->block_ptr == NULL ) + { + fprintf( stderr, "Fct=%s, Ln=%i: %s!\n", func_name, func_lineno, "Error: Cannot Allocate Memory!" ); + exit( -1 ); + } + + /* Save all auxiliary information about the memory block */ + strncpy( ptr_record->name, func_name, MAX_FUNCTION_NAME_LENGTH ); + ptr_record->name[MAX_FUNCTION_NAME_LENGTH] = '\0'; + strncpy( ptr_record->params, size_str, MAX_PARAMS_LENGTH ); /* Note: The size string starts with either 'm' or 'c' to indicate 'm'alloc or 'c'alloc */ + ptr_record->params[MAX_PARAMS_LENGTH] = '\0'; + ptr_record->lineno = func_lineno; + ptr_record->block_size = size; + ptr_record->total_block_size += size; + + if ( ptr_record->frame_allocated != -1 ) + { + fprintf( stderr, "Fct=%s, Ln=%i: %s!\n", func_name, func_lineno, "Error: Attempt to Allocate the Same Memory Block with Freeing it First!" ); + exit( -1 ); + } + + ptr_record->frame_allocated = update_cnt; /* Store the current frame number -> later it will be used to determine the total duration */ + + /* Update Heap Size in the current frame */ + current_heap_size += ptr_record->block_size; + + /* Check, if this is the new Worst-Case RAM (stack + heap) */ + current_stack_size = (int32_t) ( ( ( ptr_base_stack - ptr_current_stack ) * sizeof( int16_t ) ) ); + if ( current_stack_size + current_heap_size > wc_ram_size ) + { + wc_ram_size = current_stack_size + current_heap_size; + wc_ram_frame = update_cnt; + } + + /* Add new entry to the heap allocation call tree */ + if ( heap_allocation_call_tree == NULL ) + { + fprintf( stderr, "Error: Heap allocation call tree not created!" ); + exit( -1 ); + } + + /* check, if the maximum size of the call tree has been reached -> resize if so */ + if ( heap_allocation_call_tree_size >= heap_allocation_call_tree_max_size ) + { + heap_allocation_call_tree_max_size += MAX_NUM_RECORDS_REALLOC_STEP; + heap_allocation_call_tree = (int *) realloc( heap_allocation_call_tree, heap_allocation_call_tree_max_size * sizeof( int ) ); + } + + /* push new entry (positive number means push op, neagtive number means pop op; zero index must be converted to 0.01 :-) */ + heap_allocation_call_tree[heap_allocation_call_tree_size++] = index_record; + + return ptr_record->block_ptr; +} + +/*-------------------------------------------------------------------* + * mem_alloc_block() + * + * Physical allocation of memory using malloc(). Appends 'signature' before and after the block, + * pre-fills memory block with magic value + *--------------------------------------------------------------------*/ + +static void *mem_alloc_block( size_t size, const char *size_str ) +{ + size_t rounded_size; + void *block_ptr; + char *tmp_ptr; + size_t n, f; + int32_t fill_value; + int32_t *ptr32; + int32_t mask, temp; + + /* Round Up Block Size */ + rounded_size = ROUND_BLOCK_SIZE( size ); + + /* Allocate memory using the standard malloc() by adding room for Signature Values */ + block_ptr = malloc( rounded_size + BLOCK_ROUNDING * 2 ); + + if ( block_ptr == NULL ) + { + return NULL; + } + + /* Add Signature Before the Start of the Block */ + ptr32 = (int32_t *) block_ptr; + n = N_32BITS_BLOCKS; + do + { + *ptr32++ = MAGIC_VALUE_OOB; + } while ( --n ); + + /* Fill Memory Block with Magic Value or 0 */ + fill_value = MAGIC_VALUE_USED; + if ( IS_CALLOC( size_str ) ) + { + fill_value = 0x00000000; + } + n = size / sizeof( int32_t ); + while ( n-- ) + { + *ptr32++ = fill_value; + } + + /* Fill the Reminder of the Memory Block - After Rounding */ + n = rounded_size - size; + f = n % sizeof( int32_t ); + if ( f != 0 ) + { + /* when filling with '0' need to adapt the magic value */ + /* shift by [1->24, 2->16, 3->8] */ + mask = 0xFFFFFFFF << ( ( sizeof( int32_t ) - f ) * 8 ); /* (1) */ + temp = MAGIC_VALUE_OOB & mask; + if ( fill_value != 0x0 ) + { /* for malloc merge fill value */ + temp += ( ~mask ) & MAGIC_VALUE_USED; + } /* for calloc the code in (1) above already introduces zeros */ + *ptr32++ = temp; + } + n /= sizeof( int32_t ); + n += N_32BITS_BLOCKS; + + /* Add Signature After the End of Block */ + do + { + *ptr32++ = MAGIC_VALUE_OOB; + } while ( --n ); + + /* Adjust the Memory Block Pointer (Magic Value Before and After the Memory Block Requested) */ + tmp_ptr = (char *) block_ptr; + tmp_ptr += BLOCK_ROUNDING; + block_ptr = (void *) tmp_ptr; + + return block_ptr; +} + +/*-------------------------------------------------------------------* + * mem_set_usage() + * + * Calculates actual usage of memory block by checking the magic value that was used to pre-fill + * each memory block during its allocation + *--------------------------------------------------------------------*/ + +static int mem_set_usage( allocator_record *record_ptr ) +{ + int total_bytes_used; + + size_t n; + int32_t *ptr32; + char *ptr8; + size_t total_bytes; + int32_t fill_value; + + fill_value = MAGIC_VALUE_USED; + if ( ( record_ptr->params[0] ) == 'c' ) + { + fill_value = 0x00000000; + } + + total_bytes = record_ptr->block_size; + + /* Check 4 bytes at a time */ + ptr32 = (int32_t *) record_ptr->block_ptr; + total_bytes_used = 0; + for ( n = total_bytes / sizeof( int32_t ); n > 0; n-- ) + { + if ( *ptr32++ != fill_value ) + { + total_bytes_used += sizeof( int32_t ); + } + } + + /* Check remaining bytes (If Applicable) 1 byte at a time */ + ptr8 = (char *) ptr32; + for ( n = total_bytes % sizeof( int32_t ); n > 0; n-- ) + { + if ( *ptr8++ != (char) fill_value ) + { + total_bytes_used++; + } + + /* Update Value */ + fill_value >>= 8; + } + + return total_bytes_used; +} + +/*-------------------------------------------------------------------* + * mem_check_OOB() + * + * Checks, if out-of-bounds access has occured. This is done by inspecting the 'signature' value + * taht has been added before and after the memory block during its allocation + *--------------------------------------------------------------------*/ + +static unsigned int mem_check_OOB( allocator_record *record_ptr ) +{ + int32_t *ptr32; + unsigned int OOB_Flag = 0x0; + int32_t mask; + size_t i; + int f; + + ptr32 = (int32_t *) record_ptr->block_ptr - N_32BITS_BLOCKS; + + /* Check the Signature at the Beginning of Memory Block */ + i = N_32BITS_BLOCKS; + do + { + if ( *ptr32++ ^ MAGIC_VALUE_OOB ) + { + OOB_Flag |= OOB_START; + } + } while ( --i ); + + /* Advance to End (Snap to lowest 32 Bits) */ + ptr32 += record_ptr->block_size / sizeof( int32_t ); + + /* Calculate Unused Space That has been added to get to the rounded Block Size */ + i = ROUND_BLOCK_SIZE( record_ptr->block_size ) - record_ptr->block_size; + + /* Partial Check of Signature at the End of Memory Block (for block size that has been rounded) */ + f = i % sizeof( int32_t ); + if ( f != 0 ) + { + mask = 0xFFFFFFFF << ( ( sizeof( int32_t ) - f ) * 8 ); + if ( ( *ptr32++ ^ MAGIC_VALUE_OOB ) & mask ) + { + OOB_Flag |= OOB_END; + } + } + + /* Full Check of Signature at the End of Memory Block, i.e. all 32 Bits (for the remainder after rounding) */ + i /= sizeof( int32_t ); + i += N_32BITS_BLOCKS; + do + { + if ( *ptr32++ ^ MAGIC_VALUE_OOB ) + { + OOB_Flag |= OOB_END; + } + } while ( --i ); + + return OOB_Flag; +} + +/*-------------------------------------------------------------------* + * malloc_hash() + * + * Calculate hash from function name, line number and malloc size + *--------------------------------------------------------------------*/ + +static unsigned long malloc_hash( const char *func_name, int func_lineno, char *size_str ) +{ + unsigned long hash = 5381; + const char *ptr_str; + + ptr_str = func_name; + while ( ptr_str != NULL && *ptr_str != '\0' ) + { + hash = ( ( hash << 5 ) + hash ) + *ptr_str++; /* hash * 33 + char */ + } + + hash = ( ( hash << 5 ) + hash ) + func_lineno; /* hash * 33 + func_lineno */ + + ptr_str = size_str; + while ( ptr_str != NULL && *ptr_str != '\0' ) + { + hash = ( ( hash << 5 ) + hash ) + *ptr_str++; /* hash * 33 + char */ + } + + return hash; +} + +/*-------------------------------------------------------------------* + * get_mem_record() + * + * Search for memory record in the internal list, return NULL if not found + * Start from index_record + *--------------------------------------------------------------------*/ + +allocator_record *get_mem_record( unsigned long *hash, const char *func_name, int func_lineno, char *size_str, int *index_record ) +{ + int i; + + if ( *index_record < 0 || *index_record > Num_Records ) + { + return NULL; + } + + /* calculate hash */ + *hash = malloc_hash( func_name, func_lineno, size_str ); + + for ( i = *index_record; i < Num_Records; i++ ) + { + /* check, if memory block is not allocated at the moment and the hash matches */ + if ( allocation_list[i].block_ptr == NULL && *hash == allocation_list[i].hash ) + { + *index_record = i; + return &( allocation_list[i] ); + } + } + + /* not found */ + *index_record = -1; + return NULL; +} + + +/*-------------------------------------------------------------------* + * 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. + * + * Note: The record is not removed from the list and may be reused later on in mem_alloc()! + *--------------------------------------------------------------------*/ + +void mem_free( const char *func_name, int func_lineno, void *ptr ) +{ + int i, index_record; + char *tmp_ptr; + allocator_record *ptr_record; + + /* Search for the Block Pointer in the List */ + ptr_record = NULL; + index_record = -1; + for ( i = 0; i < Num_Records; i++ ) + { + if ( ptr == allocation_list[i].block_ptr ) + { /* Yes, Found it */ + ptr_record = &( allocation_list[i] ); + index_record = i; + break; + } + } + + if ( ptr_record == NULL ) + { + fprintf( stderr, "Fct=%s, Ln=%i: %s!\n", func_name, func_lineno, "Error: Unable to Find Record Corresponding to the Allocated Memory Block!" ); + exit( -1 ); + } + + /* Update the Heap Size */ + current_heap_size -= ptr_record->block_size; + + /* Calculate the Actual Usage of the Memory Block (Look for Signature) */ + ptr_record->total_used_size += mem_set_usage( ptr_record ); + + /* Check, if Out-Of-Bounds Access has been Detected */ + ptr_record->OOB_Flag = mem_check_OOB( ptr_record ); + + /* De-Allocate Memory Block */ + tmp_ptr = (char *) ptr; + tmp_ptr -= BLOCK_ROUNDING; + ptr = (void *) tmp_ptr; + free( ptr ); + + /* Add new entry to the heap allocation call tree */ + if ( heap_allocation_call_tree == NULL ) + { + fprintf( stderr, "Error: Heap allocation call tree not created!" ); + exit( -1 ); + } + + /* check, if the maximum size of the call tree has been reached -> resize if so */ + if ( heap_allocation_call_tree_size >= heap_allocation_call_tree_max_size ) + { + heap_allocation_call_tree_max_size += MAX_NUM_RECORDS_REALLOC_STEP; + heap_allocation_call_tree = (int *) realloc( heap_allocation_call_tree, heap_allocation_call_tree_max_size * sizeof( int ) ); + } + + heap_allocation_call_tree[heap_allocation_call_tree_size++] = -index_record; + + /* Reset memory block pointer (this is checked when updating wc intra-frame and inter-frame memory) */ + ptr_record->block_ptr = NULL; + + return; +} + + +/*-------------------------------------------------------------------* + * update_mem() + * + * This function updates the worst-case intra-frame memory and the worst-case inter-frame memory. + *--------------------------------------------------------------------*/ + +void update_mem( void ) +{ + int i, j, flag_alloc = -1, i_record; + int32_t size_current_intra_frame_heap; + int *list_current_intra_frame_heap = NULL, n_items_current_intra_frame_heap; + allocator_record *ptr_record; + + /* process the heap allocation call tree */ + n_items_current_intra_frame_heap = 0; + size_current_intra_frame_heap = 0; + for ( i = 0; i < heap_allocation_call_tree_size; i++ ) + { + /* get the record */ + i_record = heap_allocation_call_tree[i]; + + if ( i_record > 0 ) + { + flag_alloc = 1; + } + else if ( i_record < 0 ) + { + flag_alloc = 0; + i_record = -i_record; + } + ptr_record = &( allocation_list[i_record] ); + + if ( ptr_record->frame_allocated == update_cnt && ptr_record->block_ptr == NULL ) + { + /* intra-frame heap memory */ + if ( list_current_intra_frame_heap == NULL ) + { + list_current_intra_frame_heap = (int *) malloc( heap_allocation_call_tree_size * sizeof( int ) ); + memset( list_current_intra_frame_heap, -1, heap_allocation_call_tree_size * sizeof( int ) ); + } + + /* zero index doesn't have sign to determine whether it's allocated or de-allocated -> we need to search the list */ + if ( i_record == 0 ) + { + flag_alloc = 1; + for ( j = 0; j < n_items_current_intra_frame_heap; j++ ) + { + if ( list_current_intra_frame_heap[j] == i_record ) + { + flag_alloc = 0; + break; + } + } + } + + if ( flag_alloc ) + { + /* add to list */ + list_current_intra_frame_heap[n_items_current_intra_frame_heap++] = i_record; + size_current_intra_frame_heap += ptr_record->block_size; + + /* check, if this is the new worst-case */ + if ( size_current_intra_frame_heap > size_wc_intra_frame_heap ) + { + if ( n_items_current_intra_frame_heap >= max_items_wc_intra_frame_heap ) + { + /* resize list, if needed */ + max_items_wc_intra_frame_heap = n_items_current_intra_frame_heap + MAX_NUM_RECORDS_REALLOC_STEP; + list_wc_intra_frame_heap = realloc( list_wc_intra_frame_heap, max_items_wc_intra_frame_heap * sizeof( int ) ); + } + + /* save to wc list */ + memmove( list_wc_intra_frame_heap, list_current_intra_frame_heap, n_items_current_intra_frame_heap * sizeof( int ) ); + n_items_wc_intra_frame_heap = n_items_current_intra_frame_heap; + size_wc_intra_frame_heap = size_current_intra_frame_heap; + location_wc_intra_frame_heap = update_cnt; + ptr_record->wc_heap_size_intra_frame = ptr_record->block_size; + } + } + else + { + /* remove from list */ + for ( j = 0; j < n_items_current_intra_frame_heap; j++ ) + { + if ( list_current_intra_frame_heap[j] == i_record ) + { + break; + } + } + memmove( &list_current_intra_frame_heap[j], &list_current_intra_frame_heap[j + 1], ( n_items_current_intra_frame_heap - j ) * sizeof( int ) ); + n_items_current_intra_frame_heap--; + size_current_intra_frame_heap -= ptr_record->block_size; + + /* reset block size */ + ptr_record->frame_allocated = -1; + ptr_record->block_size = 0; + } + } + else + { + /* inter-frame heap memory */ + + /* zero index doesn't have sign to determine whether it's allocated or de-allocated -> we need to search the list */ + if ( i_record == 0 ) + { + flag_alloc = 1; + for ( j = 0; j < n_items_current_inter_frame_heap; j++ ) + { + if ( list_current_inter_frame_heap[j] == i_record ) + { + flag_alloc = 0; + break; + } + } + } + + if ( flag_alloc ) + { + /* add to list */ + if ( n_items_current_inter_frame_heap >= max_items_current_inter_frame_heap ) + { + /* resize list, if needed */ + max_items_current_inter_frame_heap = n_items_current_inter_frame_heap + MAX_NUM_RECORDS_REALLOC_STEP; + list_current_inter_frame_heap = realloc( list_current_inter_frame_heap, max_items_current_inter_frame_heap * sizeof( int ) ); + } + + list_current_inter_frame_heap[n_items_current_inter_frame_heap++] = i_record; + size_current_inter_frame_heap += ptr_record->block_size; + + /* check, if this is the new worst-case */ + if ( size_current_inter_frame_heap > size_wc_inter_frame_heap ) + { + if ( n_items_current_inter_frame_heap >= max_items_wc_inter_frame_heap ) + { + /* resize list, if needed */ + max_items_wc_inter_frame_heap = n_items_current_inter_frame_heap + MAX_NUM_RECORDS_REALLOC_STEP; + list_wc_inter_frame_heap = realloc( list_wc_inter_frame_heap, max_items_wc_inter_frame_heap * sizeof( int ) ); + } + + memmove( list_wc_inter_frame_heap, list_current_inter_frame_heap, n_items_current_inter_frame_heap * sizeof( int ) ); + n_items_wc_inter_frame_heap = n_items_current_inter_frame_heap; + size_wc_inter_frame_heap = size_current_inter_frame_heap; + location_wc_inter_frame_heap = update_cnt; + ptr_record->wc_heap_size_inter_frame = ptr_record->block_size; + } + } + else + { + /* remove from list */ + for ( j = 0; j < n_items_current_inter_frame_heap; j++ ) + { + if ( list_current_inter_frame_heap[j] == i_record ) + { + break; + } + } + memmove( &list_current_inter_frame_heap[j], &list_current_inter_frame_heap[j + 1], ( n_items_current_inter_frame_heap - j ) * sizeof( int ) ); + n_items_current_inter_frame_heap--; + size_current_inter_frame_heap -= ptr_record->block_size; + + /* reset block size */ + ptr_record->frame_allocated = -1; + ptr_record->block_size = 0; + } + } + } + + /* reset heap allocation call tree */ + heap_allocation_call_tree_size = 0; + + if ( list_current_intra_frame_heap ) + { + free( list_current_intra_frame_heap ); + } + + return; +} + +#ifdef MEM_COUNT_DETAILS +/*-------------------------------------------------------------------* + * subst() + * + * Substitute character in string + *--------------------------------------------------------------------*/ + +static void subst( char *s, char from, char to ) +{ + while ( *s == from ) + { + *s++ = to; + } + + return; +} + + +/*-------------------------------------------------------------------* + * mem_count_summary() + * + * Print detailed (per-item) information about heap memory usage + *--------------------------------------------------------------------*/ + +static void mem_count_summary( void ) +{ + int i, j, index, index_record; + size_t length; + char buf[300], format_str[50], name_str[MAX_FUNCTION_NAME_LENGTH + 3], parms_str[MAX_PARAMS_LENGTH + 1], type_str[10], usage_str[20], size_str[20], line_str[10]; + allocator_record *ptr_record, *ptr; + + /* Prepare format string */ + sprintf( format_str, "%%-%ds %%5s %%6s %%-%ds %%20s %%6s ", MAX_FUNCTION_NAME_LENGTH, MAX_PARAMS_LENGTH ); + + if ( n_items_wc_intra_frame_heap > 0 ) + { + /* Intra-Frame Heap Size */ + fprintf( stdout, "\nList of memory blocks when maximum intra-frame heap size is reached:\n\n" ); + + /* Find duplicate records (same hash and worst-case heap size) */ + for ( i = 0; i < n_items_wc_intra_frame_heap; i++ ) + { + index_record = list_wc_intra_frame_heap[i]; + if ( index_record == -1 ) + { + continue; + } + + ptr_record = &( allocation_list[index_record] ); + for ( j = i + 1; j < n_items_wc_intra_frame_heap; j++ ) + { + index = list_wc_intra_frame_heap[j]; + if ( index == -1 ) + { + continue; + } + ptr = &( allocation_list[index] ); + + if ( ptr->hash == ptr_record->hash && ptr->wc_heap_size_intra_frame == ptr_record->wc_heap_size_intra_frame ) + { + ptr_record->noccurances++; + list_wc_intra_frame_heap[j] = -1; + } + } + } + + /* Print Header */ + sprintf( buf, format_str, "Function Name", "Line", "Type", "Function Parameters", "Maximum Size", "Usage" ); + puts( buf ); + length = strlen( buf ); + sprintf( buf, "%0*d\n", (int) length - 1, 0 ); + subst( buf, '0', '-' ); + puts( buf ); + + for ( i = 0; i < n_items_wc_intra_frame_heap; i++ ) + { + index_record = list_wc_intra_frame_heap[i]; + + if ( index_record != -1 ) + { + /* get the record */ + ptr_record = &( allocation_list[index_record] ); + + /* prepare information strings */ + strncpy( name_str, ptr_record->name, MAX_FUNCTION_NAME_LENGTH ); + strcat( name_str, "()" ); + name_str[MAX_FUNCTION_NAME_LENGTH] = '\0'; + strncpy( parms_str, &( ptr_record->params[2] ), MAX_PARAMS_LENGTH ); + parms_str[MAX_PARAMS_LENGTH] = '\0'; + + if ( ptr_record->params[0] == 'm' ) + { + strcpy( type_str, "malloc" ); + } + else + { + strcpy( type_str, "calloc" ); + } + + sprintf( line_str, "%d", ptr_record->lineno ); + + /* prepare average usage & memory size strings */ + sprintf( usage_str, "%d%%", (int) ( ( (float) ptr_record->total_used_size / ( ptr_record->total_block_size + 1 ) ) * 100.0f ) ); + + if ( ptr_record->noccurances > 1 ) + { + sprintf( size_str, "%dx%d %s", ptr_record->noccurances, (int) ( ( ptr_record->noccurances * ptr_record->wc_heap_size_intra_frame ) >> Stat_Cnt_Size ), Count_Unit[Stat_Cnt_Size] ); + } + else + { + sprintf( size_str, "%d %s", (int) ( ptr_record->wc_heap_size_intra_frame >> Stat_Cnt_Size ), Count_Unit[Stat_Cnt_Size] ); + } + + sprintf( buf, format_str, name_str, line_str, type_str, parms_str, size_str, usage_str ); + puts( buf ); + } + } + + fprintf( stdout, "\n" ); + } + + if ( n_items_wc_inter_frame_heap > 0 ) + { + /* Inter-Frame Heap Size */ + fprintf( stdout, "\nList of memory blocks when maximum inter-frame heap size is reached:\n\n" ); + + /* Find duplicate records (same hash and worst-case heap size) */ + for ( i = 0; i < n_items_wc_inter_frame_heap; i++ ) + { + index_record = list_wc_inter_frame_heap[i]; + if ( index_record == -1 ) + { + continue; + } + ptr_record = &( allocation_list[index_record] ); + ptr_record->noccurances = 1; /* reset the counter because som blocks may be both, intra-frame and inter-frame */ + for ( j = i + 1; j < n_items_wc_inter_frame_heap; j++ ) + { + index = list_wc_inter_frame_heap[j]; + if ( index == -1 ) + { + continue; + } + ptr = &( allocation_list[index] ); + + if ( ptr->hash == ptr_record->hash && ptr->wc_heap_size_inter_frame == ptr_record->wc_heap_size_inter_frame ) + { + ptr_record->noccurances++; + list_wc_inter_frame_heap[j] = -1; + } + } + } + + /* Print Header */ + sprintf( buf, format_str, "Function Name", "Line", "Type", "Function Parameters", "Maximum Size", "Usage" ); + puts( buf ); + length = strlen( buf ); + sprintf( buf, "%0*d\n", (int) length - 1, 0 ); + subst( buf, '0', '-' ); + puts( buf ); + + for ( i = 0; i < n_items_wc_inter_frame_heap; i++ ) + { + index_record = list_wc_inter_frame_heap[i]; + + if ( index_record != -1 ) + { + /* get the record */ + ptr_record = &( allocation_list[index_record] ); + + /* prepare information strings */ + strncpy( name_str, ptr_record->name, MAX_FUNCTION_NAME_LENGTH ); + strcat( name_str, "()" ); + name_str[MAX_FUNCTION_NAME_LENGTH] = '\0'; + strncpy( parms_str, &( ptr_record->params[2] ), MAX_PARAMS_LENGTH ); + parms_str[MAX_PARAMS_LENGTH] = '\0'; + + if ( ptr_record->params[0] == 'm' ) + { + strcpy( type_str, "malloc" ); + } + else + { + strcpy( type_str, "calloc" ); + } + + sprintf( line_str, "%d", ptr_record->lineno ); + + /* prepare average usage & memory size strings */ + sprintf( usage_str, "%d%%", (int) ( ( (float) ptr_record->total_used_size / ( ptr_record->total_block_size + 1 ) ) * 100.0f ) ); + + if ( ptr_record->noccurances > 1 ) + { + sprintf( size_str, "%dx%d %s", ptr_record->noccurances, (int) ( ( ptr_record->noccurances * ptr_record->wc_heap_size_inter_frame ) >> Stat_Cnt_Size ), Count_Unit[Stat_Cnt_Size] ); + } + else + { + sprintf( size_str, "%d %s", (int) ( ptr_record->wc_heap_size_inter_frame >> Stat_Cnt_Size ), Count_Unit[Stat_Cnt_Size] ); + } + + sprintf( buf, format_str, name_str, line_str, type_str, parms_str, size_str, usage_str ); + puts( buf ); + } + } + + fprintf( stdout, "\n" ); + } + + return; +} + +/*-------------------------------------------------------------------* + * export_mem() + * + * Export detailed (per-item) information about heap memory usage to a .csv file + *--------------------------------------------------------------------*/ + +void export_mem( const char *csv_filename ) +{ + int i; + static FILE *fid = NULL; + allocator_record *record_ptr; + + if ( csv_filename == NULL || strcmp( csv_filename, "" ) == 0 ) + { + return; + } + + /* Check, if the .csv file has already been opened */ + if ( fid == NULL ) + { + fid = fopen( csv_filename, "wb" ); + + if ( fid == NULL ) + { + fprintf( stderr, "\nCannot open %s!\n\n", csv_filename ); + exit( -1 ); + } + } + + /* Export individual heap memory records to a .csv file */ + for ( i = 0; i < Num_Records; i++ ) + { + record_ptr = &( allocation_list[i] ); + fprintf( fid, "%s:%d,%d;", record_ptr->name, record_ptr->lineno, record_ptr->block_size ); + } + fprintf( fid, "\n" ); + + return; +} +#endif + +/*-------------------------------------------------------------------* + * print_mem() + * + * Print information about ROM and RAM memory usage + *--------------------------------------------------------------------*/ + +void print_mem( ROM_Size_Lookup_Table Const_Data_PROM_Table[] ) +{ + int i, nElem; + + fprintf( stdout, "\n\n --- Memory usage --- \n\n" ); + + if ( Const_Data_PROM_Table != NULL ) + { + nElem = 0; + while ( strcmp( Const_Data_PROM_Table[nElem].file_spec, "" ) != 0 ) + nElem++; + + for ( i = 0; i < nElem; i++ ) + { + fprintf( stdout, "Program ROM size (%s): %d instruction words\n", Const_Data_PROM_Table[i].file_spec, Const_Data_PROM_Table[i].PROM_size ); + } + + for ( i = 0; i < nElem; i++ ) + { + if ( Const_Data_PROM_Table[i].Get_Const_Data_Size_Func == NULL ) + { + fprintf( stdout, "Error: Cannot retrieve or calculate Table ROM size of (%s)!\n", Const_Data_PROM_Table[i].file_spec ); + } + + fprintf( stdout, "Table ROM (const data) size (%s): %d %s\n", Const_Data_PROM_Table[i].file_spec, Const_Data_PROM_Table[i].Get_Const_Data_Size_Func() >> Stat_Cnt_Size, Count_Unit[Stat_Cnt_Size] ); + } + } + else + { + fprintf( stdout, "Program ROM size: not available\n" ); + fprintf( stdout, "Table ROM (const data) size: not available\n" ); + } + + if ( wc_ram_size > 0 ) + { + fprintf( stdout, "Maximum RAM (stack + heap) size: %d %s in frame %d\n", wc_ram_size >> Stat_Cnt_Size, Count_Unit[Stat_Cnt_Size], wc_ram_frame ); + } + else + { + fprintf( stdout, "Maximum RAM (stack + heap) size: not available\n" ); + } + + /* check, if the stack is empty */ + if ( ptr_current_stack != ptr_base_stack ) + { + fprintf( stderr, "Warning: Stack is not empty.\n" ); + } + + if ( ptr_base_stack - ptr_max_stack > 0 ) + { + fprintf( stdout, "Maximum stack size: %lu %s in frame %d\n", ( ( ptr_base_stack - ptr_max_stack ) * sizeof( int16_t ) ) >> Stat_Cnt_Size, Count_Unit[Stat_Cnt_Size], + wc_stack_frame ); + } + else + { + fprintf( stdout, "Maximum stack size: not available\n" ); + } + + /* last update of intra-frame memory and inter-frame memory, if needed */ + if ( heap_allocation_call_tree_size > 0 ) + { + update_mem(); + } + + /* check, if all memory blocks have been deallocated (freed) */ + for ( i = 0; i < Num_Records; i++ ) + { + if ( allocation_list[i].block_ptr != NULL ) + { + fprintf( stderr, "Fct=%s, Ln=%i: %s!\n", allocation_list[i].name, allocation_list[i].lineno, "Error: Memory Block has not been De-Allocated with free()!" ); + exit( -1 ); + } + } + + if ( n_items_wc_intra_frame_heap > 0 ) + { + fprintf( stdout, "Maximum intra-frame heap size: %d %s in frame %d\n", size_wc_intra_frame_heap >> Stat_Cnt_Size, Count_Unit[Stat_Cnt_Size], location_wc_intra_frame_heap ); + } + else + { + fprintf( stdout, "Maximum intra-frame heap size: 0\n" ); + } + + if ( n_items_wc_inter_frame_heap > 0 ) + { + fprintf( stdout, "Maximum inter-frame heap size: %d %s in frame %d\n", size_wc_inter_frame_heap >> Stat_Cnt_Size, Count_Unit[Stat_Cnt_Size], location_wc_inter_frame_heap ); + } + else + { + fprintf( stdout, "Maximum inter-frame heap size: 0\n" ); + } + +#ifdef MEM_COUNT_DETAILS + /* Print detailed information about worst-case stack usage */ + if ( ptr_base_stack - ptr_max_stack > 0 ) + { + print_stack_call_tree(); + } + + /* Print detailed information about worst-case heap usage */ + mem_count_summary(); +#endif + + if ( Stat_Cnt_Size > 0 ) + { + fprintf( stdout, "\nNote: 1 word = %d bits\n", 8 << Stat_Cnt_Size ); + fprintf( stdout, "This is an optimistic estimate of memory consumption assuming that each variable type is stored with sizeof(type) bits\n" ); + } + + if ( n_items_wc_intra_frame_heap > 0 ) + { + fprintf( stdout, "Intra-frame heap memory is allocated and de-allocated in the same frame\n" ); + } + + /* De-allocate list of heap memory blocks */ + if ( allocation_list != NULL ) + { + free( allocation_list ); + } + + /* De-allocate heap allocation call tree */ + if ( heap_allocation_call_tree != NULL ) + { + free( heap_allocation_call_tree ); + } + + /* De-allocate intra-frame and inter-frame heap lists */ + if ( list_wc_intra_frame_heap != NULL ) + { + free( list_wc_intra_frame_heap ); + } + + if ( list_current_inter_frame_heap != NULL ) + { + free( list_current_inter_frame_heap ); + } + + if ( list_wc_inter_frame_heap != NULL ) + { + free( list_wc_inter_frame_heap ); + } + + return; +} + +#endif /* WMOPS */ + +#ifndef WMOPS +int cntr_push_pop = 0; /* global counter for checking balanced push_wmops()/pop_wmops() pairs when WMOPS is not activated */ +#endif diff --git a/lib_debug/wmops.h b/lib_debug/wmc_auto.h similarity index 62% rename from lib_debug/wmops.h rename to lib_debug/wmc_auto.h index f18c990ed5ba33a0117a4c20c9686476d5e77094..578be9b53239d9e031d424e4e7a8b00b03f69144 100644 --- a/lib_debug/wmops.h +++ b/lib_debug/wmc_auto.h @@ -1,147 +1,43 @@ -/****************************************************************************************************** - - (C) 2022 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository. All Rights Reserved. - - This software is protected by copyright law and by international treaties. - The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository retain full ownership rights in their respective contributions in - the software. This notice grants no license of any kind, including but not limited to patent - license, nor is any license granted by implication, estoppel or otherwise. - - Contributors are required to enter into the IVAS codec Public Collaboration agreement before making - contributions. - - This software is provided "AS IS", without any express or implied warranties. The software is in the - development stage. It is intended exclusively for experts who have experience with such software and - solely for the purpose of inspection. All implied warranties of non-infringement, merchantability - and fitness for a particular purpose are hereby disclaimed and excluded. - - Any dispute, controversy or claim arising under or in relation to providing this software shall be - submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in - accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and - the United Nations Convention on Contracts on the International Sales of Goods. - -*******************************************************************************************************/ +/* + * (C) 2022 copyright VoiceAge Corporation. All Rights Reserved. + * + * This software is protected by copyright law and by international treaties. The source code, and all of its derivations, + * is provided by VoiceAge Corporation under the "ITU-T Software Tools' General Public License". Please, read the license file + * or refer to ITU-T Recommendation G.191 on "SOFTWARE TOOLS FOR SPEECH AND AUDIO CODING STANDARDS". + * + * Any use of this software is permitted provided that this notice is not removed and that neither the authors nor + * VoiceAge Corporation are deemed to have made any representations as to the suitability of this software + * for any purpose nor are held responsible for any defects of this software. THERE IS NO WARRANTY FOR THIS SOFTWARE. + * + * Authors: Guy Richard, Vladimir Malenovsky (Vladimir.Malenovsky@USherbrooke.ca) + */ #ifndef WMOPS_H #define WMOPS_H -#include -#include "options.h" - - -/*------------------------------------------------------------------------------------------* - * Memory calculation tool - *------------------------------------------------------------------------------------------*/ - -#ifdef WMOPS - -#ifdef _MSC_VER -#pragma warning( disable : 4033 ) -#pragma warning( disable : 4702 ) -#pragma warning( disable : 4709 ) +#ifndef EXIT_FAILURE +#include /* stdlib is needed for exit() */ #endif -extern int Const_Data_Size_rom_enc( void ); -extern int Const_Data_Size_rom_com( void ); -extern int Const_Data_Size_rom_dec( void ); -extern int Const_Data_Size_ivas_rom_enc( void ); -extern int Const_Data_Size_ivas_rom_com( void ); -extern int Const_Data_Size_ivas_rom_dec( void ); -extern int Const_Data_Size_ivas_spar_rom_com( void ); -extern int Const_Data_Size_ivas_rom_binauralRen( void ); -extern int Const_Data_Size_ivas_rom_TdBinauralR( void ); -extern int Const_Data_Size_ivas_rom_binaural_cr( void ); - -int push_stack( const char *filename, const char *fctname ); -int pop_stack( const char *filename, const char *fctname ); -void reset_stack( void ); -void print_stack_call_tree( void ); +#ifndef EOF +#include /* stdio is needed for fprintf() */ +#endif -#else - -#define push_stack( file, fct ) -#define pop_stack( file, fct ) -#define reset_stack() -#define print_mem_enc( x ) -#define print_mem_dec( x ) -#define print_stack_call_tree() +/* To Prevent "warning: '$' in identifier or number" message under GCC */ +#ifdef __GNUC__ +#pragma GCC system_header #endif -/******************************************************************************************/ - /* Real-time relationships */ #define FRAMES_PER_SECOND 50.0 #define MILLION_CYCLES 1e6 +#define WMOPS_BOOST_FAC ( 1.0f ) /* scaling factor for equalizing the difference between automatic and manual instrumentation */ +#define FAC ( FRAMES_PER_SECOND / MILLION_CYCLES * WMOPS_BOOST_FAC ) +#define NUM_INST 20 /* Total number of instruction types (in enum below) */ -#define WMC_AUTO_WEIGHTING_FACT 0.91f /* constant to equalize difference between automatic and manual instrumentation */ -#define WMOPS_BOOST_FAC ( 1.0f / WMC_AUTO_WEIGHTING_FACT ) /* complexity scaling factor for manually instrumented code */ - -#define FAC ( FRAMES_PER_SECOND / MILLION_CYCLES * WMOPS_BOOST_FAC ) - -/******************************************************************************************/ - - -#define FLC_MSU( c ) MAC( c ) /* multiply and subtract is currently seen as MAC operation */ -#define FLC_MAX( c ) MISC( c ) /* max() is seen as MISC like abs() */ -#define FLC_MIN( c ) MISC( c ) /* min() is seen as MISC like abs() */ -#define FLC_NEG( c ) ADD( c ) /* negation is seen as addion: a = 0 - a */ -#define FLC_CAST( c ) /* type conversion is costfree for the moment, but who knows it for the future ? */ -#define FLC_INLINE_FUNC( c ) /* inline function calls are costfree, parameters/retval are currently not counted */ - /* example: FLC_INLINE_FUNC(3); SET_FLOAT(ptr,value,num); */ -#define FLC_ATAN2( c ) \ - DIV( c ); \ - TRANS( c ) /* atan2 is curently seen as division followed by atan */ - -/* inline function for memset in combination with float pointer */ -#define SET_FLOAT( ptr, value, num ) \ - { \ - int i; \ - LOOP( 1 ); \ - MOVE( num ); \ - for ( i = 0; i < num; i++ ) \ - { \ - ptr[i] = value; \ - } \ - } - -/* inline function for memset in combination with integer */ -#define SET_INT( ptr, value, num ) \ - { \ - int i; \ - LOOP( 1 ); \ - MOVE( num ); \ - for ( i = 0; i < num; i++ ) \ - { \ - ptr[i] = value; \ - } \ - } #ifdef WMOPS -#ifndef WMOPS_DETAIL -#define STACK_DEPTH_FCT_CALL push_stack( __FILE__, __func__ ) /* Define stack counting function for WMC Tool */ - -#define STACK_DEPTH_FCT_RETURN pop_stack( __FILE__, __func__ ) /* Define stack counting function for WMC Tool */ -#else -#define STACK_DEPTH_FCT_CALL ( push_wmops( __func__ ), push_stack( __FILE__, __func__ ) ) /* Define stack counting function for WMC Tool */ - -#define STACK_DEPTH_FCT_RETURN ( pop_wmops(), pop_stack( __FILE__, __func__ ) ) /* Define stack counting function for WMC Tool */ -#endif - -#define ENABLE_WMOPS 1 /* Only for the WMC_Tool */ -#define ENABLE_TREE 0 /* Call tree may be activated by setting this flag to 1 */ -#define NUM_INST 20 /* Total number of instruction types (in enum below) */ - -#define FLC_OPS_COND if ( ops_cnt_activ > 0 ) - enum instructions { _ADD, @@ -165,31 +61,6 @@ enum instructions _LOG, _MISC }; -enum flc_fields -{ - FLC_NOP = 0, - FLC_ADD, - FLC_MULT, - FLC_MAC, - FLC_MOVE, - FLC_STORE, - FLC_LOGIC, - FLC_SHIFT, - FLC_BRANCH, - FLC_DIV, - FLC_SQRT, - FLC_TRANS, - FLC_FUNC, - FLC_LOOP, - FLC_INDIRECT, - FLC_PTR_INIT, - FLC_MISC, - FLC_TEST, - FLC_POWER, - FLC_LOG, - FLC_OPEND -}; - #define _ADD_C 1 #define _ABS_C 1 @@ -235,7 +106,6 @@ enum flc_fields #define ADD( x ) \ { \ - FLC_OPS_COND \ { \ ops_cnt += ( _ADD_C * ( x ) ); \ inst_cnt[_ADD] += ( x ); \ @@ -251,7 +121,6 @@ enum flc_fields } #define ABS( x ) \ { \ - FLC_OPS_COND \ { \ ops_cnt += ( _ABS_C * ( x ) ); \ inst_cnt[_ABS] += ( x ); \ @@ -267,7 +136,6 @@ enum flc_fields } #define MULT( x ) \ { \ - FLC_OPS_COND \ { \ ops_cnt += ( _MULT_C * ( x ) ); \ inst_cnt[_MULT] += ( x ); \ @@ -283,7 +151,6 @@ enum flc_fields } #define MAC( x ) \ { \ - FLC_OPS_COND \ { \ ops_cnt += ( _MAC_C * ( x ) ); \ inst_cnt[_MAC] += ( x ); \ @@ -299,7 +166,6 @@ enum flc_fields } #define MOVE( x ) \ { \ - FLC_OPS_COND \ { \ ops_cnt += ( _MOVE_C * ( x ) ); \ inst_cnt[_MOVE] += ( x ); \ @@ -315,7 +181,6 @@ enum flc_fields } #define STORE( x ) \ { \ - FLC_OPS_COND \ { \ ops_cnt += ( _STORE_C * ( x ) ); \ inst_cnt[_STORE] += ( x ); \ @@ -331,7 +196,6 @@ enum flc_fields } #define LOGIC( x ) \ { \ - FLC_OPS_COND \ { \ ops_cnt += ( _LOGIC_C * ( x ) ); \ inst_cnt[_LOGIC] += ( x ); \ @@ -347,7 +211,6 @@ enum flc_fields } #define SHIFT( x ) \ { \ - FLC_OPS_COND \ { \ ops_cnt += ( _SHIFT_C * ( x ) ); \ inst_cnt[_SHIFT] += ( x ); \ @@ -363,7 +226,6 @@ enum flc_fields } #define BRANCH( x ) \ { \ - FLC_OPS_COND \ { \ ops_cnt += ( _BRANCH_C * ( x ) ); \ inst_cnt[_BRANCH] += ( x ); \ @@ -379,7 +241,6 @@ enum flc_fields } #define DIV( x ) \ { \ - FLC_OPS_COND \ { \ ops_cnt += ( _DIV_C * ( x ) ); \ inst_cnt[_DIV] += ( x ); \ @@ -395,7 +256,6 @@ enum flc_fields } #define SQRT( x ) \ { \ - FLC_OPS_COND \ { \ ops_cnt += ( _SQRT_C * ( x ) ); \ inst_cnt[_SQRT] += ( x ); \ @@ -411,7 +271,6 @@ enum flc_fields } #define TRANS( x ) \ { \ - FLC_OPS_COND \ { \ ops_cnt += ( _TRANS_C * ( x ) ); \ inst_cnt[_TRANS] += ( x ); \ @@ -427,7 +286,6 @@ enum flc_fields } #define LOOP( x ) \ { \ - FLC_OPS_COND \ { \ ops_cnt += ( _LOOP_C * ( x ) ); \ inst_cnt[_LOOP] += ( x ); \ @@ -443,7 +301,6 @@ enum flc_fields } #define INDIRECT( x ) \ { \ - FLC_OPS_COND \ { \ ops_cnt += ( _INDIRECT_C * ( x ) ); \ inst_cnt[_INDIRECT] += ( x ); \ @@ -459,7 +316,6 @@ enum flc_fields } #define PTR_INIT( x ) \ { \ - FLC_OPS_COND \ { \ ops_cnt += ( _PTR_INIT_C * ( x ) ); \ inst_cnt[_PTR_INIT] += ( x ); \ @@ -475,7 +331,6 @@ enum flc_fields } #define TEST( x ) \ { \ - FLC_OPS_COND \ { \ ops_cnt += ( _TEST_C * ( x ) ); \ inst_cnt[_TEST] += ( x ); \ @@ -491,7 +346,6 @@ enum flc_fields } #define POWER( x ) \ { \ - FLC_OPS_COND \ { \ ops_cnt += ( _POWER_C * ( x ) ); \ inst_cnt[_POWER] += ( x ); \ @@ -507,7 +361,6 @@ enum flc_fields } #define LOG( x ) \ { \ - FLC_OPS_COND \ { \ ops_cnt += ( _LOG_C * ( x ) ); \ inst_cnt[_LOG] += ( x ); \ @@ -523,7 +376,6 @@ enum flc_fields } #define MISC( x ) \ { \ - FLC_OPS_COND \ { \ ops_cnt += ( _MISC_C * ( x ) ); \ inst_cnt[_MISC] += ( x ); \ @@ -540,7 +392,6 @@ enum flc_fields #define FUNC( x ) \ { \ - FLC_OPS_COND \ { \ ops_cnt += ( _FUNC_C + _MOVE_C * ( x ) ); \ inst_cnt[_FUNC]++; \ @@ -558,7 +409,6 @@ enum flc_fields #define DADD( x ) \ { \ - FLC_OPS_COND \ { \ ops_cnt += ( 2 * _ADD_C * ( x ) ); \ inst_cnt[_ADD] += ( x ); \ @@ -574,7 +424,6 @@ enum flc_fields } #define DMULT( x ) \ { \ - FLC_OPS_COND \ { \ ops_cnt += ( 2 * _MULT_C * ( x ) ); \ inst_cnt[_MULT] += ( x ); \ @@ -590,7 +439,6 @@ enum flc_fields } #define DMAC( x ) \ { \ - FLC_OPS_COND \ { \ ops_cnt += ( 2 * _MAC_C * ( x ) ); \ inst_cnt[_MAC] += ( x ); \ @@ -606,7 +454,6 @@ enum flc_fields } #define DMOVE( x ) \ { \ - FLC_OPS_COND \ { \ ops_cnt += ( 2 * _MOVE_C * ( x ) ); \ inst_cnt[_MOVE] += ( x ); \ @@ -622,7 +469,6 @@ enum flc_fields } #define DSTORE( x ) \ { \ - FLC_OPS_COND \ { \ ops_cnt += ( 2 * _STORE_C * ( x ) ); \ inst_cnt[_STORE] += ( x ); \ @@ -638,7 +484,6 @@ enum flc_fields } #define DLOGIC( x ) \ { \ - FLC_OPS_COND \ { \ ops_cnt += ( 2 * _LOGIC_C * ( x ) ); \ inst_cnt[_LOGIC] += ( x ); \ @@ -654,7 +499,6 @@ enum flc_fields } #define DSHIFT( x ) \ { \ - FLC_OPS_COND \ { \ ops_cnt += ( 2 * _SHIFT_C * ( x ) ); \ inst_cnt[_SHIFT] += ( x ); \ @@ -670,7 +514,6 @@ enum flc_fields } #define DDIV( x ) \ { \ - FLC_OPS_COND \ { \ ops_cnt += ( 2 * _DIV_C * ( x ) ); \ inst_cnt[_DIV] += ( x ); \ @@ -686,7 +529,6 @@ enum flc_fields } #define DSQRT( x ) \ { \ - FLC_OPS_COND \ { \ ops_cnt += ( 2 * _SQRT_C * ( x ) ); \ inst_cnt[_SQRT] += ( x ); \ @@ -702,7 +544,6 @@ enum flc_fields } #define DTRANS( x ) \ { \ - FLC_OPS_COND \ { \ ops_cnt += ( 2 * _TRANS_C * ( x ) ); \ inst_cnt[_TRANS] += ( x ); \ @@ -725,19 +566,18 @@ extern int ops_cnt_activ; void reset_wmops( void ); void push_wmops( const char *label ); void pop_wmops( void ); -void wmops_sub_start( const char *label ); -void wmops_sub_end( void ); void update_wmops( void ); +void update_mem( void ); void print_wmops( void ); #else /* WMOPS counting disabled */ #define reset_wmops() -#define push_wmops( x ) -#define pop_wmops() -#define wmops_sub_start( x ) -#define wmops_sub_end() -#define update_wmops() +extern int cntr_push_pop; +#define push_wmops( x ) ( cntr_push_pop++ ) +#define pop_wmops() ( cntr_push_pop-- ) +#define update_wmops() ( assert( cntr_push_pop == 0 ) ) +#define update_mem() #define print_wmops() #define ADD( x ) @@ -774,4 +614,430 @@ void print_wmops( void ); #endif +/* mac & msu (Non Instrumented Versions) */ +#ifndef mac +#define mac( a, b, c ) ( ( a ) + ( b ) * ( c ) ) +#endif +#ifndef mac +#define msu( a, b, c ) ( ( a ) - ( b ) * ( c ) ) +#endif + +#ifndef WMOPS +/* DESACTIVATE the Counting Mechanism */ +#define OP_COUNT_( op, n ) + +/* DESACTIVATE Operation Counter Wrappers */ +#define OP_COUNT_WRAPPER1_( op, val ) ( val ) +#define OP_COUNT_WRAPPER2_( expr ) +#define OP_COUNT_WRAPPER3_( op, expr ) expr + +/* DESACTIVATE Logical & Ternary Operators */ +#define __ +#define _ + +#else + +/* '*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 ) ) + +/******************************************************************/ +/* NOTES: */ +/* The 'wmc_flag_' flag is global to avoid declaration in every */ +/* function and 'static' to avoid clashing with other modules */ +/* that include this header file. */ +/* */ +/* The declarations of 'wmc_flag_' and 'wops_' in this header */ +/* file prevent the addition of a 'C' file to the Project. */ +/******************************************************************/ + +/* General Purpose Global Flag */ +static int wmc_flag_ = 0; + +/* Operation Counter Wrappers */ +#define OP_COUNT_WRAPPER1_( op, val ) ( op, val ) +#define OP_COUNT_WRAPPER2_( expr ) \ + if ( expr, 0 ) \ + ; \ + else +#define OP_COUNT_WRAPPER3_( op, expr ) \ + if ( op, 0 ) \ + ; \ + else \ + expr + +#endif + +/* Define all Macros without '{' & '}' (None of these should be called externally!) */ +#define ABS_( x ) OP_COUNT_( _ABS, ( x ) / WMOPS_BOOST_FAC ) +#define ADD_( x ) OP_COUNT_( _ADD, ( x ) / WMOPS_BOOST_FAC ) +#define MULT_( x ) OP_COUNT_( _MULT, ( x ) / WMOPS_BOOST_FAC ) +#define MAC_( x ) OP_COUNT_( _MAC, ( x ) / WMOPS_BOOST_FAC ) +#define MOVE_( x ) OP_COUNT_( _MOVE, ( x ) / WMOPS_BOOST_FAC ) +#define STORE_( x ) OP_COUNT_( _STORE, ( x ) / WMOPS_BOOST_FAC ) +#define LOGIC_( x ) OP_COUNT_( _LOGIC, ( x ) / WMOPS_BOOST_FAC ) +#define SHIFT_( x ) OP_COUNT_( _SHIFT, ( x ) / WMOPS_BOOST_FAC ) +#define BRANCH_( x ) OP_COUNT_( _BRANCH, ( x ) / WMOPS_BOOST_FAC ) +#define DIV_( x ) OP_COUNT_( _DIV, ( x ) / WMOPS_BOOST_FAC ) +#define SQRT_( x ) OP_COUNT_( _SQRT, ( x ) / WMOPS_BOOST_FAC ) +#define TRANS_( x ) OP_COUNT_( _TRANS, ( x ) / WMOPS_BOOST_FAC ) +#define POWER_( x ) TRANS_( x ) +#define LOG_( x ) TRANS_( x ) +#define LOOP_( x ) OP_COUNT_( _LOOP, ( x ) / WMOPS_BOOST_FAC ) +#define INDIRECT_( x ) OP_COUNT_( _INDIRECT, ( x ) / WMOPS_BOOST_FAC ) +#define PTR_INIT_( x ) OP_COUNT_( _PTR_INIT, ( x ) / WMOPS_BOOST_FAC ) +#define FUNC_( x ) ( OP_COUNT_( _MOVE, ( x ) / WMOPS_BOOST_FAC ), OP_COUNT_( _FUNC, 1 ) ) +#define MISC_( x ) ABS_( x ) + +/* Math Operations */ +#define abs_ OP_COUNT_WRAPPER1_( ABS_( 1 ), abs ) +#define fabs_ OP_COUNT_WRAPPER1_( ABS_( 1 ), fabs ) +#define labs_ OP_COUNT_WRAPPER1_( ABS_( 1 ), labs ) +#define floor_ OP_COUNT_WRAPPER1_( MISC_( 1 ), floor ) +#define sqrt_ OP_COUNT_WRAPPER1_( SQRT_( 1 ), sqrt ) +#define pow_ OP_COUNT_WRAPPER1_( POWER_( 1 ), pow ) +#define exp_ OP_COUNT_WRAPPER1_( POWER_( 1 ), exp ) +#define log_ OP_COUNT_WRAPPER1_( LOG_( 1 ), log ) +#define log10_ OP_COUNT_WRAPPER1_( LOG_( 1 ), log10 ) +#define cos_ OP_COUNT_WRAPPER1_( TRANS_( 1 ), cos ) +#define sin_ OP_COUNT_WRAPPER1_( TRANS_( 1 ), sin ) +#define tan_ OP_COUNT_WRAPPER1_( TRANS_( 1 ), tan ) +#define acos_ OP_COUNT_WRAPPER1_( TRANS_( 1 ), acos ) +#define asin_ OP_COUNT_WRAPPER1_( TRANS_( 1 ), asin ) +#define atan_ OP_COUNT_WRAPPER1_( TRANS_( 1 ), atan ) +#define atan2_ OP_COUNT_WRAPPER1_( TRANS_( 1 ), atan2 ) +#define cosh_ OP_COUNT_WRAPPER1_( TRANS_( 1 ), cosh ) +#define sinh_ OP_COUNT_WRAPPER1_( TRANS_( 1 ), sinh ) +#define tanh_ OP_COUNT_WRAPPER1_( TRANS_( 1 ), tanh ) +#define fmod_ OP_COUNT_WRAPPER1_( DIV_( 1 ), fmod ) +/* these macros use any local macros already defined */ +/* min/max and their Variants */ +#define min_( a, b ) OP_COUNT_WRAPPER1_( MISC_( 1 ), min( ( a ), ( b ) ) ) +#define max_( a, b ) OP_COUNT_WRAPPER1_( MISC_( 1 ), max( ( a ), ( b ) ) ) +#define MIN_( a, b ) OP_COUNT_WRAPPER1_( MISC_( 1 ), MIN( ( a ), ( b ) ) ) +#define MAX_( a, b ) OP_COUNT_WRAPPER1_( MISC_( 1 ), MAX( ( a ), ( b ) ) ) +#define Min_( a, b ) OP_COUNT_WRAPPER1_( MISC_( 1 ), Min( ( a ), ( b ) ) ) +#define Max_( a, b ) OP_COUNT_WRAPPER1_( MISC_( 1 ), Max( ( a ), ( b ) ) ) +/* Square and its Variants */ +#define sqr_( x ) OP_COUNT_WRAPPER1_( MULT_( 1 ), sqr( ( x ) ) ) +#define Sqr_( x ) OP_COUNT_WRAPPER1_( MULT_( 1 ), Sqr( ( x ) ) ) +#define SQR_( x ) OP_COUNT_WRAPPER1_( MULT_( 1 ), SQR( ( x ) ) ) +#define square_( x ) OP_COUNT_WRAPPER1_( MULT_( 1 ), square( ( x ) ) ) +#define Square_( x ) OP_COUNT_WRAPPER1_( MULT_( 1 ), Square( ( x ) ) ) +#define SQUARE_( x ) OP_COUNT_WRAPPER1_( MULT_( 1 ), SQUARE( ( x ) ) ) +/* Sign and its Variants */ +#define sign_( x ) OP_COUNT_WRAPPER1_( MOVE_( 1 ), sign( ( x ) ) ) +#define Sign_( x ) OP_COUNT_WRAPPER1_( MOVE_( 1 ), Sign( ( x ) ) ) +#define SIGN_( x ) OP_COUNT_WRAPPER1_( MOVE_( 1 ), SIGN( ( x ) ) ) +/* Square Root and its Variants */ +#define sqrtf_( x ) OP_COUNT_WRAPPER1_( SQRT_( 1 ), sqrtf( ( x ) ) ) +/* Invert Square Root and its Variants */ +#define inv_sqrt_( x ) OP_COUNT_WRAPPER1_( SQRT_( 1 ), inv_sqrt( ( x ) ) ) +/* Others */ +#define log_base_2_( x ) OP_COUNT_WRAPPER1_( ( LOG_( 1 ), MULT_( 1 ) ), log_base_2( ( x ) ) ) +#define log2_f_( x ) OP_COUNT_WRAPPER1_( ( LOG_( 1 ), MULT_( 1 ) ), log2_f( ( x ) ) ) +/* The 'wmc_flag_=wmc_flag_' is Used to Avoid: "warning: left-hand operand of comma expression has no effect" + with Cygwin gcc Compiler */ +#define _round_( x ) OP_COUNT_WRAPPER1_( wmc_flag_ = wmc_flag_, _round( ( x ) ) ) +#define round_f_( x ) OP_COUNT_WRAPPER1_( wmc_flag_ = wmc_flag_, round_f( ( x ) ) ) +#define _squant_( x ) OP_COUNT_WRAPPER1_( wmc_flag_ = wmc_flag_, _squant( ( x ) ) ) +/* Set Min/Max */ +#define set_min_( a, b ) OP_COUNT_WRAPPER3_( ( ADD_( 1 ), BRANCH_( 1 ), MOVE_( 1 ) ), set_min( ( a ), ( b ) ) ) +#define set_max_( a, b ) OP_COUNT_WRAPPER3_( ( ADD_( 1 ), BRANCH_( 1 ), MOVE_( 1 ) ), set_max( ( a ), ( b ) ) ) +/* mac & msu (Instrumented Versions) */ +#define mac_( a, b, c ) OP_COUNT_WRAPPER1_( MAC_( 1 ), mac( a, b, c ) ) +#define msu_( a, b, c ) OP_COUNT_WRAPPER1_( MAC_( 1 ), msu( a, b, c ) ) + +/* Functions */ +#define func_( name, x ) OP_COUNT_WRAPPER1_( FUNC_( x ), name ) + +/* Logical Operators */ +#ifndef __ +#define __ ( BRANCH_( 1 ), 1 ) && +#endif + +/* Ternary Operators (? and :) */ +#ifndef _ +#define _ ( BRANCH_( 1 ), 0 ) ? 0: +#endif + +/* Flow Control keywords */ +#define if_ \ + OP_COUNT_WRAPPER2_( BRANCH_( 1 ) ) \ + if +#define for_ OP_COUNT_WRAPPER2_( LOOP_(1)) for +#define while_( c ) \ + while \ + OP_COUNT_WRAPPER1_( BRANCH_( 1 ), ( c ) ) /* needs extra "()" if ',' encountered */ +#define do_ \ + do \ + { +#define _while \ + BRANCH_( 1 ); \ + } \ + while + +#define goto_ \ + OP_COUNT_WRAPPER2_( BRANCH_( 1 ) ) \ + goto +#define break_ \ + OP_COUNT_WRAPPER2_( BRANCH_( 1 ) ) \ + break +#define continue_ \ + OP_COUNT_WRAPPER2_( BRANCH_( 1 ) ) \ + continue +#define return_ \ + OP_COUNT_WRAPPER2_( ( wmc_flag_ = stack_tree_level_, STACK_DEPTH_FCT_RETURN ) ) \ + return + +#define switch_ \ + OP_COUNT_WRAPPER2_( ( BRANCH_( 1 ), wmc_flag_ = 1 ) ) \ + switch +#define cost_( n ) OP_COUNT_WRAPPER2_( wmc_flag_ ? ( ADD_( n ), BRANCH_( n ), wmc_flag_ = 0 ) : 0 ); + +#ifdef WMOPS + +#define ACC 2 +#define MUL 1 + +/* Counting Function (should not be called externally!) */ +static void wops_( const char *ops ) +{ + char lm = 0; /* lm: Last Operation is Math */ + static char lo = 0; /* Last Operation */ + + void ( *fct )( const char *ops ) = wops_; + +st: + while ( *ops != '\0' ) + { + switch ( *ops++ ) + { + int cnt; + case '-': + for ( cnt = 0; ops[cnt] == '>'; cnt++ ) + ; + if ( cnt & 1 ) + goto ind; + case '+': + lm = 2; + if ( lo & MUL ) + { + MULT_( -1 ); + MAC_( 1 ); + break; + } + lo = ACC << 2; + case 'U': + case 'D': + ADD_( 1 ); + break; + case '*': + lm = 2; + if ( lo & ACC ) + { + ADD_( -1 ); + MAC_( 1 ); + break; + } + lo = MUL << 2; + MULT_( 1 ); + break; + case '/': + case '%': + lm = 2; + DIV_( 1 ); + break; + case '&': + case '|': + case '^': + lm = 2; + case '~': + LOGIC_( 1 ); + break; + case '<': + case '>': + if ( *ops != ops[-1] ) + goto error; + ops++; + case -85: + case -69: + lm = 2; + SHIFT_( 1 ); + break; + case 'L': + case 'G': + if ( *ops == 't' ) + goto comp; + case 'E': + case 'N': + if ( *ops != 'e' ) + goto error; + comp: + ops++; + ADD_( 1 ); + break; + case '!': + MISC_( 2 ); + break; + case 'M': + MOVE_( 1 ); + break; + case 'S': + STORE_( 1 ); + break; + case 'P': + PTR_INIT_( 1 ); + break; + case '[': + case ']': + goto st; + ind: + ops++; + case 'I': + case '.': + INDIRECT_( 1 ); + break; + case '=': + if ( lm ) + goto st; + case '\0': + /* This Shouldn't Happen */ + /* These are Used to Avoid: "warning: 'name' defined but not used" with Cygwin gcc Compiler */ + wmc_flag_ = wmc_flag_; + ops_cnt_ptr = ops_cnt_ptr; + fct( "" ); + error: + default: + fprintf( stderr, "\r wops: Invalid Counting Operation '%s'\n", ops - 1 ); + exit( -1 ); + } + lm >>= 1; + lo >>= 2; + } + + return; +} + +#endif + +/* All Other Operations */ +#define $( str ) OP_COUNT_WRAPPER2_( wops_( str ) ) + + +/*-------------------------------------------------------------------* + * Memory counting tool + *-------------------------------------------------------------------*/ + +/* Enhanced Const Data Size Counting (Rounding Up to the Nearest 'Integer' Size) */ +#define rsize( item ) ( ( sizeof( item ) + sizeof( int ) - 1 ) / sizeof( int ) * sizeof( int ) ) + +#ifdef _MSC_VER +/* Disable "warning C4210: nonstandard extension used : function given file scope" with Visual Studio Compiler */ +#pragma warning( disable : 4210 ) #endif + +/* Const Data Size and PROM Size Wrapper Functions */ +#define Const_Data_Size_Func( file ) Const_Data_Size_##file( void ) +#define Get_Const_Data_Size( file, val_ptr ) \ + { \ + extern int Const_Data_Size_##file( void ); \ + *( val_ptr ) = Const_Data_Size_##file(); \ + } +#define PROM_Size_Func( file ) PROM_Size_##file( void ) +#define Get_PROM_Size( file, val_ptr ) \ + { \ + int PROM_Size_##file( void ); \ + *( val_ptr ) = PROM_Size_##file(); \ + } + +/* ROM Size Lookup Table - contains information about PROM size and Const Data Size in all source files */ +/* The print_mem() function looks for this table to print the results of Const Data usage and PROM usage */ +typedef struct ROM_Size_Lookup_Table +{ + const char file_spec[255]; + int PROM_size; + int ( *Get_Const_Data_Size_Func )( void ); +} ROM_Size_Lookup_Table; + +/* The WMC tool inserts the following declaration during the innstrumentation process in the .c file where the function print_mem() is located */ +/* and modifies it to print_mem(Const_Data_PROM_Table) */ + +/* #ifdef WMOPS + * ROM_Size_Lookup_Table Const_Data_PROM_Table[] = + * { + * {"../lib_enc/rom_enc.c", 0, NULL}, + * {"../lib_com/*.c", 0, NULL}, + * {"", -1, NULL} + * }; + * #endif + */ + +/*#define MEM_ALIGN_64BITS */ /* Define this when using 64 Bits values in the code (ex: double), otherwise it will align on 32 Bits */ +/*#define MEM_COUNT_DETAILS*/ + +typedef enum +{ + USE_BYTES = 0, + USE_16BITS = 1, + USE_32BITS = 2 +} Counting_Size; + +#if ( defined( _WIN32 ) && ( _MSC_VER <= 1800 ) && ( _MSC_VER >= 1300 ) ) +#define __func__ __FUNCTION__ +#elif defined( __STDC_VERSION__ ) && __STDC_VERSION__ < 199901L +#if ( __GNUC__ >= 2 ) +#define __func__ __FUNCTION__ +#else +#define __func__ "" +#endif +#elif defined( __GNUC__ ) +#define __func__ __extension__ __FUNCTION__ +#endif + + +#ifdef WMOPS + +void *mem_alloc( const char *func_name, int func_lineno, size_t size, char *alloc_str ); +void mem_free( const char *func_name, int func_lineno, void *ptr ); + +#define malloc_( size ) mem_alloc( __func__, __LINE__, size, "m:" #size ) +#define calloc_( n, size ) mem_alloc( __func__, __LINE__, ( n ) * ( size ), "c:" #n ", " #size ) +#define free_( ptr ) mem_free( __func__, __LINE__, ptr ) + +void reset_mem( Counting_Size cnt_size ); +void print_mem( ROM_Size_Lookup_Table Const_Data_PROM_Table[] ); +#ifdef MEM_COUNT_DETAILS +void export_mem( const char *csv_filename ); +#endif + +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__ ), 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 */ +#else +#define STACK_DEPTH_FCT_CALL push_stack( __FILE__, __FUNCTION__ ) +#define STACK_DEPTH_FCT_RETURN pop_stack( __FILE__, __FUNCTION__ ) +#endif + +void reset_stack( void ); +#define func_start_ int stack_tree_level_ = STACK_DEPTH_FCT_CALL; + +#else +#define malloc_( n1 ) malloc( n1 ) +#define calloc_( n1, n2 ) calloc( n1, n2 ) +#define free_( ptr ) free( ptr ) +#define reset_mem( cnt_size ) +#define print_mem( Const_Data_PROM_Table ) +#define export_mem( csv_filename ) + +#define push_stack( file, fct ) +#define pop_stack( file, fct ) +#define reset_stack() +#define func_start_ + +#endif + +#endif /* WMOPS_H */ diff --git a/lib_debug/wmops.c b/lib_debug/wmops.c deleted file mode 100644 index fe75a207ff0d24b73f6a56899f227a88a05900ce..0000000000000000000000000000000000000000 --- a/lib_debug/wmops.c +++ /dev/null @@ -1,503 +0,0 @@ -/****************************************************************************************************** - - (C) 2022 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository. All Rights Reserved. - - This software is protected by copyright law and by international treaties. - The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository retain full ownership rights in their respective contributions in - the software. This notice grants no license of any kind, including but not limited to patent - license, nor is any license granted by implication, estoppel or otherwise. - - Contributors are required to enter into the IVAS codec Public Collaboration agreement before making - contributions. - - This software is provided "AS IS", without any express or implied warranties. The software is in the - development stage. It is intended exclusively for experts who have experience with such software and - solely for the purpose of inspection. All implied warranties of non-infringement, merchantability - and fitness for a particular purpose are hereby disclaimed and excluded. - - Any dispute, controversy or claim arising under or in relation to providing this software shall be - submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in - accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and - the United Nations Convention on Contracts on the International Sales of Goods. - -*******************************************************************************************************/ - -#include -#include -#include -#include -#include "options.h" -#ifdef DEBUGGING -#include "debug.h" -#endif -#include "wmops.h" - - -/*-------------------------------------------------------------------* - * WMOPS counting tool - *--------------------------------------------------------------------*/ - -#ifdef WMOPS - -#define MAX_RECORDS 1024 -#define MAX_CHAR 64 -#define MAX_STACK 64 -#define DOUBLE_MAX 0x80000000; - -struct wmops_record -{ - char label[MAX_CHAR]; - int32_t call_number; - int32_t 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; -#ifdef WMOPS_WC_FRAME_ANALYSIS - int32_t current_call_number; - double wc_cnt; - double wc_selfcnt; - int32_t wc_call_number; -#endif -}; - -double ops_cnt; -double prom_cnt; -double inst_cnt[NUM_INST]; - -int ops_cnt_activ = 1; - -static struct wmops_record wmops[MAX_RECORDS]; -static int stack[MAX_STACK]; -static int sptr; -static int num_records; -static int current_record; -static int32_t update_cnt; -static double start_cnt; -static double max_cnt; -static double min_cnt; -static double inst_cnt_wc[NUM_INST]; -static int32_t fnum_cnt_wc; - - -void reset_wmops( void ) -{ - int i, j; - - for ( i = 0; i < MAX_RECORDS; i++ ) - { - strcpy( &wmops[i].label[0], "\0" ); - wmops[i].call_number = 0; - wmops[i].update_cnt = 0; - for ( j = 0; j < MAX_RECORDS; 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; -#endif - } - - for ( i = 0; i < MAX_STACK; i++ ) - { - stack[i] = -1; - } - sptr = 0; - num_records = 0; - current_record = -1; - update_cnt = 0; - - max_cnt = 0.0; - min_cnt = DOUBLE_MAX; - start_cnt = 0.0; - ops_cnt = 0.0; -} - - -void push_wmops( const char *label ) -{ - int new_flag; - int i, j; - - /* Check if new function record label */ - new_flag = 1; - for ( i = 0; i < num_records; i++ ) - { - if ( strcmp( wmops[i].label, label ) == 0 ) - { - new_flag = 0; - break; - } - } - - /* Configure new record */ - if ( new_flag ) - { - if ( num_records >= MAX_RECORDS ) - { - fprintf( stdout, "push_wmops(): exceeded MAX_RECORDS count.\n\n" ); - exit( -1 ); - } - strcpy( wmops[i].label, label ); - num_records++; - } - - /* Push current context onto stack */ - if ( current_record >= 0 ) - { - if ( sptr >= MAX_STACK ) - { - fprintf( stdout, "\r push_wmops(): stack exceeded, try inreasing MAX_STACK\n" ); - exit( -1 ); - } - stack[sptr++] = current_record; - - /* accumulate op counts */ - wmops[current_record].current_selfcnt += ops_cnt - wmops[current_record].start_selfcnt; - - /* update call tree */ - for ( j = 0; j < MAX_RECORDS; j++ ) - { - if ( wmops[i].call_tree[j] == current_record ) - { - break; - } - else if ( wmops[i].call_tree[j] == -1 ) - { - wmops[i].call_tree[j] = current_record; - break; - } - } - } - - /* init current record */ - current_record = i; - wmops[current_record].start_selfcnt = ops_cnt; - wmops[current_record].start_cnt = ops_cnt; - wmops[current_record].call_number++; -#ifdef WMOPS_WC_FRAME_ANALYSIS - wmops[current_record].current_call_number++; -#endif -} - -void wmops_sub_start( const char *label ) -{ -#ifndef WMOPS_DETAIL - push_wmops( label ); -#endif -} - -void pop_wmops( void ) -{ - - /* Check for underflow */ - if ( current_record < 0 ) - { - fprintf( stdout, "\r pop_wmops(): stack underflow, too many calls to pop_wmops()\n" ); - exit( -1 ); - } - - /* update count of current record */ - 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 ( sptr > 0 ) - { - current_record = stack[--sptr]; - wmops[current_record].start_selfcnt = ops_cnt; - } - else - { - current_record = -1; - } -} - -void wmops_sub_end( void ) -{ -#ifndef WMOPS_DETAIL - pop_wmops(); -#endif -} - -void update_wmops( void ) -{ - int i; - double current_cnt; - - if ( sptr != 0 ) - { - fprintf( stdout, "update_wmops(): Stack must be empty!\n" ); - exit( -1 ); - } - -#ifdef WMOPS_PER_FRAME /* output complexity in WMOPS per frame - note that "frame" number was already incremented before calling this function */ - { - float tmpF = (float) ( FAC * wmops[0].current_cnt ); - dbgwrite( &tmpF, 4, 1, 1, "res/wmops" ); - } -#endif - -#ifdef WMOPS_WC_FRAME_ANALYSIS - if ( ops_cnt - start_cnt > max_cnt ) - { - for ( i = 0; i < num_records; i++ ) - { - wmops[i].wc_cnt = wmops[i].current_cnt; - wmops[i].wc_selfcnt = wmops[i].current_selfcnt; - wmops[i].wc_call_number = wmops[i].current_call_number; - } - } -#endif - - for ( i = 0; i < num_records; i++ ) - { - wmops[i].tot_selfcnt += wmops[i].current_selfcnt; - wmops[i].tot_cnt += wmops[i].current_cnt; - - if ( wmops[i].current_selfcnt > 0 ) - { - if ( wmops[i].current_selfcnt > wmops[i].max_selfcnt ) - { - wmops[i].max_selfcnt = wmops[i].current_selfcnt; - } - - if ( wmops[i].current_selfcnt < wmops[i].min_selfcnt ) - { - wmops[i].min_selfcnt = wmops[i].current_selfcnt; - } - } - - wmops[i].current_selfcnt = 0; - - if ( wmops[i].current_cnt > 0 ) - { - if ( wmops[i].current_cnt > wmops[i].max_cnt ) - { - wmops[i].max_cnt = wmops[i].current_cnt; - } - - if ( wmops[i].current_cnt < wmops[i].min_cnt ) - { - wmops[i].min_cnt = wmops[i].current_cnt; - } - - wmops[i].update_cnt++; - } - - wmops[i].current_cnt = 0; -#ifdef WMOPS_WC_FRAME_ANALYSIS - wmops[i].current_call_number = 0; -#endif - } - - current_cnt = ops_cnt - start_cnt; - if ( current_cnt > max_cnt ) - { - max_cnt = current_cnt; - - for ( i = 0; i < NUM_INST; i++ ) - { - inst_cnt_wc[i] = inst_cnt[i]; - } - - fnum_cnt_wc = update_cnt; - } - - if ( current_cnt < min_cnt ) - { - min_cnt = current_cnt; - } - - for ( i = 0; i < NUM_INST; i++ ) - { - inst_cnt[i] = 0.0; - } - - - start_cnt = ops_cnt; - update_cnt++; -} - - -void print_wmops( void ) -{ - int i, label_len, max_label_len; - - char *sfmts = "%*s %8s %8s %7s %7s\n"; - char *dfmts = "%*s %8.2f %8.3f %7.3f %7.3f\n"; - char *sfmt = "%*s %8s %8s %7s %7s %7s %7s %7s\n"; - char *dfmt = "%*s %8.2f %8.3f %7.3f %7.3f %7.3f %7.3f %7.3f\n"; - -#if ENABLE_TREE - int j; - char *sfmtt = "%20s %4s %15s\n"; - char *dfmtt = "%20s %4d "; -#endif - - /* fprintf( stdout, "\nProgram Memory Analysis: %12.0f words\n", prom_cnt ); */ - /* fprintf (stdout, "\nInstruction Type Analysis (for worst case frame):\n\n"); */ - fprintf( stdout, "\nInstruction Type Analysis (for worst case frame number %d):\n\n", fnum_cnt_wc ); /* added -- JPA */ - for ( i = 0; i < NUM_INST; i++ ) - { - switch ( (enum instructions) i ) - { - case _ADD: - fprintf( stdout, "\tAdds: %12.1f\n", inst_cnt_wc[i] ); - break; - case _ABS: - fprintf( stdout, "\tAbsolutes: %12.1f\n", inst_cnt_wc[i] ); - break; - case _MULT: - fprintf( stdout, "\tMultiplies: %12.1f\n", inst_cnt_wc[i] ); - break; - case _MAC: - fprintf( stdout, "\tMACs: %12.1f\n", inst_cnt_wc[i] ); - break; - case _MOVE: - fprintf( stdout, "\tMoves: %12.1f\n", inst_cnt_wc[i] ); - break; - case _STORE: - fprintf( stdout, "\tStores: %12.1f\n", inst_cnt_wc[i] ); - break; - case _LOGIC: - fprintf( stdout, "\tLogicals: %12.1f\n", inst_cnt_wc[i] ); - break; - case _SHIFT: - fprintf( stdout, "\tShifts: %12.1f\n", inst_cnt_wc[i] ); - break; - case _BRANCH: - fprintf( stdout, "\tBranches: %12.1f\n", inst_cnt_wc[i] ); - break; - case _DIV: - fprintf( stdout, "\tDivisions: %12.1f\n", inst_cnt_wc[i] ); - break; - case _SQRT: - fprintf( stdout, "\tSquare Root: %12.1f\n", inst_cnt_wc[i] ); - break; - case _TRANS: - fprintf( stdout, "\tTrans: %12.1f\n", inst_cnt_wc[i] ); - break; - case _FUNC: - fprintf( stdout, "\tFunc Call: %12.1f\n", inst_cnt_wc[i] ); - break; - case _LOOP: - fprintf( stdout, "\tLoop Init: %12.1f\n", inst_cnt_wc[i] ); - break; - case _INDIRECT: - fprintf( stdout, "\tIndirect Addr: %12.1f\n", inst_cnt_wc[i] ); - break; - case _PTR_INIT: - fprintf( stdout, "\tPointer Init: %12.1f\n", inst_cnt_wc[i] ); - break; - case _TEST: - fprintf( stdout, "\tExtra condit.: %12.1f\n", inst_cnt_wc[i] ); - break; - case _POWER: - fprintf( stdout, "\tExponential: %12.1f\n", inst_cnt_wc[i] ); - break; - case _LOG: - fprintf( stdout, "\tLogarithm: %12.1f\n", inst_cnt_wc[i] ); - break; - case _MISC: - fprintf( stdout, "\tAll other op.: %12.1f\n", inst_cnt_wc[i] ); - break; - default: - fprintf( stdout, "\tERROR: Invalid instruction type: %d\n\n", i ); - } - } - - max_label_len = 0; - for ( i = 0; i < num_records; i++ ) - { - label_len = strlen( wmops[i].label ); - if ( label_len > max_label_len ) - { - max_label_len = label_len; - } - } - max_label_len += 4; - -#ifdef WMOPS_WC_FRAME_ANALYSIS - fprintf( stdout, "\n\nWeighted MOPS Analysis for worst case frame number %d ( WMOPS boost factor %4.2f ):\n", fnum_cnt_wc, WMOPS_BOOST_FAC ); - fprintf( stdout, "%*s %8s %10s %12s\n", max_label_len, " routine", " calls", " SELF", " CUMULATIVE" ); - fprintf( stdout, "%*s %8s %10s %10s\n", max_label_len, "---------------", "------", "------", "----------" ); - - for ( i = 0; i < num_records; i++ ) - { - fprintf( stdout, "%*s %8d %10.3f %12.3f\n", max_label_len, wmops[i].label, wmops[i].wc_call_number, FAC * wmops[i].wc_selfcnt, FAC * wmops[i].wc_cnt ); - } - -#endif - - fprintf( stdout, "\n\nWeighted MOPS Analysis ( WMOPS boost factor %4.2f ):\n", WMOPS_BOOST_FAC ); - fprintf( stdout, "%*s %34s %23s\n", max_label_len, "", "|------ SELF ------|", "|--- CUMULATIVE ---|" ); - fprintf( stdout, sfmt, max_label_len, " routine", " calls", " min ", " max ", " avg ", " min ", " max ", " avg " ); - fprintf( stdout, sfmt, max_label_len, "---------------", "------", "------", "------", "------", "------", "------", "------" ); - for ( i = 0; i < num_records; i++ ) - { - fprintf( stdout, dfmt, max_label_len, wmops[i].label, - update_cnt == 0 ? 0.0f : (float) wmops[i].call_number / update_cnt, - wmops[i].update_cnt == 0 ? 0.0f : FAC * wmops[i].min_selfcnt, FAC * wmops[i].max_selfcnt, - wmops[i].update_cnt == 0 ? 0.0f : FAC * wmops[i].tot_selfcnt / wmops[i].update_cnt, - wmops[i].update_cnt == 0 ? 0.0f : FAC * wmops[i].min_cnt, FAC * wmops[i].max_cnt, - wmops[i].update_cnt == 0 ? 0.0f : FAC * wmops[i].tot_cnt / wmops[i].update_cnt ); - } - fprintf( stdout, sfmts, max_label_len, "---------------", "------", "------", "------", "------" ); - fprintf( stdout, dfmts, max_label_len, "total", (float) update_cnt, FAC * min_cnt, FAC * max_cnt, FAC * ops_cnt / update_cnt ); - fprintf( stdout, "\n" ); - -#if ENABLE_TREE - - fprintf( stdout, "\nCall Tree:\n\n" ); - fprintf( stdout, sfmtt, " function", "num", "called by: " ); - fprintf( stdout, sfmtt, "---------------", "---", "--------------" ); - - for ( i = 0; i < num_records; i++ ) - { - fprintf( stdout, dfmtt, wmops[i].label, i ); - for ( j = 0; wmops[i].call_tree[j] != -1; j++ ) - { - if ( j != 0 ) - { - fprintf( stdout, ", " ); - } - fprintf( stdout, "%d", wmops[i].call_tree[j] ); - } - fprintf( stdout, "\n" ); - } - - fprintf( stdout, sfmtt, "---------------", "---", "--------------" ); - fprintf( stdout, "\n\n" ); - -#endif -} - -#endif /* WMOPS */ diff --git a/lib_dec/ACcontextMapping_dec.c b/lib_dec/ACcontextMapping_dec.c index 10fb36974167250244b60cb2f307bec755591a98..fa11a6ce1361429ef6a170d998d1484f60d69439 100644 --- a/lib_dec/ACcontextMapping_dec.c +++ b/lib_dec/ACcontextMapping_dec.c @@ -43,7 +43,7 @@ #include "rom_com.h" #include "ivas_rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" #include "ivas_prot.h" /* Range coder header file */ #include diff --git a/lib_dec/FEC.c b/lib_dec/FEC.c index 3267092e7e46cd769a74e26a7f1c2d569e887c47..f623c265c2065d1666e127e4fd78dbf1c8ea3f3b 100644 --- a/lib_dec/FEC.c +++ b/lib_dec/FEC.c @@ -44,7 +44,7 @@ #include "rom_com.h" #include "rom_dec.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local function prototypes @@ -522,7 +522,7 @@ static void gain_dec_bfi( } -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP /*-------------------------------------------------------------------* * pulseRes_preCalc() * @@ -577,4 +577,4 @@ static void pulseRes_preCalc( return; } -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP diff --git a/lib_dec/FEC_HQ_core.c b/lib_dec/FEC_HQ_core.c index 53eca7698212331738deee3dc31d6d0cc9628f68..df35a1a3183e9a76adac892a1658ba2147ebc72c 100644 --- a/lib_dec/FEC_HQ_core.c +++ b/lib_dec/FEC_HQ_core.c @@ -44,7 +44,7 @@ #include "rom_dec.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * Local prototypes diff --git a/lib_dec/FEC_HQ_phase_ecu.c b/lib_dec/FEC_HQ_phase_ecu.c index fd71f5c41bf9e06ab8d8c26898417c88c484b085..54fd6af77dd7fc98f3febcd0d4ef30610ba2076a 100644 --- a/lib_dec/FEC_HQ_phase_ecu.c +++ b/lib_dec/FEC_HQ_phase_ecu.c @@ -44,7 +44,7 @@ #include "rom_com.h" #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * Local constants diff --git a/lib_dec/FEC_adapt_codebook.c b/lib_dec/FEC_adapt_codebook.c index 5ffd9a1fdeba23808f2d4117c2f96bb1916c2745..d80eec01ae21e763805c4c5d5b109f4674abef35 100644 --- a/lib_dec/FEC_adapt_codebook.c +++ b/lib_dec/FEC_adapt_codebook.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "rom_dec.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------- * FEC_synchro_exc() diff --git a/lib_dec/FEC_clas_estim.c b/lib_dec/FEC_clas_estim.c index 7a27532f17abd8981f7d0c170691a33211746ea7..718923a604d334eea27e2a2f0c60d88e48e67e41 100644 --- a/lib_dec/FEC_clas_estim.c +++ b/lib_dec/FEC_clas_estim.c @@ -44,7 +44,7 @@ #include "prot.h" #include "rom_com.h" #include "stat_dec.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local constants diff --git a/lib_dec/FEC_lsf_estim.c b/lib_dec/FEC_lsf_estim.c index f971ec4434de2943cb756fbe8dd9f28c6b8e178d..81fb2821324862fa07f9d6db806e683e52dbb439 100644 --- a/lib_dec/FEC_lsf_estim.c +++ b/lib_dec/FEC_lsf_estim.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * FEC_lsf_estim() diff --git a/lib_dec/FEC_pitch_estim.c b/lib_dec/FEC_pitch_estim.c index e2f6491cc30072ce48e16ae042b80fe0b4a2d68e..d0bfc99114001e49b46907f29c1c784abe113e59 100644 --- a/lib_dec/FEC_pitch_estim.c +++ b/lib_dec/FEC_pitch_estim.c @@ -42,7 +42,7 @@ #endif #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------* * FEC_pitch_estim() diff --git a/lib_dec/FEC_scale_syn.c b/lib_dec/FEC_scale_syn.c index 66fae0fc053108265fe3efad80bcc738515eb752..e13e3dce57ce709e66e69a4d7f1cbaefb4e467d1 100644 --- a/lib_dec/FEC_scale_syn.c +++ b/lib_dec/FEC_scale_syn.c @@ -42,7 +42,7 @@ #include #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" #define SCLSYN_LAMBDA 0.3f diff --git a/lib_dec/LD_music_post_filter.c b/lib_dec/LD_music_post_filter.c index f19e7375952d6c150fd1e5e3d5c27751716fd188..56454f78ff43728afa0a99016c70d21c80b91047 100644 --- a/lib_dec/LD_music_post_filter.c +++ b/lib_dec/LD_music_post_filter.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local constants diff --git a/lib_dec/TonalComponentDetection.c b/lib_dec/TonalComponentDetection.c index 230dfe408625b32ebc099a1bb82576dce3f7c122..69840ccfd4924be5beb8a194f33f5ace4aa10c40 100644 --- a/lib_dec/TonalComponentDetection.c +++ b/lib_dec/TonalComponentDetection.c @@ -46,7 +46,7 @@ #include "prot.h" #include "cnst.h" #include "stat_com.h" -#include "wmops.h" +#include "wmc_auto.h" #include "ivas_prot.h" diff --git a/lib_dec/acelp_core_dec.c b/lib_dec/acelp_core_dec.c index 4c52cdb811d19797371d861aa1c4e84f64eda123..460a2a089441bc74ca37d29ae9f2b150a4834c15 100644 --- a/lib_dec/acelp_core_dec.c +++ b/lib_dec/acelp_core_dec.c @@ -48,7 +48,7 @@ #ifdef LSF_RE_USE_SECONDARY_CHANNEL #include "ivas_rom_com.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * acelp_core_dec() @@ -131,7 +131,7 @@ ivas_error acelp_core_dec( return error; } - wmops_sub_start( "acelp_core_dec" ); + push_wmops( "acelp_core_dec" ); output_frame = (int16_t) ( st->output_Fs / FRAMES_PER_SEC ); @@ -179,7 +179,7 @@ ivas_error acelp_core_dec( set_f( synth, 0, output_frame ); /* They are however read in a few places which causes errors in the valgrind tests. Simplest solution from a code perspective was to set them to zero. */ /* CN generation done in DFT domain */ - wmops_sub_end(); + pop_wmops(); return error; } @@ -1432,6 +1432,6 @@ ivas_error acelp_core_dec( st->hTdCngDec->ho_16k_lsp[st->hTdCngDec->ho_circ_ptr] = ( st->L_frame == L_FRAME ? 0 : 1 ); } - wmops_sub_end(); + pop_wmops(); return error; } diff --git a/lib_dec/acelp_core_switch_dec.c b/lib_dec/acelp_core_switch_dec.c index be34a95e319ddfb93953c9700ce72c5791378231..6a58533ef2e4e288d58febd8b52c78c47bc575de 100644 --- a/lib_dec/acelp_core_switch_dec.c +++ b/lib_dec/acelp_core_switch_dec.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * Local function prototypes diff --git a/lib_dec/amr_wb_dec.c b/lib_dec/amr_wb_dec.c index 29c4f939ed6adeb641e6b4edcd1223fd956bcd6a..44c1bcd1e1d93de09dcda70334c735294659c506 100644 --- a/lib_dec/amr_wb_dec.c +++ b/lib_dec/amr_wb_dec.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------* * amr_wb_dec() diff --git a/lib_dec/ari_dec.c b/lib_dec/ari_dec.c index fe97e69a523f566978b2783e5f3caa4c0704e3e6..64ffb220c5b4aad0e51109887ec7bb484e2b4eb0 100644 --- a/lib_dec/ari_dec.c +++ b/lib_dec/ari_dec.c @@ -41,7 +41,7 @@ #include "prot.h" #include "stat_com.h" #include "basop_util.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------- diff --git a/lib_dec/ari_hm_dec.c b/lib_dec/ari_hm_dec.c index 78f14e4a282b0b3e67a2c59733ba031dfa3fe6a3..1433af786970b3428806102ba6f0dbe82c0bc5b6 100644 --- a/lib_dec/ari_hm_dec.c +++ b/lib_dec/ari_hm_dec.c @@ -42,7 +42,7 @@ #include "basop_util.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * DecodeIndex() diff --git a/lib_dec/arith_coder_dec.c b/lib_dec/arith_coder_dec.c index 793edcef261e17f57bcea01bfcacc0932c9d1a67..ce02943382b2abd0f6f077ecaccf6b6742588df7 100644 --- a/lib_dec/arith_coder_dec.c +++ b/lib_dec/arith_coder_dec.c @@ -45,7 +45,7 @@ #include "rom_com.h" #include "basop_util.h" #include "basop_proto_func.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------* * tcx_arith_decode() @@ -170,9 +170,9 @@ void tcx_arith_decode_envelope( gamma_w = 1.0f; gamma_uw = 1.0f / st->gamma; -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP tcx_arith_render_envelope( A_ind, L_frame, L_spec, FL2WORD16( hTcxCfg->preemph_fac ), FL2WORD16( gamma_w ), FL2WORD16( 0.5f * gamma_uw ), env ); -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP if ( use_hm ) { diff --git a/lib_dec/avq_dec.c b/lib_dec/avq_dec.c index 99aabbb04c824fe9f1e796b8d6baae1ac6b137f6..d9ab4f0569befcc5b56ee6cf4c011e4f6a70163b 100644 --- a/lib_dec/avq_dec.c +++ b/lib_dec/avq_dec.c @@ -41,7 +41,7 @@ #endif #include "prot.h" #include "cnst.h" -#include "wmops.h" +#include "wmc_auto.h" #include /*-------------------------------------------------------------------* diff --git a/lib_dec/bass_psfilter.c b/lib_dec/bass_psfilter.c index 85c595460c21abd1d82c0bf4c2c6e76d5ad43594..e07aa50a14eae80328c09677603d2117979e3b5f 100644 --- a/lib_dec/bass_psfilter.c +++ b/lib_dec/bass_psfilter.c @@ -46,7 +46,7 @@ #include "debug.h" #endif #include -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * Local constants diff --git a/lib_dec/cng_dec.c b/lib_dec/cng_dec.c index 415ac27b3a492d5686a52336433dadb1c3a93337..6fa2974667f375686d1b3b4fe2ad55f84b7df3bf 100644 --- a/lib_dec/cng_dec.c +++ b/lib_dec/cng_dec.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * Local function prototypes diff --git a/lib_dec/core_dec_init.c b/lib_dec/core_dec_init.c index 90827ca0eee8074fecdc20832be5a9e681e4f780..ae18893d8ee508f72a5ff4250305a6383e2d9684 100644 --- a/lib_dec/core_dec_init.c +++ b/lib_dec/core_dec_init.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------------* * open_decoder_LPD() diff --git a/lib_dec/core_dec_reconf.c b/lib_dec/core_dec_reconf.c index 201ccc0cb3ac5c52573f38669013fdf9117c8b75..3915e748928a36f98f3fb8779ab9ff9194199161 100644 --- a/lib_dec/core_dec_reconf.c +++ b/lib_dec/core_dec_reconf.c @@ -42,7 +42,7 @@ #include "prot.h" #include "rom_com.h" #include "rom_dec.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * reconfig_decoder_LPD() diff --git a/lib_dec/core_dec_switch.c b/lib_dec/core_dec_switch.c index c1f8e590fbde31b39ec3024729aeb425938dd8ee..76d0aedbea2254248ad462dceb20645e7ed49ff0 100644 --- a/lib_dec/core_dec_switch.c +++ b/lib_dec/core_dec_switch.c @@ -42,7 +42,7 @@ #endif #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------* * mode_switch_decoder_LPD() diff --git a/lib_dec/core_switching_dec.c b/lib_dec/core_switching_dec.c index 8762f20ac3a774d07a96353ac59f8d9d36078c67..b53394e3550aef85642c46c9893f03377a4a64ad 100644 --- a/lib_dec/core_switching_dec.c +++ b/lib_dec/core_switching_dec.c @@ -44,7 +44,7 @@ #include "rom_com.h" #include "prot.h" #include "ivas_cnst.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * Local prototypes diff --git a/lib_dec/d_gain2p.c b/lib_dec/d_gain2p.c index 7a0cd8ed4f4106dc34cdb71d564775f687308b63..7011d76d7e00386802a6b26fcd699dab6404ee5e 100644 --- a/lib_dec/d_gain2p.c +++ b/lib_dec/d_gain2p.c @@ -44,7 +44,7 @@ #include "prot.h" #include "cnst.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------* * Mode2_gain_dec_mless diff --git a/lib_dec/dec2t32.c b/lib_dec/dec2t32.c index 67981738fcb240c393388bd201156e471c2b1084..ee2ebf37345af90170285d404383c2bd0d7822a5 100644 --- a/lib_dec/dec2t32.c +++ b/lib_dec/dec2t32.c @@ -41,7 +41,7 @@ #endif #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*----------------------------------------------------------------------------------* * dec_acelp_2t32() diff --git a/lib_dec/dec4t64.c b/lib_dec/dec4t64.c index 3a0a6a7e50f18bd6e376a3ad288c082702db0171..e309d2573c682c12e9984ad3e90df58f7dc03a52 100644 --- a/lib_dec/dec4t64.c +++ b/lib_dec/dec4t64.c @@ -43,7 +43,7 @@ #include "prot.h" #include "ivas_prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local function prototypes diff --git a/lib_dec/dec_LPD.c b/lib_dec/dec_LPD.c index c06bee28f91110d342afc10378e9ab8cc196fb8a..679a87d418420da7ffb0323b136436daff187708 100644 --- a/lib_dec/dec_LPD.c +++ b/lib_dec/dec_LPD.c @@ -46,7 +46,7 @@ #include "cnst.h" #include "basop_proto_func.h" #include "stat_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* diff --git a/lib_dec/dec_ace.c b/lib_dec/dec_ace.c index 24fbf3149fa49492a50507aedb2954edf750cc63..bcb7ed6596e57504c431556778620dc7dd1de75a 100644 --- a/lib_dec/dec_ace.c +++ b/lib_dec/dec_ace.c @@ -42,7 +42,7 @@ #endif #include #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * decoder_acelp() diff --git a/lib_dec/dec_acelp.c b/lib_dec/dec_acelp.c index 7ccdee8888958871d861e2fd7910ff5eca48cb49..445b8549e02cd87d985a3ecb7bb03a4f62edbfe7 100644 --- a/lib_dec/dec_acelp.c +++ b/lib_dec/dec_acelp.c @@ -40,7 +40,7 @@ #include "typedef.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * Local function prototypes diff --git a/lib_dec/dec_acelp_tcx_main.c b/lib_dec/dec_acelp_tcx_main.c index b9d34815793e2fea27a9cf8c074261c6a8285f2d..51ed389e26d6d9c0221086f74a4ea56186eacb21 100644 --- a/lib_dec/dec_acelp_tcx_main.c +++ b/lib_dec/dec_acelp_tcx_main.c @@ -43,7 +43,7 @@ #include "debug.h" #endif #include "stat_dec.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * decode_frame_type() @@ -295,7 +295,7 @@ void dec_acelp_tcx_frame( float old_bwe_exc[( PIT16k_MAX + ( L_FRAME16k + 1 ) + L_SUBFR16k ) * 2]; /* excitation buffer */ float *ptr_bwe_exc; /* pointer to BWE excitation signal in the current frame */ - wmops_sub_start( "dec_acelp_tcx_frame" ); + push_wmops( "dec_acelp_tcx_frame" ); start_bit_pos = st->next_bit_pos; if ( st->rf_flag == 1 ) @@ -479,6 +479,6 @@ void dec_acelp_tcx_frame( st->last_coder_type = INACTIVE; } - wmops_sub_end(); + pop_wmops(); return; } diff --git a/lib_dec/dec_amr_wb.c b/lib_dec/dec_amr_wb.c index 79c9b8d951a19c161d98b342528529ae362ad77f..b03bdc9f0d0a077934b9c9d51541d7423408f27b 100644 --- a/lib_dec/dec_amr_wb.c +++ b/lib_dec/dec_amr_wb.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * decod_amr_wb() diff --git a/lib_dec/dec_gen_voic.c b/lib_dec/dec_gen_voic.c index 0151abcbbadea0969723513e05fbf9dcc7422c01..e4f3ae9b4fe1ebc67bef253a470ea1447090626f 100644 --- a/lib_dec/dec_gen_voic.c +++ b/lib_dec/dec_gen_voic.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * decod_gen_voic() @@ -285,8 +285,8 @@ ivas_error decod_gen_voic( } } - dynamic_free( PREVP ); - dynamic_free( CURRP ); + free( PREVP ); + free( CURRP ); } } diff --git a/lib_dec/dec_higher_acelp.c b/lib_dec/dec_higher_acelp.c index 32b5b705140898daff04d4f7e6da776cc3395f81..03a9ca0044edba969cd222ee0915dea981de9879 100644 --- a/lib_dec/dec_higher_acelp.c +++ b/lib_dec/dec_higher_acelp.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------* * transf_cdbk_dec() diff --git a/lib_dec/dec_nelp.c b/lib_dec/dec_nelp.c index 2cdcd126dbe9f6fce3fca8ba0aa92f3d103a9520..9e0d2171b2c07d75799bac863ffdbe438e995849 100644 --- a/lib_dec/dec_nelp.c +++ b/lib_dec/dec_nelp.c @@ -41,7 +41,7 @@ #endif #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * decod_nelp() diff --git a/lib_dec/dec_pit_exc.c b/lib_dec/dec_pit_exc.c index 547e321aaf3d420ce214927331f45ab82ece3521..bda383a9ee2a167fac27ef698da22d32ae7d4d3a 100644 --- a/lib_dec/dec_pit_exc.c +++ b/lib_dec/dec_pit_exc.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * dec_pit_exc() diff --git a/lib_dec/dec_post.c b/lib_dec/dec_post.c index 9c90fcac62cda90e5df017d9a0d37a25d79489c4..962cf0924710d6368d87f09d93f61d4ccdd1af01 100644 --- a/lib_dec/dec_post.c +++ b/lib_dec/dec_post.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * Local constants diff --git a/lib_dec/dec_ppp.c b/lib_dec/dec_ppp.c index c6a274bef4f94fdb556139863e4dcf9fda554a18..a9d75b7b17af5b08414dd9f12f14eceedc132baf 100644 --- a/lib_dec/dec_ppp.c +++ b/lib_dec/dec_ppp.c @@ -41,7 +41,7 @@ #endif #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------- * decod_ppp() diff --git a/lib_dec/dec_prm.c b/lib_dec/dec_prm.c index 4027b7f95b4b90e703eb4fdb24183d04d6bd3bde..14153810e2f679cd649ced9ef68e10513cc94b6b 100644 --- a/lib_dec/dec_prm.c +++ b/lib_dec/dec_prm.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* diff --git a/lib_dec/dec_tcx.c b/lib_dec/dec_tcx.c index fb6af86815875f7f90323dc3b452e680055d22a2..1f2d5381826e888555ef9eecf39c0a95d2d478b6 100644 --- a/lib_dec/dec_tcx.c +++ b/lib_dec/dec_tcx.c @@ -45,7 +45,7 @@ #include #include "stat_com.h" #include "cnst.h" -#include "wmops.h" +#include "wmc_auto.h" #include "ivas_rom_com.h" #ifdef DEBUG_PLOT #include "deb_out.h" diff --git a/lib_dec/dec_tran.c b/lib_dec/dec_tran.c index 7120211fb61a767b6937e68c833b873f3b7078ee..e124f6d09b265a92b34796163d68544a3e8974e8 100644 --- a/lib_dec/dec_tran.c +++ b/lib_dec/dec_tran.c @@ -41,7 +41,7 @@ #endif #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * decod_tran() diff --git a/lib_dec/dec_uv.c b/lib_dec/dec_uv.c index 28395210910cc7cf83a9494d4c7edf0cac532fce..d94bcb5af722c145a866e44b66bf451733d9dbad 100644 --- a/lib_dec/dec_uv.c +++ b/lib_dec/dec_uv.c @@ -37,7 +37,7 @@ #include #include "options.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * decod_unvoiced() diff --git a/lib_dec/decision_matrix_dec.c b/lib_dec/decision_matrix_dec.c index cb604dc5f7287807f75789dcaa1fc65e7feb8776..4f4e71107966a029448050d7aa836af7c049725f 100644 --- a/lib_dec/decision_matrix_dec.c +++ b/lib_dec/decision_matrix_dec.c @@ -42,7 +42,7 @@ #include "stat_dec.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------* * decision_matrix_dec() diff --git a/lib_dec/dlpc_avq.c b/lib_dec/dlpc_avq.c index 2a89cdb35c2d791b11320db1ee2c73fddbc818f2..f7adce59ea9cc45046482b14f4044cfe7d882c15 100644 --- a/lib_dec/dlpc_avq.c +++ b/lib_dec/dlpc_avq.c @@ -38,7 +38,7 @@ #include "options.h" #include "prot.h" #include "ivas_prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------* * dlpc_avq() diff --git a/lib_dec/dlpc_stoch.c b/lib_dec/dlpc_stoch.c index 21b1ab2d8d60077da5da767c434f7e50c1c6a76e..de47da85c6a35148fa4013f9809797303b52f5a3 100644 --- a/lib_dec/dlpc_stoch.c +++ b/lib_dec/dlpc_stoch.c @@ -43,7 +43,7 @@ #include "prot.h" #include "rom_com.h" #include "basop_proto_func.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------* * lpc_unquantize() diff --git a/lib_dec/er_dec_acelp.c b/lib_dec/er_dec_acelp.c index 4e0d5c9b482257ad4c6681a921320ad3b9301fb6..ba232d0f081571a1924a4f4d9e5ecc5989ea8b58 100644 --- a/lib_dec/er_dec_acelp.c +++ b/lib_dec/er_dec_acelp.c @@ -42,7 +42,7 @@ #endif #include #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * con_acelp() diff --git a/lib_dec/er_dec_tcx.c b/lib_dec/er_dec_tcx.c index 6710e2a6ff9c19774e1485ce7ddd417b5ba3dad7..8a1c61a046dd9e724135ef936a2fa9732e9f7cda 100644 --- a/lib_dec/er_dec_tcx.c +++ b/lib_dec/er_dec_tcx.c @@ -45,7 +45,7 @@ #include #include "prot.h" #include "rom_dec.h" -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------* * con_tcx() diff --git a/lib_dec/er_scale_syn.c b/lib_dec/er_scale_syn.c index 1ae7f57104f8055bee742b70f74caaeb89410a51..c85346b4ed4721a62007ada01ff8cf160ad192e1 100644 --- a/lib_dec/er_scale_syn.c +++ b/lib_dec/er_scale_syn.c @@ -39,7 +39,7 @@ #include #include "prot.h" #include "cnst.h" -#include "wmops.h" +#include "wmc_auto.h" /*----------------------------------------------------------------------------------* diff --git a/lib_dec/er_sync_exc.c b/lib_dec/er_sync_exc.c index 3a66e8312992d048d707246b44133989c7d9726e..618f35ae3b9aaa5ce190e40cedc13da02d543903 100644 --- a/lib_dec/er_sync_exc.c +++ b/lib_dec/er_sync_exc.c @@ -40,7 +40,7 @@ #include #include "prot.h" #include "cnst.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local constants diff --git a/lib_dec/er_util.c b/lib_dec/er_util.c index f907781c2906a66d3d754ea0871e38d76d23601e..2c2f0333e6db03c99a701fcd7b73880d115d8b69 100644 --- a/lib_dec/er_util.c +++ b/lib_dec/er_util.c @@ -43,7 +43,7 @@ #include "prot.h" #include "cnst.h" #include "stat_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* diff --git a/lib_dec/evs_dec.c b/lib_dec/evs_dec.c index 299e6a31ce2ddaacbce758ccae17ec9e0b58e70f..ac0befbb3efbc81869e7086e9a74558669f197cb 100644 --- a/lib_dec/evs_dec.c +++ b/lib_dec/evs_dec.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" #ifdef DEBUG_PLOT #include "deb_out.h" #endif @@ -86,7 +86,7 @@ ivas_error evs_dec( error = IVAS_ERR_OK; - wmops_sub_start( "evs_dec" ); + push_wmops( "evs_dec" ); /*------------------------------------------------------------------* * Initialization *-----------------------------------------------------------------*/ @@ -285,7 +285,7 @@ ivas_error evs_dec( /*---------------------------------------------------------------------* * Pre-processing for bandwidth switching *---------------------------------------------------------------------*/ - wmops_sub_start( "BWE_decoding" ); + push_wmops( "BWE_decoding" ); bw_switching_pre_proc( st, old_syn_12k8_16k, -1, 1 ); @@ -356,7 +356,7 @@ ivas_error evs_dec( swb_CNG_dec( st, synth, hb_synth, sid_bw ); } - wmops_sub_end(); + pop_wmops(); /*----------------------------------------------------------------* * Delay ACELP core synthesis to be synchronized with the components of bandwidth extension layers @@ -975,6 +975,6 @@ ivas_error evs_dec( } #endif - wmops_sub_end(); + pop_wmops(); return error; } diff --git a/lib_dec/fd_cng_dec.c b/lib_dec/fd_cng_dec.c index ce252929578daa1d21724c59636dd80d88bc7e72..a8d542de86b37330a68e1475aab2b21d8c983994 100644 --- a/lib_dec/fd_cng_dec.c +++ b/lib_dec/fd_cng_dec.c @@ -45,7 +45,7 @@ #include "prot.h" #include "ivas_prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" #include "ivas_prot.h" #include "ivas_rom_dec.h" @@ -76,7 +76,7 @@ ivas_error createFdCngDec( *hFdCngDec = NULL; /* Allocate memory */ - hs = (HANDLE_FD_CNG_DEC) count_malloc( sizeof( FD_CNG_DEC ) ); + hs = (HANDLE_FD_CNG_DEC) malloc( sizeof( FD_CNG_DEC ) ); if ( hs == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for FD CNG DEC structure" ); @@ -352,7 +352,7 @@ void deleteFdCngDec( if ( hsDec != NULL ) { deleteFdCngCom( &( hsDec->hFdCngCom ) ); - count_free( hsDec ); + free( hsDec ); *hFdCngDec = NULL; } @@ -385,7 +385,7 @@ void ApplyFdCng( int16_t L_frame, last_L_frame; int32_t sr_core; - wmops_sub_start( "ApplyFdCng" ); + push_wmops( "ApplyFdCng" ); /* limit L_frame and core Fs values for MDCT-Stereo modes which can have higher core sampling than 16kHz, but use a downsampled buffer */ L_frame = min( st->L_frame, L_FRAME16k ); @@ -608,7 +608,7 @@ void ApplyFdCng( break; } - wmops_sub_end(); + pop_wmops(); return; } @@ -1771,7 +1771,7 @@ void generate_masking_noise_dirac( int16_t *seed = &( hFdCngCom->seed ); float scale; - wmops_sub_start( "fd_cng_dirac" ); + push_wmops( "fd_cng_dirac" ); /* Init */ scale = 0.f; @@ -1930,7 +1930,7 @@ void generate_masking_noise_dirac( } } - wmops_sub_end(); + pop_wmops(); return; } diff --git a/lib_dec/gain_dec.c b/lib_dec/gain_dec.c index dd8a58637cee9e121e574d6eacd2b1abadba7c7d..e618fd9d1f9787eb1109c4eb097271058cec9b57 100644 --- a/lib_dec/gain_dec.c +++ b/lib_dec/gain_dec.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * Es_pred_dec() diff --git a/lib_dec/gaus_dec.c b/lib_dec/gaus_dec.c index fed8ab60ac8c4cf6146308f3c8854ce399be7cde..e287eda7e1c348162ecd1b9e49c2cd1a07bb1ea9 100644 --- a/lib_dec/gaus_dec.c +++ b/lib_dec/gaus_dec.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * Local function prototypes diff --git a/lib_dec/gs_dec.c b/lib_dec/gs_dec.c index f1b4e997afeddd653701267d402df2b6c5cfafc1..ed6d673d7c44af5c775556c5a2b68ed5c7c16e4d 100644 --- a/lib_dec/gs_dec.c +++ b/lib_dec/gs_dec.c @@ -44,7 +44,7 @@ #include "rom_com.h" #include "prot.h" #include "ivas_prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * decod_audio() diff --git a/lib_dec/gs_dec_amr_wb.c b/lib_dec/gs_dec_amr_wb.c index 956e065031ebb1fadb0763a50547789292336133..c8207d518e2099d6d5815ca8c9168536b2c0b01e 100644 --- a/lib_dec/gs_dec_amr_wb.c +++ b/lib_dec/gs_dec_amr_wb.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local constants diff --git a/lib_dec/hdecnrm.c b/lib_dec/hdecnrm.c index f1a119a8678040c16e02a1775806fbb99a6b0542..7ae05db5273f479f2c6196f5c0e57d41121ad723 100644 --- a/lib_dec/hdecnrm.c +++ b/lib_dec/hdecnrm.c @@ -43,7 +43,7 @@ #include "prot.h" #include "rom_com.h" #include "rom_dec.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------*/ diff --git a/lib_dec/hf_synth.c b/lib_dec/hf_synth.c index 9c0f2c8463b3299fc3cc7f91d9b97b87cdc67213..17249304873018a7414f8f3c6442c43a8d29f822 100644 --- a/lib_dec/hf_synth.c +++ b/lib_dec/hf_synth.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * Local function prototypes diff --git a/lib_dec/hq_classifier_dec.c b/lib_dec/hq_classifier_dec.c index 38a02300795dbc63606888a770654dace266e17c..94260146861eb2f3053c07e51d1b1b8107658c3c 100644 --- a/lib_dec/hq_classifier_dec.c +++ b/lib_dec/hq_classifier_dec.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------* * hq_classifier_dec() diff --git a/lib_dec/hq_conf_fec.c b/lib_dec/hq_conf_fec.c index 5e0e6426f24d850467bab892482c518360bc1225..e93acf94a58140598b7a04cfcbaae7555fb24b9f 100644 --- a/lib_dec/hq_conf_fec.c +++ b/lib_dec/hq_conf_fec.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------* * hq_configure_bfi() diff --git a/lib_dec/hq_core_dec.c b/lib_dec/hq_core_dec.c index 547354eddc51ca6d09c765befcaf1e158d88e8bb..4920e220ae9e1e22102510c8a456e5cef6f3582b 100644 --- a/lib_dec/hq_core_dec.c +++ b/lib_dec/hq_core_dec.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" #include "ivas_prot.h" @@ -87,7 +87,7 @@ void hq_core_dec( int16_t mdctWindowLength; int16_t mdctWindowLengthFB; - wmops_sub_start( "hq_core_dec" ); + push_wmops( "hq_core_dec" ); /*-------------------------------------------------------------------------- * Initializations *--------------------------------------------------------------------------*/ @@ -495,7 +495,7 @@ void hq_core_dec( mvr2r( output, st->old_exc + L_EXC_MEM_DEC - st->L_frame, st->L_frame ); } - wmops_sub_end(); + pop_wmops(); return; } diff --git a/lib_dec/hq_env_dec.c b/lib_dec/hq_env_dec.c index d4abecfc5d52410a91752a0412aea484500b9cf1..d8f851e71ff066d6ba3cb71560334ae81e8a7a16 100644 --- a/lib_dec/hq_env_dec.c +++ b/lib_dec/hq_env_dec.c @@ -41,7 +41,7 @@ #endif #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------* * decode_envelope_indices() diff --git a/lib_dec/hq_hr_dec.c b/lib_dec/hq_hr_dec.c index 3eb1108b24e1966d17934ffab447ede40e503eab..24a51bd464569a0a3bde22e4e6f76a8533de510c 100644 --- a/lib_dec/hq_hr_dec.c +++ b/lib_dec/hq_hr_dec.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------* * hq_pred_hb_bws() diff --git a/lib_dec/hq_lr_dec.c b/lib_dec/hq_lr_dec.c index 5e7584384d5522496fc508b53f9251cb3a2b0d1f..f0717287b2df32d036ff3c9f970c37db496595a2 100644 --- a/lib_dec/hq_lr_dec.c +++ b/lib_dec/hq_lr_dec.c @@ -46,7 +46,7 @@ #include "prot.h" #include "stl.h" #include "basop_util.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------* * Local function prototypes @@ -252,7 +252,7 @@ void hq_lr_dec( return; } -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP /* Estimate number of bits per sub-band */ Q_band_energy = SWB_BWE_LR_Qbe; FOR( i = 0; i < bands; i++ ) @@ -295,7 +295,7 @@ void hq_lr_dec( Ep_tmp_fx[i] = L_shr( L_tmp, sub( 15, exp2 ) ); /*Q13 */ Ep_tmp[i] = (float) ( Ep_tmp_fx[i] / pow( 2.0, 13 ) ); } -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP if ( *is_transient == 0 && inner_frame == L_FRAME8k && st->core_brate <= ACELP_13k20 ) { @@ -306,7 +306,7 @@ void hq_lr_dec( last_bitalloc_max_band[i] = get_next_indice( st, 1 ); } -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP lowband = 6; move16(); trans_bit = 2; @@ -567,7 +567,7 @@ void hq_lr_dec( #endif /* BASOP_NOGLOB */ } } -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP for ( i = 0; i < bands; i++ ) { @@ -578,7 +578,7 @@ void hq_lr_dec( } else if ( *is_transient == 0 && inner_frame == L_FRAME16k ) { -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP bit_budget = sub( bit_budget, 2 ); /* bits in high bands to indicate the last 2 subbands is allocated bits or not */ /* decode the last p2a_bands-1 subbands bit-allocation index of the previous frame */ for ( i = 0; i < 2; i++ ) @@ -839,7 +839,7 @@ void hq_lr_dec( L_band_energy_tmp[i] = L_shl( L_tmp, 1 ); /*Q_band_energy */ } } -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP for ( i = 0; i < bands; i++ ) { @@ -1216,14 +1216,14 @@ static float band_energy_dequant( deng_bits += BITS_DE_CMODE; } -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP /* Get the reference energy */ exp_normd = norm_l( L_qint ); div_s( &rev_qint_fx, 0x4000, round_fx( L_shl( L_qint, exp_normd ) ) ); /* Q14-(29+exp_normd-16)+15 */ Qrev_qint = sub( 14 - ( 29 - 16 ) + 15, exp_normd ); bq0 = (int16_t) round_fx( L_shl( L_mult( eref_fx, rev_qint_fx ), sub( 5, Qrev_qint ) ) ); /* 16-(10+Qrev_qint+1) */ -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP /* Reconstruct quantized spectrum */ bq1[0] = bq2[0] + bq0; @@ -1234,11 +1234,11 @@ static float band_energy_dequant( for ( k = 0; k < bands; k++ ) { -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP L_band_energy[k] = L_mls( L_qint, bq1[k] ); move32(); /* 29+0-15 -> Qbe(Q14) */ band_energy[k] = (float) ( L_band_energy[k] / pow( 2.0f, SWB_BWE_LR_Qbe ) ); -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP } if ( is_transient ) @@ -1309,7 +1309,7 @@ static void mdct_spectrum_fine_gain_dec( Word16 Qgt; Word16 temp_lo_fx, temp_hi_fx; -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP /* Fine gain quantization on only the most significant energy bands */ /*delta = qint / gqlevs; */ exp_normn = norm_l( L_qint ); @@ -1334,7 +1334,7 @@ static void mdct_spectrum_fine_gain_dec( gain_table_fx[i] = shl( gain_table_fx[i], sub( 14, Qgt ) ); /* Qgt -> Q14 */ gain_table[i] = (float) ( gain_table_fx[i] / pow( 2.0f, 14 ) ); } -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP for ( k = bands - Ngq; k < bands; k++ ) { diff --git a/lib_dec/igf_dec.c b/lib_dec/igf_dec.c index 12c121d503fa1a58c45e11fc8e06bcab29a5a63e..dc7a6420f4663bc7fe9c1fad7372ff15a25b016b 100644 --- a/lib_dec/igf_dec.c +++ b/lib_dec/igf_dec.c @@ -45,7 +45,7 @@ #include "cnst.h" #include "stat_dec.h" #include "ivas_prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* diff --git a/lib_dec/igf_scf_dec.c b/lib_dec/igf_scf_dec.c index 29660271b3f6eda68d8dc0d0487c17716ba3b7e9..176fdec9b7cc4c3ee125dfd2ec06b5ea1d8df20e 100644 --- a/lib_dec/igf_scf_dec.c +++ b/lib_dec/igf_scf_dec.c @@ -41,7 +41,7 @@ #include "debug.h" #endif #include "stat_dec.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* diff --git a/lib_dec/init_dec.c b/lib_dec/init_dec.c index f7968ba5fc5ecd1941f739b033a5ba8c37337a93..10f6be89dac57aea978fd618b208d9c55f2fe1d8 100644 --- a/lib_dec/init_dec.c +++ b/lib_dec/init_dec.c @@ -43,7 +43,7 @@ #include "ivas_cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*----------------------------------------------------------------------* * init_decoder() @@ -193,7 +193,7 @@ ivas_error init_decoder( if ( ( idchan == 0 && st->element_mode != IVAS_CPE_MDCT ) || st->element_mode == IVAS_CPE_TD ) { - if ( ( st->hGSCDec = (GSC_DEC_HANDLE) count_malloc( sizeof( GSC_DEC_DATA ) ) ) == NULL ) + if ( ( st->hGSCDec = (GSC_DEC_HANDLE) malloc( sizeof( GSC_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for GSC\n" ) ); } @@ -211,7 +211,7 @@ ivas_error init_decoder( if ( st->output_Fs == 16000 && st->element_mode == EVS_MONO ) { - if ( ( st->hWIDec = (WI_DEC_HANDLE) count_malloc( sizeof( WI_DEC_DATA ) ) ) == NULL ) + if ( ( st->hWIDec = (WI_DEC_HANDLE) malloc( sizeof( WI_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FEC WI\n" ) ); } @@ -230,7 +230,7 @@ ivas_error init_decoder( if ( ( idchan == 0 && st->element_mode != IVAS_CPE_MDCT ) || st->element_mode == IVAS_CPE_TD ) { - if ( ( st->hPFstat = (PFSTAT_HANDLE) count_malloc( sizeof( PFSTAT ) ) ) == NULL ) + if ( ( st->hPFstat = (PFSTAT_HANDLE) malloc( sizeof( PFSTAT ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for NB/formant postflter\n" ) ); } @@ -250,7 +250,7 @@ ivas_error init_decoder( if ( ( idchan == 0 && st->element_mode != IVAS_CPE_MDCT ) || st->element_mode == IVAS_CPE_TD ) { - if ( ( st->hBWE_zero = (ZERO_BWE_DEC_HANDLE) count_malloc( sizeof( ZERO_BWE_DEC_DATA ) ) ) == NULL ) + if ( ( st->hBWE_zero = (ZERO_BWE_DEC_HANDLE) malloc( sizeof( ZERO_BWE_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for zero BWE\n" ) ); } @@ -269,7 +269,7 @@ ivas_error init_decoder( if ( ( idchan == 0 && st->element_mode != IVAS_CPE_MDCT ) || st->element_mode == IVAS_CPE_TD ) { - if ( ( st->hMusicPF = (MUSIC_POSTFILT_HANDLE) count_malloc( sizeof( MUSIC_POSTFILT_DATA ) ) ) == NULL ) + if ( ( st->hMusicPF = (MUSIC_POSTFILT_HANDLE) malloc( sizeof( MUSIC_POSTFILT_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LD music postflter\n" ) ); } @@ -295,7 +295,7 @@ ivas_error init_decoder( if ( idchan == 0 && ( st->element_mode == EVS_MONO || st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD ) ) { - if ( ( st->hTdCngDec = (TD_CNG_DEC_HANDLE) count_malloc( sizeof( TD_CNG_DEC_DATA ) ) ) == NULL ) + if ( ( st->hTdCngDec = (TD_CNG_DEC_HANDLE) malloc( sizeof( TD_CNG_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DTX/TD CNG\n" ) ); } @@ -324,7 +324,7 @@ ivas_error init_decoder( if ( ( idchan == 0 || st->element_mode == IVAS_CPE_MDCT || st->element_mode == IVAS_SCE || st->element_mode == EVS_MONO ) && st->mct_chan_mode != MCT_CHAN_MODE_LFE ) { - if ( ( st->hHQ_core = (HQ_DEC_HANDLE) count_malloc( sizeof( HQ_DEC_DATA ) ) ) == NULL ) + if ( ( st->hHQ_core = (HQ_DEC_HANDLE) malloc( sizeof( HQ_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HQ core\n" ) ); } @@ -335,7 +335,7 @@ ivas_error init_decoder( if ( st->element_mode == EVS_MONO ) { /* HQ NB FEC initialization */ - if ( ( st->hHQ_nbfec = (HQ_NBFEC_HANDLE) count_malloc( sizeof( HQ_NBFEC_DATA ) ) ) == NULL ) + if ( ( st->hHQ_nbfec = (HQ_NBFEC_HANDLE) malloc( sizeof( HQ_NBFEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HQ NB FEC\n" ) ); } @@ -359,7 +359,7 @@ ivas_error init_decoder( if ( idchan == 0 && st->element_mode != IVAS_CPE_MDCT ) { - if ( ( st->hBWE_TD = (TD_BWE_DEC_HANDLE) count_malloc( sizeof( TD_BWE_DEC_DATA ) ) ) == NULL ) + if ( ( st->hBWE_TD = (TD_BWE_DEC_HANDLE) malloc( sizeof( TD_BWE_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TD BWE\n" ) ); } @@ -380,7 +380,7 @@ ivas_error init_decoder( if ( idchan == 0 && st->element_mode != IVAS_CPE_MDCT ) { - if ( ( st->hBWE_FD = (FD_BWE_DEC_HANDLE) count_malloc( sizeof( FD_BWE_DEC_DATA ) ) ) == NULL ) + if ( ( st->hBWE_FD = (FD_BWE_DEC_HANDLE) malloc( sizeof( FD_BWE_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FD BWE\n" ) ); } @@ -415,7 +415,7 @@ ivas_error init_decoder( if ( st->element_mode == EVS_MONO ) { - if ( ( st->hBWE_FD_HR = (HR_BWE_DEC_HANDLE) count_malloc( sizeof( HR_BWE_DEC_DATA ) ) ) == NULL ) + if ( ( st->hBWE_FD_HR = (HR_BWE_DEC_HANDLE) malloc( sizeof( HR_BWE_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HR BWE\n" ) ); } @@ -433,7 +433,7 @@ ivas_error init_decoder( if ( st->Opt_AMR_WB || st->element_mode == EVS_MONO ) { - if ( ( st->hAmrwb_IO = (AMRWB_IO_DEC_HANDLE) count_malloc( sizeof( AMRWB_IO_DEC_DATA ) ) ) == NULL ) + if ( ( st->hAmrwb_IO = (AMRWB_IO_DEC_HANDLE) malloc( sizeof( AMRWB_IO_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for AMR-WB IO\n" ) ); } @@ -478,7 +478,7 @@ ivas_error init_decoder( if ( ( idchan == 0 && st->element_mode != IVAS_CPE_MDCT ) || st->element_mode == IVAS_CPE_TD ) { - if ( ( st->hBPF = (BPF_DEC_HANDLE) count_malloc( sizeof( BPF_DEC_DATA ) ) ) == NULL ) + if ( ( st->hBPF = (BPF_DEC_HANDLE) malloc( sizeof( BPF_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for BPF\n" ) ); } @@ -553,7 +553,7 @@ ivas_error init_decoder( if ( st->element_mode == EVS_MONO ) { - if ( ( st->hSC_VBR = (SC_VBR_DEC_HANDLE) count_malloc( sizeof( SC_VBR_DEC_DATA ) ) ) == NULL ) + if ( ( st->hSC_VBR = (SC_VBR_DEC_HANDLE) malloc( sizeof( SC_VBR_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SC-VBR\n" ) ); } @@ -583,7 +583,7 @@ ivas_error init_decoder( /* TCX-LTP */ if ( ( idchan == 0 || st->element_mode == IVAS_CPE_MDCT ) && st->mct_chan_mode != MCT_CHAN_MODE_LFE ) { - if ( ( st->hTcxLtpDec = (TCX_LTP_DEC_HANDLE) count_malloc( sizeof( TCX_LTP_DEC_DATA ) ) ) == NULL ) + if ( ( st->hTcxLtpDec = (TCX_LTP_DEC_HANDLE) malloc( sizeof( TCX_LTP_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TCX-LTP handle\n" ) ); } @@ -597,7 +597,7 @@ ivas_error init_decoder( // VE: reduction possible for MCT_CHAN_MODE_LFE channel - see I1-172 if ( idchan == 0 || st->element_mode == IVAS_CPE_MDCT ) { - if ( ( st->hTcxDec = (TCX_DEC_HANDLE) count_malloc( sizeof( TCX_DEC_DATA ) ) ) == NULL ) + if ( ( st->hTcxDec = (TCX_DEC_HANDLE) malloc( sizeof( TCX_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for hTcxDec\n" ) ); } @@ -615,7 +615,7 @@ ivas_error init_decoder( /* TCX config. data structure */ if ( ( idchan == 0 || st->element_mode == IVAS_CPE_MDCT ) && st->mct_chan_mode != MCT_CHAN_MODE_LFE ) { - if ( ( st->hTcxCfg = (TCX_CONFIG_HANDLE) count_malloc( sizeof( TCX_config ) ) ) == NULL ) + if ( ( st->hTcxCfg = (TCX_CONFIG_HANDLE) malloc( sizeof( TCX_config ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for hTcxCfg\n" ) ); } @@ -628,7 +628,7 @@ ivas_error init_decoder( /* Tonal MDCT concealment data structure */ if ( ( idchan == 0 || st->element_mode == IVAS_CPE_MDCT ) && st->mct_chan_mode != MCT_CHAN_MODE_LFE ) { - if ( ( st->hTonalMDCTConc = (TonalMDCTConcealPtr) count_malloc( sizeof( TonalMDCTConceal_INSTANCE ) ) ) == NULL ) + if ( ( st->hTonalMDCTConc = (TonalMDCTConcealPtr) malloc( sizeof( TonalMDCTConceal_INSTANCE ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TonalMDCTConcealment\n" ) ); } @@ -644,7 +644,7 @@ ivas_error init_decoder( if ( ( idchan == 0 || st->element_mode == IVAS_CPE_MDCT ) && st->mct_chan_mode != MCT_CHAN_MODE_LFE ) { - if ( ( st->hIGFDec = (IGF_DEC_INSTANCE_HANDLE) count_malloc( sizeof( IGFDEC_INSTANCE ) ) ) == NULL ) + if ( ( st->hIGFDec = (IGF_DEC_INSTANCE_HANDLE) malloc( sizeof( IGFDEC_INSTANCE ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for IGF\n" ) ); } @@ -663,7 +663,7 @@ ivas_error init_decoder( if ( st->element_mode == EVS_MONO ) { - if ( ( st->hPlcInfo = (T_PLCInfo_HANDLE) count_malloc( sizeof( T_PLCInfo ) ) ) == NULL ) + if ( ( st->hPlcInfo = (T_PLCInfo_HANDLE) malloc( sizeof( T_PLCInfo ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for PLC handle\n" ) ); } @@ -675,7 +675,7 @@ ivas_error init_decoder( if ( st->element_mode == EVS_MONO ) { - if ( ( st->hTECDec = (TEC_DEC_HANDLE) count_malloc( sizeof( TEC_DEC_DATA ) ) ) == NULL ) + if ( ( st->hTECDec = (TEC_DEC_HANDLE) malloc( sizeof( TEC_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TEC\n" ) ); } diff --git a/lib_dec/inov_dec.c b/lib_dec/inov_dec.c index ce3c2728bca15fd4b5e5d7c2b8b386b5f9c7389a..bda5ac47a132762314ff5dd33dfff475f38aa7c9 100644 --- a/lib_dec/inov_dec.c +++ b/lib_dec/inov_dec.c @@ -43,7 +43,7 @@ #include "prot.h" #include "ivas_prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*----------------------------------------------------------------------* * inov_decode() diff --git a/lib_dec/ivas_agc_dec.c b/lib_dec/ivas_agc_dec.c index 827915efc2b9262c3326d094b2ee098937ee967f..cca12877a33db12da0508151e23e74f7830c2d32 100644 --- a/lib_dec/ivas_agc_dec.c +++ b/lib_dec/ivas_agc_dec.c @@ -39,7 +39,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" #ifdef DEBUG_AGC @@ -99,7 +99,7 @@ ivas_error ivas_spar_agc_dec_open( ivas_agc_dec_state_t *hAgc; int16_t output_frame, delay; - if ( ( hAgc = (ivas_agc_dec_state_t *) count_malloc( sizeof( ivas_agc_dec_state_t ) ) ) == NULL ) + if ( ( hAgc = (ivas_agc_dec_state_t *) malloc( sizeof( ivas_agc_dec_state_t ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for AGC decoder" ); } @@ -107,17 +107,17 @@ ivas_error ivas_spar_agc_dec_open( output_frame = (int16_t) ( output_Fs / FRAMES_PER_SEC ); delay = NS2SA( output_Fs, ( IVAS_ENC_DELAY_NS + IVAS_DEC_DELAY_NS ) ); - if ( ( hAgc->agc_com.winFunc = (float *) count_malloc( sizeof( float ) * ( output_frame - delay ) ) ) == NULL ) + if ( ( hAgc->agc_com.winFunc = (float *) malloc( sizeof( float ) * ( output_frame - delay ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for AGC decoder" ); } - if ( ( hAgc->gain_state = (ivas_agc_dec_chan_state_t *) count_malloc( sizeof( ivas_agc_dec_chan_state_t ) * FOA_CHANNELS ) ) == NULL ) + if ( ( hAgc->gain_state = (ivas_agc_dec_chan_state_t *) malloc( sizeof( ivas_agc_dec_chan_state_t ) * FOA_CHANNELS ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for AGC decoder" ); } - if ( ( hAgc->gain_data = (ivas_agc_chan_data_t *) count_malloc( sizeof( ivas_agc_chan_data_t ) * FOA_CHANNELS ) ) == NULL ) + if ( ( hAgc->gain_data = (ivas_agc_chan_data_t *) malloc( sizeof( ivas_agc_chan_data_t ) * FOA_CHANNELS ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for AGC decoder" ); } @@ -146,16 +146,16 @@ void ivas_spar_agc_dec_close( if ( hAgc != NULL ) { - count_free( hAgc->agc_com.winFunc ); + free( hAgc->agc_com.winFunc ); hAgc->agc_com.winFunc = NULL; - count_free( hAgc->gain_state ); + free( hAgc->gain_state ); hAgc->gain_state = NULL; - count_free( hAgc->gain_data ); + free( hAgc->gain_data ); hAgc->gain_data = NULL; - count_free( hAgc ); + free( hAgc ); *hAgcDec = NULL; } diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index 86c8bdd6058853bf2fa6a627af47b508027c6e6c..e5cc40cd479f8bab6cc821ea615b4307069e3a5c 100644 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -42,7 +42,7 @@ #include "prot.h" #include "ivas_prot.h" #include "ivas_rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" #ifdef DEBUG_PLOT #include "deb_out.h" #endif @@ -97,7 +97,7 @@ ivas_error ivas_core_dec( error = IVAS_ERR_OK; - wmops_sub_start( "ivas_core_dec" ); + push_wmops( "ivas_core_dec" ); /*------------------------------------------------------------------* * General initialization @@ -372,7 +372,7 @@ ivas_error ivas_core_dec( { if ( hMCT ) { - wmops_sub_end(); + pop_wmops(); return error; } @@ -721,7 +721,7 @@ ivas_error ivas_core_dec( output_debug_mode_info_dec( sts, n_channels, output_frame, pitch_buf ); #endif - wmops_sub_end(); + pop_wmops(); return error; } diff --git a/lib_dec/ivas_corecoder_dec_reconfig.c b/lib_dec/ivas_corecoder_dec_reconfig.c index c2092c7efee66cc88ca9701923a286e3b05ca13e..04dc4cccfcb14f86841410d665ad389fc1a9d033 100644 --- a/lib_dec/ivas_corecoder_dec_reconfig.c +++ b/lib_dec/ivas_corecoder_dec_reconfig.c @@ -43,7 +43,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* @@ -117,10 +117,10 @@ ivas_error ivas_corecoder_dec_reconfig( if ( st_ivas->hSCE[0] != NULL ) { - count_free( st_ivas->hSCE[0]->save_synth ); + free( st_ivas->hSCE[0]->save_synth ); st_ivas->hSCE[0]->save_synth = NULL; - count_free( st_ivas->hSCE[0]->save_hb_synth ); + free( st_ivas->hSCE[0]->save_hb_synth ); st_ivas->hSCE[0]->save_hb_synth = NULL; } } @@ -203,7 +203,7 @@ ivas_error ivas_corecoder_dec_reconfig( /* special case, if we have MCT now and had a single CPE before, remove the MDCT Stereo handles from the first CPE*/ if ( st_ivas->nCPE > 1 && nCPE_old == 1 ) { - count_free( st_ivas->hCPE[0]->hStereoMdct ); + free( st_ivas->hCPE[0]->hStereoMdct ); st_ivas->hCPE[0]->hStereoMdct = NULL; } @@ -282,7 +282,7 @@ ivas_error ivas_corecoder_dec_reconfig( /* special case, if we have a single CPE and had MCT before we need to init the MDCT stereo handles here */ if ( st_ivas->nCPE == 1 && nCPE_old > 1 ) { - if ( ( st_ivas->hCPE[st_ivas->nCPE - 1]->hStereoMdct = (STEREO_MDCT_DEC_DATA_HANDLE) count_malloc( sizeof( STEREO_MDCT_DEC_DATA ) ) ) == NULL ) + if ( ( st_ivas->hCPE[st_ivas->nCPE - 1]->hStereoMdct = (STEREO_MDCT_DEC_DATA_HANDLE) malloc( sizeof( STEREO_MDCT_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MDCT Stereo \n" ) ); } @@ -320,7 +320,7 @@ ivas_error ivas_corecoder_dec_reconfig( if ( st_ivas->hSCE[0]->save_synth == NULL ) { - if ( ( st_ivas->hSCE[0]->save_synth = (float *) count_malloc( sizeof( float ) * output_frame ) ) == NULL ) + if ( ( st_ivas->hSCE[0]->save_synth = (float *) malloc( sizeof( float ) * output_frame ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for stereo output\n" ) ); } @@ -329,7 +329,7 @@ ivas_error ivas_corecoder_dec_reconfig( if ( st_ivas->hSCE[0]->save_hb_synth == NULL ) { - if ( ( st_ivas->hSCE[0]->save_hb_synth = (float *) count_malloc( sizeof( float ) * output_frame ) ) == NULL ) + if ( ( st_ivas->hSCE[0]->save_hb_synth = (float *) malloc( sizeof( float ) * output_frame ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate HB memory for stereo output\n" ) ); } @@ -416,7 +416,7 @@ ivas_error ivas_hp20_dec_reconfig( old_mem_hp20_out = st_ivas->mem_hp20_out; st_ivas->mem_hp20_out = NULL; - if ( ( st_ivas->mem_hp20_out = (float **) count_malloc( nchan_hp20 * sizeof( float * ) ) ) == NULL ) + if ( ( st_ivas->mem_hp20_out = (float **) malloc( nchan_hp20 * sizeof( float * ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HP20 filter memory\n" ) ); } @@ -429,7 +429,7 @@ ivas_error ivas_hp20_dec_reconfig( /* create additional hp20 memories */ for ( ; i < nchan_hp20; i++ ) { - if ( ( st_ivas->mem_hp20_out[i] = (float *) count_malloc( L_HP20_MEM * sizeof( float ) ) ) == NULL ) + if ( ( st_ivas->mem_hp20_out[i] = (float *) malloc( L_HP20_MEM * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HP20 filter memory\n" ) ); } @@ -437,7 +437,7 @@ ivas_error ivas_hp20_dec_reconfig( set_f( st_ivas->mem_hp20_out[i], 0.0f, L_HP20_MEM ); } - count_free( old_mem_hp20_out ); + free( old_mem_hp20_out ); old_mem_hp20_out = NULL; } else if ( nchan_hp20 < nchan_hp20_old ) @@ -446,7 +446,7 @@ ivas_error ivas_hp20_dec_reconfig( old_mem_hp20_out = st_ivas->mem_hp20_out; st_ivas->mem_hp20_out = NULL; - if ( ( st_ivas->mem_hp20_out = (float **) count_malloc( nchan_hp20 * sizeof( float * ) ) ) == NULL ) + if ( ( st_ivas->mem_hp20_out = (float **) malloc( nchan_hp20 * sizeof( float * ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HP20 filter memory\n" ) ); } @@ -459,11 +459,11 @@ ivas_error ivas_hp20_dec_reconfig( /* remove superfluous hp20 memories */ for ( ; i < nchan_hp20_old; i++ ) { - count_free( old_mem_hp20_out[i] ); + free( old_mem_hp20_out[i] ); old_mem_hp20_out[i] = NULL; } - count_free( old_mem_hp20_out ); + free( old_mem_hp20_out ); old_mem_hp20_out = NULL; } diff --git a/lib_dec/ivas_cpe_dec.c b/lib_dec/ivas_cpe_dec.c index cb5b9f4e0bad7d75762f611c950f3d13024eac36..3ac34a6009af9e582d3b8db34d20e6d7d4fe92ee 100644 --- a/lib_dec/ivas_cpe_dec.c +++ b/lib_dec/ivas_cpe_dec.c @@ -42,7 +42,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" #include @@ -80,7 +80,7 @@ ivas_error ivas_cpe_dec( error = IVAS_ERR_OK; - wmops_sub_start( "ivas_cpe_dec" ); + push_wmops( "ivas_cpe_dec" ); ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; @@ -373,7 +373,7 @@ ivas_error ivas_cpe_dec( if ( st_ivas->hMCT ) { - wmops_sub_end(); + pop_wmops(); return error; } @@ -526,7 +526,7 @@ ivas_error ivas_cpe_dec( } #endif - wmops_sub_end(); + pop_wmops(); return error; } @@ -555,7 +555,7 @@ ivas_error create_cpe_dec( * Allocate CPE handle *-----------------------------------------------------------------*/ - if ( ( hCPE = (CPE_DEC_HANDLE) count_malloc( sizeof( CPE_DEC_DATA ) ) ) == NULL ) + if ( ( hCPE = (CPE_DEC_HANDLE) malloc( sizeof( CPE_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CPE\n" ) ); } @@ -615,13 +615,13 @@ ivas_error create_cpe_dec( if ( st_ivas->ivas_format == STEREO_FORMAT || st_ivas->ivas_format == MASA_FORMAT || ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) || st_ivas->sba_dirac_stereo_flag ) { - if ( ( hCPE->input_mem[i] = (float *) count_malloc( sizeof( float ) * NS2SA( output_Fs, STEREO_DFT32MS_OVL_NS ) ) ) == NULL ) + if ( ( hCPE->input_mem[i] = (float *) malloc( sizeof( float ) * NS2SA( output_Fs, STEREO_DFT32MS_OVL_NS ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DFT stereo memory\n" ) ); } set_zero( hCPE->input_mem[i], NS2SA( output_Fs, STEREO_DFT32MS_OVL_NS ) ); - if ( ( hCPE->input_mem_LB[i] = (float *) count_malloc( sizeof( float ) * STEREO_DFT32MS_OVL_16k ) ) == NULL ) + if ( ( hCPE->input_mem_LB[i] = (float *) malloc( sizeof( float ) * STEREO_DFT32MS_OVL_16k ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DFT stereo memory\n" ) ); } @@ -629,14 +629,14 @@ ivas_error create_cpe_dec( if ( i == 0 ) { - if ( ( hCPE->input_mem_BPF[0] = (float *) count_malloc( sizeof( float ) * STEREO_DFT32MS_OVL_16k ) ) == NULL ) + if ( ( hCPE->input_mem_BPF[0] = (float *) malloc( sizeof( float ) * STEREO_DFT32MS_OVL_16k ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DFT stereo memory\n" ) ); } set_zero( hCPE->input_mem_BPF[0], STEREO_DFT32MS_OVL_16k ); } - if ( ( hCPE->output_mem[i] = (float *) count_malloc( sizeof( float ) * NS2SA( output_Fs, STEREO_DFT32MS_OVL_NS ) ) ) == NULL ) + if ( ( hCPE->output_mem[i] = (float *) malloc( sizeof( float ) * NS2SA( output_Fs, STEREO_DFT32MS_OVL_NS ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DFT stereo memory\n" ) ); } @@ -644,7 +644,7 @@ ivas_error create_cpe_dec( if ( i < hCPE->nchan_out ) { - if ( ( hCPE->prev_synth_chs[i] = (float *) count_malloc( sizeof( float ) * NS2SA( output_Fs, FRAME_SIZE_NS ) ) ) == NULL ) + if ( ( hCPE->prev_synth_chs[i] = (float *) malloc( sizeof( float ) * NS2SA( output_Fs, FRAME_SIZE_NS ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DFT stereo memory\n" ) ); } @@ -680,7 +680,7 @@ ivas_error create_cpe_dec( break; } - if ( ( st = (DEC_CORE_HANDLE) count_malloc( sizeof( Decoder_State ) ) ) == NULL ) + if ( ( st = (DEC_CORE_HANDLE) malloc( sizeof( Decoder_State ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CoreCoder structure\n" ) ); } @@ -720,7 +720,7 @@ ivas_error create_cpe_dec( if ( hCPE->element_mode != IVAS_CPE_MDCT && hCPE->nchan_out == 1 ) { - if ( ( hCPE->hStereoDftDmx = (STEREO_DFT_DMX_DATA_HANDLE) count_malloc( sizeof( STEREO_DFT_DMX_DATA ) ) ) == NULL ) + if ( ( hCPE->hStereoDftDmx = (STEREO_DFT_DMX_DATA_HANDLE) malloc( sizeof( STEREO_DFT_DMX_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Stereo DFT mono output\n" ) ); } @@ -734,7 +734,7 @@ ivas_error create_cpe_dec( if ( ( hCPE->element_mode != IVAS_CPE_MDCT || ( st_ivas->ivas_format == STEREO_FORMAT && hCPE->element_brate <= MAX_MDCT_ITD_BRATE ) ) && hCPE->nchan_out != 1 ) { - if ( ( hCPE->hStereoTCA = (STEREO_TCA_DEC_HANDLE) count_malloc( sizeof( STEREO_TCA_DEC_DATA ) ) ) == NULL ) + if ( ( hCPE->hStereoTCA = (STEREO_TCA_DEC_HANDLE) malloc( sizeof( STEREO_TCA_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Stereo TCA\n" ) ); } @@ -748,7 +748,7 @@ ivas_error create_cpe_dec( if ( hCPE->element_mode != IVAS_CPE_MDCT && !( hCPE->element_mode == IVAS_CPE_DFT && hCPE->nchan_out == 1 ) ) { - if ( ( hCPE->hStereoICBWE = (STEREO_ICBWE_DEC_HANDLE) count_malloc( sizeof( STEREO_ICBWE_DEC_DATA ) ) ) == NULL ) + if ( ( hCPE->hStereoICBWE = (STEREO_ICBWE_DEC_HANDLE) malloc( sizeof( STEREO_ICBWE_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Stereo ICBWE\n" ) ); } @@ -762,7 +762,7 @@ ivas_error create_cpe_dec( if ( hCPE->element_mode == IVAS_CPE_TD ) { - if ( ( hCPE->hStereoTD = (STEREO_TD_DEC_DATA_HANDLE) count_malloc( sizeof( STEREO_TD_DEC_DATA ) ) ) == NULL ) + if ( ( hCPE->hStereoTD = (STEREO_TD_DEC_DATA_HANDLE) malloc( sizeof( STEREO_TD_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TD Stereo\n" ) ); } @@ -776,7 +776,7 @@ ivas_error create_cpe_dec( if ( hCPE->element_mode == IVAS_CPE_MDCT && st_ivas->nCPE == 1 ) { - if ( ( hCPE->hStereoMdct = (STEREO_MDCT_DEC_DATA_HANDLE) count_malloc( sizeof( STEREO_MDCT_DEC_DATA ) ) ) == NULL ) + if ( ( hCPE->hStereoMdct = (STEREO_MDCT_DEC_DATA_HANDLE) malloc( sizeof( STEREO_MDCT_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Stereo MDCT\n" ) ); } @@ -807,7 +807,7 @@ ivas_error create_cpe_dec( if ( hCPE->element_mode == IVAS_CPE_TD || hCPE->element_mode == IVAS_CPE_DFT ) { - if ( ( hCPE->hStereoCng = (STEREO_CNG_DEC_HANDLE) count_malloc( sizeof( STEREO_CNG_DEC ) ) ) == NULL ) + if ( ( hCPE->hStereoCng = (STEREO_CNG_DEC_HANDLE) malloc( sizeof( STEREO_CNG_DEC ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Stereo CNG\n" ) ); } @@ -849,7 +849,7 @@ void destroy_cpe_dec( { destroy_core_dec( st ); - count_free( st ); + free( st ); st = NULL; } } @@ -862,31 +862,31 @@ void destroy_cpe_dec( if ( hCPE->hStereoDftDmx != NULL ) { - count_free( hCPE->hStereoDftDmx ); + free( hCPE->hStereoDftDmx ); hCPE->hStereoDftDmx = NULL; } if ( hCPE->hStereoTD != NULL ) { - count_free( hCPE->hStereoTD ); + free( hCPE->hStereoTD ); hCPE->hStereoTD = NULL; } if ( hCPE->hStereoMdct != NULL ) { - count_free( hCPE->hStereoMdct ); + free( hCPE->hStereoMdct ); hCPE->hStereoMdct = NULL; } if ( hCPE->hStereoTCA != NULL ) { - count_free( hCPE->hStereoTCA ); + free( hCPE->hStereoTCA ); hCPE->hStereoTCA = NULL; } if ( hCPE->hStereoICBWE != NULL ) { - count_free( hCPE->hStereoICBWE ); + free( hCPE->hStereoICBWE ); hCPE->hStereoICBWE = NULL; } @@ -894,29 +894,29 @@ void destroy_cpe_dec( { for ( n = 0; n < CPE_CHANNELS; n++ ) { - count_free( hCPE->input_mem_LB[n] ); + free( hCPE->input_mem_LB[n] ); hCPE->input_mem_LB[n] = NULL; - count_free( hCPE->input_mem[n] ); + free( hCPE->input_mem[n] ); hCPE->input_mem[n] = NULL; - count_free( hCPE->output_mem[n] ); + free( hCPE->output_mem[n] ); hCPE->output_mem[n] = NULL; if ( hCPE->prev_synth_chs[n] != NULL ) { - count_free( hCPE->prev_synth_chs[n] ); + free( hCPE->prev_synth_chs[n] ); hCPE->prev_synth_chs[n] = NULL; } } - count_free( hCPE->input_mem_BPF[0] ); + free( hCPE->input_mem_BPF[0] ); hCPE->input_mem_BPF[0] = NULL; } if ( hCPE->hStereoCng != NULL ) { - count_free( hCPE->hStereoCng ); + free( hCPE->hStereoCng ); hCPE->hStereoCng = NULL; } - count_free( hCPE ); + free( hCPE ); return; } diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index 4eb6477db7ac29ed04bec6deccb902c752e5facc..c68c1b64903c9fbddf494e203ff16469ed3f236f 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -41,7 +41,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------* @@ -67,7 +67,7 @@ ivas_error ivas_dec( error = IVAS_ERR_OK; - wmops_sub_start( "ivas_dec" ); + push_wmops( "ivas_dec" ); /*----------------------------------------------------------------* * IVAS decoder setup @@ -599,6 +599,6 @@ ivas_error ivas_dec( } #endif - wmops_sub_end(); + pop_wmops(); return error; } diff --git a/lib_dec/ivas_decision_matrix_dec.c b/lib_dec/ivas_decision_matrix_dec.c index a62e1d29eb654222dd9bfaed659c30283b86401b..6f183359b604e75ad255d93380b19cc88d0deaf1 100644 --- a/lib_dec/ivas_decision_matrix_dec.c +++ b/lib_dec/ivas_decision_matrix_dec.c @@ -40,7 +40,7 @@ #include "ivas_prot.h" #include "prot.h" #include "ivas_cnst.h" -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------* * ivas_decision_matrix_dec() diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index b6d442ee3571d6d4a6d552a4d20bab9b8139fd25..dc10bc8590a983d210d0d86c1ec1b65d01fe8f7a 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -43,7 +43,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------------* @@ -170,12 +170,12 @@ ivas_error ivas_dirac_dec_config( * prepare library opening *-----------------------------------------------------------------*/ - if ( ( hDirAC = (DIRAC_DEC_HANDLE) count_malloc( sizeof( DIRAC_DEC_DATA ) ) ) == NULL ) + if ( ( hDirAC = (DIRAC_DEC_HANDLE) malloc( sizeof( DIRAC_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); } - if ( ( hDirAC->hConfig = (DIRAC_CONFIG_DATA_HANDLE) count_malloc( sizeof( DIRAC_CONFIG_DATA ) ) ) == NULL ) + if ( ( hDirAC->hConfig = (DIRAC_CONFIG_DATA_HANDLE) malloc( sizeof( DIRAC_CONFIG_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC Config\n" ) ); } @@ -318,7 +318,7 @@ ivas_error ivas_dirac_dec_config( if ( flag_config == DIRAC_OPEN ) { hDirAC->num_freq_bands = (int16_t) ( output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ); - hDirAC->frequency_axis = (float *) count_malloc( hDirAC->num_freq_bands * sizeof( float ) ); + hDirAC->frequency_axis = (float *) malloc( hDirAC->num_freq_bands * sizeof( float ) ); set_f( hDirAC->frequency_axis, 0.0f, hDirAC->num_freq_bands ); ivas_dirac_dec_get_frequency_axis( hDirAC->frequency_axis, output_Fs, hDirAC->num_freq_bands ); @@ -328,7 +328,7 @@ ivas_error ivas_dirac_dec_config( { if ( ( flag_config == DIRAC_RECONFIGURE && hDirAC->masa_stereo_type_detect == NULL ) || flag_config == DIRAC_OPEN ) { - hDirAC->masa_stereo_type_detect = (MASA_STEREO_TYPE_DETECT *) count_malloc( sizeof( MASA_STEREO_TYPE_DETECT ) ); + hDirAC->masa_stereo_type_detect = (MASA_STEREO_TYPE_DETECT *) malloc( sizeof( MASA_STEREO_TYPE_DETECT ) ); } ivas_masa_init_stereotype_detection( hDirAC->masa_stereo_type_detect ); } @@ -336,7 +336,7 @@ ivas_error ivas_dirac_dec_config( { if ( flag_config == DIRAC_RECONFIGURE && hDirAC->masa_stereo_type_detect != NULL ) { - count_free( hDirAC->masa_stereo_type_detect ); + free( hDirAC->masa_stereo_type_detect ); } hDirAC->masa_stereo_type_detect = NULL; } @@ -396,22 +396,22 @@ ivas_error ivas_dirac_dec_config( if ( flag_config == DIRAC_OPEN ) { num_outputs_dir_old = hDirAC->num_outputs_dir; - hDirAC->proto_index_dir = (int16_t *) count_malloc( sizeof( int16_t ) * hDirAC->num_outputs_dir ); + hDirAC->proto_index_dir = (int16_t *) malloc( sizeof( int16_t ) * hDirAC->num_outputs_dir ); num_outputs_diff_old = hDirAC->num_outputs_diff; - hDirAC->proto_index_diff = (int16_t *) count_malloc( sizeof( int16_t ) * hDirAC->num_outputs_diff ); + hDirAC->proto_index_diff = (int16_t *) malloc( sizeof( int16_t ) * hDirAC->num_outputs_diff ); } if ( hDirAC->num_outputs_dir != num_outputs_dir_old && flag_config == DIRAC_RECONFIGURE ) { - count_free( hDirAC->proto_index_dir ); - hDirAC->proto_index_dir = (int16_t *) count_malloc( sizeof( int16_t ) * hDirAC->num_outputs_dir ); + free( hDirAC->proto_index_dir ); + hDirAC->proto_index_dir = (int16_t *) malloc( sizeof( int16_t ) * hDirAC->num_outputs_dir ); } set_s( hDirAC->proto_index_dir, 0, hDirAC->num_outputs_dir ); if ( hDirAC->num_outputs_diff != num_outputs_diff_old && flag_config == DIRAC_RECONFIGURE ) { - count_free( hDirAC->proto_index_diff ); - hDirAC->proto_index_diff = (int16_t *) count_malloc( sizeof( int16_t ) * hDirAC->num_outputs_diff ); + free( hDirAC->proto_index_diff ); + hDirAC->proto_index_diff = (int16_t *) malloc( sizeof( int16_t ) * hDirAC->num_outputs_diff ); } set_s( hDirAC->proto_index_diff, 0, hDirAC->num_outputs_diff ); @@ -531,14 +531,14 @@ ivas_error ivas_dirac_dec_config( /* direct/diffuse responses */ if ( flag_config == DIRAC_OPEN ) { - hDirAC->diffuse_response_function = (float *) count_malloc( sizeof( float ) * hDirAC->num_outputs_dir ); + hDirAC->diffuse_response_function = (float *) malloc( sizeof( float ) * hDirAC->num_outputs_dir ); } /* reallocate static memory */ else if ( flag_config == DIRAC_RECONFIGURE && hDirAC->num_outputs_dir != num_outputs_dir_old ) { - count_free( hDirAC->diffuse_response_function ); + free( hDirAC->diffuse_response_function ); hDirAC->diffuse_response_function = NULL; - hDirAC->diffuse_response_function = (float *) count_malloc( sizeof( float ) * hDirAC->num_outputs_dir ); + hDirAC->diffuse_response_function = (float *) malloc( sizeof( float ) * hDirAC->num_outputs_dir ); } if ( ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_PSD_LS ) || ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_PSD_SHD ) || ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_MONO ) ) @@ -556,13 +556,13 @@ ivas_error ivas_dirac_dec_config( { if ( flag_config == DIRAC_OPEN ) { - hDirAC->hoa_encoder = (float *) count_malloc( nchan_out_woLFE * hDirAC->num_outputs_diff * sizeof( float ) ); + hDirAC->hoa_encoder = (float *) malloc( nchan_out_woLFE * hDirAC->num_outputs_diff * sizeof( float ) ); } else if ( flag_config == DIRAC_RECONFIGURE && hDirAC->hoa_encoder && ( hDirAC->num_outputs_diff != num_outputs_diff_old ) ) { - count_free( hDirAC->hoa_encoder ); + free( hDirAC->hoa_encoder ); hDirAC->hoa_encoder = NULL; - hDirAC->hoa_encoder = (float *) count_malloc( nchan_out_woLFE * hDirAC->num_outputs_diff * sizeof( float ) ); + hDirAC->hoa_encoder = (float *) malloc( nchan_out_woLFE * hDirAC->num_outputs_diff * sizeof( float ) ); } set_f( hDirAC->hoa_encoder, 0.0f, nchan_out_woLFE * hDirAC->num_outputs_diff ); compute_hoa_encoder_mtx( ls_azimuth, ls_elevation, hDirAC->hoa_encoder, hDirAC->num_outputs_diff, hDirAC->hOutSetup.ambisonics_order ); @@ -571,7 +571,7 @@ ivas_error ivas_dirac_dec_config( { if ( flag_config == DIRAC_RECONFIGURE && hDirAC->hoa_encoder ) { - count_free( hDirAC->hoa_encoder ); + free( hDirAC->hoa_encoder ); } hDirAC->hoa_encoder = NULL; } @@ -616,7 +616,7 @@ ivas_error ivas_dirac_dec_config( { if ( st_ivas->hoa_dec_mtx != NULL ) { - count_free( st_ivas->hoa_dec_mtx ); + free( st_ivas->hoa_dec_mtx ); st_ivas->hoa_dec_mtx = NULL; } if ( ( error = ivas_sba_get_hoa_dec_matrix( hDirAC->hOutSetup, &st_ivas->hoa_dec_mtx, hDirAC->hOutSetup.ambisonics_order ) ) != IVAS_ERR_OK ) @@ -707,7 +707,7 @@ ivas_error ivas_dirac_dec_config( { if ( flag_config == DIRAC_RECONFIGURE && hDirAC->proto_frame_f ) { - count_free( hDirAC->proto_frame_f ); + free( hDirAC->proto_frame_f ); } hDirAC->proto_frame_f = NULL; } @@ -715,13 +715,13 @@ ivas_error ivas_dirac_dec_config( { if ( flag_config == DIRAC_OPEN || ( flag_config == DIRAC_RECONFIGURE && hDirAC->proto_frame_f == NULL ) ) { - hDirAC->proto_frame_f = (float *) count_malloc( sizeof( float ) * 2 * hDirAC->num_protos_diff * hDirAC->num_freq_bands ); + hDirAC->proto_frame_f = (float *) malloc( sizeof( float ) * 2 * hDirAC->num_protos_diff * hDirAC->num_freq_bands ); } else if ( flag_config == DIRAC_RECONFIGURE && ( hDirAC->num_protos_diff != num_protos_diff_old ) ) { proto_frame_f_old = hDirAC->proto_frame_f; - count_free( proto_frame_f_old ); - hDirAC->proto_frame_f = (float *) count_malloc( sizeof( float ) * 2 * hDirAC->num_protos_diff * hDirAC->num_freq_bands ); + free( proto_frame_f_old ); + hDirAC->proto_frame_f = (float *) malloc( sizeof( float ) * 2 * hDirAC->num_protos_diff * hDirAC->num_freq_bands ); } } @@ -738,13 +738,13 @@ ivas_error ivas_dirac_dec_config( { for ( j = 0; j < DIRAC_NO_COL_AVG_DIFF; j++ ) { - hDirAC->buffer_intensity_real[i][j] = (float *) count_malloc( CLDFB_NO_CHANNELS_MAX * sizeof( float ) ); + hDirAC->buffer_intensity_real[i][j] = (float *) malloc( CLDFB_NO_CHANNELS_MAX * sizeof( float ) ); set_f( hDirAC->buffer_intensity_real[i][j], 0.0f, CLDFB_NO_CHANNELS_MAX ); } } if ( hDirAC->buffer_energy == NULL ) { - hDirAC->buffer_energy = (float *) count_malloc( DIRAC_NO_COL_AVG_DIFF * CLDFB_NO_CHANNELS_MAX * sizeof( float ) ); + hDirAC->buffer_energy = (float *) malloc( DIRAC_NO_COL_AVG_DIFF * CLDFB_NO_CHANNELS_MAX * sizeof( float ) ); } set_f( hDirAC->buffer_energy, 0.0f, DIRAC_NO_COL_AVG_DIFF * CLDFB_NO_CHANNELS_MAX ); } @@ -756,14 +756,14 @@ ivas_error ivas_dirac_dec_config( { if ( flag_config == DIRAC_RECONFIGURE && hDirAC->buffer_intensity_real[i][j] ) { - count_free( hDirAC->buffer_intensity_real[i][j] ); + free( hDirAC->buffer_intensity_real[i][j] ); } hDirAC->buffer_intensity_real[i][j] = NULL; } } if ( hDirAC->buffer_energy != NULL ) { - count_free( hDirAC->buffer_energy ); + free( hDirAC->buffer_energy ); hDirAC->buffer_energy = NULL; } } @@ -814,45 +814,45 @@ ivas_error ivas_dirac_dec_config( } } - hDirAC->azimuth = (int16_t **) count_malloc( hDirAC->dirac_md_buffer_length * sizeof( int16_t * ) ); - hDirAC->elevation = (int16_t **) count_malloc( hDirAC->dirac_md_buffer_length * sizeof( int16_t * ) ); - hDirAC->diffuseness_vector = (float **) count_malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ); - hDirAC->energy_ratio1 = (float **) count_malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ); - hDirAC->spreadCoherence = (float **) count_malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ); - hDirAC->surroundingCoherence = (float **) count_malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ); + hDirAC->azimuth = (int16_t **) malloc( hDirAC->dirac_md_buffer_length * sizeof( int16_t * ) ); + hDirAC->elevation = (int16_t **) malloc( hDirAC->dirac_md_buffer_length * sizeof( int16_t * ) ); + hDirAC->diffuseness_vector = (float **) malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ); + hDirAC->energy_ratio1 = (float **) malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ); + hDirAC->spreadCoherence = (float **) malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ); + hDirAC->surroundingCoherence = (float **) malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ); for ( i = 0; i < hDirAC->dirac_md_buffer_length; i++ ) { - hDirAC->azimuth[i] = (int16_t *) count_malloc( hDirAC->num_freq_bands * sizeof( int16_t ) ); + hDirAC->azimuth[i] = (int16_t *) malloc( hDirAC->num_freq_bands * sizeof( int16_t ) ); set_s( hDirAC->azimuth[i], 0, hDirAC->num_freq_bands ); - hDirAC->elevation[i] = (int16_t *) count_malloc( hDirAC->num_freq_bands * sizeof( int16_t ) ); + hDirAC->elevation[i] = (int16_t *) malloc( hDirAC->num_freq_bands * sizeof( int16_t ) ); set_s( hDirAC->elevation[i], 0, hDirAC->num_freq_bands ); - hDirAC->diffuseness_vector[i] = (float *) count_malloc( hDirAC->num_freq_bands * sizeof( float ) ); + hDirAC->diffuseness_vector[i] = (float *) malloc( hDirAC->num_freq_bands * sizeof( float ) ); set_f( hDirAC->diffuseness_vector[i], 1.0f, hDirAC->num_freq_bands ); - hDirAC->energy_ratio1[i] = (float *) count_malloc( hDirAC->num_freq_bands * sizeof( float ) ); + hDirAC->energy_ratio1[i] = (float *) malloc( hDirAC->num_freq_bands * sizeof( float ) ); set_f( hDirAC->energy_ratio1[i], 0.0f, hDirAC->num_freq_bands ); - hDirAC->spreadCoherence[i] = (float *) count_malloc( hDirAC->num_freq_bands * sizeof( float ) ); + hDirAC->spreadCoherence[i] = (float *) malloc( hDirAC->num_freq_bands * sizeof( float ) ); set_f( hDirAC->spreadCoherence[i], 0.0f, hDirAC->num_freq_bands ); - hDirAC->surroundingCoherence[i] = (float *) count_malloc( hDirAC->num_freq_bands * sizeof( float ) ); + hDirAC->surroundingCoherence[i] = (float *) malloc( hDirAC->num_freq_bands * sizeof( float ) ); set_f( hDirAC->surroundingCoherence[i], 0.0f, hDirAC->num_freq_bands ); } if ( st_ivas->ivas_format == MASA_FORMAT ) { - hDirAC->azimuth2 = (int16_t **) count_malloc( hDirAC->dirac_md_buffer_length * sizeof( int16_t * ) ); - hDirAC->elevation2 = (int16_t **) count_malloc( hDirAC->dirac_md_buffer_length * sizeof( int16_t * ) ); - hDirAC->energy_ratio2 = (float **) count_malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ); - hDirAC->spreadCoherence2 = (float **) count_malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ); + hDirAC->azimuth2 = (int16_t **) malloc( hDirAC->dirac_md_buffer_length * sizeof( int16_t * ) ); + hDirAC->elevation2 = (int16_t **) malloc( hDirAC->dirac_md_buffer_length * sizeof( int16_t * ) ); + hDirAC->energy_ratio2 = (float **) malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ); + hDirAC->spreadCoherence2 = (float **) malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ); for ( i = 0; i < hDirAC->dirac_md_buffer_length; i++ ) { - hDirAC->azimuth2[i] = (int16_t *) count_malloc( hDirAC->num_freq_bands * sizeof( int16_t ) ); + hDirAC->azimuth2[i] = (int16_t *) malloc( hDirAC->num_freq_bands * sizeof( int16_t ) ); set_s( hDirAC->azimuth2[i], 0, hDirAC->num_freq_bands ); - hDirAC->elevation2[i] = (int16_t *) count_malloc( hDirAC->num_freq_bands * sizeof( int16_t ) ); + hDirAC->elevation2[i] = (int16_t *) malloc( hDirAC->num_freq_bands * sizeof( int16_t ) ); set_s( hDirAC->elevation2[i], 0, hDirAC->num_freq_bands ); - hDirAC->energy_ratio2[i] = (float *) count_malloc( hDirAC->num_freq_bands * sizeof( float ) ); + hDirAC->energy_ratio2[i] = (float *) malloc( hDirAC->num_freq_bands * sizeof( float ) ); set_f( hDirAC->energy_ratio2[i], 0.0f, hDirAC->num_freq_bands ); - hDirAC->spreadCoherence2[i] = (float *) count_malloc( hDirAC->num_freq_bands * sizeof( float ) ); + hDirAC->spreadCoherence2[i] = (float *) malloc( hDirAC->num_freq_bands * sizeof( float ) ); set_f( hDirAC->spreadCoherence2[i], 0.0f, hDirAC->num_freq_bands ); } } @@ -889,7 +889,7 @@ void ivas_dirac_dec_close( /* Config & CLDFB */ if ( hDirAC->hConfig != NULL ) { - count_free( hDirAC->hConfig ); + free( hDirAC->hConfig ); hDirAC->hConfig = NULL; } @@ -907,32 +907,32 @@ void ivas_dirac_dec_close( /* free frequency axis buffer */ if ( hDirAC->frequency_axis != NULL ) { - count_free( hDirAC->frequency_axis ); + free( hDirAC->frequency_axis ); hDirAC->frequency_axis = NULL; } if ( hDirAC->diffuse_response_function != NULL ) { - count_free( hDirAC->diffuse_response_function ); + free( hDirAC->diffuse_response_function ); hDirAC->diffuse_response_function = NULL; } if ( hDirAC->hoa_encoder != NULL ) { - count_free( hDirAC->hoa_encoder ); + free( hDirAC->hoa_encoder ); hDirAC->hoa_encoder = NULL; } /* prototype indexing */ if ( hDirAC->proto_index_dir != NULL ) { - count_free( hDirAC->proto_index_dir ); + free( hDirAC->proto_index_dir ); hDirAC->proto_index_dir = NULL; } if ( hDirAC->proto_index_diff != NULL ) { - count_free( hDirAC->proto_index_diff ); + free( hDirAC->proto_index_diff ); hDirAC->proto_index_dir = NULL; } @@ -942,7 +942,7 @@ void ivas_dirac_dec_close( /* free prototype signal buffers */ if ( hDirAC->proto_frame_f != NULL ) { - count_free( hDirAC->proto_frame_f ); + free( hDirAC->proto_frame_f ); hDirAC->proto_frame_f = NULL; } @@ -952,14 +952,14 @@ void ivas_dirac_dec_close( { if ( hDirAC->buffer_intensity_real[i][j] != NULL ) { - count_free( hDirAC->buffer_intensity_real[i][j] ); + free( hDirAC->buffer_intensity_real[i][j] ); hDirAC->buffer_intensity_real[i][j] = NULL; } } } if ( hDirAC->buffer_energy != NULL ) { - count_free( hDirAC->buffer_energy ); + free( hDirAC->buffer_energy ); hDirAC->buffer_energy = NULL; } @@ -967,34 +967,34 @@ void ivas_dirac_dec_close( { if ( hDirAC->azimuth[i] != NULL ) { - count_free( hDirAC->azimuth[i] ); + free( hDirAC->azimuth[i] ); hDirAC->azimuth[i] = NULL; } if ( hDirAC->elevation[i] != NULL ) { - count_free( hDirAC->elevation[i] ); + free( hDirAC->elevation[i] ); hDirAC->elevation[i] = NULL; } if ( hDirAC->diffuseness_vector[i] != NULL ) { - count_free( hDirAC->diffuseness_vector[i] ); + free( hDirAC->diffuseness_vector[i] ); hDirAC->diffuseness_vector[i] = NULL; } } if ( hDirAC->azimuth != NULL ) { - count_free( hDirAC->azimuth ); + free( hDirAC->azimuth ); hDirAC->azimuth = NULL; } if ( hDirAC->elevation != NULL ) { - count_free( hDirAC->elevation ); + free( hDirAC->elevation ); hDirAC->elevation = NULL; } if ( hDirAC->diffuseness_vector != NULL ) { - count_free( hDirAC->diffuseness_vector ); + free( hDirAC->diffuseness_vector ); hDirAC->diffuseness_vector = NULL; } @@ -1004,11 +1004,11 @@ void ivas_dirac_dec_close( { if ( hDirAC->azimuth2[i] != NULL ) { - count_free( hDirAC->azimuth2[i] ); + free( hDirAC->azimuth2[i] ); hDirAC->azimuth2[i] = NULL; } } - count_free( hDirAC->azimuth2 ); + free( hDirAC->azimuth2 ); hDirAC->azimuth2 = NULL; } @@ -1018,11 +1018,11 @@ void ivas_dirac_dec_close( { if ( hDirAC->elevation2[i] != NULL ) { - count_free( hDirAC->elevation2[i] ); + free( hDirAC->elevation2[i] ); hDirAC->elevation2[i] = NULL; } } - count_free( hDirAC->elevation2 ); + free( hDirAC->elevation2 ); hDirAC->elevation2 = NULL; } @@ -1032,11 +1032,11 @@ void ivas_dirac_dec_close( { if ( hDirAC->energy_ratio1[i] != NULL ) { - count_free( hDirAC->energy_ratio1[i] ); + free( hDirAC->energy_ratio1[i] ); hDirAC->energy_ratio1[i] = NULL; } } - count_free( hDirAC->energy_ratio1 ); + free( hDirAC->energy_ratio1 ); hDirAC->energy_ratio1 = NULL; } @@ -1046,11 +1046,11 @@ void ivas_dirac_dec_close( { if ( hDirAC->energy_ratio2[i] != NULL ) { - count_free( hDirAC->energy_ratio2[i] ); + free( hDirAC->energy_ratio2[i] ); hDirAC->energy_ratio2[i] = NULL; } } - count_free( hDirAC->energy_ratio2 ); + free( hDirAC->energy_ratio2 ); hDirAC->energy_ratio2 = NULL; } @@ -1060,11 +1060,11 @@ void ivas_dirac_dec_close( { if ( hDirAC->spreadCoherence[i] != NULL ) { - count_free( hDirAC->spreadCoherence[i] ); + free( hDirAC->spreadCoherence[i] ); hDirAC->spreadCoherence[i] = NULL; } } - count_free( hDirAC->spreadCoherence ); + free( hDirAC->spreadCoherence ); hDirAC->spreadCoherence = NULL; } @@ -1074,11 +1074,11 @@ void ivas_dirac_dec_close( { if ( hDirAC->spreadCoherence2[i] != NULL ) { - count_free( hDirAC->spreadCoherence2[i] ); + free( hDirAC->spreadCoherence2[i] ); hDirAC->spreadCoherence2[i] = NULL; } } - count_free( hDirAC->spreadCoherence2 ); + free( hDirAC->spreadCoherence2 ); hDirAC->spreadCoherence2 = NULL; } @@ -1088,23 +1088,23 @@ void ivas_dirac_dec_close( { if ( hDirAC->surroundingCoherence[i] != NULL ) { - count_free( hDirAC->surroundingCoherence[i] ); + free( hDirAC->surroundingCoherence[i] ); hDirAC->surroundingCoherence[i] = NULL; } } - count_free( hDirAC->surroundingCoherence ); + free( hDirAC->surroundingCoherence ); hDirAC->surroundingCoherence = NULL; } if ( hDirAC->masa_stereo_type_detect != NULL ) { - count_free( hDirAC->masa_stereo_type_detect ); + free( hDirAC->masa_stereo_type_detect ); hDirAC->masa_stereo_type_detect = NULL; } ivas_dirac_free_mem( &( hDirAC->stack_mem ) ); - count_free( hDirAC ); + free( hDirAC ); return; } @@ -1835,10 +1835,11 @@ void ivas_dirac_dec( float *reference_power, *reference_power_smooth; float *onset_filter, *onset_filter_subframe, *p_onset_filter = NULL; uint16_t coherence_flag; - wmops_sub_start( "ivas_dirac_dec" ); + push_wmops( "ivas_dirac_dec" ); /* Initialize aux buffers */ hDirAC = st_ivas->hDirAC; + DirAC_mem = st_ivas->hDirAC->stack_mem; reference_power = DirAC_mem.reference_power; @@ -2507,7 +2508,7 @@ void ivas_dirac_dec( } } - wmops_sub_end(); + pop_wmops(); return; } diff --git a/lib_dec/ivas_dirac_dec_binaural_functions.c b/lib_dec/ivas_dirac_dec_binaural_functions.c index 1cbd6cdd8732bc81108c5959e17b69a076362a7f..0a98a92d2358b5225bf6a3a51afb8559cce62c5a 100644 --- a/lib_dec/ivas_dirac_dec_binaural_functions.c +++ b/lib_dec/ivas_dirac_dec_binaural_functions.c @@ -42,7 +42,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------- @@ -104,7 +104,7 @@ ivas_error ivas_dirac_dec_init_binaural_data( if ( hBinaural == NULL ) #endif { - if ( ( hBinaural = (DIRAC_DEC_BIN_HANDLE) count_malloc( sizeof( DIRAC_DEC_BIN_DATA ) ) ) == NULL ) + if ( ( hBinaural = (DIRAC_DEC_BIN_HANDLE) malloc( sizeof( DIRAC_DEC_BIN_DATA ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC binaural handle " ); } @@ -302,7 +302,7 @@ void ivas_dirac_dec_close_binaural_data( ivas_spar_td_decorr_dec_close( &( ( *hBinaural )->hTdDecorr ) ); - count_free( *hBinaural ); + free( *hBinaural ); *hBinaural = NULL; return; diff --git a/lib_dec/ivas_dirac_decorr_dec.c b/lib_dec/ivas_dirac_decorr_dec.c index 437bdf8a647911cc20cd13b355e77dea657116b0..ab608bad617e7cb8e91ea7825ac30b7854ec775e 100644 --- a/lib_dec/ivas_dirac_decorr_dec.c +++ b/lib_dec/ivas_dirac_decorr_dec.c @@ -44,7 +44,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------- @@ -101,8 +101,8 @@ void ivas_dirac_dec_decorr_open( *-----------------------------------------------------------------*/ /* allocate structs */ - freq_domain_decorr_ap_params = (DIRAC_DECORR_PARAMS *) count_malloc( sizeof( DIRAC_DECORR_PARAMS ) ); - freq_domain_decorr_ap_state = (DIRAC_DECORR_STATE *) count_malloc( sizeof( DIRAC_DECORR_STATE ) ); + freq_domain_decorr_ap_params = (DIRAC_DECORR_PARAMS *) malloc( sizeof( DIRAC_DECORR_PARAMS ) ); + freq_domain_decorr_ap_state = (DIRAC_DECORR_STATE *) malloc( sizeof( DIRAC_DECORR_STATE ) ); /*-----------------------------------------------------------------* * check input parameters @@ -215,7 +215,7 @@ void ivas_dirac_dec_decorr_open( } } - freq_domain_decorr_ap_params->split_frequency_bands = (int16_t *) count_malloc( sizeof( int16_t ) * ( freq_domain_decorr_ap_params->num_split_frequency_bands + 1 ) ); + freq_domain_decorr_ap_params->split_frequency_bands = (int16_t *) malloc( sizeof( int16_t ) * ( freq_domain_decorr_ap_params->num_split_frequency_bands + 1 ) ); mvs2s( &split_frequencies_bands[0], freq_domain_decorr_ap_params->split_frequency_bands, freq_domain_decorr_ap_params->num_split_frequency_bands + 1 ); /* calc buffer size and allocate arrays */ @@ -232,18 +232,18 @@ void ivas_dirac_dec_decorr_open( if ( num_outputs_diff > 0 ) { buffer_size_decorr = ( ap_pre_delay[split_band_index_start] + ap_filter_length[split_band_index_start] ); - freq_domain_decorr_ap_state->decorr_buffer = (float *) count_malloc( sizeof( float ) * 2 * buffer_size_decorr * num_outputs_diff * freq_domain_decorr_ap_params->max_band_decorr ); + freq_domain_decorr_ap_state->decorr_buffer = (float *) malloc( sizeof( float ) * 2 * buffer_size_decorr * num_outputs_diff * freq_domain_decorr_ap_params->max_band_decorr ); set_f( freq_domain_decorr_ap_state->decorr_buffer, 0.0f, 2 * buffer_size_decorr * num_outputs_diff * freq_domain_decorr_ap_params->max_band_decorr ); - freq_domain_decorr_ap_params->filter_coeff_num_real = (float *) count_malloc( sizeof( float ) * ( ap_filter_length[split_band_index_start] + 1 ) * freq_domain_decorr_ap_params->max_band_decorr * num_outputs_diff ); - freq_domain_decorr_ap_params->filter_coeff_den_real = (float *) count_malloc( sizeof( float ) * ( ap_filter_length[split_band_index_start] + 1 ) * freq_domain_decorr_ap_params->max_band_decorr * num_outputs_diff ); - freq_domain_decorr_ap_params->phase_coeff_real = (float *) count_malloc( sizeof( float ) * freq_domain_decorr_ap_params->max_band_decorr * num_outputs_diff ); - freq_domain_decorr_ap_params->phase_coeff_imag = (float *) count_malloc( sizeof( float ) * freq_domain_decorr_ap_params->max_band_decorr * num_outputs_diff ); - freq_domain_decorr_ap_state->direct_energy_smooth = (float *) count_malloc( sizeof( float ) * freq_domain_decorr_ap_params->max_band_decorr * num_outputs_diff ); - freq_domain_decorr_ap_state->reverb_energy_smooth = (float *) count_malloc( sizeof( float ) * freq_domain_decorr_ap_params->max_band_decorr * num_outputs_diff ); + freq_domain_decorr_ap_params->filter_coeff_num_real = (float *) malloc( sizeof( float ) * ( ap_filter_length[split_band_index_start] + 1 ) * freq_domain_decorr_ap_params->max_band_decorr * num_outputs_diff ); + freq_domain_decorr_ap_params->filter_coeff_den_real = (float *) malloc( sizeof( float ) * ( ap_filter_length[split_band_index_start] + 1 ) * freq_domain_decorr_ap_params->max_band_decorr * num_outputs_diff ); + freq_domain_decorr_ap_params->phase_coeff_real = (float *) malloc( sizeof( float ) * freq_domain_decorr_ap_params->max_band_decorr * num_outputs_diff ); + freq_domain_decorr_ap_params->phase_coeff_imag = (float *) malloc( sizeof( float ) * freq_domain_decorr_ap_params->max_band_decorr * num_outputs_diff ); + freq_domain_decorr_ap_state->direct_energy_smooth = (float *) malloc( sizeof( float ) * freq_domain_decorr_ap_params->max_band_decorr * num_outputs_diff ); + freq_domain_decorr_ap_state->reverb_energy_smooth = (float *) malloc( sizeof( float ) * freq_domain_decorr_ap_params->max_band_decorr * num_outputs_diff ); - freq_domain_decorr_ap_params->pre_delay = (int16_t *) count_malloc( sizeof( int16_t ) * freq_domain_decorr_ap_params->num_split_frequency_bands ); - freq_domain_decorr_ap_params->filter_length = (int16_t *) count_malloc( sizeof( int16_t ) * freq_domain_decorr_ap_params->num_split_frequency_bands ); + freq_domain_decorr_ap_params->pre_delay = (int16_t *) malloc( sizeof( int16_t ) * freq_domain_decorr_ap_params->num_split_frequency_bands ); + freq_domain_decorr_ap_params->filter_length = (int16_t *) malloc( sizeof( int16_t ) * freq_domain_decorr_ap_params->num_split_frequency_bands ); set_f( freq_domain_decorr_ap_state->direct_energy_smooth, 0.0f, freq_domain_decorr_ap_params->max_band_decorr * num_outputs_diff ); set_f( freq_domain_decorr_ap_state->reverb_energy_smooth, 0.0f, freq_domain_decorr_ap_params->max_band_decorr * num_outputs_diff ); @@ -315,7 +315,7 @@ void ivas_dirac_dec_decorr_process( float *filter_coeff_num_real, *filter_coeff_den_real, *decorr_buffer_start_ptr, *decorr_buffer_ptr; float input_real, input_imag, filter_frame_imag, filter_frame_real; - wmops_sub_start( "dirac_decorr_process" ); + push_wmops( "dirac_decorr_process" ); /* check handles */ if ( h_freq_domain_decorr_ap_params == NULL || h_freq_domain_decorr_ap_state == NULL ) @@ -571,7 +571,7 @@ void ivas_dirac_dec_decorr_process( } /*end of decorrelator*/ - wmops_sub_end(); + pop_wmops(); return; } @@ -617,13 +617,13 @@ void ivas_dirac_dec_decorr_close( if ( dirac_onset_detection_state->onset_detector_1 != NULL ) { - count_free( dirac_onset_detection_state->onset_detector_1 ); + free( dirac_onset_detection_state->onset_detector_1 ); dirac_onset_detection_state->onset_detector_1 = NULL; } if ( dirac_onset_detection_state->onset_detector_2 != NULL ) { - count_free( dirac_onset_detection_state->onset_detector_2 ); + free( dirac_onset_detection_state->onset_detector_2 ); dirac_onset_detection_state->onset_detector_2 = NULL; } @@ -634,78 +634,78 @@ void ivas_dirac_dec_decorr_close( /* free decorrelation buffer */ if ( ( *ph_freq_domain_decorr_ap_state )->decorr_buffer != NULL ) { - count_free( ( *ph_freq_domain_decorr_ap_state )->decorr_buffer ); + free( ( *ph_freq_domain_decorr_ap_state )->decorr_buffer ); ( *ph_freq_domain_decorr_ap_state )->decorr_buffer = NULL; } /* free ducker smoothed direct energy buffer */ if ( ( *ph_freq_domain_decorr_ap_state )->direct_energy_smooth != NULL ) { - count_free( ( *ph_freq_domain_decorr_ap_state )->direct_energy_smooth ); + free( ( *ph_freq_domain_decorr_ap_state )->direct_energy_smooth ); ( *ph_freq_domain_decorr_ap_state )->direct_energy_smooth = NULL; } /* free ducker smoothed reverb energy buffer */ if ( ( *ph_freq_domain_decorr_ap_state )->reverb_energy_smooth != NULL ) { - count_free( ( *ph_freq_domain_decorr_ap_state )->reverb_energy_smooth ); + free( ( *ph_freq_domain_decorr_ap_state )->reverb_energy_smooth ); ( *ph_freq_domain_decorr_ap_state )->reverb_energy_smooth = NULL; } /* free pre-delay param buffer */ if ( ( *ph_freq_domain_decorr_ap_params )->pre_delay != NULL ) { - count_free( ( *ph_freq_domain_decorr_ap_params )->pre_delay ); + free( ( *ph_freq_domain_decorr_ap_params )->pre_delay ); ( *ph_freq_domain_decorr_ap_params )->pre_delay = NULL; } /* free filter length param buffer */ if ( ( *ph_freq_domain_decorr_ap_params )->filter_length != NULL ) { - count_free( ( *ph_freq_domain_decorr_ap_params )->filter_length ); + free( ( *ph_freq_domain_decorr_ap_params )->filter_length ); ( *ph_freq_domain_decorr_ap_params )->filter_length = NULL; } /* free filter coeff param buffers */ if ( ( *ph_freq_domain_decorr_ap_params )->filter_coeff_num_real != NULL ) { - count_free( ( *ph_freq_domain_decorr_ap_params )->filter_coeff_num_real ); + free( ( *ph_freq_domain_decorr_ap_params )->filter_coeff_num_real ); ( *ph_freq_domain_decorr_ap_params )->filter_coeff_num_real = NULL; } /* free pre-delay param buffer */ if ( ( *ph_freq_domain_decorr_ap_params )->filter_coeff_den_real != NULL ) { - count_free( ( *ph_freq_domain_decorr_ap_params )->filter_coeff_den_real ); + free( ( *ph_freq_domain_decorr_ap_params )->filter_coeff_den_real ); ( *ph_freq_domain_decorr_ap_params )->filter_coeff_den_real = NULL; } /* free pre-delay param buffer */ if ( ( *ph_freq_domain_decorr_ap_params )->phase_coeff_imag != NULL ) { - count_free( ( *ph_freq_domain_decorr_ap_params )->phase_coeff_imag ); + free( ( *ph_freq_domain_decorr_ap_params )->phase_coeff_imag ); ( *ph_freq_domain_decorr_ap_params )->phase_coeff_imag = NULL; } /* free pre-delay param buffer */ if ( ( *ph_freq_domain_decorr_ap_params )->phase_coeff_real != NULL ) { - count_free( ( *ph_freq_domain_decorr_ap_params )->phase_coeff_real ); + free( ( *ph_freq_domain_decorr_ap_params )->phase_coeff_real ); ( *ph_freq_domain_decorr_ap_params )->phase_coeff_real = NULL; } /* free pre-delay param buffer */ if ( ( *ph_freq_domain_decorr_ap_params )->split_frequency_bands != NULL ) { - count_free( ( *ph_freq_domain_decorr_ap_params )->split_frequency_bands ); + free( ( *ph_freq_domain_decorr_ap_params )->split_frequency_bands ); ( *ph_freq_domain_decorr_ap_params )->split_frequency_bands = NULL; } /* free pointers to state and parameter structs */ - count_free( *ph_freq_domain_decorr_ap_params ); + free( *ph_freq_domain_decorr_ap_params ); *ph_freq_domain_decorr_ap_params = NULL; - count_free( *ph_freq_domain_decorr_ap_state ); + free( *ph_freq_domain_decorr_ap_state ); *ph_freq_domain_decorr_ap_state = NULL; return; diff --git a/lib_dec/ivas_dirac_onsets_dec.c b/lib_dec/ivas_dirac_onsets_dec.c index 67209cc052d0b20cce4d9bebf58f5343217b90b2..08968b84fb413c0d387059aa9de062eb9f761f2e 100644 --- a/lib_dec/ivas_dirac_onsets_dec.c +++ b/lib_dec/ivas_dirac_onsets_dec.c @@ -42,7 +42,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------- @@ -69,8 +69,8 @@ void ivas_dirac_dec_onset_detection_open( dirac_onset_detection_params->max_band_decorr = max_band_decorr; /* memory allocation */ - dirac_onset_detection_state->onset_detector_1 = (float *) count_malloc( sizeof( float ) * num_protos_diff * dirac_onset_detection_params->max_band_decorr ); - dirac_onset_detection_state->onset_detector_2 = (float *) count_malloc( sizeof( float ) * num_protos_diff * dirac_onset_detection_params->max_band_decorr ); + dirac_onset_detection_state->onset_detector_1 = (float *) malloc( sizeof( float ) * num_protos_diff * dirac_onset_detection_params->max_band_decorr ); + dirac_onset_detection_state->onset_detector_2 = (float *) malloc( sizeof( float ) * num_protos_diff * dirac_onset_detection_params->max_band_decorr ); /* init to zero */ set_zero( dirac_onset_detection_state->onset_detector_1, num_protos_diff * dirac_onset_detection_params->max_band_decorr ); diff --git a/lib_dec/ivas_dirac_output_synthesis_cov.c b/lib_dec/ivas_dirac_output_synthesis_cov.c index decca3445234054923af2446157b98cd9329c2fc..0557cca61291e832de01439d151d7bab24997e14 100644 --- a/lib_dec/ivas_dirac_output_synthesis_cov.c +++ b/lib_dec/ivas_dirac_output_synthesis_cov.c @@ -48,7 +48,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" #include "rom_dec.h" @@ -80,15 +80,15 @@ void ivas_dirac_dec_output_synthesis_cov_open( /* buffer length and interpolator */ h_dirac_output_synthesis_params->alpha_synthesis = NULL; - h_dirac_output_synthesis_params->proto_matrix = (float *) count_malloc( nchan_out * nchan_in * sizeof( float ) ); + h_dirac_output_synthesis_params->proto_matrix = (float *) malloc( nchan_out * nchan_in * sizeof( float ) ); /* cov buffers */ for ( idx = 0; idx < num_param_bands; idx++ ) { - h_dirac_output_synthesis_state->cx_old[idx] = (float *) count_malloc( nchan_in * nchan_in * sizeof( float ) ); - h_dirac_output_synthesis_state->cy_old[idx] = (float *) count_malloc( nchan_out * nchan_out * sizeof( float ) ); - h_dirac_output_synthesis_state->mixing_matrix_old[idx] = (float *) count_malloc( nchan_out * nchan_in * sizeof( float ) ); + h_dirac_output_synthesis_state->cx_old[idx] = (float *) malloc( nchan_in * nchan_in * sizeof( float ) ); + h_dirac_output_synthesis_state->cy_old[idx] = (float *) malloc( nchan_out * nchan_out * sizeof( float ) ); + h_dirac_output_synthesis_state->mixing_matrix_old[idx] = (float *) malloc( nchan_out * nchan_in * sizeof( float ) ); set_zero( h_dirac_output_synthesis_state->cx_old[idx], nchan_in * nchan_in ); set_zero( h_dirac_output_synthesis_state->cy_old[idx], nchan_out * nchan_out ); set_zero( h_dirac_output_synthesis_state->mixing_matrix_old[idx], nchan_out * nchan_in ); @@ -101,7 +101,7 @@ void ivas_dirac_dec_output_synthesis_cov_open( } for ( idx = 0; idx < num_param_bands_residual; idx++ ) { - h_dirac_output_synthesis_state->mixing_matrix_res_old[idx] = (float *) count_malloc( nchan_out * nchan_out * sizeof( float ) ); + h_dirac_output_synthesis_state->mixing_matrix_res_old[idx] = (float *) malloc( nchan_out * nchan_out * sizeof( float ) ); set_zero( h_dirac_output_synthesis_state->mixing_matrix_res_old[idx], nchan_out * nchan_out ); } for ( ; idx < CLDFB_NO_CHANNELS_MAX; idx++ ) @@ -114,7 +114,7 @@ void ivas_dirac_dec_output_synthesis_cov_open( *-----------------------------------------------------------------*/ /* compute interpolator */ - h_dirac_output_synthesis_params->interpolator = (float *) count_malloc( interp_length * sizeof( float ) ); + h_dirac_output_synthesis_params->interpolator = (float *) malloc( interp_length * sizeof( float ) ); for ( idx = 1; idx <= interp_length; ++idx ) { h_dirac_output_synthesis_params->interpolator[idx - 1] = (float) idx / (float) interp_length; @@ -181,21 +181,21 @@ void ivas_dirac_dec_output_synthesis_cov_close( /* free interpolator */ if ( h_dirac_output_synthesis_params->interpolator != NULL ) { - count_free( h_dirac_output_synthesis_params->interpolator ); + free( h_dirac_output_synthesis_params->interpolator ); h_dirac_output_synthesis_params->interpolator = NULL; } /* free alpha */ if ( h_dirac_output_synthesis_params->alpha_synthesis != NULL ) { - count_free( h_dirac_output_synthesis_params->alpha_synthesis ); + free( h_dirac_output_synthesis_params->alpha_synthesis ); h_dirac_output_synthesis_params->alpha_synthesis = NULL; } /* free proto_matrix */ if ( h_dirac_output_synthesis_params->proto_matrix != NULL ) { - count_free( h_dirac_output_synthesis_params->proto_matrix ); + free( h_dirac_output_synthesis_params->proto_matrix ); h_dirac_output_synthesis_params->proto_matrix = NULL; } @@ -204,25 +204,25 @@ void ivas_dirac_dec_output_synthesis_cov_close( { if ( h_dirac_output_synthesis_state->cx_old[idx] != NULL ) { - count_free( h_dirac_output_synthesis_state->cx_old[idx] ); + free( h_dirac_output_synthesis_state->cx_old[idx] ); h_dirac_output_synthesis_state->cx_old[idx] = NULL; } if ( h_dirac_output_synthesis_state->cy_old[idx] != NULL ) { - count_free( h_dirac_output_synthesis_state->cy_old[idx] ); + free( h_dirac_output_synthesis_state->cy_old[idx] ); h_dirac_output_synthesis_state->cy_old[idx] = NULL; } if ( h_dirac_output_synthesis_state->mixing_matrix_old[idx] != NULL ) { - count_free( h_dirac_output_synthesis_state->mixing_matrix_old[idx] ); + free( h_dirac_output_synthesis_state->mixing_matrix_old[idx] ); h_dirac_output_synthesis_state->mixing_matrix_old[idx] = NULL; } if ( h_dirac_output_synthesis_state->mixing_matrix_res_old[idx] != NULL ) { - count_free( h_dirac_output_synthesis_state->mixing_matrix_res_old[idx] ); + free( h_dirac_output_synthesis_state->mixing_matrix_res_old[idx] ); h_dirac_output_synthesis_state->mixing_matrix_res_old[idx] = NULL; } } @@ -452,7 +452,7 @@ int16_t computeMixingMatrices( float mat_mult_buffer2[MAX_OUTPUT_CHANNELS * MAX_OUTPUT_CHANNELS]; float mat_mult_buffer3[MAX_OUTPUT_CHANNELS * MAX_OUTPUT_CHANNELS]; - wmops_sub_start( "dirac_cov_mix_mat" ); + push_wmops( "dirac_cov_mix_mat" ); set_zero( svd_s_buffer, MAX_OUTPUT_CHANNELS ); for ( i = 0; i < MAX_OUTPUT_CHANNELS; i++ ) @@ -665,7 +665,7 @@ int16_t computeMixingMatrices( mvr2r( mat_mult_buffer3, mixing_matrix, lengthCy * lengthCx ); } - wmops_sub_end(); + pop_wmops(); return out; } @@ -706,7 +706,7 @@ int16_t computeMixingMatricesResidual( float mat_mult_buffer2[MAX_OUTPUT_CHANNELS * MAX_OUTPUT_CHANNELS]; float mat_mult_buffer3[MAX_OUTPUT_CHANNELS * MAX_OUTPUT_CHANNELS]; - wmops_sub_start( "dirac_cov_mix_mat_r" ); + push_wmops( "dirac_cov_mix_mat_r" ); /*-----------------------------------------------------------------* * Decomposition of Cy @@ -864,7 +864,7 @@ int16_t computeMixingMatricesResidual( mvr2r( mat_mult_buffer3, mixing_matrix, lengthCy * lengthCx ); - wmops_sub_end(); + pop_wmops(); return out; } @@ -910,7 +910,7 @@ int16_t computeMixingMatricesISM( float mat_mult_buffer3[MAX_OUTPUT_CHANNELS * MAX_OUTPUT_CHANNELS]; int16_t nL, nC; - wmops_sub_start( "dirac_cov_mix_mat" ); + push_wmops( "dirac_cov_mix_mat" ); out = EXIT_SUCCESS; lengthCx = num_inputs; @@ -1047,7 +1047,7 @@ int16_t computeMixingMatricesISM( mvr2r( mat_mult_buffer3, mixing_matrix, lengthCy * lengthCx ); } - wmops_sub_end(); + pop_wmops(); return out; } diff --git a/lib_dec/ivas_dirac_output_synthesis_dec.c b/lib_dec/ivas_dirac_output_synthesis_dec.c index 79c04f824b6f86848acc0df1962ec1e35757d1fe..cf4dbcb071adb58b6a4d5c277a63c3fafb582016 100644 --- a/lib_dec/ivas_dirac_output_synthesis_dec.c +++ b/lib_dec/ivas_dirac_output_synthesis_dec.c @@ -44,7 +44,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------- * Local constants @@ -126,22 +126,22 @@ void ivas_dirac_dec_output_synthesis_open( dirac_output_synthesis_state->diffuse_responses_square = NULL; if ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_MONO ) { - dirac_output_synthesis_state->diffuse_responses_square = (float *) count_malloc( 2 * sizeof( float ) ); + dirac_output_synthesis_state->diffuse_responses_square = (float *) malloc( 2 * sizeof( float ) ); } else if ( hDirAC->synthesisConf != DIRAC_SYNTHESIS_GAIN_SHD ) { - dirac_output_synthesis_state->diffuse_responses_square = (float *) count_malloc( hDirAC->hOutSetup.nchan_out_woLFE * sizeof( float ) ); + dirac_output_synthesis_state->diffuse_responses_square = (float *) malloc( hDirAC->hOutSetup.nchan_out_woLFE * sizeof( float ) ); } /* prototype power buffers */ dirac_output_synthesis_state->proto_power_smooth_prev = NULL; if ( hDirAC->synthesisConf != DIRAC_SYNTHESIS_GAIN_SHD ) { - dirac_output_synthesis_state->proto_power_smooth_prev = (float *) count_malloc( hDirAC->num_freq_bands * hDirAC->num_protos_dir * sizeof( float ) ); + dirac_output_synthesis_state->proto_power_smooth_prev = (float *) malloc( hDirAC->num_freq_bands * hDirAC->num_protos_dir * sizeof( float ) ); } if ( dirac_output_synthesis_params->max_band_decorr > 0 && ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_PSD_LS || hDirAC->synthesisConf == DIRAC_SYNTHESIS_PSD_SHD ) ) { - dirac_output_synthesis_state->proto_power_diff_smooth_prev = (float *) count_malloc( dirac_output_synthesis_params->max_band_decorr * hDirAC->hOutSetup.nchan_out_woLFE * sizeof( float ) ); + dirac_output_synthesis_state->proto_power_diff_smooth_prev = (float *) malloc( dirac_output_synthesis_params->max_band_decorr * hDirAC->hOutSetup.nchan_out_woLFE * sizeof( float ) ); } else { @@ -149,41 +149,41 @@ void ivas_dirac_dec_output_synthesis_open( } /* buffer length and interpolator */ - dirac_output_synthesis_params->interpolator = (float *) count_malloc( hDirAC->subframe_nbslots * sizeof( float ) ); + dirac_output_synthesis_params->interpolator = (float *) malloc( hDirAC->subframe_nbslots * sizeof( float ) ); /* target PSD buffers */ - dirac_output_synthesis_state->cy_cross_dir_smooth_prev = (float *) count_malloc( hDirAC->num_freq_bands * hDirAC->num_outputs_dir * sizeof( float ) ); + dirac_output_synthesis_state->cy_cross_dir_smooth_prev = (float *) malloc( hDirAC->num_freq_bands * hDirAC->num_outputs_dir * sizeof( float ) ); if ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) { dirac_output_synthesis_state->cy_auto_dir_smooth_prev = NULL; - dirac_output_synthesis_state->cy_auto_diff_smooth_prev = (float *) count_malloc( dirac_output_synthesis_params->max_band_decorr * hDirAC->num_outputs_diff * sizeof( float ) ); + dirac_output_synthesis_state->cy_auto_diff_smooth_prev = (float *) malloc( dirac_output_synthesis_params->max_band_decorr * hDirAC->num_outputs_diff * sizeof( float ) ); } else { - dirac_output_synthesis_state->cy_auto_dir_smooth_prev = (float *) count_malloc( hDirAC->num_freq_bands * hDirAC->num_outputs_dir * sizeof( float ) ); + dirac_output_synthesis_state->cy_auto_dir_smooth_prev = (float *) malloc( hDirAC->num_freq_bands * hDirAC->num_outputs_dir * sizeof( float ) ); if ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_PSD_SHD ) { - dirac_output_synthesis_state->cy_auto_diff_smooth_prev = (float *) count_malloc( hDirAC->num_freq_bands * hDirAC->num_outputs_dir * sizeof( float ) ); + dirac_output_synthesis_state->cy_auto_diff_smooth_prev = (float *) malloc( hDirAC->num_freq_bands * hDirAC->num_outputs_dir * sizeof( float ) ); } else { - dirac_output_synthesis_state->cy_auto_diff_smooth_prev = (float *) count_malloc( hDirAC->num_freq_bands * hDirAC->num_outputs_diff * sizeof( float ) ); + dirac_output_synthesis_state->cy_auto_diff_smooth_prev = (float *) malloc( hDirAC->num_freq_bands * hDirAC->num_outputs_diff * sizeof( float ) ); } } /* direct and diffuse gain buffers */ - dirac_output_synthesis_state->gains_dir_prev = (float *) count_malloc( hDirAC->num_freq_bands * hDirAC->num_outputs_dir * sizeof( float ) ); + dirac_output_synthesis_state->gains_dir_prev = (float *) malloc( hDirAC->num_freq_bands * hDirAC->num_outputs_dir * sizeof( float ) ); if ( hDirAC->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) { - dirac_output_synthesis_state->gains_diff_prev = (float *) count_malloc( dirac_output_synthesis_params->max_band_decorr * hDirAC->num_outputs_diff * sizeof( float ) ); + dirac_output_synthesis_state->gains_diff_prev = (float *) malloc( dirac_output_synthesis_params->max_band_decorr * hDirAC->num_outputs_diff * sizeof( float ) ); } else if ( hDirAC->synthesisConf != DIRAC_SYNTHESIS_PSD_SHD && hDirAC->synthesisConf != DIRAC_SYNTHESIS_MONO ) { - dirac_output_synthesis_state->gains_diff_prev = (float *) count_malloc( hDirAC->num_freq_bands * hDirAC->num_outputs_diff * sizeof( float ) ); + dirac_output_synthesis_state->gains_diff_prev = (float *) malloc( hDirAC->num_freq_bands * hDirAC->num_outputs_diff * sizeof( float ) ); } else { - dirac_output_synthesis_state->gains_diff_prev = (float *) count_malloc( hDirAC->num_freq_bands * hDirAC->num_outputs_dir * sizeof( float ) ); + dirac_output_synthesis_state->gains_diff_prev = (float *) malloc( hDirAC->num_freq_bands * hDirAC->num_outputs_dir * sizeof( float ) ); } /*-----------------------------------------------------------------* @@ -194,15 +194,15 @@ void ivas_dirac_dec_output_synthesis_open( if ( !( renderer_type == RENDERER_BINAURAL_PARAMETRIC || renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || hDirAC->synthesisConf == DIRAC_SYNTHESIS_GAIN_SHD ) ) { computeAlphaSynthesis( temp_alpha_synthesis, DIRAC_AVG_LENGTH_SYNTH_MS, DIRAC_ALPHA_MAX, &dirac_output_synthesis_params->numAlphas, hDirAC->slot_size, hDirAC->num_freq_bands, hDirAC->frequency_axis, output_Fs ); - dirac_output_synthesis_params->alpha_synthesis = (float *) count_malloc( dirac_output_synthesis_params->numAlphas * sizeof( float ) ); + dirac_output_synthesis_params->alpha_synthesis = (float *) malloc( dirac_output_synthesis_params->numAlphas * sizeof( float ) ); mvr2r( temp_alpha_synthesis, dirac_output_synthesis_params->alpha_synthesis, dirac_output_synthesis_params->numAlphas ); computeAlphaSynthesis( temp_alpha_synthesis, DIRAC_AVG_LENGTH_SYNTH_MS_FAST, DIRAC_ALPHA_MAX_FAST, &dirac_output_synthesis_params->numAlphasFast, hDirAC->slot_size, hDirAC->num_freq_bands, hDirAC->frequency_axis, output_Fs ); - dirac_output_synthesis_params->alpha_synthesis_fast = (float *) count_malloc( dirac_output_synthesis_params->numAlphasFast * sizeof( float ) ); + dirac_output_synthesis_params->alpha_synthesis_fast = (float *) malloc( dirac_output_synthesis_params->numAlphasFast * sizeof( float ) ); mvr2r( temp_alpha_synthesis, dirac_output_synthesis_params->alpha_synthesis_fast, dirac_output_synthesis_params->numAlphasFast ); - dirac_output_synthesis_state->reference_power_smooth_prev = (float *) count_malloc( hDirAC->num_freq_bands * sizeof( float ) ); - dirac_output_synthesis_state->direction_smoothness_prev = (float *) count_malloc( hDirAC->num_freq_bands * sizeof( float ) ); + dirac_output_synthesis_state->reference_power_smooth_prev = (float *) malloc( hDirAC->num_freq_bands * sizeof( float ) ); + dirac_output_synthesis_state->direction_smoothness_prev = (float *) malloc( hDirAC->num_freq_bands * sizeof( float ) ); set_zero( dirac_output_synthesis_state->reference_power_smooth_prev, hDirAC->num_freq_bands ); set_zero( dirac_output_synthesis_state->direction_smoothness_prev, hDirAC->num_freq_bands ); } @@ -367,79 +367,79 @@ void ivas_dirac_dec_output_synthesis_close( /* free interpolator */ if ( ( dirac_output_synthesis_params )->interpolator != NULL ) { - count_free( ( dirac_output_synthesis_params )->interpolator ); + free( ( dirac_output_synthesis_params )->interpolator ); ( dirac_output_synthesis_params )->interpolator = NULL; } /* free alpha */ if ( ( dirac_output_synthesis_params )->alpha_synthesis != NULL ) { - count_free( ( dirac_output_synthesis_params )->alpha_synthesis ); + free( ( dirac_output_synthesis_params )->alpha_synthesis ); ( dirac_output_synthesis_params )->alpha_synthesis = NULL; } if ( ( dirac_output_synthesis_params )->alpha_synthesis_fast != NULL ) { - count_free( ( dirac_output_synthesis_params )->alpha_synthesis_fast ); + free( ( dirac_output_synthesis_params )->alpha_synthesis_fast ); ( dirac_output_synthesis_params )->alpha_synthesis_fast = NULL; } if ( ( dirac_output_synthesis_state )->reference_power_smooth_prev != NULL ) { - count_free( ( dirac_output_synthesis_state )->reference_power_smooth_prev ); + free( ( dirac_output_synthesis_state )->reference_power_smooth_prev ); ( dirac_output_synthesis_state )->reference_power_smooth_prev = NULL; } if ( ( dirac_output_synthesis_state )->direction_smoothness_prev != NULL ) { - count_free( ( dirac_output_synthesis_state )->direction_smoothness_prev ); + free( ( dirac_output_synthesis_state )->direction_smoothness_prev ); ( dirac_output_synthesis_state )->direction_smoothness_prev = NULL; } if ( ( dirac_output_synthesis_state )->diffuse_responses_square != NULL ) { - count_free( ( dirac_output_synthesis_state )->diffuse_responses_square ); + free( ( dirac_output_synthesis_state )->diffuse_responses_square ); ( dirac_output_synthesis_state )->diffuse_responses_square = NULL; } /* free power buffers */ if ( ( dirac_output_synthesis_state )->proto_power_smooth_prev != NULL ) { - count_free( ( dirac_output_synthesis_state )->proto_power_smooth_prev ); + free( ( dirac_output_synthesis_state )->proto_power_smooth_prev ); ( dirac_output_synthesis_state )->proto_power_smooth_prev = NULL; } if ( ( dirac_output_synthesis_state )->proto_power_diff_smooth_prev != NULL ) { - count_free( ( dirac_output_synthesis_state )->proto_power_diff_smooth_prev ); + free( ( dirac_output_synthesis_state )->proto_power_diff_smooth_prev ); ( dirac_output_synthesis_state )->proto_power_diff_smooth_prev = NULL; } /* free target power buffers */ if ( ( dirac_output_synthesis_state )->cy_auto_dir_smooth_prev != NULL ) { - count_free( ( dirac_output_synthesis_state )->cy_auto_dir_smooth_prev ); + free( ( dirac_output_synthesis_state )->cy_auto_dir_smooth_prev ); ( dirac_output_synthesis_state )->cy_auto_dir_smooth_prev = NULL; } if ( ( dirac_output_synthesis_state )->cy_cross_dir_smooth_prev != NULL ) { - count_free( ( dirac_output_synthesis_state )->cy_cross_dir_smooth_prev ); + free( ( dirac_output_synthesis_state )->cy_cross_dir_smooth_prev ); ( dirac_output_synthesis_state )->cy_cross_dir_smooth_prev = NULL; } if ( ( dirac_output_synthesis_state )->cy_auto_diff_smooth_prev != NULL ) { - count_free( ( dirac_output_synthesis_state )->cy_auto_diff_smooth_prev ); + free( ( dirac_output_synthesis_state )->cy_auto_diff_smooth_prev ); ( dirac_output_synthesis_state )->cy_auto_diff_smooth_prev = NULL; } /* free gain buffers */ if ( ( dirac_output_synthesis_state )->gains_dir_prev != NULL ) { - count_free( ( dirac_output_synthesis_state )->gains_dir_prev ); + free( ( dirac_output_synthesis_state )->gains_dir_prev ); ( dirac_output_synthesis_state )->gains_dir_prev = NULL; } if ( ( dirac_output_synthesis_state )->gains_diff_prev != NULL ) { - count_free( ( dirac_output_synthesis_state )->gains_diff_prev ); + free( ( dirac_output_synthesis_state )->gains_diff_prev ); ( dirac_output_synthesis_state )->gains_diff_prev = NULL; } @@ -945,7 +945,7 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls( int16_t alphaMaxBin; int16_t alphaMaxBinFast; - wmops_sub_start( "dirac_out_synth_sfr" ); + push_wmops( "dirac_out_synth_sfr" ); h_dirac_output_synthesis_params = &( hDirAC->h_output_synthesis_psd_params ); h_dirac_output_synthesis_state = &( hDirAC->h_output_synthesis_psd_state ); @@ -1248,7 +1248,7 @@ void ivas_dirac_dec_output_synthesis_process_subframe_psd_ls( set_zero( h_dirac_output_synthesis_state->cy_cross_dir_smooth, num_freq_bands * nchan_out_woLFE ); set_zero( h_dirac_output_synthesis_state->cy_auto_diff_smooth, num_freq_bands * nchan_out_woLFE ); - wmops_sub_end(); + pop_wmops(); return; } @@ -1277,7 +1277,7 @@ static void ivas_dirac_dec_get_response_split_order( float dv_0, dv_1, dv_2, dv_r_0, dv_r_1, dv_r_2; float w; - wmops_sub_start( "ivas_dirac_dec_get_response_split_order" ); + push_wmops( "ivas_dirac_dec_get_response_split_order" ); index_azimuth = ( azimuth + 180 ) % 360; index_elevation = elevation + 90; @@ -1411,7 +1411,7 @@ static void ivas_dirac_dec_get_response_split_order( response[b] = c; } - wmops_sub_end(); + pop_wmops(); return; } diff --git a/lib_dec/ivas_entropy_decoder.c b/lib_dec/ivas_entropy_decoder.c index cc3fab86567c8fdc971b544e572e5ee51df479da..f9d63ddee9b6c423e4873cf74ac1a4627efe5dd2 100644 --- a/lib_dec/ivas_entropy_decoder.c +++ b/lib_dec/ivas_entropy_decoder.c @@ -40,7 +40,7 @@ #endif #include "ivas_rom_com.h" #include -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------------------------* diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 35d8ecf183e93ebf10927c4307f3a60e44500fa7..dae674f2866ae7093b33ddd24d5ca2f0232215d2 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -43,7 +43,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* @@ -1167,7 +1167,7 @@ ivas_error ivas_init_decoder( if ( n > 0 ) { - if ( ( st_ivas->mem_hp20_out = (float **) count_malloc( n * sizeof( float * ) ) ) == NULL ) + if ( ( st_ivas->mem_hp20_out = (float **) malloc( n * sizeof( float * ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HP20 filter memory\n" ) ); } @@ -1179,7 +1179,7 @@ ivas_error ivas_init_decoder( for ( i = 0; i < n; i++ ) { - if ( ( st_ivas->mem_hp20_out[i] = (float *) count_malloc( L_HP20_MEM * sizeof( float ) ) ) == NULL ) + if ( ( st_ivas->mem_hp20_out[i] = (float *) malloc( L_HP20_MEM * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HP20 filter memory\n" ) ); } @@ -1215,7 +1215,7 @@ ivas_error ivas_init_decoder( if ( st_ivas->hRenderConfig->roomAcoustics.late_reverb_on ) { - if ( ( st_ivas->hCrend = (CREND_HANDLE) count_malloc( sizeof( CREND_DATA ) ) ) == NULL ) + if ( ( st_ivas->hCrend = (CREND_HANDLE) malloc( sizeof( CREND_DATA ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR Crend\n" ); } @@ -1361,127 +1361,127 @@ void destroy_core_dec( if ( hCoreCoder->hGSCDec != NULL ) { - count_free( hCoreCoder->hGSCDec ); + free( hCoreCoder->hGSCDec ); hCoreCoder->hGSCDec = NULL; } if ( hCoreCoder->hPFstat != NULL ) { - count_free( hCoreCoder->hPFstat ); + free( hCoreCoder->hPFstat ); hCoreCoder->hPFstat = NULL; } if ( hCoreCoder->hMusicPF != NULL ) { - count_free( hCoreCoder->hMusicPF ); + free( hCoreCoder->hMusicPF ); hCoreCoder->hMusicPF = NULL; } if ( hCoreCoder->hBPF != NULL ) { - count_free( hCoreCoder->hBPF ); + free( hCoreCoder->hBPF ); hCoreCoder->hBPF = NULL; } if ( hCoreCoder->hBWE_zero != NULL ) { - count_free( hCoreCoder->hBWE_zero ); + free( hCoreCoder->hBWE_zero ); hCoreCoder->hBWE_zero = NULL; } if ( hCoreCoder->hTdCngDec != NULL ) { - count_free( hCoreCoder->hTdCngDec ); + free( hCoreCoder->hTdCngDec ); hCoreCoder->hTdCngDec = NULL; } if ( hCoreCoder->hSC_VBR != NULL ) { - count_free( hCoreCoder->hSC_VBR ); + free( hCoreCoder->hSC_VBR ); hCoreCoder->hSC_VBR = NULL; } if ( hCoreCoder->hAmrwb_IO != NULL ) { - count_free( hCoreCoder->hAmrwb_IO ); + free( hCoreCoder->hAmrwb_IO ); hCoreCoder->hAmrwb_IO = NULL; } if ( hCoreCoder->hBWE_TD != NULL ) { - count_free( hCoreCoder->hBWE_TD ); + free( hCoreCoder->hBWE_TD ); hCoreCoder->hBWE_TD = NULL; } if ( hCoreCoder->hBWE_FD != NULL ) { - count_free( hCoreCoder->hBWE_FD ); + free( hCoreCoder->hBWE_FD ); hCoreCoder->hBWE_FD = NULL; } if ( hCoreCoder->hBWE_FD_HR != NULL ) { - count_free( hCoreCoder->hBWE_FD_HR ); + free( hCoreCoder->hBWE_FD_HR ); hCoreCoder->hBWE_FD_HR = NULL; } if ( hCoreCoder->hWIDec != NULL ) { - count_free( hCoreCoder->hWIDec ); + free( hCoreCoder->hWIDec ); hCoreCoder->hWIDec = NULL; } if ( hCoreCoder->hTECDec != NULL ) { - count_free( hCoreCoder->hTECDec ); + free( hCoreCoder->hTECDec ); hCoreCoder->hTECDec = NULL; } if ( hCoreCoder->hTcxLtpDec != NULL ) { - count_free( hCoreCoder->hTcxLtpDec ); + free( hCoreCoder->hTcxLtpDec ); hCoreCoder->hTcxLtpDec = NULL; } if ( hCoreCoder->hTcxDec != NULL ) { - count_free( hCoreCoder->hTcxDec ); + free( hCoreCoder->hTcxDec ); hCoreCoder->hTcxDec = NULL; } if ( hCoreCoder->hTcxCfg != NULL && hCoreCoder->mct_chan_mode != MCT_CHAN_MODE_LFE ) { - count_free( hCoreCoder->hTcxCfg ); + free( hCoreCoder->hTcxCfg ); hCoreCoder->hTcxCfg = NULL; } if ( hCoreCoder->hTonalMDCTConc != NULL ) { - count_free( hCoreCoder->hTonalMDCTConc ); + free( hCoreCoder->hTonalMDCTConc ); hCoreCoder->hTonalMDCTConc = NULL; } if ( hCoreCoder->hIGFDec != NULL ) { - count_free( hCoreCoder->hIGFDec ); + free( hCoreCoder->hIGFDec ); hCoreCoder->hIGFDec = NULL; } if ( hCoreCoder->hPlcInfo != NULL ) { - count_free( hCoreCoder->hPlcInfo ); + free( hCoreCoder->hPlcInfo ); hCoreCoder->hPlcInfo = NULL; } if ( hCoreCoder->hHQ_core != NULL ) { - count_free( hCoreCoder->hHQ_core ); + free( hCoreCoder->hHQ_core ); hCoreCoder->hHQ_core = NULL; } if ( hCoreCoder->hHQ_nbfec != NULL ) { - count_free( hCoreCoder->hHQ_nbfec ); + free( hCoreCoder->hHQ_nbfec ); hCoreCoder->hHQ_nbfec = NULL; } @@ -1633,10 +1633,10 @@ void ivas_destroy_dec( { for ( i = 0; i < getNumChanSynthesis( st_ivas ); i++ ) { - count_free( st_ivas->mem_hp20_out[i] ); + free( st_ivas->mem_hp20_out[i] ); st_ivas->mem_hp20_out[i] = NULL; } - count_free( st_ivas->mem_hp20_out ); + free( st_ivas->mem_hp20_out ); st_ivas->mem_hp20_out = NULL; } @@ -1645,7 +1645,7 @@ void ivas_destroy_dec( { if ( st_ivas->hIsmMetaData[n] != NULL ) { - count_free( st_ivas->hIsmMetaData[n] ); + free( st_ivas->hIsmMetaData[n] ); st_ivas->hIsmMetaData[n] = NULL; } } @@ -1653,7 +1653,7 @@ void ivas_destroy_dec( /* ISm renderer handle */ if ( st_ivas->hIsmRendererData != NULL ) { - count_free( st_ivas->hIsmRendererData ); + free( st_ivas->hIsmRendererData ); st_ivas->hIsmRendererData = NULL; } @@ -1681,7 +1681,7 @@ void ivas_destroy_dec( /* HOA decoder matrix */ if ( st_ivas->hoa_dec_mtx != NULL ) { - count_free( st_ivas->hoa_dec_mtx ); + free( st_ivas->hoa_dec_mtx ); st_ivas->hoa_dec_mtx = NULL; } @@ -1715,7 +1715,7 @@ void ivas_destroy_dec( /* Custom LS configuration handle */ if ( st_ivas->hLsSetupCustom != NULL ) { - count_free( st_ivas->hLsSetupCustom ); + free( st_ivas->hLsSetupCustom ); st_ivas->hLsSetupCustom = NULL; } @@ -1729,14 +1729,14 @@ void ivas_destroy_dec( /* Downmix structure */ if ( st_ivas->hMonoDmxRenderer != NULL ) { - count_free( st_ivas->hMonoDmxRenderer ); + free( st_ivas->hMonoDmxRenderer ); st_ivas->hMonoDmxRenderer = NULL; } /* Head track data handle */ if ( st_ivas->hHeadTrackData != NULL ) { - count_free( st_ivas->hHeadTrackData ); + free( st_ivas->hHeadTrackData ); st_ivas->hHeadTrackData = NULL; } @@ -1766,12 +1766,12 @@ void ivas_destroy_dec( if ( st_ivas->hDecoderConfig != NULL ) { - count_free( st_ivas->hDecoderConfig ); + free( st_ivas->hDecoderConfig ); st_ivas->hDecoderConfig = NULL; } /* main IVAS handle */ - count_free( st_ivas ); + free( st_ivas ); return; } diff --git a/lib_dec/ivas_ism_metadata_dec.c b/lib_dec/ivas_ism_metadata_dec.c index 6b9f8ec8ba52beb496a7d9f318476e8bfb48a426..7a5731a286444a652f205ee56218f9853d9684f2 100644 --- a/lib_dec/ivas_ism_metadata_dec.c +++ b/lib_dec/ivas_ism_metadata_dec.c @@ -40,7 +40,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------------* @@ -76,7 +76,7 @@ ivas_error ivas_ism_metadata_dec( error = IVAS_ERR_OK; - wmops_sub_start( "ism_meta_dec" ); + push_wmops( "ism_meta_dec" ); if ( ism_total_brate == IVAS_SID_5k2 || ism_total_brate == FRAME_NO_DATA ) { @@ -97,7 +97,7 @@ ivas_error ivas_ism_metadata_dec( } #endif - wmops_sub_end(); + pop_wmops(); return error; } @@ -499,7 +499,7 @@ ivas_error ivas_ism_metadata_dec( hSCE[ch]->hCoreCoder[0]->bit_stream = hSCE[ch - 1]->hCoreCoder[0]->bit_stream + ( hSCE[ch - 1]->hCoreCoder[0]->total_brate / FRAMES_PER_SEC ); } - wmops_sub_end(); + pop_wmops(); return error; } @@ -522,7 +522,7 @@ ivas_error create_ism_metadata_dec( /* allocate ISm metadata handles */ for ( ch = 0; ch < MAX_NUM_OBJECTS; ch++ ) { - if ( ( st_ivas->hIsmMetaData[ch] = (ISM_METADATA_HANDLE) count_malloc( sizeof( ISM_METADATA_FRAME ) ) ) == NULL ) + if ( ( st_ivas->hIsmMetaData[ch] = (ISM_METADATA_HANDLE) malloc( sizeof( ISM_METADATA_FRAME ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ISm MetaData\n" ) ); } diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index aa2fcaed6bae6ae6a5bfc8b8a95b8d7c7791895d..095cd89f642cefbaa816606bc12673d458bee4ef 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -41,7 +41,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------------* @@ -326,11 +326,11 @@ static ivas_error ivas_param_ism_rendering_init( } /* memory allocation for proto matrix and interpolator */ - if ( ( hParamIsmRendering->proto_matrix = (float *) count_malloc( hOutSetup.nchan_out_woLFE * nchan_transport * sizeof( float ) ) ) == NULL ) + if ( ( hParamIsmRendering->proto_matrix = (float *) malloc( hOutSetup.nchan_out_woLFE * nchan_transport * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for proto matrix\n" ) ); } - if ( ( hParamIsmRendering->interpolator = (float *) count_malloc( subframe_nbslots * sizeof( float ) ) ) == NULL ) + if ( ( hParamIsmRendering->interpolator = (float *) malloc( subframe_nbslots * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for interpolator\n" ) ); } @@ -398,24 +398,24 @@ ivas_error ivas_param_ism_dec_open( error = IVAS_ERR_OK; - wmops_sub_start( "ivas_param_ism_dec_open" ); + push_wmops( "ivas_param_ism_dec_open" ); /*-----------------------------------------------------------------* * prepare library opening *-----------------------------------------------------------------*/ - if ( ( hDirAC = (DIRAC_DEC_HANDLE) count_malloc( sizeof( DIRAC_DEC_DATA ) ) ) == NULL ) + if ( ( hDirAC = (DIRAC_DEC_HANDLE) malloc( sizeof( DIRAC_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); } /* Assign memory to Param Object handle */ - if ( ( hDirAC->hParamIsm = (PARAM_ISM_CONFIG_HANDLE) count_malloc( sizeof( PARAM_ISM_CONFIG_DATA ) ) ) == NULL ) + if ( ( hDirAC->hParamIsm = (PARAM_ISM_CONFIG_HANDLE) malloc( sizeof( PARAM_ISM_CONFIG_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM\n" ) ); } - if ( ( hDirAC->hParamIsmRendering = (PARAM_ISM_RENDERING_HANDLE) count_malloc( sizeof( PARAM_ISM_RENDERING_DATA ) ) ) == NULL ) + if ( ( hDirAC->hParamIsmRendering = (PARAM_ISM_RENDERING_HANDLE) malloc( sizeof( PARAM_ISM_RENDERING_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM Rendering handle\n" ) ); } @@ -500,41 +500,41 @@ ivas_error ivas_param_ism_dec_open( if ( ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM ) ) { hDirAC->dirac_md_buffer_length = MAX_PARAM_SPATIAL_SUBFRAMES; - hDirAC->azimuth = (int16_t **) count_malloc( hDirAC->dirac_md_buffer_length * sizeof( int16_t * ) ); - hDirAC->elevation = (int16_t **) count_malloc( hDirAC->dirac_md_buffer_length * sizeof( int16_t * ) ); - hDirAC->azimuth2 = (int16_t **) count_malloc( hDirAC->dirac_md_buffer_length * sizeof( int16_t * ) ); - hDirAC->elevation2 = (int16_t **) count_malloc( hDirAC->dirac_md_buffer_length * sizeof( int16_t * ) ); - hDirAC->energy_ratio1 = (float **) count_malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ); - hDirAC->spreadCoherence = (float **) count_malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ); - hDirAC->energy_ratio2 = (float **) count_malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ); - hDirAC->spreadCoherence2 = (float **) count_malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ); - hDirAC->surroundingCoherence = (float **) count_malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ); + hDirAC->azimuth = (int16_t **) malloc( hDirAC->dirac_md_buffer_length * sizeof( int16_t * ) ); + hDirAC->elevation = (int16_t **) malloc( hDirAC->dirac_md_buffer_length * sizeof( int16_t * ) ); + hDirAC->azimuth2 = (int16_t **) malloc( hDirAC->dirac_md_buffer_length * sizeof( int16_t * ) ); + hDirAC->elevation2 = (int16_t **) malloc( hDirAC->dirac_md_buffer_length * sizeof( int16_t * ) ); + hDirAC->energy_ratio1 = (float **) malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ); + hDirAC->spreadCoherence = (float **) malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ); + hDirAC->energy_ratio2 = (float **) malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ); + hDirAC->spreadCoherence2 = (float **) malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ); + hDirAC->surroundingCoherence = (float **) malloc( hDirAC->dirac_md_buffer_length * sizeof( float * ) ); for ( i = 0; i < hDirAC->dirac_md_buffer_length; i++ ) { - hDirAC->azimuth[i] = (int16_t *) count_malloc( hDirAC->num_freq_bands * sizeof( int16_t ) ); + hDirAC->azimuth[i] = (int16_t *) malloc( hDirAC->num_freq_bands * sizeof( int16_t ) ); set_s( hDirAC->azimuth[i], 0, hDirAC->num_freq_bands ); - hDirAC->elevation[i] = (int16_t *) count_malloc( hDirAC->num_freq_bands * sizeof( int16_t ) ); + hDirAC->elevation[i] = (int16_t *) malloc( hDirAC->num_freq_bands * sizeof( int16_t ) ); set_s( hDirAC->elevation[i], 0, hDirAC->num_freq_bands ); - hDirAC->azimuth2[i] = (int16_t *) count_malloc( hDirAC->num_freq_bands * sizeof( int16_t ) ); + hDirAC->azimuth2[i] = (int16_t *) malloc( hDirAC->num_freq_bands * sizeof( int16_t ) ); set_s( hDirAC->azimuth2[i], 0, hDirAC->num_freq_bands ); - hDirAC->elevation2[i] = (int16_t *) count_malloc( hDirAC->num_freq_bands * sizeof( int16_t ) ); + hDirAC->elevation2[i] = (int16_t *) malloc( hDirAC->num_freq_bands * sizeof( int16_t ) ); set_s( hDirAC->elevation2[i], 0, hDirAC->num_freq_bands ); - hDirAC->energy_ratio1[i] = (float *) count_malloc( hDirAC->num_freq_bands * sizeof( float ) ); + hDirAC->energy_ratio1[i] = (float *) malloc( hDirAC->num_freq_bands * sizeof( float ) ); set_f( hDirAC->energy_ratio1[i], 0.0f, hDirAC->num_freq_bands ); - hDirAC->spreadCoherence[i] = (float *) count_malloc( hDirAC->num_freq_bands * sizeof( float ) ); + hDirAC->spreadCoherence[i] = (float *) malloc( hDirAC->num_freq_bands * sizeof( float ) ); set_f( hDirAC->spreadCoherence[i], 0.0f, hDirAC->num_freq_bands ); - hDirAC->energy_ratio2[i] = (float *) count_malloc( hDirAC->num_freq_bands * sizeof( float ) ); + hDirAC->energy_ratio2[i] = (float *) malloc( hDirAC->num_freq_bands * sizeof( float ) ); set_f( hDirAC->energy_ratio2[i], 0.0f, hDirAC->num_freq_bands ); - hDirAC->spreadCoherence2[i] = (float *) count_malloc( hDirAC->num_freq_bands * sizeof( float ) ); + hDirAC->spreadCoherence2[i] = (float *) malloc( hDirAC->num_freq_bands * sizeof( float ) ); set_f( hDirAC->spreadCoherence2[i], 0.0f, hDirAC->num_freq_bands ); - hDirAC->surroundingCoherence[i] = (float *) count_malloc( hDirAC->num_freq_bands * sizeof( float ) ); + hDirAC->surroundingCoherence[i] = (float *) malloc( hDirAC->num_freq_bands * sizeof( float ) ); set_f( hDirAC->surroundingCoherence[i], 0.0f, hDirAC->num_freq_bands ); } } st_ivas->hDirAC = hDirAC; - wmops_sub_end(); + pop_wmops(); return error; } @@ -555,7 +555,7 @@ void ivas_param_ism_dec_close( /* Config & CLDFB */ if ( hDirAC->hParamIsm != NULL ) { - count_free( hDirAC->hParamIsm ); + free( hDirAC->hParamIsm ); hDirAC->hParamIsm = NULL; } @@ -565,25 +565,25 @@ void ivas_param_ism_dec_close( { if ( hDirAC->azimuth[i] != NULL ) { - count_free( hDirAC->azimuth[i] ); + free( hDirAC->azimuth[i] ); hDirAC->azimuth[i] = NULL; } if ( hDirAC->elevation[i] != NULL ) { - count_free( hDirAC->elevation[i] ); + free( hDirAC->elevation[i] ); hDirAC->elevation[i] = NULL; } } if ( hDirAC->azimuth != NULL ) { - count_free( hDirAC->azimuth ); + free( hDirAC->azimuth ); hDirAC->azimuth = NULL; } if ( hDirAC->elevation != NULL ) { - count_free( hDirAC->elevation ); + free( hDirAC->elevation ); hDirAC->elevation = NULL; } @@ -593,11 +593,11 @@ void ivas_param_ism_dec_close( { if ( hDirAC->azimuth2[i] != NULL ) { - count_free( hDirAC->azimuth2[i] ); + free( hDirAC->azimuth2[i] ); hDirAC->azimuth2[i] = NULL; } } - count_free( hDirAC->azimuth2 ); + free( hDirAC->azimuth2 ); hDirAC->azimuth2 = NULL; } @@ -607,11 +607,11 @@ void ivas_param_ism_dec_close( { if ( hDirAC->elevation2[i] != NULL ) { - count_free( hDirAC->elevation2[i] ); + free( hDirAC->elevation2[i] ); hDirAC->elevation2[i] = NULL; } } - count_free( hDirAC->elevation2 ); + free( hDirAC->elevation2 ); hDirAC->elevation2 = NULL; } @@ -621,11 +621,11 @@ void ivas_param_ism_dec_close( { if ( hDirAC->energy_ratio1[i] != NULL ) { - count_free( hDirAC->energy_ratio1[i] ); + free( hDirAC->energy_ratio1[i] ); hDirAC->energy_ratio1[i] = NULL; } } - count_free( hDirAC->energy_ratio1 ); + free( hDirAC->energy_ratio1 ); hDirAC->energy_ratio1 = NULL; } @@ -635,11 +635,11 @@ void ivas_param_ism_dec_close( { if ( hDirAC->energy_ratio2[i] != NULL ) { - count_free( hDirAC->energy_ratio2[i] ); + free( hDirAC->energy_ratio2[i] ); hDirAC->energy_ratio2[i] = NULL; } } - count_free( hDirAC->energy_ratio2 ); + free( hDirAC->energy_ratio2 ); hDirAC->energy_ratio2 = NULL; } @@ -649,11 +649,11 @@ void ivas_param_ism_dec_close( { if ( hDirAC->spreadCoherence[i] != NULL ) { - count_free( hDirAC->spreadCoherence[i] ); + free( hDirAC->spreadCoherence[i] ); hDirAC->spreadCoherence[i] = NULL; } } - count_free( hDirAC->spreadCoherence ); + free( hDirAC->spreadCoherence ); hDirAC->spreadCoherence = NULL; } @@ -663,11 +663,11 @@ void ivas_param_ism_dec_close( { if ( hDirAC->spreadCoherence2[i] != NULL ) { - count_free( hDirAC->spreadCoherence2[i] ); + free( hDirAC->spreadCoherence2[i] ); hDirAC->spreadCoherence2[i] = NULL; } } - count_free( hDirAC->spreadCoherence2 ); + free( hDirAC->spreadCoherence2 ); hDirAC->spreadCoherence2 = NULL; } @@ -677,11 +677,11 @@ void ivas_param_ism_dec_close( { if ( hDirAC->surroundingCoherence[i] != NULL ) { - count_free( hDirAC->surroundingCoherence[i] ); + free( hDirAC->surroundingCoherence[i] ); hDirAC->surroundingCoherence[i] = NULL; } } - count_free( hDirAC->surroundingCoherence ); + free( hDirAC->surroundingCoherence ); hDirAC->surroundingCoherence = NULL; } } @@ -691,23 +691,23 @@ void ivas_param_ism_dec_close( /* Param ISM Rendering */ if ( hDirAC->hParamIsmRendering->interpolator != NULL ) { - count_free( hDirAC->hParamIsmRendering->interpolator ); + free( hDirAC->hParamIsmRendering->interpolator ); hDirAC->hParamIsmRendering->interpolator = NULL; } if ( hDirAC->hParamIsmRendering->proto_matrix != NULL ) { - count_free( hDirAC->hParamIsmRendering->proto_matrix ); + free( hDirAC->hParamIsmRendering->proto_matrix ); hDirAC->hParamIsmRendering->proto_matrix = NULL; } } if ( hDirAC->hParamIsmRendering != NULL ) { - count_free( hDirAC->hParamIsmRendering ); + free( hDirAC->hParamIsmRendering ); hDirAC->hParamIsmRendering = NULL; } - count_free( hDirAC ); + free( hDirAC ); return; } @@ -764,7 +764,7 @@ void ivas_param_ism_dec( hSetup = st_ivas->hIntSetup; - wmops_sub_start( "ivas_param_ism_dec" ); + push_wmops( "ivas_param_ism_dec" ); /* Frame-level Processing */ /* De-quantization */ @@ -915,7 +915,7 @@ void ivas_param_ism_dec( st_ivas->hIsmMetaData[ch]->elevation = st_ivas->hDirAC->elevation_values[ch]; } - wmops_sub_end(); + pop_wmops(); return; } @@ -1081,7 +1081,7 @@ static ivas_error ivas_ism_bitrate_switching( /* close the ISM renderer and reinitialize */ if ( st_ivas->hIsmRendererData != NULL ) { - count_free( st_ivas->hIsmRendererData ); + free( st_ivas->hIsmRendererData ); st_ivas->hIsmRendererData = NULL; } ivas_ism_renderer_open( st_ivas ); @@ -1125,7 +1125,7 @@ static ivas_error ivas_ism_bitrate_switching( /* Close the ISM renderer */ if ( st_ivas->hIsmRendererData != NULL ) { - count_free( st_ivas->hIsmRendererData ); + free( st_ivas->hIsmRendererData ); st_ivas->hIsmRendererData = NULL; } } diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index 2e0874bc6485a4deed557e1450597ac2ba202c13..8cdd825f38f5c4366081c63f6a86c3ddd43b2be4 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -42,7 +42,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------------* @@ -61,7 +61,7 @@ ivas_error ivas_ism_renderer_open( error = IVAS_ERR_OK; - if ( ( st_ivas->hIsmRendererData = (ISM_RENDERER_HANDLE) count_malloc( sizeof( ISM_RENDERER_DATA ) ) ) == NULL ) + if ( ( st_ivas->hIsmRendererData = (ISM_RENDERER_HANDLE) malloc( sizeof( ISM_RENDERER_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ISM renderer\n" ) ); } diff --git a/lib_dec/ivas_lfe_dec.c b/lib_dec/ivas_lfe_dec.c index 70e3a2fff48952a3ea4fdefff65a2e5053f6e468..d7ca800afef0847a83990d944ca0364a64134e44 100644 --- a/lib_dec/ivas_lfe_dec.c +++ b/lib_dec/ivas_lfe_dec.c @@ -39,7 +39,7 @@ #include "ivas_prot.h" #include "ivas_rom_com.h" #include "math.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------------------------* @@ -378,7 +378,7 @@ ivas_error ivas_create_lfe_dec( * Allocate LFE handle *-----------------------------------------------------------------*/ - if ( ( hLFE = (LFE_DEC_HANDLE) count_malloc( sizeof( LFE_DEC_DATA ) ) ) == NULL ) + if ( ( hLFE = (LFE_DEC_HANDLE) malloc( sizeof( LFE_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LFE\n" ) ); } @@ -387,7 +387,7 @@ ivas_error ivas_create_lfe_dec( * LFE Window: allocate and initialize *-----------------------------------------------------------------*/ - if ( ( hLFE->pWindow_state = (LFE_WINDOW_HANDLE) count_malloc( sizeof( LFE_WINDOW_DATA ) ) ) == NULL ) + if ( ( hLFE->pWindow_state = (LFE_WINDOW_HANDLE) malloc( sizeof( LFE_WINDOW_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LFE window structure\n" ) ); } @@ -458,7 +458,7 @@ ivas_error ivas_create_lfe_dec( if ( hLFE->lfe_addl_delay > 0 ) { - if ( ( hLFE->lfe_delay_buf = (float *) count_malloc( hLFE->lfe_addl_delay * sizeof( float ) ) ) == NULL ) + if ( ( hLFE->lfe_delay_buf = (float *) malloc( hLFE->lfe_addl_delay * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LFE additional delay buffer\n" ) ); } @@ -495,16 +495,16 @@ void ivas_lfe_dec_close( LFE_DEC_HANDLE hLFE /* i/o: LFE decoder handle */ ) { - count_free( hLFE->pWindow_state ); + free( hLFE->pWindow_state ); hLFE->pWindow_state = NULL; if ( hLFE->lfe_delay_buf != NULL ) { - count_free( hLFE->lfe_delay_buf ); + free( hLFE->lfe_delay_buf ); hLFE->lfe_delay_buf = NULL; } - count_free( hLFE ); + free( hLFE ); return; } diff --git a/lib_dec/ivas_lfe_plc.c b/lib_dec/ivas_lfe_plc.c index 71d1aa7a5e4af09d66d0a0c325ad4404a8b03f85..ea93dc0f9095f641bc6fce52780dc3e84b26b966 100644 --- a/lib_dec/ivas_lfe_plc.c +++ b/lib_dec/ivas_lfe_plc.c @@ -39,7 +39,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------------------------* * Local constants diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 087b6cab163c3dbefdca4947e8b8822a6c617312..44083b195d707f6de601f540654b8e774b47c10f 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -42,7 +42,7 @@ #include "debug.h" #endif #include -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------------* * Local constants @@ -322,7 +322,7 @@ ivas_error ivas_masa_dec_open( { MASA_DECODER_HANDLE hMasa; - if ( ( hMasa = (MASA_DECODER_HANDLE) count_malloc( sizeof( MASA_DECODER ) ) ) == NULL ) + if ( ( hMasa = (MASA_DECODER_HANDLE) malloc( sizeof( MASA_DECODER ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MASA decoder\n" ) ); } @@ -337,7 +337,7 @@ ivas_error ivas_masa_dec_open( /* Create spherical grid only for external output */ if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL ) { - hMasa->data.sph_grid16 = (SPHERICAL_GRID_DATA *) count_malloc( sizeof( SPHERICAL_GRID_DATA ) ); + hMasa->data.sph_grid16 = (SPHERICAL_GRID_DATA *) malloc( sizeof( SPHERICAL_GRID_DATA ) ); generate_gridEq( hMasa->data.sph_grid16 ); } else @@ -373,7 +373,7 @@ void ivas_masa_dec_close( /* Free spherical grid memory if in use */ if ( hMasa->data.sph_grid16 != NULL ) { - count_free( hMasa->data.sph_grid16 ); + free( hMasa->data.sph_grid16 ); hMasa->data.sph_grid16 = NULL; } @@ -381,29 +381,29 @@ void ivas_masa_dec_close( { if ( hMasa->hMasaLfeSynth->lfeSynthRingBuffer != NULL ) { - count_free( hMasa->hMasaLfeSynth->lfeSynthRingBuffer ); + free( hMasa->hMasaLfeSynth->lfeSynthRingBuffer ); hMasa->hMasaLfeSynth->lfeSynthRingBuffer = NULL; } if ( hMasa->hMasaLfeSynth->lfeSynthRingBuffer2 != NULL ) { - count_free( hMasa->hMasaLfeSynth->lfeSynthRingBuffer2 ); + free( hMasa->hMasaLfeSynth->lfeSynthRingBuffer2 ); hMasa->hMasaLfeSynth->lfeSynthRingBuffer2 = NULL; } if ( hMasa->hMasaLfeSynth->delayBuffer_syncLp != NULL ) { - count_free( hMasa->hMasaLfeSynth->delayBuffer_syncLp ); + free( hMasa->hMasaLfeSynth->delayBuffer_syncLp ); hMasa->hMasaLfeSynth->delayBuffer_syncLp = NULL; } if ( hMasa->hMasaLfeSynth->delayBuffer_syncDirAC != NULL ) { - count_free( hMasa->hMasaLfeSynth->delayBuffer_syncDirAC ); + free( hMasa->hMasaLfeSynth->delayBuffer_syncDirAC ); hMasa->hMasaLfeSynth->delayBuffer_syncDirAC = NULL; } - count_free( hMasa->hMasaLfeSynth ); + free( hMasa->hMasaLfeSynth ); hMasa->hMasaLfeSynth = NULL; } - count_free( hMasa ); + free( hMasa ); hMasa = NULL; return; @@ -803,7 +803,7 @@ static void init_lfe_synth_data( output_Fs = st_ivas->hDecoderConfig->output_Fs; output_config = st_ivas->hDecoderConfig->output_config; - hMasa->hMasaLfeSynth = (MCMASA_LFE_SYNTH_DATA_HANDLE) count_malloc( sizeof( MCMASA_LFE_SYNTH_DATA ) ); + hMasa->hMasaLfeSynth = (MCMASA_LFE_SYNTH_DATA_HANDLE) malloc( sizeof( MCMASA_LFE_SYNTH_DATA ) ); hMasa->hMasaLfeSynth->transportEneSmooth = 0.0f; hMasa->hMasaLfeSynth->protoLfeEneSmooth = 0.0f; @@ -827,7 +827,7 @@ static void init_lfe_synth_data( /* Ring buffer for the filterbank of the LFE synthesis. * The filterbank is using moving average lowpass filter with the crossover of 120 Hz. */ bufferSize = (int16_t) ( ( output_Fs / FRAMES_PER_SEC ) / MAX_PARAM_SPATIAL_SUBFRAMES ); - hMasa->hMasaLfeSynth->lfeSynthRingBuffer = (float *) count_malloc( bufferSize * sizeof( float ) ); + hMasa->hMasaLfeSynth->lfeSynthRingBuffer = (float *) malloc( bufferSize * sizeof( float ) ); set_zero( hMasa->hMasaLfeSynth->lfeSynthRingBuffer, bufferSize ); hMasa->hMasaLfeSynth->ringBufferLoPointer = 0; hMasa->hMasaLfeSynth->ringBufferHiPointer = bufferSize / 2; @@ -837,7 +837,7 @@ static void init_lfe_synth_data( /* Ring buffer for additional lowpass filter for the LFE signal. * Moving average lowpass filter with the crossover of 240 Hz. */ bufferSize /= 2; - hMasa->hMasaLfeSynth->lfeSynthRingBuffer2 = (float *) count_malloc( bufferSize * sizeof( float ) ); + hMasa->hMasaLfeSynth->lfeSynthRingBuffer2 = (float *) malloc( bufferSize * sizeof( float ) ); set_zero( hMasa->hMasaLfeSynth->lfeSynthRingBuffer2, bufferSize ); hMasa->hMasaLfeSynth->ringBufferLoPointer2 = 0; hMasa->hMasaLfeSynth->lowpassSum2 = 0.0f; @@ -845,13 +845,13 @@ static void init_lfe_synth_data( /* Delay buffer for matching the delay of the lowpass filter */ bufferSize /= 2; /* The delay of the moving average lowpass filter is bufferSize / 2 */ - hMasa->hMasaLfeSynth->delayBuffer_syncLp = (float *) count_malloc( bufferSize * sizeof( float ) ); + hMasa->hMasaLfeSynth->delayBuffer_syncLp = (float *) malloc( bufferSize * sizeof( float ) ); set_zero( hMasa->hMasaLfeSynth->delayBuffer_syncLp, bufferSize ); hMasa->hMasaLfeSynth->delayBuffer_syncLp_size = bufferSize; /* Delay buffer for syncing with DirAC rendering */ bufferSize = NS2SA( output_Fs, IVAS_FB_DEC_DELAY_NS ) - hMasa->hMasaLfeSynth->ringBufferSize / 2 - hMasa->hMasaLfeSynth->ringBufferSize2 / 2; - hMasa->hMasaLfeSynth->delayBuffer_syncDirAC = (float *) count_malloc( bufferSize * sizeof( float ) ); + hMasa->hMasaLfeSynth->delayBuffer_syncDirAC = (float *) malloc( bufferSize * sizeof( float ) ); set_zero( hMasa->hMasaLfeSynth->delayBuffer_syncDirAC, bufferSize ); hMasa->hMasaLfeSynth->delayBuffer_syncDirAC_size = bufferSize; @@ -870,7 +870,7 @@ static void init_lfe_synth_data( /* Delay buffer for syncing with DirAC rendering */ bufferSize = NS2SA( output_Fs, IVAS_FB_DEC_DELAY_NS ); - hMasa->hMasaLfeSynth->delayBuffer_syncDirAC = (float *) count_malloc( bufferSize * sizeof( float ) ); + hMasa->hMasaLfeSynth->delayBuffer_syncDirAC = (float *) malloc( bufferSize * sizeof( float ) ); set_zero( hMasa->hMasaLfeSynth->delayBuffer_syncDirAC, bufferSize ); hMasa->hMasaLfeSynth->delayBuffer_syncDirAC_size = bufferSize; diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index 3e49aca706eb6fc9a51dde4b7fd6de89d6e26a37..78a6cface97031142acaa09d031e61034d0fa776 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -48,7 +48,7 @@ #ifdef DEBUG_PLOT #include "deb_out.h" #endif -#include "wmops.h" +#include "wmc_auto.h" #include "rom_dec.h" /*-----------------------------------------------------------------------* @@ -138,12 +138,12 @@ ivas_error ivas_param_mc_dec_open( * prepare library opening *-----------------------------------------------------------------*/ - if ( ( hParamMC = (PARAM_MC_DEC_HANDLE) count_malloc( sizeof( PARAM_MC_DEC_DATA ) ) ) == NULL ) + if ( ( hParamMC = (PARAM_MC_DEC_HANDLE) malloc( sizeof( PARAM_MC_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Parametric MC\n" ) ); } - if ( ( hParamMC->hMetadataPMC = (HANDLE_IVAS_PARAM_MC_METADATA) count_malloc( sizeof( IVAS_PARAM_MC_METADATA ) ) ) == NULL ) + if ( ( hParamMC->hMetadataPMC = (HANDLE_IVAS_PARAM_MC_METADATA) malloc( sizeof( IVAS_PARAM_MC_METADATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Parametric MC metadata \n" ) ); } @@ -234,8 +234,8 @@ ivas_error ivas_param_mc_dec_open( ivas_param_mc_metadata_open( mc_ls_setup, hTransportSetup.index_lfe[0], ivas_total_brate, hParamMC->hMetadataPMC ); /* init arrays for quantized parameters */ - hParamMC->icc_q = (float *) count_malloc( hParamMC->hMetadataPMC->num_parameter_bands * hParamMC->hMetadataPMC->icc_mapping_conf->icc_map_size_lfe * sizeof( float ) ); - hParamMC->icld_q = (float *) count_malloc( hParamMC->hMetadataPMC->num_parameter_bands * hParamMC->hMetadataPMC->ild_mapping_conf->ild_map_size_lfe * sizeof( float ) ); + hParamMC->icc_q = (float *) malloc( hParamMC->hMetadataPMC->num_parameter_bands * hParamMC->hMetadataPMC->icc_mapping_conf->icc_map_size_lfe * sizeof( float ) ); + hParamMC->icld_q = (float *) malloc( hParamMC->hMetadataPMC->num_parameter_bands * hParamMC->hMetadataPMC->ild_mapping_conf->ild_map_size_lfe * sizeof( float ) ); set_f( hParamMC->icld_q, PARAM_MC_DEFAULT_MIN_ILD, hParamMC->hMetadataPMC->num_parameter_bands * hParamMC->hMetadataPMC->ild_mapping_conf->ild_map_size_lfe ); set_f( hParamMC->icc_q, 0.0f, hParamMC->hMetadataPMC->num_parameter_bands * hParamMC->hMetadataPMC->icc_mapping_conf->icc_map_size_lfe ); @@ -284,7 +284,7 @@ ivas_error ivas_param_mc_dec_open( /* convert the ls conv dmx matrix into column order matrix format (nchan_out_cldfb x nchan_out) */ if ( hParamMC->synthesis_conf == PARAM_MC_SYNTH_LS_CONV_COV || hParamMC->synthesis_conf == PARAM_MC_SYNTH_MONO_STEREO ) { - hParamMC->ls_conv_dmx_matrix = (float *) count_malloc( nchan_out_transport * nchan_out_cov * sizeof( float ) ); + hParamMC->ls_conv_dmx_matrix = (float *) malloc( nchan_out_transport * nchan_out_cov * sizeof( float ) ); for ( k = 0; k < nchan_out_transport; k++ ) { mvr2r( st_ivas->hLsSetUpConversion->dmxMtx[k], &hParamMC->ls_conv_dmx_matrix[k * nchan_out_cov], nchan_out_cov ); @@ -306,7 +306,7 @@ ivas_error ivas_param_mc_dec_open( } } - hParamMC->proto_matrix_int = (float *) count_malloc( nchan_out_transport * nchan_transport * sizeof( float ) ); + hParamMC->proto_matrix_int = (float *) malloc( nchan_out_transport * nchan_transport * sizeof( float ) ); mvr2r( ivas_param_mc_conf[config_index].dmx_fac, hParamMC->proto_matrix_int, nchan_transport * nchan_out_transport ); if ( hParamMC->synthesis_conf == PARAM_MC_SYNTH_LS_CONV_COV || hParamMC->synthesis_conf == PARAM_MC_SYNTH_MONO_STEREO ) @@ -351,7 +351,7 @@ ivas_error ivas_param_mc_dec_open( else { hParamMC->num_outputs_diff = nchan_out_cov; - hParamMC->diff_proto_info = (PARAM_MC_DIFF_PROTO_INFO *) count_malloc( sizeof( PARAM_MC_DIFF_PROTO_INFO ) ); + hParamMC->diff_proto_info = (PARAM_MC_DIFF_PROTO_INFO *) malloc( sizeof( PARAM_MC_DIFF_PROTO_INFO ) ); param_mc_get_diff_proto_info( proto_matrix, nchan_transport, nchan_out_cov, hParamMC->diff_proto_info ); @@ -402,7 +402,7 @@ ivas_error ivas_param_mc_dec_open( /* Head rotation */ if ( ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) && st_ivas->hDecoderConfig->Opt_Headrotation ) { - hParamMC->hoa_encoder = (float *) count_malloc( st_ivas->hTransSetup.nchan_out_woLFE * MAX_INTERN_CHANNELS * sizeof( float ) ); + hParamMC->hoa_encoder = (float *) malloc( st_ivas->hTransSetup.nchan_out_woLFE * MAX_INTERN_CHANNELS * sizeof( float ) ); compute_hoa_encoder_mtx( st_ivas->hTransSetup.ls_azimuth, st_ivas->hTransSetup.ls_elevation, hParamMC->hoa_encoder, st_ivas->hTransSetup.nchan_out_woLFE, HEAD_ROTATION_HOA_ORDER ); } @@ -412,8 +412,8 @@ ivas_error ivas_param_mc_dec_open( if ( hParamMC->max_band_decorr > 0 ) { - hParamMC->proto_frame_f = (float *) count_malloc( 2 * hParamMC->diff_proto_info->num_protos_diff * hParamMC->num_freq_bands * sizeof( float ) ); - hParamMC->proto_frame_dec_f = (float *) count_malloc( 2 * nchan_out_cov * hParamMC->num_freq_bands * sizeof( float ) ); + hParamMC->proto_frame_f = (float *) malloc( 2 * hParamMC->diff_proto_info->num_protos_diff * hParamMC->num_freq_bands * sizeof( float ) ); + hParamMC->proto_frame_dec_f = (float *) malloc( 2 * nchan_out_cov * hParamMC->num_freq_bands * sizeof( float ) ); } else { @@ -585,7 +585,7 @@ ivas_error ivas_param_mc_dec_reconfig( #endif if ( hParamMC->hMetadataPMC->icc_map_full[k] != NULL ) { - count_free( hParamMC->hMetadataPMC->icc_map_full[k] ); + free( hParamMC->hMetadataPMC->icc_map_full[k] ); hParamMC->hMetadataPMC->icc_map_full[k] = NULL; } } @@ -621,8 +621,8 @@ ivas_error ivas_param_mc_dec_reconfig( /* init arrays for the quantized parameters */ - hParamMC->icc_q = (float *) count_malloc( hParamMC->hMetadataPMC->num_parameter_bands * hParamMC->hMetadataPMC->icc_mapping_conf->icc_map_size_lfe * sizeof( float ) ); - hParamMC->icld_q = (float *) count_malloc( hParamMC->hMetadataPMC->num_parameter_bands * hParamMC->hMetadataPMC->ild_mapping_conf->ild_map_size_lfe * sizeof( float ) ); + hParamMC->icc_q = (float *) malloc( hParamMC->hMetadataPMC->num_parameter_bands * hParamMC->hMetadataPMC->icc_mapping_conf->icc_map_size_lfe * sizeof( float ) ); + hParamMC->icld_q = (float *) malloc( hParamMC->hMetadataPMC->num_parameter_bands * hParamMC->hMetadataPMC->ild_mapping_conf->ild_map_size_lfe * sizeof( float ) ); set_f( hParamMC->icld_q, PARAM_MC_DEFAULT_MIN_ILD, hParamMC->hMetadataPMC->num_parameter_bands * hParamMC->hMetadataPMC->ild_mapping_conf->ild_map_size_lfe ); set_f( hParamMC->icc_q, 0.0f, hParamMC->hMetadataPMC->num_parameter_bands * hParamMC->hMetadataPMC->icc_mapping_conf->icc_map_size_lfe ); @@ -665,8 +665,8 @@ ivas_error ivas_param_mc_dec_reconfig( } } } - count_free( ild_q_old ); - count_free( icc_q_old ); + free( ild_q_old ); + free( icc_q_old ); } param_mc_set_num_synth_bands( output_Fs, hParamMC ); @@ -701,8 +701,8 @@ ivas_error ivas_param_mc_dec_reconfig( } /* convert the ls conv dmx matrix into column order matrix format (nchan_out_cldfb x nchan_out) */ - count_free( hParamMC->ls_conv_dmx_matrix ); - hParamMC->ls_conv_dmx_matrix = (float *) count_malloc( nchan_out_transport * nchan_out_cov * sizeof( float ) ); + free( hParamMC->ls_conv_dmx_matrix ); + hParamMC->ls_conv_dmx_matrix = (float *) malloc( nchan_out_transport * nchan_out_cov * sizeof( float ) ); for ( k = 0; k < nchan_out_transport; k++ ) { mvr2r( st_ivas->hLsSetUpConversion->dmxMtx[k], &hParamMC->ls_conv_dmx_matrix[k * nchan_out_cov], nchan_out_cov ); @@ -723,8 +723,8 @@ ivas_error ivas_param_mc_dec_reconfig( if ( nchan_transport_old != nchan_transport ) { - count_free( hParamMC->proto_matrix_int ); - hParamMC->proto_matrix_int = (float *) count_malloc( nchan_out_transport * nchan_transport * sizeof( float ) ); + free( hParamMC->proto_matrix_int ); + hParamMC->proto_matrix_int = (float *) malloc( nchan_out_transport * nchan_transport * sizeof( float ) ); mvr2r( ivas_param_mc_conf[config_index].dmx_fac, hParamMC->proto_matrix_int, nchan_transport * nchan_out_transport ); } if ( hParamMC->synthesis_conf == PARAM_MC_SYNTH_LS_CONV_COV || hParamMC->synthesis_conf == PARAM_MC_SYNTH_MONO_STEREO ) @@ -770,31 +770,31 @@ ivas_error ivas_param_mc_dec_reconfig( { for ( i = 0; i < hParamMC->diff_proto_info->num_protos_diff; i++ ) { - count_free( hParamMC->diff_proto_info->source_chan_idx[i] ); + free( hParamMC->diff_proto_info->source_chan_idx[i] ); hParamMC->diff_proto_info->source_chan_idx[i] = NULL; - count_free( hParamMC->diff_proto_info->proto_fac[i] ); + free( hParamMC->diff_proto_info->proto_fac[i] ); hParamMC->diff_proto_info->proto_fac[i] = NULL; } - count_free( hParamMC->diff_proto_info->source_chan_idx ); + free( hParamMC->diff_proto_info->source_chan_idx ); hParamMC->diff_proto_info->source_chan_idx = NULL; - count_free( hParamMC->diff_proto_info->proto_fac ); + free( hParamMC->diff_proto_info->proto_fac ); hParamMC->diff_proto_info->proto_fac = NULL; - count_free( hParamMC->diff_proto_info->proto_index_diff ); + free( hParamMC->diff_proto_info->proto_index_diff ); hParamMC->diff_proto_info->proto_index_diff = NULL; - count_free( hParamMC->diff_proto_info->num_source_chan_diff ); + free( hParamMC->diff_proto_info->num_source_chan_diff ); hParamMC->diff_proto_info->num_source_chan_diff = NULL; - count_free( hParamMC->diff_proto_info ); + free( hParamMC->diff_proto_info ); hParamMC->diff_proto_info = NULL; } hParamMC->num_outputs_diff = nchan_out_cov; - hParamMC->diff_proto_info = (PARAM_MC_DIFF_PROTO_INFO *) count_malloc( sizeof( PARAM_MC_DIFF_PROTO_INFO ) ); + hParamMC->diff_proto_info = (PARAM_MC_DIFF_PROTO_INFO *) malloc( sizeof( PARAM_MC_DIFF_PROTO_INFO ) ); param_mc_get_diff_proto_info( proto_matrix, nchan_transport, nchan_out_cov, hParamMC->diff_proto_info ); @@ -903,8 +903,8 @@ ivas_error ivas_param_mc_dec_reconfig( if ( hParamMC->max_band_decorr > 0 && nchan_transport_old != nchan_transport ) { - count_free( hParamMC->proto_frame_f ); - hParamMC->proto_frame_f = (float *) count_malloc( 2 * hParamMC->diff_proto_info->num_protos_diff * hParamMC->num_freq_bands * sizeof( float ) ); + free( hParamMC->proto_frame_f ); + hParamMC->proto_frame_f = (float *) malloc( 2 * hParamMC->diff_proto_info->num_protos_diff * hParamMC->num_freq_bands * sizeof( float ) ); set_zero( hParamMC->proto_frame_f, 2 * hParamMC->diff_proto_info->num_protos_diff * hParamMC->num_freq_bands ); } @@ -989,19 +989,19 @@ void ivas_param_mc_dec_close( { ivas_param_mc_metadata_close( hParamMC->hMetadataPMC ); - count_free( hParamMC->hMetadataPMC ); + free( hParamMC->hMetadataPMC ); hParamMC->hMetadataPMC = NULL; } if ( hParamMC->icc_q != NULL ) { - count_free( hParamMC->icc_q ); + free( hParamMC->icc_q ); hParamMC->icc_q = NULL; } if ( hParamMC->icld_q != NULL ) { - count_free( hParamMC->icld_q ); + free( hParamMC->icld_q ); hParamMC->icld_q = NULL; } @@ -1010,26 +1010,26 @@ void ivas_param_mc_dec_close( { for ( i = 0; i < hParamMC->diff_proto_info->num_protos_diff; i++ ) { - count_free( hParamMC->diff_proto_info->source_chan_idx[i] ); + free( hParamMC->diff_proto_info->source_chan_idx[i] ); hParamMC->diff_proto_info->source_chan_idx[i] = NULL; - count_free( hParamMC->diff_proto_info->proto_fac[i] ); + free( hParamMC->diff_proto_info->proto_fac[i] ); hParamMC->diff_proto_info->proto_fac[i] = NULL; } - count_free( hParamMC->diff_proto_info->source_chan_idx ); + free( hParamMC->diff_proto_info->source_chan_idx ); hParamMC->diff_proto_info->source_chan_idx = NULL; - count_free( hParamMC->diff_proto_info->proto_fac ); + free( hParamMC->diff_proto_info->proto_fac ); hParamMC->diff_proto_info->proto_fac = NULL; - count_free( hParamMC->diff_proto_info->proto_index_diff ); + free( hParamMC->diff_proto_info->proto_index_diff ); hParamMC->diff_proto_info->proto_index_diff = NULL; - count_free( hParamMC->diff_proto_info->num_source_chan_diff ); + free( hParamMC->diff_proto_info->num_source_chan_diff ); hParamMC->diff_proto_info->num_source_chan_diff = NULL; - count_free( hParamMC->diff_proto_info ); + free( hParamMC->diff_proto_info ); hParamMC->diff_proto_info = NULL; } @@ -1038,35 +1038,35 @@ void ivas_param_mc_dec_close( /* free prototype signal buffers */ if ( hParamMC->proto_frame_f != NULL ) { - count_free( hParamMC->proto_frame_f ); + free( hParamMC->proto_frame_f ); hParamMC->proto_frame_f = NULL; } if ( hParamMC->proto_frame_dec_f != NULL ) { - count_free( hParamMC->proto_frame_dec_f ); + free( hParamMC->proto_frame_dec_f ); hParamMC->proto_frame_dec_f = NULL; } if ( hParamMC->ls_conv_dmx_matrix != NULL ) { - count_free( hParamMC->ls_conv_dmx_matrix ); + free( hParamMC->ls_conv_dmx_matrix ); hParamMC->ls_conv_dmx_matrix = NULL; } if ( hParamMC->proto_matrix_int != NULL ) { - count_free( hParamMC->proto_matrix_int ); + free( hParamMC->proto_matrix_int ); hParamMC->proto_matrix_int = NULL; } if ( hParamMC->hoa_encoder != NULL ) { - count_free( hParamMC->hoa_encoder ); + free( hParamMC->hoa_encoder ); hParamMC->hoa_encoder = NULL; } - count_free( hParamMC ); + free( hParamMC ); hParamMC = NULL; return; @@ -1101,7 +1101,7 @@ void ivas_param_mc_dec_read_BS( int16_t ild_map_size_wo_lfe; HANDLE_IVAS_PARAM_MC_METADATA hMetadataPMC; - wmops_sub_start( "param_mc_read_bs" ); + push_wmops( "param_mc_read_bs" ); /* Inits */ *nb_bits = 0; @@ -1273,7 +1273,7 @@ void ivas_param_mc_dec_read_BS( hMetadataPMC->attackIndex = 0; } - wmops_sub_end(); + pop_wmops(); return; } @@ -1319,7 +1319,7 @@ void ivas_param_mc_dec( hParamMC = st_ivas->hParamMC; assert( hParamMC ); - wmops_sub_start( "param_mc_dec" ); + push_wmops( "param_mc_dec" ); set_s( channel_active, 0, MAX_CICP_CHANNELS ); nchan_transport = st_ivas->nchan_transport; @@ -1603,7 +1603,7 @@ void ivas_param_mc_dec( /* update */ hParamMC->hMetadataPMC->last_coded_bwidth = hParamMC->hMetadataPMC->coded_bwidth; param_mc_update_mixing_matrices( hParamMC, mixing_matrix, mixing_matrix_res, nchan_transport, nchan_out_cov ); - wmops_sub_end(); + pop_wmops(); return; } @@ -2592,9 +2592,9 @@ static void param_mc_get_diff_proto_info( /* Initializations */ max_num_src_chan = 0; set_zero( proto_fac, MAX_CICP_CHANNELS * PARAM_MC_MAX_TRANSPORT_CHANS ); - p_diff_proto_info->proto_index_diff = (int16_t *) count_malloc( nchan_out_cov * sizeof( int16_t ) ); + p_diff_proto_info->proto_index_diff = (int16_t *) malloc( nchan_out_cov * sizeof( int16_t ) ); set_s( p_diff_proto_info->proto_index_diff, 0, nchan_out_cov ); - p_diff_proto_info->num_source_chan_diff = (int16_t *) count_malloc( nchan_out_cov * sizeof( int16_t ) ); + p_diff_proto_info->num_source_chan_diff = (int16_t *) malloc( nchan_out_cov * sizeof( int16_t ) ); set_s( p_diff_proto_info->num_source_chan_diff, 0, nchan_out_cov ); /* we have at least one prototype, copy the first one */ @@ -2655,15 +2655,15 @@ static void param_mc_get_diff_proto_info( /* set up the prototype info struct */ - p_diff_proto_info->source_chan_idx = (int16_t **) count_malloc( p_diff_proto_info->num_protos_diff * sizeof( int16_t * ) ); - p_diff_proto_info->proto_fac = (float **) count_malloc( p_diff_proto_info->num_protos_diff * sizeof( float * ) ); + p_diff_proto_info->source_chan_idx = (int16_t **) malloc( p_diff_proto_info->num_protos_diff * sizeof( int16_t * ) ); + p_diff_proto_info->proto_fac = (float **) malloc( p_diff_proto_info->num_protos_diff * sizeof( float * ) ); for ( cur_diff_proto = 0; cur_diff_proto < p_diff_proto_info->num_protos_diff; cur_diff_proto++ ) { float *proto_fac_ptr; - p_diff_proto_info->source_chan_idx[cur_diff_proto] = (int16_t *) count_malloc( max_num_src_chan * sizeof( int16_t ) ); - p_diff_proto_info->proto_fac[cur_diff_proto] = (float *) count_malloc( max_num_src_chan * sizeof( float ) ); + p_diff_proto_info->source_chan_idx[cur_diff_proto] = (int16_t *) malloc( max_num_src_chan * sizeof( int16_t ) ); + p_diff_proto_info->proto_fac[cur_diff_proto] = (float *) malloc( max_num_src_chan * sizeof( float ) ); proto_fac_ptr = proto_fac + cur_diff_proto; for ( cur_transport_ch = 0; cur_transport_ch < nchan_transport; cur_transport_ch++ ) diff --git a/lib_dec/ivas_mcmasa_dec.c b/lib_dec/ivas_mcmasa_dec.c index 83e226f0a0086989ad3f3caf062bf82d733e49c1..87ab621ae8f1c3eb62ed319b0105b6bf37a620d4 100644 --- a/lib_dec/ivas_mcmasa_dec.c +++ b/lib_dec/ivas_mcmasa_dec.c @@ -38,7 +38,7 @@ the United Nations Convention on Contracts on the International Sales of Goods. #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" #ifdef MC_BITRATE_SWITCHING diff --git a/lib_dec/ivas_mct_core_dec.c b/lib_dec/ivas_mct_core_dec.c index d7459efabdafac850c23e4340e28224bc430febb..d831b7044c23488b1f51cb04e3c05064d7f4fd22 100644 --- a/lib_dec/ivas_mct_core_dec.c +++ b/lib_dec/ivas_mct_core_dec.c @@ -38,7 +38,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" #include "cnst.h" #include "basop_proto_func.h" #include "stat_com.h" @@ -183,7 +183,7 @@ void ivas_mct_core_dec( float nrg[MCT_MAX_CHANNELS]; #endif - wmops_sub_start( "mct_decoding" ); + push_wmops( "mct_decoding" ); /*--------------------------------------------------------------------------------* * Initializations @@ -269,7 +269,7 @@ void ivas_mct_core_dec( apply_MCT_dec( hMCT, sts, x ); } - wmops_sub_end(); + pop_wmops(); return; } diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index cf348ff15d10418e1611a41e38310fc482e9fab8..a9d4a559d44dcd0e3142f8a18178832de86ed8ca 100755 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -43,7 +43,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" #ifdef DEBUG_PLOT #include "deb_out.h" #endif @@ -89,7 +89,7 @@ ivas_error ivas_mct_dec( error = IVAS_ERR_OK; - wmops_sub_start( "ivas_mct_dec" ); + push_wmops( "ivas_mct_dec" ); nCPE = st_ivas->nCPE; hMCT = st_ivas->hMCT; @@ -273,7 +273,7 @@ ivas_error ivas_mct_dec( } #endif - wmops_sub_end(); + pop_wmops(); return error; } @@ -298,7 +298,7 @@ ivas_error create_mct_dec( * Allocate MCT handle *-----------------------------------------------------------------*/ - if ( ( hMCT = (MCT_DEC_HANDLE) count_malloc( sizeof( MCT_DEC_DATA ) ) ) == NULL ) + if ( ( hMCT = (MCT_DEC_HANDLE) malloc( sizeof( MCT_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CPE\n" ) ); } @@ -353,7 +353,7 @@ ivas_error create_mct_dec( for ( n = 0; n < max_blocks; n++ ) { - if ( ( hMCT->hBlockData[n] = (MCT_DEC_BLOCK_DATA_HANDLE) count_malloc( sizeof( MCT_DEC_BLOCK_DATA ) ) ) == NULL ) + if ( ( hMCT->hBlockData[n] = (MCT_DEC_BLOCK_DATA_HANDLE) malloc( sizeof( MCT_DEC_BLOCK_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MCT block data structure\n" ) ); } @@ -366,7 +366,7 @@ ivas_error create_mct_dec( * MDCT stereo initialization *-----------------------------------------------------------------*/ - if ( ( hMCT->hBlockData[n]->hStereoMdct = (STEREO_MDCT_DEC_DATA_HANDLE) count_malloc( sizeof( STEREO_MDCT_DEC_DATA ) ) ) == NULL ) + if ( ( hMCT->hBlockData[n]->hStereoMdct = (STEREO_MDCT_DEC_DATA_HANDLE) malloc( sizeof( STEREO_MDCT_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MDCT Stereo \n" ) ); } @@ -498,7 +498,7 @@ ivas_error mct_dec_reconfigure( { if ( hMCT->hBlockData[n] == NULL ) { - if ( ( hMCT->hBlockData[n] = (MCT_DEC_BLOCK_DATA_HANDLE) count_malloc( sizeof( MCT_BLOCK_DATA ) ) ) == NULL ) + if ( ( hMCT->hBlockData[n] = (MCT_DEC_BLOCK_DATA_HANDLE) malloc( sizeof( MCT_BLOCK_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MCT block data structure\n" ) ); } @@ -508,7 +508,7 @@ ivas_error mct_dec_reconfigure( hMCT->hBlockData[n]->ch2 = 0; /* MDCT stereo initialization */ - if ( ( hMCT->hBlockData[n]->hStereoMdct = (STEREO_MDCT_DEC_DATA_HANDLE) count_malloc( sizeof( STEREO_MDCT_ENC_DATA ) ) ) == NULL ) + if ( ( hMCT->hBlockData[n]->hStereoMdct = (STEREO_MDCT_DEC_DATA_HANDLE) malloc( sizeof( STEREO_MDCT_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MDCT Stereo \n" ) ); } @@ -525,11 +525,11 @@ ivas_error mct_dec_reconfigure( { if ( hMCT->hBlockData[n]->hStereoMdct != NULL ) { - count_free( hMCT->hBlockData[n]->hStereoMdct ); + free( hMCT->hBlockData[n]->hStereoMdct ); hMCT->hBlockData[n]->hStereoMdct = NULL; } - count_free( hMCT->hBlockData[n] ); + free( hMCT->hBlockData[n] ); hMCT->hBlockData[n] = NULL; } } @@ -578,16 +578,16 @@ void ivas_mct_dec_close( { if ( ( *hMCT )->hBlockData[n]->hStereoMdct != NULL ) { - count_free( ( *hMCT )->hBlockData[n]->hStereoMdct ); + free( ( *hMCT )->hBlockData[n]->hStereoMdct ); ( *hMCT )->hBlockData[n]->hStereoMdct = NULL; } - count_free( ( *hMCT )->hBlockData[n] ); + free( ( *hMCT )->hBlockData[n] ); ( *hMCT )->hBlockData[n] = NULL; } } - count_free( *hMCT ); + free( *hMCT ); *hMCT = NULL; return; @@ -877,7 +877,7 @@ static ivas_error ivas_mc_dec_reconfig( if ( st->hIGFDec == NULL ) { - if ( ( st->hIGFDec = (IGF_DEC_INSTANCE_HANDLE) count_malloc( sizeof( IGFDEC_INSTANCE ) ) ) == NULL ) + if ( ( st->hIGFDec = (IGF_DEC_INSTANCE_HANDLE) malloc( sizeof( IGFDEC_INSTANCE ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for IGF\n" ) ); } @@ -889,7 +889,7 @@ static ivas_error ivas_mc_dec_reconfig( if ( st->hHQ_core == NULL ) { - if ( ( st->hHQ_core = (HQ_DEC_HANDLE) count_malloc( sizeof( HQ_DEC_DATA ) ) ) == NULL ) + if ( ( st->hHQ_core = (HQ_DEC_HANDLE) malloc( sizeof( HQ_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HQ core\n" ) ); } @@ -901,7 +901,7 @@ static ivas_error ivas_mc_dec_reconfig( /* check if we have a doubly used hTxcCfg, if so, allocate a distint one for the old MCT LFE channel */ if ( st->hTcxCfg == st_ivas->hCPE[1]->hCoreCoder[0]->hTcxCfg ) { - if ( ( st->hTcxCfg = (TCX_CONFIG_HANDLE) count_malloc( sizeof( TCX_config ) ) ) == NULL ) + if ( ( st->hTcxCfg = (TCX_CONFIG_HANDLE) malloc( sizeof( TCX_config ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for hTcxCfg\n" ) ); } @@ -949,7 +949,7 @@ static ivas_error ivas_mc_dec_reconfig( /* TCX-LTP */ if ( st->hTcxLtpDec == NULL ) { - if ( ( st->hTcxLtpDec = (TCX_LTP_DEC_HANDLE) count_malloc( sizeof( TCX_LTP_DEC_DATA ) ) ) == NULL ) + if ( ( st->hTcxLtpDec = (TCX_LTP_DEC_HANDLE) malloc( sizeof( TCX_LTP_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TCX-LTP handle\n" ) ); } @@ -1169,7 +1169,7 @@ static ivas_error ivas_mc_dec_reconfig( if ( st_ivas->hCrend == NULL && st_ivas->hRenderConfig->roomAcoustics.late_reverb_on ) { - if ( ( st_ivas->hCrend = (CREND_HANDLE) count_malloc( sizeof( CREND_DATA ) ) ) == NULL ) + if ( ( st_ivas->hCrend = (CREND_HANDLE) malloc( sizeof( CREND_DATA ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR Crend\n" ); } diff --git a/lib_dec/ivas_mct_dec_mct.c b/lib_dec/ivas_mct_dec_mct.c index 6b8f9b74fab3437b960e24438bb59b975fcf5e9c..4369dea6394a3b4482d59a215b4896a233e113d3 100644 --- a/lib_dec/ivas_mct_dec_mct.c +++ b/lib_dec/ivas_mct_dec_mct.c @@ -35,7 +35,7 @@ #include "ivas_cnst.h" #include "ivas_prot.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" #include #include "stat_enc.h" diff --git a/lib_dec/ivas_mdct_core_dec.c b/lib_dec/ivas_mdct_core_dec.c index 85247f86cddcc28876b570b4c471679a96745e4e..b0ce627c61bbb3b9db09df2c29a8c1a9b874c5f3 100755 --- a/lib_dec/ivas_mdct_core_dec.c +++ b/lib_dec/ivas_mdct_core_dec.c @@ -38,7 +38,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" #include "cnst.h" #include "basop_proto_func.h" #include "stat_com.h" @@ -478,7 +478,7 @@ void ivas_mdct_core_invQ( float concealment_noise[CPE_CHANNELS][L_FRAME48k]; TONALMDCTCONC_NOISE_GEN_MODE noise_gen_mode_bfi; - wmops_sub_start( "mdct_core_invQ" ); + push_wmops( "mdct_core_invQ" ); sts = hCPE->hCoreCoder; bfi = sts[0]->bfi; @@ -738,7 +738,7 @@ void ivas_mdct_core_invQ( } } - wmops_sub_end(); + pop_wmops(); return; } diff --git a/lib_dec/ivas_mono_dmx_renderer.c b/lib_dec/ivas_mono_dmx_renderer.c index 20b677075eaa648d58268a44ace8c7859e665410..0e40c0fe3d45c107c067bcf86da8384b1b8cecaf 100644 --- a/lib_dec/ivas_mono_dmx_renderer.c +++ b/lib_dec/ivas_mono_dmx_renderer.c @@ -39,7 +39,7 @@ #include "ivas_cnst.h" #include "ivas_rom_com.h" #include "ivas_rom_dec.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------- @@ -63,7 +63,7 @@ ivas_error ivas_mono_dmx_renderer_open( { MONO_DOWNMIX_RENDERER_HANDLE hDownmix; - if ( ( hDownmix = (MONO_DOWNMIX_RENDERER_HANDLE) count_malloc( sizeof( MONO_DOWNMIX_RENDERER_STRUCT ) ) ) == NULL ) + if ( ( hDownmix = (MONO_DOWNMIX_RENDERER_HANDLE) malloc( sizeof( MONO_DOWNMIX_RENDERER_STRUCT ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for downmixing\n" ) ); } diff --git a/lib_dec/ivas_out_setup_conversion.c b/lib_dec/ivas_out_setup_conversion.c index 55f53bae73a1df246d0879d1dcc52053858f425f..6b5734fff63d1d1f25de3c1a8892d75dc5a5ccf7 100644 --- a/lib_dec/ivas_out_setup_conversion.c +++ b/lib_dec/ivas_out_setup_conversion.c @@ -39,7 +39,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" #include "ivas_rom_com.h" #include "ivas_rom_dec.h" @@ -317,7 +317,7 @@ ivas_error ivas_ls_setup_conversion_open( output_frame = (int16_t) ( output_Fs / FRAMES_PER_SEC ); /* Allocate memory to the handle */ - if ( ( hLsSetUpConversion = (LSSETUP_CONVERSION_HANDLE) count_malloc( sizeof( LSSETUP_CONVERSION_STRUCT ) ) ) == NULL ) + if ( ( hLsSetUpConversion = (LSSETUP_CONVERSION_HANDLE) malloc( sizeof( LSSETUP_CONVERSION_STRUCT ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LS configuration Conversion Handle \n" ) ); } @@ -331,8 +331,8 @@ ivas_error ivas_ls_setup_conversion_open( hLsSetUpConversion->sfbCnt = (int16_t) ( output_Fs * INV_CLDFB_BANDWIDTH + 0.5f ); for ( chIdx = 0; chIdx < outChannels; chIdx++ ) { - hLsSetUpConversion->targetEnergyPrev[chIdx] = (float *) count_malloc( ( hLsSetUpConversion->sfbCnt ) * sizeof( float ) ); - hLsSetUpConversion->dmxEnergyPrev[chIdx] = (float *) count_malloc( ( hLsSetUpConversion->sfbCnt ) * sizeof( float ) ); + hLsSetUpConversion->targetEnergyPrev[chIdx] = (float *) malloc( ( hLsSetUpConversion->sfbCnt ) * sizeof( float ) ); + hLsSetUpConversion->dmxEnergyPrev[chIdx] = (float *) malloc( ( hLsSetUpConversion->sfbCnt ) * sizeof( float ) ); set_f( hLsSetUpConversion->targetEnergyPrev[chIdx], 0.0f, hLsSetUpConversion->sfbCnt ); set_f( hLsSetUpConversion->dmxEnergyPrev[chIdx], 0.0f, hLsSetUpConversion->sfbCnt ); } @@ -347,8 +347,8 @@ ivas_error ivas_ls_setup_conversion_open( inChannels = st_ivas->nchan_transport; /*Initialization of MDCT bands with TCX20 resolution */ ivas_lssetupconversion_mdct_init_bands( output_frame, TCX_20_CORE, &hLsSetUpConversion->sfbOffset[0], &hLsSetUpConversion->sfbCnt ); - hLsSetUpConversion->targetEnergyPrev[0] = (float *) count_malloc( ( MAX_SFB + 2 ) * sizeof( float ) ); - hLsSetUpConversion->dmxEnergyPrev[0] = (float *) count_malloc( ( MAX_SFB + 2 ) * sizeof( float ) ); + hLsSetUpConversion->targetEnergyPrev[0] = (float *) malloc( ( MAX_SFB + 2 ) * sizeof( float ) ); + hLsSetUpConversion->dmxEnergyPrev[0] = (float *) malloc( ( MAX_SFB + 2 ) * sizeof( float ) ); for ( chIdx = 1; chIdx < MAX_CICP_CHANNELS; chIdx++ ) { hLsSetUpConversion->targetEnergyPrev[chIdx] = NULL; @@ -363,7 +363,7 @@ ivas_error ivas_ls_setup_conversion_open( for ( chIdx = 0; chIdx < inChannels; chIdx++ ) { /* Allocate memory depending on the number of output channels */ - if ( ( hLsSetUpConversion->dmxMtx[chIdx] = (float *) count_malloc( outChannels * sizeof( float ) ) ) == NULL ) + if ( ( hLsSetUpConversion->dmxMtx[chIdx] = (float *) malloc( outChannels * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for temp dmx matrix \n" ) ); } @@ -418,24 +418,24 @@ void ivas_ls_setup_conversion_close( { if ( ( *hLsSetUpConversion )->dmxMtx[idx] != NULL ) { - count_free( ( *hLsSetUpConversion )->dmxMtx[idx] ); + free( ( *hLsSetUpConversion )->dmxMtx[idx] ); ( *hLsSetUpConversion )->dmxMtx[idx] = NULL; } if ( ( *hLsSetUpConversion )->targetEnergyPrev[idx] != NULL ) { - count_free( ( *hLsSetUpConversion )->targetEnergyPrev[idx] ); + free( ( *hLsSetUpConversion )->targetEnergyPrev[idx] ); ( *hLsSetUpConversion )->targetEnergyPrev[idx] = NULL; } if ( ( *hLsSetUpConversion )->dmxEnergyPrev[idx] != NULL ) { - count_free( ( *hLsSetUpConversion )->dmxEnergyPrev[idx] ); + free( ( *hLsSetUpConversion )->dmxEnergyPrev[idx] ); ( *hLsSetUpConversion )->dmxEnergyPrev[idx] = NULL; } } - count_free( *hLsSetUpConversion ); + free( *hLsSetUpConversion ); *hLsSetUpConversion = NULL; return; @@ -460,7 +460,7 @@ void ivas_ls_setup_conversion( float dmxCoeff, tmpVal; float output_tmp[MAX_OUTPUT_CHANNELS][L_FRAME48k]; - wmops_sub_start( "LS_Renderer" ); + push_wmops( "LS_Renderer" ); hLsSetUpConversion = st_ivas->hLsSetUpConversion; @@ -499,7 +499,7 @@ void ivas_ls_setup_conversion( mvr2r( output_tmp[chOutIdx], output[chOutIdx], output_frame ); } - wmops_sub_end(); + pop_wmops(); return; } @@ -535,7 +535,7 @@ void ivas_ls_setup_conversion_process_mdct( LSSETUP_CONVERSION_HANDLE hLsSetUpConversion; CPE_DEC_HANDLE hCPE[MCT_MAX_BLOCKS]; - wmops_sub_start( "LS_Renderer_MDCT" ); + push_wmops( "LS_Renderer_MDCT" ); /* Assign all the declared variables */ inChannels = st_ivas->nchan_transport; @@ -736,7 +736,7 @@ void ivas_ls_setup_conversion_process_mdct( } } - wmops_sub_end(); + pop_wmops(); return; } @@ -1096,7 +1096,7 @@ void ivas_lssetupconversion_process_param_mc( float Cldfb_ImagBuffer_tmp[MAX_CICP_CHANNELS][CLDFB_NO_CHANNELS_MAX]; LSSETUP_CONVERSION_HANDLE hLsSetUpConversion; - wmops_sub_start( "LS_Renderer_Process_Param_MC" ); + push_wmops( "LS_Renderer_Process_Param_MC" ); /* inits */ inChannels = st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe; @@ -1199,6 +1199,6 @@ void ivas_lssetupconversion_process_param_mc( } } - wmops_sub_end(); + pop_wmops(); return; } diff --git a/lib_dec/ivas_pca_dec.c b/lib_dec/ivas_pca_dec.c index ef5694d6561ca775bba2f7b1b7ef914f3e833087..84ca7025ebe9ec74f32e9ca6dbe88f6bc538a2d5 100644 --- a/lib_dec/ivas_pca_dec.c +++ b/lib_dec/ivas_pca_dec.c @@ -39,7 +39,7 @@ #endif #include #include "ivas_cnst.h" -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------------* diff --git a/lib_dec/ivas_post_proc.c b/lib_dec/ivas_post_proc.c index 1dce7978c208136bc8bd9bc806195df5e468b2ea..277c5e81aec14940463abb6ebbdaf421456a9538 100644 --- a/lib_dec/ivas_post_proc.c +++ b/lib_dec/ivas_post_proc.c @@ -41,7 +41,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------- * ivas_post_proc() diff --git a/lib_dec/ivas_qmetadata_dec.c b/lib_dec/ivas_qmetadata_dec.c index dbaca982b72c16323f916132bc6f7871234669f3..544a49fe30fc51a572a06138756542f4f094fce7 100644 --- a/lib_dec/ivas_qmetadata_dec.c +++ b/lib_dec/ivas_qmetadata_dec.c @@ -38,7 +38,7 @@ #include "ivas_prot.h" #include "ivas_rom_com.h" #include "ivas_rom_dec.h" -#include "wmops.h" +#include "wmc_auto.h" #include "prot.h" /*-----------------------------------------------------------------------* diff --git a/lib_dec/ivas_qspherical_dec.c b/lib_dec/ivas_qspherical_dec.c index c37d03e5a983c0f41312c90d693311c5678fb2f0..57d58c4596b3f4b7026fce60cb41161a1b523210 100644 --- a/lib_dec/ivas_qspherical_dec.c +++ b/lib_dec/ivas_qspherical_dec.c @@ -36,7 +36,7 @@ #include "ivas_prot.h" #include "ivas_rom_com.h" #include "ivas_stat_dec.h" -#include "wmops.h" +#include "wmc_auto.h" #include "prot.h" diff --git a/lib_dec/ivas_range_uni_dec.c b/lib_dec/ivas_range_uni_dec.c index de9b3a4559adf745e081a6f4d3030ed102adbf35..7036416c60d17c824d2d74efe2792e5efe5d7896 100644 --- a/lib_dec/ivas_range_uni_dec.c +++ b/lib_dec/ivas_range_uni_dec.c @@ -39,7 +39,7 @@ #include #include "options.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" #ifdef DEBUGGING #include "debug.h" #endif diff --git a/lib_dec/ivas_rom_dec.c b/lib_dec/ivas_rom_dec.c index c79bc3801903457fbcf12b9a0815351845d2dc08..90c62a06f2ef1ec32f5c6c5f64bf63b607113880 100644 --- a/lib_dec/ivas_rom_dec.c +++ b/lib_dec/ivas_rom_dec.c @@ -38,7 +38,7 @@ #include "cnst.h" #include "ivas_cnst.h" #include -#include "wmops.h" +#include "wmc_auto.h" #include "ivas_stat_dec.h" /* clang-format off */ diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index f7511fe356446774e20d9bdaccb5d5f0b0e33560..1bc71650f8ff1918d1c462d051103c2ca52a3859 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -45,7 +45,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" #ifdef SBA_BR_SWITCHING @@ -140,17 +140,17 @@ ivas_error ivas_sba_dec_reinit( { for ( i = 0; i < getNumChanSynthesis( st_ivas ); i++ ) { - count_free( st_ivas->mem_hp20_out[i] ); + free( st_ivas->mem_hp20_out[i] ); st_ivas->mem_hp20_out[i] = NULL; } - count_free( st_ivas->mem_hp20_out ); + free( st_ivas->mem_hp20_out ); st_ivas->mem_hp20_out = NULL; } /* HOA decoder matrix */ if ( st_ivas->hoa_dec_mtx != NULL ) { - count_free( st_ivas->hoa_dec_mtx ); + free( st_ivas->hoa_dec_mtx ); st_ivas->hoa_dec_mtx = NULL; } @@ -178,7 +178,7 @@ ivas_error ivas_sba_dec_reinit( /* Custom LS configuration handle */ if ( st_ivas->hLsSetupCustom != NULL ) { - count_free( st_ivas->hLsSetupCustom ); + free( st_ivas->hLsSetupCustom ); st_ivas->hLsSetupCustom = NULL; } @@ -192,14 +192,14 @@ ivas_error ivas_sba_dec_reinit( /* Downmix structure */ if ( st_ivas->hMonoDmxRenderer != NULL ) { - count_free( st_ivas->hMonoDmxRenderer ); + free( st_ivas->hMonoDmxRenderer ); st_ivas->hMonoDmxRenderer = NULL; } /* Head track data handle */ if ( st_ivas->hHeadTrackData != NULL ) { - count_free( st_ivas->hHeadTrackData ); + free( st_ivas->hHeadTrackData ); st_ivas->hHeadTrackData = NULL; } @@ -432,7 +432,7 @@ ivas_error ivas_sba_dec_reinit( if ( n > 0 ) { - if ( ( st_ivas->mem_hp20_out = (float **) count_malloc( n * sizeof( float * ) ) ) == NULL ) + if ( ( st_ivas->mem_hp20_out = (float **) malloc( n * sizeof( float * ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HP20 filter memory\n" ) ); } @@ -444,7 +444,7 @@ ivas_error ivas_sba_dec_reinit( for ( i = 0; i < n; i++ ) { - if ( ( st_ivas->mem_hp20_out[i] = (float *) count_malloc( L_HP20_MEM * sizeof( float ) ) ) == NULL ) + if ( ( st_ivas->mem_hp20_out[i] = (float *) malloc( L_HP20_MEM * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HP20 filter memory\n" ) ); } @@ -485,7 +485,7 @@ ivas_error ivas_sba_dec_reinit( if ( st_ivas->hRenderConfig->roomAcoustics.late_reverb_on ) { - if ( ( st_ivas->hCrend = (CREND_HANDLE) count_malloc( sizeof( CREND_DATA ) ) ) == NULL ) + if ( ( st_ivas->hCrend = (CREND_HANDLE) malloc( sizeof( CREND_DATA ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR Crend\n" ); } @@ -633,7 +633,7 @@ ivas_error ivas_sba_dec_reconfigure( { if ( hDecoderConfig->ivas_total_brate == PCA_BRATE && sba_order_internal == 1 ) { - if ( ( hSpar->hPCA = (PCA_DEC_STATE *) count_malloc( sizeof( PCA_DEC_STATE ) ) ) == NULL ) + if ( ( hSpar->hPCA = (PCA_DEC_STATE *) malloc( sizeof( PCA_DEC_STATE ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for PCA decoder" ); } @@ -642,7 +642,7 @@ ivas_error ivas_sba_dec_reconfigure( } else if ( hSpar->hPCA != NULL ) { - count_free( st_ivas->hSpar->hPCA ); + free( st_ivas->hSpar->hPCA ); hSpar->hPCA = NULL; } } diff --git a/lib_dec/ivas_sba_dirac_stereo_dec.c b/lib_dec/ivas_sba_dirac_stereo_dec.c index e4ab91a7d7d531748398e61905d17472efdd0d2c..8918712fc2516037f385a846dbc99abcd77d2bfb 100644 --- a/lib_dec/ivas_sba_dirac_stereo_dec.c +++ b/lib_dec/ivas_sba_dirac_stereo_dec.c @@ -42,7 +42,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* diff --git a/lib_dec/ivas_sce_dec.c b/lib_dec/ivas_sce_dec.c index 97ee2e83369b3a6c061237d40808e638f23bb288..29ac68d0bc35e30dd20a05bf68505d5ce3d571c3 100644 --- a/lib_dec/ivas_sce_dec.c +++ b/lib_dec/ivas_sce_dec.c @@ -42,7 +42,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------* @@ -67,7 +67,7 @@ ivas_error ivas_sce_dec( error = IVAS_ERR_OK; - wmops_sub_start( "ivas_sce_dec" ); + push_wmops( "ivas_sce_dec" ); hSCE = st_ivas->hSCE[sce_id]; st = hSCE->hCoreCoder[0]; @@ -285,7 +285,7 @@ ivas_error ivas_sce_dec( #endif - wmops_sub_end(); + pop_wmops(); return error; } @@ -314,7 +314,7 @@ ivas_error create_sce_dec( * Allocate SCE handle *-----------------------------------------------------------------*/ - if ( ( hSCE = (SCE_DEC_HANDLE) count_malloc( sizeof( SCE_DEC_DATA ) ) ) == NULL ) + if ( ( hSCE = (SCE_DEC_HANDLE) malloc( sizeof( SCE_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SCE\n" ) ); } @@ -332,7 +332,7 @@ ivas_error create_sce_dec( * Core Coder, 1 instance: allocate and initialize *-----------------------------------------------------------------*/ - if ( ( st = (DEC_CORE_HANDLE) count_malloc( sizeof( Decoder_State ) ) ) == NULL ) + if ( ( st = (DEC_CORE_HANDLE) malloc( sizeof( Decoder_State ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CoreCoder structure\n" ) ); } @@ -362,7 +362,7 @@ ivas_error create_sce_dec( /* allocate and initialize "hTdCngDec" - needed in DTX */ if ( sce_id == 0 && st->hTdCngDec == NULL ) { - if ( ( st->hTdCngDec = (TD_CNG_DEC_HANDLE) count_malloc( sizeof( TD_CNG_DEC_DATA ) ) ) == NULL ) + if ( ( st->hTdCngDec = (TD_CNG_DEC_HANDLE) malloc( sizeof( TD_CNG_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DTX/TD CNG\n" ) ); } @@ -376,13 +376,13 @@ ivas_error create_sce_dec( if ( st_ivas->sba_dirac_stereo_flag ) { - if ( ( hSCE->save_synth = (float *) count_malloc( sizeof( float ) * output_frame ) ) == NULL ) + if ( ( hSCE->save_synth = (float *) malloc( sizeof( float ) * output_frame ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for stereo output\n" ) ); } set_zero( hSCE->save_synth, output_frame ); - if ( ( hSCE->save_hb_synth = (float *) count_malloc( sizeof( float ) * output_frame ) ) == NULL ) + if ( ( hSCE->save_hb_synth = (float *) malloc( sizeof( float ) * output_frame ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate HB memory for stereo output\n" ) ); } @@ -419,22 +419,22 @@ void destroy_sce_dec( { destroy_core_dec( st ); - count_free( st ); + free( st ); st = NULL; } if ( hSCE->save_synth != NULL ) { - count_free( hSCE->save_synth ); + free( hSCE->save_synth ); hSCE->save_synth = NULL; } if ( hSCE->save_hb_synth != NULL ) { - count_free( hSCE->save_hb_synth ); + free( hSCE->save_hb_synth ); hSCE->save_hb_synth = NULL; } - count_free( hSCE ); + free( hSCE ); return; } diff --git a/lib_dec/ivas_sns_dec.c b/lib_dec/ivas_sns_dec.c index 444a76cf803645eb9429c11e88db19cb13205ff8..17e7ec26b3e0ca678efe4f9b2b590aa4063fc07e 100644 --- a/lib_dec/ivas_sns_dec.c +++ b/lib_dec/ivas_sns_dec.c @@ -35,7 +35,7 @@ #include "prot.h" #include "ivas_prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------- * sns_1st_dec() diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index ceed901c1ad0ef8b65c61a7adc1e785f21f8e3b0..15b58155d00dda47299bfb6c4b42e480c7a9ad0a 100644 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -43,7 +43,7 @@ #include "ivas_stat_com.h" #include #include -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* @@ -75,7 +75,7 @@ ivas_error ivas_spar_dec_open( num_channels_internal = ivas_sba_get_nchan_metadata( sba_order_internal ); /* SPAR decoder handle */ - if ( ( hSpar = (SPAR_DEC_HANDLE) count_malloc( sizeof( SPAR_DEC_DATA ) ) ) == NULL ) + if ( ( hSpar = (SPAR_DEC_HANDLE) malloc( sizeof( SPAR_DEC_DATA ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR decoder" ); } @@ -121,7 +121,7 @@ ivas_error ivas_spar_dec_open( hSpar->hPCA = NULL; if ( st_ivas->hDecoderConfig->ivas_total_brate == PCA_BRATE && sba_order_internal == 1 ) { - if ( ( hSpar->hPCA = (PCA_DEC_STATE *) count_malloc( sizeof( PCA_DEC_STATE ) ) ) == NULL ) + if ( ( hSpar->hPCA = (PCA_DEC_STATE *) malloc( sizeof( PCA_DEC_STATE ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for PCA decoder" ); } @@ -201,11 +201,11 @@ void ivas_spar_dec_close( /* PCA */ if ( hSpar->hPCA != NULL ) { - count_free( hSpar->hPCA ); + free( hSpar->hPCA ); hSpar->hPCA = NULL; } - count_free( hSpar ); + free( hSpar ); hSpar = NULL; } @@ -231,7 +231,7 @@ ivas_error ivas_spar_dec( uint16_t bstr_meta[MAX_BITS_METADATA], *bit_stream_orig; ivas_error error; - wmops_sub_start( "ivas_spar_decode" ); + push_wmops( "ivas_spar_decode" ); error = IVAS_ERR_OK; hDecoderConfig = st_ivas->hDecoderConfig; @@ -273,7 +273,7 @@ ivas_error ivas_spar_dec( *nb_bits_read += zero_pad_bits; } - wmops_sub_end(); + pop_wmops(); return error; } @@ -626,7 +626,7 @@ static void ivas_spar_dec_MD( DECODER_CONFIG_HANDLE hDecoderConfig = st_ivas->hDecoderConfig; SPAR_DEC_HANDLE hSpar = st_ivas->hSpar; - wmops_sub_start( "ivas_spar_dec_MD" ); + push_wmops( "ivas_spar_dec_MD" ); /*---------------------------------------------------------------------* * Initialization @@ -711,7 +711,7 @@ static void ivas_spar_dec_MD( set_s( hSpar->hMdDec->valid_bands, 0, IVAS_MAX_NUM_BANDS ); } - wmops_sub_end(); + pop_wmops(); return; } @@ -905,7 +905,7 @@ void ivas_spar_dec_upmixer( DECODER_CONFIG_HANDLE hDecoderConfig; SPAR_DEC_HANDLE hSpar; - wmops_sub_start( "ivas_spar_dec_upmixer" ); + push_wmops( "ivas_spar_dec_upmixer" ); hSpar = st_ivas->hSpar; hDecoderConfig = st_ivas->hDecoderConfig; @@ -1223,7 +1223,7 @@ void ivas_spar_dec_upmixer( } } - wmops_sub_end(); + pop_wmops(); return; } diff --git a/lib_dec/ivas_spar_md_dec.c b/lib_dec/ivas_spar_md_dec.c index f316c746cf4635161a83859c498416dc27ff31f4..c6532e42f2ba2dfda4b4cebd88a11a916b487e54 100644 --- a/lib_dec/ivas_spar_md_dec.c +++ b/lib_dec/ivas_spar_md_dec.c @@ -40,7 +40,7 @@ #include "ivas_prot.h" #include "ivas_rom_com.h" #include -#include "wmops.h" +#include "wmc_auto.h" #include "ivas_stat_dec.h" /*#define ENABLE_DITHER */ /* IVAS_fmToDo: development switch */ @@ -101,137 +101,137 @@ static ivas_error ivas_spar_md_dec_matrix_open( { int16_t i, j; - if ( ( hMdDec->spar_md.band_coeffs = (ivas_band_coeffs_t *) count_malloc( IVAS_MAX_NUM_BANDS * MAX_PARAM_SPATIAL_SUBFRAMES * sizeof( ivas_band_coeffs_t ) ) ) == NULL ) + if ( ( hMdDec->spar_md.band_coeffs = (ivas_band_coeffs_t *) malloc( IVAS_MAX_NUM_BANDS * MAX_PARAM_SPATIAL_SUBFRAMES * sizeof( ivas_band_coeffs_t ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for band_coeffs in SPAR MD" ); } - if ( ( hMdDec->mixer_mat = (float ***) count_malloc( num_channels * sizeof( float ** ) ) ) == NULL ) + if ( ( hMdDec->mixer_mat = (float ***) malloc( num_channels * sizeof( float ** ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); } for ( i = 0; i < num_channels; i++ ) { - if ( ( hMdDec->mixer_mat[i] = (float **) count_malloc( num_channels * sizeof( float * ) ) ) == NULL ) + if ( ( hMdDec->mixer_mat[i] = (float **) malloc( num_channels * sizeof( float * ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); } for ( j = 0; j < num_channels; j++ ) { - if ( ( hMdDec->mixer_mat[i][j] = (float *) count_malloc( MAX_PARAM_SPATIAL_SUBFRAMES * IVAS_MAX_NUM_BANDS * sizeof( float ) ) ) == NULL ) + if ( ( hMdDec->mixer_mat[i][j] = (float *) malloc( MAX_PARAM_SPATIAL_SUBFRAMES * IVAS_MAX_NUM_BANDS * sizeof( float ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); } } } - if ( ( hMdDec->spar_coeffs.C_re = (float ***) count_malloc( num_channels * sizeof( float ** ) ) ) == NULL ) + if ( ( hMdDec->spar_coeffs.C_re = (float ***) malloc( num_channels * sizeof( float ** ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); } for ( i = 0; i < num_channels; i++ ) { - if ( ( hMdDec->spar_coeffs.C_re[i] = (float **) count_malloc( num_channels * sizeof( float * ) ) ) == NULL ) + if ( ( hMdDec->spar_coeffs.C_re[i] = (float **) malloc( num_channels * sizeof( float * ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); } for ( j = 0; j < num_channels; j++ ) { - if ( ( hMdDec->spar_coeffs.C_re[i][j] = (float *) count_malloc( MAX_PARAM_SPATIAL_SUBFRAMES * IVAS_MAX_NUM_BANDS * sizeof( float ) ) ) == NULL ) + if ( ( hMdDec->spar_coeffs.C_re[i][j] = (float *) malloc( MAX_PARAM_SPATIAL_SUBFRAMES * IVAS_MAX_NUM_BANDS * sizeof( float ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); } } } - if ( ( hMdDec->spar_coeffs.P_re = (float ***) count_malloc( num_channels * sizeof( float ** ) ) ) == NULL ) + if ( ( hMdDec->spar_coeffs.P_re = (float ***) malloc( num_channels * sizeof( float ** ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); } for ( i = 0; i < num_channels; i++ ) { - if ( ( hMdDec->spar_coeffs.P_re[i] = (float **) count_malloc( num_channels * sizeof( float * ) ) ) == NULL ) + if ( ( hMdDec->spar_coeffs.P_re[i] = (float **) malloc( num_channels * sizeof( float * ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); } for ( j = 0; j < num_channels; j++ ) { - if ( ( hMdDec->spar_coeffs.P_re[i][j] = (float *) count_malloc( MAX_PARAM_SPATIAL_SUBFRAMES * IVAS_MAX_NUM_BANDS * sizeof( float ) ) ) == NULL ) + if ( ( hMdDec->spar_coeffs.P_re[i][j] = (float *) malloc( MAX_PARAM_SPATIAL_SUBFRAMES * IVAS_MAX_NUM_BANDS * sizeof( float ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); } } } - if ( ( hMdDec->spar_coeffs_prev.C_re = (float ***) count_malloc( num_channels * sizeof( float ** ) ) ) == NULL ) + if ( ( hMdDec->spar_coeffs_prev.C_re = (float ***) malloc( num_channels * sizeof( float ** ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); } for ( i = 0; i < num_channels; i++ ) { - if ( ( hMdDec->spar_coeffs_prev.C_re[i] = (float **) count_malloc( num_channels * sizeof( float * ) ) ) == NULL ) + if ( ( hMdDec->spar_coeffs_prev.C_re[i] = (float **) malloc( num_channels * sizeof( float * ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); } for ( j = 0; j < num_channels; j++ ) { - if ( ( hMdDec->spar_coeffs_prev.C_re[i][j] = (float *) count_malloc( IVAS_MAX_NUM_BANDS * sizeof( float ) ) ) == NULL ) + if ( ( hMdDec->spar_coeffs_prev.C_re[i][j] = (float *) malloc( IVAS_MAX_NUM_BANDS * sizeof( float ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); } } } - if ( ( hMdDec->spar_coeffs_prev.P_re = (float ***) count_malloc( num_channels * sizeof( float ** ) ) ) == NULL ) + if ( ( hMdDec->spar_coeffs_prev.P_re = (float ***) malloc( num_channels * sizeof( float ** ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); } for ( i = 0; i < num_channels; i++ ) { - if ( ( hMdDec->spar_coeffs_prev.P_re[i] = (float **) count_malloc( num_channels * sizeof( float * ) ) ) == NULL ) + if ( ( hMdDec->spar_coeffs_prev.P_re[i] = (float **) malloc( num_channels * sizeof( float * ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); } for ( j = 0; j < num_channels; j++ ) { - if ( ( hMdDec->spar_coeffs_prev.P_re[i][j] = (float *) count_malloc( IVAS_MAX_NUM_BANDS * sizeof( float ) ) ) == NULL ) + if ( ( hMdDec->spar_coeffs_prev.P_re[i][j] = (float *) malloc( IVAS_MAX_NUM_BANDS * sizeof( float ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); } } } - if ( ( hMdDec->spar_coeffs_tar.C_re = (float ***) count_malloc( num_channels * sizeof( float ** ) ) ) == NULL ) + if ( ( hMdDec->spar_coeffs_tar.C_re = (float ***) malloc( num_channels * sizeof( float ** ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); } for ( i = 0; i < num_channels; i++ ) { - if ( ( hMdDec->spar_coeffs_tar.C_re[i] = (float **) count_malloc( num_channels * sizeof( float * ) ) ) == NULL ) + if ( ( hMdDec->spar_coeffs_tar.C_re[i] = (float **) malloc( num_channels * sizeof( float * ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); } for ( j = 0; j < num_channels; j++ ) { - if ( ( hMdDec->spar_coeffs_tar.C_re[i][j] = (float *) count_malloc( IVAS_MAX_NUM_BANDS * sizeof( float ) ) ) == NULL ) + if ( ( hMdDec->spar_coeffs_tar.C_re[i][j] = (float *) malloc( IVAS_MAX_NUM_BANDS * sizeof( float ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); } } } - if ( ( hMdDec->spar_coeffs_tar.P_re = (float ***) count_malloc( num_channels * sizeof( float ** ) ) ) == NULL ) + if ( ( hMdDec->spar_coeffs_tar.P_re = (float ***) malloc( num_channels * sizeof( float ** ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); } for ( i = 0; i < num_channels; i++ ) { - if ( ( hMdDec->spar_coeffs_tar.P_re[i] = (float **) count_malloc( num_channels * sizeof( float * ) ) ) == NULL ) + if ( ( hMdDec->spar_coeffs_tar.P_re[i] = (float **) malloc( num_channels * sizeof( float * ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); } for ( j = 0; j < num_channels; j++ ) { - if ( ( hMdDec->spar_coeffs_tar.P_re[i][j] = (float *) count_malloc( IVAS_MAX_NUM_BANDS * sizeof( float ) ) ) == NULL ) + if ( ( hMdDec->spar_coeffs_tar.P_re[i][j] = (float *) malloc( IVAS_MAX_NUM_BANDS * sizeof( float ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); } @@ -260,7 +260,7 @@ ivas_error ivas_spar_md_dec_open( error = IVAS_ERR_OK; - if ( ( hMdDec = (ivas_spar_md_dec_state_t *) count_malloc( sizeof( ivas_spar_md_dec_state_t ) ) ) == NULL ) + if ( ( hMdDec = (ivas_spar_md_dec_state_t *) malloc( sizeof( ivas_spar_md_dec_state_t ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD decoder" ); } @@ -298,7 +298,7 @@ static void ivas_spar_md_dec_matrix_close( if ( hMdDecoder->spar_md.band_coeffs != NULL ) { - count_free( hMdDecoder->spar_md.band_coeffs ); + free( hMdDecoder->spar_md.band_coeffs ); hMdDecoder->spar_md.band_coeffs = NULL; } if ( hMdDecoder->mixer_mat != NULL ) @@ -307,11 +307,11 @@ static void ivas_spar_md_dec_matrix_close( { for ( j = 0; j < num_channels; j++ ) { - count_free( hMdDecoder->mixer_mat[i][j] ); + free( hMdDecoder->mixer_mat[i][j] ); } - count_free( hMdDecoder->mixer_mat[i] ); + free( hMdDecoder->mixer_mat[i] ); } - count_free( hMdDecoder->mixer_mat ); + free( hMdDecoder->mixer_mat ); } if ( hMdDecoder->spar_coeffs.C_re != NULL ) @@ -320,11 +320,11 @@ static void ivas_spar_md_dec_matrix_close( { for ( j = 0; j < num_channels; j++ ) { - count_free( hMdDecoder->spar_coeffs.C_re[i][j] ); + free( hMdDecoder->spar_coeffs.C_re[i][j] ); } - count_free( hMdDecoder->spar_coeffs.C_re[i] ); + free( hMdDecoder->spar_coeffs.C_re[i] ); } - count_free( hMdDecoder->spar_coeffs.C_re ); + free( hMdDecoder->spar_coeffs.C_re ); } if ( hMdDecoder->spar_coeffs.P_re != NULL ) @@ -333,11 +333,11 @@ static void ivas_spar_md_dec_matrix_close( { for ( j = 0; j < num_channels; j++ ) { - count_free( hMdDecoder->spar_coeffs.P_re[i][j] ); + free( hMdDecoder->spar_coeffs.P_re[i][j] ); } - count_free( hMdDecoder->spar_coeffs.P_re[i] ); + free( hMdDecoder->spar_coeffs.P_re[i] ); } - count_free( hMdDecoder->spar_coeffs.P_re ); + free( hMdDecoder->spar_coeffs.P_re ); } if ( hMdDecoder->spar_coeffs_prev.C_re != NULL ) @@ -346,11 +346,11 @@ static void ivas_spar_md_dec_matrix_close( { for ( j = 0; j < num_channels; j++ ) { - count_free( hMdDecoder->spar_coeffs_prev.C_re[i][j] ); + free( hMdDecoder->spar_coeffs_prev.C_re[i][j] ); } - count_free( hMdDecoder->spar_coeffs_prev.C_re[i] ); + free( hMdDecoder->spar_coeffs_prev.C_re[i] ); } - count_free( hMdDecoder->spar_coeffs_prev.C_re ); + free( hMdDecoder->spar_coeffs_prev.C_re ); } if ( hMdDecoder->spar_coeffs_prev.P_re != NULL ) @@ -359,11 +359,11 @@ static void ivas_spar_md_dec_matrix_close( { for ( j = 0; j < num_channels; j++ ) { - count_free( hMdDecoder->spar_coeffs_prev.P_re[i][j] ); + free( hMdDecoder->spar_coeffs_prev.P_re[i][j] ); } - count_free( hMdDecoder->spar_coeffs_prev.P_re[i] ); + free( hMdDecoder->spar_coeffs_prev.P_re[i] ); } - count_free( hMdDecoder->spar_coeffs_prev.P_re ); + free( hMdDecoder->spar_coeffs_prev.P_re ); } if ( hMdDecoder->spar_coeffs_tar.C_re != NULL ) @@ -372,11 +372,11 @@ static void ivas_spar_md_dec_matrix_close( { for ( j = 0; j < num_channels; j++ ) { - count_free( hMdDecoder->spar_coeffs_tar.C_re[i][j] ); + free( hMdDecoder->spar_coeffs_tar.C_re[i][j] ); } - count_free( hMdDecoder->spar_coeffs_tar.C_re[i] ); + free( hMdDecoder->spar_coeffs_tar.C_re[i] ); } - count_free( hMdDecoder->spar_coeffs_tar.C_re ); + free( hMdDecoder->spar_coeffs_tar.C_re ); } if ( hMdDecoder->spar_coeffs_tar.P_re != NULL ) @@ -385,11 +385,11 @@ static void ivas_spar_md_dec_matrix_close( { for ( j = 0; j < num_channels; j++ ) { - count_free( hMdDecoder->spar_coeffs_tar.P_re[i][j] ); + free( hMdDecoder->spar_coeffs_tar.P_re[i][j] ); } - count_free( hMdDecoder->spar_coeffs_tar.P_re[i] ); + free( hMdDecoder->spar_coeffs_tar.P_re[i] ); } - count_free( hMdDecoder->spar_coeffs_tar.P_re ); + free( hMdDecoder->spar_coeffs_tar.P_re ); } return; @@ -416,7 +416,7 @@ void ivas_spar_md_dec_close( if ( *hMdDec != NULL ) { - count_free( *hMdDec ); + free( *hMdDec ); *hMdDec = NULL; } diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index eae30908ab645a813d4ac5aa150eb5fa9daf6c15..bef074b3e10b73774ce753bcc374024b567f3ddf 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -703,7 +703,6 @@ typedef struct ivas_dirac_dec_data_structure float *proto_frame_dec_f; DIRAC_DEC_STACK_MEM stack_mem; - MASA_STEREO_TYPE_DETECT *masa_stereo_type_detect; int16_t num_ele_spk_no_diffuse_rendering; @@ -1539,7 +1538,7 @@ typedef struct int16_t previtd; int16_t filterlength; float mem_itd[ITD_MEM_LEN]; - float hrf_left_prev[SFX_SPAT_BIN_MAX_FILTER_LENGTH]; /* Todo: Should we allocate these buffers with count_malloc instead of the maximum length? */ + float hrf_left_prev[SFX_SPAT_BIN_MAX_FILTER_LENGTH]; /* Todo: Should we allocate these buffers with malloc() instead of the maximum length? */ float hrf_right_prev[SFX_SPAT_BIN_MAX_FILTER_LENGTH]; float azim_prev; float elev_prev; diff --git a/lib_dec/ivas_stereo_adapt_GR_dec.c b/lib_dec/ivas_stereo_adapt_GR_dec.c index ec84df98310be274e43335b55e6d0e899e70161b..313ca6b770ac8312a1aa75f3ebecadd7c0a3a4bb 100644 --- a/lib_dec/ivas_stereo_adapt_GR_dec.c +++ b/lib_dec/ivas_stereo_adapt_GR_dec.c @@ -33,7 +33,7 @@ #include #include "options.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" #include "ivas_prot.h" #include "ivas_rom_com.h" #include "rom_dec.h" diff --git a/lib_dec/ivas_stereo_cng_dec.c b/lib_dec/ivas_stereo_cng_dec.c index 6e375113800575c58259ed9db444a56bd926648e..59d00415544d575216bf6728d94f6f06c7bb78c9 100644 --- a/lib_dec/ivas_stereo_cng_dec.c +++ b/lib_dec/ivas_stereo_cng_dec.c @@ -41,7 +41,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------- * Local constants @@ -226,7 +226,7 @@ static void stereo_dft_generate_comfort_noise( hFdCngCom = st->hFdCngDec->hFdCngCom; - wmops_sub_start( "DFT_CNG" ); + push_wmops( "DFT_CNG" ); set_f( dmpf, 0.0f, M + 2 ); set_f( Atmp, 0.0f, M + 2 ); @@ -626,7 +626,7 @@ static void stereo_dft_generate_comfort_noise( st->hFdCngDec->ms_last_inactive_bwidth = st->bwidth; } - wmops_sub_end(); + pop_wmops(); return; } diff --git a/lib_dec/ivas_stereo_dft_dec.c b/lib_dec/ivas_stereo_dft_dec.c index cf7783929c3db77ced091c8bebe3c7d4d02c9ec4..71c07bfb5fa924eec55116299cf457af9e836a02 100644 --- a/lib_dec/ivas_stereo_dft_dec.c +++ b/lib_dec/ivas_stereo_dft_dec.c @@ -45,7 +45,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* @@ -262,22 +262,22 @@ ivas_error stereo_dft_dec_create( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error: DFT Stereo memory already allocated\n" ); } - if ( ( hStereoDft_loc = (STEREO_DFT_DEC_DATA_HANDLE) count_malloc( sizeof( STEREO_DFT_DEC_DATA ) ) ) == NULL ) + if ( ( hStereoDft_loc = (STEREO_DFT_DEC_DATA_HANDLE) malloc( sizeof( STEREO_DFT_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DFT Stereo\n" ) ); } - if ( ( hStereoDft_loc->hConfig = (STEREO_DFT_CONFIG_DATA_HANDLE) count_malloc( sizeof( STEREO_DFT_CONFIG_DATA ) ) ) == NULL ) + if ( ( hStereoDft_loc->hConfig = (STEREO_DFT_CONFIG_DATA_HANDLE) malloc( sizeof( STEREO_DFT_CONFIG_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DFT Stereo Config\n" ) ); } - if ( ( hStereoDft_loc->hBpf = (BPF_DEC_HANDLE) count_malloc( sizeof( BPF_DEC_DATA ) ) ) == NULL ) + if ( ( hStereoDft_loc->hBpf = (BPF_DEC_HANDLE) malloc( sizeof( BPF_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for BPF handle\n" ) ); } - if ( ( hStereoDft_loc->hTcxLtpDec = (TCX_LTP_DEC_HANDLE) count_malloc( sizeof( TCX_LTP_DEC_DATA ) ) ) == NULL ) + if ( ( hStereoDft_loc->hTcxLtpDec = (TCX_LTP_DEC_HANDLE) malloc( sizeof( TCX_LTP_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TCX-LTP handle\n" ) ); } @@ -590,23 +590,23 @@ void stereo_dft_dec_destroy( if ( hStereoDft->hConfig != NULL ) { - count_free( hStereoDft->hConfig ); + free( hStereoDft->hConfig ); hStereoDft->hConfig = NULL; } if ( hStereoDft->hBpf != NULL ) { - count_free( hStereoDft->hBpf ); + free( hStereoDft->hBpf ); hStereoDft->hBpf = NULL; } if ( hStereoDft->hTcxLtpDec != NULL ) { - count_free( hStereoDft->hTcxLtpDec ); + free( hStereoDft->hTcxLtpDec ); hStereoDft->hTcxLtpDec = NULL; } - count_free( hStereoDft ); + free( hStereoDft ); hStereoDft = NULL; return; @@ -650,7 +650,7 @@ void stereo_dft_dec_analyze( int16_t mem_size; int16_t ovl2; - wmops_sub_start( "DFT_analysis" ); + push_wmops( "DFT_analysis" ); hStereoDft = hCPE->hStereoDft; @@ -772,7 +772,7 @@ void stereo_dft_dec_analyze( if ( hCPE->nchan_out == 1 && hCPE->hStereoDft->hConfig->res_cod_mode == STEREO_DFT_RES_COD_OFF ) { - wmops_sub_end(); + pop_wmops(); return; } @@ -923,7 +923,7 @@ void stereo_dft_dec_analyze( } } - wmops_sub_end(); + pop_wmops(); return; } @@ -953,7 +953,7 @@ void stereo_dft_dec_synthesize( int16_t ovl2, flat_portion_end; float ola_buff[STEREO_DFT32MS_OVL2_MAX]; int16_t moffset; - wmops_sub_start( "DFT_synthesis" ); + push_wmops( "DFT_synthesis" ); /*-----------------------------------------------------------------* * Initialization @@ -1079,7 +1079,7 @@ void stereo_dft_dec_synthesize( } #endif - wmops_sub_end(); + pop_wmops(); return; } @@ -2225,7 +2225,7 @@ void stereo_dft_dec_read_BS( fprintf( pF, "\nGain: %d ", I ); #endif - wmops_sub_start( "residual_decode" ); + push_wmops( "residual_decode" ); if ( I != ECSQ_GLOBAL_GAIN_INDEX_ALL_ZERO ) { ECSQ_init_instance( &ecsq_inst, 0 /*dummy index*/, &range_uni_dec_state ); @@ -2257,7 +2257,7 @@ void stereo_dft_dec_read_BS( } ( *nb_bits ) += n_bits; - wmops_sub_end(); + pop_wmops(); #ifdef DEBUG_MODE_DFT fprintf( pF, "%d (max: %d)", n_bits + STEREO_DFT_RES_GLOBAL_GAIN_BITS, max_bits ); @@ -2414,7 +2414,7 @@ void stereo_dft_generate_res_pred( float g2; int16_t nbands_respred; - wmops_sub_start( "gen_respred" ); + push_wmops( "gen_respred" ); /* smoothing and limiting parameters */ alpha = hStereoDft->wasTransient ? 0 : 0.2f; /* no smoothing after transients */ @@ -2746,7 +2746,7 @@ void stereo_dft_generate_res_pred( } } - wmops_sub_end(); + pop_wmops(); return; } diff --git a/lib_dec/ivas_stereo_dft_dec_dmx.c b/lib_dec/ivas_stereo_dft_dec_dmx.c index 648893cbf1c4c81dabc432af5c0d68d5ce11b70b..d1e85d7af3b7374bc150a6677083ca598e3b1948 100644 --- a/lib_dec/ivas_stereo_dft_dec_dmx.c +++ b/lib_dec/ivas_stereo_dft_dec_dmx.c @@ -44,7 +44,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------- diff --git a/lib_dec/ivas_stereo_dft_plc.c b/lib_dec/ivas_stereo_dft_plc.c index 34eaa2013c12cb3d400c3bfc5e7833575b5807e6..a616ed82ca157c90f748cd28845e55644599a8e3 100644 --- a/lib_dec/ivas_stereo_dft_plc.c +++ b/lib_dec/ivas_stereo_dft_plc.c @@ -40,7 +40,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------- * Local constants diff --git a/lib_dec/ivas_stereo_eclvq_dec.c b/lib_dec/ivas_stereo_eclvq_dec.c index 41ed8924d1e25186b0c900cb4cd63edb0b6085e8..06529b3d9bf102139c479c88d47c7ad56de06b1e 100644 --- a/lib_dec/ivas_stereo_eclvq_dec.c +++ b/lib_dec/ivas_stereo_eclvq_dec.c @@ -38,7 +38,7 @@ #include "ivas_rom_dec.h" #include #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------- diff --git a/lib_dec/ivas_stereo_esf_dec.c b/lib_dec/ivas_stereo_esf_dec.c index 0ab8bcdb499912d41bbae9e98fe3803883baf3c4..c2a6e58f4ec9c825648720d2c13625c36a650311 100644 --- a/lib_dec/ivas_stereo_esf_dec.c +++ b/lib_dec/ivas_stereo_esf_dec.c @@ -38,7 +38,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * init_basic_allpass() diff --git a/lib_dec/ivas_stereo_ica_dec.c b/lib_dec/ivas_stereo_ica_dec.c index 122f739dbab18da6fffa409f908bdffe9f2884ae..6864accb298d6f475426546ff32dfd6c4fd7bb5f 100644 --- a/lib_dec/ivas_stereo_ica_dec.c +++ b/lib_dec/ivas_stereo_ica_dec.c @@ -41,7 +41,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" #include "rom_com.h" #include "ivas_rom_com.h" diff --git a/lib_dec/ivas_stereo_icbwe_dec.c b/lib_dec/ivas_stereo_icbwe_dec.c index 6c3fef9eae7642edcbb106364121c02d996d04d6..59f0bc90f22ad904c5d62ee3d190395a7549ff22 100644 --- a/lib_dec/ivas_stereo_icbwe_dec.c +++ b/lib_dec/ivas_stereo_icbwe_dec.c @@ -38,7 +38,7 @@ #include "ivas_cnst.h" #include "prot.h" #include "ivas_prot.h" -#include "wmops.h" +#include "wmc_auto.h" #include "rom_com.h" #include "ivas_rom_com.h" #ifdef DEBUGGING diff --git a/lib_dec/ivas_stereo_mdct_core_dec.c b/lib_dec/ivas_stereo_mdct_core_dec.c index d0d05f1fa0d66b593f6126fa67dafa95a417953d..766a9f7316a6d63b622cf5852dadde136c57f509 100644 --- a/lib_dec/ivas_stereo_mdct_core_dec.c +++ b/lib_dec/ivas_stereo_mdct_core_dec.c @@ -42,7 +42,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------- @@ -181,7 +181,7 @@ void stereo_mdct_core_dec( float signal_out_tmp[CPE_CHANNELS][L_FRAME_PLUS]; - wmops_sub_start( "stereo_mdct_core_dec" ); + push_wmops( "stereo_mdct_core_dec" ); /*--------------------------------------------------------------------------------* * Initializations @@ -365,7 +365,7 @@ void stereo_mdct_core_dec( mvr2r( signal_outFB_tmp[0], signal_outFB[0], hCPE->hCoreCoder[0]->hTcxDec->L_frameTCX ); mvr2r( signal_outFB_tmp[1], signal_outFB[1], hCPE->hCoreCoder[1]->hTcxDec->L_frameTCX ); - wmops_sub_end(); + pop_wmops(); return; } diff --git a/lib_dec/ivas_stereo_mdct_stereo_dec.c b/lib_dec/ivas_stereo_mdct_stereo_dec.c index fc53699ec5e4d355d8959c9c944d1a412d46a928..8967ad3616519ee6c3155ae88581e711f8885f9a 100755 --- a/lib_dec/ivas_stereo_mdct_stereo_dec.c +++ b/lib_dec/ivas_stereo_mdct_stereo_dec.c @@ -37,7 +37,7 @@ #include "ivas_cnst.h" #include "ivas_prot.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* diff --git a/lib_dec/ivas_stereo_switching_dec.c b/lib_dec/ivas_stereo_switching_dec.c index 781834d29ee12ccd3e08588a9c0a131eb8b79d8a..b04cae97a9404ba0081c2f303309445abaf5ed1e 100755 --- a/lib_dec/ivas_stereo_switching_dec.c +++ b/lib_dec/ivas_stereo_switching_dec.c @@ -40,7 +40,7 @@ #include "prot.h" #include "ivas_prot.h" #include "ivas_rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" #include @@ -56,7 +56,7 @@ static ivas_error allocate_CoreCoder_TCX( { if ( st->hTcxDec == NULL ) { - if ( ( st->hTcxDec = (TCX_DEC_HANDLE) count_malloc( sizeof( TCX_DEC_DATA ) ) ) == NULL ) + if ( ( st->hTcxDec = (TCX_DEC_HANDLE) malloc( sizeof( TCX_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for hTcxDec" ) ); } @@ -70,7 +70,7 @@ static ivas_error allocate_CoreCoder_TCX( if ( st->hTcxCfg == NULL ) { - if ( ( st->hTcxCfg = (TCX_CONFIG_HANDLE) count_malloc( sizeof( TCX_config ) ) ) == NULL ) + if ( ( st->hTcxCfg = (TCX_CONFIG_HANDLE) malloc( sizeof( TCX_config ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for hTcxCfg" ) ); } @@ -79,7 +79,7 @@ static ivas_error allocate_CoreCoder_TCX( /* allocated TCX-LTP structure for second channel */ if ( st->hTcxLtpDec == NULL ) { - if ( ( st->hTcxLtpDec = (TCX_LTP_DEC_HANDLE) count_malloc( sizeof( TCX_LTP_DEC_DATA ) ) ) == NULL ) + if ( ( st->hTcxLtpDec = (TCX_LTP_DEC_HANDLE) malloc( sizeof( TCX_LTP_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for TCX-LTP handle\n" ) ); } @@ -90,7 +90,7 @@ static ivas_error allocate_CoreCoder_TCX( /* allocate HQ structure */ if ( st->hHQ_core == NULL ) { - if ( ( st->hHQ_core = (HQ_DEC_HANDLE) count_malloc( sizeof( HQ_DEC_DATA ) ) ) == NULL ) + if ( ( st->hHQ_core = (HQ_DEC_HANDLE) malloc( sizeof( HQ_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for HQ core\n" ) ); } @@ -100,7 +100,7 @@ static ivas_error allocate_CoreCoder_TCX( if ( st->hIGFDec == NULL ) { - if ( ( st->hIGFDec = (IGF_DEC_INSTANCE_HANDLE) count_malloc( sizeof( IGFDEC_INSTANCE ) ) ) == NULL ) + if ( ( st->hIGFDec = (IGF_DEC_INSTANCE_HANDLE) malloc( sizeof( IGFDEC_INSTANCE ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for IGF\n" ) ); } @@ -111,7 +111,7 @@ static ivas_error allocate_CoreCoder_TCX( if ( st->hTonalMDCTConc == NULL ) { - if ( ( st->hTonalMDCTConc = (TonalMDCTConcealPtr) count_malloc( sizeof( TonalMDCTConceal_INSTANCE ) ) ) == NULL ) + if ( ( st->hTonalMDCTConc = (TonalMDCTConcealPtr) malloc( sizeof( TonalMDCTConceal_INSTANCE ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for TonalMDCTConcealment\n" ) ); } @@ -140,7 +140,7 @@ static ivas_error allocate_CoreCoder( if ( st->hGSCDec == NULL ) { - if ( ( st->hGSCDec = (GSC_DEC_HANDLE) count_malloc( sizeof( GSC_DEC_DATA ) ) ) == NULL ) + if ( ( st->hGSCDec = (GSC_DEC_HANDLE) malloc( sizeof( GSC_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for GSC\n" ) ); } @@ -150,7 +150,7 @@ static ivas_error allocate_CoreCoder( if ( st->hPFstat == NULL ) { - if ( ( st->hPFstat = (PFSTAT_HANDLE) count_malloc( sizeof( PFSTAT ) ) ) == NULL ) + if ( ( st->hPFstat = (PFSTAT_HANDLE) malloc( sizeof( PFSTAT ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for NB/formant postflter\n" ) ); } @@ -161,7 +161,7 @@ static ivas_error allocate_CoreCoder( if ( st->hMusicPF == NULL ) { - if ( ( st->hMusicPF = (MUSIC_POSTFILT_HANDLE) count_malloc( sizeof( MUSIC_POSTFILT_DATA ) ) ) == NULL ) + if ( ( st->hMusicPF = (MUSIC_POSTFILT_HANDLE) malloc( sizeof( MUSIC_POSTFILT_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LD music postflter\n" ) ); } @@ -171,7 +171,7 @@ static ivas_error allocate_CoreCoder( if ( st->hBPF == NULL ) { - if ( ( st->hBPF = (BPF_DEC_HANDLE) count_malloc( sizeof( BPF_DEC_DATA ) ) ) == NULL ) + if ( ( st->hBPF = (BPF_DEC_HANDLE) malloc( sizeof( BPF_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for BPF\n" ) ); } @@ -181,7 +181,7 @@ static ivas_error allocate_CoreCoder( if ( st->hBWE_zero == NULL ) { - if ( ( st->hBWE_zero = (ZERO_BWE_DEC_HANDLE) count_malloc( sizeof( ZERO_BWE_DEC_DATA ) ) ) == NULL ) + if ( ( st->hBWE_zero = (ZERO_BWE_DEC_HANDLE) malloc( sizeof( ZERO_BWE_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for zero BWE\n" ) ); } @@ -223,25 +223,25 @@ static void deallocate_CoreCoder_TCX( { if ( st->hTcxDec != NULL ) { - count_free( st->hTcxDec ); + free( st->hTcxDec ); st->hTcxDec = NULL; } if ( st->hTcxCfg != NULL ) { - count_free( st->hTcxCfg ); + free( st->hTcxCfg ); st->hTcxCfg = NULL; } if ( st->hIGFDec != NULL ) { - count_free( st->hIGFDec ); + free( st->hIGFDec ); st->hIGFDec = NULL; } if ( st->hTonalMDCTConc != NULL ) { - count_free( st->hTonalMDCTConc ); + free( st->hTonalMDCTConc ); st->hTonalMDCTConc = NULL; } @@ -261,31 +261,31 @@ static void deallocate_CoreCoder( { if ( st->hGSCDec != NULL ) { - count_free( st->hGSCDec ); + free( st->hGSCDec ); st->hGSCDec = NULL; } if ( st->hPFstat != NULL ) { - count_free( st->hPFstat ); + free( st->hPFstat ); st->hPFstat = NULL; } if ( st->hMusicPF != NULL ) { - count_free( st->hMusicPF ); + free( st->hMusicPF ); st->hMusicPF = NULL; } if ( st->hBPF != NULL ) { - count_free( st->hBPF ); + free( st->hBPF ); st->hBPF = NULL; } if ( st->hBWE_zero != NULL ) { - count_free( st->hBWE_zero ); + free( st->hBWE_zero ); st->hBWE_zero = NULL; } @@ -405,13 +405,13 @@ ivas_error stereo_memory_dec( /* deallocate data structure of the previous CPE mode */ if ( hCPE->hStereoTD != NULL ) { - count_free( hCPE->hStereoTD ); + free( hCPE->hStereoTD ); hCPE->hStereoTD = NULL; } if ( hCPE->hStereoMdct != NULL ) { - count_free( hCPE->hStereoMdct ); + free( hCPE->hStereoMdct ); hCPE->hStereoMdct = NULL; } @@ -436,7 +436,7 @@ ivas_error stereo_memory_dec( /* allocate ICBWE structure */ if ( hCPE->hStereoICBWE == NULL ) { - if ( ( hCPE->hStereoICBWE = (STEREO_ICBWE_DEC_HANDLE) count_malloc( sizeof( STEREO_ICBWE_DEC_DATA ) ) ) == NULL ) + if ( ( hCPE->hStereoICBWE = (STEREO_ICBWE_DEC_HANDLE) malloc( sizeof( STEREO_ICBWE_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Stereo ICBWE \n" ) ); } @@ -448,7 +448,7 @@ ivas_error stereo_memory_dec( st = hCPE->hCoreCoder[0]; if ( st->hHQ_core == NULL ) { - if ( ( st->hHQ_core = (HQ_DEC_HANDLE) count_malloc( sizeof( HQ_DEC_DATA ) ) ) == NULL ) + if ( ( st->hHQ_core = (HQ_DEC_HANDLE) malloc( sizeof( HQ_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HQ core\n" ) ); } @@ -459,7 +459,7 @@ ivas_error stereo_memory_dec( /* allocate TD CNG handle */ if ( st->idchan == 0 && st->hTdCngDec == NULL ) { - if ( ( st->hTdCngDec = (TD_CNG_DEC_HANDLE) count_malloc( sizeof( TD_CNG_DEC_DATA ) ) ) == NULL ) + if ( ( st->hTdCngDec = (TD_CNG_DEC_HANDLE) malloc( sizeof( TD_CNG_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DTX/TD CNG\n" ) ); } @@ -483,7 +483,7 @@ ivas_error stereo_memory_dec( if ( hCPE->hStereoMdct != NULL ) { - count_free( hCPE->hStereoMdct ); + free( hCPE->hStereoMdct ); hCPE->hStereoMdct = NULL; } @@ -501,7 +501,7 @@ ivas_error stereo_memory_dec( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error: TD Stereo memory already allocated\n" ); } - if ( ( hCPE->hStereoTD = (STEREO_TD_DEC_DATA_HANDLE) count_malloc( sizeof( STEREO_TD_DEC_DATA ) ) ) == NULL ) + if ( ( hCPE->hStereoTD = (STEREO_TD_DEC_DATA_HANDLE) malloc( sizeof( STEREO_TD_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TD Stereo\n" ) ); } @@ -525,7 +525,7 @@ ivas_error stereo_memory_dec( st = hCPE->hCoreCoder[1]; if ( st->hTcxLtpDec != 0 ) { - count_free( st->hTcxLtpDec ); + free( st->hTcxLtpDec ); st->hTcxLtpDec = NULL; } @@ -541,14 +541,14 @@ ivas_error stereo_memory_dec( /* deallocated HQ-core for second channel */ if ( st->hHQ_core != 0 ) { - count_free( st->hHQ_core ); + free( st->hHQ_core ); st->hHQ_core = NULL; } /* allocate DFT stereo mono DMX data structure */ if ( hCPE->nchan_out == 1 && hCPE->hStereoDftDmx == NULL ) { - if ( ( hCPE->hStereoDftDmx = (STEREO_DFT_DMX_DATA_HANDLE) count_malloc( sizeof( STEREO_DFT_DMX_DATA ) ) ) == NULL ) + if ( ( hCPE->hStereoDftDmx = (STEREO_DFT_DMX_DATA_HANDLE) malloc( sizeof( STEREO_DFT_DMX_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Stereo DFT mono output\n" ) ); } @@ -558,7 +558,7 @@ ivas_error stereo_memory_dec( /* allocate TCA data structure */ if ( hCPE->nchan_out != 1 && hCPE->hStereoTCA == NULL ) { - if ( ( hCPE->hStereoTCA = (STEREO_TCA_DEC_HANDLE) count_malloc( sizeof( STEREO_TCA_DEC_DATA ) ) ) == NULL ) + if ( ( hCPE->hStereoTCA = (STEREO_TCA_DEC_HANDLE) malloc( sizeof( STEREO_TCA_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Stereo TCA\n" ) ); } @@ -577,14 +577,14 @@ ivas_error stereo_memory_dec( /* allocate BWEs for primary channel */ if ( st->hBWE_TD == NULL ) { - if ( ( st->hBWE_TD = (TD_BWE_DEC_HANDLE) count_malloc( sizeof( TD_BWE_DEC_DATA ) ) ) == NULL ) + if ( ( st->hBWE_TD = (TD_BWE_DEC_HANDLE) malloc( sizeof( TD_BWE_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TD BWE\n" ) ); } td_bwe_dec_init( st->hBWE_TD, -1, st->output_Fs ); - if ( ( st->hBWE_FD = (FD_BWE_DEC_HANDLE) count_malloc( sizeof( FD_BWE_DEC_DATA ) ) ) == NULL ) + if ( ( st->hBWE_FD = (FD_BWE_DEC_HANDLE) malloc( sizeof( FD_BWE_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FD BWE\n" ) ); } @@ -607,7 +607,7 @@ ivas_error stereo_memory_dec( /* allocate stereo CNG structure */ if ( hCPE->hStereoCng == NULL ) { - if ( ( hCPE->hStereoCng = (STEREO_CNG_DEC_HANDLE) count_malloc( sizeof( STEREO_CNG_DEC ) ) ) == NULL ) + if ( ( hCPE->hStereoCng = (STEREO_CNG_DEC_HANDLE) malloc( sizeof( STEREO_CNG_DEC ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Stereo CNG\n" ) ); } @@ -643,26 +643,26 @@ ivas_error stereo_memory_dec( if ( hCPE->hStereoTD != NULL ) { - count_free( hCPE->hStereoTD ); + free( hCPE->hStereoTD ); hCPE->hStereoTD = NULL; } if ( hCPE->hStereoDftDmx != NULL ) { - count_free( hCPE->hStereoDftDmx ); + free( hCPE->hStereoDftDmx ); hCPE->hStereoDftDmx = NULL; } if ( hCPE->hStereoICBWE != NULL ) { - count_free( hCPE->hStereoICBWE ); + free( hCPE->hStereoICBWE ); hCPE->hStereoICBWE = NULL; } /* de-allocate stereo CNG structure */ if ( hCPE->hStereoCng != NULL ) { - count_free( hCPE->hStereoCng ); + free( hCPE->hStereoCng ); hCPE->hStereoCng = NULL; } @@ -739,7 +739,7 @@ ivas_error stereo_memory_dec( st->hTcxDec->prev_good_synth = st->hTcxDec->old_synthFB + NS2SA( st->output_Fs, PH_ECU_LOOKAHEAD_NS ); /* allocate and initialize MDCT stereo structure */ - if ( ( hCPE->hStereoMdct = (STEREO_MDCT_DEC_DATA_HANDLE) count_malloc( sizeof( STEREO_MDCT_DEC_DATA ) ) ) == NULL ) + if ( ( hCPE->hStereoMdct = (STEREO_MDCT_DEC_DATA_HANDLE) malloc( sizeof( STEREO_MDCT_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MDCT Stereo \n" ) ); } @@ -772,21 +772,21 @@ ivas_error stereo_memory_dec( /* deallocate ICBWE structure */ if ( hCPE->hStereoICBWE != NULL ) { - count_free( hCPE->hStereoICBWE ); + free( hCPE->hStereoICBWE ); hCPE->hStereoICBWE = NULL; } /* allocate BWEs for secondary channel */ if ( st->hBWE_TD == NULL ) { - if ( ( st->hBWE_TD = (TD_BWE_DEC_HANDLE) count_malloc( sizeof( TD_BWE_DEC_DATA ) ) ) == NULL ) + if ( ( st->hBWE_TD = (TD_BWE_DEC_HANDLE) malloc( sizeof( TD_BWE_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TD BWE\n" ) ); } td_bwe_dec_init( st->hBWE_TD, -1, st->output_Fs ); - if ( ( st->hBWE_FD = (FD_BWE_DEC_HANDLE) count_malloc( sizeof( FD_BWE_DEC_DATA ) ) ) == NULL ) + if ( ( st->hBWE_FD = (FD_BWE_DEC_HANDLE) malloc( sizeof( FD_BWE_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FD BWE\n" ) ); } @@ -801,13 +801,13 @@ ivas_error stereo_memory_dec( { if ( st->hBWE_TD != NULL ) { - count_free( st->hBWE_TD ); + free( st->hBWE_TD ); st->hBWE_TD = NULL; } if ( st->hBWE_FD != NULL ) { - count_free( st->hBWE_FD ); + free( st->hBWE_FD ); st->hBWE_FD = NULL; } } @@ -815,7 +815,7 @@ ivas_error stereo_memory_dec( /* allocate ICBWE structure */ if ( hCPE->hStereoICBWE == NULL ) { - if ( ( hCPE->hStereoICBWE = (STEREO_ICBWE_DEC_HANDLE) count_malloc( sizeof( STEREO_ICBWE_DEC_DATA ) ) ) == NULL ) + if ( ( hCPE->hStereoICBWE = (STEREO_ICBWE_DEC_HANDLE) malloc( sizeof( STEREO_ICBWE_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Stereo ICBWE \n" ) ); } @@ -839,7 +839,7 @@ ivas_error stereo_memory_dec( if ( hCPE->hStereoTCA == NULL ) { /* allocate TCA data structure */ - if ( ( hCPE->hStereoTCA = (STEREO_TCA_DEC_HANDLE) count_malloc( sizeof( STEREO_TCA_DEC_DATA ) ) ) == NULL ) + if ( ( hCPE->hStereoTCA = (STEREO_TCA_DEC_HANDLE) malloc( sizeof( STEREO_TCA_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Stereo TCA\n" ) ); } @@ -854,7 +854,7 @@ ivas_error stereo_memory_dec( /* de-allocate TCA data structure */ if ( hCPE->hStereoMdct->use_itd == 1 && ivas_total_brate > IVAS_SID_5k2 && hCPE->hStereoTCA != NULL ) { - count_free( hCPE->hStereoTCA ); + free( hCPE->hStereoTCA ); hCPE->hStereoTCA = NULL; hCPE->hStereoMdct->use_itd = 0; } @@ -879,7 +879,7 @@ ivas_error stereo_memory_dec( { if ( hCPE->hStereoDftDmx == NULL ) { - if ( ( hCPE->hStereoDftDmx = (STEREO_DFT_DMX_DATA_HANDLE) count_malloc( sizeof( STEREO_DFT_DMX_DATA ) ) ) == NULL ) + if ( ( hCPE->hStereoDftDmx = (STEREO_DFT_DMX_DATA_HANDLE) malloc( sizeof( STEREO_DFT_DMX_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Stereo DFT mono output\n" ) ); } @@ -888,13 +888,13 @@ ivas_error stereo_memory_dec( if ( hCPE->prev_synth_chs[1] != NULL ) { - count_free( hCPE->prev_synth_chs[1] ); + free( hCPE->prev_synth_chs[1] ); hCPE->prev_synth_chs[1] = NULL; } if ( hCPE->hStereoTCA != NULL ) { - count_free( hCPE->hStereoTCA ); + free( hCPE->hStereoTCA ); hCPE->hStereoTCA = NULL; } } @@ -902,14 +902,14 @@ ivas_error stereo_memory_dec( { if ( hCPE->hStereoDftDmx != NULL ) { - count_free( hCPE->hStereoDftDmx ); + free( hCPE->hStereoDftDmx ); hCPE->hStereoDftDmx = NULL; } if ( hCPE->prev_synth_chs[1] == NULL ) { st = hCPE->hCoreCoder[1]; - if ( ( hCPE->prev_synth_chs[1] = (float *) count_malloc( sizeof( float ) * NS2SA( st->output_Fs, FRAME_SIZE_NS ) ) ) == NULL ) + if ( ( hCPE->prev_synth_chs[1] = (float *) malloc( sizeof( float ) * NS2SA( st->output_Fs, FRAME_SIZE_NS ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DFT stereo memory\n" ) ); } @@ -918,7 +918,7 @@ ivas_error stereo_memory_dec( if ( hCPE->hStereoICBWE == NULL && hCPE->element_mode == IVAS_CPE_DFT ) { - if ( ( hCPE->hStereoICBWE = (STEREO_ICBWE_DEC_HANDLE) count_malloc( sizeof( STEREO_ICBWE_DEC_DATA ) ) ) == NULL ) + if ( ( hCPE->hStereoICBWE = (STEREO_ICBWE_DEC_HANDLE) malloc( sizeof( STEREO_ICBWE_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Stereo ICBWE \n" ) ); } @@ -928,7 +928,7 @@ ivas_error stereo_memory_dec( if ( hCPE->hStereoTCA == NULL && ( hCPE->element_mode == IVAS_CPE_DFT || hCPE->element_mode == IVAS_CPE_TD ) ) { - if ( ( hCPE->hStereoTCA = (STEREO_TCA_DEC_HANDLE) count_malloc( sizeof( STEREO_TCA_DEC_DATA ) ) ) == NULL ) + if ( ( hCPE->hStereoTCA = (STEREO_TCA_DEC_HANDLE) malloc( sizeof( STEREO_TCA_DEC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Stereo TCA\n" ) ); } @@ -941,13 +941,13 @@ ivas_error stereo_memory_dec( if ( hCPE->hStereoTCA != NULL ) { /* note: in MASA, hCPE->hStereoMdct->itd = 0 */ - count_free( hCPE->hStereoTCA ); + free( hCPE->hStereoTCA ); hCPE->hStereoTCA = NULL; } if ( hCPE->hStereoICBWE != NULL ) { - count_free( hCPE->hStereoICBWE ); + free( hCPE->hStereoICBWE ); hCPE->hStereoICBWE = NULL; } } diff --git a/lib_dec/ivas_stereo_td_dec.c b/lib_dec/ivas_stereo_td_dec.c index f3bd292a8b19abe248537f0e7ce0368c1141c341..d636d12bd74fb381e7a778b05d949d2a61abbd17 100644 --- a/lib_dec/ivas_stereo_td_dec.c +++ b/lib_dec/ivas_stereo_td_dec.c @@ -42,7 +42,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * stereo_td_init_dec() diff --git a/lib_dec/ivas_svd_dec.c b/lib_dec/ivas_svd_dec.c index ff9852d1df647b90b7177bdd954556aacc715c35..cd05d5aeeb837dc34483f2875010f5446d9c97a9 100644 --- a/lib_dec/ivas_svd_dec.c +++ b/lib_dec/ivas_svd_dec.c @@ -40,7 +40,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------------* @@ -196,7 +196,7 @@ int16_t svd( float secDiag[MAX_OUTPUT_CHANNELS]; float eps_x = 0.0f, temp; - wmops_sub_start( "svd" ); + push_wmops( "svd" ); set_zero( secDiag, MAX_OUTPUT_CHANNELS ); @@ -252,7 +252,7 @@ int16_t svd( } } while ( condition == 1 ); - wmops_sub_end(); + pop_wmops(); return ( errorMessage ); } diff --git a/lib_dec/ivas_tcx_core_dec.c b/lib_dec/ivas_tcx_core_dec.c index 3ca3033cb4a5c420faeb9175ae6e1fca9dd6e67e..ecf8bfbc3f967780edb62cbc230ebf268bbc65d9 100644 --- a/lib_dec/ivas_tcx_core_dec.c +++ b/lib_dec/ivas_tcx_core_dec.c @@ -40,7 +40,7 @@ #include "prot.h" #include "rom_com.h" #include "stat_dec.h" -#include "wmops.h" +#include "wmc_auto.h" #include "basop_proto_func.h" #include "stat_com.h" #include "ivas_prot.h" @@ -191,7 +191,7 @@ void stereo_tcx_core_dec( TCX_LTP_DEC_HANDLE hTcxLtpDec = st->hTcxLtpDec; TCX_DEC_HANDLE hTcxDec = st->hTcxDec; - wmops_sub_start( "stereo_tcx_core_dec" ); + push_wmops( "stereo_tcx_core_dec" ); /*Sanity check*/ assert( !( st->total_brate == FRAME_NO_DATA || st->total_brate == SID_2k40 ) ); /*Active frame*/ @@ -773,7 +773,7 @@ void stereo_tcx_core_dec( #endif - wmops_sub_end(); + pop_wmops(); return; } diff --git a/lib_dec/ivas_td_decorr.c b/lib_dec/ivas_td_decorr.c index 29b748e4c704dc0f352e0a813e3835db7306f3ce..7622676a3c62943954959b069933eefe09c8461e 100644 --- a/lib_dec/ivas_td_decorr.c +++ b/lib_dec/ivas_td_decorr.c @@ -39,7 +39,7 @@ #endif #include "math.h" #include -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------------------------* @@ -117,12 +117,12 @@ ivas_error ivas_spar_td_decorr_dec_open( error = IVAS_ERR_OK; - if ( ( hCovState = (ivas_td_decorr_state_t *) count_malloc( sizeof( ivas_td_decorr_state_t ) ) ) == NULL ) + if ( ( hCovState = (ivas_td_decorr_state_t *) malloc( sizeof( ivas_td_decorr_state_t ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR COV decoder" ); } - if ( ( hCovState->look_ahead_buf = (float *) count_malloc( sizeof( float ) * (int16_t) ( output_Fs * IVAS_DECORR_PARM_LOOKAHEAD_TAU ) ) ) == NULL ) + if ( ( hCovState->look_ahead_buf = (float *) malloc( sizeof( float ) * (int16_t) ( output_Fs * IVAS_DECORR_PARM_LOOKAHEAD_TAU ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR COV decoder" ); } @@ -136,7 +136,7 @@ ivas_error ivas_spar_td_decorr_dec_open( { len = hCovState->APD_filt_state[0].order[i]; - if ( ( hCovState->APD_filt_state[j].state[i] = (float *) count_malloc( sizeof( float ) * len ) ) == NULL ) + if ( ( hCovState->APD_filt_state[j].state[i] = (float *) malloc( sizeof( float ) * len ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR COV decoder" ); } @@ -182,14 +182,14 @@ void ivas_spar_td_decorr_dec_close( return; } - count_free( ( *hTdDecorr )->look_ahead_buf ); + free( ( *hTdDecorr )->look_ahead_buf ); ( *hTdDecorr )->look_ahead_buf = NULL; for ( j = 0; j < ( *hTdDecorr )->num_apd_outputs; j++ ) { for ( i = 0; i < ( *hTdDecorr )->num_apd_sections; i++ ) { - count_free( ( *hTdDecorr )->APD_filt_state[j].state[i] ); + free( ( *hTdDecorr )->APD_filt_state[j].state[i] ); ( *hTdDecorr )->APD_filt_state[j].state[i] = NULL; } } @@ -199,7 +199,7 @@ void ivas_spar_td_decorr_dec_close( ivas_spar_transient_det_close( &( *hTdDecorr )->pTrans_det ); } - count_free( ( *hTdDecorr ) ); + free( ( *hTdDecorr ) ); ( *hTdDecorr ) = NULL; return; diff --git a/lib_dec/ivas_td_low_rate_dec.c b/lib_dec/ivas_td_low_rate_dec.c index e610fcf0f38ec7aacd4788436b5fe75371d56c17..d017d7afb1315ce9b457344768519eca554f30ab 100644 --- a/lib_dec/ivas_td_low_rate_dec.c +++ b/lib_dec/ivas_td_low_rate_dec.c @@ -42,7 +42,7 @@ #include "ivas_cnst.h" #include "prot.h" #include "ivas_prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * tdm_low_rate_dec() diff --git a/lib_dec/ivas_vbap.c b/lib_dec/ivas_vbap.c index f0da2623aad77f1f4ac550f224e1efeaa07c7f24..a3ec6323cf1dd459794241a3c92f5edf0ffa6ae3 100644 --- a/lib_dec/ivas_vbap.c +++ b/lib_dec/ivas_vbap.c @@ -40,7 +40,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------------* * Local constants @@ -154,13 +154,13 @@ ivas_error vbap_init_data( VBAP_SPEAKER_NODE speaker_node_data[VBAP_MAX_NUM_SPEAKER_NODES]; VBAP_DATA *vbap; - wmops_sub_start( "vbap_init" ); + push_wmops( "vbap_init" ); /* Basic init checks */ if ( num_speaker_nodes > VBAP_MAX_NUM_SPEAKER_NODES || num_speaker_nodes < 3 ) { hVBAPdata = NULL; - wmops_sub_end(); + pop_wmops(); /* TODO: are these two paths correct behaviour or should and error be returned ? */ return IVAS_ERR_OK; } @@ -171,7 +171,7 @@ ivas_error vbap_init_data( } /* Allocate VBAP structure */ - if ( ( vbap = (VBAP_HANDLE) count_malloc( sizeof( VBAP_DATA ) ) ) == NULL ) + if ( ( vbap = (VBAP_HANDLE) malloc( sizeof( VBAP_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for VBAP data\n" ) ); } @@ -200,7 +200,7 @@ ivas_error vbap_init_data( if ( is_success && virtual_bottom_type != NO_VIRTUAL_SPEAKER_NODE ) { - vbap->bottom_virtual_speaker_node_division_gains = (float *) count_calloc( num_speaker_nodes, sizeof( float ) ); + vbap->bottom_virtual_speaker_node_division_gains = (float *) calloc( num_speaker_nodes, sizeof( float ) ); is_success &= vbap->bottom_virtual_speaker_node_division_gains != NULL; speaker_node_azi_deg_internal[vbap->bottom_virtual_speaker_node_index] = 0.0f; speaker_node_ele_deg_internal[vbap->bottom_virtual_speaker_node_index] = -90.0f; @@ -208,7 +208,7 @@ ivas_error vbap_init_data( if ( is_success && virtual_top_type != NO_VIRTUAL_SPEAKER_NODE ) { - vbap->top_virtual_speaker_node_division_gains = (float *) count_calloc( num_speaker_nodes, sizeof( float ) ); + vbap->top_virtual_speaker_node_division_gains = (float *) calloc( num_speaker_nodes, sizeof( float ) ); is_success &= vbap->top_virtual_speaker_node_division_gains != NULL; speaker_node_azi_deg_internal[vbap->top_virtual_speaker_node_index] = 0.0f; speaker_node_ele_deg_internal[vbap->top_virtual_speaker_node_index] = 90.0f; @@ -216,7 +216,7 @@ ivas_error vbap_init_data( if ( is_success && virtual_back_type != NO_VIRTUAL_SPEAKER_NODE ) { - vbap->back_virtual_speaker_node_division_gains = (float *) count_calloc( num_speaker_nodes, sizeof( float ) ); + vbap->back_virtual_speaker_node_division_gains = (float *) calloc( num_speaker_nodes, sizeof( float ) ); is_success &= vbap->back_virtual_speaker_node_division_gains != NULL; speaker_node_azi_deg_internal[vbap->back_virtual_speaker_node_index] = 180.0f; speaker_node_ele_deg_internal[vbap->back_virtual_speaker_node_index] = 0.0f; @@ -263,12 +263,12 @@ ivas_error vbap_init_data( break; } } - vbap->search_struct[0].triplets = (VBAP_VS_TRIPLET *) count_malloc( ( ( speaker_nodes_group1_internal - 2 ) * 2 - ( max( 0, ( speaker_nodes_horiz_internal - 2 ) ) ) ) * sizeof( VBAP_VS_TRIPLET ) ); + vbap->search_struct[0].triplets = (VBAP_VS_TRIPLET *) malloc( ( ( speaker_nodes_group1_internal - 2 ) * 2 - ( max( 0, ( speaker_nodes_horiz_internal - 2 ) ) ) ) * sizeof( VBAP_VS_TRIPLET ) ); is_success &= vbap->search_struct[0].triplets != NULL; if ( speaker_nodes_group2_internal > 0 ) { vbap->num_search_structs = 2; - vbap->search_struct[1].triplets = (VBAP_VS_TRIPLET *) count_malloc( ( ( speaker_nodes_group2_internal - 2 ) * 2 - ( max( 0, ( speaker_nodes_horiz_internal - 2 ) ) ) ) * sizeof( VBAP_VS_TRIPLET ) ); + vbap->search_struct[1].triplets = (VBAP_VS_TRIPLET *) malloc( ( ( speaker_nodes_group2_internal - 2 ) * 2 - ( max( 0, ( speaker_nodes_horiz_internal - 2 ) ) ) ) * sizeof( VBAP_VS_TRIPLET ) ); is_success &= vbap->search_struct[1].triplets != NULL; } else @@ -303,7 +303,7 @@ ivas_error vbap_init_data( determine_virtual_speaker_node_division_gains( vbap->back_virtual_speaker_node_index, vbap->back_virtual_speaker_node_division_gains, connections, virtual_back_type, max_num_connections, num_speaker_nodes ); } - wmops_sub_end(); + pop_wmops(); if ( is_success ) { @@ -335,26 +335,26 @@ void vbap_free_data( if ( ( *hVBAPdata )->bottom_virtual_speaker_node_division_gains != NULL ) { - count_free( ( *hVBAPdata )->bottom_virtual_speaker_node_division_gains ); + free( ( *hVBAPdata )->bottom_virtual_speaker_node_division_gains ); } if ( ( *hVBAPdata )->top_virtual_speaker_node_division_gains != NULL ) { - count_free( ( *hVBAPdata )->top_virtual_speaker_node_division_gains ); + free( ( *hVBAPdata )->top_virtual_speaker_node_division_gains ); } if ( ( *hVBAPdata )->back_virtual_speaker_node_division_gains != NULL ) { - count_free( ( *hVBAPdata )->back_virtual_speaker_node_division_gains ); + free( ( *hVBAPdata )->back_virtual_speaker_node_division_gains ); } if ( ( *hVBAPdata )->search_struct[0].triplets != NULL ) { - count_free( ( *hVBAPdata )->search_struct[0].triplets ); + free( ( *hVBAPdata )->search_struct[0].triplets ); } if ( ( *hVBAPdata )->num_search_structs == 2 && ( *hVBAPdata )->search_struct[1].triplets != NULL ) { - count_free( ( *hVBAPdata )->search_struct[1].triplets ); + free( ( *hVBAPdata )->search_struct[1].triplets ); } - count_free( *hVBAPdata ); + free( *hVBAPdata ); *hVBAPdata = NULL; return; @@ -400,7 +400,7 @@ void vbap_determine_gains( assert( gains != NULL && "VBAP gain determination requires reserved memory for gain output." ); #endif - wmops_sub_start( "vbap_gains" ); + push_wmops( "vbap_gains" ); num_speaker_nodes = hVBAPdata->num_speaker_nodes; bottom_virtual_speaker_node_index = hVBAPdata->bottom_virtual_speaker_node_index; top_virtual_speaker_node_index = hVBAPdata->top_virtual_speaker_node_index; @@ -484,7 +484,7 @@ void vbap_determine_gains( } } - wmops_sub_end(); + pop_wmops(); return; } @@ -1449,7 +1449,7 @@ static void get_half_sphere_connection_options( } /* Init memory for connection options */ - c_options = (ConnectionOption *) count_malloc( sizeof( ConnectionOption ) * max_num_connection_options ); + c_options = (ConnectionOption *) malloc( sizeof( ConnectionOption ) * max_num_connection_options ); for ( c = 0; c < max_num_connection_options; c++ ) { c_options[c].chA = -1; @@ -1504,7 +1504,7 @@ static void get_half_sphere_connection_options( /* Init memory for reordered connection options and order by arc_weighted, * which informs of the preference order of the connections in case they cross */ - c_options_reorder = (ConnectionOption *) count_malloc( sizeof( ConnectionOption ) * ( *num_connection_options ) ); + c_options_reorder = (ConnectionOption *) malloc( sizeof( ConnectionOption ) * ( *num_connection_options ) ); for ( c = 0; c < *num_connection_options; c++ ) { float min_arc_weighted; @@ -1529,7 +1529,7 @@ static void get_half_sphere_connection_options( /* Set reordered connections as output and free temporary data */ *connection_options_pr = c_options_reorder; - count_free( c_options ); + free( c_options ); return; } @@ -1675,7 +1675,7 @@ static void formulate_half_sphere_connections( } c_opt++; } - count_free( connection_options ); + free( connection_options ); return; } diff --git a/lib_dec/jbm_jb4_circularbuffer.c b/lib_dec/jbm_jb4_circularbuffer.c index a9da400a3604ba00cee41e5d4986740a6268ff06..0ef0793bc7aaea5ccdf1e428fc17fa698f8f80c0 100644 --- a/lib_dec/jbm_jb4_circularbuffer.c +++ b/lib_dec/jbm_jb4_circularbuffer.c @@ -42,7 +42,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /* local includes */ #include "jbm_jb4_circularbuffer.h" @@ -72,7 +72,7 @@ struct JB4_CIRCULARBUFFER /* Creates a circular buffer (FIFO) */ int16_t JB4_CIRCULARBUFFER_Create( JB4_CIRCULARBUFFER_HANDLE *ph ) { - JB4_CIRCULARBUFFER_HANDLE h = count_malloc( sizeof( struct JB4_CIRCULARBUFFER ) ); + JB4_CIRCULARBUFFER_HANDLE h = malloc( sizeof( struct JB4_CIRCULARBUFFER ) ); h->data = NULL; h->capacity = 0; @@ -103,9 +103,9 @@ void JB4_CIRCULARBUFFER_Destroy( if ( h->data ) { - count_free( h->data ); + free( h->data ); } - count_free( h ); + free( h ); *ph = NULL; return; @@ -119,7 +119,7 @@ int16_t JB4_CIRCULARBUFFER_Init( { /* keep one element free to be able to decide between full/empty buffer */ ++capacity; - h->data = count_malloc( capacity * sizeof( JB4_CIRCULARBUFFER_ELEMENT ) ); + h->data = malloc( capacity * sizeof( JB4_CIRCULARBUFFER_ELEMENT ) ); h->capacity = capacity; h->writePos = 0; diff --git a/lib_dec/jbm_jb4_inputbuffer.c b/lib_dec/jbm_jb4_inputbuffer.c index 8eaf547838282229205a249c29fe2b7dd48176cb..f8a3d09b523dff9503ba4f4af99c63763a0fd9b4 100644 --- a/lib_dec/jbm_jb4_inputbuffer.c +++ b/lib_dec/jbm_jb4_inputbuffer.c @@ -33,11 +33,9 @@ /*==================================================================================== EVS Codec 3GPP TS26.443 Nov 04, 2021. Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0 ====================================================================================*/ -/* WMC_TOOL_SKIP_FILE (basic ops file) */ /** \file jbm_jb4_inputbuffer.c RTP input buffer with fixed capacity. */ -/* system includes */ #include #include #include "options.h" @@ -46,9 +44,10 @@ #ifdef DEBUGGING #include "debug.h" #endif -/* local includes */ #include "jbm_jb4_inputbuffer.h" +#define WMC_TOOL_SKIP + /** input buffer with fixed capacity */ struct JB4_INPUTBUFFER @@ -70,7 +69,7 @@ struct JB4_INPUTBUFFER int16_t JB4_INPUTBUFFER_Create( JB4_INPUTBUFFER_HANDLE *ph ) { - JB4_INPUTBUFFER_HANDLE h = count_malloc( sizeof( struct JB4_INPUTBUFFER ) ); + JB4_INPUTBUFFER_HANDLE h = malloc( sizeof( struct JB4_INPUTBUFFER ) ); h->data = NULL; h->capacity = 0; @@ -100,8 +99,8 @@ void JB4_INPUTBUFFER_Destroy( return; } if ( h->data ) - count_free( h->data ); - count_free( h ); + free( h->data ); + free( h ); *ph = NULL; return; @@ -117,7 +116,7 @@ int16_t JB4_INPUTBUFFER_Init( /* keep one element free to be able to decide between full/empty buffer */ ++capacity; - h->data = count_malloc( capacity * sizeof( JB4_INPUTBUFFER_ELEMENT ) ); + h->data = malloc( capacity * sizeof( JB4_INPUTBUFFER_ELEMENT ) ); h->capacity = capacity; h->writePos = 0; h->readPos = 0; @@ -359,3 +358,5 @@ uint16_t JB4_INPUTBUFFER_Size( return ret; } + +#undef WMC_TOOL_SKIP diff --git a/lib_dec/jbm_jb4_jmf.c b/lib_dec/jbm_jb4_jmf.c index 7b0dd2f188ce44df863d1b1b252c9b4752d31cdf..945f9abcf0235e78a4a3151c21a80dccaf04d4f9 100644 --- a/lib_dec/jbm_jb4_jmf.c +++ b/lib_dec/jbm_jb4_jmf.c @@ -46,7 +46,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /* local includes */ #include "jbm_jb4_jmf.h" @@ -92,7 +92,7 @@ static void JB4_JMF_popFront( JB4_JMF_HANDLE h ); int16_t JB4_JMF_Create( JB4_JMF_HANDLE *ph ) { - JB4_JMF_HANDLE h = count_malloc( sizeof( struct JB4_JMF ) ); + JB4_JMF_HANDLE h = malloc( sizeof( struct JB4_JMF ) ); JB4_CIRCULARBUFFER_Create( &h->fifo ); JB4_CIRCULARBUFFER_Create( &h->offsetFifo ); @@ -131,7 +131,7 @@ void JB4_JMF_Destroy( JB4_CIRCULARBUFFER_Destroy( &h->offsetFifo ); JB4_CIRCULARBUFFER_Destroy( &h->timeStampFifo ); - count_free( h ); + free( h ); *ph = NULL; return; diff --git a/lib_dec/jbm_jb4sb.c b/lib_dec/jbm_jb4sb.c index 28dfd43e61538b692837738829867074463ad503..be8caff4b31e31e5f7ba97008d44563e7a73569a 100644 --- a/lib_dec/jbm_jb4sb.c +++ b/lib_dec/jbm_jb4sb.c @@ -33,7 +33,6 @@ /*==================================================================================== EVS Codec 3GPP TS26.443 Nov 04, 2021. Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0 ====================================================================================*/ -/* WMC_TOOL_SKIP_FILE (basic ops file) */ /*! \file jbm_jb4sb.c EVS Jitter Buffer Management Interface */ @@ -46,7 +45,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /* local headers */ #include "jbm_jb4_circularbuffer.h" #include "jbm_jb4_inputbuffer.h" @@ -54,6 +53,7 @@ #include "jbm_jb4sb.h" #include "prot.h" +#define WMC_TOOL_SKIP #define JB4_MIN( a, b ) ( ( a ) > ( b ) ? ( b ) : ( a ) ) #define JB4_MAX( a, b ) ( ( a ) > ( b ) ? ( a ) : ( b ) ) @@ -208,7 +208,7 @@ ivas_error JB4_Create( int16_t iter; JB4_HANDLE h; - if ( ( h = count_malloc( sizeof( struct JB4 ) ) ) == NULL ) + if ( ( h = malloc( sizeof( struct JB4 ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for JB4 structure\n" ) ); } @@ -270,7 +270,7 @@ ivas_error JB4_Create( /* allocate memory for data units */ for ( iter = 0; iter < MAX_JBM_SLOTS; ++iter ) { - h->memorySlots[iter].data = count_malloc( MAX_AU_SIZE ); + h->memorySlots[iter].data = malloc( MAX_AU_SIZE ); h->freeMemorySlots[iter] = &h->memorySlots[iter]; } h->nFreeMemorySlots = MAX_JBM_SLOTS; @@ -304,10 +304,10 @@ void JB4_Destroy( for ( i = 0; i < MAX_JBM_SLOTS; ++i ) { - count_free( h->memorySlots[i].data ); + free( h->memorySlots[i].data ); } - count_free( h ); + free( h ); *ph = NULL; return; @@ -1508,3 +1508,5 @@ static int16_t JB4_inputBufferCompareFunction( return result; } + +#undef WMC_TOOL_SKIP diff --git a/lib_dec/jbm_pcmdsp_apa.c b/lib_dec/jbm_pcmdsp_apa.c index 7bee5f9b5f26aeabe39572fffa0ec42e0940d66e..f4434e916cd4bc4865c367b24a1851f7c4c8d8b0 100644 --- a/lib_dec/jbm_pcmdsp_apa.c +++ b/lib_dec/jbm_pcmdsp_apa.c @@ -47,7 +47,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /* local headers */ #include "jbm_pcmdsp_apa.h" #include "jbm_pcmdsp_similarityestimation.h" @@ -164,7 +164,7 @@ uint8_t apa_init( } /* allocate state struct */ - ps = (apa_state_t *) count_malloc( sizeof( apa_state_t ) ); + ps = (apa_state_t *) malloc( sizeof( apa_state_t ) ); if ( !ps ) { return 2; @@ -172,7 +172,7 @@ uint8_t apa_init( #ifdef MC_JBM ps->num_channels = (uint16_t) num_channels; ps->buf_out_capacity = (uint16_t) ( APA_BUF_PER_CHANNEL * num_channels ); - ps->buf_out = count_malloc( sizeof( float ) * ps->buf_out_capacity ); + ps->buf_out = malloc( sizeof( float ) * ps->buf_out_capacity ); if ( !ps->buf_out ) { return 2; @@ -443,11 +443,11 @@ bool apa_exit( #ifdef MC_JBM /* deallocate state struct members */ - count_free( ( *pps )->buf_out ); + free( ( *pps )->buf_out ); #endif /* deallocate state struct */ - count_free( *pps ); + free( *pps ); /* set pointer to NULL */ *pps = NULL; diff --git a/lib_dec/jbm_pcmdsp_fifo.c b/lib_dec/jbm_pcmdsp_fifo.c index 6c203318e4ba4451c7067e78b3766026b5d9bf02..300adc3e740429cf64cf9732dd619dbcea356248 100644 --- a/lib_dec/jbm_pcmdsp_fifo.c +++ b/lib_dec/jbm_pcmdsp_fifo.c @@ -43,7 +43,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" #include "jbm_pcmdsp_fifo.h" @@ -51,7 +51,7 @@ int16_t pcmdsp_fifo_create( PCMDSP_FIFO_HANDLE *ph ) { - PCMDSP_FIFO_HANDLE h = count_malloc( sizeof( struct PCMDSP_FIFO ) ); + PCMDSP_FIFO_HANDLE h = malloc( sizeof( struct PCMDSP_FIFO ) ); h->size = 0; h->capacity = 0; @@ -85,10 +85,10 @@ void pcmdsp_fifo_destroy( if ( h->dataBegin ) { - count_free( h->dataBegin ); + free( h->dataBegin ); } - count_free( h ); + free( h ); *ph = NULL; return; @@ -118,7 +118,7 @@ int16_t pcmdsp_fifo_init( h->nBytesPerSampleSet = nChannels * nBytesPerSample; nDataBytes = nSamples * h->nBytesPerSampleSet; #endif - h->dataBegin = count_malloc( nDataBytes ); + h->dataBegin = malloc( nDataBytes ); h->dataEnd = h->dataBegin + nDataBytes; h->dataWriteIterator = h->dataBegin; h->dataReadIterator = h->dataBegin; diff --git a/lib_dec/jbm_pcmdsp_similarityestimation.c b/lib_dec/jbm_pcmdsp_similarityestimation.c index 3016fab5e1dac6f1652469379679250bc44c09e7..5398cafebb264832f0c08a7c8e84b699613df75d 100644 --- a/lib_dec/jbm_pcmdsp_similarityestimation.c +++ b/lib_dec/jbm_pcmdsp_similarityestimation.c @@ -44,7 +44,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /* local headers */ #include "jbm_pcmdsp_similarityestimation.h" diff --git a/lib_dec/jbm_pcmdsp_window.c b/lib_dec/jbm_pcmdsp_window.c index 94182e5ad67ff603ba4157178d44a6bda9429277..482f26f6c1af111572b11ce64abaefd2fcf5f20a 100644 --- a/lib_dec/jbm_pcmdsp_window.c +++ b/lib_dec/jbm_pcmdsp_window.c @@ -43,7 +43,7 @@ #endif #include "jbm_pcmdsp_window.h" #include "cnst.h" -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------------* * hannWindow() diff --git a/lib_dec/lead_deindexing.c b/lib_dec/lead_deindexing.c index 246e0df391e41d8c7649683295a8d22f0e9a5c37..9bd4f34a0e85fa66b89425b92ba95146e7a14d49 100644 --- a/lib_dec/lead_deindexing.c +++ b/lib_dec/lead_deindexing.c @@ -43,7 +43,7 @@ #include "prot.h" #include "rom_com.h" #include "rom_dec.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local function prototypes diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index e739b451a2e06bf2424f85137bb4227183310bcf..b42abb75ac5a05547d61c43f85da7822244a6962 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -42,7 +42,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * Local structs @@ -124,7 +124,7 @@ ivas_error IVAS_DEC_Open( * Allocate and initialize IVAS application decoder handle *-----------------------------------------------------------------*/ - if ( ( *phIvasDec = (IVAS_DEC_HANDLE) count_malloc( sizeof( struct IVAS_DEC ) ) ) == NULL ) + if ( ( *phIvasDec = (IVAS_DEC_HANDLE) malloc( sizeof( struct IVAS_DEC ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for IVAS decoder handle" ); } @@ -146,12 +146,12 @@ ivas_error IVAS_DEC_Open( * Initialize IVAS-codec decoder state *-----------------------------------------------------------------*/ - if ( ( hIvasDec->st_ivas = (Decoder_Struct *) count_malloc( sizeof( Decoder_Struct ) ) ) == NULL ) + if ( ( hIvasDec->st_ivas = (Decoder_Struct *) malloc( sizeof( Decoder_Struct ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for IVAS decoder structure" ); } - if ( ( hIvasDec->st_ivas->hDecoderConfig = (DECODER_CONFIG_HANDLE) count_malloc( sizeof( DECODER_CONFIG ) ) ) == NULL ) + if ( ( hIvasDec->st_ivas->hDecoderConfig = (DECODER_CONFIG_HANDLE) malloc( sizeof( DECODER_CONFIG ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for Decoder config structure" ); } @@ -262,7 +262,7 @@ void IVAS_DEC_Close( ( *phIvasDec )->st_ivas = NULL; } - count_free( *phIvasDec ); + free( *phIvasDec ); *phIvasDec = NULL; phIvasDec = NULL; @@ -518,7 +518,7 @@ ivas_error IVAS_DEC_EnableVoIP( { return error; } - hIvasDec->hVoIP = count_malloc( sizeof( IVAS_DEC_VOIP ) ); + hIvasDec->hVoIP = malloc( sizeof( IVAS_DEC_VOIP ) ); if ( hIvasDec->hVoIP == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" ); @@ -533,13 +533,17 @@ ivas_error IVAS_DEC_EnableVoIP( #endif #ifdef MC_JBM - hIvasDec->hVoIP->apaExecBuffer = count_malloc( sizeof( int16_t ) * APA_BUF_PER_CHANNEL * hDecoderConfig->nchan_out ); + hIvasDec->hVoIP->apaExecBuffer = malloc( sizeof( int16_t ) * APA_BUF_PER_CHANNEL * hDecoderConfig->nchan_out ); if ( hIvasDec->hVoIP->apaExecBuffer == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" ); } + +#define WMC_TOOL_SKIP /* Bitstream conversion is not counted towards complexity and memory usage */ - hIvasDec->hVoIP->bs_conversion_buf = dynamic_malloc( sizeof( uint16_t ) * MAX_BITS_PER_FRAME + 4 * 8 ); + hIvasDec->hVoIP->bs_conversion_buf = malloc( sizeof( uint16_t ) * MAX_BITS_PER_FRAME + 4 * 8 ); +#undef WMC_TOOL_SKIP + if ( hIvasDec->hVoIP->bs_conversion_buf == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Could not allocate VoIP handle" ); @@ -1253,7 +1257,7 @@ static bool isSidFrame( static void bsCompactToSerial( const uint8_t *compact, uint16_t *serial, uint16_t num_bits ) { /* Bitstream conversion is not counted towards complexity and memory usage */ -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP uint32_t i; uint8_t byte = 0; const uint8_t mask = 0x80; @@ -1269,7 +1273,7 @@ static void bsCompactToSerial( const uint8_t *compact, uint16_t *serial, uint16_ byte <<= 1; } -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP } #endif @@ -1700,16 +1704,19 @@ static void IVAS_DEC_Close_VoIP( #ifdef MC_JBM if ( hVoIP->apaExecBuffer != NULL ) { - count_free( hVoIP->apaExecBuffer ); + free( hVoIP->apaExecBuffer ); } + if ( hVoIP->bs_conversion_buf != NULL ) { +#define WMC_TOOL_SKIP /* Bitstream conversion is not counted towards complexity and memory usage */ - dynamic_free( hVoIP->bs_conversion_buf ); + free( hVoIP->bs_conversion_buf ); +#undef WMC_TOOL_SKIP } #endif - count_free( hVoIP ); + free( hVoIP ); return; } @@ -2073,6 +2080,7 @@ void IVAS_DEC_PrintConfig( #ifdef DEBUGGING +#define WMC_TOOL_SKIP void IVAS_DEC_PrintConfigWithBitstream( IVAS_DEC_HANDLE hIvasDec, const bool quietModeEnabled, @@ -2084,7 +2092,7 @@ void IVAS_DEC_PrintConfigWithBitstream( /* Create a copy of decoder struct that will be modified by preview_indices(), * leaving the original decoder struct unchanged. The additional memory used here * should not be counted towards memory footprint of the decoder. */ - st_ivas = dynamic_malloc( sizeof( Decoder_Struct ) ); + st_ivas = malloc( sizeof( Decoder_Struct ) ); memcpy( st_ivas, hIvasDec->st_ivas, sizeof( Decoder_Struct ) ); preview_indices( st_ivas, bit_stream, num_bits ); @@ -2092,7 +2100,7 @@ void IVAS_DEC_PrintConfigWithBitstream( /* Print config from modified decoder struct */ printConfigInfo_dec( st_ivas, hIvasDec->bitstreamformat, hIvasDec->Opt_VOIP, quietModeEnabled ); - dynamic_free( st_ivas ); + free( st_ivas ); return; } @@ -2110,7 +2118,7 @@ void IVAS_DEC_PrintConfigWithVoipBitstream( /* Create a copy of decoder struct that will be modified by preview_indices(), * leaving the original decoder struct unchanged. The additional memory used here * should not be counted towards memory footprint of the decoder. */ - st_ivas = dynamic_malloc( sizeof( Decoder_Struct ) ); + st_ivas = malloc( sizeof( Decoder_Struct ) ); memcpy( st_ivas, hIvasDec->st_ivas, sizeof( Decoder_Struct ) ); bsCompactToSerial( au, bit_stream, auSizeBits ); @@ -2119,11 +2127,12 @@ void IVAS_DEC_PrintConfigWithVoipBitstream( /* Print config from modified decoder struct */ printConfigInfo_dec( st_ivas, hIvasDec->bitstreamformat, hIvasDec->Opt_VOIP, quietModeEnabled ); - dynamic_free( st_ivas ); + free( st_ivas ); return; } #endif +#undef WMC_TOOL_SKIP #endif diff --git a/lib_dec/lp_exc_d.c b/lib_dec/lp_exc_d.c index 046523105fa6aa510cc5f7b29e9bc294245df699..291feeddc7111392f80fcdd6baba8a08661c7f09 100644 --- a/lib_dec/lp_exc_d.c +++ b/lib_dec/lp_exc_d.c @@ -41,7 +41,7 @@ #endif #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * lp_filt_exc_dec() diff --git a/lib_dec/lsf_dec.c b/lib_dec/lsf_dec.c index ffa5e91e2c6fdd8c0a50ad5cece67b3e848ae8e3..acf1769b4e4008d315803529665c206090b5e383 100644 --- a/lib_dec/lsf_dec.c +++ b/lib_dec/lsf_dec.c @@ -47,7 +47,7 @@ #include "ivas_prot.h" #include "ivas_rom_com.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* diff --git a/lib_dec/lsf_msvq_ma_dec.c b/lib_dec/lsf_msvq_ma_dec.c index 1fe895b70617b90d5eccf6fd6e81a5a5fff3ff26..2ad2e97abf71f98b9b403372393c36156514bd3e 100644 --- a/lib_dec/lsf_msvq_ma_dec.c +++ b/lib_dec/lsf_msvq_ma_dec.c @@ -43,7 +43,7 @@ #include "prot.h" #include "rom_com.h" #include "basop_proto_func.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * lsf_msvq_ma_decprm() diff --git a/lib_dec/nelp_dec.c b/lib_dec/nelp_dec.c index 1814031fb2d2c4dbac88c63acc8958beba2f7f57..ccf0b9f36a70bbef0549465792db9d00b2381767 100644 --- a/lib_dec/nelp_dec.c +++ b/lib_dec/nelp_dec.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * nelp_decoder() diff --git a/lib_dec/peak_vq_dec.c b/lib_dec/peak_vq_dec.c index 45897b77b30b2d0c8c8d3cd70a6b8a6b3881ac12..1f3012e4f20e9488c00205ef44a49f55c43856db 100644 --- a/lib_dec/peak_vq_dec.c +++ b/lib_dec/peak_vq_dec.c @@ -44,7 +44,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------* diff --git a/lib_dec/pit_dec.c b/lib_dec/pit_dec.c index 9f2ba3bcad25f0b150532749a6a4fabc65b4408e..4d4b1f72dba5102e6b2205510d96c8346599d0bb 100644 --- a/lib_dec/pit_dec.c +++ b/lib_dec/pit_dec.c @@ -43,7 +43,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*----------------------------------------------------------* * pit_decode() diff --git a/lib_dec/pitch_extr.c b/lib_dec/pitch_extr.c index d90f06af7a729af64630943e0c7baa33a4fd4bab..d115275f897798baea1e43442682938ee2220990 100644 --- a/lib_dec/pitch_extr.c +++ b/lib_dec/pitch_extr.c @@ -45,7 +45,7 @@ #include "cnst.h" #include "prot.h" #include "basop_util.h" -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------* @@ -151,7 +151,7 @@ void pitch_pred_linear_fit( ml_fx[i] = (int32_t) ( ml[i] / pow( 2.f, -31 + 15 ) ); /* Q16 */ } -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP FOR( i = 0; i < lcor; i++ ) { pg_fx[i] = mult( mult( pg_fx[i], pg_fx[i] ), timeWeight[i] ); /*Q12 'til pg[lcor-1], Q14 'til pg[8]*/ @@ -286,7 +286,7 @@ void pitch_pred_linear_fit( pita = L_shl( L_deposit_l( a1 ), add( add( sum0_q, 16 - 10 + 1 ), sub( tmpa, a_e ) ) ) /*Q16*/; pitb = L_shl_r( L_mult( b1 /*Q15*/, add( no_subfr_pred, nb_subfr ) /*Q0*/ ), add( add( sum0_q, 16 - 12 ), sub( tmpb, b_e ) ) ); pit = L_add( pita, pitb ); /*Q16*/ -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP /* convert pitch back to float precision */ T0 = (float) ( pit * pow( 2.f, -31 + 15 ) ); diff --git a/lib_dec/post_dec.c b/lib_dec/post_dec.c index 0d7bd7e7c7b284efa521f5c42686d4917e3abd4d..f9a87da144a9475e6727617259de9eb51c581bc5 100644 --- a/lib_dec/post_dec.c +++ b/lib_dec/post_dec.c @@ -42,7 +42,7 @@ #include #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * Function prototypes diff --git a/lib_dec/ppp_dec.c b/lib_dec/ppp_dec.c index 3de25cf680f9c710c892cfb5e0420814fddd08c3..adea4ea6a9ef7ee4c77d2433572a48a93fccf4a8 100644 --- a/lib_dec/ppp_dec.c +++ b/lib_dec/ppp_dec.c @@ -40,7 +40,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* @@ -177,7 +177,7 @@ ivas_error ppp_quarter_decoder( tmp = (float) get_next_indice( st, 3 ); DTFS_phaseShift( CURRCW_Q_DTFS, (float) ( PI2 * ( tmp - 3 ) / CURRCW_Q_DTFS->lag ) ); - dynamic_free( PREVDTFS ); + free( PREVDTFS ); return error; } diff --git a/lib_dec/pvq_core_dec.c b/lib_dec/pvq_core_dec.c index 0ef00c6ae342e1345c541f2c888899b63afe5ea1..d444a7ca91299a80675eda27fa4fa6a90e6cbaa6 100644 --- a/lib_dec/pvq_core_dec.c +++ b/lib_dec/pvq_core_dec.c @@ -44,7 +44,7 @@ #include "rom_com.h" #include "prot.h" #include "stl.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local prototypes @@ -403,7 +403,7 @@ static void densitySymbolIndexDecode( *index_phi = -1; return; } -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP angle = atan2_fx( SQRT_DIM_fx[r_dim], SQRT_DIM_fx[l_dim] ); #ifndef BASOP_NOGLOB angle = shl( angle, 1 ); @@ -412,7 +412,7 @@ static void densitySymbolIndexDecode( #endif /* BASOP_NOGLOB */ angle = mult_r( angle, 20861 ); c = mult_r( res, angle ); -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP res_c = res - c; if ( c == 0 ) diff --git a/lib_dec/pvq_decode.c b/lib_dec/pvq_decode.c index c9a2bf41ab97c5a4ba7827c2aa0f5de1f4f3fbc5..4986a25f2a0d58d4b4c9cbf1ab32c31c3bd69008 100644 --- a/lib_dec/pvq_decode.c +++ b/lib_dec/pvq_decode.c @@ -42,7 +42,7 @@ #include #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Function pvq_decode() * diff --git a/lib_dec/range_dec.c b/lib_dec/range_dec.c index 55010e0b36088a36ca8e6263a441048a9021e8b7..5c958ca110fe1ba37c88d26e954eca29cb77de17 100644 --- a/lib_dec/range_dec.c +++ b/lib_dec/range_dec.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local prototypes diff --git a/lib_dec/re8_dec.c b/lib_dec/re8_dec.c index 22a0a538a27ee7f235f89d8774131ae05611342f..29a61ca0c47779939c663a1fff5f9edf67086ea6 100644 --- a/lib_dec/re8_dec.c +++ b/lib_dec/re8_dec.c @@ -40,7 +40,7 @@ #include "debug.h" #endif #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------------- diff --git a/lib_dec/rom_dec.c b/lib_dec/rom_dec.c index a79803ea5cccae9a227ee19deefd6e8a6a42aeb7..d8d7a6a59d6e9d98af6e8443d5ae3f556d43d29b 100644 --- a/lib_dec/rom_dec.c +++ b/lib_dec/rom_dec.c @@ -40,7 +40,7 @@ #include "debug.h" #endif #include "cnst.h" -#include "wmops.h" +#include "wmc_auto.h" /* clang-format off */ diff --git a/lib_dec/rst_dec.c b/lib_dec/rst_dec.c index 6b8683767d87824a10083f2c84fcaf7852273df1..9b919044ba0f24db93c1b04e295a17a5b1e15ee0 100644 --- a/lib_dec/rst_dec.c +++ b/lib_dec/rst_dec.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*----------------------------------------------------------------------------------* * CNG_reset_dec() diff --git a/lib_dec/stat_noise_uv_dec.c b/lib_dec/stat_noise_uv_dec.c index f9e8ec4f7878814d8e0ec84154bddc8fb03baeaf..86abd752a2df3a56455dac35cadb3525668bf156 100644 --- a/lib_dec/stat_noise_uv_dec.c +++ b/lib_dec/stat_noise_uv_dec.c @@ -40,7 +40,7 @@ #include "debug.h" #endif #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------* * stat_noise_uv_dec() diff --git a/lib_dec/swb_bwe_dec.c b/lib_dec/swb_bwe_dec.c index fca9267bd03b1ba62eba96be824b326a5ef5c446..cedf300ed7bb59dfafa28f11be766cabc40308c1 100644 --- a/lib_dec/swb_bwe_dec.c +++ b/lib_dec/swb_bwe_dec.c @@ -45,7 +45,7 @@ #include "rom_com.h" #include "basop_util.h" #include "basop_proto_func.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * para_pred_bws() diff --git a/lib_dec/swb_bwe_dec_hr.c b/lib_dec/swb_bwe_dec_hr.c index edfaaf67be4ef92c4fbdce0702a3d7b0b3658964..eda63e386936fe695c2042fc26f33189904a6fba 100644 --- a/lib_dec/swb_bwe_dec_hr.c +++ b/lib_dec/swb_bwe_dec_hr.c @@ -42,7 +42,7 @@ #include #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * swb_bwe_dec_hr() diff --git a/lib_dec/swb_bwe_dec_lr.c b/lib_dec/swb_bwe_dec_lr.c index d10be17f5f75ca758ea59e917785cf1219220793..4a2860a3f84e9ecada6af00b424f63f55ea8a014 100644 --- a/lib_dec/swb_bwe_dec_lr.c +++ b/lib_dec/swb_bwe_dec_lr.c @@ -44,7 +44,7 @@ #include "prot.h" #include "rom_com.h" #include "stat_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* diff --git a/lib_dec/swb_tbe_dec.c b/lib_dec/swb_tbe_dec.c index 5b602bbfd68b2058d275a03c8df248d25449e972..50844ff680139d8fb3053a7f1bc650b37664e44b 100644 --- a/lib_dec/swb_tbe_dec.c +++ b/lib_dec/swb_tbe_dec.c @@ -44,7 +44,7 @@ #include "prot.h" #include "rom_com.h" #include "rom_dec.h" -#include "wmops.h" +#include "wmc_auto.h" #include "ivas_prot.h" /*-----------------------------------------------------------------* diff --git a/lib_dec/syn_outp.c b/lib_dec/syn_outp.c index cff7d72374ee94ea281256018ab3772617b3997a..aebc5ff5e016c9328cfc0472250504931d3267e5 100644 --- a/lib_dec/syn_outp.c +++ b/lib_dec/syn_outp.c @@ -42,7 +42,7 @@ #include #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * syn_output() diff --git a/lib_dec/tcq_core_dec.c b/lib_dec/tcq_core_dec.c index a7050f9de0e21cddd11a4437280794a98eb46f89..bcc3ca42864ed8264216286a3abf3aa96418ad89 100644 --- a/lib_dec/tcq_core_dec.c +++ b/lib_dec/tcq_core_dec.c @@ -44,7 +44,7 @@ #include "prot.h" #include "basop_util.h" #include "basop_proto_func.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * tcq_core_LR_enc() @@ -148,7 +148,7 @@ void tcq_core_LR_dec( } } -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP bsub_fx = L_shl( L_add( tcq_arbits, lsbtcq_bits ), 16 ); IF( bsub_fx > 0 ) { @@ -173,7 +173,7 @@ void tcq_core_LR_dec( } srt_vec_ind_fx( Rk_fx, Rk_sort_fx, k_sort, BANDS ); -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP /*read the bits*/ nb_bytes = bit_budget >> 3; @@ -248,10 +248,10 @@ void tcq_core_LR_dec( } if ( surplus_fx != 0 ) { -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP surplus_fx = L_add( Rk_fx[k_sort[k]], surplus_fx ); surplus_fx = L_add( delta_fx, surplus_fx ); -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP } } else @@ -283,10 +283,10 @@ void tcq_core_LR_dec( } if ( surplus_fx != 0 ) { -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP surplus_fx = L_add( Rk_fx[k_sort[k]], surplus_fx ); surplus_fx = L_add( delta_fx, surplus_fx ); -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP } } else @@ -315,7 +315,7 @@ void tcq_core_LR_dec( if ( Rk_fx[k_sort[k]] > 0 && surplus_fx < 0 ) { -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP IF( nzbands <= 1 ) { divider = 0; @@ -335,7 +335,7 @@ void tcq_core_LR_dec( delta_fx = 0; } surplus_fx = L_sub( surplus_fx, delta_fx ); -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP } else { @@ -344,13 +344,13 @@ void tcq_core_LR_dec( } } -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP if ( ( L_sub( surplus_fx, 524288 ) > 0 && sub( input_frame, L_FRAME8k ) == 0 ) || ( L_sub( surplus_fx, 786432 ) > 0 && sub( input_frame, L_FRAME16k ) == 0 ) ) { bit_surplus_fx[0] = Mult_32_16( surplus_fx, 24576 ); /* Q16 */ bit_surplus_fx[1] = Mult_32_16( surplus_fx, 8192 ); /* Q16 */ } -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP else { bit_surplus_fx[0] = surplus_fx; @@ -363,9 +363,9 @@ void tcq_core_LR_dec( { if ( k == k_num[j] ) { -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP Rk_fx[k_sort[k]] = L_add( Rk_fx[k_sort[k]], bit_surplus_fx[j] ); -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP if ( Rk_fx[k_sort[k]] > 0 && USQ_TCQ[k_sort[k]] == 0 ) { /* get number of pulses */ @@ -412,9 +412,9 @@ void tcq_core_LR_dec( decode_magnitude_usq_fx( pardec, band_width[k_sort[k]], pulsesnum, nz, &positions[band_start[k_sort[k]]], &inp_vector[band_start[k_sort[k]]] ); decode_signs_fx( pardec, band_width[k_sort[k]], &inp_vector[band_start[k_sort[k]]] ); -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP nzbands = sub( nzbands, 1 ); -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP } else { diff --git a/lib_dec/tcx_utils_dec.c b/lib_dec/tcx_utils_dec.c index f817c61e03a8473759493ebd5c9a2132e3b0a8ac..683a3738f91bdbb030d686aa74b173805dd46e97 100644 --- a/lib_dec/tcx_utils_dec.c +++ b/lib_dec/tcx_utils_dec.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------- * tcx_decoder_memory_update() diff --git a/lib_dec/tns_base_dec.c b/lib_dec/tns_base_dec.c index b7d977c84fe4f117b951a36581ca27655f3ebb07..d03815a19e3ddae4e3b0a05a8b760f8f857b6104 100644 --- a/lib_dec/tns_base_dec.c +++ b/lib_dec/tns_base_dec.c @@ -40,7 +40,7 @@ #include "rom_com.h" #include "prot.h" #include "stat_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* diff --git a/lib_dec/tonalMDCTconcealment.c b/lib_dec/tonalMDCTconcealment.c index a16638da512bc5d980a5ed19c37d4c917e8d8aaa..c792fc00339540392fbec53920cac89f9e3ab131 100644 --- a/lib_dec/tonalMDCTconcealment.c +++ b/lib_dec/tonalMDCTconcealment.c @@ -45,7 +45,7 @@ #include #include "prot.h" #include "ivas_prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*******************************************************/ @@ -502,7 +502,7 @@ void TonalMDCTConceal_InsertNoise( float g, nrgNoiseInLastFrame, nrgWhiteNoise, tiltFactor, tilt; float last_block_nrg_correct; - wmops_sub_start( "InsertNoise" ); + push_wmops( "InsertNoise" ); g = 1.0f - crossfadeGain; if ( !hTonalMDCTConc->lastBlockData.blockIsConcealed ) @@ -860,7 +860,7 @@ void TonalMDCTConceal_InsertNoise( *pSeed = rnd; - wmops_sub_end(); + pop_wmops(); return; } @@ -987,7 +987,7 @@ void TonalMdctConceal_create_concealment_noise( float *cngNoiseLevelPtr; float last_scf; - wmops_sub_start( "create_conc_noise" ); + push_wmops( "create_conc_noise" ); hStereoMdct = hCPE->hStereoMdct; st = hCPE->hCoreCoder[idchan]; @@ -1039,7 +1039,7 @@ void TonalMdctConceal_create_concealment_noise( concealment_noise[i] = *rnd; } - wmops_sub_end(); + pop_wmops(); return; } @@ -1118,7 +1118,7 @@ void TonalMdctConceal_create_concealment_noise( st->seed_tcx_plc = *rnd; - wmops_sub_end(); + pop_wmops(); return; } @@ -1135,7 +1135,7 @@ void TonalMdctConceal_whiten_noise_shape( float scfs_int[FDNS_NPTS]; const PsychoacousticParameters *psychParams; - wmops_sub_start( "apply_sns_on_noise_shape" ); + push_wmops( "apply_sns_on_noise_shape" ); scfs_bg = &st->hTonalMDCTConc->scaleFactorsBackground[0]; psychParams = st->hTonalMDCTConc->psychParams; @@ -1176,5 +1176,5 @@ void TonalMdctConceal_whiten_noise_shape( set_zero( hFdCngCom->cngNoiseLevel, stop_idx - start_idx ); } - wmops_sub_end(); + pop_wmops(); } diff --git a/lib_dec/transition_dec.c b/lib_dec/transition_dec.c index 9bcecf40b87d70a5ca7b492b76fd03dd8f11607a..6b7f22891f989a2b8ad25af9ad4fec0dff3e7d23 100644 --- a/lib_dec/transition_dec.c +++ b/lib_dec/transition_dec.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*----------------------------------------------------------------------* * Local function prototypes diff --git a/lib_dec/updt_dec.c b/lib_dec/updt_dec.c index 2c3eed80e3235028584a5c40503498e3bd7e8d4e..cf9705e73e287109a9ac002d3d2b80f285d393a2 100644 --- a/lib_dec/updt_dec.c +++ b/lib_dec/updt_dec.c @@ -43,7 +43,7 @@ #include "prot.h" #include "rom_com.h" #include "cnst.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * updt_dec() diff --git a/lib_dec/vlpc_1st_dec.c b/lib_dec/vlpc_1st_dec.c index 1aa1ab72f21febd0970da62363b2cd19f0c2cb07..37408124493c5963575ebc17940601b28da89427 100644 --- a/lib_dec/vlpc_1st_dec.c +++ b/lib_dec/vlpc_1st_dec.c @@ -39,7 +39,7 @@ #include "options.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------* * vlpc_1st_dec() diff --git a/lib_dec/vlpc_2st_dec.c b/lib_dec/vlpc_2st_dec.c index 83163cda78a2afc6c9b2bbd4f47916f0739a7066..49ab4e0629fb0f8ce550330e5270e0e790f2008d 100644 --- a/lib_dec/vlpc_2st_dec.c +++ b/lib_dec/vlpc_2st_dec.c @@ -37,7 +37,7 @@ #include #include "options.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------* * vlpc_2st_dec() diff --git a/lib_dec/voiced_dec.c b/lib_dec/voiced_dec.c index cda7120103a7b8cfc7af14c0ce154c6527837cac..2771224ac08e3b549655784079d2b79059c80f73 100644 --- a/lib_dec/voiced_dec.c +++ b/lib_dec/voiced_dec.c @@ -40,7 +40,7 @@ #include "prot.h" #include "cnst.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * ppp_voiced_decoder() @@ -233,9 +233,9 @@ ivas_error ppp_voiced_decoder( mvr2r( dtfs_temp->a, hSC_VBR->dtfs_dec_a, MAXLAG_WI ); mvr2r( dtfs_temp->b, hSC_VBR->dtfs_dec_b, MAXLAG_WI ); - dynamic_free( TMPDTFS ); - dynamic_free( CURRP_Q_D ); - dynamic_free( dtfs_temp ); + free( TMPDTFS ); + free( CURRP_Q_D ); + free( dtfs_temp ); return error; } diff --git a/lib_dec/waveadjust_fec_dec.c b/lib_dec/waveadjust_fec_dec.c index 222fb66599b49e84059c6c48bb2743c97ab08d27..f0fec98056b480ac463cf6cab690f8e7a624e3d6 100644 --- a/lib_dec/waveadjust_fec_dec.c +++ b/lib_dec/waveadjust_fec_dec.c @@ -41,7 +41,7 @@ #endif #include #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* diff --git a/lib_enc/ACcontextMapping_enc.c b/lib_enc/ACcontextMapping_enc.c index 62ab9e7552c227cf1040737a7f71b70f16e989d5..7f86ea5cf06cc6be294e416cfd4e7171e6ebfac7 100644 --- a/lib_enc/ACcontextMapping_enc.c +++ b/lib_enc/ACcontextMapping_enc.c @@ -46,7 +46,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* diff --git a/lib_enc/FEC_enc.c b/lib_enc/FEC_enc.c index 89868e6729551a8df58a69eb0e37e210b93db1a3..98d07eb13e8f11061b1fb31bf46d86b21fdedb47 100644 --- a/lib_enc/FEC_enc.c +++ b/lib_enc/FEC_enc.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * FEC_encode() diff --git a/lib_enc/SNR_calc.c b/lib_enc/SNR_calc.c index 1ccaad6e0fbfe5317655b1e1963dc173d3d32c35..08ee8706dc3a6570cf9b6e45f29f1069402cdb00 100644 --- a/lib_enc/SNR_calc.c +++ b/lib_enc/SNR_calc.c @@ -39,7 +39,7 @@ #include #include "prot.h" #include "rom_enc.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* diff --git a/lib_enc/acelp_core_enc.c b/lib_enc/acelp_core_enc.c index 857099ed927bdd9976caa750bfdb3c407f0fb15d..e1bfd633d42f2f441db7d506173771c25144c116 100644 --- a/lib_enc/acelp_core_enc.c +++ b/lib_enc/acelp_core_enc.c @@ -50,7 +50,7 @@ #ifdef LSF_RE_USE_SECONDARY_CHANNEL #include "ivas_rom_com.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * acelp_core_enc() @@ -131,7 +131,7 @@ ivas_error acelp_core_enc( return error; } - wmops_sub_start( "acelp_core_enc" ); + push_wmops( "acelp_core_enc" ); /*------------------------------------------------------------------* * Initialization *------------------------------------------------------------------*/ @@ -757,7 +757,7 @@ ivas_error acelp_core_enc( } } - wmops_sub_end(); + pop_wmops(); return error; } diff --git a/lib_enc/acelp_core_switch_enc.c b/lib_enc/acelp_core_switch_enc.c index efabd35882de2da245307f8d97fb67eff1502175..6849b40a9e1239178288404e1e734d87a685bea6 100644 --- a/lib_enc/acelp_core_switch_enc.c +++ b/lib_enc/acelp_core_switch_enc.c @@ -44,7 +44,7 @@ #include "rom_enc.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * Local function prototypes diff --git a/lib_enc/acelp_enc_util.c b/lib_enc/acelp_enc_util.c index 003dadb026122b366b91acff392189eea7ba3919..275cb239ec10ed2df4ea3583611fce2778631a36 100644 --- a/lib_enc/acelp_enc_util.c +++ b/lib_enc/acelp_enc_util.c @@ -43,7 +43,7 @@ #include "prot.h" #include "cnst.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * E_ACELP_toeplitz_mul() diff --git a/lib_enc/amr_wb_enc.c b/lib_enc/amr_wb_enc.c index e9fca2c737d24dd107e4687d7318b72fe0a708e6..ee15cee32c5125fda9cb0ca46321ee031ebad50d 100644 --- a/lib_enc/amr_wb_enc.c +++ b/lib_enc/amr_wb_enc.c @@ -43,7 +43,7 @@ #include "rom_enc.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" #ifdef DEBUG_MODE_INFO extern float snr_[2][320]; diff --git a/lib_enc/analy_lp.c b/lib_enc/analy_lp.c index b4b990634e401716793e511eeacc14fa1c8bd272..2f216cef9095cbb816354eba6ed3794eb3a31a47 100644 --- a/lib_enc/analy_lp.c +++ b/lib_enc/analy_lp.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * analy_lp() diff --git a/lib_enc/analy_sp.c b/lib_enc/analy_sp.c index 5828e72483509a2db1a0f0b4e0baa111678047d6..ab3e69bf0f17cb451d503b1ce36ba6878e969cd7 100644 --- a/lib_enc/analy_sp.c +++ b/lib_enc/analy_sp.c @@ -44,7 +44,7 @@ #include "rom_enc.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" #include #include "ivas_cnst.h" diff --git a/lib_enc/ari_enc.c b/lib_enc/ari_enc.c index 3c6df474f873c408d6d7feaf6ea626aaf70cb9c6..7b5a17f6c08bace9bc0e56d2ccd9801158a9672d 100644 --- a/lib_enc/ari_enc.c +++ b/lib_enc/ari_enc.c @@ -44,7 +44,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------- diff --git a/lib_enc/ari_hm_enc.c b/lib_enc/ari_hm_enc.c index c88ac3812a4b4d137fa3d751ac0ffe0140b30773..168fa02845659e640a0bda12dee2cdcdadfb0792 100644 --- a/lib_enc/ari_hm_enc.c +++ b/lib_enc/ari_hm_enc.c @@ -44,7 +44,7 @@ #include "basop_util.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * EncodeIndex() diff --git a/lib_enc/arith_coder_enc.c b/lib_enc/arith_coder_enc.c index 553721377c396bc79b2a8593a8f068e7028a6afd..e292a2c8816d94c69591ad9dd6e3a2992a884fb4 100644 --- a/lib_enc/arith_coder_enc.c +++ b/lib_enc/arith_coder_enc.c @@ -46,7 +46,7 @@ #include "rom_com.h" #include "basop_util.h" #include "basop_proto_func.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local constants @@ -611,9 +611,9 @@ void tcx_arith_encode_envelope( gamma_w = 1.0f; gamma_uw = 1.0f / st->gamma; -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP tcx_arith_render_envelope( A_ind, L_frame, L_spec, FL2WORD16( hTcxCfg->preemph_fac ), FL2WORD16( gamma_w ), FL2WORD16( 0.5f * gamma_uw ), env ); -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP for ( k = 0; k < L_spec; ++k ) { @@ -649,13 +649,13 @@ void tcx_arith_encode_envelope( envelope = (Word16 *) env; tcx_arith_scale_envelope( L_spec, L_spec_core, env, target_bits, low_complexity, envelope, &envelope_e ); -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP tmp = sub( envelope_e, 1 ); FOR( k = 0; k < L_spec; k++ ) { exponents[k] = expfp( negate( envelope[k] ), tmp ); } -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP scale = tcx_arith_rateloop( spectrum, L_spec, envelope, envelope_e, exponents, target_bits, deadzone, deadzone_flags, &( hTcxEnc->tcx_target_bits_fac ) ); /* Final quantization */ diff --git a/lib_enc/avq_cod.c b/lib_enc/avq_cod.c index 601138ccd0803fe6cfc17a19cce8581afbbff4b3..f2fe58a93293face520357352ac3057257a9e9f4 100644 --- a/lib_enc/avq_cod.c +++ b/lib_enc/avq_cod.c @@ -42,7 +42,7 @@ #include #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local prototypes diff --git a/lib_enc/bass_psfilter_enc.c b/lib_enc/bass_psfilter_enc.c index 3d9a390945d4e8b42fa3d7a0e0ab73e1fda8e001..fb7d656931572f4de1b1bc899c241f5c94106cea 100644 --- a/lib_enc/bass_psfilter_enc.c +++ b/lib_enc/bass_psfilter_enc.c @@ -42,7 +42,7 @@ #include #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* diff --git a/lib_enc/bw_detect.c b/lib_enc/bw_detect.c index a69913eb4a6786196f01915cdb2cafe0de35c012..4182ef4e473280e6493f6efe37397b65b1b39ef7 100644 --- a/lib_enc/bw_detect.c +++ b/lib_enc/bw_detect.c @@ -46,7 +46,7 @@ #include "rom_com.h" #include "prot.h" #include "ivas_prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local constants diff --git a/lib_enc/cng_enc.c b/lib_enc/cng_enc.c index 20787dd3f714f2af221046f5bfb148fea734104d..cd9bd2b022804156d5203138cee6ba36260afba9 100644 --- a/lib_enc/cng_enc.c +++ b/lib_enc/cng_enc.c @@ -44,7 +44,7 @@ #include "rom_enc.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * Local constants diff --git a/lib_enc/cod2t32.c b/lib_enc/cod2t32.c index 1efef884d48a2d1c235ea7965ac6a26ceb312b47..85bc7a3a4cb1b1e998feee4a9d9132e3d8c42dac 100644 --- a/lib_enc/cod2t32.c +++ b/lib_enc/cod2t32.c @@ -41,7 +41,7 @@ #endif #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * Local constants diff --git a/lib_enc/cod4t64.c b/lib_enc/cod4t64.c index 2c9ad01e21ce27e3ca0adf8877b75b7e541afba8..4b51a2d18f0530d0f10a4f7ac9f5fe8bca5d8d43 100644 --- a/lib_enc/cod4t64.c +++ b/lib_enc/cod4t64.c @@ -44,7 +44,7 @@ #include "rom_enc.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * Local function prototypes diff --git a/lib_enc/cod4t64_fast.c b/lib_enc/cod4t64_fast.c index b67248ebe2bc65967e8cfb956a373a61228fb87f..440ed8040f86699556722fd2e0011dd76d38f69b 100644 --- a/lib_enc/cod4t64_fast.c +++ b/lib_enc/cod4t64_fast.c @@ -40,7 +40,7 @@ #include "prot.h" #include "ivas_prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local constants diff --git a/lib_enc/cod_ace.c b/lib_enc/cod_ace.c index 091146298af6849bc4e6cf43fa9421819c7d043e..6903e61bc281bdc443b884aa271cfa331be015bd 100644 --- a/lib_enc/cod_ace.c +++ b/lib_enc/cod_ace.c @@ -42,7 +42,7 @@ #include "debug.h" #endif #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * coder_acelp() diff --git a/lib_enc/cod_tcx.c b/lib_enc/cod_tcx.c index 5813ca413870da1e53229f4f26347d0c39ed8db2..9fd716603a9f652a29de3d6fc031a3fdeb3c302a 100644 --- a/lib_enc/cod_tcx.c +++ b/lib_enc/cod_tcx.c @@ -40,7 +40,7 @@ #include #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" #include "ivas_prot.h" #include "ivas_rom_com.h" #ifdef DEBUGGING diff --git a/lib_enc/cod_uv.c b/lib_enc/cod_uv.c index 166a9685dc407bf585694b3cbb3ec9292d8a9770..5a64f93d0624a5c9860f26f464b0f6ca6d01c0c6 100644 --- a/lib_enc/cod_uv.c +++ b/lib_enc/cod_uv.c @@ -37,7 +37,7 @@ #include #include "options.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * gauss_L2: diff --git a/lib_enc/comvad_decision.c b/lib_enc/comvad_decision.c index 4ccd0e41423097f0a0adce4702f212fe9b832b64..8c94c3a709f822fcc338a54e01419ea213aa5d32 100644 --- a/lib_enc/comvad_decision.c +++ b/lib_enc/comvad_decision.c @@ -38,7 +38,7 @@ #include "options.h" #include "prot.h" #include "rom_enc.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* diff --git a/lib_enc/cor_shif.c b/lib_enc/cor_shif.c index d27b097a43b325ff8965c5f6bc343a41732c1f19..1a5f5a3c2c2395553da22496bdb129e16f35f7c2 100644 --- a/lib_enc/cor_shif.c +++ b/lib_enc/cor_shif.c @@ -38,7 +38,7 @@ #include "options.h" #include #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Correlation_shift diff --git a/lib_enc/core_enc_2div.c b/lib_enc/core_enc_2div.c index 65a5c786501be955f31e2f6ea15c0026cb5c40cd..ed3789aed8bedf17a7633b002dda84cfd673b467 100644 --- a/lib_enc/core_enc_2div.c +++ b/lib_enc/core_enc_2div.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * core_encode_twodiv() diff --git a/lib_enc/core_enc_init.c b/lib_enc/core_enc_init.c index 009185cc8807b985760728344db59893e6457a19..d1bb1087c0ea105010bfe1bb988cf619c0595bd5 100644 --- a/lib_enc/core_enc_init.c +++ b/lib_enc/core_enc_init.c @@ -43,7 +43,7 @@ #include "prot.h" #include "ivas_prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------------* * Local function prototypes diff --git a/lib_enc/core_enc_ol.c b/lib_enc/core_enc_ol.c index a76189365379329928a29a3901710e82cad6a508..2a41b9ad9fbd0bc0f10037d108296d5f5c4bda0a 100644 --- a/lib_enc/core_enc_ol.c +++ b/lib_enc/core_enc_ol.c @@ -44,7 +44,7 @@ #include "prot.h" #include "rom_com.h" #include "basop_proto_func.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local function prototypes diff --git a/lib_enc/core_enc_reconf.c b/lib_enc/core_enc_reconf.c index 0489d210bc0bf40aa8a49eee0b391682e62bddb2..ed5b3f2fa7120e0242072ebee8242ea2dec8122a 100644 --- a/lib_enc/core_enc_reconf.c +++ b/lib_enc/core_enc_reconf.c @@ -42,7 +42,7 @@ #include "prot.h" #include "rom_com.h" #include "rom_enc.h" -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------* * Funtion core_coder_reconfig * diff --git a/lib_enc/core_enc_switch.c b/lib_enc/core_enc_switch.c index f96d0eed570cf1f4c9c0b74ec32747d53727be27..5b230295b28f59bd09260a7c2c23ea71ef7055c2 100644 --- a/lib_enc/core_enc_switch.c +++ b/lib_enc/core_enc_switch.c @@ -41,7 +41,7 @@ #endif #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * core_coder_mode_switch() diff --git a/lib_enc/core_enc_updt.c b/lib_enc/core_enc_updt.c index 987910bcb54990322220cf2790aa9103a0f653f2..0a05cc75454f7ba47f6aaf20b498558e42395b78 100644 --- a/lib_enc/core_enc_updt.c +++ b/lib_enc/core_enc_updt.c @@ -42,7 +42,7 @@ #include "prot.h" #include "rom_com.h" #include "cnst.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * core_encode_update() diff --git a/lib_enc/core_switching_enc.c b/lib_enc/core_switching_enc.c index 8eba36afc15044cfef70e8250fc828030ebf61ed..397965e9748eac3ce820c1ebbd57ca0c3418e9d5 100644 --- a/lib_enc/core_switching_enc.c +++ b/lib_enc/core_switching_enc.c @@ -44,7 +44,7 @@ #include "rom_enc.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * core_switching_pre_enc() diff --git a/lib_enc/corr_xh.c b/lib_enc/corr_xh.c index bf4d473bdaa2259b1522fbd7d7200e3609ff5437..b33b312d5a65814d9a757b5b810b957dd97c28f6 100644 --- a/lib_enc/corr_xh.c +++ b/lib_enc/corr_xh.c @@ -41,7 +41,7 @@ #endif #include "prot.h" #include "cnst.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * corr_xh() diff --git a/lib_enc/decision_matrix_enc.c b/lib_enc/decision_matrix_enc.c index 3433bdf1b461f61fff42a3674f06c97d1ee8851d..d23689786226eb3ff275054b254a290ffcac345c 100644 --- a/lib_enc/decision_matrix_enc.c +++ b/lib_enc/decision_matrix_enc.c @@ -44,7 +44,7 @@ #include "stat_enc.h" #include "stat_dec.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------* diff --git a/lib_enc/detect_transient.c b/lib_enc/detect_transient.c index 3eaddbc073a3bb9d81b029eb0182448436c06f38..2bb7c7b52815808cd30e41b996b3dffcd8ae0ac4 100644 --- a/lib_enc/detect_transient.c +++ b/lib_enc/detect_transient.c @@ -42,7 +42,7 @@ #include "prot.h" #include "cnst.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------------- * hp_filter() diff --git a/lib_enc/diffcod.c b/lib_enc/diffcod.c index 3d0c47ca627f79cc02dcfc224540b779917f3572..e6ec2104561d8497753a7a9bc50b47cf887fc32b 100644 --- a/lib_enc/diffcod.c +++ b/lib_enc/diffcod.c @@ -41,7 +41,7 @@ #endif #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------*/ /* Function diffcod() */ diff --git a/lib_enc/dtx.c b/lib_enc/dtx.c index 4d05245dbaa316da99e22809328701f0d7ad467a..fddcd6ad427aea30e0f5bdb04633a245194fdc54 100644 --- a/lib_enc/dtx.c +++ b/lib_enc/dtx.c @@ -45,7 +45,7 @@ #include "prot.h" #include "ivas_prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local constants diff --git a/lib_enc/enc_acelp.c b/lib_enc/enc_acelp.c index 07d63fe25b653dbdca0c2c7aaa89cb399d674353..c525648d16f65ed0e1d9fd535e94b699c45583b6 100644 --- a/lib_enc/enc_acelp.c +++ b/lib_enc/enc_acelp.c @@ -45,7 +45,7 @@ #include "prot.h" #include "rom_com.h" #include "rom_enc.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* diff --git a/lib_enc/enc_acelp_tcx_main.c b/lib_enc/enc_acelp_tcx_main.c index e087c8cedece6912e3f641679e02ce03334455f9..869c8f740647b22159373b605e12743b941cfa77 100644 --- a/lib_enc/enc_acelp_tcx_main.c +++ b/lib_enc/enc_acelp_tcx_main.c @@ -41,7 +41,7 @@ #endif #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * enc_acelp_tcx_main() @@ -64,7 +64,7 @@ void enc_acelp_tcx_main( float old_bwe_exc[( PIT16k_MAX + ( L_FRAME16k + 1 ) + L_SUBFR16k ) * 2]; /* excitation buffer */ float *ptr_bwe_exc; /* pointer to BWE excitation signal in the current frame */ - wmops_sub_start( "enc_acelp_tcx_main" ); + push_wmops( "enc_acelp_tcx_main" ); ptr_bwe_exc = old_bwe_exc + PIT16k_MAX * 2; @@ -129,6 +129,6 @@ void enc_acelp_tcx_main( /* coreSwitching update of Mode 1 parameters in the last frame */ st->last_coder_type = st->coder_type; - wmops_sub_end(); + pop_wmops(); return; } diff --git a/lib_enc/enc_acelpx.c b/lib_enc/enc_acelpx.c index 6c8e783d76c804ee26607987079a8bde9b75be7c..dc7a232fae2873816e052e0928a6cfaf94dda1c0 100644 --- a/lib_enc/enc_acelpx.c +++ b/lib_enc/enc_acelpx.c @@ -43,7 +43,7 @@ #endif #include "prot.h" #include "rom_enc.h" -#include "wmops.h" +#include "wmc_auto.h" /* Iterations: nb_pos_ix*16 */ diff --git a/lib_enc/enc_amr_wb.c b/lib_enc/enc_amr_wb.c index 2e88776d8f2e7686fd0c37275ea28dfa0fd8e5f6..af1366ee6f6f8799fdfe4c89fc707c283b2b4ae2 100644 --- a/lib_enc/enc_amr_wb.c +++ b/lib_enc/enc_amr_wb.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * encod_amr_wb() diff --git a/lib_enc/enc_gain.c b/lib_enc/enc_gain.c index a5728e1f377cfee91c3e03d1704e99e2a689b87b..5d2df71cbd95bf52c6353fac892c130b442b02b8 100644 --- a/lib_enc/enc_gain.c +++ b/lib_enc/enc_gain.c @@ -41,7 +41,7 @@ #include "prot.h" #include "rom_enc.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /* diff --git a/lib_enc/enc_gen_voic.c b/lib_enc/enc_gen_voic.c index dd642cd47035c4a7433c243a20147e1bba33b058..e2b2c96e05fbdd99f2efb9c00cda0fafee85bbc3 100644 --- a/lib_enc/enc_gen_voic.c +++ b/lib_enc/enc_gen_voic.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * encod_gen_voic() diff --git a/lib_enc/enc_gen_voic_rf.c b/lib_enc/enc_gen_voic_rf.c index e8af6856adee45d1d887ce2fd0f9fe88c6d150ae..ace0f5f2acc3f02cf939c77549269fa96a050111 100644 --- a/lib_enc/enc_gen_voic_rf.c +++ b/lib_enc/enc_gen_voic_rf.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * reset_rf_indices() diff --git a/lib_enc/enc_higher_acelp.c b/lib_enc/enc_higher_acelp.c index ebda178d8b37f71bda0657efae99f87f73e7c8d1..96fd12eec9731c80da28505ddf412da2c72b1fe7 100644 --- a/lib_enc/enc_higher_acelp.c +++ b/lib_enc/enc_higher_acelp.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * Local function prototypes diff --git a/lib_enc/enc_nelp.c b/lib_enc/enc_nelp.c index 11ec6105b9b82ca923730d8349706512353e4a3e..ba7983216057a7849e6a2fa2ea845690fd26bb4e 100644 --- a/lib_enc/enc_nelp.c +++ b/lib_enc/enc_nelp.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * encod_nelp() diff --git a/lib_enc/enc_pit_exc.c b/lib_enc/enc_pit_exc.c index d4e20f5cc531ba0871ae192d2651cbed5c004cd9..8c71d6b87e3e8cbacbde1da93b9798536f10ef37 100644 --- a/lib_enc/enc_pit_exc.c +++ b/lib_enc/enc_pit_exc.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * enc_pit_exc() diff --git a/lib_enc/enc_ppp.c b/lib_enc/enc_ppp.c index b7668bfb012b47be57df34012ec15252ce038920..230aff7481516054c9b6738e943d0b55b8d59888 100644 --- a/lib_enc/enc_ppp.c +++ b/lib_enc/enc_ppp.c @@ -41,7 +41,7 @@ #endif #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------- * encod_ppp() diff --git a/lib_enc/enc_prm.c b/lib_enc/enc_prm.c index cd606af8fbbf669acc52c9334a410def511adab7..f48bb968c29ba353806eddbcd13a4d08f2f202f1 100644 --- a/lib_enc/enc_prm.c +++ b/lib_enc/enc_prm.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* diff --git a/lib_enc/enc_tran.c b/lib_enc/enc_tran.c index ee1768067e5aa3e54cb518f3f24069ea5cba2368..600466bfa1c2f7370153cfa216f03b787469f513 100644 --- a/lib_enc/enc_tran.c +++ b/lib_enc/enc_tran.c @@ -41,7 +41,7 @@ #endif #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * encod_tran() diff --git a/lib_enc/enc_uv.c b/lib_enc/enc_uv.c index c34419c7dfd1a5c03294fbee08cf51af32abc70c..cbdc8a0d7e3df3184eceae2a56bba07679d2e559 100644 --- a/lib_enc/enc_uv.c +++ b/lib_enc/enc_uv.c @@ -43,7 +43,7 @@ #include #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * encod_unvoiced() diff --git a/lib_enc/energy.c b/lib_enc/energy.c index e69063b873e12a99cb191eda821eb2d0a8206a87..408964a31b55ce6098b38147c9ffd4cb221c1aa7 100644 --- a/lib_enc/energy.c +++ b/lib_enc/energy.c @@ -39,7 +39,7 @@ #include "prot.h" #include "cnst.h" #include "rom_enc.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * background_update() diff --git a/lib_enc/eval_pit_contr.c b/lib_enc/eval_pit_contr.c index d7eb087e570da5dff87efb1d00429578c8ec2d7c..0e3d041f26bdbec53fcc8c9f600415e3e214f7e7 100644 --- a/lib_enc/eval_pit_contr.c +++ b/lib_enc/eval_pit_contr.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local constantes diff --git a/lib_enc/evs_enc.c b/lib_enc/evs_enc.c index 8a75a8a8108fcff65f994e295e84b1ea16f786fa..9489742b4c112bfbf2bf8f0c3a30e169403876f7 100644 --- a/lib_enc/evs_enc.c +++ b/lib_enc/evs_enc.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local function prototypes @@ -105,7 +105,7 @@ ivas_error evs_enc( error = IVAS_ERR_OK; - wmops_sub_start( "evs_enc" ); + push_wmops( "evs_enc" ); /*------------------------------------------------------------------* * Initialization *-----------------------------------------------------------------*/ @@ -402,7 +402,7 @@ ivas_error evs_enc( * WB TBE encoding * WB BWE encoding *---------------------------------------------------------------------*/ - wmops_sub_start( "BWE_encoding" ); + push_wmops( "BWE_encoding" ); if ( st->input_Fs >= 16000 && st->bwidth < SWB ) { @@ -513,7 +513,7 @@ ivas_error evs_enc( swb_CNG_enc( st, shb_speech, old_syn_12k8_16k ); } - wmops_sub_end(); + pop_wmops(); /*---------------------------------------------------------------------* * Channel-aware mode - write signaling information into the bitstream *---------------------------------------------------------------------*/ @@ -588,7 +588,7 @@ ivas_error evs_enc( } #endif - wmops_sub_end(); + pop_wmops(); return error; } diff --git a/lib_enc/ext_sig_ana.c b/lib_enc/ext_sig_ana.c index 58d1e34a5687da491394666ee4fd0fbddbc89226..d2e33cb6bf59f9c8585f458bada3acc03283d778 100644 --- a/lib_enc/ext_sig_ana.c +++ b/lib_enc/ext_sig_ana.c @@ -43,7 +43,7 @@ #include #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" #ifdef DEBUG_PLOT #include "deb_out.h" #endif diff --git a/lib_enc/fd_cng_enc.c b/lib_enc/fd_cng_enc.c index e3a349b2ae77a3b67bfc21e51a9d237019d8a47e..016847877c22b7864bcb47d34f51566fb4c2b843 100644 --- a/lib_enc/fd_cng_enc.c +++ b/lib_enc/fd_cng_enc.c @@ -46,7 +46,7 @@ #include "prot.h" #include "ivas_prot.h" #include "stat_enc.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * createFdCngEnc() @@ -66,7 +66,7 @@ ivas_error createFdCngEnc( *hFdCngEnc = NULL; /* Allocate memory */ - hs = (HANDLE_FD_CNG_ENC) count_malloc( sizeof( FD_CNG_ENC ) ); + hs = (HANDLE_FD_CNG_ENC) malloc( sizeof( FD_CNG_ENC ) ); if ( hs == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for FD CNG ENC structure" ); @@ -282,7 +282,7 @@ void deleteFdCngEnc( if ( hsEnc != NULL ) { deleteFdCngCom( &( hsEnc->hFdCngCom ) ); - count_free( hsEnc ); + free( hsEnc ); *hFdCngEnc = NULL; } diff --git a/lib_enc/find_tar.c b/lib_enc/find_tar.c index b97cd8fd575444f703139ccd3b11ace049f61a9e..edbf873704da6ff7abc3ee8626977283d47b86ad 100644 --- a/lib_enc/find_tar.c +++ b/lib_enc/find_tar.c @@ -41,7 +41,7 @@ #endif #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * find_targets() diff --git a/lib_enc/find_tilt.c b/lib_enc/find_tilt.c index 140c3b84bff77930041dfbe8a6617708aeeaee74..da601dd87ab14fba4ba02c5fbf9f41db05ab5b59 100644 --- a/lib_enc/find_tilt.c +++ b/lib_enc/find_tilt.c @@ -42,7 +42,7 @@ #include #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * Local constants diff --git a/lib_enc/find_uv.c b/lib_enc/find_uv.c index fcfbfaa497eec502dc1b87b0abae420d2cb54648..e05a94e1d9eb0f824bcad5b161e4138d77571089 100644 --- a/lib_enc/find_uv.c +++ b/lib_enc/find_uv.c @@ -42,7 +42,7 @@ #include #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local constants diff --git a/lib_enc/find_wsp.c b/lib_enc/find_wsp.c index d2e2575b521ee2d71ae401c1ff196e387104072b..42b6b62e4504ca4827116ee89a92359aa4fcbe88 100644 --- a/lib_enc/find_wsp.c +++ b/lib_enc/find_wsp.c @@ -41,7 +41,7 @@ #endif #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * find_wsp() diff --git a/lib_enc/frame_spec_dif_cor_rate.c b/lib_enc/frame_spec_dif_cor_rate.c index 9b3329c5c1d25ff0b5b074525d68697e4bd077d0..ae240e497d80d1b46ab9fb64902671cf93ccf64f 100644 --- a/lib_enc/frame_spec_dif_cor_rate.c +++ b/lib_enc/frame_spec_dif_cor_rate.c @@ -38,7 +38,7 @@ #include "options.h" #include #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * frame_spec_dif_cor_rate() diff --git a/lib_enc/gain_enc.c b/lib_enc/gain_enc.c index 41389a6edba51c4cfb0f3d279021b1f48658fa8d..842e14a00ce7b30aad8418a0154d5b880b052103 100644 --- a/lib_enc/gain_enc.c +++ b/lib_enc/gain_enc.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local constants diff --git a/lib_enc/gaus_enc.c b/lib_enc/gaus_enc.c index 080f12f707d5dcc422ab77a47d7b6721e95edd93..9e931e27040f42e6509f2f587967f4cd45d5a22b 100644 --- a/lib_enc/gaus_enc.c +++ b/lib_enc/gaus_enc.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local constants diff --git a/lib_enc/gp_clip.c b/lib_enc/gp_clip.c index 036fcd2bf7bf75cd2a20297580afe59a1176bcf4..1d61b5de2131a1681c8e091c6804a2b22c2869fc 100644 --- a/lib_enc/gp_clip.c +++ b/lib_enc/gp_clip.c @@ -42,7 +42,7 @@ #include #include "prot.h" #include "cnst.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local constants diff --git a/lib_enc/gs_enc.c b/lib_enc/gs_enc.c index bd8897e554f4a03f4b09c9a045e92b381da16f49..45797a47d13deb2ab3746e76e84efcf997b36d8b 100644 --- a/lib_enc/gs_enc.c +++ b/lib_enc/gs_enc.c @@ -44,7 +44,7 @@ #include "rom_com.h" #include "prot.h" #include "ivas_prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local function prototypes diff --git a/lib_enc/guided_plc_enc.c b/lib_enc/guided_plc_enc.c index 28dd46c5448203906329e92344b7c81674cc1b9a..1baf8bf66399847ef0a2b2d32f03c4de0cea6516 100644 --- a/lib_enc/guided_plc_enc.c +++ b/lib_enc/guided_plc_enc.c @@ -39,7 +39,7 @@ #include #include "prot.h" #include "stat_enc.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * coderLookAheadInnovation() diff --git a/lib_enc/hf_cod_amrwb.c b/lib_enc/hf_cod_amrwb.c index e731e13da959e2302681868191c0dbb9ff2fd4f3..66b6dc59f2464e765968cdfe20c1bc4b34392baa 100644 --- a/lib_enc/hf_cod_amrwb.c +++ b/lib_enc/hf_cod_amrwb.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * Local function prototypes diff --git a/lib_enc/hq_classifier_enc.c b/lib_enc/hq_classifier_enc.c index f604939d21226563e3be3fa329a8abf7048af05e..fc6eea1205e26aa6e37cc667871e941bb7c47622 100644 --- a/lib_enc/hq_classifier_enc.c +++ b/lib_enc/hq_classifier_enc.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------* * Local constants diff --git a/lib_enc/hq_core_enc.c b/lib_enc/hq_core_enc.c index bb66182d3d9130a9b75acbfa1da5e2623769c3e0..24b68016db0eb0293887c8ec6a33fcb2250a9a0a 100644 --- a/lib_enc/hq_core_enc.c +++ b/lib_enc/hq_core_enc.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------------- * hq_core_enc() @@ -72,7 +72,7 @@ void hq_core_enc( BSTR_ENC_HANDLE hBstr = st->hBstr; - wmops_sub_start( "hq_core_enc" ); + push_wmops( "hq_core_enc" ); set_f( t_audio, 0, L_FRAME48k ); st->Nb_ACELP_frames = 0; @@ -289,7 +289,7 @@ void hq_core_enc( mvr2r( output, st->hLPDmem->old_exc, L_FRAME16k ); } - wmops_sub_end(); + pop_wmops(); return; } diff --git a/lib_enc/hq_env_enc.c b/lib_enc/hq_env_enc.c index 0ddfc2cb0ef43cb518a307666c1a91c7fd278687..e458a9947c8ee72d280f6b81be45a8a0dfeffda0 100644 --- a/lib_enc/hq_env_enc.c +++ b/lib_enc/hq_env_enc.c @@ -42,7 +42,7 @@ #include "prot.h" #include "rom_com.h" #include "rom_enc.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------------------* * encode_envelope_indices() diff --git a/lib_enc/hq_hr_enc.c b/lib_enc/hq_hr_enc.c index 569d616066fd257a209f85da4b428f3f4b804439..9b3ad08c376c60ff03be6502a1ac65bb5e0be88e 100644 --- a/lib_enc/hq_hr_enc.c +++ b/lib_enc/hq_hr_enc.c @@ -43,7 +43,7 @@ #include "prot.h" #include "rom_enc.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------* * hq_hr_enc() diff --git a/lib_enc/hq_lr_enc.c b/lib_enc/hq_lr_enc.c index 184dc79e6b8094d21d1fe347b66ddbf4cb7ec0b4..3e6fb69eebbcd3db5569a6a5f5cc67924fe930a0 100644 --- a/lib_enc/hq_lr_enc.c +++ b/lib_enc/hq_lr_enc.c @@ -46,7 +46,7 @@ #include "prot.h" #include "stl.h" #include "basop_util.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------* @@ -326,7 +326,7 @@ void hq_lr_enc( spt_shorten_domain_set( hBstr, hHQ_core, t_audio, p2a_flags, new_band_start, new_band_end, new_band_width, bands, band_start, band_end, band_width, &bit_budget ); } -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP /* Estimate number of bits per band */ Q_band_energy = SWB_BWE_LR_Qbe; FOR( i = 0; i < bands; i++ ) @@ -368,11 +368,11 @@ void hq_lr_enc( move32(); /*Q(31-exp2) */ Ep_tmp_fx[i] = L_shr( L_tmp, sub( 15, exp2 ) ); /*Q13 */ } -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP if ( is_transient == 0 && inner_frame == L_FRAME8k && st->core_brate <= ACELP_13k20 ) { -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP lowband = 6; move16(); trans_bit = 2; @@ -640,7 +640,7 @@ void hq_lr_enc( L_band_energy_tmp[i] = L_shl( L_tmp, 1 ); /*Q_band_energy */ } } -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP for ( i = 0; i < bands; i++ ) { @@ -657,7 +657,7 @@ void hq_lr_enc( } else if ( is_transient == 0 && inner_frame == L_FRAME16k ) { -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP bit_budget = sub( bit_budget, 2 ); /* bits in high bands to indicate the last 2 subbands is allocated bits or not */ FOR( i = 0; i < bands; i++ ) { @@ -909,7 +909,7 @@ void hq_lr_enc( L_band_energy_tmp[i] = L_shl( L_tmp, 1 ); /*Q_band_energy */ } } -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP for ( i = 0; i < bands; i++ ) { @@ -1510,7 +1510,7 @@ static float band_energy_quant( for ( k = 0; k < bands; k++ ) L_band_energy[k] = (Word32) ( band_energy[k] * pow( 2.0f, SWB_BWE_LR_Qbe ) ); -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP exp_normd = norm_l( L_qint ); div_s( &rev_qint_fx, 0x4000, round_fx( L_shl( L_qint, exp_normd ) ) ); /* Q14-(29+exp_normd-16)+15 */ Qrev_qint = sub( 14 - ( 29 - 16 ) + 15, exp_normd ); @@ -1522,7 +1522,7 @@ static float band_energy_quant( L_tmp = L_mls( L_band_energy[k], rev_qint_fx ); /* Q14+Qrev_qint-15 */ bq1[k] = round_fx( L_shl( L_tmp, sub( 17, Qrev_qint ) ) ); /* 16-(14+Qrev_qint-15) */ } -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP if ( is_transient ) { @@ -1604,10 +1604,10 @@ static float band_energy_quant( for ( k = 0; k < bands; k++ ) { -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP L_band_energy[k] = L_mls( L_qint, (Word16) bq1[k] ); move32(); /* 29+0-15 -> Qbe(Q14) */ -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP band_energy[k] = (float) ( L_band_energy[k] / pow( 2.0f, SWB_BWE_LR_Qbe ) ); } @@ -1708,7 +1708,7 @@ static void mdct_spectrum_fine_gain_enc( Word16 Qgt; Word16 temp_lo_fx, temp_hi_fx; -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP /* Fine gain quantization on only the most significant energy bands */ /*delta = qint / gqlevs; */ exp_normn = norm_l( L_qint ); @@ -1733,7 +1733,7 @@ static void mdct_spectrum_fine_gain_enc( gain_table_fx[i] = shl( gain_table_fx[i], sub( 14, Qgt ) ); /* Qgt -> Q14 */ gain_table[i] = (float) ( gain_table_fx[i] / pow( 2.0f, 14 ) ); } -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP for ( k = bands - Ngq; k < bands; k++ ) { diff --git a/lib_enc/hvq_enc.c b/lib_enc/hvq_enc.c index d82de6f5f394c6b55fba891ba02d217b12b49e08..e169cb4673ea58b54ffbf23ae0a88cea650e6dbb 100644 --- a/lib_enc/hvq_enc.c +++ b/lib_enc/hvq_enc.c @@ -44,7 +44,7 @@ #include "prot.h" #include "rom_enc.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------* * hvq_enc() diff --git a/lib_enc/igf_enc.c b/lib_enc/igf_enc.c index e355cd2083872b56e454db3a66d7591c118c281c..277d36480dc71b36af7fc079ddbc3081b92ae6cb 100644 --- a/lib_enc/igf_enc.c +++ b/lib_enc/igf_enc.c @@ -45,7 +45,7 @@ #include "ivas_prot.h" #include "cnst.h" #include "stat_enc.h" -#include "wmops.h" +#include "wmc_auto.h" #ifdef DEBUG_PLOT #include "deb_out.h" #endif diff --git a/lib_enc/igf_scf_enc.c b/lib_enc/igf_scf_enc.c index b1a3842b8f4b534d0891a9352144cdb15969b8d3..b391bfcaad73609460f1662c36bfea7c99c49ba3 100644 --- a/lib_enc/igf_scf_enc.c +++ b/lib_enc/igf_scf_enc.c @@ -43,7 +43,7 @@ #include "stat_enc.h" #include "stat_com.h" #include "cnst.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* diff --git a/lib_enc/init_enc.c b/lib_enc/init_enc.c index 4e4ab24369b8d1da2cafa350a819fbbcbf2b45d4..722e4bfe12acc4988c6e1e2543e6e5e62f38e195 100644 --- a/lib_enc/init_enc.c +++ b/lib_enc/init_enc.c @@ -45,7 +45,7 @@ #include "prot.h" #include "ivas_prot.h" #include "ivas_cnst.h" -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------------* * init_encoder() @@ -107,7 +107,7 @@ ivas_error init_encoder( if ( !vad_only_flag ) { - if ( ( st->hBstr = (BSTR_ENC_HANDLE) count_malloc( sizeof( BSTR_ENC_DATA ) ) ) == NULL ) + if ( ( st->hBstr = (BSTR_ENC_HANDLE) malloc( sizeof( BSTR_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Bitstream structure\n" ) ); } @@ -256,7 +256,7 @@ ivas_error init_encoder( if ( !vad_only_flag ) { - if ( ( st->hSignalBuf = (SIGNAL_BUFFERS_ENC_HANDLE) count_malloc( sizeof( SIGNAL_BUFFERS_ENC_DATA ) ) ) == NULL ) + if ( ( st->hSignalBuf = (SIGNAL_BUFFERS_ENC_HANDLE) malloc( sizeof( SIGNAL_BUFFERS_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Signal buffers\n" ) ); } @@ -311,7 +311,7 @@ ivas_error init_encoder( if ( idchan == 0 || st->element_mode == IVAS_CPE_TD || st->element_mode == IVAS_CPE_MDCT || st->element_mode == EVS_MONO ) { - if ( ( st->hNoiseEst = (NOISE_EST_HANDLE) count_malloc( sizeof( NOISE_EST_DATA ) ) ) == NULL ) + if ( ( st->hNoiseEst = (NOISE_EST_HANDLE) malloc( sizeof( NOISE_EST_DATA ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Noise estimation\n" ); } @@ -332,7 +332,7 @@ ivas_error init_encoder( if ( ( idchan == 0 || st->element_mode == IVAS_CPE_TD || st->element_mode == IVAS_CPE_MDCT || st->element_mode == EVS_MONO ) && ( !vad_only_flag ) ) { - if ( ( st->hVAD = (VAD_HANDLE) count_malloc( sizeof( VAD_DATA ) ) ) == NULL ) + if ( ( st->hVAD = (VAD_HANDLE) malloc( sizeof( VAD_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for VAD\n" ) ); } @@ -348,7 +348,7 @@ ivas_error init_encoder( /* CLDFB-based VAD */ if ( st->element_mode == EVS_MONO ) { - if ( ( st->hVAD_CLDFB = (VAD_CLDFB_HANDLE) count_malloc( sizeof( T_CldfbVadState ) ) ) == NULL ) + if ( ( st->hVAD_CLDFB = (VAD_CLDFB_HANDLE) malloc( sizeof( T_CldfbVadState ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CLDFB VAD\n" ) ); } @@ -366,7 +366,7 @@ ivas_error init_encoder( if ( idchan == 0 || st->element_mode == IVAS_CPE_TD || st->element_mode == IVAS_CPE_MDCT || st->element_mode == EVS_MONO ) { - if ( ( st->hSpMusClas = (SP_MUS_CLAS_HANDLE) count_malloc( sizeof( SP_MUS_CLAS_DATA ) ) ) == NULL ) + if ( ( st->hSpMusClas = (SP_MUS_CLAS_HANDLE) malloc( sizeof( SP_MUS_CLAS_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Speech/music classifier\n" ) ); } @@ -414,7 +414,7 @@ ivas_error init_encoder( if ( ( ( idchan == 0 && st->Opt_DTX_ON ) || st->element_mode == EVS_MONO ) || ( st->element_mode == IVAS_CPE_MDCT && st->Opt_DTX_ON ) ) { - if ( ( st->hDtxEnc = (DTX_ENC_HANDLE) count_malloc( sizeof( DTX_ENC_DATA ) ) ) == NULL ) + if ( ( st->hDtxEnc = (DTX_ENC_HANDLE) malloc( sizeof( DTX_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DTX variables\n" ) ); } @@ -464,7 +464,7 @@ ivas_error init_encoder( if ( ( ( idchan == 0 && st->Opt_DTX_ON && st->element_mode != IVAS_CPE_MDCT ) || st->element_mode == EVS_MONO ) ) { - if ( ( st->hTdCngEnc = (TD_CNG_ENC_HANDLE) count_malloc( sizeof( TD_CNG_ENC_DATA ) ) ) == NULL ) + if ( ( st->hTdCngEnc = (TD_CNG_ENC_HANDLE) malloc( sizeof( TD_CNG_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DTX/TD CNG\n" ) ); } @@ -500,7 +500,7 @@ ivas_error init_encoder( if ( st->Opt_SC_VBR || st->element_mode == EVS_MONO ) { - if ( ( st->hSC_VBR = (SC_VBR_ENC_HANDLE) count_malloc( sizeof( SC_VBR_ENC_DATA ) ) ) == NULL ) + if ( ( st->hSC_VBR = (SC_VBR_ENC_HANDLE) malloc( sizeof( SC_VBR_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SC-VBR\n" ) ); } @@ -521,7 +521,7 @@ ivas_error init_encoder( if ( st->Opt_AMR_WB || st->element_mode == EVS_MONO ) { - if ( ( st->hAmrwb_IO = (AMRWB_IO_ENC_HANDLE) count_malloc( sizeof( AMRWB_IO_ENC_DATA ) ) ) == NULL ) + if ( ( st->hAmrwb_IO = (AMRWB_IO_ENC_HANDLE) malloc( sizeof( AMRWB_IO_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for AMR-WB IO\n" ) ); } @@ -539,7 +539,7 @@ ivas_error init_encoder( if ( ( idchan == 0 && st->element_mode != IVAS_CPE_MDCT ) || st->element_mode == IVAS_CPE_TD ) { - if ( ( st->hLPDmem = (LPD_state_HANDLE) count_malloc( sizeof( LPD_state ) ) ) == NULL ) + if ( ( st->hLPDmem = (LPD_state_HANDLE) malloc( sizeof( LPD_state ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LPDmem\n" ) ); } @@ -560,7 +560,7 @@ ivas_error init_encoder( if ( ( idchan == 0 && st->element_mode != IVAS_CPE_MDCT ) || st->element_mode == IVAS_CPE_TD ) { - if ( ( st->hGSCEnc = (GSC_ENC_HANDLE) count_malloc( sizeof( GSC_ENC_DATA ) ) ) == NULL ) + if ( ( st->hGSCEnc = (GSC_ENC_HANDLE) malloc( sizeof( GSC_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for GSC\n" ) ); } @@ -578,7 +578,7 @@ ivas_error init_encoder( if ( idchan == 0 && st->element_mode != IVAS_CPE_MDCT ) { - if ( ( st->hBWE_TD = (TD_BWE_ENC_HANDLE) count_malloc( sizeof( TD_BWE_ENC_DATA ) ) ) == NULL ) + if ( ( st->hBWE_TD = (TD_BWE_ENC_HANDLE) malloc( sizeof( TD_BWE_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TD BWE\n" ) ); } @@ -603,7 +603,7 @@ ivas_error init_encoder( if ( idchan == 0 && st->element_mode != IVAS_CPE_MDCT ) { - if ( ( st->hBWE_FD = (FD_BWE_ENC_HANDLE) count_malloc( sizeof( FD_BWE_ENC_DATA ) ) ) == NULL ) + if ( ( st->hBWE_FD = (FD_BWE_ENC_HANDLE) malloc( sizeof( FD_BWE_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FD BWE\n" ) ); } @@ -621,7 +621,7 @@ ivas_error init_encoder( if ( st->element_mode != IVAS_CPE_TD && st->element_mode != IVAS_CPE_MDCT && idchan == 0 ) { - if ( ( st->hHQ_core = (HQ_ENC_HANDLE) count_malloc( sizeof( HQ_ENC_DATA ) ) ) == NULL ) + if ( ( st->hHQ_core = (HQ_ENC_HANDLE) malloc( sizeof( HQ_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HQ core\n" ) ); } @@ -657,7 +657,7 @@ ivas_error init_encoder( if ( st->Opt_RF_ON || st->element_mode == EVS_MONO ) { - if ( ( st->hRF = (RF_ENC_HANDLE) count_malloc( sizeof( RF_ENC_DATA ) ) ) == NULL ) + if ( ( st->hRF = (RF_ENC_HANDLE) malloc( sizeof( RF_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for RF\n" ) ); } @@ -676,7 +676,7 @@ ivas_error init_encoder( if ( st->element_mode == EVS_MONO ) { - if ( ( st->hTECEnc = (TEC_ENC_HANDLE) count_malloc( sizeof( TEC_ENC_DATA ) ) ) == NULL ) + if ( ( st->hTECEnc = (TEC_ENC_HANDLE) malloc( sizeof( TEC_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TEC\n" ) ); } @@ -694,7 +694,7 @@ ivas_error init_encoder( // VE: reduction possible for MCT_CHAN_MODE_LFE channel - see I1-172 if ( idchan == 0 || st->element_mode == IVAS_CPE_MDCT ) { - if ( ( st->hTcxEnc = (TCX_ENC_HANDLE) count_malloc( sizeof( TCX_ENC_DATA ) ) ) == NULL ) + if ( ( st->hTcxEnc = (TCX_ENC_HANDLE) malloc( sizeof( TCX_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for hTcxEnc\n" ) ); } @@ -711,7 +711,7 @@ ivas_error init_encoder( /* MDCT classifier */ MDCT_classifier_reset( st->hTcxEnc ); - if ( ( st->hTcxCfg = (TCX_CONFIG_HANDLE) count_malloc( sizeof( TCX_config ) ) ) == NULL ) + if ( ( st->hTcxCfg = (TCX_CONFIG_HANDLE) malloc( sizeof( TCX_config ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for hTcxCfg\n" ) ); } @@ -728,7 +728,7 @@ ivas_error init_encoder( if ( ( idchan == 0 || st->element_mode == IVAS_CPE_MDCT ) && st->mct_chan_mode != MCT_CHAN_MODE_LFE ) { - if ( ( st->hIGFEnc = (IGF_ENC_INSTANCE_HANDLE) count_malloc( sizeof( IGF_ENC_INSTANCE ) ) ) == NULL ) + if ( ( st->hIGFEnc = (IGF_ENC_INSTANCE_HANDLE) malloc( sizeof( IGF_ENC_INSTANCE ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for hIGFEnc\n" ) ); } @@ -756,7 +756,7 @@ ivas_error init_encoder( /* PLC encoder */ if ( st->element_mode == EVS_MONO ) { - if ( ( st->hPlcExt = (PLC_ENC_EVS_HANDLE) count_malloc( sizeof( PLC_ENC_EVS ) ) ) == NULL ) + if ( ( st->hPlcExt = (PLC_ENC_EVS_HANDLE) malloc( sizeof( PLC_ENC_EVS ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for hPlcExt\n" ) ); } @@ -803,7 +803,7 @@ ivas_error init_encoder( if ( st->mct_chan_mode != MCT_CHAN_MODE_LFE ) { - if ( ( st->hTranDet = (TRAN_DET_HANDLE) count_malloc( sizeof( TRAN_DET_DATA ) ) ) == NULL ) + if ( ( st->hTranDet = (TRAN_DET_HANDLE) malloc( sizeof( TRAN_DET_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Transient Detection\n" ) ); } diff --git a/lib_enc/inov_enc.c b/lib_enc/inov_enc.c index c80057f0551d0629adf17ca5c635f445c4fb073e..09e3251f37ebe8193fc2f2d2587c1c91704a7cc9 100644 --- a/lib_enc/inov_enc.c +++ b/lib_enc/inov_enc.c @@ -43,7 +43,7 @@ #include "prot.h" #include "ivas_prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * inov_encode() diff --git a/lib_enc/isf_enc_amr_wb.c b/lib_enc/isf_enc_amr_wb.c index 441c66be9bf459f34d565c848cc62945c1022a30..ec369b46812f8a24b48a77af8099d48948722ae3 100644 --- a/lib_enc/isf_enc_amr_wb.c +++ b/lib_enc/isf_enc_amr_wb.c @@ -43,7 +43,7 @@ #include "rom_enc.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------* * Local constants diff --git a/lib_enc/ivas_agc_enc.c b/lib_enc/ivas_agc_enc.c index 9ebe2bb93859ced870d20a5a0b780a34fbe5944f..8808233892a6553be633f6d89120c6e388059dde 100644 --- a/lib_enc/ivas_agc_enc.c +++ b/lib_enc/ivas_agc_enc.c @@ -40,7 +40,7 @@ #include "prot.h" #include #include -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------------------------* @@ -152,7 +152,7 @@ ivas_error ivas_spar_agc_enc_open( ivas_agc_enc_state_t *hAgc; int16_t input_frame, delay; - if ( ( hAgc = (ivas_agc_enc_state_t *) count_malloc( sizeof( ivas_agc_enc_state_t ) ) ) == NULL ) + if ( ( hAgc = (ivas_agc_enc_state_t *) malloc( sizeof( ivas_agc_enc_state_t ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR AGC encoder" ); } @@ -160,17 +160,17 @@ ivas_error ivas_spar_agc_enc_open( input_frame = (int16_t) ( input_Fs / FRAMES_PER_SEC ); delay = NS2SA( input_Fs, ( IVAS_ENC_DELAY_NS + IVAS_DEC_DELAY_NS ) ); - if ( ( hAgc->agc_com.winFunc = (float *) count_malloc( sizeof( float ) * ( input_frame - delay ) ) ) == NULL ) + if ( ( hAgc->agc_com.winFunc = (float *) malloc( sizeof( float ) * ( input_frame - delay ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR AGC encoder" ); } - if ( ( hAgc->gain_state = (ivas_agc_enc_chan_state_t *) count_malloc( sizeof( ivas_agc_enc_chan_state_t ) * nchan_inp ) ) == NULL ) + if ( ( hAgc->gain_state = (ivas_agc_enc_chan_state_t *) malloc( sizeof( ivas_agc_enc_chan_state_t ) * nchan_inp ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR AGC encoder" ); } - if ( ( hAgc->gain_data = (ivas_agc_chan_data_t *) count_malloc( sizeof( ivas_agc_chan_data_t ) * nchan_inp ) ) == NULL ) + if ( ( hAgc->gain_data = (ivas_agc_chan_data_t *) malloc( sizeof( ivas_agc_chan_data_t ) * nchan_inp ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR AGC encoder" ); } @@ -199,16 +199,16 @@ void ivas_spar_agc_enc_close( if ( hAgc != NULL ) { - count_free( hAgc->agc_com.winFunc ); + free( hAgc->agc_com.winFunc ); hAgc->agc_com.winFunc = NULL; - count_free( hAgc->gain_state ); + free( hAgc->gain_state ); hAgc->gain_state = NULL; - count_free( hAgc->gain_data ); + free( hAgc->gain_data ); hAgc->gain_data = NULL; - count_free( hAgc ); + free( hAgc ); hAgc = NULL; } diff --git a/lib_enc/ivas_core_enc.c b/lib_enc/ivas_core_enc.c index 7a0ff91da5ea5c9a5e9abb0e6283af8b85f11e29..4e1478b65341170d0512343bdd6aa45f868cfb7b 100644 --- a/lib_enc/ivas_core_enc.c +++ b/lib_enc/ivas_core_enc.c @@ -40,7 +40,7 @@ #include "prot.h" #include "ivas_cnst.h" #include "ivas_prot.h" -#include "wmops.h" +#include "wmc_auto.h" #include #ifdef DEBUG_MODE_ACELP @@ -107,7 +107,7 @@ ivas_error ivas_core_enc( int32_t element_brate, last_element_brate, input_Fs; ivas_error error; - wmops_sub_start( "ivas_core_enc" ); + push_wmops( "ivas_core_enc" ); error = IVAS_ERR_OK; @@ -539,7 +539,7 @@ ivas_error ivas_core_enc( } #endif - wmops_sub_end(); + pop_wmops(); return error; } diff --git a/lib_enc/ivas_core_pre_proc.c b/lib_enc/ivas_core_pre_proc.c index acbacc09e0a266da989089bf1a8d6bee139076a5..6cdfd451800a630d3a70dda7458234990a2bae59 100644 --- a/lib_enc/ivas_core_pre_proc.c +++ b/lib_enc/ivas_core_pre_proc.c @@ -41,7 +41,7 @@ #include "rom_enc.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* @@ -85,7 +85,7 @@ ivas_error pre_proc_ivas( int32_t sr_core_tmp, total_brate_tmp; ivas_error error; - wmops_sub_start( "pre_proc" ); + push_wmops( "pre_proc" ); error = IVAS_ERR_OK; @@ -459,7 +459,7 @@ ivas_error pre_proc_ivas( dbgwrite( inp_16k, sizeof( float ), L_FRAME, 1, fname( debug_dir, "inp_16k", st->idchan, st->id_element, ENC ) ); #endif - wmops_sub_end(); + pop_wmops(); return error; } diff --git a/lib_enc/ivas_core_pre_proc_front.c b/lib_enc/ivas_core_pre_proc_front.c index f899eb7b67f5359d9592ecab72095b43f7c1b7a2..ad70c7a4529c11e0873c5ef9ba5ef94388bbf212 100644 --- a/lib_enc/ivas_core_pre_proc_front.c +++ b/lib_enc/ivas_core_pre_proc_front.c @@ -41,7 +41,7 @@ #include "rom_com.h" #include "prot.h" #include "ivas_prot.h" -#include "wmops.h" +#include "wmc_auto.h" #include @@ -175,7 +175,7 @@ ivas_error pre_proc_front_ivas( int16_t LR_vad_flag; ivas_error error; - wmops_sub_start( "pre_proc_front" ); + push_wmops( "pre_proc_front" ); /*------------------------------------------------------------------* * Initialization @@ -941,7 +941,7 @@ ivas_error pre_proc_front_ivas( mvr2r( &old_inp_12k8[L_FRAME], st->old_inp_12k8, L_INP_MEM ); - wmops_sub_end(); + pop_wmops(); return error; } diff --git a/lib_enc/ivas_corecoder_enc_reconfig.c b/lib_enc/ivas_corecoder_enc_reconfig.c index dfa7ed9ffae781a84b816af08e6a2bbea991beaf..df8dbbb4582be35397aaa5a1098fb07b0bfac045 100644 --- a/lib_enc/ivas_corecoder_enc_reconfig.c +++ b/lib_enc/ivas_corecoder_enc_reconfig.c @@ -40,7 +40,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* @@ -259,7 +259,7 @@ ivas_error ivas_corecoder_enc_reconfig( /* special case, if we have MCT now and had a single CPE before, remove the MDCT Stereo handles */ if ( st_ivas->nCPE > 1 && nCPE_old == 1 ) { - count_free( st_ivas->hCPE[0]->hStereoMdct ); + free( st_ivas->hCPE[0]->hStereoMdct ); st_ivas->hCPE[0]->hStereoMdct = NULL; } @@ -465,7 +465,7 @@ ivas_error ivas_corecoder_enc_reconfig( { if ( st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData == NULL ) { - if ( ( st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData = (BSTR_ENC_HANDLE) count_malloc( sizeof( BSTR_ENC_DATA ) ) ) == NULL ) + if ( ( st_ivas->hCPE[st_ivas->nCPE - 1]->hMetaData = (BSTR_ENC_HANDLE) malloc( sizeof( BSTR_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MetaData structure\n" ) ); } @@ -482,7 +482,7 @@ ivas_error ivas_corecoder_enc_reconfig( { if ( st_ivas->hCPE[cpe_id]->hMetaData != NULL ) { - count_free( st_ivas->hCPE[cpe_id]->hMetaData ); + free( st_ivas->hCPE[cpe_id]->hMetaData ); st_ivas->hCPE[cpe_id]->hMetaData = NULL; } } @@ -491,7 +491,7 @@ ivas_error ivas_corecoder_enc_reconfig( /* special case, if we have a single CPE and had MCT before we need to init the MDCT stereo handles here */ if ( st_ivas->nCPE == 1 && nCPE_old > 1 ) { - if ( ( st_ivas->hCPE[st_ivas->nCPE - 1]->hStereoMdct = (STEREO_MDCT_ENC_DATA_HANDLE) count_malloc( sizeof( STEREO_MDCT_ENC_DATA ) ) ) == NULL ) + if ( ( st_ivas->hCPE[st_ivas->nCPE - 1]->hStereoMdct = (STEREO_MDCT_ENC_DATA_HANDLE) malloc( sizeof( STEREO_MDCT_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MDCT Stereo \n" ) ); } diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index b565c346920384cd505188a1aeb1e44e42a28b84..c179ea1e4e0887bd2e6d801edea4e4cde36d77b1 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -42,7 +42,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* @@ -109,7 +109,7 @@ ivas_error ivas_cpe_enc( error = IVAS_ERR_OK; - wmops_sub_start( "ivas_cpe_enc" ); + push_wmops( "ivas_cpe_enc" ); hCPE = st_ivas->hCPE[cpe_id]; sts = hCPE->hCoreCoder; @@ -716,7 +716,7 @@ ivas_error ivas_cpe_enc( } #endif - wmops_sub_end(); + pop_wmops(); return error; } @@ -754,7 +754,7 @@ ivas_error create_cpe_enc( * Allocate CPE handle *-----------------------------------------------------------------*/ - if ( ( hCPE = (CPE_ENC_HANDLE) count_malloc( sizeof( CPE_ENC_DATA ) ) ) == NULL ) + if ( ( hCPE = (CPE_ENC_HANDLE) malloc( sizeof( CPE_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CPE\n" ) ); } @@ -788,7 +788,7 @@ ivas_error create_cpe_enc( { if ( ivas_format == STEREO_FORMAT || ivas_format == MASA_FORMAT || ( ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCMASA ) ) { - if ( ( hCPE->input_mem[n] = (float *) count_malloc( sizeof( float ) * NS2SA( input_Fs, STEREO_DFT_OVL_NS ) ) ) == NULL ) + if ( ( hCPE->input_mem[n] = (float *) malloc( sizeof( float ) * NS2SA( input_Fs, STEREO_DFT_OVL_NS ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DFT stereo memory\n" ) ); } @@ -805,7 +805,7 @@ ivas_error create_cpe_enc( * stereo classifier: allocate and initialize *-----------------------------------------------------------------*/ - if ( ( hCPE->hStereoClassif = (STEREO_CLASSIF_HANDLE) count_malloc( sizeof( STEREO_CLASSIF_DATA ) ) ) == NULL ) + if ( ( hCPE->hStereoClassif = (STEREO_CLASSIF_HANDLE) malloc( sizeof( STEREO_CLASSIF_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for stereo classifier structure\n" ) ); } @@ -825,7 +825,7 @@ ivas_error create_cpe_enc( if ( !( ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_MCT ) && ( cpe_id == ( st_ivas->nCPE - 1 ) ) ) #endif { - if ( ( hCPE->hMetaData = (BSTR_ENC_HANDLE) count_malloc( sizeof( BSTR_ENC_DATA ) ) ) == NULL ) + if ( ( hCPE->hMetaData = (BSTR_ENC_HANDLE) malloc( sizeof( BSTR_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MetaData structure\n" ) ); } @@ -837,7 +837,7 @@ ivas_error create_cpe_enc( for ( n = 0; n < CPE_CHANNELS; n++ ) { - if ( ( st = (ENC_CORE_HANDLE) count_malloc( sizeof( Encoder_State ) ) ) == NULL ) + if ( ( st = (ENC_CORE_HANDLE) malloc( sizeof( Encoder_State ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CoreCoder structure\n" ) ); } @@ -871,7 +871,7 @@ ivas_error create_cpe_enc( { if ( hCPE->element_mode == IVAS_CPE_TD || hCPE->element_mode == IVAS_CPE_DFT ) { - if ( ( hCPE->hStereoCng = (STEREO_CNG_ENC_HANDLE) count_malloc( sizeof( STEREO_CNG_ENC ) ) ) == NULL ) + if ( ( hCPE->hStereoCng = (STEREO_CNG_ENC_HANDLE) malloc( sizeof( STEREO_CNG_ENC ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Stereo Cng for Unified/TD \n" ) ); } @@ -924,7 +924,7 @@ ivas_error create_cpe_enc( if ( hCPE->element_mode != IVAS_CPE_MDCT ) { - if ( ( hCPE->hStereoTCA = (STEREO_TCA_ENC_HANDLE) count_malloc( sizeof( STEREO_TCA_ENC_DATA ) ) ) == NULL ) + if ( ( hCPE->hStereoTCA = (STEREO_TCA_ENC_HANDLE) malloc( sizeof( STEREO_TCA_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Stereo TCA\n" ) ); } @@ -938,7 +938,7 @@ ivas_error create_cpe_enc( if ( hCPE->element_mode != IVAS_CPE_MDCT ) { - if ( ( hCPE->hStereoICBWE = (STEREO_ICBWE_ENC_HANDLE) count_malloc( sizeof( STEREO_ICBWE_ENC_DATA ) ) ) == NULL ) + if ( ( hCPE->hStereoICBWE = (STEREO_ICBWE_ENC_HANDLE) malloc( sizeof( STEREO_ICBWE_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Stereo ICBWE \n" ) ); } @@ -952,7 +952,7 @@ ivas_error create_cpe_enc( if ( hCPE->element_mode == IVAS_CPE_TD ) { - if ( ( hCPE->hStereoTD = (STEREO_TD_ENC_DATA_HANDLE) count_malloc( sizeof( STEREO_TD_ENC_DATA ) ) ) == NULL ) + if ( ( hCPE->hStereoTD = (STEREO_TD_ENC_DATA_HANDLE) malloc( sizeof( STEREO_TD_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TD Stereo\n" ) ); } @@ -966,7 +966,7 @@ ivas_error create_cpe_enc( if ( hCPE->element_mode == IVAS_CPE_MDCT && st_ivas->nCPE == 1 ) { - if ( ( hCPE->hStereoMdct = (STEREO_MDCT_ENC_DATA_HANDLE) count_malloc( sizeof( STEREO_MDCT_ENC_DATA ) ) ) == NULL ) + if ( ( hCPE->hStereoMdct = (STEREO_MDCT_ENC_DATA_HANDLE) malloc( sizeof( STEREO_MDCT_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MDCT Stereo \n" ) ); } @@ -1007,7 +1007,7 @@ void destroy_cpe_enc( if ( hCPE->hStereoClassif != NULL ) { - count_free( hCPE->hStereoClassif ); + free( hCPE->hStereoClassif ); hCPE->hStereoClassif = NULL; } @@ -1015,14 +1015,14 @@ void destroy_cpe_enc( { if ( hCPE->input_mem[n] != NULL ) { - count_free( hCPE->input_mem[n] ); + free( hCPE->input_mem[n] ); hCPE->input_mem[n] = NULL; } } if ( hCPE->hMetaData != NULL ) { - count_free( hCPE->hMetaData ); + free( hCPE->hMetaData ); hCPE->hMetaData = NULL; } @@ -1045,7 +1045,7 @@ void destroy_cpe_enc( if ( hCPE->hStereoTD != NULL ) { - count_free( hCPE->hStereoTD ); + free( hCPE->hStereoTD ); hCPE->hStereoTD = NULL; } @@ -1057,19 +1057,19 @@ void destroy_cpe_enc( if ( hCPE->hStereoTCA != NULL ) { - count_free( hCPE->hStereoTCA ); + free( hCPE->hStereoTCA ); hCPE->hStereoTCA = NULL; } if ( hCPE->hStereoICBWE != NULL ) { - count_free( hCPE->hStereoICBWE ); + free( hCPE->hStereoICBWE ); hCPE->hStereoICBWE = NULL; } if ( hCPE->hStereoCng != NULL ) { - count_free( hCPE->hStereoCng ); + free( hCPE->hStereoCng ); hCPE->hStereoCng = NULL; } @@ -1082,7 +1082,7 @@ void destroy_cpe_enc( } } - count_free( hCPE ); + free( hCPE ); return; } diff --git a/lib_enc/ivas_decision_matrix_enc.c b/lib_enc/ivas_decision_matrix_enc.c index de6fe8dc96bfd9b90375133a903436d4e4c6aeec..de689b3a62e3e2800e219a9e3862982966934470 100644 --- a/lib_enc/ivas_decision_matrix_enc.c +++ b/lib_enc/ivas_decision_matrix_enc.c @@ -41,7 +41,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------* diff --git a/lib_enc/ivas_dirac_enc.c b/lib_enc/ivas_dirac_enc.c index 52b67fe0568bd3fac9bf195dc2dc10831b000fab..eeaf3ba48533635ffd398fb310e021ca559a022a 100644 --- a/lib_enc/ivas_dirac_enc.c +++ b/lib_enc/ivas_dirac_enc.c @@ -42,7 +42,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------- * Local function prototypes @@ -70,12 +70,12 @@ ivas_error ivas_dirac_enc_open( error = IVAS_ERR_OK; - if ( ( hDirAC = (DIRAC_ENC_HANDLE) count_malloc( sizeof( DIRAC_ENC_DATA ) ) ) == NULL ) + if ( ( hDirAC = (DIRAC_ENC_HANDLE) malloc( sizeof( DIRAC_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); } - if ( ( hDirAC->hConfig = (DIRAC_CONFIG_DATA_HANDLE) count_malloc( sizeof( DIRAC_CONFIG_DATA ) ) ) == NULL ) + if ( ( hDirAC->hConfig = (DIRAC_CONFIG_DATA_HANDLE) malloc( sizeof( DIRAC_CONFIG_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC Config\n" ) ); } @@ -125,7 +125,7 @@ ivas_error ivas_dirac_enc_open( for ( i = 0; i < DIRAC_MAX_ANA_CHANS; i++ ) { - hDirAC->sba_synchro_buffer[i] = (float *) count_malloc( hDirAC->num_samples_synchro_delay * sizeof( float ) ); + hDirAC->sba_synchro_buffer[i] = (float *) malloc( hDirAC->num_samples_synchro_delay * sizeof( float ) ); set_zero( hDirAC->sba_synchro_buffer[i], hDirAC->num_samples_synchro_delay ); } } @@ -142,11 +142,11 @@ ivas_error ivas_dirac_enc_open( /* intensity 3-dim */ for ( i = 0; i < DIRAC_NUM_DIMS; i++ ) { - hDirAC->direction_vector_m[i] = (float **) count_malloc( MAX_PARAM_SPATIAL_SUBFRAMES * sizeof( float * ) ); + hDirAC->direction_vector_m[i] = (float **) malloc( MAX_PARAM_SPATIAL_SUBFRAMES * sizeof( float * ) ); for ( j = 0; j < MAX_PARAM_SPATIAL_SUBFRAMES; j++ ) { - hDirAC->direction_vector_m[i][j] = (float *) count_malloc( DIRAC_MAX_NBANDS * sizeof( float ) ); + hDirAC->direction_vector_m[i][j] = (float *) malloc( DIRAC_MAX_NBANDS * sizeof( float ) ); set_f( hDirAC->direction_vector_m[i][j], 0.0f, DIRAC_MAX_NBANDS ); } } @@ -154,14 +154,14 @@ ivas_error ivas_dirac_enc_open( hDirAC->no_col_avg_diff = (int16_t) ( DIRAC_NO_COL_AVG_DIFF_NS / dirac_slot_ns ); for ( i = 0; i < DIRAC_NUM_DIMS; i++ ) { - hDirAC->buffer_intensity_real[i] = (float **) count_malloc( hDirAC->no_col_avg_diff * sizeof( float * ) ); + hDirAC->buffer_intensity_real[i] = (float **) malloc( hDirAC->no_col_avg_diff * sizeof( float * ) ); for ( j = 0; j < hDirAC->no_col_avg_diff; j++ ) { - hDirAC->buffer_intensity_real[i][j] = (float *) count_malloc( DIRAC_MAX_NBANDS * sizeof( float ) ); + hDirAC->buffer_intensity_real[i][j] = (float *) malloc( DIRAC_MAX_NBANDS * sizeof( float ) ); set_f( hDirAC->buffer_intensity_real[i][j], 0.0f, DIRAC_MAX_NBANDS ); } } - hDirAC->buffer_energy = (float *) count_malloc( DIRAC_MAX_NBANDS * hDirAC->no_col_avg_diff * sizeof( float ) ); + hDirAC->buffer_energy = (float *) malloc( DIRAC_MAX_NBANDS * hDirAC->no_col_avg_diff * sizeof( float ) ); set_f( hDirAC->buffer_energy, 0.0f, DIRAC_MAX_NBANDS * hDirAC->no_col_avg_diff ); if ( st_ivas->hQMetaData->useLowerRes ) @@ -245,7 +245,7 @@ void ivas_dirac_enc_close( { if ( hDirAC->sba_synchro_buffer[i] != NULL ) { - count_free( hDirAC->sba_synchro_buffer[i] ); + free( hDirAC->sba_synchro_buffer[i] ); hDirAC->sba_synchro_buffer[i] = NULL; } } @@ -255,7 +255,7 @@ void ivas_dirac_enc_close( { for ( j = 0; j < MAX_PARAM_SPATIAL_SUBFRAMES; j++ ) { - count_free( hDirAC->direction_vector_m[i][j] ); + free( hDirAC->direction_vector_m[i][j] ); hDirAC->direction_vector_m[i][j] = NULL; } @@ -263,28 +263,28 @@ void ivas_dirac_enc_close( { if ( hDirAC->buffer_intensity_real[i][j] != 0 ) { - count_free( hDirAC->buffer_intensity_real[i][j] ); + free( hDirAC->buffer_intensity_real[i][j] ); hDirAC->buffer_intensity_real[i][j] = NULL; } } - count_free( hDirAC->buffer_intensity_real[i] ); + free( hDirAC->buffer_intensity_real[i] ); hDirAC->buffer_intensity_real[i] = NULL; - count_free( hDirAC->direction_vector_m[i] ); + free( hDirAC->direction_vector_m[i] ); hDirAC->direction_vector_m[i] = NULL; } - count_free( hDirAC->buffer_energy ); + free( hDirAC->buffer_energy ); hDirAC->buffer_energy = NULL; if ( hDirAC->hConfig != NULL ) { - count_free( hDirAC->hConfig ); + free( hDirAC->hConfig ); hDirAC->hConfig = NULL; } - count_free( hDirAC ); + free( hDirAC ); return; } @@ -315,7 +315,7 @@ void ivas_dirac_enc( { int16_t i; - wmops_sub_start( "ivas_dirac_enc" ); + push_wmops( "ivas_dirac_enc" ); /*Check if highest band of input signal <= enc_param_start_band: could happen for WB input signal in 4TCs mode*/ if ( hDirAC->band_grouping[hDirAC->hConfig->nbands] <= hDirAC->band_grouping[hDirAC->hConfig->enc_param_start_band] ) @@ -436,7 +436,7 @@ void ivas_dirac_enc( } } - wmops_sub_end(); + pop_wmops(); return; } @@ -589,7 +589,7 @@ void ivas_dirac_param_est_enc( float reference_power[CLDFB_NO_COL_MAX][DIRAC_NO_FB_BANDS_MAX]; - wmops_sub_start( "dirac_enc_param_est" ); + push_wmops( "dirac_enc_param_est" ); /* Initialization */ l_ts = input_frame / MAX_PARAM_SPATIAL_SUBFRAMES; @@ -865,7 +865,7 @@ void ivas_dirac_param_est_enc( } #endif - wmops_sub_end(); + pop_wmops(); return; } diff --git a/lib_enc/ivas_enc.c b/lib_enc/ivas_enc.c index 61faee23a4320855fb763885cd1613a75e02847e..c5708647992d73c7c281eae78dfd5879e96264d3 100644 --- a/lib_enc/ivas_enc.c +++ b/lib_enc/ivas_enc.c @@ -41,7 +41,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * ivas_enc() @@ -72,7 +72,7 @@ ivas_error ivas_enc( #endif error = IVAS_ERR_OK; - wmops_sub_start( "ivas_enc" ); + push_wmops( "ivas_enc" ); /*------------------------------------------------------------------* * Initialization - general @@ -399,6 +399,6 @@ ivas_error ivas_enc( } #endif - wmops_sub_end(); + pop_wmops(); return error; } diff --git a/lib_enc/ivas_enc_cov_handler.c b/lib_enc/ivas_enc_cov_handler.c index 933c2c5de9b5a7185169fe7beb82396b379808a9..02d34abb52dced43e2d27b628ef0cc5cee5c003f 100644 --- a/lib_enc/ivas_enc_cov_handler.c +++ b/lib_enc/ivas_enc_cov_handler.c @@ -37,7 +37,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------------------------* * Local constants @@ -74,7 +74,7 @@ ivas_error ivas_spar_covar_enc_open( error = IVAS_ERR_OK; - if ( ( hCovState = (ivas_enc_cov_handler_state_t *) count_malloc( sizeof( ivas_enc_cov_handler_state_t ) ) ) == NULL ) + if ( ( hCovState = (ivas_enc_cov_handler_state_t *) malloc( sizeof( ivas_enc_cov_handler_state_t ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR COV encoder" ); } @@ -125,7 +125,7 @@ void ivas_spar_covar_enc_close( ivas_spar_covar_smooth_enc_close( &hCovState->pCov_dtx_state, nchan_inp ); - count_free( hCovState ); + free( hCovState ); hCovState = NULL; } diff --git a/lib_enc/ivas_entropy_coder.c b/lib_enc/ivas_entropy_coder.c index a3714821f373f3aed82085d2ff2be94466494d23..9286983f3f11a1cab842a0b35675b9853662d820 100644 --- a/lib_enc/ivas_entropy_coder.c +++ b/lib_enc/ivas_entropy_coder.c @@ -41,7 +41,7 @@ #include "ivas_rom_com.h" #include "math.h" #include -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------------------------* * Local constants diff --git a/lib_enc/ivas_front_vad.c b/lib_enc/ivas_front_vad.c index 30515751501cea479090e5ef7b59a4bd8808d7f7..16ea571dd0dc1f43ab787f04dfc83aabff8e90c5 100644 --- a/lib_enc/ivas_front_vad.c +++ b/lib_enc/ivas_front_vad.c @@ -42,7 +42,7 @@ #include "prot.h" #include "ivas_prot.h" #include -#include "wmops.h" +#include "wmc_auto.h" #include @@ -83,7 +83,7 @@ ivas_error front_vad( error = IVAS_ERR_OK; - wmops_sub_start( "front_vad" ); + push_wmops( "front_vad" ); if ( hCPE != NULL ) { @@ -249,7 +249,7 @@ ivas_error front_vad( mvr2r( Bin_E, Bin_E_out, L_FRAME ); } - wmops_sub_end(); + pop_wmops(); return error; } @@ -267,18 +267,18 @@ ivas_error front_vad_create( { FRONT_VAD_ENC_HANDLE hFrontVad; - if ( ( hFrontVad = (FRONT_VAD_ENC_HANDLE) count_malloc( sizeof( FRONT_VAD_ENC ) ) ) == NULL ) + if ( ( hFrontVad = (FRONT_VAD_ENC_HANDLE) malloc( sizeof( FRONT_VAD_ENC ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for front-VAD structure \n" ) ); } - if ( ( hFrontVad->hNoiseEst = (NOISE_EST_HANDLE) count_malloc( sizeof( NOISE_EST_DATA ) ) ) == NULL ) + if ( ( hFrontVad->hNoiseEst = (NOISE_EST_HANDLE) malloc( sizeof( NOISE_EST_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Noise estimation\n" ) ); } noise_est_init( hFrontVad->hNoiseEst ); - if ( ( hFrontVad->hVAD = (VAD_HANDLE) count_malloc( sizeof( VAD_DATA ) ) ) == NULL ) + if ( ( hFrontVad->hVAD = (VAD_HANDLE) malloc( sizeof( VAD_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for VAD\n" ) ); } @@ -297,7 +297,7 @@ ivas_error front_vad_create( hFrontVad->delay_buf = NULL; if ( hFrontVad->delay_samples > 0 ) { - if ( ( hFrontVad->delay_buf = (float *) count_malloc( hFrontVad->delay_samples * sizeof( float ) ) ) == NULL ) + if ( ( hFrontVad->delay_buf = (float *) malloc( hFrontVad->delay_samples * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for VAD delay buffer\n" ) ); } @@ -323,19 +323,19 @@ void front_vad_destroy( { if ( *hFrontVad != NULL ) { - count_free( ( *hFrontVad )->hNoiseEst ); + free( ( *hFrontVad )->hNoiseEst ); ( *hFrontVad )->hNoiseEst = NULL; - count_free( ( *hFrontVad )->hVAD ); + free( ( *hFrontVad )->hVAD ); ( *hFrontVad )->hVAD = NULL; if ( ( *hFrontVad )->delay_buf != NULL ) { - count_free( ( *hFrontVad )->delay_buf ); + free( ( *hFrontVad )->delay_buf ); ( *hFrontVad )->delay_buf = NULL; } - count_free( *hFrontVad ); + free( *hFrontVad ); *hFrontVad = NULL; } @@ -390,7 +390,7 @@ ivas_error front_vad_spar( int16_t old_pitch; ivas_error error; - wmops_sub_start( "front_vad_SPAR" ); + push_wmops( "front_vad_SPAR" ); error = IVAS_ERR_OK; @@ -502,7 +502,7 @@ ivas_error front_vad_spar( hSpar->force_front_vad = 0; } - wmops_sub_end(); + pop_wmops(); return error; } diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index 7c9253a35ec972e97b269e5754b853808b0df87e..ca8fd727c0aa9403bc0d6c0393b95a8f06072462 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -40,7 +40,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* @@ -738,7 +738,7 @@ ivas_error ivas_init_encoder( if ( n > 0 ) { - if ( ( st_ivas->mem_hp20_in = (float **) count_malloc( n * sizeof( float * ) ) ) == NULL ) + if ( ( st_ivas->mem_hp20_in = (float **) malloc( n * sizeof( float * ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HP20 filter memory\n" ) ); } @@ -750,7 +750,7 @@ ivas_error ivas_init_encoder( for ( i = 0; i < n; i++ ) { - if ( ( st_ivas->mem_hp20_in[i] = (float *) count_malloc( L_HP20_MEM * sizeof( float ) ) ) == NULL ) + if ( ( st_ivas->mem_hp20_in[i] = (float *) malloc( L_HP20_MEM * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HP20 filter memory\n" ) ); } @@ -776,137 +776,137 @@ void destroy_core_enc( if ( hCoreCoder->hSignalBuf != NULL ) { - count_free( hCoreCoder->hSignalBuf ); + free( hCoreCoder->hSignalBuf ); hCoreCoder->hSignalBuf = NULL; } if ( hCoreCoder->hBstr != NULL ) { - count_free( hCoreCoder->hBstr ); + free( hCoreCoder->hBstr ); hCoreCoder->hBstr = NULL; } if ( hCoreCoder->hLPDmem != NULL ) { - count_free( hCoreCoder->hLPDmem ); + free( hCoreCoder->hLPDmem ); hCoreCoder->hLPDmem = NULL; } if ( hCoreCoder->hTranDet != NULL ) { - count_free( hCoreCoder->hTranDet ); + free( hCoreCoder->hTranDet ); hCoreCoder->hTranDet = NULL; } if ( hCoreCoder->hNoiseEst != NULL ) { - count_free( hCoreCoder->hNoiseEst ); + free( hCoreCoder->hNoiseEst ); hCoreCoder->hNoiseEst = NULL; } if ( hCoreCoder->hVAD != NULL ) { - count_free( hCoreCoder->hVAD ); + free( hCoreCoder->hVAD ); hCoreCoder->hVAD = NULL; } if ( hCoreCoder->hVAD_CLDFB != NULL ) { - count_free( hCoreCoder->hVAD_CLDFB ); + free( hCoreCoder->hVAD_CLDFB ); hCoreCoder->hVAD_CLDFB = NULL; } if ( hCoreCoder->hTdCngEnc != NULL ) { - count_free( hCoreCoder->hTdCngEnc ); + free( hCoreCoder->hTdCngEnc ); hCoreCoder->hTdCngEnc = NULL; } if ( hCoreCoder->hDtxEnc != NULL ) { - count_free( hCoreCoder->hDtxEnc ); + free( hCoreCoder->hDtxEnc ); hCoreCoder->hDtxEnc = NULL; } if ( hCoreCoder->hSpMusClas != NULL ) { - count_free( hCoreCoder->hSpMusClas ); + free( hCoreCoder->hSpMusClas ); hCoreCoder->hSpMusClas = NULL; } if ( hCoreCoder->hGSCEnc != NULL ) { - count_free( hCoreCoder->hGSCEnc ); + free( hCoreCoder->hGSCEnc ); hCoreCoder->hGSCEnc = NULL; } if ( hCoreCoder->hSC_VBR != NULL ) { - count_free( hCoreCoder->hSC_VBR ); + free( hCoreCoder->hSC_VBR ); hCoreCoder->hSC_VBR = NULL; } if ( hCoreCoder->hAmrwb_IO != NULL ) { - count_free( hCoreCoder->hAmrwb_IO ); + free( hCoreCoder->hAmrwb_IO ); hCoreCoder->hAmrwb_IO = NULL; } if ( hCoreCoder->hBWE_TD != NULL ) { - count_free( hCoreCoder->hBWE_TD ); + free( hCoreCoder->hBWE_TD ); hCoreCoder->hBWE_TD = NULL; } if ( hCoreCoder->hBWE_FD != NULL ) { - count_free( hCoreCoder->hBWE_FD ); + free( hCoreCoder->hBWE_FD ); hCoreCoder->hBWE_FD = NULL; } if ( hCoreCoder->hRF != NULL ) { - count_free( hCoreCoder->hRF ); + free( hCoreCoder->hRF ); hCoreCoder->hRF = NULL; } if ( hCoreCoder->hTECEnc != NULL ) { - count_free( hCoreCoder->hTECEnc ); + free( hCoreCoder->hTECEnc ); hCoreCoder->hTECEnc = NULL; } if ( hCoreCoder->hTcxEnc != NULL ) { - count_free( hCoreCoder->hTcxEnc ); + free( hCoreCoder->hTcxEnc ); hCoreCoder->hTcxEnc = NULL; } if ( hCoreCoder->hTcxCfg != NULL ) { - count_free( hCoreCoder->hTcxCfg ); + free( hCoreCoder->hTcxCfg ); hCoreCoder->hTcxCfg = NULL; } if ( hCoreCoder->hIGFEnc != NULL ) { - count_free( hCoreCoder->hIGFEnc ); + free( hCoreCoder->hIGFEnc ); hCoreCoder->hIGFEnc = NULL; } if ( hCoreCoder->hPlcExt != NULL ) { - count_free( hCoreCoder->hPlcExt ); + free( hCoreCoder->hPlcExt ); hCoreCoder->hPlcExt = NULL; } if ( hCoreCoder->hHQ_core != NULL ) { - count_free( hCoreCoder->hHQ_core ); + free( hCoreCoder->hHQ_core ); hCoreCoder->hHQ_core = NULL; } - count_free( hCoreCoder ); + free( hCoreCoder ); return; } @@ -955,10 +955,10 @@ void ivas_destroy_enc( for ( i = 0; i < n; i++ ) { - count_free( st_ivas->mem_hp20_in[i] ); + free( st_ivas->mem_hp20_in[i] ); st_ivas->mem_hp20_in[i] = NULL; } - count_free( st_ivas->mem_hp20_in ); + free( st_ivas->mem_hp20_in ); st_ivas->mem_hp20_in = NULL; } @@ -967,7 +967,7 @@ void ivas_destroy_enc( { if ( st_ivas->hIsmMetaData[n] != NULL ) { - count_free( st_ivas->hIsmMetaData[n] ); + free( st_ivas->hIsmMetaData[n] ); st_ivas->hIsmMetaData[n] = NULL; } } @@ -1041,12 +1041,12 @@ void ivas_destroy_enc( /* Encoder configuration handle */ if ( st_ivas->hEncoderConfig != NULL ) { - count_free( st_ivas->hEncoderConfig ); + free( st_ivas->hEncoderConfig ); st_ivas->hEncoderConfig = NULL; } /* main IVAS handle */ - count_free( st_ivas ); + free( st_ivas ); return; } diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index 4cbfa6acc8eddfcb0af3ef2d45b5d3a7d156ede0..f59edfaf0e049c199888fd13baa2c729cdbf891c 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -39,7 +39,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* @@ -93,7 +93,7 @@ ivas_error ivas_ism_enc( error = IVAS_ERR_OK; - wmops_sub_start( "ivas_ism_enc" ); + push_wmops( "ivas_ism_enc" ); /*------------------------------------------------------------------* * Preprocesing @@ -296,7 +296,7 @@ ivas_error ivas_ism_enc( mvr2r( st->input, st->old_input_signal, input_frame ); } - wmops_sub_end(); + pop_wmops(); return error; } diff --git a/lib_enc/ivas_ism_metadata_enc.c b/lib_enc/ivas_ism_metadata_enc.c index 57c6a37a7b1e9fae3165ff92f25ac359953a9145..efec91891494823ca7babae0164762a134a5e832 100644 --- a/lib_enc/ivas_ism_metadata_enc.c +++ b/lib_enc/ivas_ism_metadata_enc.c @@ -42,7 +42,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------------* @@ -169,7 +169,7 @@ ivas_error ivas_ism_metadata_enc( error = IVAS_ERR_OK; - wmops_sub_start( "ism_meta_enc" ); + push_wmops( "ism_meta_enc" ); if ( ism_mode == ISM_MODE_PARAM ) { @@ -187,7 +187,7 @@ ivas_error ivas_ism_metadata_enc( if ( num_obj == 1 && ( hSCE[0]->hCoreCoder[0]->core_brate == SID_2k40 || hSCE[0]->hCoreCoder[0]->core_brate == FRAME_NO_DATA ) && ( ism_mode == ISM_MODE_DISC ) ) { /* no metadata encoding in CNG */ - wmops_sub_end(); + pop_wmops(); return error; } @@ -717,7 +717,7 @@ ivas_error ivas_ism_metadata_enc( } } - wmops_sub_end(); + pop_wmops(); return error; } @@ -752,7 +752,7 @@ ivas_error create_ism_metadata_enc( /* allocate ISm metadata handles */ for ( ch = 0; ch < n_ISms; ch++ ) { - if ( ( st_ivas->hIsmMetaData[ch] = (ISM_METADATA_HANDLE) count_malloc( sizeof( ISM_METADATA_FRAME ) ) ) == NULL ) + if ( ( st_ivas->hIsmMetaData[ch] = (ISM_METADATA_HANDLE) malloc( sizeof( ISM_METADATA_FRAME ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ISm MetaData\n" ) ); } diff --git a/lib_enc/ivas_ism_param_enc.c b/lib_enc/ivas_ism_param_enc.c index 6574daf201a9fefdbae6e6bd20e9d6c8ed647ebe..b74358af2ff7b7a6421046d0466f48f087f58af6 100644 --- a/lib_enc/ivas_ism_param_enc.c +++ b/lib_enc/ivas_ism_param_enc.c @@ -39,7 +39,7 @@ #include "cnst.h" #include "ivas_cnst.h" #include "ivas_rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------- * Local function definitions @@ -197,7 +197,7 @@ void ivas_param_ism_stereo_dmx( float stereo_dmx[2][L_FRAME48k]; ISM_METADATA_HANDLE hIsmMetaData; - wmops_sub_start( "ivas_param_ism_st_dmx" ); + push_wmops( "ivas_param_ism_st_dmx" ); /*Initialization*/ alpha = 0.5; @@ -232,7 +232,7 @@ void ivas_param_ism_stereo_dmx( mvr2r( stereo_dmx[0], data[0], input_frame ); mvr2r( stereo_dmx[1], data[1], input_frame ); - wmops_sub_end(); + pop_wmops(); return; } @@ -258,13 +258,13 @@ ivas_error ivas_param_ism_enc_open( error = IVAS_ERR_OK; /* Assign memory to DirAC handle */ - if ( ( hDirAC = (DIRAC_ENC_HANDLE) count_malloc( sizeof( DIRAC_ENC_DATA ) ) ) == NULL ) + if ( ( hDirAC = (DIRAC_ENC_HANDLE) malloc( sizeof( DIRAC_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DirAC\n" ) ); } /* Assign memory to Param Object handle */ - if ( ( hDirAC->hParamIsm = (PARAM_ISM_CONFIG_HANDLE) count_malloc( sizeof( PARAM_ISM_CONFIG_DATA ) ) ) == NULL ) + if ( ( hDirAC->hParamIsm = (PARAM_ISM_CONFIG_HANDLE) malloc( sizeof( PARAM_ISM_CONFIG_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Param ISM\n" ) ); } @@ -326,11 +326,11 @@ void ivas_param_ism_enc_close( if ( hDirAC->hParamIsm != NULL ) { - count_free( hDirAC->hParamIsm ); + free( hDirAC->hParamIsm ); hDirAC->hParamIsm = NULL; } - count_free( hDirAC ); + free( hDirAC ); return; } @@ -362,7 +362,7 @@ void ivas_param_ism_enc( hDirAC = st_ivas->hDirAC; hParamIsm = hDirAC->hParamIsm; - wmops_sub_start( "ivas_param_ism_enc" ); + push_wmops( "ivas_param_ism_enc" ); l_ts = input_frame / PARAM_ISM_MDFT_NO_SLOTS; num_time_slots = PARAM_ISM_MDFT_NO_SLOTS; @@ -396,7 +396,7 @@ void ivas_param_ism_enc( /* Compute object indices and power ratios */ ivas_param_ism_compute_obj_parameters( reference_power_obj, hParamIsm ); - wmops_sub_end(); + pop_wmops(); return; } diff --git a/lib_enc/ivas_lfe_enc.c b/lib_enc/ivas_lfe_enc.c index a333995d69ca850eb69b6558fca19375608daf13..c34b77e9de84c4ddf338badd0f4cd0338da17440 100644 --- a/lib_enc/ivas_lfe_enc.c +++ b/lib_enc/ivas_lfe_enc.c @@ -40,7 +40,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------------------------------* @@ -391,7 +391,7 @@ ivas_error ivas_create_lfe_enc( * Allocate LFE handle *-----------------------------------------------------------------*/ - if ( ( hLFE = (LFE_ENC_HANDLE) count_malloc( sizeof( LFE_ENC_DATA ) ) ) == NULL ) + if ( ( hLFE = (LFE_ENC_HANDLE) malloc( sizeof( LFE_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LFE\n" ) ); } @@ -406,7 +406,7 @@ ivas_error ivas_create_lfe_enc( * Input memory buffer: allocate and initialize *-----------------------------------------------------------------*/ - if ( ( hLFE->old_wtda_audio = (float *) count_malloc( sizeof( float ) * NS2SA( input_Fs, IVAS_LFE_FADE_NS ) ) ) == NULL ) + if ( ( hLFE->old_wtda_audio = (float *) malloc( sizeof( float ) * NS2SA( input_Fs, IVAS_LFE_FADE_NS ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LFE memory\n" ) ); } @@ -417,7 +417,7 @@ ivas_error ivas_create_lfe_enc( * LFE Window: allocate and initialize *-----------------------------------------------------------------*/ - if ( ( hLFE->pWindow_state = (LFE_WINDOW_HANDLE) count_malloc( sizeof( LFE_WINDOW_DATA ) ) ) == NULL ) + if ( ( hLFE->pWindow_state = (LFE_WINDOW_HANDLE) malloc( sizeof( LFE_WINDOW_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LFE window structure\n" ) ); } @@ -465,16 +465,16 @@ void ivas_lfe_enc_close( { if ( hLFE->old_wtda_audio != NULL ) { - count_free( hLFE->old_wtda_audio ); + free( hLFE->old_wtda_audio ); hLFE->old_wtda_audio = NULL; } if ( hLFE->pWindow_state ) { - count_free( hLFE->pWindow_state ); + free( hLFE->pWindow_state ); hLFE->pWindow_state = NULL; } - count_free( hLFE ); + free( hLFE ); return; } diff --git a/lib_enc/ivas_masa_enc.c b/lib_enc/ivas_masa_enc.c index c2649adc56c10964b037c39eeb7c1e3f6b70f433..e1eb467aeff140eeb1c5c27326942fa521b47deb 100644 --- a/lib_enc/ivas_masa_enc.c +++ b/lib_enc/ivas_masa_enc.c @@ -37,7 +37,7 @@ #include "ivas_prot.h" #include "ivas_rom_com.h" #include "ivas_stat_enc.h" -#include "wmops.h" +#include "wmc_auto.h" #include "prot.h" /*-----------------------------------------------------------------------* @@ -88,7 +88,7 @@ ivas_error ivas_masa_enc_open( error = IVAS_ERR_OK; - if ( ( hMasa = (MASA_ENCODER_HANDLE) count_malloc( sizeof( MASA_ENCODER ) ) ) == NULL ) + if ( ( hMasa = (MASA_ENCODER_HANDLE) malloc( sizeof( MASA_ENCODER ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MASA encoder\n" ) ); } @@ -123,7 +123,7 @@ ivas_error ivas_masa_enc_open( { for ( i = 0; i < st_ivas->nchan_transport; i++ ) { - hMasa->data.delay_buffer[i] = (float *) count_malloc( MASA_ENC_DELAY_SLOTS * CLDFB_NO_CHANNELS_MAX * sizeof( float ) ); + hMasa->data.delay_buffer[i] = (float *) malloc( MASA_ENC_DELAY_SLOTS * CLDFB_NO_CHANNELS_MAX * sizeof( float ) ); set_f( hMasa->data.delay_buffer[i], 0.0f, MASA_ENC_DELAY_SLOTS * CLDFB_NO_CHANNELS_MAX ); } } @@ -163,12 +163,12 @@ void ivas_masa_enc_close( { for ( i = 0; i < nchan_transport; i++ ) { - count_free( hMasa->data.delay_buffer[i] ); + free( hMasa->data.delay_buffer[i] ); hMasa->data.delay_buffer[i] = NULL; } } - count_free( hMasa ); + free( hMasa ); return; } @@ -219,7 +219,7 @@ void ivas_masa_encode( if ( Opt_DTX_ON ) { - h_orig_metadata = (MASA_DIRECTIONAL_SPATIAL_META *) count_malloc( MASA_MAXIMUM_DIRECTIONS * sizeof( MASA_DIRECTIONAL_SPATIAL_META ) ); + h_orig_metadata = (MASA_DIRECTIONAL_SPATIAL_META *) malloc( MASA_MAXIMUM_DIRECTIONS * sizeof( MASA_DIRECTIONAL_SPATIAL_META ) ); for ( i = 0; i < MASA_MAXIMUM_DIRECTIONS; i++ ) { for ( j = 0; j < MAX_PARAM_SPATIAL_SUBFRAMES; j++ ) @@ -348,7 +348,7 @@ void ivas_masa_encode( } } - count_free( h_orig_metadata ); + free( h_orig_metadata ); ivas_qmetadata_enc_sid_encode( hMetaData, hQMetaData, masa_sid_descriptor, ivas_format, SBA_MODE_NONE ); diff --git a/lib_enc/ivas_mc_param_enc.c b/lib_enc/ivas_mc_param_enc.c index 1f0d1334d595917c4443618f94973421e000e2ab..2a3ee7f749795398b6fd939389e630561759e5b4 100644 --- a/lib_enc/ivas_mc_param_enc.c +++ b/lib_enc/ivas_mc_param_enc.c @@ -46,7 +46,7 @@ #ifdef DEBUG_PLOT #include "deb_out.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------- @@ -98,7 +98,7 @@ ivas_error ivas_param_mc_enc_open( error = IVAS_ERR_OK; /* Sanity Checks */ - if ( ( hParamMC = (PARAM_MC_ENC_HANDLE) count_malloc( sizeof( PARAM_MC_ENC_DATA ) ) ) == NULL ) + if ( ( hParamMC = (PARAM_MC_ENC_HANDLE) malloc( sizeof( PARAM_MC_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Paramtric MC\n" ) ); } @@ -285,7 +285,7 @@ ivas_error ivas_param_mc_enc_reconfig( #endif if ( hParamMC->hMetadataPMC.icc_map_full[i] != NULL ) { - count_free( hParamMC->hMetadataPMC.icc_map_full[i] ); + free( hParamMC->hMetadataPMC.icc_map_full[i] ); hParamMC->hMetadataPMC.icc_map_full[i] = NULL; } } @@ -371,7 +371,7 @@ void ivas_param_mc_enc_close( ivas_FB_mixer_close( &hParamMC->hFbMixer, sampling_rate ); - count_free( hParamMC ); + free( hParamMC ); return; } @@ -405,7 +405,7 @@ void ivas_param_mc_enc( PARAM_MC_ENC_HANDLE hParamMC; int16_t nchan_inp; - wmops_sub_start( "param_mc_enc" ); + push_wmops( "param_mc_enc" ); /* initializations */ hParamMC = st_ivas->hParamMC; @@ -547,7 +547,7 @@ void ivas_param_mc_enc( /* updates */ hParamMC->hMetadataPMC.last_coded_bwidth = hParamMC->hMetadataPMC.coded_bwidth; - wmops_sub_end(); + pop_wmops(); return; } @@ -638,7 +638,7 @@ static void ivas_param_mc_param_est_enc( int16_t start_ts; const float *p_dmx_fac; - wmops_sub_start( "param_mc_prm_est" ); + push_wmops( "param_mc_prm_est" ); /* initializations */ @@ -915,7 +915,7 @@ static void ivas_param_mc_param_est_enc( } - wmops_sub_end(); + pop_wmops(); return; } @@ -1172,7 +1172,7 @@ static void ivas_param_mc_quantize_ilds( float tot_ener, dmx_ener, ener_fac, delta_fac; int16_t ILD_idx[PARAM_MC_SZ_ILD_MAP]; - wmops_sub_start( "param_mc_prm_q" ); + push_wmops( "param_mc_prm_q" ); /* Initialization */ set_zero( Nrg, MAX_CICP_CHANNELS ); @@ -1194,7 +1194,7 @@ static void ivas_param_mc_quantize_ilds( /* Downsampling */ if ( ( hParamMC->hMetadataPMC.bAttackPresent == 0 ) && ( hParamMC->hMetadataPMC.param_frame_idx != hParamMC->hMetadataPMC.coding_band_mapping[freq_idx] ) ) { - wmops_sub_end(); + pop_wmops(); return; } @@ -1281,7 +1281,7 @@ static void ivas_param_mc_quantize_ilds( /* Save current quantized ICLDs */ mvs2s( ILD_idx, ILD_idx_out + freq_idx * ild_map_size, num_ilds_to_code ); - wmops_sub_end(); + pop_wmops(); return; } @@ -1446,7 +1446,7 @@ static void ivas_param_mc_transient_detection( float *pAccSubblockNrg; float attackRatioThreshold; - wmops_sub_start( "param_mc_trn_det" ); + push_wmops( "param_mc_trn_det" ); attackRatioThreshold = hTranDet->transientDetector.attackRatioThreshold; pSubblockNrg = &hTranDet->subblockEnergies.subblockNrg[hParamMC->transient_detector_delay]; @@ -1477,7 +1477,7 @@ static void ivas_param_mc_transient_detection( *pAttackIndex = attackIndex; *pbIsAttackPresent = bIsAttackPresent; - wmops_sub_end(); + pop_wmops(); return; } @@ -1507,7 +1507,7 @@ static void ivas_param_mc_write_bs( int16_t ild_map_size_wo_lfe; int16_t ild_map_size; - wmops_sub_start( "param_mc_prm_enc" ); + push_wmops( "param_mc_prm_enc" ); /* Init */ set_zero( seq_tmp_uni, PARAM_MC_MAX_PARAMETER_BANDS * PARAM_MC_SZ_ILD_MAP ); @@ -1572,7 +1572,7 @@ static void ivas_param_mc_write_bs( ivas_param_mc_encode_parameter( ILD_idx, &hParamMC->hMetadataPMC, &hParamMC->hMetadataPMC.ild_coding, nbands, band_step, ild_map_size_wo_lfe, ild_map_size, bit_buffer, bit_pos ); - wmops_sub_end(); + pop_wmops(); return; } diff --git a/lib_enc/ivas_mcmasa_enc.c b/lib_enc/ivas_mcmasa_enc.c index 4622864e088c9a30c7c8be65b9f288315853bb62..5b66d03abb6e4d9cd2a753265a5cec32d38f41e1 100644 --- a/lib_enc/ivas_mcmasa_enc.c +++ b/lib_enc/ivas_mcmasa_enc.c @@ -44,7 +44,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------- @@ -111,7 +111,7 @@ ivas_error ivas_mcmasa_enc_open( assert( st_ivas->hMasa != NULL && "MASA encoder handle is not present" ); hMasa = st_ivas->hMasa; - if ( NULL == ( hMcMasa = (MCMASA_ENC_HANDLE) count_malloc( sizeof( MCMASA_ENC_DATA ) ) ) ) + if ( NULL == ( hMcMasa = (MCMASA_ENC_HANDLE) malloc( sizeof( MCMASA_ENC_DATA ) ) ) ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for McMasa\n" ) ); } @@ -204,9 +204,9 @@ ivas_error ivas_mcmasa_enc_open( if ( hMcMasa->separateChannelEnabled ) { /* TD Energy calculation with LP */ - hMcMasa->delay_buffer_lfe[0] = (float *) count_malloc( NS2SA( input_Fs, DELAY_DIRAC_ENC_CMP_NS + DIRAC_SLOT_ENC_NS ) * sizeof( float ) ); + hMcMasa->delay_buffer_lfe[0] = (float *) malloc( NS2SA( input_Fs, DELAY_DIRAC_ENC_CMP_NS + DIRAC_SLOT_ENC_NS ) * sizeof( float ) ); set_zero( hMcMasa->delay_buffer_lfe[0], NS2SA( input_Fs, DELAY_DIRAC_ENC_CMP_NS + DIRAC_SLOT_ENC_NS ) ); - hMcMasa->delay_buffer_lfe[1] = (float *) count_malloc( NS2SA( input_Fs, DELAY_DIRAC_ENC_CMP_NS + DIRAC_SLOT_ENC_NS ) * sizeof( float ) ); + hMcMasa->delay_buffer_lfe[1] = (float *) malloc( NS2SA( input_Fs, DELAY_DIRAC_ENC_CMP_NS + DIRAC_SLOT_ENC_NS ) * sizeof( float ) ); set_zero( hMcMasa->delay_buffer_lfe[1], NS2SA( input_Fs, DELAY_DIRAC_ENC_CMP_NS + DIRAC_SLOT_ENC_NS ) ); hMcMasa->hFbMixerLfe = NULL; } @@ -236,7 +236,7 @@ ivas_error ivas_mcmasa_enc_open( bufferSize = (int16_t) ( ( input_Fs / FRAMES_PER_SEC ) / MAX_PARAM_SPATIAL_SUBFRAMES ); for ( i = 0; i < 2; i++ ) { - hMcMasa->lfeAnaRingBuffer[i] = (float *) count_malloc( bufferSize * sizeof( float ) ); + hMcMasa->lfeAnaRingBuffer[i] = (float *) malloc( bufferSize * sizeof( float ) ); set_zero( hMcMasa->lfeAnaRingBuffer[i], bufferSize ); hMcMasa->lowpassSum[i] = 0.0f; } @@ -250,33 +250,33 @@ ivas_error ivas_mcmasa_enc_open( /* intensity 3-dim */ for ( i = 0; i < DIRAC_NUM_DIMS; i++ ) { - hMcMasa->direction_vector_m[i] = (float **) count_malloc( MAX_PARAM_SPATIAL_SUBFRAMES * sizeof( float * ) ); + hMcMasa->direction_vector_m[i] = (float **) malloc( MAX_PARAM_SPATIAL_SUBFRAMES * sizeof( float * ) ); for ( j = 0; j < MAX_PARAM_SPATIAL_SUBFRAMES; j++ ) { - hMcMasa->direction_vector_m[i][j] = (float *) count_malloc( hMcMasa->nbands * sizeof( float ) ); + hMcMasa->direction_vector_m[i][j] = (float *) malloc( hMcMasa->nbands * sizeof( float ) ); } } hMcMasa->no_col_avg_diff = (int8_t) ( DIRAC_NO_COL_AVG_DIFF_NS / dirac_slot_ns ); for ( i = 0; i < DIRAC_NUM_DIMS; i++ ) { - hMcMasa->buffer_intensity_real[i] = (float **) count_malloc( hMcMasa->no_col_avg_diff * sizeof( float * ) ); + hMcMasa->buffer_intensity_real[i] = (float **) malloc( hMcMasa->no_col_avg_diff * sizeof( float * ) ); for ( j = 0; j < hMcMasa->no_col_avg_diff; j++ ) { - hMcMasa->buffer_intensity_real[i][j] = (float *) count_malloc( hMcMasa->nbands * sizeof( float ) ); + hMcMasa->buffer_intensity_real[i][j] = (float *) malloc( hMcMasa->nbands * sizeof( float ) ); set_zero( hMcMasa->buffer_intensity_real[i][j], hMcMasa->nbands ); } } - hMcMasa->buffer_intensity_real_vert = (float **) count_malloc( hMcMasa->no_col_avg_diff * sizeof( float * ) ); + hMcMasa->buffer_intensity_real_vert = (float **) malloc( hMcMasa->no_col_avg_diff * sizeof( float * ) ); for ( j = 0; j < hMcMasa->no_col_avg_diff; j++ ) { - hMcMasa->buffer_intensity_real_vert[j] = (float *) count_malloc( hMcMasa->nbands * sizeof( float ) ); + hMcMasa->buffer_intensity_real_vert[j] = (float *) malloc( hMcMasa->nbands * sizeof( float ) ); set_zero( hMcMasa->buffer_intensity_real_vert[j], hMcMasa->nbands ); } - hMcMasa->buffer_energy = (float *) count_malloc( hMcMasa->nbands * hMcMasa->no_col_avg_diff * sizeof( float ) ); + hMcMasa->buffer_energy = (float *) malloc( hMcMasa->nbands * hMcMasa->no_col_avg_diff * sizeof( float ) ); set_zero( hMcMasa->buffer_energy, hMcMasa->nbands * hMcMasa->no_col_avg_diff ); if ( st_ivas->hEncoderConfig->mc_input_setup == MC_LS_SETUP_5_1 ) @@ -457,14 +457,14 @@ void ivas_mcmasa_enc_close( if ( hMcMasa->separateChannelEnabled ) { - count_free( hMcMasa->delay_buffer_lfe[0] ); - count_free( hMcMasa->delay_buffer_lfe[1] ); + free( hMcMasa->delay_buffer_lfe[0] ); + free( hMcMasa->delay_buffer_lfe[1] ); } if ( hMcMasa->separateChannelEnabled ) { for ( i = 0; i < 2; i++ ) { - count_free( hMcMasa->lfeAnaRingBuffer[i] ); + free( hMcMasa->lfeAnaRingBuffer[i] ); } } @@ -480,35 +480,35 @@ void ivas_mcmasa_enc_close( { for ( j = 0; j < MAX_PARAM_SPATIAL_SUBFRAMES; j++ ) { - count_free( hMcMasa->direction_vector_m[i][j] ); + free( hMcMasa->direction_vector_m[i][j] ); hMcMasa->direction_vector_m[i][j] = NULL; } for ( j = 0; j < hMcMasa->no_col_avg_diff; j++ ) { - count_free( hMcMasa->buffer_intensity_real[i][j] ); + free( hMcMasa->buffer_intensity_real[i][j] ); hMcMasa->buffer_intensity_real[i][j] = NULL; } - count_free( hMcMasa->buffer_intensity_real[i] ); + free( hMcMasa->buffer_intensity_real[i] ); hMcMasa->buffer_intensity_real[i] = NULL; - count_free( hMcMasa->direction_vector_m[i] ); + free( hMcMasa->direction_vector_m[i] ); hMcMasa->direction_vector_m[i] = NULL; } for ( j = 0; j < hMcMasa->no_col_avg_diff; j++ ) { - count_free( hMcMasa->buffer_intensity_real_vert[j] ); + free( hMcMasa->buffer_intensity_real_vert[j] ); hMcMasa->buffer_intensity_real_vert[j] = NULL; } - count_free( hMcMasa->buffer_intensity_real_vert ); + free( hMcMasa->buffer_intensity_real_vert ); hMcMasa->buffer_intensity_real_vert = NULL; - count_free( hMcMasa->buffer_energy ); + free( hMcMasa->buffer_energy ); hMcMasa->buffer_energy = NULL; - count_free( hMcMasa ); + free( hMcMasa ); return; } diff --git a/lib_enc/ivas_mct_core_enc.c b/lib_enc/ivas_mct_core_enc.c index 614059aa27b188c2e6c5ff1d96f998f57b2bb8db..c1734f960f4dbda401025727f58343ace41dd592 100644 --- a/lib_enc/ivas_mct_core_enc.c +++ b/lib_enc/ivas_mct_core_enc.c @@ -40,7 +40,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*----------------------------------------------------------* @@ -228,7 +228,7 @@ void ivas_mct_core_enc( static FILE *f_bit_split = 0; #endif - wmops_sub_start( "mct_encoding" ); + push_wmops( "mct_encoding" ); /*--------------------------------------------------------------* * Initialization @@ -556,7 +556,7 @@ void ivas_mct_core_enc( assert( ( total_brate + ( NBITS_BWIDTH + format_bits + mct_bits + sba_meta + lfe_bits ) * FRAMES_PER_SEC ) == ivas_total_brate ); #endif - wmops_sub_end(); + pop_wmops(); return; } diff --git a/lib_enc/ivas_mct_enc.c b/lib_enc/ivas_mct_enc.c index 1c091146af392db399fbde6ecf934a851ed19881..dd1d1fe02a093e7b35f8fee7042dda0ca9fa5e75 100755 --- a/lib_enc/ivas_mct_enc.c +++ b/lib_enc/ivas_mct_enc.c @@ -41,7 +41,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" #ifdef MC_BITRATE_SWITCHING @@ -119,7 +119,7 @@ ivas_error ivas_mct_enc( error = IVAS_ERR_OK; - wmops_sub_start( "ivas_mct_enc" ); + push_wmops( "ivas_mct_enc" ); /* Initialization */ hMCT = st_ivas->hMCT; @@ -203,7 +203,7 @@ ivas_error ivas_mct_enc( } } - wmops_sub_end(); + pop_wmops(); return error; } @@ -233,7 +233,7 @@ ivas_error create_mct_enc( * Allocate MCT handle *-----------------------------------------------------------------*/ - if ( ( hMCT = (MCT_ENC_HANDLE) count_malloc( sizeof( MCT_ENC_DATA ) ) ) == NULL ) + if ( ( hMCT = (MCT_ENC_HANDLE) malloc( sizeof( MCT_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MCT\n" ) ); } @@ -298,7 +298,7 @@ ivas_error create_mct_enc( assert( st_ivas->hEncoderConfig->element_mode_init == IVAS_CPE_MDCT && "MCT is not supported for other stereo modes" ); - if ( ( hMCT->hBlockData[n] = (MCT_BLOCK_DATA_HANDLE) count_malloc( sizeof( MCT_BLOCK_DATA ) ) ) == NULL ) + if ( ( hMCT->hBlockData[n] = (MCT_BLOCK_DATA_HANDLE) malloc( sizeof( MCT_BLOCK_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MCT block data structure\n" ) ); } @@ -312,7 +312,7 @@ ivas_error create_mct_enc( * MDCT stereo initialization *-----------------------------------------------------------------*/ - if ( ( hMCT->hBlockData[n]->hStereoMdct = (STEREO_MDCT_ENC_DATA_HANDLE) count_malloc( sizeof( STEREO_MDCT_ENC_DATA ) ) ) == NULL ) + if ( ( hMCT->hBlockData[n]->hStereoMdct = (STEREO_MDCT_ENC_DATA_HANDLE) malloc( sizeof( STEREO_MDCT_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MDCT Stereo \n" ) ); } @@ -453,7 +453,7 @@ ivas_error mct_enc_reconfigure( if ( hMCT->hBlockData[n] == NULL ) { mem_init = 1; - if ( ( hMCT->hBlockData[n] = (MCT_BLOCK_DATA_HANDLE) count_malloc( sizeof( MCT_BLOCK_DATA ) ) ) == NULL ) + if ( ( hMCT->hBlockData[n] = (MCT_BLOCK_DATA_HANDLE) malloc( sizeof( MCT_BLOCK_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MCT block data structure\n" ) ); } @@ -467,7 +467,7 @@ ivas_error mct_enc_reconfigure( * MDCT stereo initialization *-----------------------------------------------------------------*/ - if ( ( hMCT->hBlockData[n]->hStereoMdct = (STEREO_MDCT_ENC_DATA_HANDLE) count_malloc( sizeof( STEREO_MDCT_ENC_DATA ) ) ) == NULL ) + if ( ( hMCT->hBlockData[n]->hStereoMdct = (STEREO_MDCT_ENC_DATA_HANDLE) malloc( sizeof( STEREO_MDCT_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MDCT Stereo \n" ) ); } @@ -487,11 +487,11 @@ ivas_error mct_enc_reconfigure( { if ( hMCT->hBlockData[n]->hStereoMdct != NULL ) { - count_free( hMCT->hBlockData[n]->hStereoMdct ); + free( hMCT->hBlockData[n]->hStereoMdct ); hMCT->hBlockData[n]->hStereoMdct = NULL; } - count_free( hMCT->hBlockData[n] ); + free( hMCT->hBlockData[n] ); hMCT->hBlockData[n] = NULL; } } @@ -526,16 +526,16 @@ void ivas_mct_enc_close( { if ( hMCT->hBlockData[n]->hStereoMdct != NULL ) { - count_free( hMCT->hBlockData[n]->hStereoMdct ); + free( hMCT->hBlockData[n]->hStereoMdct ); hMCT->hBlockData[n]->hStereoMdct = NULL; } - count_free( hMCT->hBlockData[n] ); + free( hMCT->hBlockData[n] ); hMCT->hBlockData[n] = NULL; } } - count_free( hMCT ); + free( hMCT ); return; } @@ -784,7 +784,7 @@ static ivas_error ivas_mc_enc_reconfig( if ( st->hTranDet == NULL ) { - if ( ( st->hTranDet = (TRAN_DET_HANDLE) count_malloc( sizeof( TRAN_DET_DATA ) ) ) == NULL ) + if ( ( st->hTranDet = (TRAN_DET_HANDLE) malloc( sizeof( TRAN_DET_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Transient Detection\n" ) ); } @@ -794,7 +794,7 @@ static ivas_error ivas_mc_enc_reconfig( if ( st->hIGFEnc == NULL ) { - if ( ( st->hIGFEnc = (IGF_ENC_INSTANCE_HANDLE) count_malloc( sizeof( IGF_ENC_INSTANCE ) ) ) == NULL ) + if ( ( st->hIGFEnc = (IGF_ENC_INSTANCE_HANDLE) malloc( sizeof( IGF_ENC_INSTANCE ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for hIGFEnc\n" ) ); } diff --git a/lib_enc/ivas_mct_enc_mct.c b/lib_enc/ivas_mct_enc_mct.c index 0e36280b20ff70aa8cb1d011522c82fa55c5604c..9f90f86fd36937e157d13e1cba7be01f8bae3c68 100755 --- a/lib_enc/ivas_mct_enc_mct.c +++ b/lib_enc/ivas_mct_enc_mct.c @@ -36,7 +36,7 @@ #include "ivas_cnst.h" #include "ivas_prot.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" #include #define SPAR_CORR_THRES 0.9f @@ -474,7 +474,7 @@ void apply_MCT_enc( float tmp_max_corr; int16_t count_active_ch = 0; - wmops_sub_start( "mct_core_enc_mct" ); + push_wmops( "mct_core_enc_mct" ); forceKeepTree = 1; inactiveBlockDetected = 0; @@ -739,7 +739,7 @@ void apply_MCT_enc( } #endif - wmops_sub_end(); + pop_wmops(); return; } diff --git a/lib_enc/ivas_mdct_core_enc.c b/lib_enc/ivas_mdct_core_enc.c index 12ccb0c4fe6f492c427f4674b83e0c6a26d7ce4c..6dba0fb321ecdd65a452260cd7d506aa86860261 100755 --- a/lib_enc/ivas_mdct_core_enc.c +++ b/lib_enc/ivas_mdct_core_enc.c @@ -41,7 +41,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------* * Local constants @@ -602,7 +602,7 @@ void ivas_mdct_core_whitening_enc( int16_t nbits_start_sns; int16_t num_sns; - wmops_sub_start( "mdct_core_whitening" ); + push_wmops( "mdct_core_whitening" ); /*--------------------------------------------------------------* * Initialization @@ -1147,7 +1147,7 @@ void ivas_mdct_core_whitening_enc( } } - wmops_sub_end(); + pop_wmops(); return; } @@ -1186,7 +1186,7 @@ void ivas_mdct_quant_coder( int16_t target_bitsTCX10[CPE_CHANNELS][NB_DIV]; int16_t nbits_start, total_nbbits; - wmops_sub_start( "mdct_core_Q" ); + push_wmops( "mdct_core_Q" ); sts = hCPE->hCoreCoder; @@ -1306,7 +1306,7 @@ void ivas_mdct_quant_coder( assert( st->bits_frame_channel == total_nbbits ); } - wmops_sub_end(); + pop_wmops(); return; } diff --git a/lib_enc/ivas_pca_enc.c b/lib_enc/ivas_pca_enc.c index c6b804088e6e4b6e62903122c31f9bb7ea8ba36a..9fb4180236e2c9e152edacb6a60aee01adf3bed8 100644 --- a/lib_enc/ivas_pca_enc.c +++ b/lib_enc/ivas_pca_enc.c @@ -41,7 +41,7 @@ #include #include #include "typedef.h" -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------------* diff --git a/lib_enc/ivas_qmetadata_enc.c b/lib_enc/ivas_qmetadata_enc.c index 7f79df39877b68e0e3e9e400ae565b584f901513..2ed41a8f74fade71811719a5d326a8aa573fe30d 100644 --- a/lib_enc/ivas_qmetadata_enc.c +++ b/lib_enc/ivas_qmetadata_enc.c @@ -39,7 +39,7 @@ #include "ivas_prot.h" #include "ivas_rom_com.h" #include "ivas_stat_enc.h" -#include "wmops.h" +#include "wmc_auto.h" #include "prot.h" diff --git a/lib_enc/ivas_qspherical_enc.c b/lib_enc/ivas_qspherical_enc.c index b8f889b472b55059c4599a19f66a15aecccaad66..4e2ab5049e054d3eb31a14608955c5be8df37de5 100644 --- a/lib_enc/ivas_qspherical_enc.c +++ b/lib_enc/ivas_qspherical_enc.c @@ -38,7 +38,7 @@ #include "ivas_prot.h" #include "ivas_rom_com.h" #include "ivas_stat_enc.h" -#include "wmops.h" +#include "wmc_auto.h" #include "prot.h" diff --git a/lib_enc/ivas_range_uni_enc.c b/lib_enc/ivas_range_uni_enc.c index be325d47bc76841b7116256fffc131107d64cf86..aa2ab55e0bd86f215148949aeb1a7e06a921c3a7 100644 --- a/lib_enc/ivas_range_uni_enc.c +++ b/lib_enc/ivas_range_uni_enc.c @@ -39,7 +39,7 @@ #include #include "options.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" #ifdef DEBUGGING #include "debug.h" #endif diff --git a/lib_enc/ivas_rom_enc.c b/lib_enc/ivas_rom_enc.c index ebc4ee6bc3207a85fc8bf4e2454e5de8a82fe4aa..7227dbc66ddcd9b2cf1912766352fc0ce1a653c7 100644 --- a/lib_enc/ivas_rom_enc.c +++ b/lib_enc/ivas_rom_enc.c @@ -38,7 +38,7 @@ #include "cnst.h" #include "ivas_cnst.h" #include -#include "wmops.h" +#include "wmc_auto.h" /* clang-format off */ diff --git a/lib_enc/ivas_sba_enc.c b/lib_enc/ivas_sba_enc.c index fd37c67825004aa79fdbe1556995e1e7a7e10f1f..c6a65c8a4aa3b95eca107f69d3f413e4a533dcd1 100644 --- a/lib_enc/ivas_sba_enc.c +++ b/lib_enc/ivas_sba_enc.c @@ -43,7 +43,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* @@ -200,10 +200,10 @@ ivas_error ivas_sba_enc_reinit( for ( i = 0; i < n; i++ ) { - count_free( st_ivas->mem_hp20_in[i] ); + free( st_ivas->mem_hp20_in[i] ); st_ivas->mem_hp20_in[i] = NULL; } - count_free( st_ivas->mem_hp20_in ); + free( st_ivas->mem_hp20_in ); st_ivas->mem_hp20_in = NULL; } @@ -291,7 +291,7 @@ ivas_error ivas_sba_enc_reinit( if ( n > 0 ) { - if ( ( st_ivas->mem_hp20_in = (float **) count_malloc( n * sizeof( float * ) ) ) == NULL ) + if ( ( st_ivas->mem_hp20_in = (float **) malloc( n * sizeof( float * ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HP20 filter memory\n" ) ); } @@ -303,7 +303,7 @@ ivas_error ivas_sba_enc_reinit( for ( i = 0; i < n; i++ ) { - if ( ( st_ivas->mem_hp20_in[i] = (float *) count_malloc( L_HP20_MEM * sizeof( float ) ) ) == NULL ) + if ( ( st_ivas->mem_hp20_in[i] = (float *) malloc( L_HP20_MEM * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HP20 filter memory\n" ) ); } diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index a26f3a4b1085860228cef69a6e9ba1d356b97164..9970d7b5fbaf8f833a9976f84cac50b19a8771ab 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -41,7 +41,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* @@ -93,7 +93,7 @@ ivas_error ivas_sce_enc( ivas_error error; int16_t flag_16k_smc; - wmops_sub_start( "ivas_sce_enc" ); + push_wmops( "ivas_sce_enc" ); error = IVAS_ERR_OK; @@ -280,7 +280,7 @@ ivas_error ivas_sce_enc( } #endif - wmops_sub_end(); + pop_wmops(); return error; } @@ -308,7 +308,7 @@ ivas_error create_sce_enc( * Allocate SCE handle *-----------------------------------------------------------------*/ - if ( ( hSCE = (SCE_ENC_HANDLE) count_malloc( sizeof( SCE_ENC_DATA ) ) ) == NULL ) + if ( ( hSCE = (SCE_ENC_HANDLE) malloc( sizeof( SCE_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SCE\n" ) ); } @@ -327,7 +327,7 @@ ivas_error create_sce_enc( if ( st_ivas->hEncoderConfig->ivas_format != MONO_FORMAT ) { - if ( ( hSCE->hMetaData = (BSTR_ENC_HANDLE) count_malloc( sizeof( BSTR_ENC_DATA ) ) ) == NULL ) + if ( ( hSCE->hMetaData = (BSTR_ENC_HANDLE) malloc( sizeof( BSTR_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MetaData structure\n" ) ); } @@ -341,7 +341,7 @@ ivas_error create_sce_enc( * Core Coder, 1 instance: allocate and initialize *-----------------------------------------------------------------*/ - if ( ( st = (ENC_CORE_HANDLE) count_malloc( sizeof( Encoder_State ) ) ) == NULL ) + if ( ( st = (ENC_CORE_HANDLE) malloc( sizeof( Encoder_State ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CoreCoder structure\n" ) ); } @@ -386,11 +386,11 @@ void destroy_sce_enc( if ( hSCE->hMetaData != NULL ) { - count_free( hSCE->hMetaData ); + free( hSCE->hMetaData ); hSCE->hMetaData = NULL; } - count_free( hSCE ); + free( hSCE ); return; } diff --git a/lib_enc/ivas_sns_enc.c b/lib_enc/ivas_sns_enc.c index 45c04ac9ea083618f1195a4621213403fd4c48dc..c55e8e6f27b4fe3789098afa5e661b4788ab8b7e 100644 --- a/lib_enc/ivas_sns_enc.c +++ b/lib_enc/ivas_sns_enc.c @@ -41,7 +41,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------- diff --git a/lib_enc/ivas_spar_encoder.c b/lib_enc/ivas_spar_encoder.c index dc6b5f7c73fc7496439c88137ef7a5b69f9bc261..fe965ed7889e19f1aa11c96b602f3a9ad8cea804 100644 --- a/lib_enc/ivas_spar_encoder.c +++ b/lib_enc/ivas_spar_encoder.c @@ -41,7 +41,7 @@ #include "prot.h" #include "math.h" #include -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* @@ -73,7 +73,7 @@ ivas_error ivas_spar_enc_open( error = IVAS_ERR_OK; /* SPAR encoder handle */ - if ( ( hSpar = (SPAR_ENC_HANDLE) count_malloc( sizeof( SPAR_ENC_DATA ) ) ) == NULL ) + if ( ( hSpar = (SPAR_ENC_HANDLE) malloc( sizeof( SPAR_ENC_DATA ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR encoder" ); } @@ -138,7 +138,7 @@ ivas_error ivas_spar_enc_open( hSpar->hPCA = NULL; if ( hEncoderConfig->Opt_PCA_ON ) { - if ( ( hSpar->hPCA = (PCA_ENC_STATE *) count_malloc( sizeof( PCA_ENC_STATE ) ) ) == NULL ) + if ( ( hSpar->hPCA = (PCA_ENC_STATE *) malloc( sizeof( PCA_ENC_STATE ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR PCA encoder" ); } @@ -179,7 +179,7 @@ ivas_error ivas_spar_enc_open( return error; } - if ( ( hSpar->hCoreCoderVAD = (ENC_CORE_HANDLE) count_malloc( sizeof( Encoder_State ) ) ) == NULL ) + if ( ( hSpar->hCoreCoderVAD = (ENC_CORE_HANDLE) malloc( sizeof( Encoder_State ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CoreCoder structure\n" ) ); } @@ -260,11 +260,11 @@ void ivas_spar_enc_close( /* PCA */ if ( hSpar->hPCA != NULL ) { - count_free( hSpar->hPCA ); + free( hSpar->hPCA ); hSpar->hPCA = NULL; } - count_free( hSpar ); + free( hSpar ); hSpar = NULL; } @@ -358,7 +358,7 @@ static ivas_error ivas_spar_enc_process( float dir[3], avg_dir[3]; float energySum, vecLen; - wmops_sub_start( "ivas_spar_enc_process" ); + push_wmops( "ivas_spar_enc_process" ); /*-----------------------------------------------------------------------------------------* * Initialization @@ -803,7 +803,7 @@ static ivas_error ivas_spar_enc_process( set_f( data_f[order[j]], 0.0f, input_frame ); } - wmops_sub_end(); + pop_wmops(); return error; } diff --git a/lib_enc/ivas_spar_md_enc.c b/lib_enc/ivas_spar_md_enc.c index 11893eff818fc43ea3df2332c8d621f2601188d2..c4f724b9f42642f8c080699cdb38ca34f64aa15b 100644 --- a/lib_enc/ivas_spar_md_enc.c +++ b/lib_enc/ivas_spar_md_enc.c @@ -40,7 +40,7 @@ #include "math.h" #include "ivas_rom_com.h" #include -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------------------------* @@ -117,87 +117,87 @@ ivas_error ivas_spar_md_enc_open( error = IVAS_ERR_OK; - if ( ( hMdEnc = (ivas_spar_md_enc_state_t *) count_malloc( sizeof( ivas_spar_md_enc_state_t ) ) ) == NULL ) + if ( ( hMdEnc = (ivas_spar_md_enc_state_t *) malloc( sizeof( ivas_spar_md_enc_state_t ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD encoder" ); } num_channels = ivas_sba_get_nchan_metadata( sba_order ); - if ( ( hMdEnc->spar_md.band_coeffs = (ivas_band_coeffs_t *) count_malloc( IVAS_MAX_NUM_BANDS * sizeof( ivas_band_coeffs_t ) ) ) == NULL ) + if ( ( hMdEnc->spar_md.band_coeffs = (ivas_band_coeffs_t *) malloc( IVAS_MAX_NUM_BANDS * sizeof( ivas_band_coeffs_t ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for band_coeffs in SPAR MD" ); } - if ( ( hMdEnc->mixer_mat = (float ***) count_malloc( num_channels * sizeof( float ** ) ) ) == NULL ) + if ( ( hMdEnc->mixer_mat = (float ***) malloc( num_channels * sizeof( float ** ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); } for ( i = 0; i < num_channels; i++ ) { - if ( ( hMdEnc->mixer_mat[i] = (float **) count_malloc( num_channels * sizeof( float * ) ) ) == NULL ) + if ( ( hMdEnc->mixer_mat[i] = (float **) malloc( num_channels * sizeof( float * ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); } for ( j = 0; j < num_channels; j++ ) { - if ( ( hMdEnc->mixer_mat[i][j] = (float *) count_malloc( IVAS_MAX_NUM_BANDS * sizeof( float ) ) ) == NULL ) + if ( ( hMdEnc->mixer_mat[i][j] = (float *) malloc( IVAS_MAX_NUM_BANDS * sizeof( float ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); } } } - if ( ( hMdEnc->cov_real = (float ***) count_malloc( num_channels * sizeof( float ** ) ) ) == NULL ) + if ( ( hMdEnc->cov_real = (float ***) malloc( num_channels * sizeof( float ** ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR cov real matrix" ); } for ( i = 0; i < num_channels; i++ ) { - if ( ( hMdEnc->cov_real[i] = (float **) count_malloc( num_channels * sizeof( float * ) ) ) == NULL ) + if ( ( hMdEnc->cov_real[i] = (float **) malloc( num_channels * sizeof( float * ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR cov real matrix" ); } for ( j = 0; j < num_channels; j++ ) { - if ( ( hMdEnc->cov_real[i][j] = (float *) count_malloc( IVAS_MAX_NUM_BANDS * sizeof( float ) ) ) == NULL ) + if ( ( hMdEnc->cov_real[i][j] = (float *) malloc( IVAS_MAX_NUM_BANDS * sizeof( float ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR cov real matrix" ); } } } - if ( ( hMdEnc->cov_dtx_real = (float ***) count_malloc( num_channels * sizeof( float ** ) ) ) == NULL ) + if ( ( hMdEnc->cov_dtx_real = (float ***) malloc( num_channels * sizeof( float ** ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR cov dtx real matrix" ); } for ( i = 0; i < num_channels; i++ ) { - if ( ( hMdEnc->cov_dtx_real[i] = (float **) count_malloc( num_channels * sizeof( float * ) ) ) == NULL ) + if ( ( hMdEnc->cov_dtx_real[i] = (float **) malloc( num_channels * sizeof( float * ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR cov dtx real matrix" ); } for ( j = 0; j < num_channels; j++ ) { - if ( ( hMdEnc->cov_dtx_real[i][j] = (float *) count_malloc( IVAS_MAX_NUM_BANDS * sizeof( float ) ) ) == NULL ) + if ( ( hMdEnc->cov_dtx_real[i][j] = (float *) malloc( IVAS_MAX_NUM_BANDS * sizeof( float ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR cov dtx real matrix" ); } } } - if ( ( hMdEnc->mixer_mat_local = (float ***) count_malloc( num_channels * sizeof( float ** ) ) ) == NULL ) + if ( ( hMdEnc->mixer_mat_local = (float ***) malloc( num_channels * sizeof( float ** ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); } for ( i = 0; i < num_channels; i++ ) { - if ( ( hMdEnc->mixer_mat_local[i] = (float **) count_malloc( num_channels * sizeof( float * ) ) ) == NULL ) + if ( ( hMdEnc->mixer_mat_local[i] = (float **) malloc( num_channels * sizeof( float * ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); } for ( j = 0; j < num_channels; j++ ) { - if ( ( hMdEnc->mixer_mat_local[i][j] = (float *) count_malloc( IVAS_MAX_NUM_BANDS * sizeof( float ) ) ) == NULL ) + if ( ( hMdEnc->mixer_mat_local[i][j] = (float *) malloc( IVAS_MAX_NUM_BANDS * sizeof( float ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR MD matrix" ); } @@ -233,7 +233,7 @@ void ivas_spar_md_enc_close( if ( hMdEnc->spar_md.band_coeffs != NULL ) { - count_free( hMdEnc->spar_md.band_coeffs ); + free( hMdEnc->spar_md.band_coeffs ); hMdEnc->spar_md.band_coeffs = NULL; } if ( hMdEnc->mixer_mat != NULL ) @@ -242,11 +242,11 @@ void ivas_spar_md_enc_close( { for ( j = 0; j < num_channels; j++ ) { - count_free( hMdEnc->mixer_mat[i][j] ); + free( hMdEnc->mixer_mat[i][j] ); } - count_free( hMdEnc->mixer_mat[i] ); + free( hMdEnc->mixer_mat[i] ); } - count_free( hMdEnc->mixer_mat ); + free( hMdEnc->mixer_mat ); } if ( hMdEnc->cov_real != NULL ) @@ -256,11 +256,11 @@ void ivas_spar_md_enc_close( for ( j = 0; j < num_channels; j++ ) { - count_free( hMdEnc->cov_real[i][j] ); + free( hMdEnc->cov_real[i][j] ); } - count_free( hMdEnc->cov_real[i] ); + free( hMdEnc->cov_real[i] ); } - count_free( hMdEnc->cov_real ); + free( hMdEnc->cov_real ); } if ( hMdEnc->cov_dtx_real != NULL ) @@ -270,11 +270,11 @@ void ivas_spar_md_enc_close( for ( j = 0; j < num_channels; j++ ) { - count_free( hMdEnc->cov_dtx_real[i][j] ); + free( hMdEnc->cov_dtx_real[i][j] ); } - count_free( hMdEnc->cov_dtx_real[i] ); + free( hMdEnc->cov_dtx_real[i] ); } - count_free( hMdEnc->cov_dtx_real ); + free( hMdEnc->cov_dtx_real ); } if ( hMdEnc->mixer_mat_local != NULL ) @@ -284,16 +284,16 @@ void ivas_spar_md_enc_close( for ( j = 0; j < num_channels; j++ ) { - count_free( hMdEnc->mixer_mat_local[i][j] ); + free( hMdEnc->mixer_mat_local[i][j] ); } - count_free( hMdEnc->mixer_mat_local[i] ); + free( hMdEnc->mixer_mat_local[i] ); } - count_free( hMdEnc->mixer_mat_local ); + free( hMdEnc->mixer_mat_local ); } if ( hMdEnc != NULL ) { - count_free( hMdEnc ); + free( hMdEnc ); hMdEnc = NULL; } diff --git a/lib_enc/ivas_stereo_adapt_GR_enc.c b/lib_enc/ivas_stereo_adapt_GR_enc.c index 8f07441920a8506b175eeb558e29f8c58a868e9f..f2a63660d7f1d2c4f0e4366a7c9a462ed023d49f 100644 --- a/lib_enc/ivas_stereo_adapt_GR_enc.c +++ b/lib_enc/ivas_stereo_adapt_GR_enc.c @@ -36,7 +36,7 @@ #include "ivas_prot.h" #include "prot.h" #include "stat_enc.h" -#include "wmops.h" +#include "wmc_auto.h" #include "ivas_rom_com.h" #ifdef DEBUGGING #include "debug.h" diff --git a/lib_enc/ivas_stereo_classifier.c b/lib_enc/ivas_stereo_classifier.c index 48b21146fadf2ba50c3f6c3f929bf3b05604d52e..f48437ccfdab259a8ab485934a52b45484f3ede2 100644 --- a/lib_enc/ivas_stereo_classifier.c +++ b/lib_enc/ivas_stereo_classifier.c @@ -43,7 +43,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* diff --git a/lib_enc/ivas_stereo_cng_enc.c b/lib_enc/ivas_stereo_cng_enc.c index ea75419724f130c1131f140ca5aace5804f7a483..8ab1289f6e8193e4090c60820957e4b9a5638c2b 100644 --- a/lib_enc/ivas_stereo_cng_enc.c +++ b/lib_enc/ivas_stereo_cng_enc.c @@ -43,7 +43,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------- diff --git a/lib_enc/ivas_stereo_dft_enc.c b/lib_enc/ivas_stereo_dft_enc.c index c97e6715cc95c3a8ac43881c254789aec882893a..4109c072e466a7582112543fecf09349ddcb69e4 100644 --- a/lib_enc/ivas_stereo_dft_enc.c +++ b/lib_enc/ivas_stereo_dft_enc.c @@ -45,7 +45,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" #ifdef DEBUG_PLOT #include "deb_out.h" #endif @@ -270,17 +270,17 @@ ivas_error stereo_dft_enc_create( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error: DFT Stereo memory already allocated\n" ); } - if ( ( hStereoDft_loc = (STEREO_DFT_ENC_DATA_HANDLE) count_malloc( sizeof( STEREO_DFT_ENC_DATA ) ) ) == NULL ) + if ( ( hStereoDft_loc = (STEREO_DFT_ENC_DATA_HANDLE) malloc( sizeof( STEREO_DFT_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DFT Stereo\n" ) ); } - if ( ( hStereoDft_loc->hConfig = (STEREO_DFT_CONFIG_DATA_HANDLE) count_malloc( sizeof( STEREO_DFT_CONFIG_DATA ) ) ) == NULL ) + if ( ( hStereoDft_loc->hConfig = (STEREO_DFT_CONFIG_DATA_HANDLE) malloc( sizeof( STEREO_DFT_CONFIG_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DFT Stereo Config\n" ) ); } - if ( ( hStereoDft_loc->hItd = (ITD_DATA_HANDLE) count_malloc( sizeof( ITD_DATA ) ) ) == NULL ) + if ( ( hStereoDft_loc->hItd = (ITD_DATA_HANDLE) malloc( sizeof( ITD_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ITD data\n" ) ); } @@ -699,17 +699,17 @@ void stereo_dft_enc_destroy( { if ( ( *hStereoDft )->hConfig != NULL ) { - count_free( ( *hStereoDft )->hConfig ); + free( ( *hStereoDft )->hConfig ); ( *hStereoDft )->hConfig = NULL; } if ( ( *hStereoDft )->hItd != NULL ) { - count_free( ( *hStereoDft )->hItd ); + free( ( *hStereoDft )->hItd ); ( *hStereoDft )->hItd = NULL; } - count_free( *hStereoDft ); + free( *hStereoDft ); *hStereoDft = NULL; return; @@ -743,7 +743,7 @@ void stereo_dft_enc_analyze( int16_t trigo_step; - wmops_sub_start( "DFT_analysis" ); + push_wmops( "DFT_analysis" ); /*-----------------------------------------------------------------* * Initialization @@ -867,7 +867,7 @@ void stereo_dft_enc_analyze( } } - wmops_sub_end(); + pop_wmops(); return; } @@ -943,7 +943,7 @@ float stereo_dft_enc_synthesize( win = hStereoDft->win; win_ana = hStereoDft->win_ana; - wmops_sub_start( "DFT_synth_fs" ); + push_wmops( "DFT_synth_fs" ); } else if ( output_sampling_rate == INT_FS_12k8 ) { @@ -960,7 +960,7 @@ float stereo_dft_enc_synthesize( win = hStereoDft->win_12k8; win_ana = hStereoDft->win_ana_12k8; - wmops_sub_start( "DFT_synth_12k8" ); + push_wmops( "DFT_synth_12k8" ); } else if ( output_sampling_rate == 16000 ) { @@ -977,13 +977,13 @@ float stereo_dft_enc_synthesize( { mem = hStereoDft->output_mem_dmx_16k_shb; - wmops_sub_start( "DFT_synth_16k_shb" ); + push_wmops( "DFT_synth_16k_shb" ); } else { mem = hStereoDft->output_mem_dmx_16k; - wmops_sub_start( "DFT_synth_16k" ); + push_wmops( "DFT_synth_16k" ); } win = hStereoDft->win_16k; win_ana = hStereoDft->win_ana_16k; @@ -1003,7 +1003,7 @@ float stereo_dft_enc_synthesize( win = hStereoDft->win_32k; win_ana = hStereoDft->win_ana_32k; - wmops_sub_start( "DFT_synth_32k" ); + push_wmops( "DFT_synth_32k" ); } else if ( output_sampling_rate == 8000 ) { @@ -1020,7 +1020,7 @@ float stereo_dft_enc_synthesize( win = hStereoDft->win_8k; win_ana = hStereoDft->win_ana_8k; - wmops_sub_start( "DFT_synth_8k" ); + push_wmops( "DFT_synth_8k" ); } else { @@ -1216,7 +1216,7 @@ float stereo_dft_enc_synthesize( } #endif - wmops_sub_end(); + pop_wmops(); return ( nrg ); } @@ -1945,7 +1945,7 @@ void stereo_dft_enc_res( dbgwrite( &max_snr, sizeof( float ), 1, 1, "./res/stereo_dft_res_cod_target_snr.dat" ); #endif - wmops_sub_start( "residual_encode" ); + push_wmops( "residual_encode" ); /* residual encoding */ ECSQ_init_instance( &ecsq_inst, 0 /*dummy index*/, &range_uni_enc_state ); @@ -2023,7 +2023,7 @@ void stereo_dft_enc_res( } #endif - wmops_sub_end(); + pop_wmops(); #ifdef DEBUG_MODE_DFT { diff --git a/lib_enc/ivas_stereo_dft_enc_itd.c b/lib_enc/ivas_stereo_dft_enc_itd.c index d8c32e7aee66afb72e747248d326c49e5ba49711..e65b525e0903f2fcd381e1693526fca4d1f70ea6 100644 --- a/lib_enc/ivas_stereo_dft_enc_itd.c +++ b/lib_enc/ivas_stereo_dft_enc_itd.c @@ -45,7 +45,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------- diff --git a/lib_enc/ivas_stereo_dft_td_itd.c b/lib_enc/ivas_stereo_dft_td_itd.c index 4f7060e3503ba860b6b7544d88d39d30785cdd57..8f6fe122aacdb86a621eb9964ffb088efde61cb9 100644 --- a/lib_enc/ivas_stereo_dft_td_itd.c +++ b/lib_enc/ivas_stereo_dft_td_itd.c @@ -47,7 +47,7 @@ #ifdef DEBUG_PLOT #include "deb_out.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* diff --git a/lib_enc/ivas_stereo_dmx_evs.c b/lib_enc/ivas_stereo_dmx_evs.c index e522912cc794345a68fcbedd5cde2422850e35cd..396cf2d557de7b85f0cd139f8d7564f446c4df59 100644 --- a/lib_enc/ivas_stereo_dmx_evs.c +++ b/lib_enc/ivas_stereo_dmx_evs.c @@ -43,7 +43,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------------* @@ -847,7 +847,7 @@ ivas_error stereo_dmx_evs_init_encoder( input_frame = (int16_t) ( input_Fs / FRAMES_PER_SEC ); hStereoDmxEVS = NULL; - if ( ( hStereoDmxEVS = (STEREO_DMX_EVS_ENC_HANDLE) count_malloc( sizeof( STEREO_DMX_EVS_ENC_DATA ) ) ) == NULL ) + if ( ( hStereoDmxEVS = (STEREO_DMX_EVS_ENC_HANDLE) malloc( sizeof( STEREO_DMX_EVS_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for STEREO_DMX_EVS_ENC_DATA\n" ) ); } @@ -881,7 +881,7 @@ ivas_error stereo_dmx_evs_init_encoder( } hStereoDmxEVS->hPOC = NULL; - if ( ( hStereoDmxEVS->hPOC = (STEREO_DMX_EVS_POC_HANDLE) count_malloc( sizeof( STEREO_DMX_EVS_POC_DATA ) ) ) == NULL ) + if ( ( hStereoDmxEVS->hPOC = (STEREO_DMX_EVS_POC_HANDLE) malloc( sizeof( STEREO_DMX_EVS_POC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for STEREO_DMX_EVS_POC_DATA\n" ) ); } @@ -951,11 +951,11 @@ void stereo_dmx_evs_close_encoder( { if ( hStereoDmxEVS->hPOC != NULL ) { - count_free( hStereoDmxEVS->hPOC ); + free( hStereoDmxEVS->hPOC ); hStereoDmxEVS->hPOC = NULL; } - count_free( hStereoDmxEVS ); + free( hStereoDmxEVS ); return; } diff --git a/lib_enc/ivas_stereo_eclvq_enc.c b/lib_enc/ivas_stereo_eclvq_enc.c index dffdafd17a64d09b598c4d9d4ca9b5683eb4e8be..ac635ca6fee5598ddf5ac6cf29a3fb71ea92d493 100644 --- a/lib_enc/ivas_stereo_eclvq_enc.c +++ b/lib_enc/ivas_stereo_eclvq_enc.c @@ -39,7 +39,7 @@ #include "ivas_rom_enc.h" #include #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /* used only for norm_s in the code_length_from_count function */ #include "basop32.h" @@ -240,9 +240,9 @@ static int16_t code_length_from_count( assert( c <= ( 1 << 14 ) ); #endif -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP c_norm = norm_s( (int16_t) c ); /* equivalent with 14 - floor(log_base2(c)) */ -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP /* compute linear approximation of log2(1 + x), for x in [0, 1], using a look-up table with 64 entries */ /* normalize to {16384, ..., 32767}, subtract MSB bit, and convert to Q6 for indexing log2_1px_table */ diff --git a/lib_enc/ivas_stereo_ica_enc.c b/lib_enc/ivas_stereo_ica_enc.c index c178d05a91cd7a8008f9bb28bd38e71ac7e80e12..b7152096ea92f0a3f40d622695be24515804ed78 100644 --- a/lib_enc/ivas_stereo_ica_enc.c +++ b/lib_enc/ivas_stereo_ica_enc.c @@ -41,7 +41,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" #include "rom_com.h" #include "ivas_rom_com.h" diff --git a/lib_enc/ivas_stereo_icbwe_enc.c b/lib_enc/ivas_stereo_icbwe_enc.c index 1d1f89f65642238e706b001d6c2e91e574a812f8..049dd0ba76c19b41dbf0504f7b1e75b24e868e47 100644 --- a/lib_enc/ivas_stereo_icbwe_enc.c +++ b/lib_enc/ivas_stereo_icbwe_enc.c @@ -37,7 +37,7 @@ #include "ivas_cnst.h" #include "prot.h" #include "ivas_prot.h" -#include "wmops.h" +#include "wmc_auto.h" #include "rom_com.h" #include "ivas_rom_com.h" #ifdef DEBUGGING diff --git a/lib_enc/ivas_stereo_mdct_core_enc.c b/lib_enc/ivas_stereo_mdct_core_enc.c index 6d1e9a32b0d10110079f5ebbce5095092c976766..1b8460cf073e75d47c6aa95dcc7d2ff18e556059 100755 --- a/lib_enc/ivas_stereo_mdct_core_enc.c +++ b/lib_enc/ivas_stereo_mdct_core_enc.c @@ -41,7 +41,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * sync_tcx_mode() @@ -146,7 +146,7 @@ void stereo_mdct_core_enc( int16_t stereo_bits; int16_t meta_bits, signal_bits; - wmops_sub_start( "stereo_mdct_core_enc" ); + push_wmops( "stereo_mdct_core_enc" ); L_subframeTCX = 0; /* to avoid compilation warning */ @@ -451,7 +451,7 @@ void stereo_mdct_core_enc( ivas_mdct_quant_coder( hCPE, 0, tnsBits, tnsSize, p_param, 0 ); - wmops_sub_end(); + pop_wmops(); return; } diff --git a/lib_enc/ivas_stereo_mdct_igf_enc.c b/lib_enc/ivas_stereo_mdct_igf_enc.c index b04fe84de23a8f7c17434e40bf60d33b056333d0..d2c5ae38fe9986b83cdf2cb2db58b1976e743048 100644 --- a/lib_enc/ivas_stereo_mdct_igf_enc.c +++ b/lib_enc/ivas_stereo_mdct_igf_enc.c @@ -39,7 +39,7 @@ #include "stat_enc.h" #include "ivas_stat_enc.h" #include "ivas_prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local constants diff --git a/lib_enc/ivas_stereo_mdct_stereo_enc.c b/lib_enc/ivas_stereo_mdct_stereo_enc.c index fcad004b3a2148aa840e381293540f05b7c50f21..a8bcc5e50a0c7db100f04d305f1ff303e9a9fbc2 100644 --- a/lib_enc/ivas_stereo_mdct_stereo_enc.c +++ b/lib_enc/ivas_stereo_mdct_stereo_enc.c @@ -39,7 +39,7 @@ #include "prot.h" #include "ivas_rom_com.h" #include "ivas_rom_enc.h" -#include "wmops.h" +#include "wmc_auto.h" #include "stat_enc.h" #ifdef DEBUG_PLOT #include "deb_out.h" @@ -189,7 +189,7 @@ void stereo_coder_tcx( int16_t k; int16_t nSubframes, L_frameTCX; int16_t nAvailBitsMS[NB_DIV]; - wmops_sub_start( "stereo_coder_tcx" ); + push_wmops( "stereo_coder_tcx" ); set_s( nAvailBitsMS, 0, NB_DIV ); @@ -321,7 +321,7 @@ void stereo_coder_tcx( #endif hStereoMdct->sw_uncorr = 1; - wmops_sub_end(); + pop_wmops(); return; } #ifdef DEBUGGING @@ -342,7 +342,7 @@ void stereo_coder_tcx( set_s( &ms_mask[k][0], 1, MAX_SFB ); } - wmops_sub_end(); + pop_wmops(); return; } #endif @@ -464,7 +464,7 @@ void stereo_coder_tcx( hStereoMdct->sw_uncorr = ( sw_uncorr_mean > 0.6f ); } - wmops_sub_end(); + pop_wmops(); #ifdef DEBUG_MODE_MDCT /* MDCT stereo data */ @@ -1161,13 +1161,13 @@ void initMdctStereoEncData( { if ( hStereoMdct->hDft_ana != NULL ) { - count_free( hStereoMdct->hDft_ana ); + free( hStereoMdct->hDft_ana ); hStereoMdct->hDft_ana = NULL; } if ( hStereoMdct->hItd != NULL ) { - count_free( hStereoMdct->hItd ); + free( hStereoMdct->hItd ); hStereoMdct->hItd = NULL; } } @@ -1188,7 +1188,7 @@ ivas_error initMdctItdHandling( { if ( hStereoMdct->hItd == NULL ) { - if ( ( hStereoMdct->hItd = (ITD_DATA_HANDLE) count_malloc( sizeof( ITD_DATA ) ) ) == NULL ) + if ( ( hStereoMdct->hItd = (ITD_DATA_HANDLE) malloc( sizeof( ITD_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ITD data\n" ) ); } @@ -1196,7 +1196,7 @@ ivas_error initMdctItdHandling( if ( hStereoMdct->hDft_ana == NULL ) { - if ( ( hStereoMdct->hDft_ana = (DFT_ANA_HANDLE) count_malloc( sizeof( DFT_ANA ) ) ) == NULL ) + if ( ( hStereoMdct->hDft_ana = (DFT_ANA_HANDLE) malloc( sizeof( DFT_ANA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for ITD data\n" ) ); } @@ -1223,17 +1223,17 @@ void stereo_mdct_enc_destroy( { if ( ( *hStereoMdct )->hDft_ana != NULL ) { - count_free( ( *hStereoMdct )->hDft_ana ); + free( ( *hStereoMdct )->hDft_ana ); ( *hStereoMdct )->hDft_ana = NULL; } if ( ( *hStereoMdct )->hItd != NULL ) { - count_free( ( *hStereoMdct )->hItd ); + free( ( *hStereoMdct )->hItd ); ( *hStereoMdct )->hItd = NULL; } - count_free( *hStereoMdct ); + free( *hStereoMdct ); *hStereoMdct = NULL; return; diff --git a/lib_enc/ivas_stereo_switching_enc.c b/lib_enc/ivas_stereo_switching_enc.c index 59adc49fef6eda1e46ec21310a51cd0c0e6f855e..75c62cfba961b1679017a3ddb207bddda118a4ab 100644 --- a/lib_enc/ivas_stereo_switching_enc.c +++ b/lib_enc/ivas_stereo_switching_enc.c @@ -40,7 +40,7 @@ #include "prot.h" #include "ivas_prot.h" #include "ivas_rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* @@ -55,7 +55,7 @@ static ivas_error allocate_CoreCoder_enc( { if ( st->hLPDmem == NULL && st->element_mode != IVAS_CPE_MDCT ) { - if ( ( st->hLPDmem = (LPD_state_HANDLE) count_malloc( sizeof( LPD_state ) ) ) == NULL ) + if ( ( st->hLPDmem = (LPD_state_HANDLE) malloc( sizeof( LPD_state ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LPDmem\n" ) ); } @@ -64,7 +64,7 @@ static ivas_error allocate_CoreCoder_enc( if ( st->hGSCEnc == NULL && st->element_mode != IVAS_CPE_MDCT ) { - if ( ( st->hGSCEnc = (GSC_ENC_HANDLE) count_malloc( sizeof( GSC_ENC_DATA ) ) ) == NULL ) + if ( ( st->hGSCEnc = (GSC_ENC_HANDLE) malloc( sizeof( GSC_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for GSC\n" ) ); } @@ -73,7 +73,7 @@ static ivas_error allocate_CoreCoder_enc( if ( st->hNoiseEst == NULL ) { - if ( ( st->hNoiseEst = (NOISE_EST_HANDLE) count_malloc( sizeof( NOISE_EST_DATA ) ) ) == NULL ) + if ( ( st->hNoiseEst = (NOISE_EST_HANDLE) malloc( sizeof( NOISE_EST_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Noise estimation\n" ) ); } @@ -82,7 +82,7 @@ static ivas_error allocate_CoreCoder_enc( if ( st->hVAD == NULL ) { - if ( ( st->hVAD = (VAD_HANDLE) count_malloc( sizeof( VAD_DATA ) ) ) == NULL ) + if ( ( st->hVAD = (VAD_HANDLE) malloc( sizeof( VAD_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for VAD\n" ) ); } @@ -91,7 +91,7 @@ static ivas_error allocate_CoreCoder_enc( if ( st->hSpMusClas == NULL ) { - if ( ( st->hSpMusClas = (SP_MUS_CLAS_HANDLE) count_malloc( sizeof( SP_MUS_CLAS_DATA ) ) ) == NULL ) + if ( ( st->hSpMusClas = (SP_MUS_CLAS_HANDLE) malloc( sizeof( SP_MUS_CLAS_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Speech/music classifier\n" ) ); } @@ -114,25 +114,25 @@ static void deallocate_CoreCoder_TCX_enc( { if ( st->hTcxEnc != NULL ) { - count_free( st->hTcxEnc ); + free( st->hTcxEnc ); st->hTcxEnc = NULL; } if ( st->hTcxCfg != NULL ) { - count_free( st->hTcxCfg ); + free( st->hTcxCfg ); st->hTcxCfg = NULL; } if ( st->hIGFEnc != NULL ) { - count_free( st->hIGFEnc ); + free( st->hIGFEnc ); st->hIGFEnc = NULL; } if ( st->hHQ_core != NULL ) { - count_free( st->hHQ_core ); + free( st->hHQ_core ); st->hHQ_core = NULL; } @@ -152,31 +152,31 @@ static void deallocate_CoreCoder_enc( { if ( st->hLPDmem != NULL ) { - count_free( st->hLPDmem ); + free( st->hLPDmem ); st->hLPDmem = NULL; } if ( st->hGSCEnc != NULL ) { - count_free( st->hGSCEnc ); + free( st->hGSCEnc ); st->hGSCEnc = NULL; } if ( st->hNoiseEst != NULL && st->element_mode != IVAS_CPE_MDCT ) { - count_free( st->hNoiseEst ); + free( st->hNoiseEst ); st->hNoiseEst = NULL; } if ( st->hVAD != NULL && st->element_mode != IVAS_CPE_MDCT ) { - count_free( st->hVAD ); + free( st->hVAD ); st->hVAD = NULL; } if ( st->hSpMusClas != NULL && st->element_mode != IVAS_CPE_MDCT ) { - count_free( st->hSpMusClas ); + free( st->hSpMusClas ); st->hSpMusClas = NULL; } @@ -187,7 +187,7 @@ static void deallocate_CoreCoder_enc( if ( st->hBWE_TD != NULL ) { - count_free( st->hBWE_TD ); + free( st->hBWE_TD ); st->hBWE_TD = NULL; } @@ -198,7 +198,7 @@ static void deallocate_CoreCoder_enc( if ( st->hBWE_FD != NULL ) { - count_free( st->hBWE_FD ); + free( st->hBWE_FD ); st->hBWE_FD = NULL; } @@ -261,7 +261,7 @@ ivas_error stereo_memory_enc( /* deallocate data structure of the previous CPE mode */ if ( hCPE->hStereoTD != NULL ) { - count_free( hCPE->hStereoTD ); + free( hCPE->hStereoTD ); hCPE->hStereoTD = NULL; } @@ -283,7 +283,7 @@ ivas_error stereo_memory_enc( /* allocate ICBWE structure */ if ( hCPE->hStereoICBWE == NULL ) { - if ( ( hCPE->hStereoICBWE = (STEREO_ICBWE_ENC_HANDLE) count_malloc( sizeof( STEREO_ICBWE_ENC_DATA ) ) ) == NULL ) + if ( ( hCPE->hStereoICBWE = (STEREO_ICBWE_ENC_HANDLE) malloc( sizeof( STEREO_ICBWE_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Stereo ICBWE \n" ) ); } @@ -295,7 +295,7 @@ ivas_error stereo_memory_enc( st = hCPE->hCoreCoder[0]; if ( st->hHQ_core == NULL ) { - if ( ( st->hHQ_core = (HQ_ENC_HANDLE) count_malloc( sizeof( HQ_ENC_DATA ) ) ) == NULL ) + if ( ( st->hHQ_core = (HQ_ENC_HANDLE) malloc( sizeof( HQ_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HQ core\n" ) ); } @@ -332,7 +332,7 @@ ivas_error stereo_memory_enc( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error: TD Stereo memory already allocated\n" ); } - if ( ( hCPE->hStereoTD = (STEREO_TD_ENC_DATA_HANDLE) count_malloc( sizeof( STEREO_TD_ENC_DATA ) ) ) == NULL ) + if ( ( hCPE->hStereoTD = (STEREO_TD_ENC_DATA_HANDLE) malloc( sizeof( STEREO_TD_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TD Stereo\n" ) ); } @@ -360,7 +360,7 @@ ivas_error stereo_memory_enc( { if ( hCPE->hCoreCoder[1]->hDtxEnc != NULL ) { - count_free( hCPE->hCoreCoder[1]->hDtxEnc ); + free( hCPE->hCoreCoder[1]->hDtxEnc ); hCPE->hCoreCoder[1]->hDtxEnc = NULL; } @@ -372,7 +372,7 @@ ivas_error stereo_memory_enc( if ( hCPE->hCoreCoder[0]->Opt_DTX_ON && hCPE->hCoreCoder[0]->hTdCngEnc == NULL ) { - if ( ( hCPE->hCoreCoder[0]->hTdCngEnc = (TD_CNG_ENC_HANDLE) count_malloc( sizeof( TD_CNG_ENC_DATA ) ) ) == NULL ) + if ( ( hCPE->hCoreCoder[0]->hTdCngEnc = (TD_CNG_ENC_HANDLE) malloc( sizeof( TD_CNG_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DTX/TD CNG\n" ) ); } @@ -386,7 +386,7 @@ ivas_error stereo_memory_enc( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error: TCA Stereo memory already allocated\n" ); } - if ( ( hCPE->hStereoTCA = (STEREO_TCA_ENC_HANDLE) count_malloc( sizeof( STEREO_TCA_ENC_DATA ) ) ) == NULL ) + if ( ( hCPE->hStereoTCA = (STEREO_TCA_ENC_HANDLE) malloc( sizeof( STEREO_TCA_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Stereo TCA\n" ) ); } @@ -413,7 +413,7 @@ ivas_error stereo_memory_enc( /* allocate BWEs for primary channel */ if ( st->hBWE_TD == NULL ) { - if ( ( st->hBWE_TD = (TD_BWE_ENC_HANDLE) count_malloc( sizeof( TD_BWE_ENC_DATA ) ) ) == NULL ) + if ( ( st->hBWE_TD = (TD_BWE_ENC_HANDLE) malloc( sizeof( TD_BWE_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TD BWE\n" ) ); } @@ -429,7 +429,7 @@ ivas_error stereo_memory_enc( InitSWBencBuffer( st->hBWE_TD ); ResetSHBbuffer_Enc( st->hBWE_TD ); - if ( ( st->hBWE_FD = (FD_BWE_ENC_HANDLE) count_malloc( sizeof( FD_BWE_ENC_DATA ) ) ) == NULL ) + if ( ( st->hBWE_FD = (FD_BWE_ENC_HANDLE) malloc( sizeof( FD_BWE_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FD BWE\n" ) ); } @@ -440,7 +440,7 @@ ivas_error stereo_memory_enc( /* allocate stereo CNG structure */ if ( hCPE->hStereoCng == NULL ) { - if ( ( hCPE->hStereoCng = (STEREO_CNG_ENC_HANDLE) count_malloc( sizeof( STEREO_CNG_ENC ) ) ) == NULL ) + if ( ( hCPE->hStereoCng = (STEREO_CNG_ENC_HANDLE) malloc( sizeof( STEREO_CNG_ENC ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Stereo Cng for Unified/TD\n" ) ); } @@ -466,19 +466,19 @@ ivas_error stereo_memory_enc( if ( hCPE->hStereoTD != NULL ) { - count_free( hCPE->hStereoTD ); + free( hCPE->hStereoTD ); hCPE->hStereoTD = NULL; } if ( hCPE->hStereoTCA != NULL ) { - count_free( hCPE->hStereoTCA ); + free( hCPE->hStereoTCA ); hCPE->hStereoTCA = NULL; } if ( hCPE->hStereoICBWE != NULL ) { - count_free( hCPE->hStereoICBWE ); + free( hCPE->hStereoICBWE ); hCPE->hStereoICBWE = NULL; } @@ -500,7 +500,7 @@ ivas_error stereo_memory_enc( /* allocate TCX/IGF structures for second channel */ st = hCPE->hCoreCoder[1]; - if ( ( st->hTcxEnc = (TCX_ENC_HANDLE) count_malloc( sizeof( TCX_ENC_DATA ) ) ) == NULL ) + if ( ( st->hTcxEnc = (TCX_ENC_HANDLE) malloc( sizeof( TCX_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for hTcxEnc\n" ) ); } @@ -515,19 +515,19 @@ ivas_error stereo_memory_enc( st->last_core = ACELP_CORE; /* needed to set-up TCX core in SetTCXModeInfo() */ } - if ( ( st->hTcxCfg = (TCX_CONFIG_HANDLE) count_malloc( sizeof( TCX_config ) ) ) == NULL ) + if ( ( st->hTcxCfg = (TCX_CONFIG_HANDLE) malloc( sizeof( TCX_config ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for hTcxCfg\n" ) ); } - if ( ( st->hIGFEnc = (IGF_ENC_INSTANCE_HANDLE) count_malloc( sizeof( IGF_ENC_INSTANCE ) ) ) == NULL ) + if ( ( st->hIGFEnc = (IGF_ENC_INSTANCE_HANDLE) malloc( sizeof( IGF_ENC_INSTANCE ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for hIGFEnc\n" ) ); } st->igf = getIgfPresent( st->element_mode, st->total_brate, st->bwidth, st->rf_mode, st->mct_chan_mode ); /* allocate and initialize MDCT stereo structure */ - if ( ( hCPE->hStereoMdct = (STEREO_MDCT_ENC_DATA_HANDLE) count_malloc( sizeof( STEREO_MDCT_ENC_DATA ) ) ) == NULL ) + if ( ( hCPE->hStereoMdct = (STEREO_MDCT_ENC_DATA_HANDLE) malloc( sizeof( STEREO_MDCT_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for MDCT Stereo \n" ) ); } @@ -562,7 +562,7 @@ ivas_error stereo_memory_enc( if ( st->hDtxEnc == NULL ) { - if ( ( st->hDtxEnc = (DTX_ENC_HANDLE) count_malloc( sizeof( DTX_ENC_DATA ) ) ) == NULL ) + if ( ( st->hDtxEnc = (DTX_ENC_HANDLE) malloc( sizeof( DTX_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for DTX variables\n" ) ); } @@ -571,7 +571,7 @@ ivas_error stereo_memory_enc( if ( st->hTdCngEnc != NULL ) { - count_free( st->hTdCngEnc ); + free( st->hTdCngEnc ); st->hTdCngEnc = NULL; } diff --git a/lib_enc/ivas_stereo_td_analysis.c b/lib_enc/ivas_stereo_td_analysis.c index 41de84d71422668fd36ec663d569d256e9fa2087..50e7a83fec80d43770689ba8dc30272b6024a43e 100644 --- a/lib_enc/ivas_stereo_td_analysis.c +++ b/lib_enc/ivas_stereo_td_analysis.c @@ -43,7 +43,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* diff --git a/lib_enc/ivas_stereo_td_enc.c b/lib_enc/ivas_stereo_td_enc.c index bc454f0220c6ce62b43f2a36e2da4b70eccf64f2..78349edf334d0a37926dfc10044d9d4e0e7c6307 100644 --- a/lib_enc/ivas_stereo_td_enc.c +++ b/lib_enc/ivas_stereo_td_enc.c @@ -41,7 +41,7 @@ #include "prot.h" #include "ivas_prot.h" #include "ivas_rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" #include "math.h" @@ -190,7 +190,7 @@ ivas_error stereo_set_tdm( { if ( st->hBWE_TD != NULL ) { - count_free( st->hBWE_TD ); + free( st->hBWE_TD ); st->hBWE_TD = NULL; } @@ -198,7 +198,7 @@ ivas_error stereo_set_tdm( if ( st->hBWE_FD != NULL ) { - count_free( st->hBWE_FD ); + free( st->hBWE_FD ); st->hBWE_FD = NULL; } } @@ -206,7 +206,7 @@ ivas_error stereo_set_tdm( /* allocate ICBWE structure */ if ( hCPE->hStereoICBWE == NULL ) { - if ( ( hCPE->hStereoICBWE = (STEREO_ICBWE_ENC_HANDLE) count_malloc( sizeof( STEREO_ICBWE_ENC_DATA ) ) ) == NULL ) + if ( ( hCPE->hStereoICBWE = (STEREO_ICBWE_ENC_HANDLE) malloc( sizeof( STEREO_ICBWE_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Stereo ICBWE \n" ) ); } @@ -222,7 +222,7 @@ ivas_error stereo_set_tdm( /* deallocate ICBWE structure */ if ( hCPE->hStereoICBWE != NULL ) { - count_free( hCPE->hStereoICBWE ); + free( hCPE->hStereoICBWE ); hCPE->hStereoICBWE = NULL; } @@ -238,7 +238,7 @@ ivas_error stereo_set_tdm( /* allocate BWEs for secondary channel */ if ( st->hBWE_TD == NULL ) { - if ( ( st->hBWE_TD = (TD_BWE_ENC_HANDLE) count_malloc( sizeof( TD_BWE_ENC_DATA ) ) ) == NULL ) + if ( ( st->hBWE_TD = (TD_BWE_ENC_HANDLE) malloc( sizeof( TD_BWE_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TD BWE\n" ) ); } @@ -251,7 +251,7 @@ ivas_error stereo_set_tdm( InitSWBencBuffer( st->hBWE_TD ); ResetSHBbuffer_Enc( st->hBWE_TD ); - if ( ( st->hBWE_FD = (FD_BWE_ENC_HANDLE) count_malloc( sizeof( FD_BWE_ENC_DATA ) ) ) == NULL ) + if ( ( st->hBWE_FD = (FD_BWE_ENC_HANDLE) malloc( sizeof( FD_BWE_ENC_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FD BWE\n" ) ); } diff --git a/lib_enc/ivas_tcx_core_enc.c b/lib_enc/ivas_tcx_core_enc.c index e8cfaf66977de809850fdccde926d7289e5bb01c..4f17a3979be0720d1bb95614d4d73beec22102d4 100644 --- a/lib_enc/ivas_tcx_core_enc.c +++ b/lib_enc/ivas_tcx_core_enc.c @@ -41,7 +41,7 @@ #include "prot.h" #include "rom_com.h" #include "basop_proto_func.h" -#include "wmops.h" +#include "wmc_auto.h" #include "ivas_prot.h" /*-------------------------------------------------------------------* @@ -171,7 +171,7 @@ void stereo_tcx_core_enc( pF = fopen( "./res/stereo_tcx_enc_ind.txt", "w" ); #endif - wmops_sub_start( "stereo_tcx_core_enc" ); + push_wmops( "stereo_tcx_core_enc" ); /*Sanity check*/ assert( st->mdct_sw == MODE1 && "MDCT switching should be in TCX MODE 1\n" ); @@ -547,7 +547,7 @@ void stereo_tcx_core_enc( set_f( pitch_buf, L_SUBFR, NB_SUBFR16k ); } - wmops_sub_end(); + pop_wmops(); return; } diff --git a/lib_enc/ivas_td_low_rate_enc.c b/lib_enc/ivas_td_low_rate_enc.c index 87140143470a208af975ac7e938ba975d261ef55..ad7d8e3cdc72afec89f48343f350b58e15339e9b 100644 --- a/lib_enc/ivas_td_low_rate_enc.c +++ b/lib_enc/ivas_td_low_rate_enc.c @@ -42,7 +42,7 @@ #include "ivas_cnst.h" #include "prot.h" #include "ivas_prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* diff --git a/lib_enc/lead_indexing.c b/lib_enc/lead_indexing.c index d97ccc69559526f8211641a5cdb55d1e4652ab4d..3faccbb2e734cf296a16dcd9f28cdf41d5282f12 100644 --- a/lib_enc/lead_indexing.c +++ b/lib_enc/lead_indexing.c @@ -41,7 +41,7 @@ #endif #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local function prototypes diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index 6db4bb991bd638f13cf2050d46a0f5c962b787bd..3b28f0ee64630aee9fcdac4c0e979518f13639e3 100755 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -39,10 +39,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#ifdef WMOPS -#include "wmops.h" -#endif - +#include "wmc_auto.h" /*---------------------------------------------------------------------* * Local struct @@ -114,9 +111,11 @@ ivas_error IVAS_ENC_Open( *-----------------------------------------------------------------*/ #ifdef BITSTREAM_INDICES_MEMORY - if ( ( *phIvasEnc = (IVAS_ENC_HANDLE) dynamic_malloc( sizeof( struct IVAS_ENC ) ) ) == NULL ) +#define WMC_TOOL_SKIP + if ( ( *phIvasEnc = (IVAS_ENC_HANDLE) malloc( sizeof( struct IVAS_ENC ) ) ) == NULL ) +#undef WMC_TOOL_SKIP #else - if ( ( *phIvasEnc = (IVAS_ENC_HANDLE) count_malloc( sizeof( struct IVAS_ENC ) ) ) == NULL ) + if ( ( *phIvasEnc = (IVAS_ENC_HANDLE) malloc( sizeof( struct IVAS_ENC ) ) ) == NULL ) #endif { return IVAS_ERR_FAILED_ALLOC; @@ -157,12 +156,12 @@ ivas_error IVAS_ENC_Open( * Allocate IVAS-codec encoder state *-----------------------------------------------------------------*/ - if ( ( ( *phIvasEnc )->st_ivas = (Encoder_Struct *) count_malloc( sizeof( Encoder_Struct ) ) ) == NULL ) + if ( ( ( *phIvasEnc )->st_ivas = (Encoder_Struct *) malloc( sizeof( Encoder_Struct ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for IVAS encoder structure" ); } - if ( ( ( *phIvasEnc )->st_ivas->hEncoderConfig = (ENCODER_CONFIG_HANDLE) count_malloc( sizeof( ENCODER_CONFIG ) ) ) == NULL ) + if ( ( ( *phIvasEnc )->st_ivas->hEncoderConfig = (ENCODER_CONFIG_HANDLE) malloc( sizeof( ENCODER_CONFIG ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for Encoder config structure" ); } @@ -213,18 +212,20 @@ void IVAS_ENC_Close( { if ( ( *phIvasEnc )->st_ivas->hEncoderConfig ) { - count_free( ( *phIvasEnc )->st_ivas->hEncoderConfig ); + free( ( *phIvasEnc )->st_ivas->hEncoderConfig ); ( *phIvasEnc )->st_ivas->hEncoderConfig = NULL; } - count_free( ( *phIvasEnc )->st_ivas ); + free( ( *phIvasEnc )->st_ivas ); } ( *phIvasEnc )->st_ivas = NULL; #ifdef BITSTREAM_INDICES_MEMORY - dynamic_free( *phIvasEnc ); +#define WMC_TOOL_SKIP + free( *phIvasEnc ); +#undef WMC_TOOL_SKIP #else - count_free( *phIvasEnc ); + free( *phIvasEnc ); #endif *phIvasEnc = NULL; diff --git a/lib_enc/long_enr.c b/lib_enc/long_enr.c index 68128b5d8ae10b3c89f002a9d0f90fc6428c2df8..d2100b9ee6d57b6d57d9e62f0f3e3662cffeb72f 100644 --- a/lib_enc/long_enr.c +++ b/lib_enc/long_enr.c @@ -41,7 +41,7 @@ #endif #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * long_enr() diff --git a/lib_enc/lp_exc_e.c b/lib_enc/lp_exc_e.c index e8078c5e0e2d5eb921690a045cefa93bc70bdac8..36011ade86ab461e240d959edf5fea908ed52e0c 100644 --- a/lib_enc/lp_exc_e.c +++ b/lib_enc/lp_exc_e.c @@ -42,7 +42,7 @@ #include #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local constants diff --git a/lib_enc/lsf_enc.c b/lib_enc/lsf_enc.c index 8e561c76e87315de90530dda3d536415de1ddf78..e8bf8b51acdea7c4116077699f89c2214a640ad4 100644 --- a/lib_enc/lsf_enc.c +++ b/lib_enc/lsf_enc.c @@ -49,7 +49,7 @@ #include "ivas_prot.h" #include "ivas_rom_com.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------* * Local constants diff --git a/lib_enc/lsf_msvq_ma_enc.c b/lib_enc/lsf_msvq_ma_enc.c index bf115aa6719b35f8a114d13e2ee3721995cc2efa..7e78a2b8e11812f28b2530477634f22acc55f4db 100644 --- a/lib_enc/lsf_msvq_ma_enc.c +++ b/lib_enc/lsf_msvq_ma_enc.c @@ -44,7 +44,7 @@ #include "rom_com.h" #include "rom_enc.h" #include "basop_proto_func.h" -#include "wmops.h" +#include "wmc_auto.h" #define kMaxC 8 @@ -120,14 +120,14 @@ void msvq_enc( cb_stage = cbp; /* Set up pointers to parent and current nodes */ -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP swap( indices[0], indices[1], int16_t * ); MOVE( 3 ); swap( resid[0], resid[1], float * ); MOVE( 3 ); swap( dist[0], dist[1], float * ); MOVE( 3 ); -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP /* p_max points to maximum distortion node (worst of best) */ p_max = 0; diff --git a/lib_enc/ltd_stable.c b/lib_enc/ltd_stable.c index 5650f93e67bb0dc32ce7b0c2fdee50a2f6992f44..3ca14288d545a33a4f9f5a1303bc74e925a1f915 100644 --- a/lib_enc/ltd_stable.c +++ b/lib_enc/ltd_stable.c @@ -38,7 +38,7 @@ #include "options.h" #include #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * ltd_stable() diff --git a/lib_enc/mdct_classifier.c b/lib_enc/mdct_classifier.c index ae7e6f7e3f31513688134da43ddf34cc21a12a44..b94835b0a470a9c6440fb32537f18ab710fb4f7e 100644 --- a/lib_enc/mdct_classifier.c +++ b/lib_enc/mdct_classifier.c @@ -41,7 +41,7 @@ #endif #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" #include diff --git a/lib_enc/mdct_selector.c b/lib_enc/mdct_selector.c index 1f118d23d2d03bd73ca3ef02b10970c07fd2b79c..ee83eb3a409706939c38c0ca50adcce34b98e3eb 100644 --- a/lib_enc/mdct_selector.c +++ b/lib_enc/mdct_selector.c @@ -44,7 +44,7 @@ #include "rom_enc.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------* * Local constants diff --git a/lib_enc/mslvq_enc.c b/lib_enc/mslvq_enc.c index 3c910cbf0663194fc83df13ecd829504de6a4726..2ca49f26299b0c89f71e7f8dd51f2b49cc13f62c 100644 --- a/lib_enc/mslvq_enc.c +++ b/lib_enc/mslvq_enc.c @@ -40,7 +40,7 @@ #include "prot.h" #include "rom_com.h" #include "cnst.h" -#include "wmops.h" +#include "wmc_auto.h" #include "ivas_prot.h" /*-----------------------------------------------------------------* diff --git a/lib_enc/multi_harm.c b/lib_enc/multi_harm.c index 4427b3376c4cec7121e5ff4d31fc2df5a74db434..cfbe05efa33a5aeb359c9deacd50a1fbb156e0a4 100644 --- a/lib_enc/multi_harm.c +++ b/lib_enc/multi_harm.c @@ -42,7 +42,7 @@ #include #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------* * Local constants diff --git a/lib_enc/nelp_enc.c b/lib_enc/nelp_enc.c index 8f8f407749e6b7cc59aeb0e5255e9a146cb37ede..e25983020fd3193206f7b3e7ef1a66b09e1dab84 100644 --- a/lib_enc/nelp_enc.c +++ b/lib_enc/nelp_enc.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * quantize_uvg() diff --git a/lib_enc/nois_est.c b/lib_enc/nois_est.c index 62330f71536bc822d79314c92ab9ed31b3fbc4d3..fb096322929d807f0050660410e9e222cbb92f8a 100644 --- a/lib_enc/nois_est.c +++ b/lib_enc/nois_est.c @@ -39,7 +39,7 @@ #include #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------* * Local constants diff --git a/lib_enc/noise_adjust.c b/lib_enc/noise_adjust.c index 5d592d071bf05340a0ed48f75f711f3852e68398..7eb123b39947423670ef7746ac1aaf16db464f07 100644 --- a/lib_enc/noise_adjust.c +++ b/lib_enc/noise_adjust.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------* * noise_adjust() diff --git a/lib_enc/normalizecoefs.c b/lib_enc/normalizecoefs.c index 7e039f171e43e2deb13761f78c5707337c69bf74..425bde338cc3a28606ca1b1e8b2579c242af2ca7 100644 --- a/lib_enc/normalizecoefs.c +++ b/lib_enc/normalizecoefs.c @@ -41,7 +41,7 @@ #endif #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------------- * normalizecoefs() diff --git a/lib_enc/peak_vq_enc.c b/lib_enc/peak_vq_enc.c index a77f071112164ee5d99ba68c1b21d53a2c50444b..e2bc6b9c5ce2058692ad64755ddab27de9116c0b 100644 --- a/lib_enc/peak_vq_enc.c +++ b/lib_enc/peak_vq_enc.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" #include /*-------------------------------------------------------------------------- diff --git a/lib_enc/pit_enc.c b/lib_enc/pit_enc.c index 454da71966fa8c11cfd8eea3443de688d75d872c..2bbca8b8b4ba2b474bafd74ae40aa5a11de2c2a6 100644 --- a/lib_enc/pit_enc.c +++ b/lib_enc/pit_enc.c @@ -42,7 +42,7 @@ #include "prot.h" #include "rom_enc.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------* * pit_encode() diff --git a/lib_enc/pitch_ol.c b/lib_enc/pitch_ol.c index 72d454fd3037e9697d4e3680b905112bcd524dc8..32ab74cea6d066f26c8d45f54a169c3dd263f951 100644 --- a/lib_enc/pitch_ol.c +++ b/lib_enc/pitch_ol.c @@ -41,7 +41,7 @@ #include "cnst.h" #include "rom_com.h" #include "rom_enc.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * Local constants diff --git a/lib_enc/pitch_ol2.c b/lib_enc/pitch_ol2.c index 13f5bd33de6cb6adcc3ca404baf382d57ea5f10b..5ea871d2659c8086d541eac431b8f9d2c8b609c1 100644 --- a/lib_enc/pitch_ol2.c +++ b/lib_enc/pitch_ol2.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "rom_enc.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local constants diff --git a/lib_enc/plc_enc_ext.c b/lib_enc/plc_enc_ext.c index 70b573c5a9aa9cac9d02d1296d27ab3829c1b25a..4c3685076ad4fbfe1ce79032bf1c9fb2497f2a94 100644 --- a/lib_enc/plc_enc_ext.c +++ b/lib_enc/plc_enc_ext.c @@ -41,7 +41,7 @@ #include "stat_enc.h" #include "cnst.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" #define NBITS_GACELP 5 diff --git a/lib_enc/ppp_enc.c b/lib_enc/ppp_enc.c index f2c6f4e2bd183a7ac9f43fcf72e5361e4877997f..5c64049f511f869327710b3a759af5c5bea6441a 100644 --- a/lib_enc/ppp_enc.c +++ b/lib_enc/ppp_enc.c @@ -40,7 +40,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* @@ -355,7 +355,7 @@ ivas_error ppp_quarter_encoder( push_indice( hBstr, IND_GLOBAL_ALIGNMENT, (int16_t) ( tmp + 3 ), 3 ); - dynamic_free( PREVDTFS ); + free( PREVDTFS ); return error; } diff --git a/lib_enc/pre_proc.c b/lib_enc/pre_proc.c index 6eb11ca68ed1383e3170674bec744974db0fe5c8..d77a3e729cb2e5b3cd0b708222c8a33fe94aecac 100644 --- a/lib_enc/pre_proc.c +++ b/lib_enc/pre_proc.c @@ -43,7 +43,7 @@ #include "rom_enc.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* @@ -123,7 +123,7 @@ void pre_proc( int16_t clas_mod; int16_t old_pitch1; - wmops_sub_start( "pre_proc" ); + push_wmops( "pre_proc" ); /*------------------------------------------------------------------* * Initialization @@ -1004,6 +1004,6 @@ void pre_proc( } } - wmops_sub_end(); + pop_wmops(); return; } diff --git a/lib_enc/pvq_core_enc.c b/lib_enc/pvq_core_enc.c index 3603b950e9bc32f8ec9209dab730cf035367c0e9..5e7003e025bbe0c48c4232b8631e9c7508acdae9 100644 --- a/lib_enc/pvq_core_enc.c +++ b/lib_enc/pvq_core_enc.c @@ -44,7 +44,7 @@ #include "prot.h" #include "prot.h" #include "stl.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local function prototypes diff --git a/lib_enc/pvq_encode.c b/lib_enc/pvq_encode.c index acf7928a6faf4b6c1f6ce890dd8a878b8fb38116..159a4c25976cb6100226fdd2536f6427525742c9 100644 --- a/lib_enc/pvq_encode.c +++ b/lib_enc/pvq_encode.c @@ -43,7 +43,7 @@ #include "prot.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" static void pyramidSearch( const float *const s, const int16_t L, const int16_t Ptot, const float A, int16_t *ztak, float *stak ); diff --git a/lib_enc/q_gain2p.c b/lib_enc/q_gain2p.c index 8a3bc04b9a86cc7efd717b713bd6b8d6ac339bc6..949bbe0fe1673d826672a9f8ad44f31d720b0fa2 100644 --- a/lib_enc/q_gain2p.c +++ b/lib_enc/q_gain2p.c @@ -43,7 +43,7 @@ #include "prot.h" #include "cnst.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------------* * Local function prototypes diff --git a/lib_enc/qlpc_avq.c b/lib_enc/qlpc_avq.c index 03aeab128e90a8441cbedd83741aa1e5a76350f5..4b41c56bab240abf6d4649902d485f4641a0303c 100644 --- a/lib_enc/qlpc_avq.c +++ b/lib_enc/qlpc_avq.c @@ -38,7 +38,7 @@ #include "options.h" #include "prot.h" #include "ivas_prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * qlpc_avq() diff --git a/lib_enc/qlpc_stoch.c b/lib_enc/qlpc_stoch.c index 403132b6e820b573dc0905a649452b7a4ce1e509..c42d2efeb73819a5b030a4f8be34685442513fcb 100644 --- a/lib_enc/qlpc_stoch.c +++ b/lib_enc/qlpc_stoch.c @@ -46,7 +46,7 @@ #include "rom_com.h" #include "rom_enc.h" #include "basop_proto_func.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * lpc_quantization() diff --git a/lib_enc/range_enc.c b/lib_enc/range_enc.c index d44ed895a4f7d0a1b04a0d9ae7324a5584f3d399..4029ffc2f045bc47136f3bbcd7a8116b7cae900b 100644 --- a/lib_enc/range_enc.c +++ b/lib_enc/range_enc.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local function prototypes diff --git a/lib_enc/re8_cod.c b/lib_enc/re8_cod.c index 30030cc394b23a994b8e077bf8e5fa821ccc7465..500fa8b13908d4caf142a614e32059b5cb086c04 100644 --- a/lib_enc/re8_cod.c +++ b/lib_enc/re8_cod.c @@ -40,7 +40,7 @@ #include "debug.h" #endif #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------ diff --git a/lib_enc/reordernorm.c b/lib_enc/reordernorm.c index 2387263aab5abdab44b792ceda6ce65215b78415..b086ef3ad83820306a4e8e7234657852f2e532ca 100644 --- a/lib_enc/reordernorm.c +++ b/lib_enc/reordernorm.c @@ -42,7 +42,7 @@ #include "prot.h" #include "cnst.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------*/ /* Function reordernorm */ diff --git a/lib_enc/rom_enc.c b/lib_enc/rom_enc.c index cc9755ce9243d13f63d47f6f2bfb557a55d4cffe..72b185f613e2ce6c95e611bbd070ce40cee6459d 100644 --- a/lib_enc/rom_enc.c +++ b/lib_enc/rom_enc.c @@ -40,7 +40,7 @@ #include "debug.h" #endif #include "cnst.h" -#include "wmops.h" +#include "wmc_auto.h" /* clang-format off */ diff --git a/lib_enc/rst_enc.c b/lib_enc/rst_enc.c index ac8853c7211666ae99d0daf14736eec1137740cd..43f4e19d312d8df5a01414583987a50bc071085f 100644 --- a/lib_enc/rst_enc.c +++ b/lib_enc/rst_enc.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * CNG_reset_enc() diff --git a/lib_enc/set_impulse.c b/lib_enc/set_impulse.c index 493d373d1ecb897b7144fb2d5249569fc340fd19..f2dc62d3cdf4573e910370eb6067d6338f3a4bb6 100644 --- a/lib_enc/set_impulse.c +++ b/lib_enc/set_impulse.c @@ -39,7 +39,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------* * Local constant diff --git a/lib_enc/setmodeindex.c b/lib_enc/setmodeindex.c index 67d2d9d7103d61aa7b074d5c843d3d9a80f6d097..0dba8cf52b30d5578f222a47eeecb68c4ea5fcc9 100644 --- a/lib_enc/setmodeindex.c +++ b/lib_enc/setmodeindex.c @@ -42,7 +42,7 @@ #include "prot.h" #include "cnst.h" #include "ivas_cnst.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------- diff --git a/lib_enc/sig_clas.c b/lib_enc/sig_clas.c index c1438b6b7686d6fd0dfd1801ab861446ef5c9ee6..44c6ed8c0358f758bf8dd48d6f416e230cb95abe 100644 --- a/lib_enc/sig_clas.c +++ b/lib_enc/sig_clas.c @@ -42,7 +42,7 @@ #include #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * Local constants diff --git a/lib_enc/spec_center.c b/lib_enc/spec_center.c index f565cba7a8eb23f8c2a86fff1fb84a47a202a993..45c7792dc291be5822b84603f0092e626f2ae457 100644 --- a/lib_enc/spec_center.c +++ b/lib_enc/spec_center.c @@ -39,7 +39,7 @@ #include "prot.h" #include "rom_enc.h" #include "cnst.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * spec_center() diff --git a/lib_enc/spec_flatness.c b/lib_enc/spec_flatness.c index 2ef6bd3b606bf1f6487ded483384eaea312706e1..ed97d959e8a63872bf470f5745f7088b9a517d3b 100644 --- a/lib_enc/spec_flatness.c +++ b/lib_enc/spec_flatness.c @@ -39,7 +39,7 @@ #include "options.h" #include #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * spec_flatness() diff --git a/lib_enc/speech_music_classif.c b/lib_enc/speech_music_classif.c index a61e42c1646254ddef87ee57d26ed054bc06cafc..e384a50cb832505a9ea687a38cf5e2479e675eb1 100644 --- a/lib_enc/speech_music_classif.c +++ b/lib_enc/speech_music_classif.c @@ -46,7 +46,7 @@ #include "ivas_prot.h" #include "rom_enc.h" #include "rom_com.h" /* Common static table prototypes */ -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* diff --git a/lib_enc/stat_noise_uv_enc.c b/lib_enc/stat_noise_uv_enc.c index 3cb876097b9b35fe2c531fba1c6282f97749e98d..1b7647d7f9bf3a4363676f6394e797d439ed69ee 100644 --- a/lib_enc/stat_noise_uv_enc.c +++ b/lib_enc/stat_noise_uv_enc.c @@ -41,7 +41,7 @@ #endif #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------* * stat_noise_uv_enc() diff --git a/lib_enc/subband_fft.c b/lib_enc/subband_fft.c index 9f02fa04aeec09ad1e2ab133dca047ab2b76b764..61d40b24896abcef5fa6098083504d2c4240ac0c 100644 --- a/lib_enc/subband_fft.c +++ b/lib_enc/subband_fft.c @@ -39,7 +39,7 @@ #include #include "prot.h" #include "rom_enc.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* diff --git a/lib_enc/swb_bwe_enc.c b/lib_enc/swb_bwe_enc.c index 01c586fcbc882c2219837964400594a97e2500d0..7aded2bc57f74dcb73562cfba3506b02e55ddee8 100644 --- a/lib_enc/swb_bwe_enc.c +++ b/lib_enc/swb_bwe_enc.c @@ -46,7 +46,7 @@ #include "rom_enc.h" #include "basop_util.h" #include "basop_proto_func.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * Local function prototypes diff --git a/lib_enc/swb_bwe_enc_hr.c b/lib_enc/swb_bwe_enc_hr.c index 63e5753650fdb51b1bf2bf3a7c7f1db2b250d6d6..087e0f01f97e1149cde5e68af8ffc385bd10f400 100644 --- a/lib_enc/swb_bwe_enc_hr.c +++ b/lib_enc/swb_bwe_enc_hr.c @@ -42,7 +42,7 @@ #include #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * en_band_quant() diff --git a/lib_enc/swb_bwe_enc_lr.c b/lib_enc/swb_bwe_enc_lr.c index 7273972d7c463f186bad04d6e2b0dffb0d2ae7fb..c7a6a99f8272f42669599a410180d11ee1493ac4 100644 --- a/lib_enc/swb_bwe_enc_lr.c +++ b/lib_enc/swb_bwe_enc_lr.c @@ -44,7 +44,7 @@ #include "prot.h" #include "rom_com.h" #include "stat_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*--------------------------------------------------------------------------* * GetSubbandCorrIndex2_har() diff --git a/lib_enc/swb_pre_proc.c b/lib_enc/swb_pre_proc.c index 83b0deab6c769ba2d0f7d14120ca6169182aa4e0..70c12b62322c49b7fc01728e51c1755e0b680b45 100644 --- a/lib_enc/swb_pre_proc.c +++ b/lib_enc/swb_pre_proc.c @@ -44,7 +44,7 @@ #include "prot.h" #include "rom_com.h" #include "rom_enc.h" -#include "wmops.h" +#include "wmc_auto.h" #include "ivas_prot.h" #include "ivas_rom_enc.h" diff --git a/lib_enc/swb_tbe_enc.c b/lib_enc/swb_tbe_enc.c index cf2470ed8bacfeb090e51c4ee5d5fcb2044db3a4..9602540dadd09d8343b94530c6dbe1d00b0e33d0 100644 --- a/lib_enc/swb_tbe_enc.c +++ b/lib_enc/swb_tbe_enc.c @@ -44,7 +44,7 @@ #include "prot.h" #include "rom_com.h" #include "rom_enc.h" -#include "wmops.h" +#include "wmc_auto.h" #include "ivas_prot.h" /*-----------------------------------------------------------------* diff --git a/lib_enc/tcq_core_enc.c b/lib_enc/tcq_core_enc.c index 11d96e2015eb17302e8bc96449af051a7d36a38f..c096117c67e7f3eedeb0805029d8c3b10329215b 100644 --- a/lib_enc/tcq_core_enc.c +++ b/lib_enc/tcq_core_enc.c @@ -44,7 +44,7 @@ #include "cnst.h" #include "basop_util.h" #include "basop_proto_func.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* * tcq_core_LR_enc() @@ -181,7 +181,7 @@ ivas_error tcq_core_LR_enc( } } -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP bsub_fx = L_shl( L_add( tcq_arbits, lsbtcq_bits ), 16 ); IF( bsub_fx > 0 ) { @@ -206,7 +206,7 @@ ivas_error tcq_core_LR_enc( } srt_vec_ind_fx( Rk_fx, Rk_sort_fx, k_sort, BANDS ); -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP /* Quantize spectral band shapes using TCQ */ /* Select ISC */ @@ -282,7 +282,7 @@ ivas_error tcq_core_LR_enc( if ( Rk_fx[k_sort[k]] > 0 && surplus_fx < 0 ) { -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP IF( nzbands <= 1 ) { divider = 0; @@ -302,7 +302,7 @@ ivas_error tcq_core_LR_enc( delta_fx = 0; } surplus_fx = L_sub( surplus_fx, delta_fx ); -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP } else { @@ -311,13 +311,13 @@ ivas_error tcq_core_LR_enc( } } -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP if ( ( L_sub( surplus_fx, 524288 ) > 0 && sub( input_frame, L_FRAME8k ) == 0 ) || ( L_sub( surplus_fx, 786432 ) > 0 && sub( input_frame, L_FRAME16k ) == 0 ) ) { bit_surplus_fx[0] = Mult_32_16( surplus_fx, 24576 ); /* Q16 */ bit_surplus_fx[1] = Mult_32_16( surplus_fx, 8192 ); /* Q16 */ } -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP else { bit_surplus_fx[0] = surplus_fx; @@ -329,9 +329,9 @@ ivas_error tcq_core_LR_enc( { if ( k == k_num[j] ) { -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP Rk_fx[k_sort[k]] = L_add( Rk_fx[k_sort[k]], bit_surplus_fx[j] ); -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP if ( Rk_fx[k_sort[k]] > 0 && USQ_TCQ[k_sort[k]] == 0 ) /* Then have non-zero block AND WILL BE ENCODED BY TCQ */ { diff --git a/lib_enc/tcx_ltp_enc.c b/lib_enc/tcx_ltp_enc.c index fbac9b164075f5f00c9473f7618e50960a0613fa..4274fc047b3cae011339aa585da0222d759c549e 100644 --- a/lib_enc/tcx_ltp_enc.c +++ b/lib_enc/tcx_ltp_enc.c @@ -43,7 +43,7 @@ #include "prot.h" #include "rom_enc.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" #ifdef DEBUG_PLOT #include "deb_out.h" #endif diff --git a/lib_enc/tcx_utils_enc.c b/lib_enc/tcx_utils_enc.c index 04b6f0a20633e8507330f7513b868dbded36f1e3..3b982a73950d9d822e9f9770eb11d51a3c9b235e 100755 --- a/lib_enc/tcx_utils_enc.c +++ b/lib_enc/tcx_utils_enc.c @@ -44,7 +44,7 @@ #include "prot.h" #include "rom_com.h" #include "cnst.h" -#include "wmops.h" +#include "wmc_auto.h" #include "ivas_prot.h" /*---------------------------------------------------------------------* diff --git a/lib_enc/tfa_enc.c b/lib_enc/tfa_enc.c index dca8b62623ed05cb1a44540637b4d7d668e5379f..db875805e104b582d333655dfe275e7d6ea82de0 100644 --- a/lib_enc/tfa_enc.c +++ b/lib_enc/tfa_enc.c @@ -38,7 +38,7 @@ #include "options.h" #include #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * tfaCalcEnv() diff --git a/lib_enc/tns_base_enc.c b/lib_enc/tns_base_enc.c index f008ed728fbf9dd34ebfde9ae98559bc355b4c4a..dde185b345c8825c96d63dcdb39b6a07fb513ef6 100644 --- a/lib_enc/tns_base_enc.c +++ b/lib_enc/tns_base_enc.c @@ -37,7 +37,7 @@ #include #include #include "options.h" -#include "wmops.h" +#include "wmc_auto.h" #include "cnst.h" #include "rom_com.h" #include "prot.h" diff --git a/lib_enc/transient_detection.c b/lib_enc/transient_detection.c index 2b10e7cbe4076b39ce983fd21b935e4863e032af..c5a6e4a0e979c4ffcf4364eb757b3b4ee0f35ea5 100644 --- a/lib_enc/transient_detection.c +++ b/lib_enc/transient_detection.c @@ -44,7 +44,7 @@ #include "prot.h" #include "ivas_prot.h" #include -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------* @@ -634,9 +634,9 @@ static void RunTransientDetector( assert( ( pTransientDetector->CheckSubblocksForAttack != NULL ) ); /* Variable initialization */ -#define WMC_TOOL_MAN +#define WMC_TOOL_SKIP pTransientDetector->CheckSubblocksForAttack( pSubblockNrg, pAccSubblockNrg, NSUBBLOCKS + nDelay, nRelativeDelay, attackRatioThreshold, &pTransientDetector->bIsAttackPresent, &pTransientDetector->attackIndex ); -#undef WMC_TOOL_MAN +#undef WMC_TOOL_SKIP return; } diff --git a/lib_enc/transition_enc.c b/lib_enc/transition_enc.c index ef291f23c27a0ad3b4eecc51310f741aee57e4d4..52d4b19803e31e1bb2da35058c62c184c7bf386d 100644 --- a/lib_enc/transition_enc.c +++ b/lib_enc/transition_enc.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------* * Local function prototypes diff --git a/lib_enc/update_decision.c b/lib_enc/update_decision.c index 05877f7a7ec4b2772c61e2e927bc3aeea3ceb307..655ce8d8b753d535dd71e2a5f0dc9a8264559eaf 100644 --- a/lib_enc/update_decision.c +++ b/lib_enc/update_decision.c @@ -38,7 +38,7 @@ #include "options.h" #include #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* diff --git a/lib_enc/updt_enc.c b/lib_enc/updt_enc.c index 16af04550e656246835d1a84defc36f2ae6bb452..b425dbe00689fc0c0cda1617137d50e2c326e56a 100644 --- a/lib_enc/updt_enc.c +++ b/lib_enc/updt_enc.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "rom_com.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * updt_enc() diff --git a/lib_enc/updt_tar.c b/lib_enc/updt_tar.c index 4cf7f78680cf9037a9e7f62f8b560ab3b3c6ad7f..692dad3f5882a5a513c35de31d95b2a9ab8c98fb 100644 --- a/lib_enc/updt_tar.c +++ b/lib_enc/updt_tar.c @@ -40,7 +40,7 @@ #include "debug.h" #endif #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*----------------------------------------------------------------------------------* * procedure updt_tar() diff --git a/lib_enc/vad.c b/lib_enc/vad.c index 1812085689ab45ae8462c8e0aeb17b11a56a93f3..54c88c71b95fe92e1645970ee008674de7a542b3 100644 --- a/lib_enc/vad.c +++ b/lib_enc/vad.c @@ -43,7 +43,7 @@ #include "cnst.h" #include "prot.h" #include "rom_enc.h" -#include "wmops.h" +#include "wmc_auto.h" #include "ivas_prot.h" /*-----------------------------------------------------------------* diff --git a/lib_enc/vad_param_updt.c b/lib_enc/vad_param_updt.c index cbbf5c37d9adaf78bbdac097dde4e8f71e442eb3..21c940510d31005801af7050f7846129d3843596 100644 --- a/lib_enc/vad_param_updt.c +++ b/lib_enc/vad_param_updt.c @@ -42,7 +42,7 @@ #include #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * vad_param_updt() diff --git a/lib_enc/vad_proc.c b/lib_enc/vad_proc.c index f40ca2cb5fe86733a018dbed709174e38f3e1f65..93f357aa07282d01356cc1999f2cce40a9a7c385 100644 --- a/lib_enc/vad_proc.c +++ b/lib_enc/vad_proc.c @@ -39,7 +39,7 @@ #include "options.h" #include "prot.h" #include "rom_enc.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* diff --git a/lib_enc/vbr_average_rate.c b/lib_enc/vbr_average_rate.c index a32091f690ba8c649280af992a81403eecc0b946..77ac2a9ddbd2326072bb29c8e4560b3747605afa 100644 --- a/lib_enc/vbr_average_rate.c +++ b/lib_enc/vbr_average_rate.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------* * Local constants diff --git a/lib_enc/vlpc_1st_cod.c b/lib_enc/vlpc_1st_cod.c index 9f9316705405cfb31269e9de043cab03e28e5d61..0ffbc85a9f08402e89dd40addeec334dabdfe909 100644 --- a/lib_enc/vlpc_1st_cod.c +++ b/lib_enc/vlpc_1st_cod.c @@ -42,7 +42,7 @@ #include "cnst.h" #include "prot.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------* diff --git a/lib_enc/vlpc_2st_cod.c b/lib_enc/vlpc_2st_cod.c index 86abfec1b03f9ce6e7faf90e6c734a2b9693779e..7a90311d7e0cfafa9dda21eb279b20c922913507 100644 --- a/lib_enc/vlpc_2st_cod.c +++ b/lib_enc/vlpc_2st_cod.c @@ -38,7 +38,7 @@ #include "options.h" #include "cnst.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------* * vlpc_2st_cod() diff --git a/lib_enc/voiced_enc.c b/lib_enc/voiced_enc.c index d67ecbbce248d2cc60f4e841b34156f80ac49cc0..15fd15d07906e0d2e55abd16f80d8b907661446b 100644 --- a/lib_enc/voiced_enc.c +++ b/lib_enc/voiced_enc.c @@ -40,7 +40,7 @@ #include "prot.h" #include "cnst.h" #include "rom_com.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * Local function prototypes @@ -554,12 +554,12 @@ ivas_error ppp_voiced_encoder( { hSC_VBR->bump_up = 1; - dynamic_free( CURRP_NQ ); - dynamic_free( TMPDTFS ); - dynamic_free( TMPDTFS2 ); - dynamic_free( TMPDTFS3 ); - dynamic_free( CURRP_Q_E ); - dynamic_free( dtfs_temp ); + free( CURRP_NQ ); + free( TMPDTFS ); + free( TMPDTFS2 ); + free( TMPDTFS3 ); + free( CURRP_Q_E ); + free( dtfs_temp ); return error; } @@ -580,12 +580,12 @@ ivas_error ppp_voiced_encoder( { hSC_VBR->bump_up = 1; - dynamic_free( CURRP_NQ ); - dynamic_free( TMPDTFS ); - dynamic_free( TMPDTFS2 ); - dynamic_free( TMPDTFS3 ); - dynamic_free( CURRP_Q_E ); - dynamic_free( dtfs_temp ); + free( CURRP_NQ ); + free( TMPDTFS ); + free( TMPDTFS2 ); + free( TMPDTFS3 ); + free( CURRP_Q_E ); + free( dtfs_temp ); return error; } @@ -608,12 +608,12 @@ ivas_error ppp_voiced_encoder( { hSC_VBR->bump_up = 1; - dynamic_free( CURRP_NQ ); - dynamic_free( TMPDTFS ); - dynamic_free( TMPDTFS2 ); - dynamic_free( TMPDTFS3 ); - dynamic_free( CURRP_Q_E ); - dynamic_free( dtfs_temp ); + free( CURRP_NQ ); + free( TMPDTFS ); + free( TMPDTFS2 ); + free( TMPDTFS3 ); + free( CURRP_Q_E ); + free( dtfs_temp ); return error; } @@ -749,12 +749,12 @@ ivas_error ppp_voiced_encoder( { hSC_VBR->bump_up = 1; - dynamic_free( CURRP_NQ ); - dynamic_free( TMPDTFS ); - dynamic_free( TMPDTFS2 ); - dynamic_free( TMPDTFS3 ); - dynamic_free( CURRP_Q_E ); - dynamic_free( dtfs_temp ); + free( CURRP_NQ ); + free( TMPDTFS ); + free( TMPDTFS2 ); + free( TMPDTFS3 ); + free( CURRP_Q_E ); + free( dtfs_temp ); return error; } @@ -780,12 +780,12 @@ ivas_error ppp_voiced_encoder( { hSC_VBR->bump_up = 1; - dynamic_free( CURRP_NQ ); - dynamic_free( TMPDTFS ); - dynamic_free( TMPDTFS2 ); - dynamic_free( TMPDTFS3 ); - dynamic_free( CURRP_Q_E ); - dynamic_free( dtfs_temp ); + free( CURRP_NQ ); + free( TMPDTFS ); + free( TMPDTFS2 ); + free( TMPDTFS3 ); + free( CURRP_Q_E ); + free( dtfs_temp ); return error; } @@ -800,13 +800,12 @@ ivas_error ppp_voiced_encoder( if ( hSC_VBR->bump_up == 1 ) { - - dynamic_free( CURRP_NQ ); - dynamic_free( TMPDTFS ); - dynamic_free( TMPDTFS2 ); - dynamic_free( TMPDTFS3 ); - dynamic_free( CURRP_Q_E ); - dynamic_free( dtfs_temp ); + free( CURRP_NQ ); + free( TMPDTFS ); + free( TMPDTFS2 ); + free( TMPDTFS3 ); + free( CURRP_Q_E ); + free( dtfs_temp ); return error; } @@ -816,12 +815,12 @@ ivas_error ppp_voiced_encoder( { hSC_VBR->bump_up = 1; - dynamic_free( CURRP_NQ ); - dynamic_free( TMPDTFS ); - dynamic_free( TMPDTFS2 ); - dynamic_free( TMPDTFS3 ); - dynamic_free( CURRP_Q_E ); - dynamic_free( dtfs_temp ); + free( CURRP_NQ ); + free( TMPDTFS ); + free( TMPDTFS2 ); + free( TMPDTFS3 ); + free( CURRP_Q_E ); + free( dtfs_temp ); return error; } @@ -835,12 +834,12 @@ ivas_error ppp_voiced_encoder( { if ( ( error = ppp_quarter_encoder( &flag, hBstr, CURRP_Q_E, TMPDTFS, dtfs_temp->lag, *CURRP_NQ, lpc2, &( hSC_VBR->lastLgainE ), &( hSC_VBR->lastHgainE ), &( hSC_VBR->lasterbE[0] ), *dtfs_temp ) ) != IVAS_ERR_OK ) { - dynamic_free( CURRP_NQ ); - dynamic_free( TMPDTFS ); - dynamic_free( TMPDTFS2 ); - dynamic_free( TMPDTFS3 ); - dynamic_free( CURRP_Q_E ); - dynamic_free( dtfs_temp ); + free( CURRP_NQ ); + free( TMPDTFS ); + free( TMPDTFS2 ); + free( TMPDTFS3 ); + free( CURRP_Q_E ); + free( dtfs_temp ); return error; } @@ -1027,12 +1026,12 @@ ivas_error ppp_voiced_encoder( { hSC_VBR->bump_up = 1; - dynamic_free( CURRP_NQ ); - dynamic_free( TMPDTFS ); - dynamic_free( TMPDTFS2 ); - dynamic_free( TMPDTFS3 ); - dynamic_free( CURRP_Q_E ); - dynamic_free( dtfs_temp ); + free( CURRP_NQ ); + free( TMPDTFS ); + free( TMPDTFS2 ); + free( TMPDTFS3 ); + free( CURRP_Q_E ); + free( dtfs_temp ); return error; } @@ -1047,12 +1046,12 @@ ivas_error ppp_voiced_encoder( PPP_MODE_E = 'B'; hSC_VBR->bump_up = 1; - dynamic_free( CURRP_NQ ); - dynamic_free( TMPDTFS ); - dynamic_free( TMPDTFS2 ); - dynamic_free( TMPDTFS3 ); - dynamic_free( CURRP_Q_E ); - dynamic_free( dtfs_temp ); + free( CURRP_NQ ); + free( TMPDTFS ); + free( TMPDTFS2 ); + free( TMPDTFS3 ); + free( CURRP_Q_E ); + free( dtfs_temp ); return error; } @@ -1084,12 +1083,12 @@ ivas_error ppp_voiced_encoder( mvr2r( dtfs_temp->a, hSC_VBR->dtfs_enc_a, MAXLAG_WI ); mvr2r( dtfs_temp->b, hSC_VBR->dtfs_enc_b, MAXLAG_WI ); - dynamic_free( CURRP_NQ ); - dynamic_free( TMPDTFS ); - dynamic_free( TMPDTFS2 ); - dynamic_free( TMPDTFS3 ); - dynamic_free( CURRP_Q_E ); - dynamic_free( dtfs_temp ); + free( CURRP_NQ ); + free( TMPDTFS ); + free( TMPDTFS2 ); + free( TMPDTFS3 ); + free( CURRP_Q_E ); + free( dtfs_temp ); return error; } diff --git a/lib_enc/waveadjust_fec_cod.c b/lib_enc/waveadjust_fec_cod.c index e0b87477be6b3d4a054043f3112206f66f57c60a..f1d5ab6220770e4b53d1cc1016c235034281df66 100644 --- a/lib_enc/waveadjust_fec_cod.c +++ b/lib_enc/waveadjust_fec_cod.c @@ -38,7 +38,7 @@ #include "options.h" #include #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* * SFM_Cal() diff --git a/lib_rend/ivas_allrad_dec.c b/lib_rend/ivas_allrad_dec.c index a61f543cb197e72aea08175db9464106e45de617..b304208441107d1683aee5126c71a8c95963b3fb 100644 --- a/lib_rend/ivas_allrad_dec.c +++ b/lib_rend/ivas_allrad_dec.c @@ -43,7 +43,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" #ifdef DEBUG_MODE_INFO_ALLRAD @@ -108,7 +108,7 @@ ivas_error ivas_sba_get_hoa_dec_matrix( /* Allocate memory */ assert( *hoa_dec_mtx == NULL && "hoa_dec_mtx != NULL" ); - if ( ( *hoa_dec_mtx = (float *) count_malloc( SBA_NHARM_HOA3 * ( hOutSetup.nchan_out_woLFE ) * sizeof( float ) ) ) == NULL ) + if ( ( *hoa_dec_mtx = (float *) malloc( SBA_NHARM_HOA3 * ( hOutSetup.nchan_out_woLFE ) * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "ALLRAD: Cannot allocate memory!" ) ); } diff --git a/lib_rend/ivas_binauralRenderer.c b/lib_rend/ivas_binauralRenderer.c index b31ee4e00dc679f6cee5c6e86f141bd8de18cdd6..1443766b604f314429fa637f0182841204cbd91a 100644 --- a/lib_rend/ivas_binauralRenderer.c +++ b/lib_rend/ivas_binauralRenderer.c @@ -43,7 +43,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------- @@ -133,7 +133,7 @@ static ivas_error ivas_binRenderer_convModuleOpen( * prepare library opening *-----------------------------------------------------------------*/ - if ( ( hBinRenConvModule = (BINRENDERER_CONV_MODULE_HANDLE) count_malloc( sizeof( BINRENDERER_CONV_MODULE ) ) ) == NULL ) + if ( ( hBinRenConvModule = (BINRENDERER_CONV_MODULE_HANDLE) malloc( sizeof( BINRENDERER_CONV_MODULE ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } @@ -187,79 +187,79 @@ static ivas_error ivas_binRenderer_convModuleOpen( } /* allocate memory for filter states */ - if ( ( hBinRenConvModule->filterTapsLeftReal = (float ***) count_malloc( hBinRenderer->conv_band * sizeof( float ** ) ) ) == NULL ) + if ( ( hBinRenConvModule->filterTapsLeftReal = (float ***) malloc( hBinRenderer->conv_band * sizeof( float ** ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } - if ( ( hBinRenConvModule->filterTapsLeftImag = (float ***) count_malloc( hBinRenderer->conv_band * sizeof( float ** ) ) ) == NULL ) + if ( ( hBinRenConvModule->filterTapsLeftImag = (float ***) malloc( hBinRenderer->conv_band * sizeof( float ** ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } - if ( ( hBinRenConvModule->filterTapsRightReal = (float ***) count_malloc( hBinRenderer->conv_band * sizeof( float ** ) ) ) == NULL ) + if ( ( hBinRenConvModule->filterTapsRightReal = (float ***) malloc( hBinRenderer->conv_band * sizeof( float ** ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } - if ( ( hBinRenConvModule->filterTapsRightImag = (float ***) count_malloc( hBinRenderer->conv_band * sizeof( float ** ) ) ) == NULL ) + if ( ( hBinRenConvModule->filterTapsRightImag = (float ***) malloc( hBinRenderer->conv_band * sizeof( float ** ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } for ( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) { - if ( ( hBinRenConvModule->filterTapsLeftReal[bandIdx] = (float **) count_malloc( hBinRenderer->nInChannels * sizeof( float * ) ) ) == NULL ) + if ( ( hBinRenConvModule->filterTapsLeftReal[bandIdx] = (float **) malloc( hBinRenderer->nInChannels * sizeof( float * ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } - if ( ( hBinRenConvModule->filterTapsLeftImag[bandIdx] = (float **) count_malloc( hBinRenderer->nInChannels * sizeof( float * ) ) ) == NULL ) + if ( ( hBinRenConvModule->filterTapsLeftImag[bandIdx] = (float **) malloc( hBinRenderer->nInChannels * sizeof( float * ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } - if ( ( hBinRenConvModule->filterTapsRightReal[bandIdx] = (float **) count_malloc( hBinRenderer->nInChannels * sizeof( float * ) ) ) == NULL ) + if ( ( hBinRenConvModule->filterTapsRightReal[bandIdx] = (float **) malloc( hBinRenderer->nInChannels * sizeof( float * ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } - if ( ( hBinRenConvModule->filterTapsRightImag[bandIdx] = (float **) count_malloc( hBinRenderer->nInChannels * sizeof( float * ) ) ) == NULL ) + if ( ( hBinRenConvModule->filterTapsRightImag[bandIdx] = (float **) malloc( hBinRenderer->nInChannels * sizeof( float * ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } } - if ( ( hBinRenConvModule->filterStatesLeftReal = (float ***) count_malloc( hBinRenderer->conv_band * sizeof( float ** ) ) ) == NULL ) + if ( ( hBinRenConvModule->filterStatesLeftReal = (float ***) malloc( hBinRenderer->conv_band * sizeof( float ** ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } - if ( ( hBinRenConvModule->filterStatesLeftImag = (float ***) count_malloc( hBinRenderer->conv_band * sizeof( float ** ) ) ) == NULL ) + if ( ( hBinRenConvModule->filterStatesLeftImag = (float ***) malloc( hBinRenderer->conv_band * sizeof( float ** ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } for ( bandIdx = 0; bandIdx < hBinRenderer->conv_band; bandIdx++ ) { - if ( ( hBinRenConvModule->filterStatesLeftReal[bandIdx] = (float **) count_malloc( hBinRenderer->nInChannels * sizeof( float * ) ) ) == NULL ) + if ( ( hBinRenConvModule->filterStatesLeftReal[bandIdx] = (float **) malloc( hBinRenderer->nInChannels * sizeof( float * ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } - if ( ( hBinRenConvModule->filterStatesLeftImag[bandIdx] = (float **) count_malloc( hBinRenderer->nInChannels * sizeof( float * ) ) ) == NULL ) + if ( ( hBinRenConvModule->filterStatesLeftImag[bandIdx] = (float **) malloc( hBinRenderer->nInChannels * sizeof( float * ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } for ( chIdx = 0; chIdx < hBinRenderer->nInChannels; chIdx++ ) { - if ( ( hBinRenConvModule->filterStatesLeftReal[bandIdx][chIdx] = (float *) count_malloc( hBinRenConvModule->numTapsArray[bandIdx] * sizeof( float ) ) ) == NULL ) + if ( ( hBinRenConvModule->filterStatesLeftReal[bandIdx][chIdx] = (float *) malloc( hBinRenConvModule->numTapsArray[bandIdx] * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } - if ( ( hBinRenConvModule->filterStatesLeftImag[bandIdx][chIdx] = (float *) count_malloc( hBinRenConvModule->numTapsArray[bandIdx] * sizeof( float ) ) ) == NULL ) + if ( ( hBinRenConvModule->filterStatesLeftImag[bandIdx][chIdx] = (float *) malloc( hBinRenConvModule->numTapsArray[bandIdx] * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Convolution Module \n" ) ); } @@ -495,7 +495,7 @@ ivas_error ivas_binRenderer_open( * prepare library opening *-----------------------------------------------------------------*/ - if ( ( hBinRenderer = (BINAURAL_RENDERER_HANDLE) count_malloc( sizeof( BINAURAL_RENDERER ) ) ) == NULL ) + if ( ( hBinRenderer = (BINAURAL_RENDERER_HANDLE) malloc( sizeof( BINAURAL_RENDERER ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural Renderer\n" ) ); } @@ -677,29 +677,29 @@ static void ivas_binRenderer_convModuleClose( for ( bandIdx = 0; bandIdx < ( *hBinRenderer )->conv_band; bandIdx++ ) { - count_free( hBinRenConvModule->filterTapsLeftReal[bandIdx] ); + free( hBinRenConvModule->filterTapsLeftReal[bandIdx] ); hBinRenConvModule->filterTapsLeftReal[bandIdx] = NULL; - count_free( hBinRenConvModule->filterTapsLeftImag[bandIdx] ); + free( hBinRenConvModule->filterTapsLeftImag[bandIdx] ); hBinRenConvModule->filterTapsLeftImag[bandIdx] = NULL; - count_free( hBinRenConvModule->filterTapsRightReal[bandIdx] ); + free( hBinRenConvModule->filterTapsRightReal[bandIdx] ); hBinRenConvModule->filterTapsRightReal[bandIdx] = NULL; - count_free( hBinRenConvModule->filterTapsRightImag[bandIdx] ); + free( hBinRenConvModule->filterTapsRightImag[bandIdx] ); hBinRenConvModule->filterTapsRightImag[bandIdx] = NULL; } - count_free( hBinRenConvModule->filterTapsLeftReal ); + free( hBinRenConvModule->filterTapsLeftReal ); hBinRenConvModule->filterTapsLeftReal = NULL; - count_free( hBinRenConvModule->filterTapsLeftImag ); + free( hBinRenConvModule->filterTapsLeftImag ); hBinRenConvModule->filterTapsLeftImag = NULL; - count_free( hBinRenConvModule->filterTapsRightReal ); + free( hBinRenConvModule->filterTapsRightReal ); hBinRenConvModule->filterTapsRightReal = NULL; - count_free( hBinRenConvModule->filterTapsRightImag ); + free( hBinRenConvModule->filterTapsRightImag ); hBinRenConvModule->filterTapsRightImag = NULL; @@ -707,28 +707,28 @@ static void ivas_binRenderer_convModuleClose( { for ( chIdx = 0; chIdx < ( *hBinRenderer )->nInChannels; chIdx++ ) { - count_free( hBinRenConvModule->filterStatesLeftReal[bandIdx][chIdx] ); + free( hBinRenConvModule->filterStatesLeftReal[bandIdx][chIdx] ); hBinRenConvModule->filterStatesLeftReal[bandIdx][chIdx] = NULL; - count_free( hBinRenConvModule->filterStatesLeftImag[bandIdx][chIdx] ); + free( hBinRenConvModule->filterStatesLeftImag[bandIdx][chIdx] ); hBinRenConvModule->filterStatesLeftImag[bandIdx][chIdx] = NULL; } - count_free( hBinRenConvModule->filterStatesLeftReal[bandIdx] ); + free( hBinRenConvModule->filterStatesLeftReal[bandIdx] ); hBinRenConvModule->filterStatesLeftReal[bandIdx] = NULL; - count_free( hBinRenConvModule->filterStatesLeftImag[bandIdx] ); + free( hBinRenConvModule->filterStatesLeftImag[bandIdx] ); hBinRenConvModule->filterStatesLeftImag[bandIdx] = NULL; } - count_free( hBinRenConvModule->filterStatesLeftReal ); + free( hBinRenConvModule->filterStatesLeftReal ); hBinRenConvModule->filterStatesLeftReal = NULL; - count_free( hBinRenConvModule->filterStatesLeftImag ); + free( hBinRenConvModule->filterStatesLeftImag ); hBinRenConvModule->filterStatesLeftImag = NULL; - count_free( ( *hBinRenderer )->hBinRenConvModule ); + free( ( *hBinRenderer )->hBinRenConvModule ); ( *hBinRenderer )->hBinRenConvModule = NULL; return; @@ -760,7 +760,7 @@ void ivas_binRenderer_close( ivas_binaural_reverb_close( &( ( *hBinRenderer )->hReverb ) ); } - count_free( *hBinRenderer ); + free( *hBinRenderer ); *hBinRenderer = NULL; return; @@ -900,7 +900,7 @@ void ivas_binRenderer( int16_t chIdx, k; int16_t numTimeSlots = MAX_PARAM_SPATIAL_SUBFRAMES; - wmops_sub_start( "fastconv_binaural_rendering" ); + push_wmops( "fastconv_binaural_rendering" ); /* Compute Convolution */ /* memory reset for the binaural output */ @@ -978,7 +978,7 @@ void ivas_binRenderer( } } - wmops_sub_end(); + pop_wmops(); return; } diff --git a/lib_rend/ivas_binaural_reverb.c b/lib_rend/ivas_binaural_reverb.c index db12954a1e95ab01d1cf5dc42a78e2a32d78f252..061bbb61a6a317d2b1d0993b8a0534eedb17af78 100644 --- a/lib_rend/ivas_binaural_reverb.c +++ b/lib_rend/ivas_binaural_reverb.c @@ -40,7 +40,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /* The reverberator structure implemented here is described in detail in: @@ -384,7 +384,7 @@ ivas_error ivas_binaural_reverb_open( float t60[CLDFB_NO_CHANNELS_MAX]; float ene[CLDFB_NO_CHANNELS_MAX]; - if ( ( *hReverbPr = (REVERB_STRUCT_HANDLE) count_malloc( sizeof( REVERB_STRUCT ) ) ) == NULL ) + if ( ( *hReverbPr = (REVERB_STRUCT_HANDLE) malloc( sizeof( REVERB_STRUCT ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural Reverberator\n" ) ); } @@ -426,12 +426,12 @@ ivas_error ivas_binaural_reverb_open( hReverb->loopBufLengthMax[bin] = (int16_t) ( 500 / ( 1 + bin ) + ( CLDFB_NO_CHANNELS_MAX - bin ) ); len = hReverb->loopBufLengthMax[bin] + hReverb->blockSize; - if ( ( hReverb->loopBufReal[bin] = (float *) count_malloc( len * sizeof( float ) ) ) == NULL ) + if ( ( hReverb->loopBufReal[bin] = (float *) malloc( len * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural Reverberator\n" ) ); } - if ( ( hReverb->loopBufImag[bin] = (float *) count_malloc( len * sizeof( float ) ) ) == NULL ) + if ( ( hReverb->loopBufImag[bin] = (float *) malloc( len * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural Reverberator\n" ) ); } @@ -450,29 +450,29 @@ ivas_error ivas_binaural_reverb_open( { len = hReverb->loopBufLength[bin]; - if ( ( hReverb->tapPhaseShiftType[bin][chIdx] = (int16_t *) count_malloc( len * sizeof( int16_t ) ) ) == NULL ) + if ( ( hReverb->tapPhaseShiftType[bin][chIdx] = (int16_t *) malloc( len * sizeof( int16_t ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural Reverberator\n" ) ); } set_s( hReverb->tapPhaseShiftType[bin][chIdx], 0, len ); - if ( ( hReverb->tapPointersReal[bin][chIdx] = (float **) count_malloc( len * sizeof( float * ) ) ) == NULL ) + if ( ( hReverb->tapPointersReal[bin][chIdx] = (float **) malloc( len * sizeof( float * ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural Reverberator\n" ) ); } - if ( ( hReverb->tapPointersImag[bin][chIdx] = (float **) count_malloc( len * sizeof( float * ) ) ) == NULL ) + if ( ( hReverb->tapPointersImag[bin][chIdx] = (float **) malloc( len * sizeof( float * ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural Reverberator\n" ) ); } len = hReverb->blockSize; - if ( ( hReverb->outputBufferReal[bin][chIdx] = (float *) count_malloc( len * sizeof( float ) ) ) == NULL ) + if ( ( hReverb->outputBufferReal[bin][chIdx] = (float *) malloc( len * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural Reverberator\n" ) ); } - if ( ( hReverb->outputBufferImag[bin][chIdx] = (float *) count_malloc( len * sizeof( float ) ) ) == NULL ) + if ( ( hReverb->outputBufferImag[bin][chIdx] = (float *) malloc( len * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural Reverberator\n" ) ); } @@ -527,17 +527,17 @@ void ivas_binaural_reverb_close( { for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ ) { - count_free( ( *hReverb )->tapPhaseShiftType[bin][chIdx] ); - count_free( ( *hReverb )->tapPointersReal[bin][chIdx] ); - count_free( ( *hReverb )->tapPointersImag[bin][chIdx] ); - count_free( ( *hReverb )->outputBufferReal[bin][chIdx] ); - count_free( ( *hReverb )->outputBufferImag[bin][chIdx] ); + free( ( *hReverb )->tapPhaseShiftType[bin][chIdx] ); + free( ( *hReverb )->tapPointersReal[bin][chIdx] ); + free( ( *hReverb )->tapPointersImag[bin][chIdx] ); + free( ( *hReverb )->outputBufferReal[bin][chIdx] ); + free( ( *hReverb )->outputBufferImag[bin][chIdx] ); } - count_free( ( *hReverb )->loopBufReal[bin] ); - count_free( ( *hReverb )->loopBufImag[bin] ); + free( ( *hReverb )->loopBufReal[bin] ); + free( ( *hReverb )->loopBufImag[bin] ); } - count_free( ( *hReverb ) ); + free( ( *hReverb ) ); #ifdef BRATE_SWITCHING_RENDERING ( *hReverb ) = NULL; #endif diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index f63d729dc758990a14938286759ee1f09d77137e..41c60261f753027314b29e2450d7299b39f2c5e1 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -44,7 +44,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------- @@ -108,7 +108,7 @@ static ivas_error ivas_hrtf_open( if ( *hHrtf_out == NULL ) { - if ( ( hHrtf = (HRTFS_HANDLE) count_malloc( sizeof( HRTFS_DATA ) ) ) == NULL ) + if ( ( hHrtf = (HRTFS_HANDLE) malloc( sizeof( HRTFS_DATA ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for SPAR decoder\n" ); } @@ -141,7 +141,7 @@ static ivas_error ivas_hrtf_close( return IVAS_ERR_WRONG_PARAMS; } - count_free( *hHrtf ); + free( *hHrtf ); *hHrtf = NULL; return IVAS_ERR_OK; @@ -668,7 +668,7 @@ ivas_error ivas_crend_open( } } - if ( ( hCrend = (CREND_HANDLE) count_malloc( sizeof( CREND_DATA ) ) ) == NULL ) + if ( ( hCrend = (CREND_HANDLE) malloc( sizeof( CREND_DATA ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for renderer handle" ); } @@ -704,13 +704,13 @@ ivas_error ivas_crend_open( for ( i = 0; i < hHrtf->max_num_ir; i++ ) { - if ( ( hCrend->freq_buffer_re[i] = (float *) count_malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) + if ( ( hCrend->freq_buffer_re[i] = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } set_f( hCrend->freq_buffer_re[i], 0, max_total_ir_len ); - if ( ( hCrend->freq_buffer_im[i] = (float *) count_malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) + if ( ( hCrend->freq_buffer_im[i] = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } @@ -719,7 +719,7 @@ ivas_error ivas_crend_open( for ( i = 0; i < BINAURAL_CHANNELS; i++ ) { - if ( ( hCrend->prev_out_buffer[i] = (float *) count_malloc( sizeof( float ) * subframe_length ) ) == NULL ) + if ( ( hCrend->prev_out_buffer[i] = (float *) malloc( sizeof( float ) * subframe_length ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } @@ -730,13 +730,13 @@ ivas_error ivas_crend_open( if ( max_total_ir_len > 0 ) { - if ( ( hCrend->freq_buffer_re_diffuse = (float *) count_malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) + if ( ( hCrend->freq_buffer_re_diffuse = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } set_f( hCrend->freq_buffer_re_diffuse, 0, max_total_ir_len ); - if ( ( hCrend->freq_buffer_im_diffuse = (float *) count_malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) + if ( ( hCrend->freq_buffer_im_diffuse = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } @@ -751,7 +751,7 @@ ivas_error ivas_crend_open( max_total_ir_len = (int16_t) ( hHrtf->latency_s * st_ivas->hDecoderConfig->output_Fs + 0.5f ) + subframe_length; if ( max_total_ir_len > 0 ) { - if ( ( hCrend->lfe_delay_line = (float *) count_malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) + if ( ( hCrend->lfe_delay_line = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } @@ -764,7 +764,7 @@ ivas_error ivas_crend_open( if ( st_ivas->hDecoderConfig->Opt_Headrotation ) { - if ( ( hCrend->hTrack = (ivas_orient_trk_state_t *) count_malloc( sizeof( ivas_orient_trk_state_t ) ) ) == NULL ) + if ( ( hCrend->hTrack = (ivas_orient_trk_state_t *) malloc( sizeof( ivas_orient_trk_state_t ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Orientation tracking" ); } @@ -830,12 +830,12 @@ ivas_error ivas_crend_close( { if ( st_ivas->hCrend->freq_buffer_re[i] != NULL ) { - count_free( st_ivas->hCrend->freq_buffer_re[i] ); + free( st_ivas->hCrend->freq_buffer_re[i] ); st_ivas->hCrend->freq_buffer_re[i] = NULL; } if ( st_ivas->hCrend->freq_buffer_im[i] != NULL ) { - count_free( st_ivas->hCrend->freq_buffer_im[i] ); + free( st_ivas->hCrend->freq_buffer_im[i] ); st_ivas->hCrend->freq_buffer_im[i] = NULL; } } @@ -844,39 +844,39 @@ ivas_error ivas_crend_close( { if ( st_ivas->hCrend->prev_out_buffer[i] != NULL ) { - count_free( st_ivas->hCrend->prev_out_buffer[i] ); + free( st_ivas->hCrend->prev_out_buffer[i] ); st_ivas->hCrend->prev_out_buffer[i] = NULL; } } if ( st_ivas->hCrend->lfe_delay_line != NULL ) { - count_free( st_ivas->hCrend->lfe_delay_line ); + free( st_ivas->hCrend->lfe_delay_line ); st_ivas->hCrend->lfe_delay_line = NULL; } if ( st_ivas->hCrend->freq_buffer_re_diffuse != NULL ) { - count_free( st_ivas->hCrend->freq_buffer_re_diffuse ); + free( st_ivas->hCrend->freq_buffer_re_diffuse ); st_ivas->hCrend->freq_buffer_re_diffuse = NULL; } if ( st_ivas->hCrend->freq_buffer_im_diffuse != NULL ) { - count_free( st_ivas->hCrend->freq_buffer_im_diffuse ); + free( st_ivas->hCrend->freq_buffer_im_diffuse ); st_ivas->hCrend->freq_buffer_im_diffuse = NULL; } if ( st_ivas->hCrend->hTrack != NULL ) { - count_free( st_ivas->hCrend->hTrack ); + free( st_ivas->hCrend->hTrack ); st_ivas->hCrend->hTrack = NULL; } } ivas_reverb_close( &st_ivas->hCrend->hReverb ); - count_free( st_ivas->hCrend ); + free( st_ivas->hCrend ); st_ivas->hCrend = NULL; } @@ -1039,7 +1039,7 @@ ivas_error ivas_crend_process( AUDIO_CONFIG intern_config; ivas_error error; - wmops_sub_start( "ivas_crend_process" ); + push_wmops( "ivas_crend_process" ); intern_config = st_ivas->intern_config; nchan_out = st_ivas->hDecoderConfig->nchan_out; @@ -1117,7 +1117,7 @@ ivas_error ivas_crend_process( mvr2r( pcm_tmp[i], output[i], output_frame ); } - wmops_sub_end(); + pop_wmops(); return IVAS_ERR_OK; } @@ -1154,7 +1154,7 @@ ivas_error ivas_rend_openCrend( } } - if ( ( hCrend = (CREND_HANDLE) count_malloc( sizeof( CREND_DATA ) ) ) == NULL ) + if ( ( hCrend = (CREND_HANDLE) malloc( sizeof( CREND_DATA ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for renderer handle" ); } @@ -1190,13 +1190,13 @@ ivas_error ivas_rend_openCrend( for ( i = 0; i < hHrtf->max_num_ir; i++ ) { - if ( ( hCrend->freq_buffer_re[i] = (float *) count_malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) + if ( ( hCrend->freq_buffer_re[i] = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } set_zero( hCrend->freq_buffer_re[i], max_total_ir_len ); - if ( ( hCrend->freq_buffer_im[i] = (float *) count_malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) + if ( ( hCrend->freq_buffer_im[i] = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } @@ -1205,7 +1205,7 @@ ivas_error ivas_rend_openCrend( for ( i = 0; i < BINAURAL_CHANNELS; i++ ) { - if ( ( hCrend->prev_out_buffer[i] = (float *) count_malloc( sizeof( float ) * subframe_length ) ) == NULL ) + if ( ( hCrend->prev_out_buffer[i] = (float *) malloc( sizeof( float ) * subframe_length ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } @@ -1216,13 +1216,13 @@ ivas_error ivas_rend_openCrend( if ( max_total_ir_len > 0 ) { - if ( ( hCrend->freq_buffer_re_diffuse = (float *) count_malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) + if ( ( hCrend->freq_buffer_re_diffuse = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } set_zero( hCrend->freq_buffer_re_diffuse, max_total_ir_len ); - if ( ( hCrend->freq_buffer_im_diffuse = (float *) count_malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) + if ( ( hCrend->freq_buffer_im_diffuse = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } @@ -1237,7 +1237,7 @@ ivas_error ivas_rend_openCrend( max_total_ir_len = (int16_t) ( hHrtf->latency_s * output_Fs + 0.5f ) + subframe_length; if ( max_total_ir_len > 0 ) { - if ( ( hCrend->lfe_delay_line = (float *) count_malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) + if ( ( hCrend->lfe_delay_line = (float *) malloc( sizeof( float ) * max_total_ir_len ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend" ); } @@ -1250,7 +1250,7 @@ ivas_error ivas_rend_openCrend( if ( false ) /* TODO tmu : check renderer headrotation flag */ { - if ( ( hCrend->hTrack = (ivas_orient_trk_state_t *) count_malloc( sizeof( ivas_orient_trk_state_t ) ) ) == NULL ) + if ( ( hCrend->hTrack = (ivas_orient_trk_state_t *) malloc( sizeof( ivas_orient_trk_state_t ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Orientation tracking" ); } @@ -1695,12 +1695,12 @@ ivas_error ivas_rend_closeCrend( { if ( pCrend->hCrend->freq_buffer_re[i] != NULL ) { - count_free( pCrend->hCrend->freq_buffer_re[i] ); + free( pCrend->hCrend->freq_buffer_re[i] ); pCrend->hCrend->freq_buffer_re[i] = NULL; } if ( pCrend->hCrend->freq_buffer_im[i] != NULL ) { - count_free( pCrend->hCrend->freq_buffer_im[i] ); + free( pCrend->hCrend->freq_buffer_im[i] ); pCrend->hCrend->freq_buffer_im[i] = NULL; } } @@ -1709,38 +1709,38 @@ ivas_error ivas_rend_closeCrend( { if ( pCrend->hCrend->prev_out_buffer[i] != NULL ) { - count_free( pCrend->hCrend->prev_out_buffer[i] ); + free( pCrend->hCrend->prev_out_buffer[i] ); pCrend->hCrend->prev_out_buffer[i] = NULL; } } if ( pCrend->hCrend->lfe_delay_line != NULL ) { - count_free( pCrend->hCrend->lfe_delay_line ); + free( pCrend->hCrend->lfe_delay_line ); pCrend->hCrend->lfe_delay_line = NULL; } if ( pCrend->hCrend->freq_buffer_re_diffuse != NULL ) { - count_free( pCrend->hCrend->freq_buffer_re_diffuse ); + free( pCrend->hCrend->freq_buffer_re_diffuse ); pCrend->hCrend->freq_buffer_re_diffuse = NULL; } if ( pCrend->hCrend->freq_buffer_im_diffuse != NULL ) { - count_free( pCrend->hCrend->freq_buffer_im_diffuse ); + free( pCrend->hCrend->freq_buffer_im_diffuse ); pCrend->hCrend->freq_buffer_im_diffuse = NULL; } if ( pCrend->hCrend->hTrack != NULL ) { - count_free( pCrend->hCrend->hTrack ); + free( pCrend->hCrend->hTrack ); pCrend->hCrend->hTrack = NULL; } ivas_reverb_close( &pCrend->hCrend->hReverb ); - count_free( pCrend->hCrend ); + free( pCrend->hCrend ); pCrend->hCrend = NULL; } @@ -1767,7 +1767,7 @@ ivas_error ivas_rend_crendProcess( IVAS_REND_AudioConfigType inConfigType; ivas_error error; - wmops_sub_start( "ivas_rend_crendProcess" ); + push_wmops( "ivas_rend_crendProcess" ); in_config = getIvasAudioConfigFromRendAudioConfig( inConfig ); inConfigType = getAudioConfigType( inConfig ); @@ -1803,7 +1803,7 @@ ivas_error ivas_rend_crendProcess( mvr2r( pcm_tmp[i], output[i], output_frame ); } - wmops_sub_end(); + pop_wmops(); return IVAS_ERR_OK; } diff --git a/lib_rend/ivas_efap.c b/lib_rend/ivas_efap.c index 48bfd7b8a0e82333cc4edb4891a09c4b5e0517df..d3412c8873fc5a6ad23acca7a30bc60b75d4c998 100644 --- a/lib_rend/ivas_efap.c +++ b/lib_rend/ivas_efap.c @@ -42,7 +42,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------------* * Local constants @@ -163,29 +163,29 @@ ivas_error efap_init_data( *-----------------------------------------------------------------*/ /* Memory Allocations for efap */ - if ( ( efap = (EFAP *) count_malloc( sizeof( EFAP ) ) ) == NULL ) + if ( ( efap = (EFAP *) malloc( sizeof( EFAP ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for EFAP handle\n" ) ); } /* Memory Allocation and update for aziSpk & eleSpk arrays*/ - if ( ( efap->aziSpk = (float *) count_malloc( num_speaker_nodes * sizeof( float ) ) ) == NULL ) + if ( ( efap->aziSpk = (float *) malloc( num_speaker_nodes * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for EFAP speaker azimuths\n" ) ); } - if ( ( efap->eleSpk = (float *) count_malloc( num_speaker_nodes * sizeof( float ) ) ) == NULL ) + if ( ( efap->eleSpk = (float *) malloc( num_speaker_nodes * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for EFAP speaker elevations\n" ) ); } /* Memory Allocation for vertexArray */ - if ( ( efap->vtxData.vertexArray = (EFAP_VERTEX *) count_malloc( ( num_speaker_nodes + EFAP_MAX_GHOST_LS ) * sizeof( EFAP_VERTEX ) ) ) == NULL ) + if ( ( efap->vtxData.vertexArray = (EFAP_VERTEX *) malloc( ( num_speaker_nodes + EFAP_MAX_GHOST_LS ) * sizeof( EFAP_VERTEX ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for EFAP Vertex Array\n" ) ); } /* Memory allocation for the tmp buffer short */ - if ( ( efap->bufferShort = (float *) count_malloc( num_speaker_nodes * sizeof( float ) ) ) == NULL ) + if ( ( efap->bufferShort = (float *) malloc( num_speaker_nodes * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for EFAP bufferS\n" ) ); } @@ -214,7 +214,7 @@ ivas_error efap_init_data( /* Memory allocation for the tmp buffer long */ - if ( ( efap->bufferLong = (float *) count_malloc( efap->vtxData.numVtx * sizeof( float ) ) ) == NULL ) + if ( ( efap->bufferLong = (float *) malloc( efap->vtxData.numVtx * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for EFAP bufferL\n" ) ); } @@ -322,33 +322,33 @@ void efap_free_data( dim1 = ( *hEFAPdata )->numTot; /* instance buffer members */ - count_free( ( *hEFAPdata )->aziSpk ); + free( ( *hEFAPdata )->aziSpk ); ( *hEFAPdata )->aziSpk = NULL; - count_free( ( *hEFAPdata )->eleSpk ); + free( ( *hEFAPdata )->eleSpk ); ( *hEFAPdata )->eleSpk = NULL; - count_free( ( *hEFAPdata )->vtxData.vertexArray ); + free( ( *hEFAPdata )->vtxData.vertexArray ); ( *hEFAPdata )->vtxData.vertexArray = NULL; - count_free( ( *hEFAPdata )->vtxData.vtxOrder ); + free( ( *hEFAPdata )->vtxData.vtxOrder ); ( *hEFAPdata )->vtxData.vtxOrder = NULL; - count_free( ( *hEFAPdata )->bufferLong ); + free( ( *hEFAPdata )->bufferLong ); ( *hEFAPdata )->bufferLong = NULL; - count_free( ( *hEFAPdata )->bufferShort ); + free( ( *hEFAPdata )->bufferShort ); ( *hEFAPdata )->bufferShort = NULL; p_dmTranspose = (void **) ( *hEFAPdata )->dmTranspose; for ( i = 0; i < dim1; i++ ) { - count_free( p_dmTranspose[i] ); + free( p_dmTranspose[i] ); } - count_free( p_dmTranspose ); + free( p_dmTranspose ); /* instance */ - count_free( *hEFAPdata ); + free( *hEFAPdata ); *hEFAPdata = NULL; return; @@ -533,7 +533,7 @@ static ivas_error sphere_triangulation( add_ghost_speakers( vtxData->vertexArray, &vtxData->numVtx, efip_flag ); /* Sort the vertices according to their index */ - if ( ( vtxData->vtxOrder = (int16_t *) count_malloc( vtxData->numVtx * sizeof( int16_t ) ) ) == NULL ) + if ( ( vtxData->vtxOrder = (int16_t *) malloc( vtxData->numVtx * sizeof( int16_t ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for EFAP Vertex Order\n" ) ); } @@ -552,7 +552,7 @@ static ivas_error sphere_triangulation( assert( polyData->numTri != 0 && "EFAP: failed to construct convex hull!" ); /* Allocate the DM matrix transpose */ - if ( ( p_dmTranspose = count_malloc( vtxData->numVtx * sizeof( float * ) ) ) == NULL ) + if ( ( p_dmTranspose = malloc( vtxData->numVtx * sizeof( float * ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "EFAP: can not allocate memory for dmTranspose\n" ) ); } @@ -562,7 +562,7 @@ static ivas_error sphere_triangulation( for ( i = 0; i < vtxData->numVtx; i++ ) { - if ( ( p_dmTranspose[i] = count_malloc( numSpk * sizeof( float ) ) ) == NULL ) + if ( ( p_dmTranspose[i] = malloc( numSpk * sizeof( float ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "EFAP: can not allocate memory for dmTranspose\n" ) ); } diff --git a/lib_rend/ivas_hrtf.c b/lib_rend/ivas_hrtf.c index 7c4183b0e8cb0bb0db50bdee7b46fd9558ed6b80..347a060e9800e093e27a91f7d709922d5ca0e9c9 100644 --- a/lib_rend/ivas_hrtf.c +++ b/lib_rend/ivas_hrtf.c @@ -39,7 +39,7 @@ #include "assert.h" #include "ivas_rom_TdBinauralRenderer.h" #include "ivas_error.h" -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------* @@ -61,8 +61,8 @@ void BSplineModelEvalAlloc( ModelEval_t *modelEval /* i/o: Model evaluation structure */ ) { - modelEval->hrfModL = (float *) count_malloc( model->K * sizeof( float ) ); - modelEval->hrfModR = (float *) count_malloc( model->K * sizeof( float ) ); + modelEval->hrfModL = (float *) malloc( model->K * sizeof( float ) ); + modelEval->hrfModR = (float *) malloc( model->K * sizeof( float ) ); return; } @@ -118,11 +118,11 @@ void DefaultBSplineModel( model->elevKSeq = (const float *) orange53_rom_elevKSeq; model->elevBsShape = (const float *) orange53_rom_elevBsShape; - model->azimBsShape = (const float **) count_malloc( model->num_unique_azim_splines * sizeof( float * ) ); + model->azimBsShape = (const float **) malloc( model->num_unique_azim_splines * sizeof( float * ) ); model->azimBsShape[0] = (const float *) orange53_rom_azimBsShape; - model->azimKSeq = (float **) count_malloc( 18 * sizeof( float * ) ); - model->azimKSeq[0] = (float *) count_malloc( 2 * sizeof( float * ) ); - model->azimKSeq[17] = (float *) count_malloc( 2 * sizeof( float * ) ); + model->azimKSeq = (float **) malloc( 18 * sizeof( float * ) ); + model->azimKSeq[0] = (float *) malloc( 2 * sizeof( float * ) ); + model->azimKSeq[17] = (float *) malloc( 2 * sizeof( float * ) ); model->azimKSeq[0][0] = 0.0f; model->azimKSeq[17][0] = 0.0f; model->azimKSeq[0][1] = 360.0f; @@ -130,7 +130,7 @@ void DefaultBSplineModel( for ( i = 1; i < 17; i++ ) { - model->azimKSeq[i] = (float *) count_malloc( model->azimDim2[i] * sizeof( float * ) ); /* azimDim2[i] = 91, i=2..15 */ + model->azimKSeq[i] = (float *) malloc( model->azimDim2[i] * sizeof( float * ) ); /* azimDim2[i] = 91, i=2..15 */ for ( j = 0; j < model->azimDim2[i]; j++ ) { model->azimKSeq[i][j] = (float) orange53_rom_azimSegSamples[0] * j; @@ -229,7 +229,7 @@ ivas_error ivas_HRTF_binary_open( TDREND_HRFILT_FiltSet_t **hHrtfTD ) { /* Allocate HR filter set for headphones configuration */ - *hHrtfTD = (TDREND_HRFILT_FiltSet_t *) count_malloc( sizeof( TDREND_HRFILT_FiltSet_t ) ); + *hHrtfTD = (TDREND_HRFILT_FiltSet_t *) malloc( sizeof( TDREND_HRFILT_FiltSet_t ) ); if ( *hHrtfTD == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HRTF binary!" ); @@ -253,7 +253,7 @@ void ivas_HRTF_binary_close( return; } - count_free( *hHrtfTD ); + free( *hHrtfTD ); *hHrtfTD = NULL; return; diff --git a/lib_rend/ivas_limiter.c b/lib_rend/ivas_limiter.c index 56dbb39b070e5e54dbf319fda57532e9c97e53a2..cddd561c3e330d1644228cc1b58a316a4f90f6e7 100644 --- a/lib_rend/ivas_limiter.c +++ b/lib_rend/ivas_limiter.c @@ -36,7 +36,7 @@ #include "ivas_prot.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" #include @@ -115,11 +115,11 @@ IVAS_LIMITER_HANDLE ivas_limiter_open( return NULL; } - hLimiter = count_malloc( sizeof( IVAS_LIMITER ) ); + hLimiter = malloc( sizeof( IVAS_LIMITER ) ); hLimiter->max_num_channels = max_num_channels; hLimiter->num_channels = max_num_channels; - hLimiter->channel_ptrs = count_malloc( max_num_channels * sizeof( float * ) ); + hLimiter->channel_ptrs = malloc( max_num_channels * sizeof( float * ) ); hLimiter->sampling_rate = sampling_rate; hLimiter->gain = 1.f; hLimiter->release_heuristic = 0.f; @@ -153,8 +153,8 @@ void ivas_limiter_close( return; } - count_free( ( *phLimiter )->channel_ptrs ); - count_free( *phLimiter ); + free( ( *phLimiter )->channel_ptrs ); + free( *phLimiter ); *phLimiter = NULL; return; diff --git a/lib_rend/ivas_ls_custom_dec.c b/lib_rend/ivas_ls_custom_dec.c index 28bd8c1dd81ff1c7ccb89117c794349f59f16ed2..7a0d9f149df8dc6a6a4a8df750b9623e833e7a8e 100644 --- a/lib_rend/ivas_ls_custom_dec.c +++ b/lib_rend/ivas_ls_custom_dec.c @@ -37,7 +37,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------------* @@ -51,7 +51,7 @@ ivas_error ivas_ls_custom_open( ) { /* Allocate handle */ - if ( ( *hLsSetupCustom = (LSSETUP_CUSTOM_HANDLE) count_malloc( sizeof( LSSETUP_CUSTOM_STRUCT ) ) ) == NULL ) + if ( ( *hLsSetupCustom = (LSSETUP_CUSTOM_HANDLE) malloc( sizeof( LSSETUP_CUSTOM_STRUCT ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Custom LS layout memory\n" ) ); } diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index 9fc512e639c8cf63a06db3451c9581c06501842c..3aad7fe5a0e9fe28cfc8285d58970e6f1fdff797 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -35,7 +35,7 @@ #include "prot.h" #include "ivas_prot.h" #include -#include "wmops.h" +#include "wmc_auto.h" #include "ivas_rom_com.h" #include "lib_rend.h" #include "ivas_lib_rend_internal.h" @@ -84,19 +84,19 @@ ivas_error ivas_td_binaural_open( error = IVAS_ERR_OK; - if ( ( hBinRendererTd = count_malloc( sizeof( BINAURAL_TD_OBJECT_RENDERER ) ) ) == NULL ) + if ( ( hBinRendererTd = malloc( sizeof( BINAURAL_TD_OBJECT_RENDERER ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TD renderer\n" ) ); } - if ( ( hBinRendererTd->TdRend_MixSpatSpec_p = count_malloc( sizeof( TDREND_MixSpatSpec_t ) ) ) == NULL ) + if ( ( hBinRendererTd->TdRend_MixSpatSpec_p = malloc( sizeof( TDREND_MixSpatSpec_t ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TD renderer\n" ) ); } - if ( ( hBinRendererTd->DirAtten_p = count_malloc( sizeof( TDREND_DirAtten_t ) ) ) == NULL ) + if ( ( hBinRendererTd->DirAtten_p = malloc( sizeof( TDREND_DirAtten_t ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TD renderer\n" ) ); } - if ( ( hBinRendererTd->Listener_p = count_malloc( sizeof( TDREND_MIX_Listener_t ) ) ) == NULL ) + if ( ( hBinRendererTd->Listener_p = malloc( sizeof( TDREND_MIX_Listener_t ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TD renderer\n" ) ); } @@ -210,12 +210,12 @@ void ivas_td_binaural_close( return; } - count_free( ( *hBinRendererTd )->TdRend_MixSpatSpec_p ); - count_free( ( *hBinRendererTd )->DirAtten_p ); + free( ( *hBinRendererTd )->TdRend_MixSpatSpec_p ); + free( ( *hBinRendererTd )->DirAtten_p ); TDREND_MIX_Dealloc( *hBinRendererTd ); - count_free( *hBinRendererTd ); + free( *hBinRendererTd ); *hBinRendererTd = NULL; return; @@ -510,19 +510,19 @@ ivas_error ivas_rend_TDObjRendOpen( error = IVAS_ERR_OK; - if ( ( hBinRendererTd = count_malloc( sizeof( BINAURAL_TD_OBJECT_RENDERER ) ) ) == NULL ) + if ( ( hBinRendererTd = malloc( sizeof( BINAURAL_TD_OBJECT_RENDERER ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TD renderer\n" ) ); } - if ( ( hBinRendererTd->TdRend_MixSpatSpec_p = count_malloc( sizeof( TDREND_MixSpatSpec_t ) ) ) == NULL ) + if ( ( hBinRendererTd->TdRend_MixSpatSpec_p = malloc( sizeof( TDREND_MixSpatSpec_t ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TD renderer\n" ) ); } - if ( ( hBinRendererTd->DirAtten_p = count_malloc( sizeof( TDREND_DirAtten_t ) ) ) == NULL ) + if ( ( hBinRendererTd->DirAtten_p = malloc( sizeof( TDREND_DirAtten_t ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TD renderer\n" ) ); } - if ( ( hBinRendererTd->Listener_p = count_malloc( sizeof( TDREND_MIX_Listener_t ) ) ) == NULL ) + if ( ( hBinRendererTd->Listener_p = malloc( sizeof( TDREND_MIX_Listener_t ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for TD renderer\n" ) ); } @@ -655,7 +655,7 @@ ivas_error ivas_rend_TDObjRenderFrame( IVAS_FORMAT ivas_format; IVAS_REND_AudioConfigType inConfigType; - wmops_sub_start( "ivas_rend_TDObjRenderFrame" ); + push_wmops( "ivas_rend_TDObjRenderFrame" ); inConfigType = getAudioConfigType( inConfig ); lfe_idx = LFE_CHANNEL; @@ -676,7 +676,7 @@ ivas_error ivas_rend_TDObjRenderFrame( { ivas_format = ISM_FORMAT; num_src = 1; - hIsmMetaData[0] = count_malloc( sizeof( ISM_METADATA_FRAME ) ); + hIsmMetaData[0] = malloc( sizeof( ISM_METADATA_FRAME ) ); hIsmMetaData[0]->azimuth = currentPos->azimuth; hIsmMetaData[0]->elevation = currentPos->elevation; } @@ -698,7 +698,7 @@ ivas_error ivas_rend_TDObjRenderFrame( /* TODO tmu : needs a refactor / better approach */ if ( ivas_format == ISM_FORMAT ) { - count_free( hIsmMetaData[0] ); + free( hIsmMetaData[0] ); } for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ ) @@ -727,7 +727,7 @@ ivas_error ivas_rend_TDObjRenderFrame( // } // } - wmops_sub_end(); + pop_wmops(); return IVAS_ERR_OK; } diff --git a/lib_rend/ivas_objectRenderer_hrFilt.c b/lib_rend/ivas_objectRenderer_hrFilt.c index 9230ad3dc8d7a4b2f7c8532217a194eadfc3a2c0..ebb9cf19ef7091bcf703d1b739e33757b714d244 100644 --- a/lib_rend/ivas_objectRenderer_hrFilt.c +++ b/lib_rend/ivas_objectRenderer_hrFilt.c @@ -39,7 +39,7 @@ #include "ivas_rom_rend.h" #include "ivas_cnst.h" #include "ivas_rom_TdBinauralRenderer.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* @@ -132,8 +132,8 @@ void TDREND_HRFILT_SetFiltSet( HrFiltSet_p->NumElev = (int16_t) temp; /* Elevation angles */ - HrFiltSet_p->Elev_p = (float *) count_malloc( HrFiltSet_p->NumElev * sizeof( float ) ); - buffer_p = (double *) count_malloc( HrFiltSet_p->NumElev * sizeof( double ) ); + HrFiltSet_p->Elev_p = (float *) malloc( HrFiltSet_p->NumElev * sizeof( float ) ); + buffer_p = (double *) malloc( HrFiltSet_p->NumElev * sizeof( double ) ); num_to_read = HrFiltSet_p->NumElev; fread( (void *) buffer_p, num_bytes, num_to_read, f_hrtf ); temp_p = buffer_p; @@ -149,20 +149,20 @@ void TDREND_HRFILT_SetFiltSet( assert( 0 && "Error: HR Filter elevation values had irregular spacing." ); } } - count_free( buffer_p ); + free( buffer_p ); /* Number of azimuth values, one per elevation */ - HrFiltSet_p->NumAzim_p = (int16_t *) count_malloc( HrFiltSet_p->NumElev * sizeof( int16_t ) ); - buffer_p = (double *) count_malloc( HrFiltSet_p->NumElev * sizeof( double ) ); + HrFiltSet_p->NumAzim_p = (int16_t *) malloc( HrFiltSet_p->NumElev * sizeof( int16_t ) ); + buffer_p = (double *) malloc( HrFiltSet_p->NumElev * sizeof( double ) ); fread( (void *) buffer_p, num_bytes, HrFiltSet_p->NumElev, f_hrtf ); for ( n = 0; n < HrFiltSet_p->NumElev; n++ ) { HrFiltSet_p->NumAzim_p[n] = (int16_t) buffer_p[n]; } - count_free( buffer_p ); + free( buffer_p ); /* Indices to the first azimuth value, one per elevation */ - HrFiltSet_p->AzimStartIdx_p = (int16_t *) count_malloc( HrFiltSet_p->NumElev * sizeof( int16_t ) ); + HrFiltSet_p->AzimStartIdx_p = (int16_t *) malloc( HrFiltSet_p->NumElev * sizeof( int16_t ) ); count = 0; for ( n = 0; n < HrFiltSet_p->NumElev; n++ ) { @@ -178,9 +178,9 @@ void TDREND_HRFILT_SetFiltSet( } /* Azimuth values, one set per elevation, i.e. one per measurement point */ - HrFiltSet_p->Azim_p = (float *) count_malloc( HrFiltSet_p->NumPos * sizeof( float ) ); - buffer_p = (double *) count_malloc( HrFiltSet_p->NumPos * sizeof( double ) ); - HrFiltSet_p->ElevFull_p = (float *) count_malloc( HrFiltSet_p->NumPos * sizeof( float ) ); + HrFiltSet_p->Azim_p = (float *) malloc( HrFiltSet_p->NumPos * sizeof( float ) ); + buffer_p = (double *) malloc( HrFiltSet_p->NumPos * sizeof( double ) ); + HrFiltSet_p->ElevFull_p = (float *) malloc( HrFiltSet_p->NumPos * sizeof( float ) ); fread( (void *) buffer_p, num_bytes, HrFiltSet_p->NumPos, f_hrtf ); i = 0; for ( n = 0; n < HrFiltSet_p->NumElev; n++ ) @@ -197,7 +197,7 @@ void TDREND_HRFILT_SetFiltSet( i++; } } - count_free( buffer_p ); + free( buffer_p ); } if ( HrFiltSet_p->FilterMethod == TDREND_HRFILT_Method_Table_S ) { @@ -206,8 +206,8 @@ void TDREND_HRFILT_SetFiltSet( HrFiltSet_p->NumElev = (int16_t) temp; /* Elevation angles */ - HrFiltSet_p->Elev_p = (float *) count_malloc( HrFiltSet_p->NumElev * sizeof( float ) ); - buffer_p = (double *) count_malloc( HrFiltSet_p->NumElev * sizeof( double ) ); + HrFiltSet_p->Elev_p = (float *) malloc( HrFiltSet_p->NumElev * sizeof( float ) ); + buffer_p = (double *) malloc( HrFiltSet_p->NumElev * sizeof( double ) ); num_to_read = HrFiltSet_p->NumElev; fread( (void *) buffer_p, num_bytes, num_to_read, f_hrtf ); temp_p = buffer_p; @@ -215,20 +215,20 @@ void TDREND_HRFILT_SetFiltSet( { HrFiltSet_p->Elev_p[n] = (float) *temp_p++; } - count_free( buffer_p ); + free( buffer_p ); /* Number of azimuth values, one per elevation */ - HrFiltSet_p->NumAzim_p = (int16_t *) count_malloc( HrFiltSet_p->NumElev * sizeof( int16_t ) ); - buffer_p = (double *) count_malloc( HrFiltSet_p->NumElev * sizeof( double ) ); + HrFiltSet_p->NumAzim_p = (int16_t *) malloc( HrFiltSet_p->NumElev * sizeof( int16_t ) ); + buffer_p = (double *) malloc( HrFiltSet_p->NumElev * sizeof( double ) ); fread( (void *) buffer_p, num_bytes, HrFiltSet_p->NumElev, f_hrtf ); for ( n = 0; n < HrFiltSet_p->NumElev; n++ ) { HrFiltSet_p->NumAzim_p[n] = (int16_t) buffer_p[n]; } - count_free( buffer_p ); + free( buffer_p ); /* Indices to the first azimuth value, one per elevation */ - HrFiltSet_p->AzimStartIdx_p = (int16_t *) count_malloc( HrFiltSet_p->NumElev * sizeof( int16_t ) ); + HrFiltSet_p->AzimStartIdx_p = (int16_t *) malloc( HrFiltSet_p->NumElev * sizeof( int16_t ) ); count = 0; for ( n = 0; n < HrFiltSet_p->NumElev; n++ ) { @@ -244,9 +244,9 @@ void TDREND_HRFILT_SetFiltSet( } /* Azimuth values, one set per elevation, i.e. one per measurement point */ - HrFiltSet_p->Azim_p = (float *) count_malloc( HrFiltSet_p->NumPos * sizeof( float ) ); - buffer_p = (double *) count_malloc( HrFiltSet_p->NumPos * sizeof( double ) ); - HrFiltSet_p->ElevFull_p = (float *) count_malloc( HrFiltSet_p->NumPos * sizeof( float ) ); + HrFiltSet_p->Azim_p = (float *) malloc( HrFiltSet_p->NumPos * sizeof( float ) ); + buffer_p = (double *) malloc( HrFiltSet_p->NumPos * sizeof( double ) ); + HrFiltSet_p->ElevFull_p = (float *) malloc( HrFiltSet_p->NumPos * sizeof( float ) ); fread( (void *) buffer_p, num_bytes, HrFiltSet_p->NumPos, f_hrtf ); i = 0; for ( n = 0; n < HrFiltSet_p->NumElev; n++ ) @@ -263,14 +263,14 @@ void TDREND_HRFILT_SetFiltSet( i++; } } - count_free( buffer_p ); + free( buffer_p ); } /* allocate memory to LeftFilt and RightFilt */ mem_size = ( HrFiltSet_p->NumPos * HrFiltSet_p->FiltLength * sizeof( double ) ); - FiltSetIntRight_p = (double *) count_malloc( mem_size ); - FiltSetIntLeft_p = (double *) count_malloc( mem_size ); + FiltSetIntRight_p = (double *) malloc( mem_size ); + FiltSetIntLeft_p = (double *) malloc( mem_size ); RightFilt_p = FiltSetIntRight_p; LeftFilt_p = FiltSetIntLeft_p; @@ -301,8 +301,8 @@ void TDREND_HRFILT_SetFiltSet( /* Copy, and reverse the filter sets */ mem_size = ( HrFiltSet_p->NumPos * HrFiltSet_p->FiltLength * sizeof( float ) ); - RightFiltFlp_p = (float *) count_malloc( mem_size ); - LeftFiltFlp_p = (float *) count_malloc( mem_size ); + RightFiltFlp_p = (float *) malloc( mem_size ); + LeftFiltFlp_p = (float *) malloc( mem_size ); HrFiltSet_p->RightFiltSet_p = RightFiltFlp_p; HrFiltSet_p->LeftFiltSet_p = LeftFiltFlp_p; @@ -328,8 +328,8 @@ void TDREND_HRFILT_SetFiltSet( FiltIntLeft0_p += HrFiltSet_p->FiltLength; } - count_free( FiltSetIntLeft_p ); - count_free( FiltSetIntRight_p ); + free( FiltSetIntLeft_p ); + free( FiltSetIntRight_p ); return; } @@ -1092,8 +1092,8 @@ void HRTF_model_precalc( AlphaN = model->AlphaN; /* Precalculated energies for each section and each row of the alpha matrices */ - model->EL_dyn = (float *) count_malloc( HRTF_MODEL_N_SECTIONS * AlphaN * sizeof( float ) ); - model->ER_dyn = (float *) count_malloc( HRTF_MODEL_N_SECTIONS * AlphaN * sizeof( float ) ); + model->EL_dyn = (float *) malloc( HRTF_MODEL_N_SECTIONS * AlphaN * sizeof( float ) ); + model->ER_dyn = (float *) malloc( HRTF_MODEL_N_SECTIONS * AlphaN * sizeof( float ) ); pEL = model->EL_dyn; pER = model->ER_dyn; for ( i = 0; i < HRTF_MODEL_N_SECTIONS; i++ ) @@ -1127,7 +1127,6 @@ void HRTF_model_precalc( return; } - /*-------------------------------------------------------------------* * BSplineModelEvalDealloc() * @@ -1142,40 +1141,42 @@ void BSplineModelEvalDealloc( /* Allocated in LoadBSplineBinary() */ int16_t i; +#define WMC_TOOL_SKIP if ( !model->modelROM ) { - count_free( model->elevKSeq_dyn ); - count_free( model->azim_start_idx_dyn ); - count_free( model->azimDim2_dyn ); - count_free( model->azimDim3_dyn ); - count_free( model->AlphaL_dyn ); - count_free( model->AlphaR_dyn ); - count_free( model->azimSegSamples_dyn ); + free( model->elevKSeq_dyn ); + free( model->azim_start_idx_dyn ); + free( model->azimDim2_dyn ); + free( model->azimDim3_dyn ); + free( model->AlphaL_dyn ); + free( model->AlphaR_dyn ); + free( model->azimSegSamples_dyn ); - count_free( model->azimShapeIdx_dyn ); - count_free( model->azimShapeSampFactor_dyn ); - count_free( model->elevBsShape_dyn ); + free( model->azimShapeIdx_dyn ); + free( model->azimShapeSampFactor_dyn ); + free( model->elevBsShape_dyn ); - count_free( model->EL_dyn ); - count_free( model->ER_dyn ); + free( model->EL_dyn ); + free( model->ER_dyn ); for ( i = 0; i < model->num_unique_azim_splines; i++ ) { - count_free( model->azimBsShape_dyn[i] ); + free( model->azimBsShape_dyn[i] ); } - count_free( model->azimBsShape_dyn ); + free( model->azimBsShape_dyn ); } - count_free( (void *) model->azimBsShape ); /* void* cast needed to please both gcc and Visual studio compilers. Deallocating const float** should be fine and gcc agrees, but Visual studio complains. */ + free( (void *) model->azimBsShape ); /* void* cast needed to please both gcc and Visual studio compilers. Deallocating const float** should be fine and gcc agrees, but Visual studio complains. */ for ( i = 0; i < model->elevDim3; i++ ) { - count_free( model->azimKSeq[i] ); + free( model->azimKSeq[i] ); } - count_free( model->azimKSeq ); + free( model->azimKSeq ); if ( modelEval != NULL ) { - count_free( modelEval->hrfModL ); - count_free( modelEval->hrfModR ); + free( modelEval->hrfModL ); + free( modelEval->hrfModR ); } +#undef WMC_TOOL_SKIP return; } @@ -1191,11 +1192,13 @@ void BSplineModelEvalITDDealloc( ModelParamsITD_t *model /* i : Model parameters */ ) { - count_free( model->elevKSeq_dyn ); - count_free( model->azimKSeq_dyn ); - count_free( model->W_dyn ); - count_free( model->azimBsShape_dyn ); - count_free( model->elevBsShape_dyn ); +#define WMC_TOOL_SKIP + free( model->elevKSeq_dyn ); + free( model->azimKSeq_dyn ); + free( model->W_dyn ); + free( model->azimBsShape_dyn ); + free( model->elevBsShape_dyn ); +#undef WMC_TOOL_SKIP return; } diff --git a/lib_rend/ivas_objectRenderer_mix.c b/lib_rend/ivas_objectRenderer_mix.c index 670c4378dfb1fc1380f6d24369bb8d447c0c6895..6fa5270304acc9db20ffb2e93d03e6924069cbd7 100644 --- a/lib_rend/ivas_objectRenderer_mix.c +++ b/lib_rend/ivas_objectRenderer_mix.c @@ -34,7 +34,7 @@ #include "options.h" #include "prot.h" #include "ivas_prot.h" -#include "wmops.h" +#include "wmc_auto.h" #ifdef DEBUGGING #include "debug.h" #endif @@ -122,7 +122,7 @@ void TDREND_MIX_Dealloc( /* Deallocate Listener and RendListener */ if ( hBinRendererTd->Listener_p != NULL ) { - count_free( hBinRendererTd->Listener_p ); + free( hBinRendererTd->Listener_p ); hBinRendererTd->Listener_p = NULL; } /* Dealloc HR filter set */ @@ -140,44 +140,44 @@ void TDREND_MIX_Dealloc( { if ( hBinRendererTd->HrFiltSet_p->Elev_p != NULL ) { - count_free( hBinRendererTd->HrFiltSet_p->Elev_p ); + free( hBinRendererTd->HrFiltSet_p->Elev_p ); hBinRendererTd->HrFiltSet_p->Elev_p = NULL; } if ( hBinRendererTd->HrFiltSet_p->Azim_p != NULL ) { - count_free( hBinRendererTd->HrFiltSet_p->Azim_p ); + free( hBinRendererTd->HrFiltSet_p->Azim_p ); hBinRendererTd->HrFiltSet_p->Azim_p = NULL; } if ( hBinRendererTd->HrFiltSet_p->LeftFiltSet_p != NULL ) { - count_free( hBinRendererTd->HrFiltSet_p->LeftFiltSet_p ); + free( hBinRendererTd->HrFiltSet_p->LeftFiltSet_p ); hBinRendererTd->HrFiltSet_p->LeftFiltSet_p = NULL; } if ( hBinRendererTd->HrFiltSet_p->RightFiltSet_p != NULL ) { - count_free( hBinRendererTd->HrFiltSet_p->RightFiltSet_p ); + free( hBinRendererTd->HrFiltSet_p->RightFiltSet_p ); hBinRendererTd->HrFiltSet_p->RightFiltSet_p = NULL; } #ifdef TDREND_HRTF_TABLE_METHODS if ( hBinRendererTd->HrFiltSet_p->NumAzim_p != NULL ) { - count_free( hBinRendererTd->HrFiltSet_p->NumAzim_p ); + free( hBinRendererTd->HrFiltSet_p->NumAzim_p ); hBinRendererTd->HrFiltSet_p->NumAzim_p = NULL; } if ( hBinRendererTd->HrFiltSet_p->AzimStartIdx_p != NULL ) { - count_free( hBinRendererTd->HrFiltSet_p->AzimStartIdx_p ); + free( hBinRendererTd->HrFiltSet_p->AzimStartIdx_p ); hBinRendererTd->HrFiltSet_p->AzimStartIdx_p = NULL; } if ( hBinRendererTd->HrFiltSet_p->ElevFull_p != NULL ) { - count_free( hBinRendererTd->HrFiltSet_p->ElevFull_p ); + free( hBinRendererTd->HrFiltSet_p->ElevFull_p ); hBinRendererTd->HrFiltSet_p->ElevFull_p = NULL; } #endif } - count_free( hBinRendererTd->HrFiltSet_p ); + free( hBinRendererTd->HrFiltSet_p ); hBinRendererTd->HrFiltSet_p = NULL; } @@ -225,7 +225,7 @@ ivas_error TDREND_MIX_Init( /* Init HR filter set */ if ( *hHrtfTD == NULL ) { - if ( ( hBinRendererTd->HrFiltSet_p = (TDREND_HRFILT_FiltSet_t *) count_malloc( sizeof( TDREND_HRFILT_FiltSet_t ) ) ) == NULL ) + if ( ( hBinRendererTd->HrFiltSet_p = (TDREND_HRFILT_FiltSet_t *) malloc( sizeof( TDREND_HRFILT_FiltSet_t ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Binaural TD renderer\n" ) ); } diff --git a/lib_rend/ivas_objectRenderer_sfx.c b/lib_rend/ivas_objectRenderer_sfx.c index cc6e6c0a8d78f2b5257be37751d875d7ff42f377..11b989380004b5a56c3507042e73f4bea88a702b 100644 --- a/lib_rend/ivas_objectRenderer_sfx.c +++ b/lib_rend/ivas_objectRenderer_sfx.c @@ -36,7 +36,7 @@ #include "ivas_prot.h" #include "ivas_rom_rend.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*---------------------------------------------------------------------* @@ -78,7 +78,7 @@ void TDREND_Apply_ITD( float *p_input; float *out_buf_A, *out_buf_B; - wmops_sub_start( "TDREND_Apply_ITD" ); + push_wmops( "TDREND_Apply_ITD" ); /* Prepare resampling buffer */ mvr2r( mem_itd, buffer, ITD_MEM_LEN ); /* Retrieve memory */ @@ -151,7 +151,7 @@ void TDREND_Apply_ITD( mvr2r( pstart3, out_buf_B + transition_len, tlen3 ); *previtd = itd; - wmops_sub_end(); + pop_wmops(); return; } diff --git a/lib_rend/ivas_objectRenderer_sources.c b/lib_rend/ivas_objectRenderer_sources.c index d3f3df30fac361920bad46f9f70f2859c403d433..1c29e58bc3c9a93fcf82aa42b4ed778fa53e2f23 100644 --- a/lib_rend/ivas_objectRenderer_sources.c +++ b/lib_rend/ivas_objectRenderer_sources.c @@ -35,7 +35,7 @@ #include #include "ivas_prot.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" #ifdef DEBUGGING #include "debug.h" #endif @@ -185,7 +185,7 @@ static ivas_error TDREND_SRC_REND_Alloc( *SrcRend_pp = NULL; /* Allocate the TDREND_SRC_REND_t variable */ - SrcRend_p = (TDREND_SRC_REND_t *) count_malloc( sizeof( TDREND_SRC_REND_t ) ); + SrcRend_p = (TDREND_SRC_REND_t *) malloc( sizeof( TDREND_SRC_REND_t ) ); if ( SrcRend_p == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "SrcRend_p allocation error\n" ) ); @@ -384,7 +384,7 @@ static ivas_error TDREND_SRC_SPATIAL_Alloc( *SrcSpatial_pp = NULL; /* Allocate the TDREND_SRC_t variable */ - SrcSpatial_p = (TDREND_SRC_SPATIAL_t *) count_malloc( sizeof( TDREND_SRC_SPATIAL_t ) ); + SrcSpatial_p = (TDREND_SRC_SPATIAL_t *) malloc( sizeof( TDREND_SRC_SPATIAL_t ) ); if ( SrcSpatial_p == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "TDREND_SRC_SPATIAL_t allocation error\n" ) ); @@ -411,7 +411,7 @@ static void TDREND_SRC_SPATIAL_Dealloc( return; } /* Free the SrcSpatial_p variable */ - count_free( SrcSpatial_p ); + free( SrcSpatial_p ); SrcSpatial_p = NULL; return; @@ -596,7 +596,7 @@ ivas_error TDREND_SRC_Alloc( *Src_pp = NULL; /* Allocate the TDREND_SRC_t variable */ - Src_p = (TDREND_SRC_t *) count_malloc( sizeof( TDREND_SRC_t ) ); + Src_p = (TDREND_SRC_t *) malloc( sizeof( TDREND_SRC_t ) ); if ( Src_p == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, " TDREND_SRC_Alloc: Allocation error\n" ) ); @@ -638,11 +638,11 @@ void TDREND_SRC_Dealloc( TDREND_SRC_SPATIAL_Dealloc( Src_p->SrcSpatial_p ); /* Delloc the TDREND_SRC_REND__t variable */ - count_free( Src_p->SrcRend_p ); + free( Src_p->SrcRend_p ); Src_p->SrcRend_p = NULL; /* Free the Src_p variable */ - count_free( Src_p ); + free( Src_p ); Src_p = NULL; return; diff --git a/lib_rend/ivas_objectRenderer_vec.c b/lib_rend/ivas_objectRenderer_vec.c index 11c5d31ea874dadc13d804a571619658d5e25d97..17f5f229d12a9ed979774d7d311d5e2b8b11d0e9 100644 --- a/lib_rend/ivas_objectRenderer_vec.c +++ b/lib_rend/ivas_objectRenderer_vec.c @@ -35,7 +35,7 @@ #include #include "ivas_prot.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" #ifdef DEBUGGING #include "debug.h" #endif diff --git a/lib_rend/ivas_orient_trk.c b/lib_rend/ivas_orient_trk.c index 4754062b561520c46c0516fc1a51beb0be5c1fe0..8d4d561898c2a397b90c7e83e2295d8b1c77e382 100644 --- a/lib_rend/ivas_orient_trk.c +++ b/lib_rend/ivas_orient_trk.c @@ -40,7 +40,7 @@ #endif #include #include -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------------------------* diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index 57fcbf7268da6058c244c65398976d2f979ce580..039fe8458bf6e1e292fb2c47a4a4451cc8ea311b 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -43,7 +43,7 @@ #include "debug.h" #include #endif -#include "wmops.h" +#include "wmc_auto.h" /*-------------------------------------------------------------------------* * audioCfg2channels() diff --git a/lib_rend/ivas_render_config.c b/lib_rend/ivas_render_config.c index 73cf4d91407b7e538200ab4b0c542d70160fc754..0e9e089b9313e7a189670e8fab3298862bcc9cbb 100644 --- a/lib_rend/ivas_render_config.c +++ b/lib_rend/ivas_render_config.c @@ -39,7 +39,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------------* @@ -61,7 +61,7 @@ ivas_error ivas_render_config_open( ) { /* Allocate HR filter set for headphones configuration */ - *hRenderConfig = (RENDER_CONFIG_HANDLE) count_malloc( sizeof( RENDER_CONFIG_DATA ) ); + *hRenderConfig = (RENDER_CONFIG_HANDLE) malloc( sizeof( RENDER_CONFIG_DATA ) ); if ( *hRenderConfig == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for renderer configuration!" ); @@ -86,7 +86,7 @@ void ivas_render_config_close( return; } - count_free( *hRenderConfig ); + free( *hRenderConfig ); *hRenderConfig = NULL; return; diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index 22265c03c13eff76eb90dc40f570670a0c10b174..a6cc8d50eaaf70e01f07e666c2259505307e9347 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -41,7 +41,7 @@ #include "math.h" #include "ivas_rom_rend.h" #include -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------------------------* @@ -965,7 +965,7 @@ ivas_error ivas_reverb_open( nr_fc_input = hRenderConfig->roomAcoustics.nBands; /* Allocate main reverb. handle */ - if ( ( pState = (REVERB_HANDLE) count_malloc( sizeof( REVERB_DATA ) ) ) == NULL ) + if ( ( pState = (REVERB_HANDLE) malloc( sizeof( REVERB_DATA ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Crend Reverberator " ); } @@ -978,14 +978,14 @@ ivas_error ivas_reverb_open( /* Allocate memory for feedback delay lines */ for ( loop_idx = 0; loop_idx < IVAS_REV_MAX_NR_BRANCHES; loop_idx++ ) { - if ( ( pState->loop_delay_buffer[loop_idx] = (float *) count_malloc( params.pLoop_delays[loop_idx] * sizeof( float ) ) ) == NULL ) + if ( ( pState->loop_delay_buffer[loop_idx] = (float *) malloc( params.pLoop_delays[loop_idx] * sizeof( float ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CREND Reverberator" ); } } /* Allocate memory for the pre-delay delay line */ - if ( ( pState->pPredelay_buffer = (float *) count_malloc( output_frame * sizeof( float ) ) ) == NULL ) + if ( ( pState->pPredelay_buffer = (float *) malloc( output_frame * sizeof( float ) ) ) == NULL ) { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CREND Reverberator" ); } @@ -1120,15 +1120,15 @@ void ivas_reverb_close( { if ( hReverb->loop_delay_buffer[loop_idx] != NULL ) { - count_free( hReverb->loop_delay_buffer[loop_idx] ); + free( hReverb->loop_delay_buffer[loop_idx] ); hReverb->loop_delay_buffer[loop_idx] = NULL; } } - count_free( hReverb->pPredelay_buffer ); + free( hReverb->pPredelay_buffer ); hReverb->pPredelay_buffer = NULL; - count_free( hReverb ); + free( hReverb ); hReverb = NULL; } diff --git a/lib_rend/ivas_reverb_delay_line.c b/lib_rend/ivas_reverb_delay_line.c index 9ad1a03bf98b81623c1b0b70eb67981436ba3b5d..361af732ff4ad5f1eb1d610e1a53576f144593a6 100644 --- a/lib_rend/ivas_reverb_delay_line.c +++ b/lib_rend/ivas_reverb_delay_line.c @@ -37,7 +37,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------------------------------* diff --git a/lib_rend/ivas_reverb_fft_filter.c b/lib_rend/ivas_reverb_fft_filter.c index 7a304aaf7c3df0b460aded859dcb66da947e2fef..4b8b2ec414ceb767e9a6a1458c94f4a624d0d733 100644 --- a/lib_rend/ivas_reverb_fft_filter.c +++ b/lib_rend/ivas_reverb_fft_filter.c @@ -38,7 +38,7 @@ #endif #include #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------------------------* diff --git a/lib_rend/ivas_reverb_filter_design.c b/lib_rend/ivas_reverb_filter_design.c index 0654dbfa8ae25bebb31a0c3b70eaf4b25e1bb006..efe8ec16dc7e00726fbb3e995bbbc8b794b9b405 100644 --- a/lib_rend/ivas_reverb_filter_design.c +++ b/lib_rend/ivas_reverb_filter_design.c @@ -40,7 +40,7 @@ #include #include #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------------------------* diff --git a/lib_rend/ivas_reverb_iir_filter.c b/lib_rend/ivas_reverb_iir_filter.c index b633f8e82cbe0c9bc86955e72135340457dfacd2..b557079db33d52d387f380c56e2c46f524a49f44 100644 --- a/lib_rend/ivas_reverb_iir_filter.c +++ b/lib_rend/ivas_reverb_iir_filter.c @@ -38,7 +38,7 @@ #include "debug.h" #endif #include -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------------------------------* diff --git a/lib_rend/ivas_reverb_utils.c b/lib_rend/ivas_reverb_utils.c index 31a559bd2c001cc138578b42fcbfdce842bd296d..7d26351ee822befcc3538357c658315dea502cba 100644 --- a/lib_rend/ivas_reverb_utils.c +++ b/lib_rend/ivas_reverb_utils.c @@ -40,7 +40,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------------------------------* diff --git a/lib_rend/ivas_rom_TdBinauralRenderer.c b/lib_rend/ivas_rom_TdBinauralRenderer.c index 34263ea8f3d9ce8e23ff5abab66c5cdc898e6d65..a4e07a435e5c1c1c4bf93f24927d069b9ba5877c 100644 --- a/lib_rend/ivas_rom_TdBinauralRenderer.c +++ b/lib_rend/ivas_rom_TdBinauralRenderer.c @@ -39,7 +39,7 @@ #endif #include "cnst.h" #include "ivas_cnst.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------- diff --git a/lib_rend/ivas_rom_binauralRenderer.c b/lib_rend/ivas_rom_binauralRenderer.c index bfd2da9fb496a741a7698ce00d1fdbfdd919c66c..b778c720926737c2088f51b2191b65b7c2e255ae 100644 --- a/lib_rend/ivas_rom_binauralRenderer.c +++ b/lib_rend/ivas_rom_binauralRenderer.c @@ -37,7 +37,7 @@ #endif #include "cnst.h" #include "ivas_cnst.h" -#include "wmops.h" +#include "wmc_auto.h" /* clang-format off */ diff --git a/lib_rend/ivas_rotation.c b/lib_rend/ivas_rotation.c index 60cbb5e9b834b3aad9bc20368eb814cca7974d3b..8c358305e3b759db356ef360f7ec63c6da31db3e 100644 --- a/lib_rend/ivas_rotation.c +++ b/lib_rend/ivas_rotation.c @@ -43,7 +43,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------------* @@ -59,7 +59,7 @@ ivas_error ivas_headTrack_open( int16_t i; /* Allocate Head-Tracking handle */ - if ( ( *hHeadTrackData = (HEAD_TRACK_DATA_HANDLE) count_malloc( sizeof( HEAD_TRACK_DATA ) ) ) == NULL ) + if ( ( *hHeadTrackData = (HEAD_TRACK_DATA_HANDLE) malloc( sizeof( HEAD_TRACK_DATA ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for head-tracking memory\n" ) ); } @@ -251,7 +251,7 @@ void rotateAziEle_DirAC( float dv_r_0, dv_r_1, dv_r_2; float w; - wmops_sub_start( "rotateAziEle_DirAC" ); + push_wmops( "rotateAziEle_DirAC" ); for ( b = band1; b < band2; b++ ) { @@ -271,7 +271,7 @@ void rotateAziEle_DirAC( ele[b] = (int16_t) ( atan2f( dv_r_2, sqrtf( dv_r_0 * dv_r_0 + dv_r_1 * dv_r_1 ) ) * _180_OVER_PI ); } - wmops_sub_end(); + pop_wmops(); return; } @@ -407,7 +407,7 @@ void rotateFrame_sd( float output_tmp[MAX_CICP_CHANNELS][L_FRAME48k]; float cross_fade[L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; - wmops_sub_start( "rotateFrame_sd" ); + push_wmops( "rotateFrame_sd" ); nchan = hTransSetup.nchan_out_woLFE + hTransSetup.num_lfe; index_lfe = hTransSetup.index_lfe[0]; @@ -509,7 +509,7 @@ void rotateFrame_sd( mvr2r( &output_tmp[ch_out][subframe_idx * subframe_len], &output[ch_out][subframe_idx * subframe_len], subframe_len ); } - wmops_sub_end(); + pop_wmops(); return; } @@ -635,7 +635,7 @@ void rotateFrame_sd_cldfb( int16_t nInChannels; int16_t isPlanar; - wmops_sub_start( "rotateFrame_sd_cldfb" ); + push_wmops( "rotateFrame_sd_cldfb" ); nInChannels = hOutputSetup->nchan_out_woLFE; isPlanar = 1; @@ -714,7 +714,7 @@ void rotateFrame_sd_cldfb( } } } - wmops_sub_end(); + pop_wmops(); return; } diff --git a/lib_rend/ivas_sba_rendering.c b/lib_rend/ivas_sba_rendering.c index fb404020394cfadc101797810106b1b5b7a7f580..0647e426dd473b50b35097b366c0c5ae4802cc1b 100755 --- a/lib_rend/ivas_sba_rendering.c +++ b/lib_rend/ivas_sba_rendering.c @@ -40,7 +40,7 @@ #ifdef DEBUGGING #include "debug.h" #endif -#include "wmops.h" +#include "wmc_auto.h" /*-----------------------------------------------------------------------* @@ -157,7 +157,7 @@ void ivas_sba2mc_cldfb( float *p_real, *p_imag, *p_realOut, *p_imagOut; int16_t nb_channels_in; - wmops_sub_start( "ivas_sba2mc_cldfb" ); + push_wmops( "ivas_sba2mc_cldfb" ); nb_channels_in = hInSetup.nchan_out_woLFE; assert( ( nb_channels_in == 16 ) && ( nb_channels_out == 11 ) && "ivas_sba2mc_cldfb; only HOA3 to CICP19 is for now supported!" ); @@ -203,7 +203,7 @@ void ivas_sba2mc_cldfb( } } - wmops_sub_end(); + pop_wmops(); return; } @@ -496,7 +496,7 @@ void ivas_sba_upmixer_renderer( int16_t i, nchan_internal; float temp; - wmops_sub_start( "ivas_sba_upmixer_renderer" ); + push_wmops( "ivas_sba_upmixer_renderer" ); nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order ); @@ -519,7 +519,7 @@ void ivas_sba_upmixer_renderer( ivas_sba_linear_renderer( output, output_frame, st_ivas->hIntSetup.nchan_out_woLFE, st_ivas->hDecoderConfig->output_config, st_ivas->hOutSetup, st_ivas->hoa_dec_mtx ); } - wmops_sub_end(); + pop_wmops(); return; } @@ -611,7 +611,7 @@ void ivas_sba_prototype_renderer( int16_t firstSlot, slotEnd, firstInCh, inChEnd, firstOutCh, outChEnd; int16_t sf_idx; - wmops_sub_start( "ivas_sba_prototype_renderer" ); + push_wmops( "ivas_sba_prototype_renderer" ); hSpar = st_ivas->hSpar; hDecoderConfig = st_ivas->hDecoderConfig; @@ -740,7 +740,7 @@ void ivas_sba_prototype_renderer( } } - wmops_sub_end(); + pop_wmops(); return; } diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index e62cf8c845b4092478227bdbf04a44fb9bf5de88..028b0f62740ece10b78b6dd79e2d07bd8746f1c6 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -39,7 +39,7 @@ #include "ivas_rom_rend.h" #include "ivas_lib_rend_internal.h" #include "prot.h" -#include "wmops.h" +#include "wmc_auto.h" #include #include @@ -1764,7 +1764,7 @@ static ivas_error initSbaPanGainsForMcOut( } } - count_free( tmpDecMtx ); + free( tmpDecMtx ); return IVAS_ERR_OK; } @@ -2136,8 +2136,8 @@ static DecoderDummy *initDecoderDummy( int32_t sampleRate, int16_t numTransChann assert( error == IVAS_ERR_OK ); } - decDummy = count_malloc( sizeof( DecoderDummy ) ); - decDummy->hDecoderConfig = count_malloc( sizeof( DECODER_CONFIG ) ); + decDummy = malloc( sizeof( DecoderDummy ) ); + decDummy->hDecoderConfig = malloc( sizeof( DECODER_CONFIG ) ); decDummy->hDecoderConfig->output_Fs = sampleRate; decDummy->hDecoderConfig->nchan_out = (int16_t) numOutChannels; decDummy->hDecoderConfig->Opt_Headrotation = 0; @@ -2157,7 +2157,7 @@ static DecoderDummy *initDecoderDummy( int32_t sampleRate, int16_t numTransChann if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) { - decDummy->hHeadTrackData = count_malloc( sizeof( HEAD_TRACK_DATA ) ); + decDummy->hHeadTrackData = malloc( sizeof( HEAD_TRACK_DATA ) ); /* Initialise Rmat_prev to I, Rmat will be computed later */ for ( i = 0; i < 3; i++ ) { @@ -2238,11 +2238,11 @@ static void freeDecoderDummy( DecoderDummy **ppDecDummy ) if ( pDecDummy->hDecoderConfig != NULL ) { - count_free( pDecDummy->hDecoderConfig ); + free( pDecDummy->hDecoderConfig ); } if ( pDecDummy->hHeadTrackData != NULL ) { - count_free( pDecDummy->hHeadTrackData ); + free( pDecDummy->hHeadTrackData ); } ivas_render_config_close( &pDecDummy->hRenderConfig ); @@ -2281,14 +2281,14 @@ static void freeDecoderDummy( DecoderDummy **ppDecDummy ) /* HOA decoder matrix */ if ( pDecDummy->hoa_dec_mtx != NULL ) { - count_free( pDecDummy->hoa_dec_mtx ); + free( pDecDummy->hoa_dec_mtx ); pDecDummy->hoa_dec_mtx = NULL; } /* Parametric binaural renderer handle */ ivas_dirac_dec_close_binaural_data( &pDecDummy->hDiracDecBin ); - count_free( pDecDummy ); + free( pDecDummy ); pDecDummy = NULL; } @@ -2329,7 +2329,7 @@ ivas_error IVAS_REND_Open( return error; } - *phIvasRend = (IVAS_REND_HANDLE) count_malloc( sizeof( struct IVAS_REND ) ); + *phIvasRend = (IVAS_REND_HANDLE) malloc( sizeof( struct IVAS_REND ) ); if ( *phIvasRend == NULL ) { return IVAS_ERR_FAILED_ALLOC; @@ -3454,7 +3454,7 @@ static ivas_error rotateFrameMc( rotation_gains gains; float tmp_gains[MAX_INPUT_CHANNELS]; - wmops_sub_start( "rotateFrameMc" ); + push_wmops( "rotateFrameMc" ); if ( inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) { @@ -3540,7 +3540,7 @@ static ivas_error rotateFrameMc( } } - wmops_sub_end(); + pop_wmops(); return IVAS_ERR_OK; } @@ -3562,7 +3562,7 @@ static ivas_error rotateFrameSba( float tmpRot[2 * HEADROT_ORDER + 1]; rotation_gains gains; - wmops_sub_start( "rotateFrameSba" ); + push_wmops( "rotateFrameSba" ); getAmbisonicsOrder( inConfig, &shd_rot_max_order ); @@ -3638,7 +3638,7 @@ static ivas_error rotateFrameSba( } } - wmops_sub_end(); + pop_wmops(); return IVAS_ERR_OK; } @@ -3650,7 +3650,7 @@ static ivas_error renderIsmToBinaural( float tmpTDRendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; ivas_error error; - wmops_sub_start( "renderIsmToBinaural" ); + push_wmops( "renderIsmToBinaural" ); copyBufferTo2dArray( ismInput->base.inputBuffer, tmpTDRendBuffer ); @@ -3668,7 +3668,7 @@ static ivas_error renderIsmToBinaural( accumulate2dArrayToBuffer( tmpTDRendBuffer, &outAudio ); - wmops_sub_end(); + pop_wmops(); return IVAS_ERR_OK; } @@ -3691,7 +3691,7 @@ static ivas_error renderIsmToBinauralRoom( IVAS_REND_AudioObjectPosition rotatedPos; const IVAS_REND_HeadRotData *headRotData; - wmops_sub_start( "renderIsmToBinauralRoom" ); + push_wmops( "renderIsmToBinauralRoom" ); headRotData = ismInput->base.ctx.pHeadRotData; rotatedPos = defaultObjectPosition(); @@ -3754,7 +3754,7 @@ static ivas_error renderIsmToBinauralRoom( tmpMcBuffer = ismInput->base.inputBuffer; getAudioConfigNumChannels( IVAS_REND_AUDIO_CONFIG_7_1_4, &tmp ); tmpMcBuffer.config.numChannels = tmp; - tmpMcBuffer.data = count_malloc( tmpMcBuffer.config.numSamplesPerChannel * tmpMcBuffer.config.numChannels * sizeof( float ) ); + tmpMcBuffer.data = malloc( tmpMcBuffer.config.numSamplesPerChannel * tmpMcBuffer.config.numChannels * sizeof( float ) ); set_zero( tmpMcBuffer.data, tmpMcBuffer.config.numSamplesPerChannel * tmpMcBuffer.config.numChannels ); renderBufferChannelLerp( ismInput->base.inputBuffer, 0, currentPanGains, previousPanGains, tmpMcBuffer ); @@ -3765,9 +3765,9 @@ static ivas_error renderIsmToBinauralRoom( accumulate2dArrayToBuffer( tmpCrendBuffer, &outAudio ); - count_free( tmpMcBuffer.data ); + free( tmpMcBuffer.data ); - wmops_sub_end(); + pop_wmops(); return IVAS_ERR_OK; } @@ -3780,7 +3780,7 @@ static ivas_error renderIsmToMc( pan_vector previousPanGains; ivas_error error; - wmops_sub_start( "renderIsmToMc" ); + push_wmops( "renderIsmToMc" ); /* TODO(sgi): Possible optimization: less processing needed if position didn't change */ if ( *ismInput->base.ctx.pOutConfig == IVAS_REND_AUDIO_CONFIG_STEREO ) @@ -3820,7 +3820,7 @@ static ivas_error renderIsmToMc( * This should have been validated in IVAS_REND_FeedInputAudio() */ renderBufferChannelLerp( ismInput->base.inputBuffer, 0, currentPanGains, previousPanGains, outAudio ); - wmops_sub_end(); + pop_wmops(); return IVAS_ERR_OK; } @@ -3837,7 +3837,7 @@ static ivas_error renderIsmToSba( ivas_error error; error = IVAS_ERR_OK; - wmops_sub_start( "renderIsmToSba" ); + push_wmops( "renderIsmToSba" ); if ( ( error = getAudioConfigNumChannels( outConfig, &numOutChannels ) ) != IVAS_ERR_OK ) { @@ -3872,7 +3872,7 @@ static ivas_error renderIsmToSba( * This should have been validated in IVAS_REND_FeedInputAudio() */ renderBufferChannelLerp( ismInput->base.inputBuffer, 0, currentPanGains, previousPanGains, outAudio ); - wmops_sub_end(); + pop_wmops(); return error; } @@ -3966,7 +3966,7 @@ static ivas_error renderLfeToBinaural( assert( ( outAudio.config.numChannels == 2 ) && "Must be binaural output" ); - wmops_sub_start( "renderLfeToBinaural" ); + push_wmops( "renderLfeToBinaural" ); gain = GAIN_LFE; @@ -3999,7 +3999,7 @@ static ivas_error renderLfeToBinaural( *writePtr++ += gain * ( *readPtr++ ); } - wmops_sub_end(); + pop_wmops(); return IVAS_ERR_OK; } @@ -4016,7 +4016,7 @@ static ivas_error renderMcToBinaural( ivas_error error; IVAS_REND_AudioBuffer tmpRotBuffer; - wmops_sub_start( "renderMcToBinaural" ); + push_wmops( "renderMcToBinaural" ); headRotEnabled = mcInput->base.ctx.pHeadRotData->headRotEnabled; inConfig = mcInput->base.inConfig; @@ -4043,7 +4043,7 @@ static ivas_error renderMcToBinaural( if ( headRotEnabled ) { tmpRotBuffer = mcInput->base.inputBuffer; - tmpRotBuffer.data = count_malloc( tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels * sizeof( float ) ); + tmpRotBuffer.data = malloc( tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels * sizeof( float ) ); set_zero( tmpRotBuffer.data, tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels ); rotateFrameMc( mcInput->base.inputBuffer, @@ -4055,7 +4055,7 @@ static ivas_error renderMcToBinaural( tmpRotBuffer ); copyBufferTo2dArray( tmpRotBuffer, tmpRendBuffer ); - count_free( tmpRotBuffer.data ); + free( tmpRotBuffer.data ); } else { @@ -4074,7 +4074,7 @@ static ivas_error renderMcToBinaural( /* TODO tmu : needs delay compensation */ renderLfeToBinaural( mcInput, outAudio ); - wmops_sub_end(); + pop_wmops(); return IVAS_ERR_OK; } @@ -4089,13 +4089,13 @@ static ivas_error renderMcToBinauralRoom( ivas_error error; IVAS_REND_AudioBuffer tmpRotBuffer; - wmops_sub_start( "renderMcToBinauralRoom" ); + push_wmops( "renderMcToBinauralRoom" ); /* apply rotation */ if ( mcInput->base.ctx.pHeadRotData->headRotEnabled ) { tmpRotBuffer = mcInput->base.inputBuffer; - tmpRotBuffer.data = count_malloc( tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels * sizeof( float ) ); + tmpRotBuffer.data = malloc( tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels * sizeof( float ) ); set_zero( tmpRotBuffer.data, tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels ); rotateFrameMc( mcInput->base.inputBuffer, @@ -4107,7 +4107,7 @@ static ivas_error renderMcToBinauralRoom( tmpRotBuffer ); copyBufferTo2dArray( tmpRotBuffer, tmpCrendBuffer ); - count_free( tmpRotBuffer.data ); + free( tmpRotBuffer.data ); } else { @@ -4126,7 +4126,7 @@ static ivas_error renderMcToBinauralRoom( /* TODO tmu : needs delay compensation */ renderLfeToBinaural( mcInput, outAudio ); - wmops_sub_end(); + pop_wmops(); return IVAS_ERR_OK; } @@ -4145,7 +4145,7 @@ static ivas_error renderMcCustomLsToBinauralRoom( IVAS_REND_AudioBuffer tmpMcBuffer; IVAS_REND_AudioBuffer *tmpBufPtr; - wmops_sub_start( "renderMcCustomLsToBinauralRoom" ); + push_wmops( "renderMcCustomLsToBinauralRoom" ); tmpRotBuffer = outAudio; /* avoid compilation warning */ @@ -4155,7 +4155,7 @@ static ivas_error renderMcCustomLsToBinauralRoom( if ( headRotEnabled ) { tmpRotBuffer = mcInput->base.inputBuffer; - tmpRotBuffer.data = count_malloc( tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels * sizeof( float ) ); + tmpRotBuffer.data = malloc( tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels * sizeof( float ) ); set_zero( tmpRotBuffer.data, tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels ); rotateFrameMc( mcInput->base.inputBuffer, @@ -4171,7 +4171,7 @@ static ivas_error renderMcCustomLsToBinauralRoom( tmpMcBuffer = mcInput->base.inputBuffer; getAudioConfigNumChannels( IVAS_REND_AUDIO_CONFIG_7_1_4, &tmp ); tmpMcBuffer.config.numChannels = (int16_t) tmp; - tmpMcBuffer.data = count_malloc( tmpMcBuffer.config.numSamplesPerChannel * tmpMcBuffer.config.numChannels * sizeof( float ) ); + tmpMcBuffer.data = malloc( tmpMcBuffer.config.numSamplesPerChannel * tmpMcBuffer.config.numChannels * sizeof( float ) ); set_zero( tmpMcBuffer.data, tmpMcBuffer.config.numSamplesPerChannel * tmpMcBuffer.config.numChannels ); tmpBufPtr = ( headRotEnabled ) ? &tmpRotBuffer : &mcInput->base.inputBuffer; @@ -4194,11 +4194,11 @@ static ivas_error renderMcCustomLsToBinauralRoom( if ( headRotEnabled ) { - count_free( tmpRotBuffer.data ); + free( tmpRotBuffer.data ); } - count_free( tmpMcBuffer.data ); + free( tmpMcBuffer.data ); - wmops_sub_end(); + pop_wmops(); return IVAS_ERR_OK; } @@ -4210,7 +4210,7 @@ static ivas_error renderMcToMc( int16_t i; IVAS_REND_AudioBuffer inAudio; - wmops_sub_start( "renderMcToMc" ); + push_wmops( "renderMcToMc" ); inAudio = mcInput->base.inputBuffer; @@ -4219,7 +4219,7 @@ static ivas_error renderMcToMc( renderBufferChannel( inAudio, i, mcInput->panGains[i], outAudio ); } - wmops_sub_end(); + pop_wmops(); return IVAS_ERR_OK; } @@ -4231,7 +4231,7 @@ static ivas_error renderMcToSba( int16_t i; IVAS_REND_AudioBuffer inAudio; - wmops_sub_start( "renderMcToSba" ); + push_wmops( "renderMcToSba" ); inAudio = mcInput->base.inputBuffer; @@ -4240,7 +4240,7 @@ static ivas_error renderMcToSba( renderBufferChannel( inAudio, i, mcInput->panGains[i], outAudio ); } - wmops_sub_end(); + pop_wmops(); return IVAS_ERR_OK; } @@ -4339,7 +4339,7 @@ static ivas_error renderSbaToMc( int16_t i; IVAS_REND_AudioBuffer inAudio; - wmops_sub_start( "renderSbaToMc" ); + push_wmops( "renderSbaToMc" ); inAudio = sbaInput->base.inputBuffer; @@ -4348,7 +4348,7 @@ static ivas_error renderSbaToMc( renderBufferChannel( inAudio, i, sbaInput->hoaDecMtx[i], outAudio ); } - wmops_sub_end(); + pop_wmops(); return IVAS_ERR_OK; } @@ -4360,7 +4360,7 @@ static ivas_error renderSbaToSba( int16_t i; IVAS_REND_AudioBuffer inAudio; - wmops_sub_start( "renderSbaToSba" ); + push_wmops( "renderSbaToSba" ); inAudio = sbaInput->base.inputBuffer; @@ -4369,7 +4369,7 @@ static ivas_error renderSbaToSba( renderBufferChannel( inAudio, i, sbaInput->hoaDecMtx[i], outAudio ); } - wmops_sub_end(); + pop_wmops(); return IVAS_ERR_OK; } @@ -4384,13 +4384,13 @@ static ivas_error renderSbaToBinaural( ivas_error error; IVAS_REND_AudioBuffer tmpRotBuffer; - wmops_sub_start( "renderSbaToBinaural" ); + push_wmops( "renderSbaToBinaural" ); /* apply rotation */ if ( sbaInput->base.ctx.pHeadRotData->headRotEnabled ) { tmpRotBuffer = sbaInput->base.inputBuffer; - tmpRotBuffer.data = count_malloc( tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels * sizeof( float ) ); + tmpRotBuffer.data = malloc( tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels * sizeof( float ) ); /* copy input for in-place rotation */ mvr2r( sbaInput->base.inputBuffer.data, tmpRotBuffer.data, tmpRotBuffer.config.numChannels * tmpRotBuffer.config.numSamplesPerChannel ); @@ -4402,7 +4402,7 @@ static ivas_error renderSbaToBinaural( tmpRotBuffer ); copyBufferTo2dArray( tmpRotBuffer, tmpCrendBuffer ); - count_free( tmpRotBuffer.data ); + free( tmpRotBuffer.data ); } else { @@ -4417,7 +4417,7 @@ static ivas_error renderSbaToBinaural( accumulate2dArrayToBuffer( tmpCrendBuffer, &outAudio ); - wmops_sub_end(); + pop_wmops(); return IVAS_ERR_OK; } @@ -4439,7 +4439,7 @@ static ivas_error renderSbaToBinauralRoom( tmpRotBuffer = outAudio; /* avoid compilation warning */ - wmops_sub_start( "renderSbaToBinauralRoom" ); + push_wmops( "renderSbaToBinauralRoom" ); headRotEnabled = sbaInput->base.ctx.pHeadRotData->headRotEnabled; @@ -4447,7 +4447,7 @@ static ivas_error renderSbaToBinauralRoom( if ( headRotEnabled ) { tmpRotBuffer = sbaInput->base.inputBuffer; - tmpRotBuffer.data = count_malloc( tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels * sizeof( float ) ); + tmpRotBuffer.data = malloc( tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels * sizeof( float ) ); /* copy input for in-place rotation */ mvr2r( sbaInput->base.inputBuffer.data, tmpRotBuffer.data, tmpRotBuffer.config.numChannels * tmpRotBuffer.config.numSamplesPerChannel ); @@ -4458,7 +4458,7 @@ static ivas_error renderSbaToBinauralRoom( tmpMcBuffer = sbaInput->base.inputBuffer; getAudioConfigNumChannels( IVAS_REND_AUDIO_CONFIG_7_1_4, &tmp ); tmpMcBuffer.config.numChannels = (int16_t) tmp; - tmpMcBuffer.data = count_malloc( tmpMcBuffer.config.numSamplesPerChannel * tmpMcBuffer.config.numChannels * sizeof( float ) ); + tmpMcBuffer.data = malloc( tmpMcBuffer.config.numSamplesPerChannel * tmpMcBuffer.config.numChannels * sizeof( float ) ); set_zero( tmpMcBuffer.data, tmpMcBuffer.config.numChannels * tmpMcBuffer.config.numSamplesPerChannel ); tmpBufPtr = ( headRotEnabled ) ? &tmpRotBuffer : &sbaInput->base.inputBuffer; @@ -4479,11 +4479,11 @@ static ivas_error renderSbaToBinauralRoom( if ( headRotEnabled ) { - count_free( tmpRotBuffer.data ); + free( tmpRotBuffer.data ); } - count_free( tmpMcBuffer.data ); + free( tmpMcBuffer.data ); - wmops_sub_end(); + pop_wmops(); return IVAS_ERR_OK; } @@ -4849,7 +4849,7 @@ void IVAS_REND_Close( ivas_limiter_close( &hIvasRend->hLimiter ); - count_free( hIvasRend ); + free( hIvasRend ); *phIvasRend = NULL; return; diff --git a/lib_util/audio_file_reader.c b/lib_util/audio_file_reader.c index d2c38cbb17327b88784b6880e16a64cc68e03450..ded04a9f2c0180a45339093b1152f5a49d693c77 100644 --- a/lib_util/audio_file_reader.c +++ b/lib_util/audio_file_reader.c @@ -34,7 +34,7 @@ #include "tinywavein_c.h" #include #include -#include "wmops.h" +#include "wmc_auto.h" struct AudioFileReader { diff --git a/lib_util/audio_file_writer.c b/lib_util/audio_file_writer.c index af9c6ee0e610b85de52574410593524e53d9e7f9..5c86161eaddb6f53c3b430e4a6502bbc3a61c0c3 100644 --- a/lib_util/audio_file_writer.c +++ b/lib_util/audio_file_writer.c @@ -34,7 +34,7 @@ #include "tinywaveout_c.h" #include #include -#include "wmops.h" +#include "wmc_auto.h" struct AudioFileWriter { diff --git a/lib_util/hrtf_file_reader.c b/lib_util/hrtf_file_reader.c index 92b0058436446d2bd2fb5c0187ae95b68856caa5..9eddcdf305768ffd4031ac092700bd71ced9116b 100644 --- a/lib_util/hrtf_file_reader.c +++ b/lib_util/hrtf_file_reader.c @@ -126,16 +126,16 @@ static void LoadBSplineBinaryITD( fread( &modelITD->N, sizeof( int16_t ), 1, f_hrtf ); fread( &modelITD->elevDim2, sizeof( int16_t ), 1, f_hrtf ); fread( &modelITD->elevDim3, sizeof( int16_t ), 1, f_hrtf ); - modelITD->elevKSeq_dyn = (float *) count_malloc( ( modelITD->elevDim3 - 2 ) * sizeof( float ) ); + modelITD->elevKSeq_dyn = (float *) malloc( ( modelITD->elevDim3 - 2 ) * sizeof( float ) ); fread( modelITD->elevKSeq_dyn, sizeof( float ), modelITD->elevDim3 - 2, f_hrtf ); fread( &modelITD->azimDim2, sizeof( int16_t ), 1, f_hrtf ); fread( &modelITD->azimDim3, sizeof( int16_t ), 1, f_hrtf ); - modelITD->azimKSeq_dyn = (float *) count_malloc( ( ( modelITD->azimDim3 + 1 ) / 2 - 2 ) * sizeof( float ) ); /* basis functions are flipped around 180 deg, number of basis functions above/below is (N+1)/2 */ + modelITD->azimKSeq_dyn = (float *) malloc( ( ( modelITD->azimDim3 + 1 ) / 2 - 2 ) * sizeof( float ) ); /* basis functions are flipped around 180 deg, number of basis functions above/below is (N+1)/2 */ fread( modelITD->azimKSeq_dyn, sizeof( float ), ( modelITD->azimDim3 + 1 ) / 2 - 2, f_hrtf ); fread( &tmp, sizeof( int16_t ), 1, f_hrtf ); - modelITD->W_dyn = (float *) count_malloc( tmp * sizeof( float ) ); + modelITD->W_dyn = (float *) malloc( tmp * sizeof( float ) ); fread( modelITD->W_dyn, sizeof( float ), tmp, f_hrtf ); /* azimuth */ @@ -144,7 +144,7 @@ static void LoadBSplineBinaryITD( fread( &tmp, sizeof( int16_t ), 1, f_hrtf ); - modelITD->azimBsShape_dyn = (float *) count_malloc( tmp * sizeof( float ) ); + modelITD->azimBsShape_dyn = (float *) malloc( tmp * sizeof( float ) ); fread( modelITD->azimBsShape_dyn, sizeof( float ), tmp, f_hrtf ); fread( &modelITD->azimSegSamples, sizeof( int16_t ), 1, f_hrtf ); @@ -155,7 +155,7 @@ static void LoadBSplineBinaryITD( fread( &tmp, sizeof( int16_t ), 1, f_hrtf ); - modelITD->elevBsShape_dyn = (float *) count_malloc( tmp * sizeof( float ) ); + modelITD->elevBsShape_dyn = (float *) malloc( tmp * sizeof( float ) ); fread( modelITD->elevBsShape_dyn, sizeof( float ), tmp, f_hrtf ); fread( &modelITD->elevSegSamples, sizeof( int16_t ), 1, f_hrtf ); @@ -224,51 +224,51 @@ static ivas_error LoadBSplineBinary( fread( &model->elevDim2, sizeof( int16_t ), 1, f_hrtf ); fread( &model->elevDim3, sizeof( int16_t ), 1, f_hrtf ); - model->elevKSeq_dyn = (float *) count_malloc( ( model->elevDim3 - 2 ) * sizeof( float ) ); + model->elevKSeq_dyn = (float *) malloc( ( model->elevDim3 - 2 ) * sizeof( float ) ); fread( model->elevKSeq_dyn, sizeof( float ), model->elevDim3 - 2, f_hrtf ); - model->azimDim2_dyn = (int16_t *) count_malloc( model->elevDim3 * sizeof( int16_t ) ); - model->azimDim3_dyn = (int16_t *) count_malloc( model->elevDim3 * sizeof( int16_t ) ); - model->azim_start_idx_dyn = (int16_t *) count_malloc( model->elevDim3 * sizeof( int16_t ) ); - model->azimKSeq = (float **) count_malloc( model->elevDim3 * sizeof( float * ) ); + model->azimDim2_dyn = (int16_t *) malloc( model->elevDim3 * sizeof( int16_t ) ); + model->azimDim3_dyn = (int16_t *) malloc( model->elevDim3 * sizeof( int16_t ) ); + model->azim_start_idx_dyn = (int16_t *) malloc( model->elevDim3 * sizeof( int16_t ) ); + model->azimKSeq = (float **) malloc( model->elevDim3 * sizeof( float * ) ); for ( i = 0; i < model->elevDim3; i++ ) { fread( &model->azimDim2_dyn[i], sizeof( int16_t ), 1, f_hrtf ); fread( &model->azimDim3_dyn[i], sizeof( int16_t ), 1, f_hrtf ); fread( &model->azim_start_idx_dyn[i], sizeof( int16_t ), 1, f_hrtf ); - model->azimKSeq[i] = (float *) count_malloc( ( model->azimDim3_dyn[i] + 1 ) * sizeof( float ) ); + model->azimKSeq[i] = (float *) malloc( ( model->azimDim3_dyn[i] + 1 ) * sizeof( float ) ); fread( model->azimKSeq[i], sizeof( float ), ( model->azimDim3_dyn[i] + 1 ), f_hrtf ); } fread( &model->AlphaN, sizeof( int16_t ), 1, f_hrtf ); - model->AlphaL_dyn = (float *) count_malloc( model->AlphaN * model->K * sizeof( float ) ); + model->AlphaL_dyn = (float *) malloc( model->AlphaN * model->K * sizeof( float ) ); fread( model->AlphaL_dyn, sizeof( float ), model->AlphaN * model->K, f_hrtf ); - model->AlphaR_dyn = (float *) count_malloc( model->AlphaN * model->K * sizeof( float ) ); + model->AlphaR_dyn = (float *) malloc( model->AlphaN * model->K * sizeof( float ) ); fread( model->AlphaR_dyn, sizeof( float ), model->AlphaN * model->K, f_hrtf ); /* azimuth */ fread( &model->num_unique_azim_splines, sizeof( int16_t ), 1, f_hrtf ); - model->azimBsShape = (const float **) count_malloc( model->num_unique_azim_splines * sizeof( float * ) ); - model->azimBsShape_dyn = (float **) count_malloc( model->num_unique_azim_splines * sizeof( float * ) ); - model->azimSegSamples_dyn = (int16_t *) count_malloc( model->num_unique_azim_splines * sizeof( int16_t ) ); + model->azimBsShape = (const float **) malloc( model->num_unique_azim_splines * sizeof( float * ) ); + model->azimBsShape_dyn = (float **) malloc( model->num_unique_azim_splines * sizeof( float * ) ); + model->azimSegSamples_dyn = (int16_t *) malloc( model->num_unique_azim_splines * sizeof( int16_t ) ); for ( i = 0; i < model->num_unique_azim_splines; i++ ) { fread( &tmp, sizeof( int16_t ), 1, f_hrtf ); - model->azimBsShape_dyn[i] = (float *) count_malloc( tmp * sizeof( float ) ); + model->azimBsShape_dyn[i] = (float *) malloc( tmp * sizeof( float ) ); fread( model->azimBsShape_dyn[i], sizeof( float ), tmp, f_hrtf ); fread( &model->azimSegSamples_dyn[i], sizeof( int16_t ), 1, f_hrtf ); } - model->azimShapeIdx_dyn = (int16_t *) count_malloc( model->elevDim3 * sizeof( int16_t ) ); + model->azimShapeIdx_dyn = (int16_t *) malloc( model->elevDim3 * sizeof( int16_t ) ); fread( model->azimShapeIdx_dyn, sizeof( int16_t ), model->elevDim3, f_hrtf ); - model->azimShapeSampFactor_dyn = (int16_t *) count_malloc( model->elevDim3 * sizeof( int16_t ) ); + model->azimShapeSampFactor_dyn = (int16_t *) malloc( model->elevDim3 * sizeof( int16_t ) ); fread( model->azimShapeSampFactor_dyn, sizeof( int16_t ), model->elevDim3, f_hrtf ); /* elevation */ fread( model->elevBsLen, sizeof( int16_t ), HRTF_MODEL_BSPLINE_NUM_COEFFS, f_hrtf ); fread( model->elevBsStart, sizeof( int16_t ), HRTF_MODEL_BSPLINE_NUM_COEFFS, f_hrtf ); fread( &tmp, sizeof( int16_t ), 1, f_hrtf ); - model->elevBsShape_dyn = (float *) count_malloc( tmp * sizeof( float ) ); + model->elevBsShape_dyn = (float *) malloc( tmp * sizeof( float ) ); fread( model->elevBsShape_dyn, sizeof( float ), tmp, f_hrtf ); fread( &model->elevSegSamples, sizeof( int16_t ), 1, f_hrtf ); @@ -305,7 +305,6 @@ static ivas_error LoadBSplineBinary( return IVAS_ERR_OK; } - /*-------------------------------------------------------------------* * TDREND_MIX_LoadHRTF() * diff --git a/lib_util/hrtf_file_reader.h b/lib_util/hrtf_file_reader.h index ed3d572d56047e36cd629de40f40ec21b8755f15..c7b751ad76846a49e13e4597f244f0225419b135 100644 --- a/lib_util/hrtf_file_reader.h +++ b/lib_util/hrtf_file_reader.h @@ -36,6 +36,7 @@ #include #include "common_api_types.h" #include "ivas_error.h" +#include "options.h" typedef struct hrtfFileReader hrtfFileReader; diff --git a/scripts/ivas_pytests/tests/unit_tests/crend/ivas_crend_unit_test.c b/scripts/ivas_pytests/tests/unit_tests/crend/ivas_crend_unit_test.c index 0c8d7590a32f9e8a429fa5556a9afe279f98b059..2e0bacd97fe3146bad422a94760c303fef28e737 100644 --- a/scripts/ivas_pytests/tests/unit_tests/crend/ivas_crend_unit_test.c +++ b/scripts/ivas_pytests/tests/unit_tests/crend/ivas_crend_unit_test.c @@ -51,6 +51,7 @@ #include "ivas_prox_mix.h" #include "prot.h" #include "ivas_prot.h" +#include "wmc_auto.h" #if defined( __unix__ ) || defined( __unix ) || defined( __APPLE__ ) || defined( __CYGWIN__ ) #define USE_DIRENT @@ -707,6 +708,11 @@ int main( int argc, char **argv ) ivas_open_files_crend( &io_params ); } } + +#ifdef WMOPS + reset_mem( USE_32BITS ); +#endif + switch ( io_params.test ) { case CREND_ACOUSTIC_PROXIMITY: @@ -728,8 +734,8 @@ int main( int argc, char **argv ) FILES_CLOSE; -#ifdef RAM_COUNTING_TOOL - mem_count_summary( USE_DEFAULT ); +#ifdef WMOPS + print_mem( NULL ); #endif return 0; diff --git a/scripts/ivas_pytests/tests/unit_tests/crend/ivas_crend_utest_utils.c b/scripts/ivas_pytests/tests/unit_tests/crend/ivas_crend_utest_utils.c index f58454cbdf350e84ee62410cdcef5a0ac918d989..81ac69ecc1662fe5f834ff32d3bac8c865cc64f7 100644 --- a/scripts/ivas_pytests/tests/unit_tests/crend/ivas_crend_utest_utils.c +++ b/scripts/ivas_pytests/tests/unit_tests/crend/ivas_crend_utest_utils.c @@ -62,6 +62,7 @@ #include "head_rotation_file_reader.h" #include "options.h" #include "render_config_reader.h" +#include "wmc_auto.h" static int32_t ivas_check_rounding( float binaural_latencys_s[3], int16_t use_round_latency, int16_t use_round_for_lfe, int32_t *err_lfe, int32_t *err_dec, int16_t verbose ) @@ -1512,7 +1513,7 @@ ivas_result_t ivas_common_mixer_renderer( ivas_crend_io_params_t *pIo_params, fl { if ( st_ivas.hLFE->lfe_delay_buf != NULL ) { - count_free( st_ivas.hLFE->lfe_delay_buf ); + free( st_ivas.hLFE->lfe_delay_buf ); st_ivas.hLFE->lfe_delay_buf = NULL; } #ifdef FIX_FIX_I59 @@ -1526,7 +1527,7 @@ ivas_result_t ivas_common_mixer_renderer( ivas_crend_io_params_t *pIo_params, fl #endif if ( st_ivas.hLFE->lfe_addl_delay > 0 ) { - if ( ( st_ivas.hLFE->lfe_delay_buf = (float *) count_malloc( st_ivas.hLFE->lfe_addl_delay * sizeof( float ) ) ) == NULL ) + if ( ( st_ivas.hLFE->lfe_delay_buf = (float *) malloc( st_ivas.hLFE->lfe_addl_delay * sizeof( float ) ) ) == NULL ) { fprintf( stderr, "Can not allocate memory for LFE additional delay buffer\n" ); return IVAS_FAILED; @@ -1545,7 +1546,7 @@ ivas_result_t ivas_common_mixer_renderer( ivas_crend_io_params_t *pIo_params, fl delay_lp = (int16_t) ( ivas_lfe_lpf_delay[1] * (float) pIo_params->sample_rate ); for ( i = 0; i < in_ch - st_ivas.hIntSetup.num_lfe; i++ ) { - if ( ( ppDelay_lines[i] = (float *) count_malloc( delay_lp * sizeof( float ) ) ) == NULL ) + if ( ( ppDelay_lines[i] = (float *) malloc( delay_lp * sizeof( float ) ) ) == NULL ) { fprintf( stderr, "Can not allocate memory for LFE additional delay buffer\n" ); return IVAS_FAILED; @@ -1765,6 +1766,10 @@ ivas_result_t ivas_common_mixer_renderer( ivas_crend_io_params_t *pIo_params, fl fprintf( stdout, "Processed frame: %ld\r", (long) frame_count ); frame_count++; + +#ifdef WMOPS + update_wmops(); +#endif } int16_t pcm[MAX_OUTPUT_CHANNELS] = { 0 }; @@ -1801,7 +1806,7 @@ ivas_result_t ivas_common_mixer_renderer( ivas_crend_io_params_t *pIo_params, fl { for ( i = 0; i < in_ch - st_ivas.hIntSetup.num_lfe; i++ ) { - count_free( ppDelay_lines[i] ); + free( ppDelay_lines[i] ); } } if ( st_ivas.hRenderConfig != NULL ) @@ -1812,7 +1817,7 @@ ivas_result_t ivas_common_mixer_renderer( ivas_crend_io_params_t *pIo_params, fl /* Head track data handle */ if ( st_ivas.hHeadTrackData != NULL ) { - count_free( st_ivas.hHeadTrackData ); + free( st_ivas.hHeadTrackData ); st_ivas.hHeadTrackData = NULL; } @@ -1821,11 +1826,6 @@ ivas_result_t ivas_common_mixer_renderer( ivas_crend_io_params_t *pIo_params, fl HeadRotationFileReader_close( &headRotReader ); } - -#ifdef RAM_COUNTING_TOOL - mem_count_summary( USE_DEFAULT ); -#endif - return IVAS_SUCCESS; } diff --git a/scripts/ivas_pytests/tests/unit_tests/crend/ivas_prox_mix.c b/scripts/ivas_pytests/tests/unit_tests/crend/ivas_prox_mix.c index b55c43b6f8e1666583467236b2947ff9d297f3f8..502f2fe069fbf29f0a44dd674ebf4f68a197c4dc 100644 --- a/scripts/ivas_pytests/tests/unit_tests/crend/ivas_prox_mix.c +++ b/scripts/ivas_pytests/tests/unit_tests/crend/ivas_prox_mix.c @@ -45,7 +45,7 @@ #include "debug.h" #endif #include "ivas_prox_mix.h" -#include "wmops.h" +#include "wmc_auto.h" /*------------------------------------------------------------------------------------------* * PreProcessor diff --git a/scripts/prepare_instrumentation.sh b/scripts/prepare_instrumentation.sh index d9fab685eab4ef6c8fed771d68e547608018b74c..70385e971c4cde1aa2ae784fc5d6366b1ce575c2 100755 --- a/scripts/prepare_instrumentation.sh +++ b/scripts/prepare_instrumentation.sh @@ -30,13 +30,9 @@ # the United Nations Convention on Contracts on the International Sales of Goods. # -emulator="" system=`uname -s` if [[ ($system == "Linux") && (`uname -a` =~ (microsoft|Microsoft|wsl|WSL) ) ]]; then - system="WSL" -fi -if [[ ($system == "Linux") || ($system == "Darwin") ]]; then - emulator="wine" + system="Linux" fi coan_exists () { @@ -88,22 +84,25 @@ if [ $? -ne 0 ]; then exit -1 fi -# strip switches, to remove the macros +# strip switches, to remove the macros (turn on extended globing to allow !(pattern*) matching) +shopt -s extglob if coan_exists; then - coan source --replace --no-transients -E -K --file $ifdef_list $targetdir/lib_{com,dec,enc,rend,util,debug}/*.[hc] + # remove WMOPS from the list -> otherwise it will be removed with coan and wmc_auto.h will not see it + sed -i "/-DWMOPS/d" $ifdef_list + + coan source --replace --no-transients -E -K --file $ifdef_list $targetdir/lib_{com,dec,enc,rend,util,debug}/!(wmc_auto*).[hc] coan source --replace --no-transients -E -K --file $ifdef_list $targetdir/apps/*.[hc] else ./strip_defines_cppp.sh $targetdir $ifdef_list fi +shopt -u extglob # patch code before wmc_tool: replace hexadecimal unsigned long constants (0x...UL) by regular integer constant + cast to unsigned long find $targetdir -name "*.[ch]" -exec sed -i.bak -e "s/\(0x[0-9a-fA-F]*\)UL/\(\(unsigned long\)\1\)/" \{\} \; -# run wmc_tool using wine -${emulator} ./wmc_tool.exe $targetdir/lib_enc/*.c /ic /op > /dev/null -${emulator} ./wmc_tool.exe $targetdir/lib_com/*.c /ic /op > /dev/null -${emulator} ./wmc_tool.exe $targetdir/lib_dec/*.c /ic /op > /dev/null -${emulator} ./wmc_tool.exe $targetdir/lib_rend/*.c /ic /op > /dev/null +# run wmc_tool +"tools/$system/wmc_tool" -m "$targetdir/apps/encoder.c" "$targetdir/lib_enc/*.c" "$targetdir/lib_com/*.c" >> /dev/null +"tools/$system/wmc_tool" -m "$targetdir/apps/decoder.c" "$targetdir/lib_dec/*.c" "$targetdir/lib_rend/*.c" >> /dev/null # automatically enable #define WMOPS in options.h sed -i.bak -e "s/\/\*\s*\(#define\s*WMOPS\)\s*\*\//\1/g" $targetdir/lib_com/options.h diff --git a/scripts/pyivastest/IvasModeAnalyzer.py b/scripts/pyivastest/IvasModeAnalyzer.py index 678af1906a08ff3512acb5af7a6c138fd066958f..f51ed47ec1c63b5d726bf44527203c8c52c72983 100644 --- a/scripts/pyivastest/IvasModeAnalyzer.py +++ b/scripts/pyivastest/IvasModeAnalyzer.py @@ -46,51 +46,67 @@ INSTRUMENTED_RESULTS = { "WMOPS": { "keyword": "total", "number_format": "{:.5g}", - "position": 3, + "position": 2, "max_or_add": "add", "keyword_suffix": False, "strip_suffix": False, "encdec": 2, }, - "SRAM": { - "keyword": "Static RAM size", + "RAM": { + "keyword": "Maximum RAM (stack + heap) size:", "number_format": "{:.0f}", - "position": 4, + "position": 0, "max_or_add": "add", - "keyword_suffix": True, - "strip_suffix": True, + "keyword_suffix": False, + "strip_suffix": False, + "encdec": 2, + }, + "HEAP": { + "keyword": "Maximum inter-frame heap size:", + "number_format": "{:.0f}", + "position": 0, + "max_or_add": "add", + "keyword_suffix": False, + "strip_suffix": False, + "encdec": 2, + }, + "HEAP_INTRA": { + "keyword": "Maximum intra-frame heap size:", + "number_format": "{:.0f}", + "position": 0, + "max_or_add": "add", + "keyword_suffix": False, + "strip_suffix": False, "encdec": 2, }, - "DRAM": { - "keyword": "Stack size", + "STACK": { + "keyword": "Maximum stack size:", "number_format": "{:.0f}", - "position": 3, + "position": 0, "max_or_add": "max", - "keyword_suffix": True, - "strip_suffix": True, + "keyword_suffix": False, + "strip_suffix": False, "encdec": 2, }, "PROM": { - "keyword": "PROM size", + "keyword": "Program ROM size", "number_format": "{:.0f}", - "position": 3, + "position": 0, "max_or_add": "add", "keyword_suffix": True, "strip_suffix": True, "encdec": 4, }, - "TABLES": { - "keyword": "Table ROM size", + "TROM": { + "keyword": "Table ROM (const data) size", "number_format": "{:.0f}", - "position": 4, + "position": 0, "max_or_add": "add", "keyword_suffix": True, "strip_suffix": True, "encdec": 4, }, } - - HTML_DOCTYPE = """""" HTML_META = ( @@ -254,32 +270,44 @@ class IvasModeAnalyzer(IvasModeCollector): @staticmethod def get_log_value_from_file( - filename: str, keyword: str, position: int, strip_suffix=0 + filename: str, keywords: list, position: int, strip_suffix=0 ): """ Parameters ---------- - filename : + filename : log filename - keyword : + keywords : list of keywords to be searched in the log file (must be present on a single line) - position : + position : index to the list of extracted values strip_suffix : (Default value = 0) Returns ------- + + First value extracted from the line in the log file containing all keywords """ - loglines = [] + + if type(keywords) != list: + keywords = [keywords] + if os.path.exists(filename): fp = open(filename) loglines = fp.readlines() - return IvasModeAnalyzer.get_log_value( - loglines, keyword, position, strip_suffix=strip_suffix - ) + fp.close() + matching_lines = [line for line in loglines if all(keyword in line for keyword in keywords)] + + for line in matching_lines: + all_values_on_line = [float(s) for s in line.split() if re.match(r'^[0-9\.]*$', s)] + if all_values_on_line: + return all_values_on_line[position] + + return -1.0 + def sort_log_modes(self): list_to_sort = [] @@ -363,9 +391,9 @@ class IvasModeAnalyzer(IvasModeCollector): result_table = [["conf", "com"]] else: if max_or_add == "add": - result_table = [["conf", "enc", "dec", "com", "total"]] + result_table = [["conf", "enc", "dec", "com", "rend", "total"]] if max_or_add == "max": - result_table = [["conf", "enc", "dec", "com", "max"]] + result_table = [["conf", "enc", "dec", "com", "rend", "max"]] sorted_modes = self.sort_log_modes() @@ -389,7 +417,7 @@ class IvasModeAnalyzer(IvasModeCollector): enc_value, self.get_log_value_from_file( enc_log_name, - " ".join([keyword, "\(encoder\)"]), + [keyword, "lib_enc"], position, strip_suffix=strip_suffix, ), @@ -411,7 +439,7 @@ class IvasModeAnalyzer(IvasModeCollector): com_value, self.get_log_value_from_file( enc_log_name, - " ".join([keyword, "\(common\)"]), + [keyword, "lib_com"], position, strip_suffix=strip_suffix, ), @@ -427,15 +455,17 @@ class IvasModeAnalyzer(IvasModeCollector): for oc in self.selected_logs[mode]["oc_list"]: formatted_name_oc = formatted_name + " to " + oc dec_value = -1 + rend_value = -1 for item in self.selected_logs[mode]["items"]: if oc in self.selected_logs[mode]["items"][item]["dec"]: dec_log_name = self.get_dec_log_file_name(item, mode, oc) + # get dec if keyword_suffix == 1: dec_value = max( dec_value, self.get_log_value_from_file( dec_log_name, - " ".join([keyword, "\(decoder\)"]), + [keyword, "lib_dec"], position, strip_suffix=strip_suffix, ), @@ -450,6 +480,27 @@ class IvasModeAnalyzer(IvasModeCollector): strip_suffix=strip_suffix, ), ) + # get rend + if keyword_suffix == 1: + rend_value = max( + rend_value, + self.get_log_value_from_file( + dec_log_name, + [keyword, "lib_rend"], + position, + strip_suffix=strip_suffix, + ), + ) + else: + rend_value = max( + rend_value, + self.get_log_value_from_file( + dec_log_name, + keyword, + position, + strip_suffix=strip_suffix, + ), + ) if encdec == 2: if max_or_add == "add": total = number_format.format( @@ -475,13 +526,13 @@ class IvasModeAnalyzer(IvasModeCollector): elif encdec == 4: if max_or_add == "add": total = number_format.format( - float(enc_value) + float(dec_value) + float(com_value) + float(enc_value) + float(dec_value) + float(com_value) + float(rend_value) ) elif max_or_add == "max": total = number_format.format( max( float(enc_value) + float(com_value), - float(dec_value) + float(com_value), + float(dec_value) + float(com_value) + float(rend_value), ) ) result_line = [ @@ -489,6 +540,7 @@ class IvasModeAnalyzer(IvasModeCollector): number_format.format(enc_value), number_format.format(float(dec_value)), number_format.format(com_value), + number_format.format(rend_value), total, ] result_table.append(result_line) @@ -885,6 +937,10 @@ class IvasModeAnalyzer(IvasModeCollector): ------- """ + + if not os.path.exists(os.path.dirname(csv_file_name)): + os.makedirs(os.path.dirname(csv_file_name)) + with open(csv_file_name + ".csv", "w", newline="\n") as f: header = result_table.pop(0) # write header diff --git a/scripts/pyivastest/IvasSvnBuilder.py b/scripts/pyivastest/IvasSvnBuilder.py index f12e71428646d4a115242ce0da5b034866e62a66..919ec6ae894428253a33b52e1babb7125ff3327e 100644 --- a/scripts/pyivastest/IvasSvnBuilder.py +++ b/scripts/pyivastest/IvasSvnBuilder.py @@ -275,7 +275,7 @@ class IvasBuilder(IvasBaseClass): build_log.write(" ".join(instrument_cmd)) build_log.write("\n") build_result = subprocess.run( - instrument_cmd, capture_output=True, text=True + instrument_cmd, capture_output=True, text=True, check=True ) build_log.write(build_result.stderr) build_log.write(build_result.stdout) diff --git a/scripts/td_object_renderer/object_renderer_standalone/Makefile b/scripts/td_object_renderer/object_renderer_standalone/Makefile index 42b762bcfe8f83aa3c5b0a375bcac961f08ed57b..5f27f599b3c85c5b5e9d7fe9654ba3104334a5e0 100644 --- a/scripts/td_object_renderer/object_renderer_standalone/Makefile +++ b/scripts/td_object_renderer/object_renderer_standalone/Makefile @@ -157,8 +157,8 @@ $(LIB_LIBREND): $(OBJS_LIBREND) $(LIB_LIBUTIL): $(OBJS_LIBUTIL) $(QUIET_AR)$(AR) rcs $@ $^ -$(CLI_REN): $(LIB_LIBENC) $(LIB_LIBDEC) $(LIB_LIBDEBUG) $(LIB_LIBCOM) $(LIB_LIBUTIL) $(OBJS_REN) - $(QUIET_LINK)$(CC) $(LDFLAGS) $(OBJS_REN) -L. -livasdebug -livasutil -livasenc -livasdec -livascom $(LDLIBS) -o $(CLI_REN) +$(CLI_REN): $(OBJS_REN) $(LIB_LIBENC) $(LIB_LIBDEC) $(LIB_LIBDEBUG) $(LIB_LIBCOM) $(LIB_LIBUTIL) $(LIB_LIBREND) + $(QUIET_LINK)$(CC) $(LDFLAGS) $(OBJS_REN) -L. -livasrend -livasdebug -livasutil -livasenc -livasdec -livascom $(LDLIBS) -o $(CLI_REN) libs: $(LIB_LIBENC) $(LIB_LIBDEBUG) $(LIB_LIBCOM) $(LIB_LIBDEC) $(LIB_LIBREND) $(LIB_LIBUTIL) diff --git a/scripts/td_object_renderer/object_renderer_standalone/object_renderer_standalone/renderer_standalone.c b/scripts/td_object_renderer/object_renderer_standalone/object_renderer_standalone/renderer_standalone.c index 3727aeec5be6c4faa609661f42c9c442fed9d536..f5748d7cf644a18f86e592758d9d4ff3a8a40f3b 100644 --- a/scripts/td_object_renderer/object_renderer_standalone/object_renderer_standalone/renderer_standalone.c +++ b/scripts/td_object_renderer/object_renderer_standalone/object_renderer_standalone/renderer_standalone.c @@ -43,7 +43,7 @@ #include "ivas_cnst.h" #include "ivas_stat_dec.h" #include "cnst.h" -#include "wmops.h" +#include "wmc_auto.h" #include "hrtf_file_reader.h" #include "ivas_error.h" @@ -132,9 +132,13 @@ int main( int argc, char *argv[] ) Decoder_Struct st_ivas_static; Decoder_Struct *st_ivas = &st_ivas_static; - MixFrame = count_malloc( 2 * L_FRAME48k * sizeof( float ) ); - MixFrameWav = count_malloc( 2 * L_FRAME48k * sizeof( int16_t ) ); - input_buff = count_malloc( MAX_CICP_CHANNELS * L_FRAME48k * sizeof( int16_t ) ); +#ifdef WMOPS + reset_mem( USE_32BITS ); +#endif + + MixFrame = malloc_( 2 * L_FRAME48k * sizeof( float ) ); + MixFrameWav = malloc_( 2 * L_FRAME48k * sizeof( int16_t ) ); + input_buff = malloc_( MAX_CICP_CHANNELS * L_FRAME48k * sizeof( int16_t ) ); nChannels = 0; noClipping = 0; @@ -148,7 +152,6 @@ int main( int argc, char *argv[] ) f_metadata[i] = NULL; } - /*------------------------------------------------------------------------------------------* * Struct initializations *------------------------------------------------------------------------------------------*/ @@ -157,7 +160,7 @@ int main( int argc, char *argv[] ) st_ivas->hHeadTrackData = NULL; st_ivas->ivas_format = ISM_FORMAT; f_quat_traj = NULL; - if ( ( st_ivas->hDecoderConfig = (DECODER_CONFIG_HANDLE) count_malloc( sizeof( DECODER_CONFIG ) ) ) == NULL ) + if ( ( st_ivas->hDecoderConfig = (DECODER_CONFIG_HANDLE) malloc_( sizeof( DECODER_CONFIG ) ) ) == NULL ) { return IVAS_ERR_FAILED_ALLOC; } @@ -276,7 +279,7 @@ int main( int argc, char *argv[] ) fprintf( stderr, "\nError: Unable to open metadata file %s \n\n", argv[i] ); exit( -1 ); } - st_ivas->hIsmMetaData[j] = (ISM_METADATA_HANDLE) count_malloc( sizeof( ISM_METADATA_FRAME ) ); + st_ivas->hIsmMetaData[j] = (ISM_METADATA_HANDLE) malloc_( sizeof( ISM_METADATA_FRAME ) ); i++; } } @@ -309,11 +312,10 @@ int main( int argc, char *argv[] ) usage_rend(); } - if ( f_quat_traj != NULL ) { st_ivas->hDecoderConfig->Opt_Headrotation = 1; - if ( ( st_ivas->hHeadTrackData = (HEAD_TRACK_DATA_HANDLE) count_malloc( sizeof( HEAD_TRACK_DATA ) ) ) == NULL ) + if ( ( st_ivas->hHeadTrackData = (HEAD_TRACK_DATA_HANDLE) malloc_( sizeof( HEAD_TRACK_DATA ) ) ) == NULL ) { fprintf( stderr, "Can not allocate memory for head-tracking\n" ); exit( -1 ); @@ -340,6 +342,7 @@ int main( int argc, char *argv[] ) /*------------------------------------------------------------------------------------------* * Main rendering loop *------------------------------------------------------------------------------------------*/ + fprintf( stdout, "Rendering...\n" ); while ( 1 ) { @@ -462,6 +465,10 @@ int main( int argc, char *argv[] ) } fwrite( MixFrameWav, sizeof( int16_t ), ( currFrameLength ) * NumLdspks, f_output ); +#ifdef WMOPS + update_wmops(); +#endif + nFrameCount++; frame++; @@ -478,12 +485,12 @@ int main( int argc, char *argv[] ) fclose( f_input ); fclose( f_output ); - count_free( MixFrame ); - count_free( MixFrameWav ); - count_free( input_buff ); + free_( MixFrame ); + free_( MixFrameWav ); + free_( input_buff ); ivas_td_binaural_close( &st_ivas->hBinRendererTd ); - count_free( st_ivas->hDecoderConfig ); + free_( st_ivas->hDecoderConfig ); st_ivas->hHrtfTD = NULL; /* ISM metadata handles */ @@ -491,23 +498,19 @@ int main( int argc, char *argv[] ) { if ( st_ivas->hIsmMetaData[n] != NULL ) { - count_free( st_ivas->hIsmMetaData[n] ); + free_( st_ivas->hIsmMetaData[n] ); st_ivas->hIsmMetaData[n] = NULL; } } if ( st_ivas->hHeadTrackData != NULL ) { - count_free( st_ivas->hHeadTrackData ); + free_( st_ivas->hHeadTrackData ); fclose( f_quat_traj ); } ivas_limiter_close( &st_ivas->hLimiter ); -#ifdef RAM_COUNTING_TOOL - mem_count_summary( USE_DEFAULT ); -#endif - #ifdef DEBUGGING dbgclose(); #endif @@ -517,6 +520,11 @@ int main( int argc, char *argv[] ) { fprintf( stderr, "*** Clipping on %d samples.\n", noClipping ); } + +#ifdef WMOPS + print_mem( NULL ); +#endif + /* system( "pause" ); */ return 0; } diff --git a/scripts/tools/Darwin/wmc_tool b/scripts/tools/Darwin/wmc_tool new file mode 100755 index 0000000000000000000000000000000000000000..1393aaa77f752e4595dfb5898a5a0b8a3e010ede Binary files /dev/null and b/scripts/tools/Darwin/wmc_tool differ diff --git a/scripts/tools/Linux/wmc_tool b/scripts/tools/Linux/wmc_tool new file mode 100755 index 0000000000000000000000000000000000000000..fa197f0647c5d4fc951fc688cd07695c6b66f1cd Binary files /dev/null and b/scripts/tools/Linux/wmc_tool differ diff --git a/scripts/tools/Win32/wmc_tool.exe b/scripts/tools/Win32/wmc_tool.exe new file mode 100755 index 0000000000000000000000000000000000000000..2c4859e0e56c4b5f62dc92e2427095aa94fe99be --- /dev/null +++ b/scripts/tools/Win32/wmc_tool.exe @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:85947566be9633b14ed4c2cf0b822333a2820ce02a3675ab837bc32b791790dc +size 176128 diff --git a/scripts/wmc_tool.exe b/scripts/wmc_tool.exe deleted file mode 100644 index 552430288695e2ec39dd000b7aec9e84232e718a..0000000000000000000000000000000000000000 --- a/scripts/wmc_tool.exe +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b213d20b8edf59a094f0d9d4dd2624d4bf9944d1cf7f9732b302c580b790bed1 -size 207360