Commit 60fd5fff authored by norvell's avatar norvell
Browse files

Added fix for TD standalone renderer under FIX_TDREND_STANDALONE

parent 050f3c0c
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -147,6 +147,8 @@
/*#define FIX_IVAS_180_PLC_SIGNAL_LAST_OVLP_IN_TCX10*/  /* IVAS-180 write last overlap mode in TCX10 frames to allow for correct TCX10/TCX5 subframe decomposition in TCX10 frames after a lost frame */
/*#define FIX_I1_113*/                                  /* under review : MCT bit distribution optimization for SBA high bitrates*/

#define FIX_TDREND_STANDALONE                           /* Fix for TD standalone renderer (broken after update of hHrtfTD pointer and addition of hRenderConfig */

/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
#endif
+29 −3
Original line number Diff line number Diff line
@@ -302,7 +302,22 @@ ivas_error ObjRenderIVASFrame(
            TDREND_MIX_SRC_SetPlayState( st_ivas->hBinRendererTd, nS, TDREND_PLAYSTATUS_PLAYING );
        }
    }

#ifdef FIX_TDREND_STANDALONE
    if ( st_ivas->hRenderConfig != NULL ) /* Renderer Configuration not enabled in TD standalone renderer */
    {
        if ( st_ivas->hRenderConfig->roomAcoustics.late_reverb_on )
        {
            if ( st_ivas->ini_frame == 0 )
            {
                ivas_reverb_open( &st_ivas->hCrend->hReverb, NULL, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs );
            }
            for ( subframe_idx = 0; subframe_idx < 4; subframe_idx++ )
            {
                ivas_reverb_process( st_ivas->hCrend->hReverb, st_ivas->transport_config, 0, output, reverb_signal, subframe_idx );
            }
        }
    }
#else
    if ( st_ivas->hRenderConfig->roomAcoustics.late_reverb_on )
    {
        if ( st_ivas->ini_frame == 0 )
@@ -314,17 +329,28 @@ ivas_error ObjRenderIVASFrame(
            ivas_reverb_process( st_ivas->hCrend->hReverb, st_ivas->transport_config, 0, output, reverb_signal, subframe_idx );
        }
    }
#endif

    /* Call the renderer */
    TDREND_GetMix( st_ivas->hBinRendererTd, output, output_frame, st_ivas->hDecoderConfig->output_Fs );

#ifdef FIX_TDREND_STANDALONE
    if ( st_ivas->hRenderConfig != NULL ) /* Renderer Configuration not enabled in TD standalone renderer */
    {
        if ( st_ivas->hRenderConfig->roomAcoustics.late_reverb_on )
        {
            /* add reverb to rendered signals */
            v_add( reverb_signal[0], output[0], output[0], output_frame );
            v_add( reverb_signal[1], output[1], output[1], output_frame );
        }

    }
#else
    if ( st_ivas->hRenderConfig->roomAcoustics.late_reverb_on )
    {
        /* add reverb to rendered signals */
        v_add( reverb_signal[0], output[0], output[0], output_frame );
        v_add( reverb_signal[1], output[1], output[1], output_frame );
    }
#endif
    return IVAS_ERR_OK;
}

+9 −0
Original line number Diff line number Diff line
@@ -151,7 +151,12 @@ int main( int argc, char *argv[] )
    /*------------------------------------------------------------------------------------------*
     * Struct initializations
     *------------------------------------------------------------------------------------------*/
#ifdef FIX_TDREND_STANDALONE
    st_ivas->hHrtfTD = NULL;
    st_ivas->hRenderConfig = NULL;
#else
    st_ivas->hHrtf = NULL;
#endif
    st_ivas->hHeadTrackData = NULL;
    st_ivas->ivas_format = ISM_FORMAT;
    f_quat_traj = NULL;
@@ -466,7 +471,11 @@ int main( int argc, char *argv[] )

    ivas_td_binaural_close( &st_ivas->hBinRendererTd );
    count_free( st_ivas->hDecoderConfig );
#ifdef FIX_TDREND_STANDALONE
    st_ivas->hHrtfTD = NULL;
#else    
    ivas_HRTF_binary_close( &st_ivas->hHrtfTD );
#endif

    /* ISM metadata handles */
    for ( n = 0; n < MAX_NUM_OBJECTS; n++ )