Commit 7c30f52d authored by Lauros Pajunen's avatar Lauros Pajunen
Browse files

Add tests for combined orientations, fixes

Add test file for combined orientations, test_combined_orientations.py

Few fixes for checking enabled rotations and null pointers

Add commented-out code part, which can be used to test near-BE behaviour of the combined orientations
parent dd88b91f
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2171,7 +2171,8 @@ void ivas_dirac_dec(
        }

#ifdef EXTERNAL_ORIENTATIONS
        if ( st_ivas->hHeadTrackData && st_ivas->hCombinedOrientationData )

        if ( st_ivas->hHeadTrackData && st_ivas->hCombinedOrientationData && st_ivas->hCombinedOrientationData->enableCombinedOrientation[subframe_idx] )
        {
            p_Rmat = &st_ivas->hCombinedOrientationData->Rmat[subframe_idx][0][0];
#else
+17 −0
Original line number Diff line number Diff line
@@ -544,10 +544,27 @@ void TDREND_Update_listener_orientation(
        UpVec[1] = Rmat[2][1];
        UpVec[2] = Rmat[2][2];
#ifdef TD5
#ifdef EXTERNAL_ORIENTATIONS
        if ( Pos != NULL )
        {
            /* Input position   */
            Pos_p[0] = ( *Pos ).x;
            Pos_p[1] = ( *Pos ).y;
            Pos_p[2] = ( *Pos ).z;
        }
        else
        {
            /* Listener at the origin   */
            Pos_p[0] = 0.0f;
            Pos_p[1] = 0.0f;
            Pos_p[2] = 0.0f;
        }
#else
        /* Input position   */
        Pos_p[0] = ( *Pos ).x;
        Pos_p[1] = ( *Pos ).y;
        Pos_p[2] = ( *Pos ).z;
#endif
#endif
    }
    else
+14 −0
Original line number Diff line number Diff line
@@ -1174,6 +1174,20 @@ ivas_error combine_external_and_head_orientations(
        }
    }

    // TODO(Nokia): remove this before merging to main
    //////////////////////////////////////////////////////////////////////////
    /* Uncomment below to round the combined quaternions. Rounded values should get rid of numerical errors and
     * the output should be BE.*/
    /*for ( i = 0; i < MAX_PARAM_SPATIAL_SUBFRAMES; i++ )
    {
        float divFloat = 10000.0f;
        hCombinedOrientationData->Quaternions[i].w = roundf(hCombinedOrientationData->Quaternions[i].w * divFloat) / divFloat;
        hCombinedOrientationData->Quaternions[i].x = roundf(hCombinedOrientationData->Quaternions[i].x * divFloat) / divFloat;
        hCombinedOrientationData->Quaternions[i].y = roundf(hCombinedOrientationData->Quaternions[i].y * divFloat) / divFloat;
        hCombinedOrientationData->Quaternions[i].z = roundf(hCombinedOrientationData->Quaternions[i].z * divFloat) / divFloat;
    }*/
    //////////////////////////////////////////////////////////////////////////

    if ( headRotQuaternions != NULL || hExtOrientationData != NULL )
    {
        /* Calculate the combined rotation matrix */
+4 −0
Original line number Diff line number Diff line
0.965926,0.00,0.00,0.258819,1,0,0,0
0.965926,0.00,0.00,0.258819,1,0,0,0
0.965926,0.00,0.00,0.258819,1,0,0,0
0.965926,0.00,0.00,0.258819,1,0,0,0
 No newline at end of file
+4 −0
Original line number Diff line number Diff line
0.965926,0.00,0.00,0.258819,0,1,0,0
0.965926,0.00,0.00,0.258819,0,1,0,0
0.965926,0.00,0.00,0.258819,0,1,0,0
0.965926,0.00,0.00,0.258819,0,1,0,0
 No newline at end of file
Loading