Commit 3aa79bb8 authored by sbsarac's avatar sbsarac
Browse files

Review comments

parent 0a5b6429
Loading
Loading
Loading
Loading
+128 −27
Original line number Diff line number Diff line
@@ -377,7 +377,7 @@ int main(
    {
        if ( ( error = QuaternionFileWriter_open( arg.mainOrientationFilename, &mainOrientWriter ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError: Can't open main orientation file %s \n\n", arg.mainOrientationFilename );
            fprintf( stderr, "\nError: Can't open main orientation output file %s \n\n", arg.mainOrientationFilename );
            goto cleanup;
        }
    }
@@ -390,7 +390,7 @@ int main(
    {
        if ( ( error = QuaternionFileWriter_open( arg.trackedRotationFilename, &trackRotWriter ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError: Can't open tracked rotation file %s \n\n", arg.trackedRotationFilename );
            fprintf( stderr, "\nError: Can't open tracked rotation output file %s \n\n", arg.trackedRotationFilename );
            goto cleanup;
        }
    }
@@ -403,7 +403,7 @@ int main(
    {
        if ( ( error = QuaternionFileWriter_open( arg.combinedOrientationFilename, &combOrientWriter ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError: Can't open combined orientation file %s \n\n", arg.combinedOrientationFilename );
            fprintf( stderr, "\nError: Can't open combined orientation output file %s \n\n", arg.combinedOrientationFilename );
            goto cleanup;
        }
    }
@@ -1441,7 +1441,7 @@ static bool parseCmdlIVAS_dec(

            if ( argc - i <= 4 || argv[i][0] == '-' )
            {
                fprintf( stderr, "Error: Main orientation file name not specified!\n\n" );
                fprintf( stderr, "Error: Main orientation output file name not specified!\n\n" );
                usage_dec();
                return false;
            }
@@ -1456,7 +1456,7 @@ static bool parseCmdlIVAS_dec(

            if ( argc - i <= 4 || argv[i][0] == '-' )
            {
                fprintf( stderr, "Error: Tracked rotation file name not specified!\n\n" );
                fprintf( stderr, "Error: Tracked rotation output file name not specified!\n\n" );
                usage_dec();
                return false;
            }
@@ -1471,7 +1471,7 @@ static bool parseCmdlIVAS_dec(

            if ( argc - i <= 4 || argv[i][0] == '-' )
            {
                fprintf( stderr, "Error: Combined orientation file name not specified!\n\n" );
                fprintf( stderr, "Error: Combined orientation output file name not specified!\n\n" );
                usage_dec();
                return false;
            }
@@ -1983,9 +1983,11 @@ static void usage_dec( void )
    fprintf( stdout, "                      default bitstream file format is G.192\n" );
    fprintf( stdout, "-hrtf File          : HRTF filter File used in BINAURAL output configuration\n" );
    fprintf( stdout, "-T File             : Head rotation specified by external trajectory File\n" );
    fprintf( stdout, "-mori File          : Main orientation data output file\n" );
    fprintf( stdout, "-trot File          : Tracked rotation data output file\n" );
    fprintf( stdout, "-cori File          : Combined orientation data output file\n" );
#ifdef NONBE_FIX_1100_OUTPUT_ORIENT
    fprintf( stdout, "-mori File          : Main orientation data output File\n" );
    fprintf( stdout, "-trot File          : Tracked rotation data output File\n" );
    fprintf( stdout, "-cori File          : Combined orientation data output File\n" );
#endif
    fprintf( stdout, "-otr tracking_type  : Head orientation tracking type: 'none', 'ref', 'avg', 'ref_vec' \n" );
    fprintf( stdout, "                      or 'ref_vec_lev' (only for binaural rendering)\n" );
    fprintf( stdout, "-rf File            : Reference rotation specified by external trajectory File\n" );
@@ -2655,17 +2657,39 @@ static ivas_error decodeG192(
            if ( arg.mainOrientationWriterEnabled )
            {
                IVAS_QUATERNION orientation;
                IVAS_DEC_GetMainOrientation( hIvasDec, &orientation );

                QuaternionFileWriter_writeFrame( mainOrientWriter, orientation );
                if ( ( error = IVAS_DEC_GetMainOrientation( hIvasDec, &orientation ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nIVAS_DEC_GetMainOrientation failed: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
                }
                else
                {
                    if ( ( error = QuaternionFileWriter_writeFrame( mainOrientWriter, orientation ) ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "\nQuaternionFileWriter_writeFrame failed: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                        goto cleanup;
                    }
                }
            }

            if ( arg.trackedRotationWriterEnabled )
            {
                IVAS_QUATERNION rotation;
                IVAS_DEC_GetTrackedRotation( hIvasDec, &rotation );

                QuaternionFileWriter_writeFrame( trackRotWriter, rotation );
                if ( ( error = IVAS_DEC_GetTrackedRotation( hIvasDec, &rotation ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nIVAS_DEC_GetTrackedRotation failed: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
                }
                else
                {
                    if ( ( error = QuaternionFileWriter_writeFrame( trackRotWriter, rotation ) ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "\nQuaternionFileWriter_writeFrame failed: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                        goto cleanup;
                    }
                }
            }
#endif
        }
@@ -2700,9 +2724,20 @@ static ivas_error decodeG192(
        if ( arg.combinedOrientationWriterEnabled && ( arg.enableHeadRotation || arg.enableExternalOrientation ) )
        {
            IVAS_QUATERNION orientation;
            IVAS_DEC_GetCombinedOrientation( hIvasDec, &orientation );

            QuaternionFileWriter_writeFrame( combOrientWriter, orientation );
            if ( ( error = IVAS_DEC_GetCombinedOrientation( hIvasDec, &orientation ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nIVAS_DEC_GetCombinedOrientation failed: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                goto cleanup;
            }
            else
            {
                if ( ( error = QuaternionFileWriter_writeFrame( combOrientWriter, orientation ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nQuaternionFileWriter_writeFrame failed: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
                }
            }
        }
#endif

@@ -3043,17 +3078,39 @@ static ivas_error decodeG192(
            if ( arg.mainOrientationWriterEnabled )
            {
                IVAS_QUATERNION orientation;
                IVAS_DEC_GetMainOrientation( hIvasDec, &orientation );

                QuaternionFileWriter_writeFrame( mainOrientWriter, orientation );
                if ( ( error = IVAS_DEC_GetMainOrientation( hIvasDec, &orientation ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nIVAS_DEC_GetMainOrientation failed: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
                }
                else
                {
                    if ( ( error = QuaternionFileWriter_writeFrame( mainOrientWriter, orientation ) ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "\nQuaternionFileWriter_writeFrame failed: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                        goto cleanup;
                    }
                }
            }

            if ( arg.trackedRotationWriterEnabled )
            {
                IVAS_QUATERNION rotation;
                IVAS_DEC_GetTrackedRotation( hIvasDec, &rotation );

                QuaternionFileWriter_writeFrame( trackRotWriter, rotation );
                if ( ( error = IVAS_DEC_GetTrackedRotation( hIvasDec, &rotation ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nIVAS_DEC_GetTrackedRotation failed: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
                }
                else
                {
                    if ( ( error = QuaternionFileWriter_writeFrame( trackRotWriter, rotation ) ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "\nQuaternionFileWriter_writeFrame failed: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                        goto cleanup;
                    }
                }
            }
#endif
        }
@@ -3062,9 +3119,20 @@ static ivas_error decodeG192(
        if ( arg.combinedOrientationWriterEnabled && ( arg.enableHeadRotation || arg.enableExternalOrientation ) )
        {
            IVAS_QUATERNION orientation;
            IVAS_DEC_GetCombinedOrientation( hIvasDec, &orientation );

            QuaternionFileWriter_writeFrame( combOrientWriter, orientation );
            if ( ( error = IVAS_DEC_GetCombinedOrientation( hIvasDec, &orientation ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nIVAS_DEC_GetCombinedOrientation failed: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                goto cleanup;
            }
            else
            {
                if ( ( error = QuaternionFileWriter_writeFrame( combOrientWriter, orientation ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nQuaternionFileWriter_writeFrame failed: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
                }
            }
        }
#endif

@@ -3622,17 +3690,39 @@ static ivas_error decodeVoIP(
            if ( arg.mainOrientationWriterEnabled )
            {
                IVAS_QUATERNION orientation;
                IVAS_DEC_GetMainOrientation( hIvasDec, &orientation );

                QuaternionFileWriter_writeFrame( mainOrientWriter, orientation );
                if ( ( error = IVAS_DEC_GetMainOrientation( hIvasDec, &orientation ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nIVAS_DEC_GetMainOrientation failed: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
                }
                else
                {
                    if ( ( error = QuaternionFileWriter_writeFrame( mainOrientWriter, orientation ) ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "\nQuaternionFileWriter_writeFrame failed: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                        goto cleanup;
                    }
                }
            }

            if ( arg.trackedRotationWriterEnabled )
            {
                IVAS_QUATERNION rotation;
                IVAS_DEC_GetTrackedRotation( hIvasDec, &rotation );

                QuaternionFileWriter_writeFrame( trackRotWriter, rotation );
                if ( ( error = IVAS_DEC_GetTrackedRotation( hIvasDec, &rotation ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nIVAS_DEC_GetTrackedRotation failed: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
                }
                else
                {
                    if ( ( error = QuaternionFileWriter_writeFrame( trackRotWriter, rotation ) ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "\nQuaternionFileWriter_writeFrame failed: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                        goto cleanup;
                    }
                }
            }
#endif
        }
@@ -3669,9 +3759,20 @@ static ivas_error decodeVoIP(
        if ( arg.combinedOrientationWriterEnabled && ( arg.enableHeadRotation || arg.enableExternalOrientation ) )
        {
            IVAS_QUATERNION orientation;
            IVAS_DEC_GetCombinedOrientation( hIvasDec, &orientation );

            QuaternionFileWriter_writeFrame( combOrientWriter, orientation );
            if ( ( error = IVAS_DEC_GetCombinedOrientation( hIvasDec, &orientation ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nIVAS_DEC_GetCombinedOrientation failed: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                goto cleanup;
            }
            else
            {
                if ( ( error = QuaternionFileWriter_writeFrame( combOrientWriter, orientation ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nQuaternionFileWriter_writeFrame failed: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
                }
            }
        }
#endif

+2 −1
Original line number Diff line number Diff line
@@ -175,6 +175,7 @@
#define FIX_989_TD_REND_ROM                             /* Eri: Clean-up for TD renderer and completion of ROM generation tool */

#define FIX_1068_ASAN_IN_MC_2_BINAURAL_ROOM_IR          /* issue 1068 : Memory leak in MC to BINAURAL_ROOM decoding with bitrate switching*/
#define NONBE_FIX_1100_OUTPUT_ORIENT                    /* Philips: issue 1100: Output for main/tracked/combined orientation for the decoder application */

/* #################### End BE switches ################################## */

@@ -190,7 +191,7 @@
#define NONBE_FIX_1087_OOB_SBA_DTX_RS                   /* VA: issue 1087: Extend the length of the buffer for MCT decoding to avoid out-of-bound writing in SBA SID bitrate switching decoding */
#define NONBE_FIX_1091_PMC_LOW_SIGNAL_BURSTS            /* FhG: fix for #1091, fix limit calculation for the regularized inverse of Kx to avoid bursts in very low signals */
#define NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR            /* Nok: issue 1074 fixing number of objects signaling in OMASA low rate */
#define NONBE_FIX_1100_OUTPUT_ORIENT					/* Philips: issue 1100: Output for main/tracked/combined orientation for the decoder application */

/* ##################### End NON-BE switches ########################### */

/* ################## End DEVELOPMENT switches ######################### */
+6 −6
Original line number Diff line number Diff line
@@ -2504,7 +2504,7 @@ static void bsCompactToSerial( const uint8_t *compact, uint16_t *serial, uint16_
/*-------------------------------------------------------------------*
 * IVAS_DEC_GetMainOrientation()
 *
 *
 * Get main orientation
 *-------------------------------------------------------------------*/
ivas_error IVAS_DEC_GetMainOrientation(
    IVAS_DEC_HANDLE hIvasDec,     /* i/o: IVAS decoder handle                       */
@@ -2530,7 +2530,7 @@ ivas_error IVAS_DEC_GetMainOrientation(
/*-------------------------------------------------------------------*
 * IVAS_DEC_GetTrackedRotation()
 *
 *
 * Get tracked rotation
 *-------------------------------------------------------------------*/
ivas_error IVAS_DEC_GetTrackedRotation(
    IVAS_DEC_HANDLE hIvasDec,  /* i/o: IVAS decoder handle                         */
@@ -2555,7 +2555,7 @@ ivas_error IVAS_DEC_GetTrackedRotation(
/*---------------------------------------------------------------------*
 * IVAS_DEC_GetCombinedOrientation()
 *
 *
 * Get combined orientation
 *---------------------------------------------------------------------*/
ivas_error IVAS_DEC_GetCombinedOrientation(
    IVAS_DEC_HANDLE hIvasDec,     /* i/o: IVAS decoder handle                            */
+1 −5
Original line number Diff line number Diff line
@@ -103,11 +103,7 @@ ivas_error QuaternionFileWriter_writeFrame(

    file = quatWriter->file;

    if ( file )
    {
        fprintf( file, "%f,%f,%f,%f\n", quatData.w, quatData.x, quatData.y, quatData.z );
    }
    else
    if ( fprintf( file, "%f,%f,%f,%f\n", quatData.w, quatData.x, quatData.y, quatData.z ) <= 0 )
    {
        return IVAS_ERR_FAILED_FILE_WRITE;
    }