Commit d5633d63 authored by Vladimir Malenovsky's avatar Vladimir Malenovsky
Browse files

set default SR behavior when no head-track info and render_config is supplied

parent a0051869
Loading
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
@@ -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 )
+1 −0
Original line number Diff line number Diff line
@@ -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 ################################## */

+16 −0
Original line number Diff line number Diff line
@@ -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;
}
+19 −5
Original line number Diff line number Diff line
@@ -7096,11 +7096,18 @@ static ivas_error renderIsmToSplitBinaural(
        }
    }

#ifdef FIX_1456_SPLIT_REND_NO_HEAD_ROT
    IF ( GT_16( pMultiBinPoseData->num_poses, 1 ) )
    {
#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 */
#ifdef FIX_1456_SPLIT_REND_NO_HEAD_ROT
    IF( GT_16( pMultiBinPoseData->num_poses, 1 ) )
    {
#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 )
    {