Commit de03fd1e authored by bayers's avatar bayers
Browse files

fix external orientation update rate

parent d4c03c2e
Loading
Loading
Loading
Loading
+17 −17
Original line number Diff line number Diff line
@@ -1783,45 +1783,45 @@ static ivas_error decodeG192(
            }
        }

        if ( arg.enableExternalOrientation )
        /* Head-tracking input simulation */
        if ( arg.enableHeadRotation )
        {
            IVAS_QUATERNION Quaternion;
            int8_t enableHeadRotation;
            int8_t enableExternalOrientation;
            int8_t enableRotationInterpolation;
            int16_t numFramesToTargetOrientation;


            if ( ( error = ExternalOrientationFileReading( externalOrientationFileReader, &Quaternion, &enableHeadRotation, &enableExternalOrientation, &enableRotationInterpolation, &numFramesToTargetOrientation ) ) != IVAS_ERR_OK )
            if ( ( error = HeadRotationFileReading( headRotReader, &Quaternion, &Pos ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nError %s while reading external orientation from %s\n", IVAS_DEC_GetErrorMessage( error ),
                         RotationFileReader_getFilePath( externalOrientationFileReader ) );
                fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), RotationFileReader_getFilePath( headRotReader ) );
                goto cleanup;
            }


            if ( ( error = IVAS_DEC_FeedExternalOrientationData( hIvasDec, Quaternion, enableHeadRotation, enableExternalOrientation, enableRotationInterpolation, numFramesToTargetOrientation ) ) != IVAS_ERR_OK )
            if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternion, Pos ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nIVAS_DEC_FeedExternalOrientationData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                fprintf( stderr, "\nIVAS_DEC_FeedHeadTrackData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                goto cleanup;
            }
        }

        /* Head-tracking input simulation */
        if ( arg.enableHeadRotation )
        if ( arg.enableExternalOrientation )
        {
            IVAS_QUATERNION Quaternion;
            int8_t enableHeadRotation;
            int8_t enableExternalOrientation;
            int8_t enableRotationInterpolation;
            int16_t numFramesToTargetOrientation;

            if ( ( error = HeadRotationFileReading( headRotReader, &Quaternion, &Pos ) ) != IVAS_ERR_OK )

            if ( ( error = ExternalOrientationFileReading( externalOrientationFileReader, &Quaternion, &enableHeadRotation, &enableExternalOrientation, &enableRotationInterpolation, &numFramesToTargetOrientation ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), RotationFileReader_getFilePath( headRotReader ) );
                fprintf( stderr, "\nError %s while reading external orientation from %s\n", IVAS_DEC_GetErrorMessage( error ),
                         RotationFileReader_getFilePath( externalOrientationFileReader ) );
                goto cleanup;
            }


            if ( ( error = IVAS_DEC_FeedHeadTrackData( hIvasDec, Quaternion, Pos ) ) != IVAS_ERR_OK )
            if ( ( error = IVAS_DEC_FeedExternalOrientationData( hIvasDec, Quaternion, enableHeadRotation, enableExternalOrientation, enableRotationInterpolation, numFramesToTargetOrientation ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nIVAS_DEC_FeedHeadTrackData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                fprintf( stderr, "\nIVAS_DEC_FeedExternalOrientationData failed: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                goto cleanup;
            }
        }
+1 −1
Original line number Diff line number Diff line
@@ -1434,7 +1434,7 @@ void external_target_interpolation(

            /* Calculate the interpolation increment and coefficient */
#ifdef API_5MS
            hCombinedOrientationData->interpolationIncrement = 1.0f / ( (float) hExtOrientationData->numFramesToTargetOrientation * (float) MAX_PARAM_SPATIAL_SUBFRAMES );
            hCombinedOrientationData->interpolationIncrement = 1.0f / ( (float) hExtOrientationData->numFramesToTargetOrientation );
#else
            hCombinedOrientationData->interpolationIncrement = 1.0f / ( (float) hExtOrientationData->numFramesToTargetOrientation[i] * (float) MAX_PARAM_SPATIAL_SUBFRAMES );
#endif