Commit d8f66c1b authored by Lauros Pajunen's avatar Lauros Pajunen
Browse files

Remove enable/disable headtracking PI data

parent c7da622a
Loading
Loading
Loading
Loading
Loading
+0 −58
Original line number Diff line number Diff line
@@ -39,7 +39,6 @@
#include "jbm_file_reader.h"
#include "masa_file_reader.h"
#ifdef IVAS_RTPDUMP
#include "disable_headtracking_file_reader.h"
#include "evs_rtp_payload.h"
#include "ivas_rtp_payload.h"
#include "rotation_file_reader.h"
@@ -156,7 +155,6 @@ typedef struct
    bool rtpdumpOutput;
    char *sceneOrientationTrajFileName;
    char *deviceOrientationTrajFileName;
    char *disableHeadtrackingFileName;
#endif

} EncArguments;
@@ -204,7 +202,6 @@ int main(
#ifdef IVAS_RTPDUMP
    RotFileReader *sceneOrientationFileReader = NULL;
    RotFileReader *deviceOrientationFileReader = NULL;
    DisableHeadtrackingFileReader *disableHeadtrackingFileReader = NULL;
#endif
#ifdef DEBUGGING
    FILE *f_forcedModeProfile = NULL;
@@ -668,19 +665,6 @@ int main(
            goto cleanup;
        }
    }

    /*------------------------------------------------------------------------------------------*
     * Open disable headtracking file
     *------------------------------------------------------------------------------------------*/

    if ( arg.disableHeadtrackingFileName != NULL )
    {
        if ( ( error = DisableHeadtrackingFileReader_open( arg.disableHeadtrackingFileName, &disableHeadtrackingFileReader ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError: Can't open disable headtracking file %s \n\n", arg.disableHeadtrackingFileName );
            goto cleanup;
        }
    }
#endif

    int16_t numSamplesRead = 0;
@@ -878,17 +862,6 @@ int main(
                rtpdumpPacker->piDataPacker.deviceOrientationPresent = true;
            }

            /* disable headtracking */
            if ( disableHeadtrackingFileReader )
            {
                if ( ( error = DisableHeadtrackingFileReading( disableHeadtrackingFileReader, &rtpdumpPacker->piDataPacker.disableHeadtracking ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError %s while reading disable headtracking data from %s\n", IVAS_ENC_GetErrorMessage( error ), DisableHeadtrackingFileReader_getFilePath( disableHeadtrackingFileReader ) );
                    goto cleanup;
                }
                IVAS_RTPDUMP_PACKER_checkPIdisableHeadtrackingState( rtpdumpPacker );
            }

            /* PI presence */
            IVAS_RTPDUMP_PACKER_determinePIpresence( rtpdumpPacker );

@@ -1007,11 +980,6 @@ cleanup:
    {
        RotationFileReader_close( &deviceOrientationFileReader );
    }

    if ( disableHeadtrackingFileReader )
    {
        DisableHeadtrackingFileReader_close( &disableHeadtrackingFileReader );
    }
#endif

    IVAS_ENC_Close( &hIvasEnc );
@@ -1088,7 +1056,6 @@ static bool parseCmdlIVAS_enc(
    arg->rtpdumpOutput = false;
    arg->sceneOrientationTrajFileName = NULL;
    arg->deviceOrientationTrajFileName = NULL;
    arg->disableHeadtrackingFileName = NULL;
#endif

#ifdef DEBUGGING
@@ -1932,24 +1899,6 @@ static bool parseCmdlIVAS_enc(
            i++;
        }

        /*-----------------------------------------------------------------*
         * Disable headtracking file reading
         *-----------------------------------------------------------------*/

        else if ( strcmp( argv_to_upper, "-DISABLE_HEADTRACKING_FILE" ) == 0 )
        {
            i++;
            if ( argc - i <= 4 || argv[i][0] == '-' )
            {
                fprintf( stderr, "Error: Disable headtracking input file name not specified!\n\n" );
                usage_enc();
                return false;
            }

            arg->disableHeadtrackingFileName = argv[i];
            i++;
        }

#endif
        /*-----------------------------------------------------------------*
         * Option not recognized
@@ -1975,12 +1924,6 @@ static bool parseCmdlIVAS_enc(
        usage_enc();
        return false;
    }
    if ( arg->disableHeadtrackingFileName != NULL && arg->rtpdumpOutput == false )
    {
        fprintf( stderr, "Error: Disable headtracking file reading is only enabled with rtpdump output!\n\n" );
        usage_enc();
        return false;
    }

#endif
    /*-----------------------------------------------------------------*
@@ -2196,7 +2139,6 @@ static void usage_enc( void )
    fprintf( stdout, "                      EVS RTP Payload Format is used. \n" );
    fprintf( stdout, "-scene_orientation  : Scene orientation trajectory file. Only used with rtpdump output.\n" );
    fprintf( stdout, "-device_orientation : Device orientation trajectory file. Only used with rtpdump output.\n" );
    fprintf( stdout, "-disable_headtracking_file : Disable headtracking input file. (1) to disable and (0) to enable headtracking. Only used with rtpdump output.\n" );
#endif
    fprintf( stdout, "\n" );

+0 −2
Original line number Diff line number Diff line
@@ -226,8 +226,6 @@ typedef struct
    char *acousticEnvironmentId;
    char *acousticEnvironmentOnlyLateReverb;
    char *acousticEnvironmentLateReverbAndEarlyReflections;
    bool enableHeadTracking;
    bool disableHeadTracking;
} PI_DATA_CURRENT_FRAME;

typedef struct
+0 −31
Original line number Diff line number Diff line
@@ -3784,34 +3784,6 @@ ivas_error IVAS_DEC_parseSinglePIorientation(
}


/*---------------------------------------------------------------------*
 * IVAS_DEC_parsePIenableDisableHeadtracking( )
 *
 * Parse enable/disable headtracking from PI data
 *---------------------------------------------------------------------*/

void IVAS_DEC_parsePIenableDisableHeadtracking(
    IVAS_DEC_HANDLE hIvasDec,                 /* i/o: IVAS decoder handle                                                     */
    PI_DATA_CURRENT_FRAME *PIdataCurrentFrame /* i  : PI data handle for the current frame                                    */
)
{
    if ( PIdataCurrentFrame->enableHeadTracking )
    {
        if ( hIvasDec->st_ivas->hCombinedOrientationData )
        {
            hIvasDec->st_ivas->hCombinedOrientationData->enableHeadTrackingPI = 1;
        }
    }
    if ( PIdataCurrentFrame->disableHeadTracking )
    {
        if ( hIvasDec->st_ivas->hCombinedOrientationData )
        {
            hIvasDec->st_ivas->hCombinedOrientationData->enableHeadTrackingPI = 0;
        }
    }
}


/*---------------------------------------------------------------------*
 * IVAS_DEC_parsePIdata( )
 *
@@ -3838,9 +3810,6 @@ ivas_error IVAS_DEC_parsePIdata(
        return error;
    }

    /* enable/disable headtracking */
    IVAS_DEC_parsePIenableDisableHeadtracking( hIvasDec, PIdataCurrentFrame );

    return error;
}

+0 −5
Original line number Diff line number Diff line
@@ -337,11 +337,6 @@ ivas_error IVAS_DEC_parseSinglePIorientation(
    IVAS_QUATERNION *savedInvOrientation        /* i  : previously saved (inverted) orientation for this PI type                */
);

void IVAS_DEC_parsePIenableDisableHeadtracking(
    IVAS_DEC_HANDLE hIvasDec,                   /* i/o: IVAS decoder handle                                                     */
    PI_DATA_CURRENT_FRAME *PIdataCurrentFrame   /* i  : PI data handle for the current frame                                    */
);

ivas_error IVAS_DEC_parsePIdata(
    IVAS_DEC_HANDLE hIvasDec,                   /* i/o: IVAS decoder handle                                                     */
    PI_DATA_CURRENT_FRAME *PIdataCurrentFrame,  /* i  : PI data handle for the current frame                                    */
+2 −23
Original line number Diff line number Diff line
@@ -862,9 +862,6 @@ ivas_error ivas_combined_orientation_open(
    ( *hCombinedOrientationData )->subframe_idx = 0;
    ( *hCombinedOrientationData )->subframe_size = (int16_t) ( fs / ( FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES ) );
    ( *hCombinedOrientationData )->cur_subframe_samples_rendered = 0;
#ifdef IVAS_RTPDUMP
    ( *hCombinedOrientationData )->enableHeadTrackingPI = 1;
#endif

    return IVAS_ERR_OK;
}
@@ -1026,24 +1023,10 @@ ivas_error combine_external_and_head_orientations(
    else if ( hExtOrientationData == NULL && headRotQuaternions != NULL )
    {
        /* Head rotation only */
#ifdef IVAS_RTPDUMP
        if ( hCombinedOrientationData->enableHeadTrackingPI == 1 )
        {
#endif
        for ( i = 0; i < hCombinedOrientationData->num_subframes; i++ )
        {
            hCombinedOrientationData->Quaternions[i] = headRotQuaternions[i];
        }
#ifdef IVAS_RTPDUMP
        }
        else
        {
            for ( i = 0; i < hCombinedOrientationData->num_subframes; i++ )
            {
                hCombinedOrientationData->Quaternions[i] = identity;
            }
        }
#endif
    }

    if ( hExtOrientationData != NULL )
@@ -1121,11 +1104,7 @@ ivas_error combine_external_and_head_orientations(
                hCombinedOrientationData->isHeadRotationFrozen = 0;
            }
            /* Use the most recent head rotation */
#ifdef IVAS_RTPDUMP
            if ( hExtOrientationData->enableHeadRotation[i] == 1 && hCombinedOrientationData->enableHeadTrackingPI == 1 )
#else
            if ( hExtOrientationData->enableHeadRotation[i] == 1 )
#endif
            {
                if ( hExtOrientationData->enableExternalOrientation[i] > 0 )
                {
Loading