Commit 76b5a7a0 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

fix merge changes

- update TD Object Renderer file reading
- clean up tests/renderer/data directory
parent 36d50d04
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -273,7 +273,7 @@ def rotateISM(
    ele_rot = np.zeros([N_frames])

    for i_frame in range(N_frames):
        q = trj_data[i_frame % trj_frames, 1:]
        q = trj_data[i_frame % trj_frames, :]
        azi_rot[i_frame], ele_rot[i_frame] = rotateAziEle(
            azi[i_frame], ele[i_frame], Quat2RotMat(q)
        )
@@ -324,7 +324,7 @@ def rotateMC(x: np.ndarray, trajectory: str, layout: spatialaudioformat) -> np.n
        start = i_frame * frame_len
        end = (i_frame + 1) * frame_len

        q = trj_data[i_frame % trj_frames, 1:]
        q = trj_data[i_frame % trj_frames, :]

        rotated_pos = np.array(
            [
+25 −6
Original line number Diff line number Diff line
@@ -52,7 +52,11 @@
 *------------------------------------------------------------------------------------------*/

#define META_LINE_LENGTH 200 /* max number of characters at one line of metadata input/output file */
#ifdef FIX_I173_I174
#define NUM_ISM_METADATA_PER_LINE 4 /* Number of ISM metadata per line in a metadata file */
#else
#define NUM_ISM_METADATA_PER_LINE 5 /* Number of ISM metadata per line in a metadata file */
#endif

/*---------------------------------------------------------------------*
 * Local function prototypes
@@ -126,7 +130,9 @@ int main( int argc, char *argv[] )
    FILE *f_input;
    FILE *f_output;
    FILE *f_quat_traj;
#ifndef FIX_I173_I174
    int32_t tmp;
#endif
    float x, y, z, w;
    FILE *f_metadata[MAX_NUM_OBJECTS];
    Decoder_Struct st_ivas_static;
@@ -395,7 +401,11 @@ int main( int argc, char *argv[] )
        {
            for ( i = 0; i < 4; i++ ) /* MAX_PARAM_SPATIAL_SUBFRAMES = 4 */
            {
#ifdef FIX_I173_I174
                if ( 4 == fscanf( f_quat_traj, "%f,%f,%f,%f", &w, &x, &y, &z ) )
#else
                if ( 5 == fscanf( f_quat_traj, "%d,%f,%f,%f,%f", &tmp, &w, &x, &y, &z ) )
#endif
                {
                    st_ivas->hHeadTrackData->num_quaternions = -1;

@@ -543,7 +553,9 @@ static void readMetadata(
    float meta_prm[NUM_ISM_METADATA_PER_LINE];
    char *char_ptr;
    int16_t j;
#ifndef FIX_I173_I174
    int32_t time_stamp;
#endif

    if ( fgets( char_buff, META_LINE_LENGTH, file ) == NULL )
    {
@@ -552,6 +564,7 @@ static void readMetadata(
    }

    char_ptr = strtok( char_buff, "," );
#ifndef FIX_I173_I174
    time_stamp = (int32_t) atoi( char_ptr );

    if ( time_stamp != frame )
@@ -559,12 +572,18 @@ static void readMetadata(
        fprintf( stderr, "\n!!!Error: Wrong time-stamp while reading ISM metadata input file. Exiting!!!\n\n" );
        exit( -1 );
    }
#endif

    j = 0;
    while ( char_ptr != NULL && j < NUM_ISM_METADATA_PER_LINE )
    {
#ifndef FIX_I173_I174
        meta_prm[j++] = (float) atof( char_ptr );
        char_ptr = strtok( NULL, "," );
#else
        char_ptr = strtok( NULL, "," );
        meta_prm[j++] = (float) atof( char_ptr );
#endif
    }

    hIsmMetaData->azimuth = meta_prm[0];
+12 −12
Original line number Diff line number Diff line
@@ -166,24 +166,24 @@ FORMAT_TO_FILE = {
}

FORMAT_TO_METADATA_FILES = {
    "ISM1": [str(TEST_VECTOR_DIR.joinpath("stvISM1.csv"))],
    "ISM1": [str(TESTV_DIR.joinpath("stvISM1.csv"))],
    "ISM2": [
        str(TEST_VECTOR_DIR.joinpath("stvISM1.csv")),
        str(TEST_VECTOR_DIR.joinpath("stvISM2.csv")),
        str(TESTV_DIR.joinpath("stvISM1.csv")),
        str(TESTV_DIR.joinpath("stvISM2.csv")),
    ],
    "ISM3": [
        str(TEST_VECTOR_DIR.joinpath("stvISM1.csv")),
        str(TEST_VECTOR_DIR.joinpath("stvISM2.csv")),
        str(TEST_VECTOR_DIR.joinpath("stvISM3.csv")),
        str(TESTV_DIR.joinpath("stvISM1.csv")),
        str(TESTV_DIR.joinpath("stvISM2.csv")),
        str(TESTV_DIR.joinpath("stvISM3.csv")),
    ],
    "ISM4": [
        str(TEST_VECTOR_DIR.joinpath("stvISM1.csv")),
        str(TEST_VECTOR_DIR.joinpath("stvISM2.csv")),
        str(TEST_VECTOR_DIR.joinpath("stvISM3.csv")),
        str(TEST_VECTOR_DIR.joinpath("stvISM4.csv")),
        str(TESTV_DIR.joinpath("stvISM1.csv")),
        str(TESTV_DIR.joinpath("stvISM2.csv")),
        str(TESTV_DIR.joinpath("stvISM3.csv")),
        str(TESTV_DIR.joinpath("stvISM4.csv")),
    ],
    "MASA1": [str(TEST_VECTOR_DIR.joinpath("stv_IVASMASAQ_1dir1TC.met"))],
    "MASA2": [str(TEST_VECTOR_DIR.joinpath("stv_IVASMASAQ_2dir2TC.met"))],
    "MASA1": [str(TESTV_DIR.joinpath("stv_IVASMASAQ_1dir1TC.met"))],
    "MASA2": [str(TESTV_DIR.joinpath("stv_IVASMASAQ_2dir2TC.met"))],
}

FORMAT_TO_IVAS = {
+0 −50
Original line number Diff line number Diff line
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
-030.00,+00.00,01.00,000.00,1.00
+0 −50
Original line number Diff line number Diff line
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
+000.00,+00.00,01.00,000.00,1.00
Loading