diff --git a/lib_com/options.h b/lib_com/options.h index 5ee8fff0cd4861b95f345aa381a3192dfca4a698..8e0fe3db46db84b8a64e4f5f1256085355e7e90d 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -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 diff --git a/lib_dec/ivas_objectRenderer.c b/lib_dec/ivas_objectRenderer.c index 43aa475e7da95ff80ebe3a3472c9e02e7f29a716..0c3233880e81d41772457f29ab394c239039572c 100644 --- a/lib_dec/ivas_objectRenderer.c +++ b/lib_dec/ivas_objectRenderer.c @@ -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; } diff --git a/scripts/td_object_renderer/object_renderer_standalone/object_renderer_standalone/renderer_standalone.c b/scripts/td_object_renderer/object_renderer_standalone/object_renderer_standalone/renderer_standalone.c index e1e7bc1e313c44592c04e1bd1e81c1c51abd7496..aa82df64c3b44ea937475d6a91259e21e9bd726f 100644 --- a/scripts/td_object_renderer/object_renderer_standalone/object_renderer_standalone/renderer_standalone.c +++ b/scripts/td_object_renderer/object_renderer_standalone/object_renderer_standalone/renderer_standalone.c @@ -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++ )