diff --git a/apps/decoder.c b/apps/decoder.c index 889fde47983a552716d4a35e7122fa3eb452900e..478f4f210753f7dce51f62d40ba80fcb9e74afe4 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -217,6 +217,9 @@ static ivas_error decodeVoIP( #ifdef FIX_1119_SPLIT_RENDERING_VOIP ISAR_SPLIT_REND_BITS_DATA *splitRendBits, #endif +#ifdef FIX_SPLIT_RENDERING_ON_DECODER_RESTART + IVAS_RENDER_CONFIG_DATA *renderConfig, +#endif #ifdef DECODER_FORMAT_SWITCHING IVAS_DEC_HANDLE *phIvasDec, #else @@ -267,6 +270,9 @@ int main( IVAS_ROOM_ACOUSTICS_CONFIG_DATA **pAE = NULL; uint32_t aeCount = 0; #endif +#ifdef FIX_SPLIT_RENDERING_ON_DECODER_RESTART + IVAS_RENDER_CONFIG_DATA renderConfig = { 0 }; +#endif #ifdef DEBUGGING int32_t noClipping; int32_t cnt_frames_limited; @@ -655,7 +661,9 @@ int main( if ( arg.renderConfigEnabled ) { +#ifndef FIX_SPLIT_RENDERING_ON_DECODER_RESTART IVAS_RENDER_CONFIG_DATA renderConfig; +#endif /* sanity check */ if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && @@ -854,6 +862,9 @@ int main( #ifdef FIX_1119_SPLIT_RENDERING_VOIP &splitRendBits, #endif +#ifdef FIX_SPLIT_RENDERING_ON_DECODER_RESTART + &renderConfig, +#endif #ifdef DECODER_FORMAT_SWITCHING &hIvasDec, #else @@ -3400,6 +3411,9 @@ static ivas_error decodeVoIP( #ifdef FIX_1119_SPLIT_RENDERING_VOIP ISAR_SPLIT_REND_BITS_DATA *splitRendBits, #endif +#ifdef FIX_SPLIT_RENDERING_ON_DECODER_RESTART + IVAS_RENDER_CONFIG_DATA *renderConfig, +#endif #ifdef DECODER_FORMAT_SWITCHING IVAS_DEC_HANDLE *phIvasDec, #else @@ -3643,8 +3657,12 @@ static ivas_error decodeVoIP( &hIvasDec, newCodecInPacket, &arg, +#ifdef FIX_SPLIT_RENDERING_ON_DECODER_RESTART + renderConfig, +#else NULL, /* ToDo : Provide rendererConfig */ - NULL /* ToDo : Provide LS Custom Data */ +#endif + NULL /* ToDo : Provide LS Custom Data */ ); if ( error != IVAS_ERR_OK ) { @@ -4708,6 +4726,7 @@ ivas_error restartDecoder( goto cleanup; } +#ifndef FIX_SPLIT_RENDERING_ON_DECODER_RESTART if ( arg->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { if ( ( error = IVAS_DEC_EnableSplitRendering( hIvasDec ) ) != IVAS_ERR_OK ) @@ -4724,6 +4743,7 @@ ivas_error restartDecoder( arg->enableHeadRotation = true; } +#endif if ( arg->voipMode ) { @@ -4740,6 +4760,15 @@ ivas_error restartDecoder( goto cleanup; } +#ifdef FIX_SPLIT_RENDERING_ON_DECODER_RESTART + /* ISAR frame size is set from command line, not renderer config file. + * This will be ignored if output format is not split rendering. */ + if ( renderConfig != NULL ) + { + renderConfig->split_rend_config.isar_frame_size_ms = (int16_t) arg->renderFramesize /* given in number of 5ms subframes */ * 5; + } +#endif + if ( arg->renderConfigEnabled && renderConfig != NULL ) { if ( ( error = IVAS_DEC_FeedRenderConfig( hIvasDec, *renderConfig ) ) != IVAS_ERR_OK ) diff --git a/lib_com/options.h b/lib_com/options.h index 301a4fdab403043e7d83befb3008befdf42ac859..494ac4f705b4f76845a00d6e573ddea9147c5669 100755 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -167,6 +167,7 @@ #define ISM_PI_DATA /* Add reading and packing/unpacking of ISM PI data */ #define REVERSE_ISM_PI_DATA /* Add reading and packing/unpacking of reverse ISM PI data */ #define DECODER_FORMAT_SWITCHING /* Re-initialize the decoder when the format/subformat of the incoming stream is changed */ +#define FIX_SPLIT_RENDERING_ON_DECODER_RESTART /* Re-configure split rendering on decoder restart */ /* ################### Start BE switches ################################# */ /* only BE switches wrt selection floating point code */