Commit 0d9b6475 authored by Dominik Weckbecker's avatar Dominik Weckbecker 💬
Browse files

Merge branch '1680_ref_port-object-editing-API' into 'ivas-float-update'

Port object-editing API changes to ivas-float update

See merge request !2345
parents 5b6c15b1 44c1e11d
Loading
Loading
Loading
Loading
+38 −4
Original line number Diff line number Diff line
@@ -2597,6 +2597,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 )
@@ -3153,6 +3170,9 @@ static ivas_error decodeVoIP(
    int16_t nOutSamples = 0;
#ifdef FIX_CREND_SIMPLIFY_CODE
    bool bitstreamReadDone = false;
#ifdef OBJ_EDITING_API
    bool parameterAvailableForEditing = false;
#endif
    uint16_t nSamplesRendered;
#endif

@@ -3444,13 +3464,21 @@ static ivas_error decodeVoIP(
#endif
#ifdef SUPPORT_JBM_TRACEFILE
#ifdef FIX_CREND_SIMPLIFY_CODE
            if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, systemTime_ms, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &bitstreamReadDone, &nSamplesRendered ) ) != IVAS_ERR_OK )
#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
            if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, systemTime_ms, writeJbmTraceFileFrameWrapper, jbmTraceWriter ) ) != IVAS_ERR_OK )
            if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, writeJbmTraceFileFrameWrapper, jbmTraceWriter, systemTime_ms ) ) != IVAS_ERR_OK )
#endif
#else
#ifdef FIX_CREND_SIMPLIFY_CODE
        if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, systemTime_ms, &bitstreamReadDone ) ) != IVAS_ERR_OK )
#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 )
#else
        if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, &bitstreamReadDone, systemTime_ms ) ) != IVAS_ERR_OK )
#endif
#else
        if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, systemTime_ms ) ) != IVAS_ERR_OK )
#endif
@@ -3485,9 +3513,15 @@ static ivas_error decodeVoIP(
                }
            }
#endif
#ifdef FIX_HRTF_LOAD
#ifdef OBJ_EDITING_API
            if ( parameterAvailableForEditing == true )
            {
                /* do the object editing here */
            }
#endif
#ifdef FIX_HRTF_LOAD
        } /* while ( nSamplesRendered < nOutSamples ) */
#endif

        /* write JBM Offset file entry */
        if ( jbmOffsetWriter != NULL )
+12 −0
Original line number Diff line number Diff line
@@ -128,9 +128,21 @@ 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;
    IVAS_ISM_METADATA ism_metadata[IVAS_MAX_NUM_OBJECTS];
    float gain_bed;
} IVAS_EDITABLE_PARAMETERS;
#endif

typedef struct
{
    float w, x, y, z;
+11 −0
Original line number Diff line number Diff line
@@ -418,6 +418,17 @@ 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;
    hIsmMeta->edited_pitch = 0.0f;
    hIsmMeta->edited_yaw = 0.0f;
    hIsmMeta->edited_radius = 1.0f;
    hIsmMeta->gain = 1.0f;
    hIsmMeta->non_diegetic_flag = 0;
#endif

    return;
}

+29 −0
Original line number Diff line number Diff line
@@ -864,6 +864,12 @@ void ivas_jbm_dec_feed_tc_to_renderer(
    float *data                                                 /* i/o: transport channels/output synthesis signal                  */
);

#ifdef OBJ_EDITING_API
void ivas_jbm_dec_prepare_renderer(
    Decoder_Struct *st_ivas                                     /* i/o: IVAS decoder structure                                      */
);
#endif

ivas_error ivas_jbm_dec_set_discard_samples(
    Decoder_Struct *st_ivas                                     /* i/o: main IVAS decoder structre                                  */
);
@@ -1073,6 +1079,11 @@ ivas_error ivas_ism_metadata_dec(
    DEC_CORE_HANDLE st0                                         /* i  : core-coder handle                           */
);

#ifdef OBJ_EDITING_API
void ivas_ism_renderer_update_md(
	Decoder_Struct *st_ivas                                     /* i/o:  main IVAS decoder handle                   */
);
#endif

/*----------------------------------------------------------------------------------*
 * Parametric ISM prototypes
@@ -1150,6 +1161,17 @@ void ivas_param_ism_dec_digest_tc(
    float *transport_channels_f[]                               /* i  : synthesized core-coder transport channels/DirAC output  */
);

#ifdef OBJ_EDITING_API
void ivas_param_ism_dec_dequant_md(
    Decoder_Struct *st_ivas 
);

void ivas_param_ism_dec_prepare_renderer(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder handle                                     */
    const uint16_t nCldfbSlots                                  /* i  : number of CLFBS slots in the transport channels         */
);
#endif

void ivas_ism_param_dec_tc_gain_ajust(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder handle                         */
    const uint16_t nSamples,                                    /* i  : number of samples to be compensate          */
@@ -3911,6 +3933,13 @@ void ivas_param_mc_dec_digest_tc(
    float *transport_channels_f[]                               /* i  : synthesized core-coder transport channels/DirAC output*/
);

#ifdef OBJ_EDITING_API
void ivas_param_mc_dec_prepare_renderer(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder handle                                 */
    const uint8_t nCldfbSlots                                   /* i  : number of CLFBS slots in the transport channels     */
);
#endif

void ivas_param_mc_dec_render(
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder handle                                 */
    const uint16_t nSamplesAsked,                               /* i  : number of CLDFB slots requested                     */
+12 −0
Original line number Diff line number Diff line
@@ -65,6 +65,18 @@ typedef struct
    float yaw;       /* yaw value read from the input metadata file */
    float pitch;     /* pitch value read from the input metadata file */

#ifdef OBJ_EDITING_API
    float gain;

    float edited_azimuth;
    float edited_elevation;
    float edited_radius;

    float edited_yaw;
    float edited_pitch;
    float edited_gain;
#endif

    int16_t non_diegetic_flag; /* Non-diegetic (non-headtracked) object flag */

    ISM_METADATA_ANGLE position_angle;    /* Angle structs for azimuth and elevation */
Loading