Commit 0c6a51a0 authored by multrus's avatar multrus
Browse files

[cleanup] accept OBJ_EDITING_INTERFACE, OBJ_EDITING_API, OBJ_EDITING_EXAMPLE,...

[cleanup] accept OBJ_EDITING_INTERFACE, OBJ_EDITING_API, OBJ_EDITING_EXAMPLE, OMASA_OBJECT_EDITING, OBJ_EDITING_PARAMISM_BIN
parent 7ab76d69
Loading
Loading
Loading
Loading
+0 −44
Original line number Diff line number Diff line
@@ -197,9 +197,7 @@ 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
static void do_object_editing( IVAS_EDITABLE_PARAMETERS *editableParameters );
#endif


/*------------------------------------------------------------------------------------------*
@@ -2506,11 +2504,9 @@ static ivas_error decodeG192(
#else
                /* Feed into decoder */
                if ( ( error = IVAS_DEC_FeedFrame_Serial( hIvasDec, bit_stream, num_bits, bfi
#ifdef OBJ_EDITING_API
                                                          ,
                                                          isSplitRend,
                                                          splitRendBits
#endif
                                                          ) ) != IVAS_ERR_OK )
#endif
                {
@@ -2547,7 +2543,6 @@ static ivas_error decodeG192(
                }

#endif
#ifdef OBJ_EDITING_API
                /* Object metadata editing */
                if ( arg.objEditEnabled )
                {
@@ -2561,10 +2556,8 @@ static ivas_error decodeG192(
                    }

                    /* Do object metadata editing here ... */
#ifdef OBJ_EDITING_EXAMPLE
                    do_object_editing( &editableParameters );

#endif
                    /* set new object parameters */
                    if ( ( error = IVAS_DEC_SetEditableParameters( hIvasDec, editableParameters ) ) != IVAS_ERR_OK )
                    {
@@ -2580,7 +2573,6 @@ static ivas_error decodeG192(
                    goto cleanup;
                }
            }
#endif

            /* Render */
            if ( isSplitRend )
@@ -2596,19 +2588,11 @@ static ivas_error decodeG192(
            }
            else
            {
#ifdef OBJ_EDITING_API
                if ( ( error = IVAS_DEC_GetSamplesRenderer( hIvasDec, nSamplesToRender, IVAS_DEC_PCM_INT16, (void *) ( pcmBuf + nOutChannels * nSamplesRendered ), &nSamplesRendered_loop, &needNewFrame ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError in IVAS_DEC_GetSamplesRenderer(): %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
                }
#else
                    if ( ( error = IVAS_DEC_GetSamples( hIvasDec, nSamplesToRender, IVAS_DEC_PCM_INT16, (void *) ( pcmBuf + nOutChannels * nSamplesRendered ), &nSamplesRendered_loop, &needNewFrame ) ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "\nError in IVAS_DEC_GetSamples: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                        goto cleanup;
                    }
#endif

                nSamplesRendered += nSamplesRendered_loop;
                nSamplesToRender -= nSamplesRendered_loop;
@@ -3147,10 +3131,8 @@ static ivas_error decodeVoIP(
    bool bitstreamReadDone = false;
#endif

#ifdef OBJ_EDITING_API
    bool parameterAvailableForEditing = false;
    uint16_t nSamplesRendered = 0;
#endif

    vec_pos_update = 0;
    if ( ( error = IVAS_DEC_GetRenderFramesizeMs( hIvasDec, &systemTimeInc_ms ) ) != IVAS_ERR_OK )
@@ -3268,9 +3250,7 @@ static ivas_error decodeVoIP(

    while ( 1 )
    {
#ifdef OBJ_EDITING_API
        nSamplesRendered = 0;
#endif

        /* reference vector */
        if ( arg.enableReferenceVectorTracking && vec_pos_update == 0 )
@@ -3433,37 +3413,19 @@ static ivas_error decodeVoIP(


        /* decode and get samples */
#ifdef OBJ_EDITING_API
        while ( nSamplesRendered < nOutSamples )
        {
#endif
#ifdef SUPPORT_JBM_TRACEFILE
#ifdef FIX_HRTF_LOAD
#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, 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, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &nSamplesRendered, &parameterAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK )
#else
            if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, writeJbmTraceFileFrameWrapper, jbmTraceWriter, systemTime_ms ) ) != IVAS_ERR_OK )
#endif
#endif
#else
#ifdef FIX_HRTF_LOAD
#ifdef OBJ_EDITING_API
            if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, &bitstreamReadDone, &nSamplesRendered, &parameterAvailableForEditing, 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
#else
#ifdef OBJ_EDITING_API
            if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, systemTime_ms, &nSamplesRendered, &parameterAvailableForEditing ) ) != IVAS_ERR_OK )
#else
            if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, systemTime_ms ) ) != IVAS_ERR_OK )
#endif
#endif
#endif
            {
@@ -3497,7 +3459,6 @@ static ivas_error decodeVoIP(
            }

#endif
#ifdef OBJ_EDITING_API
            /* Object metadata editing */
            if ( arg.objEditEnabled && parameterAvailableForEditing == true )
            {
@@ -3511,10 +3472,8 @@ static ivas_error decodeVoIP(
                }

                /* Do object metadata editing here ... */
#ifdef OBJ_EDITING_EXAMPLE
                do_object_editing( &editableParameters );

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

        /* write JBM Offset file entry */
        if ( jbmOffsetWriter != NULL )
@@ -3806,7 +3764,6 @@ cleanup:
    return error;
}

#ifdef OBJ_EDITING_EXAMPLE

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

#endif

#ifdef DEBUGGING

+0 −4
Original line number Diff line number Diff line
@@ -128,13 +128,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;
@@ -142,7 +139,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
@@ -1219,11 +1219,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
    IVAS_ERR_INVALID_HRTF,
    IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA,
    IVAS_ERR_INVALID_INPUT_FORMAT,
@@ -257,10 +255,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
        case IVAS_ERR_INVALID_HRTF:
            return "Unsupported HRTF filter set";
        case IVAS_ERR_BINARY_FILE_WITHOUT_BINAURAL_RENDERER_DATA:
+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