Commit c0da2a83 authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch 'ivas-float-update' into 2106_ref_several_small_code_improvements

parents 0a9042ac 829228ec
Loading
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -469,11 +469,15 @@
    <ClCompile Include="..\lib_com\ivas_lfe_com.c">
      <Filter>common_ivas_c</Filter>
    </ClCompile>
    <ClCompile Include="..\lib_com\ivas_rotation_com.c" />
    <ClCompile Include="..\lib_com\ivas_limiter.c" />
    <ClCompile Include="..\lib_com\ivas_osba_com.c">
      <Filter>common_ivas_c</Filter>
    </ClCompile>
    <ClCompile Include="..\lib_com\ivas_rotation_com.c">
      <Filter>common_ivas_c</Filter>
    </ClCompile>
    <ClCompile Include="..\lib_com\ivas_limiter.c">
      <Filter>common_ivas_c</Filter>
    </ClCompile>
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="..\lib_com\basop_proto_func.h">
+50 −74
Original line number Diff line number Diff line
@@ -75,22 +75,10 @@ static
#endif
    int32_t frame = 0; /* Counter of frames */

#ifdef DEBUGGING
#define MIN_NUM_BITS_ACTIVE_FRAME 56
#define NUM_BITS_SID_IVAS_5K2     104
#define MAX_OUTPUT_PCM_BUFFER_SIZE ( ( IVAS_MAX_OUTPUT_CHANNELS + IVAS_MAX_NUM_OBJECTS ) * IVAS_MAX_FRAME_SIZE )

#define ORIENT_TRK_NONE        ( 0 )
#define ORIENT_TRK_REF         ( 1 )
#define ORIENT_TRK_AVG         ( 2 )
#define ORIENT_TRK_REF_VEC     ( 3 )
#define ORIENT_TRK_REF_VEC_LEV ( 4 )

#ifdef VARIABLE_SPEED_DECODING
#define VARIABLE_SPEED_FETCH_FRAMESIZE_MS 20
#endif
#define JBM_FRONTEND_FETCH_FRAMESIZE_MS 20
#define HEADROTATION_FETCH_FRAMESIZE_MS 5
#define DEFAULT_FETCH_FRAMESIZE_MS      20


/*------------------------------------------------------------------------------------------*
@@ -136,7 +124,7 @@ typedef struct
    IVAS_DEC_INPUT_FORMAT inputFormat;
    bool customLsOutputEnabled;
    char *customLsSetupFilename;
    int16_t orientation_tracking;
    IVAS_HEAD_ORIENT_TRK_T orientation_tracking;
    bool non_diegetic_pan_enabled;
    float non_diegetic_pan_gain;
    bool renderConfigEnabled;
@@ -159,9 +147,7 @@ typedef struct
    AcousticEnvironmentSequence aeSequence;
    bool dpidEnabled;
    uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS];
#ifdef OBJ_EDITING_COMMANDLINE
    bool objEditEnabled;
#endif
#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE
    char *objEditFileName;
#endif
@@ -195,10 +181,10 @@ static bool parseCmdlIVAS_dec( int16_t argc, char **argv, DecArguments *arg );
static void usage_dec( void );
#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE
static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf );
static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, IVAS_DEC_HANDLE hIvasDec );
static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf );
#else
static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf );
static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec );
static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf );
#endif
static ivas_error load_hrtf_from_file( IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, IVAS_DEC_HANDLE hIvasDec, const IVAS_AUDIO_CONFIG OutputConfig, const int32_t output_Fs );
#ifdef DEBUGGING
@@ -206,13 +192,11 @@ static ivas_error printBitstreamInfoVoip( DecArguments arg, BS_READER_HANDLE hBs
static int16_t app_own_random( int16_t *seed );
static IVAS_DEC_FORCED_REND_MODE parseForcedRendModeDec( char *forcedRendModeChar );
#endif
#ifdef OBJ_EDITING_EXAMPLE
#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE
static void do_object_editing( IVAS_EDITABLE_PARAMETERS *editableParameters, ObjectEditFileReader *objectEditFileReader );
#else
static void do_object_editing( IVAS_EDITABLE_PARAMETERS *editableParameters );
#endif
#endif


/*------------------------------------------------------------------------------------------*
@@ -384,7 +368,7 @@ int main(
        }

        /* sanity check */
        if ( arg.orientation_tracking != ORIENT_TRK_REF )
        if ( arg.orientation_tracking != IVAS_HEAD_ORIENT_TRK_REF )
        {
            fprintf( stderr, "\nError: Reference rotation file can be used in '-otr ref' mode only.\n\n" );
            goto cleanup;
@@ -411,7 +395,7 @@ int main(
        }

        /* sanity check */
        if ( arg.orientation_tracking != ORIENT_TRK_REF_VEC && arg.orientation_tracking != ORIENT_TRK_REF_VEC_LEV )
        if ( arg.orientation_tracking != IVAS_HEAD_ORIENT_TRK_REF_VEC && arg.orientation_tracking != IVAS_HEAD_ORIENT_TRK_REF_VEC_LEV )
        {
            fprintf( stderr, "\nError: Reference trajectory file can be used in '-otr ref_vec' or '-otr ref_vec_lev' mode only.\n\n" );
            goto cleanup;
@@ -474,13 +458,8 @@ int main(
    uint16_t aeID = arg.aeSequence.count > 0 ? arg.aeSequence.pID[0] : 65535;

#ifdef LIB_DEC_REVISION
#ifdef OBJ_EDITING_COMMANDLINE
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.non_diegetic_pan_enabled, arg.non_diegetic_pan_gain,
                                       arg.dpidEnabled, aeID, arg.objEditEnabled, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
#else
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.non_diegetic_pan_enabled, arg.non_diegetic_pan_gain,
                                       arg.dpidEnabled, aeID, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
#endif
#else
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.non_diegetic_pan_enabled, arg.non_diegetic_pan_gain,
                                       arg.dpidEnabled, aeID, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
@@ -802,9 +781,9 @@ int main(
    if ( arg.voipMode )
    {
#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE
        error = decodeVoIP( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, objectEditFileReader, hIvasDec );
        error = decodeVoIP( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, objectEditFileReader, hIvasDec, pcmBuf );
#else
        error = decodeVoIP( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, hIvasDec );
        error = decodeVoIP( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, hIvasDec, pcmBuf );
#endif
    }
    else
@@ -1010,6 +989,10 @@ static bool parseCmdlIVAS_dec(
    int16_t i;
    char argv_to_upper[FILENAME_MAX];

    /*-----------------------------------------------------------------*
     * Set default values
     *-----------------------------------------------------------------*/

#ifdef DEBUGGING
    float ftmp;

@@ -1018,7 +1001,7 @@ static bool parseCmdlIVAS_dec(
    arg->agcBitstream = NULL;
#endif
#endif
    arg->output_Fs = 48000;
    arg->output_Fs = IVAS_MAX_SAMPLING_RATE;
    arg->outputConfig = IVAS_AUDIO_CONFIG_MONO;
    arg->decMode = IVAS_DEC_MODE_IVAS;
    arg->quietModeEnabled = false;
@@ -1028,7 +1011,7 @@ static bool parseCmdlIVAS_dec(

    arg->enableHeadRotation = false;
    arg->headrotTrajFileName = NULL;
    arg->orientation_tracking = ORIENT_TRK_NONE;
    arg->orientation_tracking = IVAS_HEAD_ORIENT_TRK_NONE;
    arg->enableReferenceRotation = false;
    arg->headrotTrajFileName = NULL;
    arg->enableReferenceVectorTracking = false;
@@ -1078,9 +1061,7 @@ static bool parseCmdlIVAS_dec(
        arg->directivityPatternId[i] = 65535;
    }

#ifdef OBJ_EDITING_COMMANDLINE
    arg->objEditEnabled = false;
#endif
#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE
    arg->objEditFileName = NULL;
#endif
@@ -1244,9 +1225,9 @@ static bool parseCmdlIVAS_dec(
                }
                arg->tsmScale = (uint16_t) tmp;

                if ( arg->tsmScale < 50 || arg->tsmScale > 150 )
                if ( arg->tsmScale < IVAS_TIME_SCALE_MIN || arg->tsmScale > IVAS_TIME_SCALE_MAX )
                {
                    fprintf( stderr, "Error: Scaling factor value must be 50 <= fac <= 150!\n\n" );
                    fprintf( stderr, "Error: Scaling factor value must be IVAS_TIME_SCALE_MIN  <= fac <= IVAS_TIME_SCALE_MAX !\n\n" );
                    usage_dec();
                    return false;
                }
@@ -1321,23 +1302,23 @@ static bool parseCmdlIVAS_dec(

            if ( strcmp( argv_to_upper, "NONE" ) == 0 )
            {
                arg->orientation_tracking = ORIENT_TRK_NONE;
                arg->orientation_tracking = IVAS_HEAD_ORIENT_TRK_NONE;
            }
            else if ( strcmp( argv_to_upper, "REF" ) == 0 )
            {
                arg->orientation_tracking = ORIENT_TRK_REF;
                arg->orientation_tracking = IVAS_HEAD_ORIENT_TRK_REF;
            }
            else if ( strcmp( argv_to_upper, "AVG" ) == 0 )
            {
                arg->orientation_tracking = ORIENT_TRK_AVG;
                arg->orientation_tracking = IVAS_HEAD_ORIENT_TRK_AVG;
            }
            else if ( strcmp( argv_to_upper, "REF_VEC" ) == 0 )
            {
                arg->orientation_tracking = ORIENT_TRK_REF_VEC;
                arg->orientation_tracking = IVAS_HEAD_ORIENT_TRK_REF_VEC;
            }
            else if ( strcmp( argv_to_upper, "REF_VEC_LEV" ) == 0 )
            {
                arg->orientation_tracking = ORIENT_TRK_REF_VEC_LEV;
                arg->orientation_tracking = IVAS_HEAD_ORIENT_TRK_REF_VEC_LEV;
            }
            else
            {
@@ -1613,7 +1594,6 @@ static bool parseCmdlIVAS_dec(

            i += tmp;
        }
#ifdef OBJ_EDITING_COMMANDLINE
        else if ( strcmp( argv_to_upper, "-OBJ_EDIT" ) == 0 )
        {
            arg->objEditEnabled = true;
@@ -1637,7 +1617,6 @@ static bool parseCmdlIVAS_dec(
            i++;
#endif
        }
#endif

        /*-----------------------------------------------------------------*
         * Option not recognized
@@ -1795,7 +1774,7 @@ static void usage_dec( void )
#ifdef DEBUGGING
#ifdef VARIABLE_SPEED_DECODING
    fprintf( stdout, "-VS fac             : Variable Speed mode: change speed of playout fac as integer in percent.\n" );
    fprintf( stdout, "                      50 <= fac <= 150; fac<100 faster, fac>100 slower\n" );
    fprintf( stdout, "                      IVAS_TIME_SCALE_MIN <= fac <= IVAS_TIME_SCALE_MAX; fac<100 faster, fac>100 slower\n" );
#endif
#endif
    fprintf( stdout, "-fr L               : render frame size in ms L=(5,10,20), default is 20)\n" );
@@ -1845,12 +1824,10 @@ static void usage_dec( void )
    fprintf( stdout, "                      ID and duration pairs, where duration is specified in frames\n" );
#endif
    fprintf( stdout, "                      for BINAURAL_ROOM_REVERB output configuration.\n" );
#ifdef OBJ_EDITING_COMMANDLINE
#ifndef FIX_1217_OBJECT_EDIT_FILE_INTERFACE
    fprintf( stdout, "-obj_edit           : Enable objects editing\n" );
#else
    fprintf( stdout, "-obj_edit File      : Object editing instructions file or NULL for built-in example\n" );
#endif
#endif
    fprintf( stdout, "-level level        : Complexity level, level = (1, 2, 3), will be defined after characterisation. \n" );
    fprintf( stdout, "                      Currently, all values default to level 3 (full functionality).\n" );
@@ -2611,7 +2588,6 @@ static ivas_error decodeG192(
                    return error;
                }

#ifdef OBJ_EDITING_API
                /* Object metadata editing */
                if ( arg.objEditEnabled )
                {
@@ -2636,12 +2612,10 @@ static ivas_error decodeG192(
#endif

                    /* Do object metadata editing here ... */
#ifdef OBJ_EDITING_EXAMPLE
#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE
                    do_object_editing( &editableParameters, objectEditFileReader );
#else
                    do_object_editing( &editableParameters );
#endif
#endif

                    /* set new object parameters*/
@@ -2651,7 +2625,6 @@ static ivas_error decodeG192(
                        return error;
                    }
                }
#endif
                /* Do the final preparations needed for rendering */
                if ( ( error = IVAS_DEC_PrepareRenderer( hIvasDec ) ) != IVAS_ERR_OK )
                {
@@ -3172,14 +3145,15 @@ static ivas_error decodeVoIP(
#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE
    ObjectEditFileReader *objectEditFileReader,
#endif
    IVAS_DEC_HANDLE hIvasDec )
    IVAS_DEC_HANDLE hIvasDec,
    int16_t *pcmBuf )
{
    bool decodingFailed = true; /* Assume failure until cleanup is reached without errors */
    ivas_error error = IVAS_ERR_OK;

    uint32_t nextPacketRcvTime_ms = 0;
    uint32_t systemTime_ms = 0;
    uint32_t systemTimeInc_ms = (uint32_t) JBM_FRONTEND_FETCH_FRAMESIZE_MS;
    uint32_t systemTimeInc_ms = (uint32_t) ( 1000 / IVAS_NUM_FRAMES_PER_SEC );
    int32_t nFramesFed = 0;

    uint8_t au[( IVAS_MAX_BITS_PER_FRAME + 7 ) >> 3];
@@ -3193,7 +3167,6 @@ static ivas_error decodeVoIP(
    MasaFileWriter *masaWriter = NULL;
    uint16_t numObj = 0;

    int16_t pcmBuf[MAX_OUTPUT_PCM_BUFFER_SIZE];
    AudioFileWriter *afWriter = NULL;
#ifdef SUPPORT_JBM_TRACEFILE
    JbmTraceFileWriter *jbmTraceWriter = NULL;
@@ -3218,9 +3191,7 @@ static ivas_error decodeVoIP(
    int16_t vec_pos_update, vec_pos_len;
    int16_t nOutSamples = 0;
    bool bitstreamReadDone = false;
#ifdef OBJ_EDITING_API
    bool parameterAvailableForEditing = false;
#endif
    bool parametersAvailableForEditing = false;
    uint16_t nSamplesRendered;

    vec_pos_update = 0;
@@ -3453,7 +3424,11 @@ static ivas_error decodeVoIP(
        }

#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE
#ifdef NONBE_FIX_1255_OBJ_EDIT_JBM
        if ( arg.objEditEnabled && arg.objEditFileName != NULL && vec_pos_update == 0 )
#else
        if ( arg.objEditEnabled && ( arg.objEditFileName != NULL ) )
#endif
        {
            if ( ( error = ObjectEditFileReader_readNextFrame( objectEditFileReader ) ) != IVAS_ERR_OK )
            {
@@ -3517,17 +3492,9 @@ static ivas_error decodeVoIP(
        while ( nSamplesRendered < nOutSamples )
        {
#ifdef SUPPORT_JBM_TRACEFILE
#ifdef OBJ_EDITING_API
            if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &bitstreamReadDone, &nSamplesRendered, &parameterAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK )
#else
            if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &bitstreamReadDone, &nSamplesRendered, systemTime_ms ) ) != IVAS_ERR_OK )
#endif
#else
#ifdef OBJ_EDITING_API
            if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, &bitstreamReadDone, &parameterAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK )
            if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &bitstreamReadDone, &nSamplesRendered, &parametersAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK )
#else
            if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, &bitstreamReadDone, systemTime_ms ) ) != IVAS_ERR_OK )
#endif
            if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, &bitstreamReadDone, &parametersAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK )
#endif
            {
                fprintf( stderr, "\nError in IVAS_DEC_VoIP_GetSamples: %s\n", IVAS_DEC_GetErrorMessage( error ) );
@@ -3558,9 +3525,8 @@ static ivas_error decodeVoIP(
                }
            }

#ifdef OBJ_EDITING_API
            /* Object metadata editing */
            if ( arg.objEditEnabled && parameterAvailableForEditing == true )
            if ( arg.objEditEnabled && parametersAvailableForEditing == true )
            {
                IVAS_EDITABLE_PARAMETERS editableParameters;

@@ -3572,14 +3538,12 @@ static ivas_error decodeVoIP(
                }

                /* Do object metadata editing here ... */
#ifdef OBJ_EDITING_EXAMPLE
#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE
                do_object_editing( &editableParameters, objectEditFileReader );
#else
                do_object_editing( &editableParameters );
#endif

#endif
                /* set new object parameters */
                if ( ( error = IVAS_DEC_SetEditableParameters( hIvasDec, editableParameters ) ) != IVAS_ERR_OK )
                {
@@ -3587,7 +3551,6 @@ static ivas_error decodeVoIP(
                    return error;
                }
            }
#endif
        } /* while ( nSamplesRendered < nOutSamples ) */

        /* write JBM Offset file entry */
@@ -3713,17 +3676,32 @@ static ivas_error decodeVoIP(
            }
        }

#ifdef NONBE_FIX_1255_OBJ_EDIT_JBM
        vec_pos_update = ( vec_pos_update + 1 ) % vec_pos_len;
#else
        if ( !arg.quietModeEnabled )
        {
            fprintf( stdout, "%-8d\b\b\b\b\b\b\b\b", frame );
        }
        vec_pos_update = ( vec_pos_update + 1 ) % vec_pos_len;
        frame++;
#endif
        if ( vec_pos_update == 0 )
        {
            systemTime_ms += vec_pos_len * systemTimeInc_ms;
        }

#ifdef NONBE_FIX_1255_OBJ_EDIT_JBM
        if ( vec_pos_update == 0 )
        {
            frame++;
            if ( !arg.quietModeEnabled )
            {
                fprintf( stdout, "%-8d\b\b\b\b\b\b\b\b", frame );
            }
        }
#endif

#ifdef WMOPS
        update_mem();
        update_wmops();
@@ -3878,7 +3856,6 @@ cleanup:
    return error;
}

#ifdef OBJ_EDITING_EXAMPLE

/*---------------------------------------------------------------------*
 * do_object_editing()
@@ -3999,7 +3976,6 @@ static void do_object_editing(
    return;
}

#endif
#ifdef DEBUGGING

/*---------------------------------------------------------------------*
+22 −29
Original line number Diff line number Diff line
@@ -170,7 +170,6 @@ typedef struct
 * Local functions prototypes
 *------------------------------------------------------------------------------------------*/

static void initArgStruct( EncArguments *arg );
static bool parseCmdlIVAS_enc( int16_t argc, char *argv[], EncArguments *arg );
static void usage_enc( void );
static bool readBandwidth( FILE *file, IVAS_ENC_BANDWIDTH *bandwidth, int32_t *bandwidthFrameCounter );
@@ -223,8 +222,6 @@ int main(
    reset_mem( USE_BYTES );
#endif

    initArgStruct( &arg );

    /*------------------------------------------------------------------------------------------*
     * Parse command-line arguments
     *------------------------------------------------------------------------------------------*/
@@ -906,14 +903,29 @@ cleanup:
 * Local functions
 *-------------------------------------------------------------------*/

#define IVAS_DEFAULT_AGC ( 0 )
/*---------------------------------------------------------------------*
 * parseCmdlIVAS_enc()
 *
 * Encoder command-line parsing
 *---------------------------------------------------------------------*/

static void initArgStruct( EncArguments *arg )
static bool parseCmdlIVAS_enc(
    int16_t argc,
    char *argv[],
    EncArguments *arg )
{
    /* Set default values here */
    int16_t i, j;
    char argv_to_upper[FILENAME_MAX];
    char stmp[FILENAME_MAX];
    int32_t tmp;

    /*-----------------------------------------------------------------*
     * Set default values
     *-----------------------------------------------------------------*/

    arg->inputWavFilename = NULL;
    arg->outputBitstreamFilename = NULL;
    arg->inputFs = 0;
    arg->inputFs = IVAS_MAX_SAMPLING_RATE;
    arg->inputFormat = IVAS_ENC_INPUT_MONO;
    arg->is_binaural = false;
    arg->inputFormatConfig.stereoToMonoDownmix = false;
@@ -935,9 +947,6 @@ static void initArgStruct( EncArguments *arg )
#ifdef DEBUGGING
    arg->forcedMode = IVAS_ENC_FORCE_UNFORCED;
    arg->forcedModeFile = NULL;
#ifdef DEBUG_FORCE_DIR
    arg->forcedModeDir = NULL;
#endif
#ifdef DEBUG_AGC_ENCODER_CMD_OPTION
    arg->agc = IVAS_ENC_AGC_UNDEFINED;
#endif
@@ -950,25 +959,9 @@ static void initArgStruct( EncArguments *arg )
#endif
    arg->pca = false;

    return;
}


/*---------------------------------------------------------------------*
 * parseCmdlIVAS_enc()
 *
 * Encoder command-line parsing
 *---------------------------------------------------------------------*/

static bool parseCmdlIVAS_enc(
    int16_t argc,
    char *argv[],
    EncArguments *arg )
{
    int16_t i, j;
    char argv_to_upper[FILENAME_MAX];
    char stmp[FILENAME_MAX];
    int32_t tmp;
    /*-----------------------------------------------------------------*
     * Initialization
     *-----------------------------------------------------------------*/

    if ( argc < 5 )
    {
+1 −1
Original line number Diff line number Diff line
@@ -920,7 +920,7 @@ int main(

    memset( outBuffer.data, 0, outBuffer.config.numSamplesPerChannel * outBuffer.config.numChannels * sizeof( float ) );

    bitsBufferSize = SPLIT_REND_BITS_BUFF_SIZE;
    bitsBufferSize = ISAR_SPLIT_REND_BITS_BUFF_SIZE;

    if ( bitsBufferSize > 0 )
    {
+3 −3
Original line number Diff line number Diff line
@@ -170,7 +170,7 @@ typedef struct
    char externalOrientationFilePath[RENDERER_MAX_CLI_ARG_LENGTH];
    char customHrtfFilePath[RENDERER_MAX_CLI_ARG_LENGTH];
    char renderConfigFilePath[RENDERER_MAX_CLI_ARG_LENGTH];
    int8_t orientation_tracking;
    IVAS_HEAD_ORIENT_TRK_T orientation_tracking;
    int16_t Opt_Headrotation;
    int16_t Opt_ExternalOrientation;
    int16_t nonDiegeticPan;
@@ -1477,7 +1477,7 @@ int main(

    if ( is_split_pre_rend_mode( &args ) )
    {
        bitsBufferSize = SPLIT_REND_BITS_BUFF_SIZE;
        bitsBufferSize = ISAR_SPLIT_REND_BITS_BUFF_SIZE;
    }
    else
    {
@@ -2312,7 +2312,7 @@ static bool parseRenderFramesize(

static bool parseOrientationTracking(
    char *value,
    int8_t *orientation_tracking )
    IVAS_HEAD_ORIENT_TRK_T *orientation_tracking )
{
    to_upper( value );

Loading