Commit 0136ccc9 authored by norvell's avatar norvell
Browse files

Merge branch 'ci/update-basop-ci-branch-pc' into 'basop-ci-branch-pc'

[CI] Update basop-ci-branch-pc to get pre-generated omasa/osba files

See merge request !2163
parents e3fa4e94 0be82d4b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
variables:
  # note: GitLab cannot reference variables defined by users in the include ref:, we need to use a YAML anchor for this
  # see https://docs.gitlab.com/ci/yaml/includes/#use-variables-with-include for more information
  IVAS_CODEC_CI_REF: &IVAS_CODEC_CI_REF 1ed1eb9dba06245fbcc80bcd24ea43be284f7f8e
  IVAS_CODEC_CI_REF: &IVAS_CODEC_CI_REF a31272de16bd1b556269a50bc179321a60f2a500

include:
  - local: .gitlab-ci/variables.yml
@@ -488,7 +488,7 @@ pytest-compare-20ms-and-5ms-rendering:
  needs: ["build-codec-linux-cmake", "build-codec-linux-make", "build-codec-instrumented-linux", "build-codec-sanitizers-linux"]
  script:
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/float/disable-limiter.sh
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/disable-limiter.sh
    - make clean
    - make -j
    ### prepare pytest
+11 −0
Original line number Diff line number Diff line
@@ -681,6 +681,9 @@ int main(
    int argc,
    char **argv )
{
#ifdef FIX_1335_EXTREND_RETCODE
    bool mainFailed = true; /* Assume main failed until cleanup is reached without errors */
#endif
    ISAR_POST_REND_HANDLE hIsarPostRend = NULL;
    RotFileReader *headRotReader = NULL;
    RotFileReader *externalOrientationFileReader = NULL;
@@ -1222,6 +1225,10 @@ int main(
     * Close files and deallocate resources
     *------------------------------------------------------------------------------------------*/

#ifdef FIX_1335_EXTREND_RETCODE
    mainFailed = false; /* This will stay set to true if cleanup is reached via a goto due to an error */

#endif
cleanup:

    free( inpInt16Buffer );
@@ -1252,7 +1259,11 @@ cleanup:
    print_mem( NULL );
#endif

#ifdef FIX_1335_EXTREND_RETCODE
    return mainFailed ? -1 : 0;
#else
    return 0;
#endif
}


+52 −28
Original line number Diff line number Diff line
@@ -232,13 +232,13 @@ static const CmdLnParser_Option cliOptions[] = {
        .id = CmdLnOptionId_inputFormat,
        .match = "input_format",
        .matchShort = "if",
        .description = "Audio format of input file (e.g. 5_1 or HOA3 or META, use -l for a list)",
        .description = "Audio format of input file (e.g. 5_1 or HOA3 or META,\nuse -l for a list)",
    },
    {
        .id = CmdLnOptionId_inputMetadata,
        .match = "input_metadata",
        .matchShort = "im",
        .description = "Space-separated list of path to metadata files for ISM or MASA inputs or BINAURAL_SPLIT_PCM input mode. For OMASA, ISM files must be specified first.",
        .description = "Space-separated list of path to metadata files for ISM/MASA/OMASA/\nOSBA/BINAURAL_SPLIT_PCM inputs. \nFor OMASA, ISM files must be specified first.",
    },
    {
        .id = CmdLnOptionId_outputFile,
@@ -256,13 +256,13 @@ static const CmdLnParser_Option cliOptions[] = {
        .id = CmdLnOptionId_sampleRate,
        .match = "sample_rate",
        .matchShort = "fs",
        .description = "Input sampling rate in kHz (16, 32, 48) - required only with raw PCM inputs",
        .description = "Input sampling rate in kHz (16, 32, 48) - required only with raw\nPCM inputs",
    },
    {
        .id = CmdLnOptionId_trajFile,
        .match = "trajectory_file",
        .matchShort = "T",
        .description = "Head rotation trajectory file for simulation of head tracking (only for binaural outputs)",
        .description = "Head rotation trajectory file for simulation of head tracking\n(only for binaural outputs)",
    },
    {
        .id = CmdLnOptionId_outputMetadata,
@@ -280,43 +280,43 @@ static const CmdLnParser_Option cliOptions[] = {
        .id = CmdLnOptionId_refRotFile,
        .match = "reference_rotation_file",
        .matchShort = "rf",
        .description = "Reference rotation trajectory file for simulation of head tracking (only for binaural outputs)",
        .description = "Reference rotation trajectory file for simulation of head tracking\n(only for binaural outputs)",
    },
    {
        .id = CmdLnOptionId_customHrtfFile,
        .match = "custom_hrtf",
        .matchShort = "hrtf",
        .description = "Custom HRTF file for binaural rendering (only for binaural outputs)",
        .description = "Custom HRTF file for binaural rendering\n(only for binaural outputs)",
    },
    {
        .id = CmdLnOptionId_renderConfigFile,
        .match = "render_config_parameters",
        .matchShort = "render_config",
        .description = "Binaural renderer configuration parameters in file (only for binaural outputs)",
        .description = "Binaural renderer configuration parameters in file\n(only for binaural outputs)",
    },
    {
        .id = CmdLnOptionId_nonDiegeticPan,
        .match = "non_diegetic_panning",
        .matchShort = "non_diegetic_pan",
        .description = "Panning mono non diegetic sound to stereo -90<= pan <= 90\nleft or l or 90->left, right or r or -90->right, center or c or 0 ->middle\n",
        .description = "Panning mono non diegetic sound to stereo -90<= pan <= 90\nleft or l or 90->left, right or r or -90->right,\ncenter or c or 0 ->middle",
    },
    {
        .id = CmdLnOptionId_orientationTracking,
        .match = "tracking_type",
        .matchShort = "otr",
        .description = "Head orientation tracking type: 'none', 'ref', 'avg' or `ref_vec` or `ref_vec_lev` (only for binaural outputs)",
        .description = "Head orientation tracking type: 'none', 'ref', 'avg' or `ref_vec`\nor `ref_vec_lev` (only for binaural outputs)",
    },
    {
        .id = CmdlnOptionId_lfePosition,
        .match = "lfe_position",
        .matchShort = "lp",
        .description = "Output LFE position. Comma-delimited triplet of [gain, azimuth, elevation] where gain is linear (like --gain, -g) and azimuth, elevation are in degrees.\nIf specified, overrides the default behavior which attempts to map input to output LFE channel(s)",
        .description = "Output LFE position. Comma-delimited triplet of [gain, azimuth,\nelevation] where gain is linear (like --gain, -g) and azimuth,\nelevation are in degrees. If specified, overrides the default\nbehavior which attempts to map input to output LFE channel(s)",
    },
    {
        .id = CmdlnOptionId_lfeMatrix,
        .match = "lfe_matrix",
        .matchShort = "lm",
        .description = "LFE panning matrix. File (CSV table) containing a matrix of dimensions [ num_input_lfe x num_output_channels ] with elements specifying linear routing gain (like --gain, -g). \nIf specified, overrides the output LFE position option and the default behavior which attempts to map input to output LFE channel(s)",
        .description = "LFE panning matrix. File (CSV table) containing a matrix of\ndimensions [ num_input_lfe x num_output_channels ] with elements\nspecifying linear routing gain (like --gain, -g). If specified,\noverrides the output LFE position option and the default\nbehavior which attempts to map input to output LFE channel(s)",
    },
    {
        .id = CmdLnOptionId_noDelayCmp,
@@ -328,7 +328,7 @@ static const CmdLnParser_Option cliOptions[] = {
        .id = CmdLnOptionId_complexityLevel,
        .match = "complexity_level",
        .matchShort = "level",
        .description = "Complexity level, level = (1, 2, 3), will be defined after characterisation.",
        .description = "Complexity level, level = (1, 2, 3), will be defined after\ncharacterisation.",
    },
    {
        .id = CmdLnOptionId_quietModeEnabled,
@@ -352,13 +352,13 @@ static const CmdLnParser_Option cliOptions[] = {
        .id = CmdLnOptionId_referenceVectorFile,
        .match = "reference_vector_file",
        .matchShort = "rvf",
        .description = "Reference vector trajectory file for simulation of head tracking (only for binaural outputs)",
        .description = "Reference vector trajectory file for simulation of head tracking\n(only for binaural outputs)",
    },
    {
        .id = CmdLnOptionId_exteriorOrientationFile,
        .match = "exterior_orientation_file",
        .matchShort = "exof",
        .description = "External orientation trajectory file for simulation of external orientations",
        .description = "External orientation trajectory file for simulation of external\norientations",
    },
    {
        .id = CmdLnOptionId_framing,
@@ -370,19 +370,19 @@ static const CmdLnParser_Option cliOptions[] = {
        .id = CmdLnOptionId_syncMdDelay,
        .match = "sync_md_delay",
        .matchShort = "smd",
        .description = "Metadata Synchronization Delay in ms, Default is 0. Quantized by 5ms subframes for TDRenderer (13ms -> 10ms -> 2subframes)",
        .description = "Metadata Synchronization Delay in ms, Default is 0. Quantized by\n5ms subframes for TDRenderer (13ms -> 10ms -> 2subframes)",
    },
    {
        .id = CmdLnOptionId_directivityPatternId,
        .match = "ism_directivity_pattern_id",
        .matchShort = "dpid",
        .description = "Directivity pattern ID(s) = [ID1, ID2, ID3, ID4]. Space-separated list of up to 4 numbers (unsigned integers) can be specified for BINAURAL and BINAURAL_ROOM_REVERB output configuration.\nID1, ID2, ID3, ID4 specify the directivity pattern IDs used for ISMs 1,2,3 and 4 respectively.\nThis options needs to be accompanied by a render_config file, otherwise a default directivity pattern is used.",
        .description = "Directivity pattern ID(s) = [ID1, ID2, ID3, ID4]. Space-separated\nlist of up to 4 numbers (unsigned integers) can be specified for\nBINAURAL and BINAURAL_ROOM_REVERB output.\nID1, ID2, ID3, ID4 specify the directivity pattern IDs used for\nISMs 1,2,3 and 4 respectively. \nThis option needs to be accompanied by a render_config file,\notherwise a default directivity pattern is used.",
    },
    {
        .id = CmdLnOptionId_acousticEnvironmentId,
        .match = "acoustic_environment_id",
        .matchShort = "aeid",
        .description = "Acoustic environment ID (number > 0) alternatively, it can be a text file where each line contains \"ID duration\" for BINAURAL_ROOM_REVERB output configuration.",
        .description = "Acoustic environment ID (number > 0) alternatively, it can be\na text file where each line contains \"ID duration\" for\nBINAURAL_ROOM_REVERB output.",
    },
};

@@ -659,12 +659,15 @@ int main(
    int argc,
    char **argv )
{
#ifdef FIX_1335_EXTREND_RETCODE
    bool mainFailed = true; /* Assume main failed until cleanup is reached without errors */
#endif
    IVAS_REND_HANDLE hIvasRend = NULL;
    RotFileReader *headRotReader = NULL;
    RotFileReader *externalOrientationFileReader = NULL;
    RotFileReader *referenceRotReader = NULL;
    IVAS_CLDFB_FILTER_BANK_HANDLE cldfbAna[IVAS_MAX_INPUT_CHANNELS];
    IVAS_CLDFB_FILTER_BANK_HANDLE cldfbSyn[IVAS_MAX_INPUT_CHANNELS];
    IVAS_CLDFB_FILTER_BANK_HANDLE cldfbAna[RENDERER_MAX_INPUT_CHANNELS];
    IVAS_CLDFB_FILTER_BANK_HANDLE cldfbSyn[RENDERER_MAX_INPUT_CHANNELS];
    int16_t cldfb_in_flag, CLDFBframeSize_smpls;
    SplitRendBFIFileReader *splitRendBFIReader = NULL;
    Vector3PairFileReader *referenceVectorReader = NULL;
@@ -1080,7 +1083,18 @@ int main(
            fprintf( stderr, "\nFailed to read renderer configuration from file %s\n", args.renderConfigFilePath );
            goto cleanup;
        }

#ifdef NONBE_FIX_1337_MISSING_DIRECTIVITY_DISTATT_EXTREND
        if ( ( error = RenderConfigReader_getDirectivity( renderConfigReader, args.directivityPatternId, renderConfig.directivity ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Failed to get directivity patterns for one or more of IDs: %d %d %d %d\n\n", args.directivityPatternId[0], args.directivityPatternId[1], args.directivityPatternId[2], args.directivityPatternId[3] );
            goto cleanup;
        }
        if ( ( error = RenderConfigReader_getDistanceAttenuation( renderConfigReader, renderConfig.distAtt ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Failed to get Distance Attenuation \n\n" );
            goto cleanup;
        }
#endif
        if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
        {
            aeID = args.aeSequence.count > 0 ? args.aeSequence.pID[0] : 65535;
@@ -1965,6 +1979,10 @@ int main(
     * Close files and deallocate resources
     *------------------------------------------------------------------------------------------*/

#ifdef FIX_1335_EXTREND_RETCODE
    mainFailed = false; /* This will stay set to true if cleanup is reached via a goto due to an error */

#endif
cleanup:

    free( inpInt16Buffer );
@@ -2021,7 +2039,11 @@ cleanup:
    print_mem( NULL );
#endif

#ifdef FIX_1335_EXTREND_RETCODE
    return mainFailed ? -1 : 0;
#else
    return 0;
#endif
}


@@ -3722,6 +3744,7 @@ static void printSupportedAudioConfigs( void )
        "BINAURAL_SPLIT_CODED",
        "BINAURAL_ROOM_IR (output only)",
        "BINAURAL_ROOM_REVERB (output only)",
        "META (Scene description, input only)",
    };

    fprintf( stdout, "Supported audio formats:\n" );
@@ -3729,6 +3752,7 @@ static void printSupportedAudioConfigs( void )
    {
        fprintf( stdout, "%s\n", supportedFormats[i] );
    }
    fprintf( stdout, "\n" );

    return;
}
@@ -3739,7 +3763,7 @@ static ivas_error parseLfePanMtxFile(
{
    int16_t i, lfe_in, ch_out;
    const char *tok;
    char line[200]; /* > (10 chars * IVAS_MAX_OUTPUT_CHANNELS) i.e. "-999,     " */
    char line[200]; /* > (10 chars * RENDERER_MAX_OUTPUT_CHANNELS) i.e. "-999,     " */
    FILE *mtxFile;

    if ( strlen( lfeRoutingMatrixFilePath ) < 1 )
@@ -3758,7 +3782,7 @@ static ivas_error parseLfePanMtxFile(
           any subsequent issue in file reading will gracefully exit the function */
    for ( lfe_in = 0; lfe_in < RENDERER_MAX_INPUT_LFE_CHANNELS; lfe_in++ )
    {
        for ( i = 0; i < IVAS_MAX_OUTPUT_CHANNELS; i++ )
        for ( i = 0; i < RENDERER_MAX_OUTPUT_CHANNELS; i++ )
        {
            ( *lfePanMtx )[lfe_in][i] = 0.0f;
        }
@@ -3786,7 +3810,7 @@ static ivas_error parseLfePanMtxFile(
            {
                continue;
            }
            if ( ch_out > IVAS_MAX_OUTPUT_CHANNELS )
            if ( ch_out > RENDERER_MAX_OUTPUT_CHANNELS )
            {
                break;
            }
@@ -3827,13 +3851,13 @@ static void convertInputBuffer(
    if ( cldfb_in_flag )
    {
        int16_t slotIdx, numCldfbBands, numFloatPcmSamples;
        float fIn[IVAS_MAX_OUTPUT_CHANNELS][IVAS_MAX_FRAME_SIZE];
        float fIn[RENDERER_MAX_OUTPUT_CHANNELS][IVAS_MAX_FRAME_SIZE];

        numFloatPcmSamples = numFloatSamplesPerChannel >> 1;
        numCldfbBands = numFloatPcmSamples / IVAS_CLDFB_NO_COL_MAX;

        /* CLDFB Analysis*/
        assert( numIntSamplesPerChannel <= IVAS_MAX_OUTPUT_CHANNELS * IVAS_MAX_FRAME_SIZE );
        assert( numIntSamplesPerChannel <= RENDERER_MAX_OUTPUT_CHANNELS * IVAS_MAX_FRAME_SIZE );
        for ( smpl = 0; smpl < numFloatPcmSamples; ++smpl )
        {
            for ( chnl = 0; chnl < numChannels; ++chnl )
@@ -3908,9 +3932,9 @@ static void convertOutputBuffer(
    if ( cldfb_in_flag )
    {
        int16_t slotIdx, numCldfbBands, numPcmSamples, b;
        float fIn[IVAS_MAX_OUTPUT_CHANNELS][IVAS_MAX_FRAME_SIZE];
        float re[IVAS_MAX_OUTPUT_CHANNELS][IVAS_CLDFB_NO_COL_MAX][IVAS_CLDFB_NO_CHANNELS_MAX];
        float im[IVAS_MAX_OUTPUT_CHANNELS][IVAS_CLDFB_NO_COL_MAX][IVAS_CLDFB_NO_CHANNELS_MAX];
        float fIn[RENDERER_MAX_OUTPUT_CHANNELS][IVAS_MAX_FRAME_SIZE];
        float re[RENDERER_MAX_OUTPUT_CHANNELS][IVAS_CLDFB_NO_COL_MAX][IVAS_CLDFB_NO_CHANNELS_MAX];
        float im[RENDERER_MAX_OUTPUT_CHANNELS][IVAS_CLDFB_NO_COL_MAX][IVAS_CLDFB_NO_CHANNELS_MAX];

        numPcmSamples = numSamplesPerChannel >> 1;
        numCldfbBands = numPcmSamples / IVAS_CLDFB_NO_COL_MAX;
+7 −2
Original line number Diff line number Diff line
@@ -104,8 +104,9 @@ TESTCASES_MAIN_PC = [
    "Multi-channel 5_1 bitrate switching from 13.2 kbps to 512 kbps, 48kHz in, 16kHz out, BINAURAL_ROOM_REVERB out",
    "OSBA 2OA 2ISM bitrate switching, 32kHz in, 48kHz out, BINAURAL_ROOM_REVERB out, JBM Prof 5",
]


TESTCASES_MAIN_PC_REENABLE = [
    #"4 ISM with extended metadata at 128 kbps, 48 kHz in, 48 kHz out, BINAURAL_ROOM_REVERB out, rendconf dir w id",
]
def remove_testcases(cfg: Path, testcases: list):
    """
    Go through file line by line and copy all testcases except the given ones
@@ -136,7 +137,11 @@ if __name__ == "__main__":

    testcases = TESTCASES_MAIN
    if args.use_main_pc_set:
        # Add further unsupported test cases
        testcases.extend(TESTCASES_MAIN_PC)
        # Re-enable test cases that are now supported
        for case in TESTCASES_MAIN_PC_REENABLE:
            testcases.remove(case)

    for f in args.cfg_files:
        remove_testcases(f, testcases)
+23 −28
Original line number Diff line number Diff line
@@ -52,7 +52,6 @@ else
  usage
fi


cfg=./scripts/config/ci_linux.json
dly_profile=./scripts/dly_error_profiles/dly_error_profile_10_smoke_test.dat
ism_md_cmd="--ism_metadata_files /usr/local/ltv/ltvISM1.csv /usr/local/ltv/ltvISM2.csv /usr/local/ltv/ltvISM3.csv /usr/local/ltv/ltvISM4.csv"
@@ -77,10 +76,6 @@ if [ $BUILD -eq 1 ];then

fi

# prepare combined format test signals
echo -e "\n======================= 0. preparing combined format test inputs =======================\n\n"
./scripts/prepare_combined_format_inputs.py

# run all modes vanilla-fashion
# treat ISM modes separately because passing the metadata files to MASA modes causes crashes
readarray -t ism_modes < <(./scripts/runIvasCodec.py -l | grep ISM)
Loading