From d5633d631781f94f3a931c401174341c33fea47d Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Mon, 12 Jan 2026 14:47:37 +0100 Subject: [PATCH 1/2] set default SR behavior when no head-track info and render_config is supplied --- apps/decoder.c | 31 +++++++++++++++++++++++++++++++ lib_com/options.h | 1 + lib_dec/lib_dec_fx.c | 16 ++++++++++++++++ lib_rend/lib_rend_fx.c | 24 +++++++++++++++++++----- 4 files changed, 67 insertions(+), 5 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 494f76ccb..86d860e08 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -4002,6 +4002,31 @@ static ivas_error restartDecoder( goto cleanup; } +#ifdef FIX_1456_SPLIT_REND_NO_HEAD_ROT + /*------------------------------------------------------------------------------------------* + * Configure Split rendering + *------------------------------------------------------------------------------------------*/ + + 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 ) + { + fprintf( stderr, "\nSplit rendering configure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + + if ( ( error = IVAS_DEC_GetRenderFramesize( hIvasDec, &arg->renderFramesize ) ) != IVAS_ERR_OK ) + { + fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) ); + goto cleanup; + } + } + + /*------------------------------------------------------------------------------------------* + * Configure VoIP mode + *------------------------------------------------------------------------------------------*/ +#endif + if ( arg->voipMode ) { if ( ( error = IVAS_DEC_EnableVoIP( hIvasDec, 60, arg->inputFormat ) ) != IVAS_ERR_OK ) @@ -4033,6 +4058,12 @@ static ivas_error restartDecoder( } } +#ifdef FIX_1456_SPLIT_REND_NO_HEAD_ROT + /*------------------------------------------------------------------------------------------* + * Load custom loudspeaker layout data + *------------------------------------------------------------------------------------------*/ +#endif + if ( arg->customLsOutputEnabled && hLsCustomData != NULL ) { if ( ( error = IVAS_DEC_FeedCustomLsData( hIvasDec, *hLsCustomData ) ) != IVAS_ERR_OK ) diff --git a/lib_com/options.h b/lib_com/options.h index a24403788..3b0c3e689 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -116,6 +116,7 @@ #define FIX_2290_COPY_OF_UNINIT_DATA /* VA: prevent the copy of un-initialized data */ #define CLEANUP_ACELP_ENC /* VA: basop issue 2304: Remove duplicated code in excitation encoding in the ACELP core */ #define CLEANUP_VBR_CAM_ENC /* VA: basop issue 2299: Remove unused core-encoder VBR and CAM code */ +#define FIX_1456_SPLIT_REND_NO_HEAD_ROT /* Dolby: issue 1456: default ISAR behaviour in case of no head rotation */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index c20a69451..4766ab539 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -685,10 +685,26 @@ ivas_error IVAS_DEC_EnableSplitRendering( hDecoderConfig = hIvasDec->st_ivas->hDecoderConfig; move32(); +#ifdef FIX_1456_SPLIT_REND_NO_HEAD_ROT + IF ( EQ_16( hDecoderConfig->Opt_Headrotation, 0 ) ) + { + hIvasDec->st_ivas->hRenderConfig->split_rend_config.dof = 0; + move16(); + hIvasDec->st_ivas->hRenderConfig->split_rend_config.poseCorrectionMode = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE; + move16(); + } + + IF ( NE_16( hIvasDec->st_ivas->hRenderConfig->split_rend_config.dof, 0 ) ) + { + hDecoderConfig->render_framesize = IVAS_RENDER_FRAMESIZE_20MS; + move32(); + } +#else hDecoderConfig->Opt_Headrotation = 1; move16(); hDecoderConfig->render_framesize = IVAS_RENDER_FRAMESIZE_20MS; move32(); +#endif return IVAS_ERR_OK; } diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index eaed6ebf5..ebd5f5036 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -7096,11 +7096,18 @@ static ivas_error renderIsmToSplitBinaural( } } - /* Save current head positions */ - FOR( i = 0; i < pCombinedOrientationData->num_subframes; ++i ) +#ifdef FIX_1456_SPLIT_REND_NO_HEAD_ROT + IF ( GT_16( pMultiBinPoseData->num_poses, 1 ) ) { - Copy_Quat_fx( &pCombinedOrientationData->Quaternions[i], &originalHeadRot[i] ); +#endif + /* Save current head positions */ + FOR( i = 0; i < pCombinedOrientationData->num_subframes; ++i ) + { + Copy_Quat_fx( &pCombinedOrientationData->Quaternions[i], &originalHeadRot[i] ); + } +#ifdef FIX_1456_SPLIT_REND_NO_HEAD_ROT } +#endif /* Copy input audio to a processing buffer. */ copyBufferTo2dArray_fx( ismInput->base.inputBuffer, tmpProcessing ); @@ -7194,10 +7201,17 @@ static ivas_error renderIsmToSplitBinaural( } /* Restore original head rotation */ - FOR( i = 0; i < pCombinedOrientationData->num_subframes; ++i ) +#ifdef FIX_1456_SPLIT_REND_NO_HEAD_ROT + IF( GT_16( pMultiBinPoseData->num_poses, 1 ) ) { - Copy_Quat_fx( &originalHeadRot[i], &pCombinedOrientationData->Quaternions[i] ); +#endif + FOR( i = 0; i < pCombinedOrientationData->num_subframes; ++i ) + { + Copy_Quat_fx( &originalHeadRot[i], &pCombinedOrientationData->Quaternions[i] ); + } +#ifdef FIX_1456_SPLIT_REND_NO_HEAD_ROT } +#endif if ( outAudio.config.is_cldfb ) { -- GitLab From 66523b3feddc941656dcf4b89c118c766c835ff4 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Mon, 12 Jan 2026 15:17:54 +0100 Subject: [PATCH 2/2] clang format --- lib_dec/lib_dec_fx.c | 4 ++-- lib_rend/lib_rend_fx.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index 4766ab539..e442c9b53 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -686,7 +686,7 @@ ivas_error IVAS_DEC_EnableSplitRendering( move32(); #ifdef FIX_1456_SPLIT_REND_NO_HEAD_ROT - IF ( EQ_16( hDecoderConfig->Opt_Headrotation, 0 ) ) + IF( EQ_16( hDecoderConfig->Opt_Headrotation, 0 ) ) { hIvasDec->st_ivas->hRenderConfig->split_rend_config.dof = 0; move16(); @@ -694,7 +694,7 @@ ivas_error IVAS_DEC_EnableSplitRendering( move16(); } - IF ( NE_16( hIvasDec->st_ivas->hRenderConfig->split_rend_config.dof, 0 ) ) + IF( NE_16( hIvasDec->st_ivas->hRenderConfig->split_rend_config.dof, 0 ) ) { hDecoderConfig->render_framesize = IVAS_RENDER_FRAMESIZE_20MS; move32(); diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index ebd5f5036..225e1cec6 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -7097,7 +7097,7 @@ static ivas_error renderIsmToSplitBinaural( } #ifdef FIX_1456_SPLIT_REND_NO_HEAD_ROT - IF ( GT_16( pMultiBinPoseData->num_poses, 1 ) ) + IF( GT_16( pMultiBinPoseData->num_poses, 1 ) ) { #endif /* Save current head positions */ -- GitLab