diff --git a/apps/decoder.c b/apps/decoder.c index 52da06869728fafd3c53a84f87b7fe3eed34f301..69e55bfaab59ba3c0b5a664c557d9d79fca132c1 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -4391,6 +4391,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 ) @@ -4422,6 +4447,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 08c4d0f8f929453f53adee3e82672cf9b009b83a..97091c1b24b4accb4673230efcc6a223f8effb53 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -184,6 +184,8 @@ #define FIX_1487_ACCESS_OF_UNINIT_VAL_FROM_ARR_ISM_DTX /* FhG/VA: init nb_bits_metadata to zero */ #define FIX_1477_OOB_INDEX_IN_D_ACELP_INDEXING /* FhG: fix oob indexing */ +#define FIX_1456_SPLIT_REND_NO_HEAD_ROT /* Dolby: issue 1456: default ISAR behaviour in case of no head rotation */ + /* #################### End BE switches ################################## */ /* #################### Start NON-BE switches ############################ */ diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index d9d12ec14ae37540088db3b7b9328217a3456ee0..701f129151a1b4f468b77732d25fb05931730e2e 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -320,11 +320,18 @@ ivas_error ivas_td_binaural_renderer_sf_splitBinaural( } } - /* Save current head positions */ - for ( i = 0; i < st_ivas->hCombinedOrientationData->num_subframes; ++i ) +#ifdef FIX_1456_SPLIT_REND_NO_HEAD_ROT + if ( pMultiBinPoseData->num_poses > 1 ) { - originalHeadRot[i] = st_ivas->hCombinedOrientationData->Quaternions[i]; +#endif + /* Save current head positions */ + for ( i = 0; i < st_ivas->hCombinedOrientationData->num_subframes; ++i ) + { + originalHeadRot[i] = st_ivas->hCombinedOrientationData->Quaternions[i]; + } +#ifdef FIX_1456_SPLIT_REND_NO_HEAD_ROT } +#endif original_subframes_rendered = st_ivas->hTcBuffer->subframes_rendered; original_slots_rendered = st_ivas->hTcBuffer->slots_rendered; @@ -398,11 +405,18 @@ ivas_error ivas_td_binaural_renderer_sf_splitBinaural( mvr2r( output_local[i], output[i], nSamplesRendered ); } - /* Restore original head rotation */ - for ( i = 0; i < st_ivas->hCombinedOrientationData->num_subframes; ++i ) +#ifdef FIX_1456_SPLIT_REND_NO_HEAD_ROT + if ( pMultiBinPoseData->num_poses > 1 ) { - st_ivas->hCombinedOrientationData->Quaternions[i] = originalHeadRot[i]; +#endif + /* Restore original head rotation */ + for ( i = 0; i < st_ivas->hCombinedOrientationData->num_subframes; ++i ) + { + st_ivas->hCombinedOrientationData->Quaternions[i] = originalHeadRot[i]; + } +#ifdef FIX_1456_SPLIT_REND_NO_HEAD_ROT } +#endif /* restore original td renderer handle */ st_ivas->hBinRendererTd = origTdRendHandle; diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index d8470eb930726e64095f59479d33ff23a417b7b0..4eca48fca9c37c9d41355c689b10713934904cbd 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -588,8 +588,21 @@ ivas_error IVAS_DEC_EnableSplitRendering( hDecoderConfig = hIvasDec->st_ivas->hDecoderConfig; +#ifdef FIX_1456_SPLIT_REND_NO_HEAD_ROT + if ( hDecoderConfig->Opt_Headrotation == 0 ) + { + hIvasDec->st_ivas->hRenderConfig->split_rend_config.dof = 0; + hIvasDec->st_ivas->hRenderConfig->split_rend_config.poseCorrectionMode = ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE; + } + + if ( hIvasDec->st_ivas->hRenderConfig->split_rend_config.dof != 0 ) + { + hDecoderConfig->render_framesize = IVAS_RENDER_FRAMESIZE_20MS; + } +#else hDecoderConfig->Opt_Headrotation = 1; hDecoderConfig->render_framesize = IVAS_RENDER_FRAMESIZE_20MS; +#endif return IVAS_ERR_OK; }