Commit 9b97446a authored by malenov's avatar malenov
Browse files

corrections in main encoder/decoder functions

parent 57643faf
Loading
Loading
Loading
Loading
Loading
+26 −35
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@
#include "rotation_file_reader.h"
#include "vector3_pair_file_reader.h"
#include "wmc_auto.h"
#include "options.h"
#include "stl.h"


@@ -54,7 +55,7 @@
 * Local constants
 *------------------------------------------------------------------------------------------*/

#if !defined( DEBUGGING ) && !defined( WMOPS_FLT )
#if !defined( DEBUGGING ) && !defined( WMOPS )
static
#endif
    int32_t frame = 0; /* Counter of frames */
@@ -161,15 +162,13 @@ int main(
    IVAS_RENDER_FRAMESIZE asked_frame_size;
    int16_t run_unit_tests = 0;

#ifdef WMOPS_FLT
#ifdef WMOPS
#ifndef DONT_COUNT
    reset_wmops();
    reset_mem( USE_BYTES );
#endif
#if ( WMOPS )
#ifndef DONT_COUNT
    BASOP_init
#endif
#endif

    /*------------------------------------------------------------------------------------------*
     * Parse command-line arguments
     *------------------------------------------------------------------------------------------*/
@@ -611,11 +610,7 @@ int main(
    mainFailed = false; /* This will stay set to true if cleanup is reached via a goto due to an error */

cleanup:
#ifndef DONT_COUNT
    /* end of WMOPS counting */
    BASOP_end
        BASOP_end_noprint
#endif

    free( pcmBuf );

    if ( arg.hrtfReaderEnabled )
@@ -642,10 +637,11 @@ cleanup:
        fprintf( stderr, "\nError while closing file: %s\nContinuing...\n\n", arg.inputBitstreamFilename );
    }

#ifdef WMOPS_FLT
#ifdef WMOPS
    print_wmops();
    print_mem( NULL );
#endif

    if ( !arg.quietModeEnabled )
    {
        printf( "\n" );
@@ -1550,7 +1546,7 @@ static ivas_error decodeG192(

    delayNumSamples_orig[0] = -1;

#ifdef WMOPS_FLT
#ifdef WMOPS
    reset_stack();
    reset_wmops();
#endif
@@ -1806,28 +1802,21 @@ static ivas_error decodeG192(
                }
            }
        }

        vec_pos_update = ( vec_pos_update + 1 ) % vec_pos_len;
#ifdef WMOPS_FLT
        if ( vec_pos_update == 0 )
        {
            update_wmops();
            update_mem();
#ifdef MEM_COUNT_DETAILS
            export_mem( "mem_analysis.csv" );
#endif
        }
#endif

#ifdef WMOPS
#ifndef DONT_COUNT
        if ( vec_pos_update == 0 )
        {
            /* update WMPOS counting (end of frame) */
            BASOP_frame_update();
            update_wmops();
            update_mem();
        }

#endif
#endif

    }

    /*------------------------------------------------------------------------------------------*
     * Flush what is still left in the VoIP Buffers....
     *------------------------------------------------------------------------------------------*/
@@ -1948,12 +1937,17 @@ static ivas_error decodeG192(
                }
            }
        }

#ifdef WMOPS
#ifndef DONT_COUNT
        /* update WMPOS counting (end of frame) */
        BASOP_frame_update();
        update_wmops();
        update_mem();
#ifdef MEM_COUNT_DETAILS
        export_mem( "mem_analysis.csv" );
#endif
#endif
#endif

        frame++;
        if ( !arg.quietModeEnabled )
        {
@@ -2211,7 +2205,7 @@ static ivas_error decodeVoIP(
        fprintf( stdout, "\n-- Start the decoder (quiet mode) --\n\n" );
    }

#ifdef WMOPS_FLT
#ifdef WMOPS
    reset_stack();
    reset_wmops();
#endif
@@ -2493,15 +2487,12 @@ static ivas_error decodeVoIP(
        vec_pos_update = ( vec_pos_update + 1 ) % vec_pos_len;
        frame++;
        systemTime_ms += systemTimeInc_ms;

#ifdef WMOPS
#ifndef DONT_COUNT
        /* update WMPOS counting (end of frame) */
        BASOP_frame_update();
#endif
#endif
#ifdef WMOPS_FLT
        update_mem();
        update_wmops();
#endif
#endif
    }

+1 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@
#include "jbm_file_reader.h"
#include "masa_file_reader.h"
#include "wmc_auto.h"
#include "options.h"
#include "stl.h"