Commit 2041502b authored by vasilache's avatar vasilache
Browse files

Merge branch 'main' into 2092-assert-in-ivas_omasa_render_objects_from_mix_fx-for-basop-decoder

parents 160cb85d e2fd89a9
Loading
Loading
Loading
Loading
Loading
+35 −1
Original line number Diff line number Diff line
@@ -2265,6 +2265,23 @@ static ivas_error decodeG192(
                    }
                }
#endif

#ifdef FIX_HRTF_LOAD_API
                /* decode transport channels, do TSM and feed to renderer */
                if ( ( error = IVAS_DEC_GetSamplesDecoder( hIvasDec, isSplitRend, splitRendBits ) ) != IVAS_ERR_OK )
                {
                    return error;
                }

#endif
#ifdef OBJ_EDITING_API
                /* Do the final preparations needed for rendering */
                if ( ( error = IVAS_DEC_PrepareRenderer( hIvasDec ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError: could not prepare the renderer: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
                }
#endif
            }

            if ( isSplitRend )
@@ -2714,6 +2731,9 @@ static ivas_error decodeVoIP(
    int16_t nOutSamples = 0;
#ifdef FIX_CREND_SIMPLIFY_CODE
    bool bitstreamReadDone = false;
#ifdef OBJ_EDITING_API
    bool parametersAvailableForEditing = false;
#endif
    uint16_t nSamplesRendered;
#endif

@@ -3005,13 +3025,21 @@ static ivas_error decodeVoIP(
#endif
#ifdef SUPPORT_JBM_TRACEFILE
#ifdef FIX_CREND_SIMPLIFY_CODE
#ifdef OBJ_EDITING_API
            if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, (void *) pcmBuf, systemTime_ms, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &bitstreamReadDone, &nSamplesRendered, &parametersAvailableForEditing ) ) != IVAS_ERR_OK )
#else
            if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, (void *) pcmBuf, systemTime_ms, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &bitstreamReadDone, &nSamplesRendered ) ) != IVAS_ERR_OK )
#endif
#else
            if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, pcmBuf, systemTime_ms, writeJbmTraceFileFrameWrapper, jbmTraceWriter ) ) != IVAS_ERR_OK )
#endif
#else
#ifdef FIX_CREND_SIMPLIFY_CODE
#ifdef OBJ_EDITING_API
        if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, (void *) pcmBuf, systemTime_ms, &bitstreamReadDone, &parametersAvailableForEditing ) ) != IVAS_ERR_OK )
#else
        if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, (void *) pcmBuf, systemTime_ms, &bitstreamReadDone ) ) != IVAS_ERR_OK )
#endif
#else
        if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, pcmBuf, systemTime_ms ) ) != IVAS_ERR_OK )
#endif
@@ -3046,9 +3074,15 @@ static ivas_error decodeVoIP(
                }
            }
#endif
#ifdef FIX_HRTF_LOAD
#ifdef OBJ_EDITING_API
            if ( parametersAvailableForEditing == true )
            {
                /* do the object editing here */
            }
#endif
#ifdef FIX_HRTF_LOAD
        } /* while ( nSamplesRendered < nOutSamples ) */
#endif

        /* write JBM Offset file entry */
        if ( jbmOffsetWriter != NULL )
+21 −0
Original line number Diff line number Diff line
@@ -992,6 +992,9 @@ int main(

    while ( 1 )
    {
#ifdef NONBE_1293_CRASH_FIRST_FRAME_LOST
        int16_t bfi = 0;
#endif
        int16_t num_in_channels;
        num_in_channels = inBuffer.config.numChannels;

@@ -1000,7 +1003,11 @@ int main(
        {
            ivas_error error_tmp;
            numSamplesRead = (int16_t) inBufferSize;
#ifdef NONBE_1293_CRASH_FIRST_FRAME_LOST
            error_tmp = split_rend_read_bits_from_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten, &bfi );
#else
            error_tmp = split_rend_read_bits_from_file( hSplitRendFileReadWrite, bitsBuffer.bits, &bitsBuffer.config.bitsRead, &bitsBuffer.config.bitsWritten );
#endif
            if ( error_tmp != IVAS_ERR_OK )
            {
                if ( error_tmp == IVAS_ERR_END_OF_FILE )
@@ -1067,19 +1074,33 @@ int main(
        /* Read from split renderer bfi file if specified */
        if ( splitRendBFIReader != NULL && splitBinNeedsNewFrame )
        {
#ifndef NONBE_1293_CRASH_FIRST_FRAME_LOST
            int16_t bfi;
#endif
            if ( ( error = SplitRendBFIFileReading( splitRendBFIReader, &bfi ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nError in SplitRendBFIFileReading(): %s\n", ivas_error_to_string( error ) );
                goto cleanup;
            }
#ifndef NONBE_1293_CRASH_FIRST_FRAME_LOST
            if ( ( error = ISAR_POST_REND_SetSplitRendBFI( hIsarPostRend, bfi ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nError in ISAR_POST_REND_SetSplitRendBFI(): %s\n", ivas_error_to_string( error ) );
                goto cleanup;
            }
#endif
        }

#ifdef NONBE_1293_CRASH_FIRST_FRAME_LOST
        if ( splitBinNeedsNewFrame )
        {
            if ( ( error = ISAR_POST_REND_SetSplitRendBFI( hIsarPostRend, bfi ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nError in ISAR_POST_REND_SetSplitRendBFI(): %s\n", ivas_error_to_string( error ) );
                goto cleanup;
            }
        }
#endif

        for ( i = 0; i < args.inConfig.numBinBuses; ++i )
        {
+8 −0
Original line number Diff line number Diff line
@@ -1342,7 +1342,15 @@ int main(
        masaIds[i] = 0u;
    }
#ifdef NONBE_1377_REND_DIRATT_CONF
#ifdef FIX_1377_HANDLE_ERROR_CODE
    if ( ( error = IVAS_REND_SetObjectIDs( hIvasRend ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nIVAS_REND_SetObjectIDs: %s\n", ivas_error_to_string( error ) );
        goto cleanup;
    }
#else
    IVAS_REND_SetObjectIDs( hIvasRend );
#endif
#endif

    for ( i = 0; i < args.inConfig.numMultiChannelBuses; ++i )
+12 −0
Original line number Diff line number Diff line
@@ -137,9 +137,21 @@ typedef struct _IVAS_ISM_METADATA
    float yaw;
    float pitch;
    Word16 non_diegetic_flag;
#ifdef OBJ_EDITING_API
    Word32 gain_fx;
#endif

} IVAS_ISM_METADATA;

#ifdef OBJ_EDITING_API
typedef struct _IVAS_EDITABLE_PARAMETERS
{
    Word16 num_obj;
    IVAS_ISM_METADATA ism_metadata[IVAS_MAX_NUM_OBJECTS];
    Word32 gain_bed_fx;
} IVAS_EDITABLE_PARAMETERS;
#endif

typedef struct
{
    // float w, x, y, z;
+11 −0
Original line number Diff line number Diff line
@@ -470,6 +470,17 @@ void ivas_ism_reset_metadata(
    hIsmMeta->non_diegetic_flag = 0;
    move16();

#ifdef OBJ_EDITING_API
    hIsmMeta->edited_gain_fx = ONE_IN_Q31;
    hIsmMeta->edited_azimuth_fx = 0;
    hIsmMeta->edited_elevation_fx = 0;
    hIsmMeta->edited_pitch_fx = 0;
    hIsmMeta->edited_yaw_fx = 0;
    hIsmMeta->edited_radius_fx = ONE_IN_Q9;
    hIsmMeta->gain_fx = ONE_IN_Q31;
    hIsmMeta->non_diegetic_flag = 0;
#endif

    return;
}

Loading