Commit fcbf6bab authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_570_SF_EXT_ORIENTATION

parent a6c6950f
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -151,7 +151,6 @@
/*#define FIX_I4_OL_PITCH*/                             /* fix open-loop pitch used for EVS core switching */


#define FIX_570_SF_EXT_ORIENTATION
#define FIX_280_PLANAR_CP                               /* Dlb : fix issue 28 : remove planarCP=1 related code*/
#define CODE_CLEAN_UP_DIRAC                             /* Dlb : code clean up*/
#define COVARIANCE_MEMORY_OPT                           /* Dlb : Issue 231: define SPAR covariance buffers in stack instead of inter-frame heap */
+0 −66
Original line number Diff line number Diff line
@@ -893,10 +893,6 @@ ivas_error ivas_combined_orientation_open(
    {
        ( *hCombinedOrientationData )->enableCombinedOrientation[i] = 0;
        ( *hCombinedOrientationData )->Quaternions[i] = identity;
#ifndef FIX_570_SF_EXT_ORIENTATION
        ( *hCombinedOrientationData )->Quaternions_prev_headRot[i] = identity;
        ( *hCombinedOrientationData )->Quaternions_prev_extOrientation[i] = identity;
#endif
        ( *hCombinedOrientationData )->listenerPos[i] = origo;

        for ( j = 0; j < 3; j++ )
@@ -922,11 +918,9 @@ ivas_error ivas_combined_orientation_open(
    }
#endif

#ifdef FIX_570_SF_EXT_ORIENTATION
    ( *hCombinedOrientationData )->Quaternion_prev_extOrientation = identity;
    ( *hCombinedOrientationData )->Quaternion_frozen_ext = identity;
    ( *hCombinedOrientationData )->Quaternion_frozen_head = identity;
#endif


    set_zero( ( *hCombinedOrientationData )->chEneIIR[0], MASA_FREQUENCY_BANDS );
@@ -934,10 +928,8 @@ ivas_error ivas_combined_orientation_open(
    set_zero( ( *hCombinedOrientationData )->procChEneIIR[0], MASA_FREQUENCY_BANDS );
    set_zero( ( *hCombinedOrientationData )->procChEneIIR[1], MASA_FREQUENCY_BANDS );

#ifdef FIX_570_SF_EXT_ORIENTATION
    ( *hCombinedOrientationData )->isExtOrientationFrozen = 0;
    ( *hCombinedOrientationData )->isHeadRotationFrozen = 0;
#endif

    return IVAS_ERR_OK;
}
@@ -1141,7 +1133,6 @@ static ivas_error combine_external_and_head_orientations(
        /* External orientations */
        for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ )
        {
#ifdef FIX_570_SF_EXT_ORIENTATION
            /* Check for frozen external orientation */
            if ( hExtOrientationData->enableExternalOrientation[i] == 2 )
            {
@@ -1156,7 +1147,6 @@ static ivas_error combine_external_and_head_orientations(
                hCombinedOrientationData->Quaternion_frozen_ext = identity;
                hCombinedOrientationData->isExtOrientationFrozen = 0;
            }
#endif

            if ( hExtOrientationData->enableRotationInterpolation[i] == 1 && hExtOrientationData->enableExternalOrientation[i] > 0 )
            {
@@ -1187,11 +1177,7 @@ static ivas_error combine_external_and_head_orientations(
                /* Use the freezed external orientation */
                else if ( hExtOrientationData->enableExternalOrientation[i] == 2 )
                {
#ifdef FIX_570_SF_EXT_ORIENTATION
                    hCombinedOrientationData->Quaternions[i] = hCombinedOrientationData->Quaternion_frozen_ext;
#else
                    hCombinedOrientationData->Quaternions[i] = hCombinedOrientationData->Quaternions_prev_extOrientation[i];
#endif
                }
            }
        }
@@ -1202,7 +1188,6 @@ static ivas_error combine_external_and_head_orientations(
        /* Combine head and external orientations */
        for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ )
        {
#ifdef FIX_570_SF_EXT_ORIENTATION
            /* Check for frozen head rotation */
            if ( hExtOrientationData->enableHeadRotation[i] == 2 && numHeadRotQuaternions >= 0 )
            {
@@ -1217,7 +1202,6 @@ static ivas_error combine_external_and_head_orientations(
                hCombinedOrientationData->Quaternion_frozen_head = identity;
                hCombinedOrientationData->isHeadRotationFrozen = 0;
            }
#endif
            /* Use the most recent head rotation */
            if ( hExtOrientationData->enableHeadRotation[i] == 1 && numHeadRotQuaternions >= 0 )
            {
@@ -1235,19 +1219,11 @@ static ivas_error combine_external_and_head_orientations(
            {
                if ( hExtOrientationData->enableExternalOrientation[i] > 0 )
                {
#ifdef FIX_570_SF_EXT_ORIENTATION
                    QuaternionProduct( hCombinedOrientationData->Quaternions[i], hCombinedOrientationData->Quaternion_frozen_head, &hCombinedOrientationData->Quaternions[i] );
#else
                    QuaternionProduct( hCombinedOrientationData->Quaternions[i], hCombinedOrientationData->Quaternions_prev_headRot[i], &hCombinedOrientationData->Quaternions[i] );
#endif
                }
                else
                {
#ifdef FIX_570_SF_EXT_ORIENTATION
                    hCombinedOrientationData->Quaternions[i] = hCombinedOrientationData->Quaternion_frozen_head;
#else
                    hCombinedOrientationData->Quaternions[i] = hCombinedOrientationData->Quaternions_prev_headRot[i];
#endif
                }
            }

@@ -1271,7 +1247,6 @@ static ivas_error combine_external_and_head_orientations(
    /* Save the current orientations */
    if ( hExtOrientationData != NULL )
    {
#ifdef FIX_570_SF_EXT_ORIENTATION
        if ( hExtOrientationData->enableExternalOrientation[MAX_PARAM_SPATIAL_SUBFRAMES - 1] > 0 )
        {
            hCombinedOrientationData->Quaternion_prev_extOrientation = hExtOrientationData->Quaternions[MAX_PARAM_SPATIAL_SUBFRAMES - 1];
@@ -1280,48 +1255,11 @@ static ivas_error combine_external_and_head_orientations(
        {
            hCombinedOrientationData->Quaternion_prev_extOrientation = identity;
        }
#else
        for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ )
        {
            if ( hExtOrientationData->enableExternalOrientation[i] > 0 )
            {
                hCombinedOrientationData->Quaternions_prev_extOrientation[i] = hCombinedOrientationData->Quaternions[i];
            }
            else
            {
                hCombinedOrientationData->Quaternions_prev_extOrientation[i] = identity;
            }
        }
#endif
    }
    if ( headRotQuaternions != NULL )
    {
        for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ )
        {
#ifndef FIX_570_SF_EXT_ORIENTATION
            if ( hExtOrientationData != NULL )
            {
                if ( hExtOrientationData->enableHeadRotation[i] > 0 && numHeadRotQuaternions >= 0 )
                {
                    hCombinedOrientationData->Quaternions_prev_headRot[i] = headRotQuaternions[i];
                }
                else
                {
                    hCombinedOrientationData->Quaternions_prev_headRot[i] = identity;
                }
            }
            else
            {
                if ( numHeadRotQuaternions >= 0 )
                {
                    hCombinedOrientationData->Quaternions_prev_headRot[i] = headRotQuaternions[i];
                }
                else
                {
                    hCombinedOrientationData->Quaternions_prev_headRot[i] = identity;
                }
            }
#endif
            hCombinedOrientationData->listenerPos[i] = listenerPos[i];
        }
    }
@@ -1410,7 +1348,6 @@ static void external_target_interpolation(
            hCombinedOrientationData->Quaternions_ext_interpolation_target = hExtOrientationData->Quaternions[i];

            /* Use the most recent external orientation as the starting orientation */
#ifdef FIX_570_SF_EXT_ORIENTATION
            if ( hExtOrientationData->enableExternalOrientation[i] == 1 )
            {
                if ( i > 0 )
@@ -1426,9 +1363,6 @@ static void external_target_interpolation(
            {
                hCombinedOrientationData->Quaternions_ext_interpolation_start = hCombinedOrientationData->Quaternion_frozen_ext;
            }
#else
            hCombinedOrientationData->Quaternions_ext_interpolation_start = hCombinedOrientationData->Quaternions_prev_extOrientation[i];
#endif

            /* Calculate the interpolation increment and coefficient */
            hCombinedOrientationData->interpolationIncrement = 1.0f / ( (float) hExtOrientationData->numFramesToTargetOrientation[i] * (float) MAX_PARAM_SPATIAL_SUBFRAMES );
+0 −5
Original line number Diff line number Diff line
@@ -883,12 +883,7 @@ typedef struct ivas_combined_orientation_struct
    float lrSwitchInterpVal;
    bool isInterpolationOngoing;
    IVAS_QUATERNION Quaternions[MAX_PARAM_SPATIAL_SUBFRAMES];
#ifdef FIX_570_SF_EXT_ORIENTATION
    IVAS_QUATERNION Quaternion_prev_extOrientation;
#else
    IVAS_QUATERNION Quaternions_prev_headRot[MAX_PARAM_SPATIAL_SUBFRAMES];
    IVAS_QUATERNION Quaternions_prev_extOrientation[MAX_PARAM_SPATIAL_SUBFRAMES];
#endif
    IVAS_QUATERNION Quaternions_ext_interpolation_start;
    IVAS_QUATERNION Quaternions_ext_interpolation_target;
    float Rmat[MAX_PARAM_SPATIAL_SUBFRAMES][3][3];