Commit 307293d4 authored by TYAGIRIS's avatar TYAGIRIS
Browse files

update as per latest main

parents be24f74c e5b2dd99
Loading
Loading
Loading
Loading
Loading
+92 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ variables:
      - 'test-be-release'
      - 'test-long-self-test'
      - 'ivas-conformance'
      - 'ivas-conformance-linux'
  GIT_CLEAN_FLAGS: -ffdxq
  TESTCASE_TIMEOUT_STV_SANITIZERS: 180
  TESTCASE_TIMEOUT_LTV_SANITIZERS: 1200
@@ -58,6 +59,10 @@ workflow:
      variables:
        IVAS_PIPELINE_NAME: 'Draft IVAS Conformance test: $CI_COMMIT_BRANCH'        
    - if: $CI_PIPELINE_SOURCE == 'trigger'
    - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'ivas-conformance-linux'
      variables:
        IVAS_PIPELINE_NAME: 'Draft IVAS Conformance test -- Linux: $CI_COMMIT_BRANCH'        
    

stages:
  - .pre
@@ -243,6 +248,8 @@ stages:
      when: never
    - if: $MANUAL_PIPELINE_TYPE == 'ivas-conformance'
      when: never      
    - if: $MANUAL_PIPELINE_TYPE == 'ivas-conformance-linux'
      when: never      
    - when: on_success

.rules-merge-request:
@@ -528,6 +535,8 @@ codec-smoke-test:
codec-msan:
  extends:
    - .sanitizer-selftest-on-mr
  tags:
    - ivas-linux-fast
  before_script:
    - CLANG_NUM=1
    - SELFTEST_SANITY_TIMEOUT=$TESTCASE_TIMEOUT_STV_SANITIZERS
@@ -1336,6 +1345,7 @@ ivas-conformance:
    # Prepare reference exec, use tests and scripts from reference
    - $source_branch_commit_sha = $(git rev-parse HEAD)
    - git checkout main # This should be set to a relevant reference
    - git pull # Ensure to get the latest version
    - python .\scripts\strip_split_rendering.py
    - MSBuild.exe -maxcpucount .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug    
    - cp -force IVAS_cod.exe IVAS_cod_ref.exe
@@ -1400,6 +1410,86 @@ ivas-conformance:
    reports:
      junit: report-junit.xml

ivas-conformance-linux:
  tags:
    - ivas-linux
  stage: test
  timeout: "60 minutes"
  rules:
    - if: ($CI_PIPELINE_SOURCE == 'web' || $CI_PIPELINE_SOURCE == 'trigger') && $MANUAL_PIPELINE_TYPE == 'ivas-conformance-linux'
  allow_failure:
    exit_codes:
      - 123
  script:
    - *print-common-info
    # Prepare reference exec, use tests and scripts from reference
    - source_branch_commit_sha=$(git rev-parse HEAD)
    - git checkout main # This should be set to a relevant reference
    
    - make -j
    - cp IVAS_cod IVAS_cod_ref
    - cp IVAS_dec IVAS_dec_ref
    - cp IVAS_rend IVAS_rend_ref
    - git restore .
    - git checkout $source_branch_commit_sha
    
    # Reference creation
    - python3 tests/create_short_testvectors.py
    - python3 scripts/prepare_combined_format_inputs.py
    - python3 -m pytest tests/codec_be_on_mr_nonselection -v -n auto --update_ref 1 -m create_ref --keep_files
    - python3 -m pytest tests/codec_be_on_mr_nonselection -v -n auto --update_ref 1 -m create_ref_part2 --keep_files
    - python3 -m pytest tests/renderer/test_renderer.py --create_ref --keep_files

    # Output creation
    - python3 -m pytest tests/codec_be_on_mr_nonselection tests/renderer/test_renderer.py -v -n auto --keep_files --create_cut --html=report_cmd.html --self-contained-html
    - python3 scripts/parse_commands.py report_cmd.html Readme_IVAS.txt
    
    # Copy input data and output ref data
    - rm -rf testvec
    - mkdir testvec
    - mkdir testvec/binauralRenderer_interface
    - mkdir testvec/testv
    - mkdir testvec/testv/renderer
    - mkdir testvec/bin    
    - cp -r scripts/testv/* testvec/testv
    - cp -r scripts/ls_layouts testvec
    - cp -r scripts/switchPaths testvec
    - cp -r scripts/trajectories testvec
    - cp -r scripts/binauralRenderer_interface/binaural_renderers_hrtf_data testvec/binauralRenderer_interface
    - cp -r tests/ref testvec/testv/ref
    - cp -r tests/dut/* testvec/testv/ref
    - cp -r tests/renderer/cut testvec/testv/renderer/ref
    - cp -r tests/conformance-test testvec/
    - cp Readme_IVAS_dec.txt testvec
    - cp Readme_IVAS_enc.txt testvec 
    - cp Readme_IVAS_rend.txt testvec
    - cp Readme_IVAS_JBM_dec.txt testvec
    - cp IVAS_cod testvec/bin
    - cp IVAS_dec testvec/bin
    - cp IVAS_rend testvec/bin
    
    # Test run generated scripts in testvec
    - cd testvec    
    - python3 -m pytest conformance-test/test_26252.py --junit-xml=report-junit.xml --html=report.html --self-contained-html
    - mv report.html ..
    - mv report-junit.xml ..

  artifacts:
    name: "ivas-conformance-linux-$CI_COMMIT_SHORT_SHA"
    expire_in: 1 week
    when: always
    paths:
      - report-junit.xml
      - report.html
      - Readme_IVAS_dec.txt  
      - Readme_IVAS_enc.txt  
      - Readme_IVAS_rend.txt
      - Readme_IVAS_JBM_dec.txt
    expose_as: "Draft IVAS conformance -- Linux"
    reports:
      junit: report-junit.xml


test-long-self-test:
  tags:
    - ivas-linux-fast
@@ -1538,6 +1628,8 @@ ltv-usan:
    paths:
      - ep_015.g192
      - dly_profile.dat
      - head_rot_traj.csv
      - exof_traj.csv
      - ./LOGS_PLC
      - ./LOGS_noPLC

+25 −0
Original line number Diff line number Diff line
import numpy as np


FRAMES_PER_SEC = 50


def random_trajectory(duration_sec):
    n_frames = int(FRAMES_PER_SEC * duration_sec)
    trj = np.random.random((n_frames, 4))
    trj[:, 0] = -3
    trj[:, 1] *= 180
    trj[:, 2] *= 90
    trj[:, 3] *= 180
    return trj


def constant_trajectory(duration_sec, yaw=0, pitch=0, roll=0):
    n_frames = int(FRAMES_PER_SEC * duration_sec)
    trj = np.empty((n_frames, 4))
    trj[:, 0] = -3
    trj[:, 1] = yaw
    trj[:, 2] = pitch
    trj[:, 3] = roll
    return trj
+41 −6
Original line number Diff line number Diff line
@@ -33,6 +33,8 @@ import argparse
import pathlib
import subprocess
import sys
import numpy as np
import json

CI_SCRIPT_DIR = "./ci"
sys.path.append(CI_SCRIPT_DIR)
@@ -41,6 +43,8 @@ from collect_artifacts import (
    find_failed_files_for_sanitizer_test,
)
from combine_genpatt_and_jbm_profile import combine_error_profiles
from create_trajectories import random_trajectory


SCRIPT_DIR = pathlib.Path("./scripts").resolve()
DURATION = "120"
@@ -54,12 +58,23 @@ N_FRAMES_DLY_PROFILE = 7500
GENPATT_CMD = f"gen-patt -tailstat -fer -g192 -gamma 0 -rate 0.15 -tol 0.001 -reset -n {N_FRAMES_DLY_PROFILE} {EP_FILE}"
MC_MODES = ["5_1", "5_1_2", "5_1_4", "7_1", "7_1_4"]
AMBISONICS_MODES = ["HOA3", "HOA2", "FOA", "PlanarHOA3", "PlanarHOA2", "PlanarFOA"]
TIMEOUT = (
    60 * 20
)  # timeout of 15 minutes per en/decoding to safeguard against endless loops
# timeout of 15 minutes per en/decoding to safeguard against endless loops
TIMEOUT = 60 * 20
HEAD_TRAJ_FILE = str(pathlib.Path("./head_rot_traj.csv").resolve())
EXOF_TRAJ_FILE = str(pathlib.Path("./exof_traj.csv").resolve())

CONSOLE_OUT_FILE = "output_san.txt"

HEAD_ROT_ARGS = ["-t", HEAD_TRAJ_FILE]
EXOF_ARGS = ["-exof", EXOF_TRAJ_FILE]
OTR_ARGS = ["-otr", "avg"]
BINAURAL_OUT_ARGS = HEAD_ROT_ARGS + EXOF_ARGS + OTR_ARGS
ARGS_FOR_OC = {
    "BINAURAL": BINAURAL_OUT_ARGS,
    "BINAURAL_ROOM_IR": BINAURAL_OUT_ARGS,
    "BINAURAL_ROOM_REVERB": BINAURAL_OUT_ARGS,
}


def main(args):
    in_format = args.in_format
@@ -112,6 +127,12 @@ def get_modes(in_format: str) -> list:
    return mode_list


def assemble_oc_dict(out_formats: list):
    oc_dict = {of: ARGS_FOR_OC.get(of, list()) for of in out_formats}

    return json.dumps(oc_dict)


def get_md_file_command(in_format: str) -> list:

    cmd = list()
@@ -127,11 +148,19 @@ def get_md_file_command(in_format: str) -> list:
def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = True):

    modes = get_modes(in_format)
    md_file_command = get_md_file_command(in_format)

    if len(modes) == 0:
        return 0

    md_file_command = get_md_file_command(in_format)
    oc_str = assemble_oc_dict(out_formats)

    # create random trajectory files
    if "BINAURAL" in oc_str:
        trajectory_files = [HEAD_TRAJ_FILE, EXOF_TRAJ_FILE]
        for tf in trajectory_files:
            traj = random_trajectory(int(DURATION))
            np.savetxt(tf, traj, fmt="%.2f", delimiter=",")

    ### always run encoder and decoder with no frameloss
    cmd_no_fec = [
        str(SCRIPT_DIR.joinpath("IvasBuildAndRunChecks.py")),
@@ -146,7 +175,7 @@ def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = Tr
        "-m",
        *modes,
        "--oc",
        *out_formats,
        oc_str,
        *md_file_command,
        "--usan_supp_file",
        USAN_SUPP_FILE,
@@ -154,6 +183,12 @@ def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = Tr
        str(TIMEOUT),
    ]

    # to test non-diegetic panning with mono decoding:
    # resue decoder part of StereDmxEVS mode (it is basically a duplicate of "normal" mono run)
    if in_format == "StereoDmxEVS":
        panning = np.random.randint(-90, 91)
        cmd_no_fec += [f'-D=-non_diegetic_pan {panning}']

    print(
        "======== Script command line WITHOUT plc: ========\n{}".format(
            " ".join(cmd_no_fec)
+10 −11
Original line number Diff line number Diff line
@@ -82,8 +82,8 @@ echo "\n======================= 0. preparing combined format test inputs =======

# run all modes vanilla-fashion
# treat ISM modes separately because passing the metadata files to MASA modes causes crashes
ism_modes=$(./scripts/runIvasCodec.py -l | grep ^ISM)
non_ism_modes=$(./scripts/runIvasCodec.py -l | grep -v ^ISM)
ism_modes=$(./scripts/runIvasCodec.py -l | grep ISM)
non_ism_modes=$(./scripts/runIvasCodec.py -l | grep -v ISM)
echo "\n======================= 1. non-ism modes no FEC =======================\n\n"
./scripts/runIvasCodec.py $verbosity_cmd -m $non_ism_modes -p $cfg $duration_arg $timeout_cmd | tee smoke_test_output.txt
echo "\n======================= 2. ism modes no FEC =======================\n\n"
@@ -93,29 +93,28 @@ echo "\n======================= 3. all modes with FEC =======================\n\
./scripts/runIvasCodec.py $verbosity_cmd -p $cfg $duration_arg -f="$ep_file" --decoder_only $timeout_cmd | tee smoke_test_output_plc.txt

# run JBM modes - EXT is excluded as not supported yet
# OMASA disabled for now
modes_with_no_ext_out=$(./scripts/runIvasCodec.py -l | grep -v ^MASA | grep -v ^ISM | grep -v OMASA)
modes_with_ext_out=$(./scripts/runIvasCodec.py -l | grep 'MASA\|ISM' | grep -v ^ISM+ | grep -v OMASA)
formats_with_no_ext_out=$(./scripts/runIvasCodec.py -L | grep -v MASA | grep -v ISM | grep -v OSBA)
formats_with_ext_out=$(./scripts/runIvasCodec.py -L | grep 'MASA\|ISM\|OSBA')
echo "\n======================= 4. JBM, modes with no EXT =======================\n\n"
./scripts/runIvasCodec.py $verbosity_cmd -m $modes_with_no_ext_out -p $cfg $duration_arg --decoder_only --jbm_file $dly_profile $timeout_cmd | tee smoke_test_output_jbm_noEXT.txt
./scripts/runIvasCodec.py $verbosity_cmd -C $formats_with_no_ext_out -p $cfg $duration_arg --decoder_only --jbm_file $dly_profile $timeout_cmd | tee smoke_test_output_jbm_noEXT.txt
echo "\n======================= 5. JBM, modes with EXT =======================\n\n"
./scripts/runIvasCodec.py  $verbosity_cmd -m $modes_with_ext_out -p $cfg $duration_arg --decoder_only --jbm_file $dly_profile --oc BINAURAL BINAURAL_ROOM_IR mono stereo FOA HOA3 5_1 7_1_4 $timeout_cmd | tee -a smoke_test_output_jbm_noEXT.txt
./scripts/runIvasCodec.py  $verbosity_cmd -C $formats_with_ext_out -p $cfg $duration_arg --decoder_only --jbm_file $dly_profile --oc BINAURAL BINAURAL_ROOM_IR mono stereo FOA HOA3 5_1 7_1_4 $timeout_cmd | tee -a smoke_test_output_jbm_noEXT.txt

# run all modes with binaural output using external files
modes_with_bin_out="FOA HOA2 HOA3 PlanarFOA PlanarHOA2 PlanarHOA3 MASA MC ISM1 ISM2 ISM3 ISM4"
formats_with_bin_out=$(./scripts/runIvasCodec.py -L | grep -v "mono\|tereo")
bin_out_modes="BINAURAL BINAURAL_ROOM_IR"

echo "\n======================= 6. binaural out with HRTF files - WB =======================\n\n"
wb_modes=$(./scripts/runIvasCodec.py -l -C $modes_with_bin_out | grep _wb_)
wb_modes=$(./scripts/runIvasCodec.py -l -C $formats_with_bin_out | grep _wb_)
hrtf_wb="../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin"
./scripts/runIvasCodec.py $verbosity_cmd -p $cfg -m $wb_modes $duration_arg -D="-hrtf ${hrtf_wb}" --decoder_only --oc $bin_out_modes $timeout_cmd | tee -a smoke_test_output_hrtf.txt

echo "\n======================= 7. binaural out with HRTF files - SWB =======================\n\n"
swb_modes=$(./scripts/runIvasCodec.py -l -C $modes_with_bin_out | grep _swb_)
swb_modes=$(./scripts/runIvasCodec.py -l -C $formats_with_bin_out | grep _swb_)
hrtf_swb="../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin"
./scripts/runIvasCodec.py $verbosity_cmd -p $cfg -m $swb_modes $duration_arg -D="-hrtf ${hrtf_swb}" --decoder_only --oc $bin_out_modes $timeout_cmd | tee -a smoke_test_output_hrtf.txt

echo "\n======================= 8. binaural out with HRTF files - FB =======================\n\n"
fb_modes=$(./scripts/runIvasCodec.py -l -C $modes_with_bin_out | grep _fb_)
fb_modes=$(./scripts/runIvasCodec.py -l -C $formats_with_bin_out | grep _fb_)
hrtf_fb="../scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin"
./scripts/runIvasCodec.py $verbosity_cmd -p $cfg -m $fb_modes $duration_arg -D="-hrtf ${hrtf_fb}" --decoder_only --oc $bin_out_modes $timeout_cmd | tee -a smoke_test_output_hrtf.txt
+0 −4
Original line number Diff line number Diff line
@@ -1195,11 +1195,7 @@ enum
#define MASA_COHERENCE_TOLERANCE                0.1f
#define MASA_COHERENCE_THRESHOLD                0.1f
#define MASA_RATIO_TOLERANCE                    0.1f
#ifdef NONBE_FIX_1034_DRY_MASA_RATIOS
#define MASA_RATIO_THRESHOLD                    0.015f
#else
#define MASA_RATIO_THRESHOLD                    0.1f
#endif
#define MASA_ANGLE_TOLERANCE                    0.5f
#define MASA_LIMIT_NO_BANDS_SUR_COH             8
#define MINIMUM_BIT_BUDGET_NORMAL_META          100
Loading