Commit 4e4e7194 authored by Marek Szczerba's avatar Marek Szczerba
Browse files

TDREND update for orientation tracking. Fixes for ivas_orient_trk_Process error handling.

parent 1c344bee
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -739,6 +739,10 @@ ivas_error ivas_rend_TDObjRenderFrame(
    IVAS_FORMAT ivas_format;
    IVAS_REND_AudioConfigType inConfigType;

#ifdef FIX_I109_ORIENTATION_TRACKING
    IVAS_QUATERNION trackedHeadOrientation;
#endif

    wmops_sub_start( "ivas_rend_TDObjRenderFrame" );

    inConfigType = getAudioConfigType( inConfig );
@@ -788,7 +792,18 @@ ivas_error ivas_rend_TDObjRenderFrame(
    for ( subframe_idx = 0; subframe_idx < MAX_PARAM_SPATIAL_SUBFRAMES; subframe_idx++ )
    {
        /* Update the listener's location/orientation */
#ifdef FIX_I109_ORIENTATION_TRACKING
        if ( headRotData->headRotEnabled )
        {
            ivas_orient_trk_Process( headRotData->hOrientationTracker,
                                     headRotData->headPositions[subframe_idx],
                                     FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES,
                                     &trackedHeadOrientation );
        }
        TDREND_Update_listener_orientation( pTDRend->hBinRendererTd, headRotData->headRotEnabled, ( headRotData != NULL ) ? &trackedHeadOrientation : NULL );
#else
        TDREND_Update_listener_orientation( pTDRend->hBinRendererTd, headRotData->headRotEnabled, ( headRotData != NULL ) ? &headRotData->headPositions[subframe_idx] : NULL );
#endif

        /* TODO tmu : pass down renderer config struct */
        // if ( ( hRenderConfig != NULL ) && ( hRenderConfig->roomAcoustics.late_reverb_on ) )
+2 −4
Original line number Diff line number Diff line
@@ -383,6 +383,8 @@ ivas_error ivas_orient_trk_Process(
    float ang;
    ivas_error result;

    result = IVAS_ERR_OK;

    switch ( pOTR->trackingType )
    {
        case OTR_TRACKING_NONE:
@@ -399,8 +401,6 @@ ivas_error ivas_orient_trk_Process(
            /* Compute relative orientation = (absolute orientation) - (reference orientation) */
            QuaternionInverse( pOTR->refRot, pTrkRot );
            QuaternionProduct( *pTrkRot, absRot, pTrkRot );

            result = IVAS_ERR_OK;
            break;

        case OTR_TRACKING_AVG_ORIENT:
@@ -438,8 +438,6 @@ ivas_error ivas_orient_trk_Process(

            /* Compute filter coefficient corresponding to desired cutoff frequency */
            pOTR->alpha = sinf( 2.0f * EVS_PI * cutoffFrequency / updateRate );

            result = IVAS_ERR_OK;
            break;

        default:
+1 −1
Original line number Diff line number Diff line
@@ -4955,7 +4955,7 @@ void IVAS_REND_Close(
    ivas_limiter_close( &hIvasRend->hLimiter );

#ifdef FIX_I109_ORIENTATION_TRACKING
    closeHeadRotation( &( hIvasRend->headRotData ) );
    closeHeadRotation( hIvasRend );
#endif

    count_free( hIvasRend );