Commit 9a11901a authored by vaclav's avatar vaclav
Browse files

- Merge remote-tracking branch 'remotes/origin/ivas-float-update' into...

- Merge remote-tracking branch 'remotes/origin/ivas-float-update' into 2052-ref-PortMr2088-from-float-leftovers-after-nonbe_unified_decoding_paths
parents de7ed670 f58f5ee3
Loading
Loading
Loading
Loading
Loading
+0 −35
Original line number Diff line number Diff line
@@ -147,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
@@ -194,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


/*------------------------------------------------------------------------------------------*
@@ -462,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 )
@@ -1070,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
@@ -1605,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;
@@ -1629,7 +1617,6 @@ static bool parseCmdlIVAS_dec(
            i++;
#endif
        }
#endif

        /*-----------------------------------------------------------------*
         * Option not recognized
@@ -1837,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" );
@@ -2599,7 +2584,6 @@ static ivas_error decodeG192(
                    return error;
                }

#ifdef OBJ_EDITING_API
                /* Object metadata editing */
                if ( arg.objEditEnabled )
                {
@@ -2624,12 +2608,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*/
@@ -2639,7 +2621,6 @@ static ivas_error decodeG192(
                        return error;
                    }
                }
#endif
                /* Do the final preparations needed for rendering */
                if ( ( error = IVAS_DEC_PrepareRenderer( hIvasDec ) ) != IVAS_ERR_OK )
                {
@@ -3206,9 +3187,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 parametersAvailableForEditing = false;
#endif
    uint16_t nSamplesRendered;

    vec_pos_update = 0;
@@ -3509,17 +3488,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, &parametersAvailableForEditing, 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, &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
#endif
            {
                fprintf( stderr, "\nError in IVAS_DEC_VoIP_GetSamples: %s\n", IVAS_DEC_GetErrorMessage( error ) );
@@ -3550,7 +3521,6 @@ static ivas_error decodeVoIP(
                }
            }

#ifdef OBJ_EDITING_API
            /* Object metadata editing */
            if ( arg.objEditEnabled && parametersAvailableForEditing == true )
            {
@@ -3564,14 +3534,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 )
                {
@@ -3579,7 +3547,6 @@ static ivas_error decodeVoIP(
                    return error;
                }
            }
#endif
        } /* while ( nSamplesRendered < nOutSamples ) */

        /* write JBM Offset file entry */
@@ -3885,7 +3852,6 @@ cleanup:
    return error;
}

#ifdef OBJ_EDITING_EXAMPLE

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

#endif
#ifdef DEBUGGING

/*---------------------------------------------------------------------*
+0 −4
Original line number Diff line number Diff line
@@ -131,13 +131,10 @@ typedef struct _IVAS_ISM_METADATA
    float yaw;
    float pitch;
    int16_t non_diegetic_flag;
#ifdef OBJ_EDITING_API
    float gain;
#endif

} IVAS_ISM_METADATA;

#ifdef OBJ_EDITING_API
typedef struct _IVAS_EDITABLE_PARAMETERS
{
    int16_t num_obj;
@@ -145,7 +142,6 @@ typedef struct _IVAS_EDITABLE_PARAMETERS
    float gain_bed;

} IVAS_EDITABLE_PARAMETERS;
#endif

typedef struct
{
+0 −2
Original line number Diff line number Diff line
@@ -1225,11 +1225,9 @@ enum
#define MASA_MAXIMUM_TWO_DIR_BANDS              24
#define NBITS_HR_COH                            4
#define OMASA_TDREND_MATCHING_GAIN              0.7943f
#ifdef OMASA_OBJECT_EDITING
#define OMASA_GAIN_EDIT_THR                     0.06f                       /* OMASA gain change threshold */
#define OMASA_AZI_EDIT_THR                      1.0f                        /* OMASA-DISC azimuth change threshold */
#define OMASA_ELE_EDIT_THR                      2.0f                        /* OMASA-DISC elevation change threshold */
#endif

#define MASA_JBM_RINGBUFFER_FRAMES              3

+0 −4
Original line number Diff line number Diff line
@@ -77,9 +77,7 @@ typedef enum
    IVAS_ERR_EXT_ORIENTATION_NOT_SUPPORTED,
    IVAS_ERR_DIRECTIVITY_NOT_SUPPORTED,
    IVAS_ERR_ACOUSTIC_ENVIRONMENT_NOT_SUPPORTED,
#ifdef OBJ_EDITING_API
    IVAS_ERR_OBJECTS_EDITING_NOT_SUPPORTED,
#endif
#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE
    IVAS_ERR_OBJECTS_EDITING_AND_PANNING_NOT_SUPPORTED,
#endif
@@ -261,10 +259,8 @@ static inline const char *ivas_error_to_string( ivas_error error_code )
            return "Directivity not supported";
        case IVAS_ERR_ACOUSTIC_ENVIRONMENT_NOT_SUPPORTED:
            return "Acoustic environment not supported";
#ifdef OBJ_EDITING_API
        case IVAS_ERR_OBJECTS_EDITING_NOT_SUPPORTED:
            return "Objects editing not supported";
#endif
#ifdef FIX_1217_OBJECT_EDIT_FILE_INTERFACE
        case IVAS_ERR_OBJECTS_EDITING_AND_PANNING_NOT_SUPPORTED:
            return "Wrong use of both Object editing and Non-diegetic panning";
+0 −2
Original line number Diff line number Diff line
@@ -418,7 +418,6 @@ void ivas_ism_reset_metadata(
    hIsmMeta->ism_metadata_flag = 0;
    hIsmMeta->non_diegetic_flag = 0;

#ifdef OBJ_EDITING_API
    hIsmMeta->edited_gain = 1.0f;
    hIsmMeta->edited_azimuth = 0.0f;
    hIsmMeta->edited_elevation = 0.0f;
@@ -427,7 +426,6 @@ void ivas_ism_reset_metadata(
    hIsmMeta->edited_radius = 1.0f;
    hIsmMeta->gain = 1.0f;
    hIsmMeta->non_diegetic_flag = 0;
#endif

    return;
}
Loading