Commit 11ac0cdf authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch 'main' into basop-ci/add-peaq-scores-comparison

parents cfd1245c 494a317a
Loading
Loading
Loading
Loading
Loading
+17 −15
Original line number Diff line number Diff line
@@ -1012,11 +1012,13 @@ voip-be-on-merge-request:
    - .test-job-linux-needs-testv-dir
    - .rules-merge-request
  stage: test
  needs: ["build-codec-linux-make", "codec-smoke-test"]
  needs: ["build-codec-linux-make"]
  timeout: "10 minutes"
  script:
    - *print-common-info
    - bash ci/ivas_voip_be_test.sh
    - make clean
    - make -j
    - python3 -m pytest tests/test_be_for_jbm_neutral_dly_profile.py

clang-format-check:
  extends:
@@ -2205,7 +2207,7 @@ coverage-test-on-main-scheduled:
    - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_param_file.py -v -n auto --update_ref 1 -m create_ref --param_file scripts/config/self_test_evs.prm --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec
    - bash ci/smoke_test.sh coverage
    - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_param_file.py -v -n auto --update_ref 1 -m create_ref --param_file scripts/config/self_test_ltv.prm --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec
    - bash ci/ivas_voip_be_test.sh coverage
    - python3 -m pytest tests/test_be_for_jbm_neutral_dly_profile.py
    - lcov -c -d obj -o coverage.info
    # remove apps and lib_util files from coverage
    - lcov -r coverage.info "*apps*" -o coverage.info
@@ -2289,8 +2291,8 @@ complexity-stereo-in-stereo-out:
    - *complexity-measurements-setup
    - in_format=stereo
    - out_format=stereo
    - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format"
    - ret_val=$?
    - ret_val=0
    - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$?
    - *complexity-measurements-prepare-artifacts
    - exit $ret_val

@@ -2307,8 +2309,8 @@ complexity-ism-in-binaural-out:
    - *complexity-measurements-setup
    - in_format=ISM
    - out_format=BINAURAL
    - bash ci/complexity_measurements/getWmops.sh "ISM+1 ISM+2 ISM+3 ISM+4" "$out_format"
    - ret_val=$?
    - ret_val=0
    - bash ci/complexity_measurements/getWmops.sh "ISM+1 ISM+2 ISM+3 ISM+4" "$out_format" || ret_val=$?
    - *complexity-measurements-prepare-artifacts
    - exit $ret_val

@@ -2325,8 +2327,8 @@ complexity-sba-hoa3-in-hoa3-out:
    - *complexity-measurements-setup
    - in_format=HOA3
    - out_format=HOA3
    - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format"
    - ret_val=$?
    - ret_val=0
    - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$?
    - *complexity-measurements-prepare-artifacts
    - exit $ret_val

@@ -2343,8 +2345,8 @@ complexity-mc-in-7_1_4-out:
    - *complexity-measurements-setup
    - in_format=MC
    - out_format=7_1_4
    - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format"
    - ret_val=$?
    - ret_val=0
    - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$?
    - *complexity-measurements-prepare-artifacts
    - exit $ret_val

@@ -2361,8 +2363,8 @@ complexity-masa-in-7_1_4-out:
    - *complexity-measurements-setup
    - in_format=MASA
    - out_format=7_1_4
    - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format"
    - ret_val=$?
    - ret_val=0
    - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$?
    - *complexity-measurements-prepare-artifacts
    - exit $ret_val

@@ -2379,8 +2381,8 @@ complexity-StereoDmxEVS-stereo-in-mono-out:
    - *complexity-measurements-setup
    - in_format=StereoDmxEVS
    - out_format=mono
    - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format"
    - ret_val=$?
    - ret_val=0
    - bash ci/complexity_measurements/getWmops.sh "$in_format" "$out_format" || ret_val=$?
    - *complexity-measurements-prepare-artifacts
    - exit $ret_val

+48 −0
Original line number Diff line number Diff line
@@ -128,7 +128,11 @@ typedef struct
    bool customLsOutputEnabled;
    char *customLsSetupFilename;
    int16_t orientation_tracking;
#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
    bool non_diegetic_pan_enabled;
#else
    int16_t Opt_non_diegetic_pan;
#endif
    float non_diegetic_pan_gain;
    bool renderConfigEnabled;
    char *renderConfigFilename;
@@ -148,7 +152,11 @@ typedef struct
#endif
#endif
    AcousticEnvironmentSequence aeSequence;
#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
    bool dpidEnabled;
#else
    int16_t Opt_dpid_on;
#endif
    uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS];

} DecArguments;
@@ -407,8 +415,12 @@ int main(
    if ( arg.renderConfigEnabled )
    {
        /* sanity check */
#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
        if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM && arg.non_diegetic_pan_enabled == false )
#else
        if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM &&
             arg.Opt_non_diegetic_pan == 0 )
#endif
        {
            fprintf( stderr, "\nError: Renderer configuration file cannot be used in this output configuration.\n\n" );
            goto cleanup;
@@ -427,8 +439,14 @@ int main(

    asked_frame_size = arg.renderFramesize;
    uint16_t aeID = arg.aeSequence.count > 0 ? arg.aeSequence.pID[0] : 65535;

#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.non_diegetic_pan_enabled, arg.non_diegetic_pan_gain,
                                       arg.dpidEnabled, aeID, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
#else
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain,
                                       arg.Opt_dpid_on, aeID, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
#endif
    {
        fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
        goto cleanup;
@@ -594,8 +612,12 @@ int main(

        /* sanity check */
        if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB &&
#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
             arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM && arg.non_diegetic_pan_enabled == false )
#else
             arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM &&
             arg.Opt_non_diegetic_pan == 0 )
#endif
        {
            fprintf( stderr, "\nExternal Renderer Config is supported only when binaural output configurations is used as output OR when Split rendering mode is enabled. Exiting. \n" );
            goto cleanup;
@@ -1066,12 +1088,20 @@ static bool parseCmdlIVAS_dec(

    arg->renderConfigEnabled = false;
    arg->renderConfigFilename = NULL;
#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
    arg->dpidEnabled = false;
#else
    arg->Opt_dpid_on = 0;
#endif

    arg->outputMdFilename = NULL;

    arg->inputFormat = IVAS_DEC_INPUT_FORMAT_G192;
#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
    arg->non_diegetic_pan_enabled = false;
#else
    arg->Opt_non_diegetic_pan = 0;
#endif
    arg->non_diegetic_pan_gain = 0.f;
    arg->tsmEnabled = false;
    arg->renderFramesize = IVAS_RENDER_FRAMESIZE_20MS;
@@ -1410,7 +1440,11 @@ static bool parseCmdlIVAS_dec(
        else if ( strcmp( argv_to_upper, "-NON_DIEGETIC_PAN" ) == 0 )
        {
            i++;
#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
            arg->non_diegetic_pan_enabled = true;
#else
            arg->Opt_non_diegetic_pan = 1;
#endif
            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 );
@@ -1507,7 +1541,11 @@ static bool parseCmdlIVAS_dec(
        {
            int16_t id, tmp;

#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
            arg->dpidEnabled = true;
#else
            arg->Opt_dpid_on = 1;
#endif
            ++i;
            tmp = 0;
            while ( is_number( argv[i + tmp] ) && tmp < IVAS_MAX_NUM_OBJECTS )
@@ -1587,7 +1625,12 @@ static bool parseCmdlIVAS_dec(
            arg->customLsSetupFilename = argv[i];
        }
        i++;

#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
        if ( arg->non_diegetic_pan_enabled && arg->outputConfig != IVAS_AUDIO_CONFIG_STEREO )
#else
        if ( ( arg->Opt_non_diegetic_pan ) && ( arg->outputConfig != IVAS_AUDIO_CONFIG_STEREO ) )
#endif
        {
            fprintf( stderr, "Error: non-diegetic panning is supported in stereo only\n\n" );
            usage_dec();
@@ -1605,7 +1648,12 @@ static bool parseCmdlIVAS_dec(
    {
        arg->outputConfig = IVAS_AUDIO_CONFIG_MONO;
        arg->decMode = IVAS_DEC_MODE_EVS;

#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
        if ( arg->non_diegetic_pan_enabled )
#else
        if ( ( arg->Opt_non_diegetic_pan ) )
#endif
        {
            arg->outputConfig = IVAS_AUDIO_CONFIG_STEREO;
        }
+19 −6
Original line number Diff line number Diff line
@@ -92,11 +92,12 @@ ARROW_DOWN = '<span class="arrowdown">&#11010;</span>'

# expected columns. actual columns are filtered from the incoming data later, this
# is mainly for controlling the order in the output table
COLUMNS = ["testcase", "Result", "MLD", "MAXIMUM ABS DIFF"]
COLUMNS = ["testcase", "Result", "MLD", "MAXIMUM ABS DIFF", "MIN_SSNR"]
COLUMNS_GLOBAL = COLUMNS[:1]
COLUMNS_DIFFERENTIAL = COLUMNS[1:]
COLUMNS_DIFFERENTIAL_NOT_MLD = COLUMNS_DIFFERENTIAL[2:]


def create_subpage(
    html_out,
    csv_out,
@@ -111,11 +112,18 @@ def create_subpage(
    )
    write_out_csv(merged_reports, merged_reports[0].keys(), csv_out)

    table_header_a = "".join([TH_TMPL_GLOBAL.format(c) for c in COLUMNS_GLOBAL] + [TH_TMPL_DIFFERENTIAL.format(c) for c in COLUMNS_DIFFERENTIAL])
    table_header_a = "".join(
        [TH_TMPL_GLOBAL.format(c) for c in COLUMNS_GLOBAL]
        + [TH_TMPL_DIFFERENTIAL.format(c) for c in COLUMNS_DIFFERENTIAL]
    )
    table_header_b = list()
    for c in COLUMNS_DIFFERENTIAL:
        table_header_b.append(TH_TMPL_SECOND_ROW.format(f"Previous Run<br>ID: {id_previous}"))
        table_header_b.append(TH_TMPL_SECOND_ROW.format(f"Current Run<br>ID: {id_current}"))
        table_header_b.append(
            TH_TMPL_SECOND_ROW.format(f"Previous Run<br>ID: {id_previous}")
        )
        table_header_b.append(
            TH_TMPL_SECOND_ROW.format(f"Current Run<br>ID: {id_current}")
        )
    table_header_b = "".join(table_header_b)
    table_body = "\n".join(
        tr_from_row(row, id_current, id_previous) for row in merged_reports
@@ -241,8 +249,13 @@ def merge_and_cleanup_mld_reports(

        return diff

    other_col_pairs = [(f"{col}-{id_previous}", f"{col}-{id_current}") for col in COLUMNS_DIFFERENTIAL_NOT_MLD]
    merged = sorted(merged, key=partial(sort_func, other_col_pairs=other_col_pairs), reverse=True)
    other_col_pairs = [
        (f"{col}-{id_previous}", f"{col}-{id_current}")
        for col in COLUMNS_DIFFERENTIAL_NOT_MLD
    ]
    merged = sorted(
        merged, key=partial(sort_func, other_col_pairs=other_col_pairs), reverse=True
    )

    # remove the unecessary whole path from the testcase names
    for row in merged:
+4 −1
Original line number Diff line number Diff line
import argparse
import csv
import sys
import numpy as np


THRESH = 0.01
@@ -32,6 +31,10 @@ def check_linewise_logfile(filepath, cols):
    change_ratios = [abs(float(curr[i]) / float(prev[i]) - 1) > THRESH for i in cols]
    changes_found = any(change_ratios)

    if changes_found:
        print("Previous log line:", prev)
        print("Current log line:", curr)

    return changes_found


ci/ivas_voip_be_test.sh

deleted100755 → 0
+0 −145
Original line number Diff line number Diff line
#! /usr/bin/bash

# (C) 2022-2024 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB,
# Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
# Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
# Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
# contributors to this repository. All Rights Reserved.

# This software is protected by copyright law and by international treaties.
# The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB,
# Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
# Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
# Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
# contributors to this repository retain full ownership rights in their respective contributions in
# the software. This notice grants no license of any kind, including but not limited to patent
# license, nor is any license granted by implication, estoppel or otherwise.

# Contributors are required to enter into the IVAS codec Public Collaboration agreement before making
# contributions.

# This software is provided "AS IS", without any express or implied warranties. The software is in the
# development stage. It is intended exclusively for experts who have experience with such software and
# solely for the purpose of inspection. All implied warranties of non-infringement, merchantability
# and fitness for a particular purpose are hereby disclaimed and excluded.

# Any dispute, controversy or claim arising under or in relation to providing this software shall be
# submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in
# accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and
# the United Nations Convention on Contracts on the International Sales of Goods.

function usage {
    echo
    echo "Usage:"
    echo "      ivas_voip_be_test.sh [MODE]"
    echo 
    echo "      MODE - test (default) or coverage"
    exit
}

if [ ! -d "lib_com" ]; then
    echo "not in root directory! - please run in IVAS root"
    exit 1
fi

if [ -z "$1" ] || [ "$1" == "test" ]; then
    WORKERS=""
    BUILD=1
    COVERAGE=0
elif [ "$1" == "coverage" ]; then
    WORKERS="-t 1"
    BUILD=0
    COVERAGE=1
else
    usage
fi

if [ $BUILD -eq 1 ];then
    make clean
    make all -j
fi

# Configuration
modes=('HOA3_b128_wb_cbr' 'MC_7_1_b96_fb_cbr' 'ISM2_b48_fb_cbr')
output_formats=('STEREO' 'FOA' '7_1' 'HOA3')
limit_input_to_x_seconds=30
verbosity_cmd="-z console"

cfg=./scripts/config/ci_linux.json
dly_profile=./scripts/dly_error_profiles/dly_error_profile_0.dat

output_dir_default="out"
output_dir_voip="out_voip"

# Run the same modes in VoIP and non-VoIP mode with a neutral delay profile
./scripts/runIvasCodec.py $verbosity_cmd -p $cfg $WORKERS -U $limit_input_to_x_seconds -m "${modes[@]}" --oc "${output_formats[@]}" -o $output_dir_default | tee voip_be_test_output.txt
./scripts/runIvasCodec.py $verbosity_cmd -p $cfg $WORKERS -U $limit_input_to_x_seconds -m "${modes[@]}" --oc "${output_formats[@]}" -o $output_dir_voip -J "$dly_profile" | tee -a voip_be_test_output.txt

# Check if Python scripts above failed. They return status 0 even when running a mode fails, so we have to parse log file
if grep -iq failed voip_be_test_output.txt ; then
    echo "Run errors in runIvasCodec.py"
    exit 1
fi

if [ $COVERAGE -eq 1 ];then
    # Coverage analysis requires only running the codec and may exit before the comparison part
    exit 0
fi

# Set up Python path
python_audio_module_path=$(pwd)/scripts
export PYTHONPATH=$python_audio_module_path:$PYTHONPATH
python_audiofile_script_path=$python_audio_module_path/pyaudio3dtools/audiofile.py

# Trim JBM delay from VoIP output files
output_dir_voip_dec="$output_dir_voip"/dec
output_dir_voip_dec_trimmed="$output_dir_voip"/dec_trimmed

if [[ ! -d $output_dir_voip_dec_trimmed ]]; then
    mkdir $output_dir_voip_dec_trimmed 
fi

for cut in "$output_dir_voip_dec"/*.wav; do
    output_path=${cut/$output_dir_voip_dec/$output_dir_voip_dec_trimmed}
    output_path=${output_path/".wav"/".raw"}
    python3 "$python_audiofile_script_path" pre-trim 60 "$cut" "$output_path" | tee -a voip_be_test_output.txt
done

# Convert non-VoIP output from wav to pcm (comparison script doesn't support wav)
output_dir_default_dec="$output_dir_default"/dec
output_dir_default_dec_pcm="$output_dir_default"/dec_pcm

if [[ ! -d $output_dir_default_dec_pcm ]]; then
    mkdir $output_dir_default_dec_pcm 
fi

for ref in "$output_dir_default_dec"/*.wav; do
    output_path=${ref/$output_dir_default_dec/$output_dir_default_dec_pcm}
    output_path=${output_path/".wav"/".raw"}
    python3 "$python_audiofile_script_path" convert "$ref" "$output_path" | tee -a voip_be_test_output.txt
done

# Assert BE between non-VoIP and VoIP modes
all_be=1

cmp_tool_path=$(pwd)/tests/cmp_pcm.py

for ref in "$output_dir_default_dec_pcm"/*; do
    cut=${ref/$output_dir_default_dec_pcm/$output_dir_voip_dec_trimmed}
    cut=${cut/".dec."/"_jbm_dly_error_profile_0_dat.dec."}

    # Print paths of compared files, since the script doesn't do it
    printf "\nComparing %s and %s\n" "$ref" "$cut" | tee -a voip_be_test_output.txt
    printout=$($cmp_tool_path "$ref" "$cut")
    if [ $? -ne 0 ]; then
        all_be=0
    fi
    printf "%s\n" "$printout" | tee -a voip_be_test_output.txt
done

if [ $all_be -eq 1 ]; then
    printf "\n\nAll tested conditions are bit-exact\n" | tee -a voip_be_test_output.txt
else
    printf "\n\nBitexactness problems found!\n" | tee -a voip_be_test_output.txt
    exit 1;
fi
Loading