Commit f98e6425 authored by Dominik Weckbecker's avatar Dominik Weckbecker 💬
Browse files

port changes from the float branches here

parent c4f46c08
Loading
Loading
Loading
Loading
+36 −1
Original line number Diff line number Diff line
@@ -2265,6 +2265,24 @@ 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 +2732,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 +3026,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 +3075,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 )
+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
    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
@@ -470,6 +470,17 @@ void ivas_ism_reset_metadata(
    hIsmMeta->non_diegetic_flag = 0;
    move16();

#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;
}

+31 −0
Original line number Diff line number Diff line
@@ -777,6 +777,12 @@ ivas_error ivas_ism_metadata_dec_fx(
    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

void ivas_get_ism_sid_quan_bitbudget_fx(
    const Word16 nchan_ism,   /* i  : number of objects                 */
    Word16 *nBits_azimuth,    /* o  : number of Q bits for azimuth      */
@@ -4225,6 +4231,12 @@ void ivas_jbm_dec_feed_tc_to_renderer_fx(
    Word32 *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

void ivas_jbm_dec_get_adapted_subframes(
    const Word16 nCldfbTs,    /* i  : number of time slots in the current frame                   */
    Word16 *subframe_nbslots, /* i/o: subframe grid                                               */
@@ -4320,6 +4332,18 @@ void ivas_param_ism_dec_digest_tc_fx(
    Word32 *transport_channels[], /* i  : synthesized core-coder transport channels/DirAC output  */
    Word16 q_tc_in );


#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_param_ism_dec_render_fx(
    Decoder_Struct *st_ivas,     /* i/o: IVAS decoder handle                         */
    const UWord16 nSamplesAsked, /* i  : number of CLDFB slots requested             */
@@ -5163,6 +5187,13 @@ void ivas_param_mc_dec_digest_tc_fx(
    Word32 *transport_channels_f_fx[],
    Word16 transport_f_e );

#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_fx(
    Decoder_Struct *st_ivas,     /* i/o: IVAS decoder handle                                 */
    const UWord16 nSamplesAsked, /* i  : number of CLDFB slots requested                     */
+12 −0
Original line number Diff line number Diff line
@@ -65,6 +65,18 @@ typedef struct
    Word32 yaw_fx; /* yaw value read from the input metadata file */             /* Q22 */
    Word32 pitch_fx; /* pitch value read from the input metadata file */         /* Q22 */

#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

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

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