Commit 99249416 authored by vaclav's avatar vaclav
Browse files

formatting; remove unused constant; fix typos

parent c94ee1c5
Loading
Loading
Loading
Loading
+18 −15
Original line number Diff line number Diff line
@@ -767,7 +767,6 @@ int main(
            }
        }


        if ( ( error = IVAS_DEC_GetHrtfCRendHandle( hIvasDec, &hSetOfHRTF ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nIVAS_DEC_GetHrtfCRendHandle failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
@@ -1471,6 +1470,7 @@ static bool parseCmdlIVAS_dec(
            strncpy( argv_to_upper, argv[i], sizeof( argv_to_upper ) - 1 );
            argv_to_upper[sizeof( argv_to_upper ) - 1] = '\0';
            to_upper( argv_to_upper );

            if ( ( strcmp( argv_to_upper, "CENTER" ) == 0 ) || ( strchr( argv_to_upper, 'C' ) != NULL ) )
            {
                arg->non_diegetic_pan_gain = 0.f;
@@ -1605,6 +1605,7 @@ static bool parseCmdlIVAS_dec(
        /*-----------------------------------------------------------------*
         * Option not recognized
         *-----------------------------------------------------------------*/

        else
        {
            fprintf( stderr, "Error: Unknown option %s or wrong number of parameters!\n\n", argv[i] );
@@ -2185,6 +2186,7 @@ static ivas_error initOnFirstGoodFrame(
            fprintf( stderr, "\nError getting render frame size in samples\n" );
            return error;
        }

        if ( ( error = IVAS_DEC_GetReferencesUpdateFrequency( hIvasDec, vec_pos_len ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError getting render frame size in samples\n" );
@@ -2288,7 +2290,6 @@ static ivas_error decodeG192(
        }
    }


    for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i )
    {
        ismWriters[i] = NULL;
@@ -2361,9 +2362,9 @@ static ivas_error decodeG192(
            goto cleanup;
        }
    }
#endif
#endif

#endif
    /*------------------------------------------------------------------------------------------*
     * Loop for every packet (frame) of bitstream data
     * - Read the bitstream packet
@@ -2682,7 +2683,7 @@ static ivas_error decodeG192(
#endif
        }

        /* Write ISm metadata to external file(s) */
        /* Write ISM metadata to external file(s) */
        if ( decodedGoodFrame && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL )
        {
            if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM || bsFormat == IVAS_DEC_BS_SBA_ISM )
@@ -2722,6 +2723,7 @@ static ivas_error decodeG192(
                {
                    fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) );
                }

                if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) );
@@ -2756,8 +2758,6 @@ static ivas_error decodeG192(
    {
        int16_t nSamplesFlushed;

        /* Feed into decoder */

        /* reference vector */
        if ( arg.enableReferenceVectorTracking )
        {
@@ -2813,7 +2813,7 @@ static ivas_error decodeG192(
            }
        }

        /* decode and get samples */
        /* flush remaining audio */
#ifdef SPLIT_REND_WITH_HEAD_ROT
        if ( ( error = IVAS_DEC_Flush( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, &nSamplesFlushed ) ) != IVAS_ERR_OK )
#else
@@ -2831,7 +2831,7 @@ static ivas_error decodeG192(
            goto cleanup;
        }

        /* Write ISm metadata to external file(s) */
        /* Write ISM metadata to external file(s) */
        if ( decodedGoodFrame && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL )
        {
            if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM || bsFormat == IVAS_DEC_BS_SBA_ISM )
@@ -2870,6 +2870,7 @@ static ivas_error decodeG192(
                {
                    fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) );
                }

                if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) );
@@ -3164,11 +3165,13 @@ static ivas_error decodeVoIP(
        fprintf( stderr, "\nError getting render frame size in samples\n" );
        return error;
    }

    if ( ( error = IVAS_DEC_GetRenderFramesizeSamples( hIvasDec, &nOutSamples ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nError getting render frame size in samples\n" );
        return error;
    }

    if ( ( error = IVAS_DEC_GetReferencesUpdateFrequency( hIvasDec, &vec_pos_len ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nError getting render frame size in samples\n" );
@@ -3210,7 +3213,6 @@ static ivas_error decodeVoIP(
            goto cleanup;
    }


#ifdef SUPPORT_JBM_TRACEFILE
    if ( arg.jbmTraceFilename != NULL )
    {
@@ -3247,6 +3249,7 @@ static ivas_error decodeVoIP(
        /* EVS RTP payload format has timescale 16000, JBM uses 1000 internally */
        rtpTimeStamp = rtpTimeStamp / 16;
    }

    if ( error != IVAS_ERR_OK || rtpdumpDepackerError != EVS_RTPDUMP_DEPACKER_NO_ERROR )
    {
        fprintf( stderr, "failed to read first RTP packet\n" );
@@ -3274,7 +3277,6 @@ static ivas_error decodeVoIP(

    while ( 1 )
    {

        /* reference vector */
        if ( arg.enableReferenceVectorTracking && vec_pos_update == 0 )
        {
@@ -3315,7 +3317,6 @@ static ivas_error decodeVoIP(
            goto cleanup;
        }

        /* Head-tracking input simulation */
        /* Head-tracking input simulation */
        if ( arg.enableHeadRotation )
        {
@@ -3430,7 +3431,6 @@ static ivas_error decodeVoIP(
            break;
        }


        /* decode and get samples */
#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef SUPPORT_JBM_TRACEFILE
@@ -3556,6 +3556,7 @@ static ivas_error decodeVoIP(
                    {
                        fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) );
                    }

                    if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 1 ) ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) );
@@ -3576,8 +3577,9 @@ static ivas_error decodeVoIP(
        {
            fprintf( stdout, "%-8d\b\b\b\b\b\b\b\b", frame );
        }
        vec_pos_update = ( vec_pos_update + 1 ) % vec_pos_len;
        frame++;

        vec_pos_update = ( vec_pos_update + 1 ) % vec_pos_len;
        if ( vec_pos_update == 0 )
        {
            systemTime_ms += vec_pos_len * systemTimeInc_ms;
@@ -3592,7 +3594,7 @@ static ivas_error decodeVoIP(

    int16_t nSamplesFlushed = 0;

    /* decode and get samples */
    /* flush remaining audio */
#ifdef SPLIT_REND_WITH_HEAD_ROT
    if ( ( error = IVAS_DEC_Flush( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, &nSamplesFlushed ) ) != IVAS_ERR_OK )
#else
@@ -3612,7 +3614,7 @@ static ivas_error decodeVoIP(
            goto cleanup;
        }

        /* Write ISm metadata to external file(s) */
        /* Write ISM metadata to external file(s) */
        if ( decodedGoodFrame && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL )
        {
            if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM || bsFormat == IVAS_DEC_BS_SBA_ISM )
@@ -3652,6 +3654,7 @@ static ivas_error decodeVoIP(
                {
                    fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) );
                }

                if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) );
+1 −3
Original line number Diff line number Diff line
@@ -556,8 +556,8 @@ int main(
            goto cleanup;
        }
    }
#endif

#endif
    /*------------------------------------------------------------------------------------------*
     * Allocate input data buffer
     *------------------------------------------------------------------------------------------*/
@@ -870,8 +870,6 @@ cleanup:
 * Local functions
 *-------------------------------------------------------------------*/

#define IVAS_DEFAULT_AGC ( 0 )

static void initArgStruct( EncArguments *arg )
{
    /* Set default values here */
+1 −1
Original line number Diff line number Diff line
@@ -148,7 +148,7 @@ ivas_error ivas_ism_config(
        bits_element[n_ISms - 1] += bits_ism % n_ISms;
        bitbudget_to_brate( bits_element, element_brate, n_ISms );

        /* count ISm common signaling bits */
        /* count ISM common signaling bits */
        if ( hIsmMeta != NULL )
        {
            nb_bits_metadata[0] += n_ISms * ISM_METADATA_FLAG_BITS + nchan_ism;
+5 −1
Original line number Diff line number Diff line
@@ -205,6 +205,7 @@ ivas_error ivas_ism_metadata_dec(
        /*----------------------------------------------------------------*
         * Read ISM common signaling
         *----------------------------------------------------------------*/

        if ( ism_mode == ISM_SBA_MODE_DISC )
        {
            /* number of objects was read in ivas_dec_setup() */
@@ -448,6 +449,7 @@ ivas_error ivas_ism_metadata_dec(
                        hIsmMetaData->last_true_elevation = hIsmMetaData->elevation;
                    }
                }

                /* save number of metadata bits read */
                if ( ism_mode == ISM_MODE_DISC || ism_mode == ISM_SBA_MODE_DISC || ism_mode == ISM_MASA_MODE_DISC || ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ )
                {
@@ -787,6 +789,7 @@ static void decode_angle_indices(
                nbits_diff_angle1++;
            }
        }

        idx_angle1 = angle->last_angle1_idx + sgn * diff;
    }

@@ -935,6 +938,7 @@ static int16_t decode_radius(
                nbits_diff_radius++;
            }
        }

        idx_radius = *last_radius_idx + sgn * diff;
    }

@@ -1006,7 +1010,7 @@ void ivas_ism_metadata_sid_dec(
    if ( !bfi )
    {
        /*----------------------------------------------------------------*
         * ISm common signaling
         * ISM common signaling
         *----------------------------------------------------------------*/

        /* number of objects was already read in ivas_ism_get_dtx_dec() */
+1 −1
Original line number Diff line number Diff line
@@ -2888,7 +2888,7 @@ static void update_voip_rendered20ms(


/*---------------------------------------------------------------------*
 * IVAS_DEC_VoIP_Flush( )
 * IVAS_DEC_Flush( )
 *
 * Function to flush remaining audio in VoIP
 *---------------------------------------------------------------------*/
Loading