Commit f97ea578 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files
Merge branch 'main' of ssh://forge.3gpp.org:29419/ivas-codec-pc/ivas-codec into ci/loudness-measurements-pinknoise
parents 994c68f1 08cd8642
Loading
Loading
Loading
Loading
Loading
+78 −55
Original line number Diff line number Diff line
@@ -568,6 +568,10 @@ int main(
        }
    }
#else
    /*-----------------------------------------------------------------*
     * Print config information
     *-----------------------------------------------------------------*/

    if ( ( error = IVAS_DEC_PrintConfig( hIvasDec, 1, arg.voipMode ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nIVAS_DEC_PrintConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
@@ -833,6 +837,7 @@ cleanup:
        free( arg.aeSequence.pID );
        free( arg.aeSequence.pValidity );
    }

#ifdef DEBUG_SBA_AUDIO_DUMP
    IVAS_DEC_GetSbaDebugParams( hIvasDec, &numOutChannels, &numTransportChannels, &pca_ingest_channels );

@@ -1223,7 +1228,6 @@ static bool parseCmdlIVAS_dec(
        }
#endif
#endif /* #ifdef DEBUGGING */

        else if ( strcmp( argv_to_upper, "-MIME" ) == 0 )
        {
            arg->inputFormat = IVAS_DEC_INPUT_FORMAT_MIME;
@@ -1248,6 +1252,7 @@ static bool parseCmdlIVAS_dec(
        {
            int32_t tmp;
            i++;

            if ( i < argc - 3 )
            {
                if ( !is_digits_only( argv[i] ) )
@@ -1281,7 +1286,6 @@ static bool parseCmdlIVAS_dec(
        }
        else if ( strcmp( argv_to_upper, "-OTR" ) == 0 )
        {

            strncpy( argv_to_upper, argv[i + 1], sizeof( argv_to_upper ) - 1 );
            argv_to_upper[sizeof( argv_to_upper ) - 1] = '\0';
            to_upper( argv_to_upper );
@@ -1390,6 +1394,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;
@@ -1587,6 +1592,7 @@ static bool parseCmdlIVAS_dec(
        /*-----------------------------------------------------------------*
         * Option not recognized
         *-----------------------------------------------------------------*/

        else
        {
            fprintf( stderr, "Error: Unknown option %s or wrong number of parameters!\n\n", argv[i] );
@@ -1841,6 +1847,35 @@ static int16_t app_own_random( int16_t *seed )
}
#endif

/*---------------------------------------------------------------------*
 * resetHeadRotation()
 *
 *
 *---------------------------------------------------------------------*/

static void resetHeadRotation(
    const int16_t num_subframes,  /* i  : number of subframes   */
    IVAS_QUATERNION *pQuaternion, /* o  : head-tracking data    */
    IVAS_VECTOR3 *pPos            /* o  : listener position     */

)
{
    int16_t i;

    for ( i = 0; i < num_subframes; i++ )
    {
        pQuaternion[i].w = -3.0f;
        pQuaternion[i].x = 0.0f;
        pQuaternion[i].y = 0.0f;
        pQuaternion[i].z = 0.0f;
        pPos[i].x = 0.0f;
        pPos[i].y = 0.0f;
        pPos[i].z = 0.0f;
    }

    return;
}


/*---------------------------------------------------------------------*
 * initOnFirstGoodFrame()
@@ -1939,9 +1974,13 @@ static ivas_error initOnFirstGoodFrame(
        if ( arg.rtpOutSR && srRtp != NULL )
        {
            FILE *fParamsSR = NULL;
            char srParamsFile[FILENAME_MAX], *ext = ".sr.txt";
            strncpy( srParamsFile, arg.outputWavFilename, FILENAME_MAX - sizeof( ext ) );
            strncat( srParamsFile, ext, sizeof( ext ) + 1 );
            char srParamsFile[FILENAME_MAX];
            const char *ext = ".sr.txt";

            strncpy( srParamsFile, arg.outputWavFilename, FILENAME_MAX - strlen( ext ) - 1 );
            srParamsFile[FILENAME_MAX - strlen( ext ) - 1] = '\0';
            strncat( srParamsFile, ext, strlen( ext ) );
            srParamsFile[FILENAME_MAX - 1] = '\0';

            /* Write the Split Rendering Params passed from SDP to srParamsFile */
            fParamsSR = fopen( srParamsFile, "w" );
@@ -2158,6 +2197,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" );
@@ -2285,7 +2325,6 @@ static ivas_error decodeG192(
    /* we always start with needing a new frame */
    needNewFrame = true;


    if ( !arg.quietModeEnabled )
    {
        fprintf( stdout, "\n------ Running the decoder ------\n\n" );
@@ -2362,8 +2401,6 @@ static ivas_error decodeG192(

    while ( 1 )
    {
        /* Read next frame if not enough samples availble */

        /* reference vector */
        if ( arg.enableReferenceVectorTracking && vec_pos_update == 0 )
        {
@@ -2410,16 +2447,7 @@ static ivas_error decodeG192(
        {
            if ( headRotReader == NULL )
            {
                for ( i = 0; i < (int16_t) num_subframes; i++ )
                {
                    Quaternions[i].w = -3.0f;
                    Quaternions[i].x = 0.0f;
                    Quaternions[i].y = 0.0f;
                    Quaternions[i].z = 0.0f;
                    Pos[i].x = 0.0f;
                    Pos[i].y = 0.0f;
                    Pos[i].z = 0.0f;
                }
                resetHeadRotation( num_subframes, Quaternions, Pos );
            }
            else
            {
@@ -2633,9 +2661,6 @@ static ivas_error decodeG192(
                    fprintf( stderr, "\nError in IVAS_DEC_GetSplitBinauralBitstream: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
                }

                nSamplesRendered += nSamplesRendered_loop;
                nSamplesToRender -= nSamplesRendered_loop;
            }
            else
            {
@@ -2644,10 +2669,10 @@ static ivas_error decodeG192(
                    fprintf( stderr, "\nError in IVAS_DEC_GetSamplesRenderer(): %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
                }
            }

            nSamplesRendered += nSamplesRendered_loop;
            nSamplesToRender -= nSamplesRendered_loop;
            }

            if ( needNewFrame )
            {
@@ -2723,7 +2748,7 @@ static ivas_error decodeG192(
            }
        }

        /* 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 )
@@ -2763,6 +2788,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 ) );
@@ -2777,6 +2803,7 @@ static ivas_error decodeG192(
                }
            }
        }

        vec_pos_update = ( vec_pos_update + 1 ) % vec_pos_len;
#ifdef WMOPS
        if ( vec_pos_update == 0 )
@@ -2795,8 +2822,6 @@ static ivas_error decodeG192(
    {
        int16_t nSamplesFlushed;

        /* Feed into decoder */

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

        /* decode and get samples */
        /* flush remaining audio */
        if ( ( error = IVAS_DEC_Flush( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, &nSamplesFlushed ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError in IVAS_DEC_VoIP_Flush: %s\n", IVAS_DEC_GetErrorMessage( error ) );
@@ -2874,7 +2899,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 )
@@ -2913,6 +2938,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 ) );
@@ -3108,7 +3134,15 @@ cleanup:
#endif

#ifdef SUPPORT_JBM_TRACEFILE
static ivas_error writeJbmTraceFileFrameWrapper( const void *data, void *writer )
/*---------------------------------------------------------------------*
 * writeJbmTraceFileFrameWrapper()
 *
 *
 *---------------------------------------------------------------------*/

static ivas_error writeJbmTraceFileFrameWrapper(
    const void *data,
    void *writer )
{
    return JbmTraceFileWriter_writeFrame( data, writer );
}
@@ -3213,11 +3247,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" );
@@ -3259,8 +3295,8 @@ static ivas_error decodeVoIP(
        }
        fprintf( stdout, "JBM trace file:         %s\n", arg.jbmTraceFilename );
    }
#endif

#endif
    if ( arg.jbmOffsetFilename != NULL )
    {
        if ( ( error = JbmOffsetFileWriter_open( arg.jbmOffsetFilename, &jbmOffsetWriter ) ) != IVAS_ERR_OK )
@@ -3335,6 +3371,8 @@ static ivas_error decodeVoIP(

            *phIvasDec = hIvasDec; /* Update for main()' s free */
            ivasRtp.restartNeeded = false;
            bitstreamReadDone = false;
            parametersAvailableForEditing = false;
        }

        /* reference vector */
@@ -3383,16 +3421,7 @@ static ivas_error decodeVoIP(
        {
            if ( headRotReader == NULL )
            {
                for ( i = 0; i < (int16_t) num_subframes; i++ )
                {
                    Quaternions[i].w = -3.0f;
                    Quaternions[i].x = 0.0f;
                    Quaternions[i].y = 0.0f;
                    Quaternions[i].z = 0.0f;
                    Pos[i].x = 0.0f;
                    Pos[i].y = 0.0f;
                    Pos[i].z = 0.0f;
                }
                resetHeadRotation( num_subframes, Quaternions, Pos );
            }
            else
            {
@@ -3400,8 +3429,7 @@ static ivas_error decodeVoIP(
                {
                    if ( ( error = HeadRotationFileReading( headRotReader, &Quaternions[i], &Pos[i] ) ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ),
                                 RotationFileReader_getFilePath( headRotReader ) );
                        fprintf( stderr, "\nError %s while reading head orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), RotationFileReader_getFilePath( headRotReader ) );
                        goto cleanup;
                    }
                }
@@ -3426,11 +3454,9 @@ static ivas_error decodeVoIP(

            for ( i = 0; i < (int16_t) num_subframes; i++ )
            {

                if ( ( error = ExternalOrientationFileReading( externalOrientationFileReader, &Quaternions[i], &enableHeadRotation[i], &enableExternalOrientation[i], &enableRotationInterpolation[i], &numFramesToTargetOrientation[i] ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError %s while reading external orientation from %s\n", IVAS_DEC_GetErrorMessage( error ),
                             RotationFileReader_getFilePath( externalOrientationFileReader ) );
                    fprintf( stderr, "\nError %s while reading external orientation from %s\n", IVAS_DEC_GetErrorMessage( error ), RotationFileReader_getFilePath( externalOrientationFileReader ) );
                    goto cleanup;
                }
            }
@@ -3595,6 +3621,8 @@ static ivas_error decodeVoIP(
                        goto cleanup;
                    }
                    *phIvasDec = hIvasDec; /* Update for main()' s free */
                    bitstreamReadDone = false;
                    parametersAvailableForEditing = false;
                }

                /* Placeholder for memory reallocation */
@@ -3747,6 +3775,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 ) );
@@ -3800,10 +3829,9 @@ static ivas_error decodeVoIP(
#endif
    }


    int16_t nSamplesFlushed = 0;

    /* decode and get samples */
    /* flush remaining audio */
    if ( ( error = IVAS_DEC_Flush( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, &nSamplesFlushed ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nError in IVAS_DEC_VoIP_Flush: %s\n", IVAS_DEC_GetErrorMessage( error ) );
@@ -3819,7 +3847,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 )
@@ -3859,6 +3887,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 ) );
@@ -4352,12 +4381,6 @@ static ivas_error restartDecoder(
        }
    }

    if ( ( error = IVAS_DEC_PrintConfig( hIvasDec, 1, arg->voipMode ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nIVAS_DEC_PrintConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
        goto cleanup;
    }

    /* ISAR frame size is set from command line, not renderer config file.
     * This will be ignored if output format is not split rendering. */
    if ( renderConfig != NULL )
+1 −1
Original line number Diff line number Diff line
@@ -1336,7 +1336,6 @@ static bool parseCmdlIVAS_enc(
            ++i;
        }


        /*-----------------------------------------------------------------*
         * Complexity Level
         *-----------------------------------------------------------------*/
@@ -2236,6 +2235,7 @@ static bool readBitrate(

    fprintf( stderr, "Error: cannot read the bitrate profile file\n\n" );
    usage_enc();

    return false;
}

+11 −1
Original line number Diff line number Diff line
@@ -7,7 +7,17 @@

  <h2>Regression tracking</h2>

  <li><a href="long_term_regression.html">Long term regression</a></li>
  <ul>
    <li><a href="long_term_mld_enc.html">Long term MLD encoder</a></li>
    <li><a href="long_term_mld_dec.html">Long term MLD decoder</a></li>
    <li><a href="long_term_mld_dec_reject_JBM_BINAURAL_ROOM_REVERB.html">Long term MLD decoder - excluding JBM and BINAURAL_ROOM_REVERB</a></li>
    <li><a href="long_term_max_abs_diff_enc.html">Long term MAX_ABS_DIFF encoder</a></li>
    <li><a href="long_term_max_abs_diff_dec.html">Long term MAX_ABS_DIFF decoder</a></li>
    <li><a href="long_term_max_abs_diff_dec_reject_JBM_BINAURAL_ROOM_REVERB.html">Long term MAX_ABS_DIFF decoder - excluding JBM and BINAURAL_ROOM_REVERB</a></li>

    <li><a href="detect_regressions.html">Detect MLD regressions</a></li>
    <li><a href="detect_regressions.csv">detect_regressions.csv</a></li>
  </ul>

  <h2>Daily long testvector tests</h2>

+6 −6
Original line number Diff line number Diff line
@@ -7,15 +7,13 @@ TEST_TYPES = ["sanitizers"]


def main(args):

    test = args.test
    file = args.console_out_file
    if test == "sanitizers":
        collect_for_sanitizer_test(file)


def find_failed_files_for_sanitizer_test(console_log: list) -> dict():

def find_failed_files_for_sanitizer_test(console_log: list) -> dict:
    pattern_line = r"(CLANG.) reports . error\(s\) for (.*)"

    files_found = dict()
@@ -33,13 +31,15 @@ def find_failed_files_for_sanitizer_test(console_log: list) -> dict():


def collect_for_sanitizer_test(file):

    with open(file) as f:
        console_log = f.readlines()

    start_indicators = ["Adding config" in l for l in console_log]
    start_indicators = ["Adding config CLANG1" in line for line in console_log]
    assert sum(start_indicators) == 2

    idx_first_run = start_indicators.index(True)
    idx_second_run = start_indicators[idx_first_run + 1:].index(True) + idx_first_run + 1
    idx_second_run = start_indicators.index(True, idx_first_run + 1)

    no_plc_part = console_log[idx_first_run:idx_second_run]
    plc_part = console_log[idx_second_run:]

+139 −71

File changed.

Preview size limit exceeded, changes collapsed.

Loading