Commit e42283d6 authored by vaillancour's avatar vaillancour
Browse files

make the decoder to compile with fixed point complexity enabled

parent 454da326
Loading
Loading
Loading
Loading
+54 −13
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@
 * Local constants
 *------------------------------------------------------------------------------------------*/

#if !defined( WMOPS )
#if !defined( WMOPS_FLT )
static
#endif
    int32_t frame = 0; /* Counter of frames */
@@ -76,7 +76,12 @@ static
/*------------------------------------------------------------------------------------------*
 * Local structure for storing cmdln arguments
 *------------------------------------------------------------------------------------------*/

#ifdef WMOPS
#include "stl.h"
extern int currCounter;
int idxG192;
int idxVOIP;
#endif
typedef struct
{
    char *inputBitstreamFilename;
@@ -160,11 +165,15 @@ int main(
    IVAS_RENDER_FRAMESIZE asked_frame_size;
    int16_t run_unit_tests = 0;

#ifdef WMOPS
#ifdef WMOPS_FLT
    reset_wmops();
    reset_mem( USE_BYTES );
#endif

#if ( WMOPS )
    Init_WMOPS_counter();
    Reset_WMOPS_counter();
    setFrameRate( 48000, 960 );
#endif
    /*------------------------------------------------------------------------------------------*
     * Parse command-line arguments
     *------------------------------------------------------------------------------------------*/
@@ -628,7 +637,7 @@ cleanup:
        fprintf( stderr, "\nError while closing file: %s\nContinuing...\n\n", arg.inputBitstreamFilename );
    }

#ifdef WMOPS
#ifdef WMOPS_FLT
    print_wmops();
    print_mem( NULL );
#endif
@@ -1526,10 +1535,18 @@ static ivas_error decodeG192(

    delayNumSamples_orig[0] = -1;

#ifdef WMOPS
#ifdef WMOPS_FLT
    reset_stack();
    reset_wmops();
#endif
#ifdef WMOPS
    //BASOP_end_noprint;
    //BASOP_init;
    Init_WMOPS_counter();
    Reset_WMOPS_counter();
    setFrameRate( 48000, 960 );
#endif

    nSamplesAvailableNext = 0;

    vec_pos_update = 0;
@@ -1555,7 +1572,10 @@ static ivas_error decodeG192(
    while ( 1 )
    {
        /* Read next frame if not enough samples availble */

#if ( WMOPS )
        fwc();
        Reset_WMOPS_counter();
#endif
        /* reference vector */
        if ( arg.enableReferenceVectorTracking && vec_pos_update == 0 )
        {
@@ -1671,13 +1691,18 @@ static ivas_error decodeG192(
                    goto cleanup;
                }
            }

#ifdef WMOPS
SUB_WMOPS_INIT( "IVAS_DEC_GetSamples" );
#endif
            if ( ( error = IVAS_DEC_GetSamples( hIvasDec, nSamplesToRender, ( pcmBuf + nOutChannels * nSamplesRendered ), &nSamplesRendered_loop, &needNewFrame ) ) != IVAS_ERR_OK )

                {
                    fprintf( stderr, "\nError in IVAS_DEC_GetSamples: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
                }
#ifdef WMOPS
END_SUB_WMOPS;
#endif
                nSamplesRendered += nSamplesRendered_loop;
                nSamplesToRender -= nSamplesRendered_loop;
            if ( needNewFrame )
@@ -1783,7 +1808,7 @@ static ivas_error decodeG192(
            }
        }
        vec_pos_update = ( vec_pos_update + 1 ) % vec_pos_len;
#ifdef WMOPS
#ifdef WMOPS_FLT
        if ( vec_pos_update == 0 )
        {
            update_wmops();
@@ -1792,6 +1817,16 @@ static ivas_error decodeG192(
            export_mem( "mem_analysis.csv" );
#endif
        }
#endif
#ifdef WMOPS
        if ( vec_pos_update == 0 )
        {
            /* update WMPOS counting (end of frame) */
            //BASOP_frame_update();
#if ( WMOPS )
            fwc();
#endif
        }
#endif
    }

@@ -1972,9 +2007,15 @@ static ivas_error decodeG192(
     *------------------------------------------------------------------------------------------*/

    decodingFailed = false; /* This will stay set to true if cleanup is reached via a goto due to an error */

    //BASOP_end
cleanup:

    /* free memory etc. */
#ifdef WMOPS
      fwc();
    printf( "\ndecoder complexity\n" );
    WMOPS_output( 0 );
    printf( "\n" );
#endif
    AudioFileWriter_close( &afWriter );
    MasaFileWriter_close( &masaWriter );
    for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; i++ )
@@ -2163,7 +2204,7 @@ static ivas_error decodeVoIP(
        fprintf( stdout, "\n-- Start the decoder (quiet mode) --\n\n" );
    }

#ifdef WMOPS
#ifdef WMOPS_FLT
    reset_stack();
    reset_wmops();
#endif
@@ -2446,7 +2487,7 @@ static ivas_error decodeVoIP(
        frame++;
        systemTime_ms += systemTimeInc_ms;

#ifdef WMOPS
#ifdef WMOPS_FLT
        update_mem();
        update_wmops();
#endif
+2 −2
Original line number Diff line number Diff line
@@ -59,9 +59,9 @@

#ifndef _COUNT_H
#define _COUNT_H "$Id$"
#if 0 
#if 1
#define WMOPS 1                 /* enable WMOPS profiling features */
#undef WMOPS /* disable WMOPS profiling features */
//#undef WMOPS /* disable WMOPS profiling features */
#endif
#define MAXCOUNTERS (256)

+9 −1
Original line number Diff line number Diff line
@@ -36,9 +36,14 @@

#ifndef _MOVE_H
#define _MOVE_H

#include "stl.h"
/* BASOP -> FLC brigde: data move counting */

#if (WMOPS)
extern BASIC_OP multiCounter[MAXCOUNTERS];
extern int currCounter;
#endif /* ifdef WMOPS */

static __inline void move16( void )
{
#ifdef WMOPS
@@ -55,6 +60,9 @@ static __inline void move32( void )

#ifdef ENH_64_BIT_OPERATOR
static __inline void move64(void) {
#ifdef WMOPS
  multiCounter[currCounter].move64++;
#endif /* if WMOPS */
}
#endif /* #ifdef ENH_64_BIT_OPERATOR */

lib_com/move.h.bak

0 → 100644
+94 −0
Original line number Diff line number Diff line
/******************************************************************************************************

   (C) 2022-2023 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.

*******************************************************************************************************/

/*====================================================================================
    EVS Codec 3GPP TS26.443 Nov 04, 2021. Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0
  ====================================================================================*/

#ifndef _MOVE_H
#define _MOVE_H
#include "stl.h"
/* BASOP -> FLC brigde: data move counting */

static __inline void move16( void )
{
#ifdef WMOPS
    multiCounter[currCounter].move16++;
#endif
}

static __inline void move32( void )
{
#ifdef WMOPS
    multiCounter[currCounter].move32++;
#endif
}

#ifdef ENH_64_BIT_OPERATOR
static __inline void move64(void) {
#ifdef WMOPS
  multiCounter[currCounter].move64++;
#endif /* if WMOPS */
}
#endif /* #ifdef ENH_64_BIT_OPERATOR */

static __inline void test( void )
{
#ifdef WMOPS
    multiCounter[currCounter].Test++;
#endif
}

static __inline void logic16( void )
{
#ifdef WMOPS
    multiCounter[currCounter].Logic16++;
#endif
}

static __inline void logic32( void )
{
#ifdef WMOPS
    multiCounter[currCounter].Logic32++;
#endif
}

/*-------- legacy ----------*/
#define data_move()          move16()
#define L_data_move()        move32()
#define data_move_external() move16()
#define compare_zero()       test()
/*-------- end legacy ----------*/

#define cast16 move16

#endif /* _MOVE_H */
+1 −1
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@
#pragma warning(disable:4310)     /* cast truncates constant value this affects mainly constants tables*/
#endif

/*#define WMOPS*/                               /* Activate complexity and memory counters */
#define WMOPS  1                             /* 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 */
Loading