From ca520084d43e973ae4bf70a7b80e0aea96cdc2b2 Mon Sep 17 00:00:00 2001 From: knj Date: Mon, 8 Jan 2024 15:26:49 +0100 Subject: [PATCH 1/4] add script for combining .192 eps and jbm dly profile files --- ci/combine_genpatt_and_jbm_profile.py | 70 +++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 ci/combine_genpatt_and_jbm_profile.py diff --git a/ci/combine_genpatt_and_jbm_profile.py b/ci/combine_genpatt_and_jbm_profile.py new file mode 100644 index 0000000000..b039ceb990 --- /dev/null +++ b/ci/combine_genpatt_and_jbm_profile.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python3 +""" + (C) 2022-2023 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. +""" + +import argparse +import numpy as np + + +ERR_MAGIC_NUM_DLY_PROF = -1 +ERR_MAGIC_NUM_G192 = 27424 + + +def combine_error_profiles(genpatt_file, jbm_dly_profile, output_file): + ep = np.fromfile(genpatt_file, dtype="int16") + with open(jbm_dly_profile) as f: + dly = np.asarray([int(l.strip()) for l in f.readlines()]) + + # if one wants to differently-sized files, add wraparound/shorten logic here + # in ci, file lengths will match + assert len(ep) == len(dly) + + # remove lost frames already in the dly profile + # replace with no delay (not there in the profile files, except the all-zero one) + err_idx = np.where(dly == ERR_MAGIC_NUM_DLY_PROF)[0] + dly[err_idx] = 0 + + # insert lost frames based on .g192 file + err_idx = np.where(ep == ERR_MAGIC_NUM_G192)[0] + dly[err_idx] = -1 + + with open(output_file, "w") as f: + for d in dly: + f.write(f"{int(d)}\n") + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("genpatt_file") + parser.add_argument("jbm_dly_profile") + parser.add_argument("output_file") + args = parser.parse_args() + + combine_error_profiles(**vars(args)) -- GitLab From 604e1ec2c951f19c3d02718f49bfe916e9319d53 Mon Sep 17 00:00:00 2001 From: knj Date: Mon, 8 Jan 2024 15:37:10 +0100 Subject: [PATCH 2/4] use jbm dly profile for 2nd impaired-channel run --- ci/run_scheduled_sanitizer_test.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ci/run_scheduled_sanitizer_test.py b/ci/run_scheduled_sanitizer_test.py index c30c7bc2c4..a668991c79 100755 --- a/ci/run_scheduled_sanitizer_test.py +++ b/ci/run_scheduled_sanitizer_test.py @@ -40,19 +40,20 @@ from collect_artifacts import ( find_failed_files_for_sanitizer_test, collect_for_sanitizer_test, ) +from combine_genpatt_and_jbm_profile import combine_error_profiles +SCRIPT_DIR = pathlib.Path("./scripts").resolve() DURATION = "120" CFG = "ci_linux_ltv.json" SUPPORTED_TESTS = ["CLANG1", "CLANG2", "CLANG3", "VALGRIND"] EP_FILE = "ep_015.g192" +DLY_PROFILE_IN = SCRIPT_DIR.joinpath("dly_error_profiles/dly_error_profile_5.dat") +DLY_PROFILE_OUT = "dly_profile.dat" GENPATT_CMD = f"gen-patt -tailstat -fer -g192 -gamma 0 -rate 0.15 -tol 0.001 -reset -n {int(DURATION) * 50} {EP_FILE}" -EIDXOR_CMD = "eid-xor -vbr -fer {bitstream} {ep_file} {out_file}" MC_MODES = ["5_1", "5_1_2", "5_1_4", "7_1", "7_1_4"] AMBISONICS_MODES = ["HOA3", "HOA2", "FOA", "PlanarHOA3", "PlanarHOA2", "PlanarFOA"] -SCRIPT_DIR = pathlib.Path("./scripts").resolve() - CONSOLE_OUT_FILE = "output_san.txt" @@ -186,6 +187,7 @@ def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = Tr # generate error pattern subprocess.call(GENPATT_CMD.split()) + combine_error_profiles(EP_FILE, DLY_PROFILE_IN, DLY_PROFILE_OUT) # cleanup to avoid script errors # we want "logs" and "dec" subfolders to be empty -> delete "dec" and rename "log" @@ -203,7 +205,7 @@ def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = Tr # need empty log folder to avoid crashes path.mkdir() - cmd_fec = cmd_no_fec + ["--decoder_only", "-f", EP_FILE] + cmd_fec = cmd_no_fec + ["--decoder_only", "-J", DLY_PROFILE_OUT] print( "======== Script command line WITH plc: ========\n{}".format( " ".join(cmd_no_fec) -- GitLab From dbbe057c57a271241940f782380893285994daf5 Mon Sep 17 00:00:00 2001 From: knj Date: Mon, 8 Jan 2024 16:07:10 +0100 Subject: [PATCH 3/4] use length of dly profile for ep generation --- ci/run_scheduled_sanitizer_test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/run_scheduled_sanitizer_test.py b/ci/run_scheduled_sanitizer_test.py index a668991c79..327b511a37 100755 --- a/ci/run_scheduled_sanitizer_test.py +++ b/ci/run_scheduled_sanitizer_test.py @@ -50,7 +50,8 @@ SUPPORTED_TESTS = ["CLANG1", "CLANG2", "CLANG3", "VALGRIND"] EP_FILE = "ep_015.g192" DLY_PROFILE_IN = SCRIPT_DIR.joinpath("dly_error_profiles/dly_error_profile_5.dat") DLY_PROFILE_OUT = "dly_profile.dat" -GENPATT_CMD = f"gen-patt -tailstat -fer -g192 -gamma 0 -rate 0.15 -tol 0.001 -reset -n {int(DURATION) * 50} {EP_FILE}" +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"] -- GitLab From 2e0f2028e9719303bda8b8b10b8f13390809ceda Mon Sep 17 00:00:00 2001 From: knj Date: Mon, 8 Jan 2024 16:08:09 +0100 Subject: [PATCH 4/4] fix bug with commandline printout --- ci/run_scheduled_sanitizer_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/run_scheduled_sanitizer_test.py b/ci/run_scheduled_sanitizer_test.py index 327b511a37..c6d3d78d45 100755 --- a/ci/run_scheduled_sanitizer_test.py +++ b/ci/run_scheduled_sanitizer_test.py @@ -209,7 +209,7 @@ def run_check(in_format: str, out_formats: list, tests: list, run_fec: bool = Tr cmd_fec = cmd_no_fec + ["--decoder_only", "-J", DLY_PROFILE_OUT] print( "======== Script command line WITH plc: ========\n{}".format( - " ".join(cmd_no_fec) + " ".join(cmd_fec) ) ) -- GitLab