From 645b65da401cf0b0997125dc5d1d013f3b829ee0 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Thu, 10 Oct 2024 13:20:27 +0200 Subject: [PATCH 1/6] comment unsupported testcases + EXT -> native mode --- tests/test_be_for_jbm_neutral_dly_profile.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/test_be_for_jbm_neutral_dly_profile.py b/tests/test_be_for_jbm_neutral_dly_profile.py index 61bb168a2f..743a4e0cfb 100644 --- a/tests/test_be_for_jbm_neutral_dly_profile.py +++ b/tests/test_be_for_jbm_neutral_dly_profile.py @@ -17,7 +17,7 @@ DTX_OFF = "DTX_OFF" # TODO: Clarify if this should also be tested with DTX, see #1122 TESTCASES = [ # stereo - ["stereo", 32000, "EXT", "DTX_OFF"], + ["stereo", 32000, "STEREO", "DTX_OFF"], ["stereo", 48000, "MONO", "DTX_OFF"], ["stereo", 16400, "5_1", "DTX_OFF"], ["stereo", 256000, "7_1_4", "DTX_OFF"], @@ -42,21 +42,21 @@ TESTCASES = [ # McMasa ["MC_5_1", 16400, "BINAURAL_ROOM_IR", "DTX_OFF"], ["MC_7_1_4", 80000, "mono", "DTX_OFF"], - ["MC_5_1_2", 24400, "EXT", "DTX_OFF"], + ["MC_5_1_2", 24400, "5_1_2", "DTX_OFF"], # paramMC ["MC_5_1_2", 48000, "BINAURAL", "DTX_OFF"], - ["MC_7_1", 80000, "EXT", "DTX_OFF"], + ["MC_7_1", 80000, "7_1", "DTX_OFF"], ["MC_7_1_4", 128000, "FOA", "DTX_OFF"], # paramUpmix ["MC_7_1_4", 160000, "stereo", "DTX_OFF"], # discrete MC ["MC_5_1_2", 512000, "BINAURAL_ROOM_REVERB", "DTX_OFF"], - ["MC_7_1", 128000, "EXT", "DTX_OFF"], + ["MC_7_1", 128000, "7_1", "DTX_OFF"], ["MC_7_1_4", 256000, "5_1", "DTX_OFF"], # SBA ["HOA3", 64000, "BINAURAL", "DTX_OFF"], ["FOA", 256000, "BINAURAL_ROOM_REVERB", "DTX_OFF"], - ["HOA2", 80000, "EXT", "DTX_OFF"], + ["HOA2", 80000, "HOA2", "DTX_OFF"], ["HOA3", 512000, "5_1_4", "DTX_OFF"], ["FOA", 80000, "stereo", "DTX_OFF"], # OMASA @@ -64,11 +64,11 @@ TESTCASES = [ ["OMASA_ISM2", 24400, "MONO", "DTX_OFF"], ["OMASA_ISM3", 80000, "7_1_4", "DTX_OFF"], ["OMASA_ISM4", 64000, "HOA3", "DTX_OFF"], - ["OMASA_ISM2", 32000, "EXT", "DTX_OFF"], + # ["OMASA_ISM2", 32000, "EXT", "DTX_OFF"], # OSBA ["OSBA_ISM2_HOA2", 64000, "BINAURAL_ROOM_IR", "DTX_OFF"], - ["OSBA_ISM4_FOA", 512000, "BINAURAL_ROOM_REVERB", "DTX_OFF"], - ["OSBA_ISM3_HOA3", 128000, "EXT", "DTX_OFF"], + # ["OSBA_ISM4_FOA", 512000, "BINAURAL_ROOM_REVERB", "DTX_OFF"], + # ["OSBA_ISM3_HOA3", 128000, "EXT", "DTX_OFF"], ["OSBA_ISM2_HOA3", 96000, "5_1", "DTX_OFF"], ["OSBA_ISM1_HOA2", 32000, "mono", "DTX_OFF"], ] -- GitLab From 9d704f568403475ecd822dd1a1264f5c866aa151 Mon Sep 17 00:00:00 2001 From: Lauros Pajunen Date: Tue, 22 Oct 2024 16:44:20 +0300 Subject: [PATCH 2/6] Add complexity script, add basop and skip_build arguments to script --- scripts/IvasBuildAndRunChecks.py | 12 ++ scripts/pyivastest/IvasSvnBuilder.py | 224 ++++++++++++++----------- scripts/smoke_test_complexity_basop.sh | 214 +++++++++++++++++++++++ 3 files changed, 352 insertions(+), 98 deletions(-) create mode 100644 scripts/smoke_test_complexity_basop.sh diff --git a/scripts/IvasBuildAndRunChecks.py b/scripts/IvasBuildAndRunChecks.py index c1f31e433d..57272b64e0 100755 --- a/scripts/IvasBuildAndRunChecks.py +++ b/scripts/IvasBuildAndRunChecks.py @@ -100,6 +100,16 @@ class IvasBuildAndRunChecks(IvasScriptsCommon.IvasScript): help="pass the '-s' argument to the wmc tool to only measure memory", action="store_true", ) + self.parser.add_argument( + "--basop", + help="build the basop version for instrumentation", + action="store_true", + ) + self.parser.add_argument( + "--skip_build", + help="skip instrumentation and build", + action="store_true", + ) def run(self): @@ -165,6 +175,8 @@ class IvasBuildAndRunChecks(IvasScriptsCommon.IvasScript): formats_fname=self.args["format_file"], max_workers=self.args["max_workers"], mem_only=self.args["wmc_tool_mem_only"], + basop=self.args["basop"], + skip_build=self.args["skip_build"], ) else: br.add_check( diff --git a/scripts/pyivastest/IvasSvnBuilder.py b/scripts/pyivastest/IvasSvnBuilder.py index e437843d16..a35278b780 100644 --- a/scripts/pyivastest/IvasSvnBuilder.py +++ b/scripts/pyivastest/IvasSvnBuilder.py @@ -227,6 +227,8 @@ class IvasBuilder(IvasBaseClass): defines_to_disable=[], instrumented=False, mem_only=False, + basop=False, + skip_build=False, ): """ @@ -265,119 +267,129 @@ class IvasBuilder(IvasBaseClass): build_log = open(build_log_name, "w") # build if instrumented: - self.logger.console("Instrumenting...", logging.INFO) - make_dir = os.path.join(self.src_dir, "scripts", "c-code_instrument") - # remove if it c-code_instrument already exists - if os.path.exists(make_dir): - shutil.rmtree(make_dir) - instrument_cmd = [ - os.path.join(self.src_dir, "scripts", "prepare_instrumentation.sh") - ] - if mem_only: - instrument_cmd.append("mem_only") - build_log.write(" ".join(instrument_cmd)) - build_log.write("\n") - build_result = subprocess.run( - instrument_cmd, capture_output=True, text=True, check=True - ) - build_log.write(build_result.stderr) - build_log.write(build_result.stdout) - build_log.write("\n") + if skip_build: + self.logger.console("Skipping instrumentation", logging.INFO) + else: + self.logger.console("Instrumenting...", logging.INFO) + make_dir = os.path.join(self.src_dir, "scripts", "c-code_instrument") + # remove if it c-code_instrument already exists + if os.path.exists(make_dir): + shutil.rmtree(make_dir) + instrument_cmd = [ + os.path.join(self.src_dir, "scripts", "prepare_instrumentation.sh") + ] + if mem_only: + instrument_cmd.append("-m") + instrument_cmd.append("mem_only") + if basop: + instrument_cmd.append("-p") + instrument_cmd.append("basop") + build_log.write(" ".join(instrument_cmd)) + build_log.write("\n") + build_result = subprocess.run( + instrument_cmd, capture_output=True, text=True, check=True + ) + build_log.write(build_result.stderr) + build_log.write(build_result.stdout) + build_log.write("\n") else: make_dir = self.src_dir build_log.write("".join(["Build directory: ", make_dir])) build_log.write("\n") - self.logger.console("Building...", logging.INFO) + if skip_build: + self.logger.console("Skipping building", logging.INFO) + else: + self.logger.console("Building...", logging.INFO) - # to be safe remove existing binaries - if os.path.exists( - os.path.join(make_dir, "".join(["IVAS_cod", self.binary_ext])) - ): - os.remove(os.path.join(make_dir, "".join(["IVAS_cod", self.binary_ext]))) - if os.path.exists( - os.path.join(make_dir, "".join(["IVAS_dec", self.binary_ext])) - ): - os.remove(os.path.join(make_dir, "".join(["IVAS_dec", self.binary_ext]))) - if os.path.exists( - os.path.join(make_dir, "".join(["EVS_cod", self.binary_ext])) - ): - os.remove(os.path.join(make_dir, "".join(["EVS_cod", self.binary_ext]))) - if os.path.exists( - os.path.join(make_dir, "".join(["EVS_dec", self.binary_ext])) - ): - os.remove(os.path.join(make_dir, "".join(["EVS_dec", self.binary_ext]))) - # remove also in the target directory if it exists - if os.path.abspath(make_dir) != os.path.abspath(sub_dir): + # to be safe remove existing binaries if os.path.exists( - os.path.join(sub_dir, "".join(["IVAS_cod", self.binary_ext])) + os.path.join(make_dir, "".join(["IVAS_cod", self.binary_ext])) ): - os.remove(os.path.join(sub_dir, "".join(["IVAS_cod", self.binary_ext]))) + os.remove(os.path.join(make_dir, "".join(["IVAS_cod", self.binary_ext]))) if os.path.exists( - os.path.join(sub_dir, "".join(["IVAS_dec", self.binary_ext])) + os.path.join(make_dir, "".join(["IVAS_dec", self.binary_ext])) ): - os.remove(os.path.join(sub_dir, "".join(["IVAS_dec", self.binary_ext]))) + os.remove(os.path.join(make_dir, "".join(["IVAS_dec", self.binary_ext]))) if os.path.exists( - os.path.join(sub_dir, "".join(["EVS_cod", self.binary_ext])) + os.path.join(make_dir, "".join(["EVS_cod", self.binary_ext])) ): - os.remove(os.path.join(sub_dir, "".join(["EVS_cod", self.binary_ext]))) + os.remove(os.path.join(make_dir, "".join(["EVS_cod", self.binary_ext]))) if os.path.exists( - os.path.join(sub_dir, "".join(["EVS_dec", self.binary_ext])) + os.path.join(make_dir, "".join(["EVS_dec", self.binary_ext])) ): - os.remove(os.path.join(sub_dir, "".join(["EVS_dec", self.binary_ext]))) - - build_success = -1 - if self.system == "Windows": - make_sln = os.path.join(make_dir, "Workspace_msvc", "Workspace_msvc.sln") - clean_cmd = [self.msbuild, make_sln, "/t:clean"] - build_log.write(" ".join(clean_cmd)) - build_log.write("\n") - make_cmd = [self.msbuild, make_sln] + make_options - build_result = subprocess.run( - clean_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE - ) - build_log.write(build_result.stderr.decode("cp1252")) - build_log.write(build_result.stderr.decode("cp1252")) - build_log.write(" ".join(make_cmd)) - build_log.write("\n") - build_result = subprocess.run( - list(filter(None, make_cmd)), - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - ) - build_success = build_result.returncode - build_log.write(build_result.stderr.decode("cp1252")) - build_log.write(build_result.stderr.decode("cp1252")) - else: - clean_cmd = ["make", "-C", make_dir, "clean"] - build_log.write(" ".join(clean_cmd)) - build_log.write("\n") - make_cmd = ["make", "-C", make_dir] + make_options - build_result = subprocess.run( - clean_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE - ) - build_log.write(build_result.stderr.decode()) - build_log.write(build_result.stdout.decode()) - build_log.write(" ".join(make_cmd)) - build_log.write("\n") - build_result = subprocess.run( - list(filter(None, make_cmd)), - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - ) - build_success = build_result.returncode - build_log.write(build_result.stderr.decode()) - build_log.write(build_result.stdout.decode()) + os.remove(os.path.join(make_dir, "".join(["EVS_dec", self.binary_ext]))) + # remove also in the target directory if it exists + if os.path.abspath(make_dir) != os.path.abspath(sub_dir): + if os.path.exists( + os.path.join(sub_dir, "".join(["IVAS_cod", self.binary_ext])) + ): + os.remove(os.path.join(sub_dir, "".join(["IVAS_cod", self.binary_ext]))) + if os.path.exists( + os.path.join(sub_dir, "".join(["IVAS_dec", self.binary_ext])) + ): + os.remove(os.path.join(sub_dir, "".join(["IVAS_dec", self.binary_ext]))) + if os.path.exists( + os.path.join(sub_dir, "".join(["EVS_cod", self.binary_ext])) + ): + os.remove(os.path.join(sub_dir, "".join(["EVS_cod", self.binary_ext]))) + if os.path.exists( + os.path.join(sub_dir, "".join(["EVS_dec", self.binary_ext])) + ): + os.remove(os.path.join(sub_dir, "".join(["EVS_dec", self.binary_ext]))) + + build_success = -1 + if self.system == "Windows": + make_sln = os.path.join(make_dir, "Workspace_msvc", "Workspace_msvc.sln") + clean_cmd = [self.msbuild, make_sln, "/t:clean"] + build_log.write(" ".join(clean_cmd)) + build_log.write("\n") + make_cmd = [self.msbuild, make_sln] + make_options + build_result = subprocess.run( + clean_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE + ) + build_log.write(build_result.stderr.decode("cp1252")) + build_log.write(build_result.stderr.decode("cp1252")) + build_log.write(" ".join(make_cmd)) + build_log.write("\n") + build_result = subprocess.run( + list(filter(None, make_cmd)), + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + ) + build_success = build_result.returncode + build_log.write(build_result.stderr.decode("cp1252")) + build_log.write(build_result.stderr.decode("cp1252")) + else: + clean_cmd = ["make", "-C", make_dir, "clean"] + build_log.write(" ".join(clean_cmd)) + build_log.write("\n") + make_cmd = ["make", "-C", make_dir] + make_options + build_result = subprocess.run( + clean_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE + ) + build_log.write(build_result.stderr.decode()) + build_log.write(build_result.stdout.decode()) + build_log.write(" ".join(make_cmd)) + build_log.write("\n") + build_result = subprocess.run( + list(filter(None, make_cmd)), + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + ) + build_success = build_result.returncode + build_log.write(build_result.stderr.decode()) + build_log.write(build_result.stdout.decode()) - if build_success != 0: - self.logger.console( - f"Something went wrong with building, please check {build_log_name}!", - logging.ERROR, - ) - build_log.flush() - build_log.close() - else: - success = True + if build_success != 0: + self.logger.console( + f"Something went wrong with building, please check {build_log_name}!", + logging.ERROR, + ) + build_log.flush() + build_log.close() + else: + success = True # test for EVS vs IVAS # avoid copying if make_dir and sub_dir are identical @@ -644,6 +656,8 @@ class IvasSvnBuilder(IvasBuilder): defines_to_disable=[], instrumented=False, mem_only=False, + basop=False, + skip_build=False, ): """ @@ -673,6 +687,8 @@ class IvasSvnBuilder(IvasBuilder): defines_to_disable=defines_to_disable, instrumented=instrumented, mem_only=mem_only, + basop=basop, + skip_build=skip_build, ) @@ -781,6 +797,8 @@ class IvasBuilderAndRunner(IvasBaseClass): max_workers=1, timeout=None, mem_only=False, + basop=False, + skip_build=False, ): """ @@ -826,6 +844,8 @@ class IvasBuilderAndRunner(IvasBaseClass): self.build_and_run_dict[cfg_name]["instrumented"] = instrumented self.build_and_run_dict[cfg_name]["mem_only"] = mem_only self.build_and_run_dict[cfg_name]["make_options"] = make_options + self.build_and_run_dict[cfg_name]["basop"] = basop + self.build_and_run_dict[cfg_name]["skip_build"] = skip_build else: self.logger.console("Adding config {}".format(cfg_name), logging.INFO) run_dir = os.path.join(self.builder.src_dir, cfg_name) @@ -871,6 +891,8 @@ class IvasBuilderAndRunner(IvasBaseClass): "mem_only": mem_only, "make_options": make_options, "analyzer": new_analyzer, + "basop": basop, + "skip_build": skip_build, } } self.build_and_run_dict.update(cfg_dict) @@ -1054,6 +1076,8 @@ class IvasBuilderAndRunner(IvasBaseClass): defines_to_disable=cfg["defines_to_disable"], instrumented=cfg["instrumented"], mem_only=cfg["mem_only"], + basop=cfg["basop"], + skip_build=cfg["skip_build"] ) self.build_and_run_dict[cfg_name]["runner"].encoder = self.builder.encoder self.build_and_run_dict[cfg_name]["runner"].decoder = self.builder.decoder @@ -1255,6 +1279,8 @@ class IvasBuilderAndRunner(IvasBaseClass): formats_fname="", max_workers=1, mem_only=False, + basop=False, + skip_build=False, ): """ @@ -1288,6 +1314,8 @@ class IvasBuilderAndRunner(IvasBaseClass): formats_fname=formats_fname, max_workers=max_workers, mem_only=mem_only, + basop=basop, + skip_build=skip_build, ) # TODO: this is used nowhere, is this still needed? diff --git a/scripts/smoke_test_complexity_basop.sh b/scripts/smoke_test_complexity_basop.sh new file mode 100644 index 0000000000..df7d915270 --- /dev/null +++ b/scripts/smoke_test_complexity_basop.sh @@ -0,0 +1,214 @@ +#! /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 " smoke_test_complexity_basop.sh [--max_cores nMaxCores]" + echo + echo " nMaxCores - the number of CPUs to use (default 42)" + exit +} + +if [ ! -d "lib_com" ]; then + echo "not in root directory! - please run in IVAS root" + exit 1 +fi + +if [[ -z "$1" ]]; then + MAX_CORES=42 +elif [[ "$1" == "--max_cores" ]]; then + if [[ -z "$2" ]]; then + echo "Need maximum number of cores" + exit 1 + else + MAX_CORES=$2 + fi +else + usage +fi + +cfg=./scripts/config/ci_linux_ltv.json +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" +duration_arg="" +complexity_cmd="--checks COMPLEXITY --wmc_tool_mem_only --basop --skip_build --create_complexity_tables" +max_num_workers="--max_workers $MAX_CORES" + +# prepare combined format test signals +echo "\n======================= 0. preparing combined format test inputs =======================\n\n" +./scripts/prepare_combined_format_inputs.py + +# Modes +mono_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^mono) +FOA_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^FOA) +HOA2_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^HOA2) +HOA3_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^HOA3) +PlanarFOA_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^PlanarFOA) +PlanarHOA2_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^PlanarHOA2) +PlanarHOA3_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^PlanarHOA3) +MASA_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^MASA) +MC_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^MC) +stereo_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^stereo) +stereoDmx_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^StereoDmx) +OMASA_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^OMASA) +OSBA_ISM1_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^OSBA_ISM1) +OSBA_ISM2_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^OSBA_ISM2) +OSBA_ISM3_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^OSBA_ISM3) +OSBA_ISM4_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^OSBA_ISM4) +ISM1_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^ISM1) +ISM2_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^ISM2) +ISM3_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^ISM3) +ISM4_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^ISM4) +ISM_plus1_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^ISM+1) +ISM_plus2_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^ISM+2) +ISM_plus3_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^ISM+3) +ISM_plus4_modes=$(./scripts/IvasBuildAndRunChecks.py -l | grep ^ISM+4) + + +echo "\n======================= 1. Mono =======================\n\n" +./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_mono_no_fec -m $mono_modes -p $cfg $duration_arg $max_num_workers | tee smoke_test_output_mono.txt +rm -r ./COMPLEXITY/dec/ +rm -r ./COMPLEXITY/enc/ +rm -r ./COMPLEXITY/pcm/ +echo "\n======================= 2. FOA =======================\n\n" +./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_FOA_no_fec -m $FOA_modes -p $cfg $duration_arg $max_num_workers | tee smoke_test_output_FOA.txt +rm -r ./COMPLEXITY/dec/ +rm -r ./COMPLEXITY/enc/ +rm -r ./COMPLEXITY/pcm/ +echo "\n======================= 3. HOA2 =======================\n\n" +./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_HOA2_no_fec -m $HOA2_modes -p $cfg $duration_arg $max_num_workers | tee smoke_test_output_HOA2.txt +rm -r ./COMPLEXITY/dec/ +rm -r ./COMPLEXITY/enc/ +rm -r ./COMPLEXITY/pcm/ +echo "\n======================= 4. HOA3 =======================\n\n" +./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_HOA3_no_fec -m $HOA3_modes -p $cfg $duration_arg $max_num_workers | tee smoke_test_output_HOA3.txt +rm -r ./COMPLEXITY/dec/ +rm -r ./COMPLEXITY/enc/ +rm -r ./COMPLEXITY/pcm/ +echo "\n======================= 5. PlanarFOA =======================\n\n" +./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_PlanarFOA_no_fec -m $PlanarFOA_modes -p $cfg $duration_arg $max_num_workers | tee smoke_test_output_PlanarFOA.txt +rm -r ./COMPLEXITY/dec/ +rm -r ./COMPLEXITY/enc/ +rm -r ./COMPLEXITY/pcm/ +echo "\n======================= 6. PlanarHOA2 =======================\n\n" +./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_PlanarHOA2_no_fec -m $PlanarHOA2_modes -p $cfg $duration_arg $max_num_workers | tee smoke_test_output_PlanarHOA2.txt +rm -r ./COMPLEXITY/dec/ +rm -r ./COMPLEXITY/enc/ +rm -r ./COMPLEXITY/pcm/ +echo "\n======================= 7. PlanarHOA3 =======================\n\n" +./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_PlanarHOA3_no_fec -m $PlanarHOA3_modes -p $cfg $duration_arg $max_num_workers | tee smoke_test_output_PlanarHOA3.txt +rm -r ./COMPLEXITY/dec/ +rm -r ./COMPLEXITY/enc/ +rm -r ./COMPLEXITY/pcm/ +echo "\n======================= 8. MASA =======================\n\n" +./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_MASA_no_fec -m $MASA_modes -p $cfg $duration_arg $max_num_workers | tee smoke_test_output_MASA.txt +rm -r ./COMPLEXITY/dec/ +rm -r ./COMPLEXITY/enc/ +rm -r ./COMPLEXITY/pcm/ +echo "\n======================= 9. MC =======================\n\n" +./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_MC_no_fec -m $MC_modes -p $cfg $duration_arg $max_num_workers | tee smoke_test_output_MC.txt +rm -r ./COMPLEXITY/dec/ +rm -r ./COMPLEXITY/enc/ +rm -r ./COMPLEXITY/pcm/ +echo "\n======================= 10. stereo =======================\n\n" +./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_stereo_no_fec -m $stereo_modes -p $cfg $duration_arg $max_num_workers | tee smoke_test_output_stereo.txt +rm -r ./COMPLEXITY/dec/ +rm -r ./COMPLEXITY/enc/ +rm -r ./COMPLEXITY/pcm/ +echo "\n======================= 11. stereoDmx =======================\n\n" +./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_stereoDmx_no_fec -m $stereoDmx_modes -p $cfg $duration_arg $max_num_workers | tee smoke_test_output_stereoDmx.txt +rm -r ./COMPLEXITY/dec/ +rm -r ./COMPLEXITY/enc/ +rm -r ./COMPLEXITY/pcm/ +echo "\n======================= 12. OMASA =======================\n\n" +./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_OMASA_no_fec -m $OMASA_modes -p $cfg $duration_arg $max_num_workers | tee smoke_test_output_OMASA.txt +rm -r ./COMPLEXITY/dec/ +rm -r ./COMPLEXITY/enc/ +rm -r ./COMPLEXITY/pcm/ +echo "\n======================= 13. OSBA ISM1 =======================\n\n" +./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_OSBA_ISM1_no_fec -m $OSBA_ISM1_modes -p $cfg $duration_arg $max_num_workers | tee smoke_test_output_OSBA_ISM1.txt +rm -r ./COMPLEXITY/dec/ +rm -r ./COMPLEXITY/enc/ +rm -r ./COMPLEXITY/pcm/ +echo "\n======================= 14. OSBA ISM2 =======================\n\n" +./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_OSBA_ISM2_no_fec -m $OSBA_ISM2_modes -p $cfg $duration_arg $max_num_workers | tee smoke_test_output_OSBA_ISM2.txt +rm -r ./COMPLEXITY/dec/ +rm -r ./COMPLEXITY/enc/ +rm -r ./COMPLEXITY/pcm/ +echo "\n======================= 15. OSBA ISM3 =======================\n\n" +./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_OSBA_ISM3_no_fec -m $OSBA_ISM3_modes -p $cfg $duration_arg $max_num_workers | tee smoke_test_output_OSBA_ISM3.txt +rm -r ./COMPLEXITY/dec/ +rm -r ./COMPLEXITY/enc/ +rm -r ./COMPLEXITY/pcm/ +echo "\n======================= 16. OSBA ISM4 =======================\n\n" +./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_OSBA_ISM4_no_fec -m $OSBA_ISM4_modes -p $cfg $duration_arg $max_num_workers | tee smoke_test_output_OSBA_ISM4.txt +rm -r ./COMPLEXITY/dec/ +rm -r ./COMPLEXITY/enc/ +rm -r ./COMPLEXITY/pcm/ +echo "\n======================= 15. ISM1 =======================\n\n" +./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_ISM1_no_fec -m $ISM1_modes -p $cfg $duration_arg $ism_md_cmd $max_num_workers | tee smoke_test_output_ISM1.txt +rm -r ./COMPLEXITY/dec/ +rm -r ./COMPLEXITY/enc/ +rm -r ./COMPLEXITY/pcm/ +echo "\n======================= 16. ISM2 =======================\n\n" +./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_ISM2_no_fec -m $ISM2_modes -p $cfg $duration_arg $ism_md_cmd $max_num_workers | tee smoke_test_output_ISM2.txt +rm -r ./COMPLEXITY/dec/ +rm -r ./COMPLEXITY/enc/ +rm -r ./COMPLEXITY/pcm/ +echo "\n======================= 17. ISM3 =======================\n\n" +./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_ISM3_no_fec -m $ISM3_modes -p $cfg $duration_arg $ism_md_cmd $max_num_workers | tee smoke_test_output_ISM3.txt +rm -r ./COMPLEXITY/dec/ +rm -r ./COMPLEXITY/enc/ +rm -r ./COMPLEXITY/pcm/ +echo "\n======================= 18. ISM4 =======================\n\n" +./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_ISM4_no_fec -m $ISM4_modes -p $cfg $duration_arg $ism_md_cmd $max_num_workers | tee smoke_test_output_ISM4.txt +rm -r ./COMPLEXITY/dec/ +rm -r ./COMPLEXITY/enc/ +rm -r ./COMPLEXITY/pcm/ +echo "\n======================= 19. ISM1 + extended metadata =======================\n\n" +./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_ISM_plus1_no_fec -m $ISM_plus1_modes -p $cfg $duration_arg $ism_md_cmd $max_num_workers | tee smoke_test_output_ISM_plus1.txt +rm -r ./COMPLEXITY/dec/ +rm -r ./COMPLEXITY/enc/ +rm -r ./COMPLEXITY/pcm/ +echo "\n======================= 20. ISM2 + extended metadata =======================\n\n" +./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_ISM_plus2_no_fec -m $ISM_plus2_modes -p $cfg $duration_arg $ism_md_cmd $max_num_workers | tee smoke_test_output_ISM_plus2.txt +rm -r ./COMPLEXITY/dec/ +rm -r ./COMPLEXITY/enc/ +rm -r ./COMPLEXITY/pcm/ +echo "\n======================= 21. ISM3 + extended metadata =======================\n\n" +./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_ISM_plus3_no_fec -m $ISM_plus3_modes -p $cfg $duration_arg $ism_md_cmd $max_num_workers | tee smoke_test_output_ISM_plus3.txt +rm -r ./COMPLEXITY/dec/ +rm -r ./COMPLEXITY/enc/ +rm -r ./COMPLEXITY/pcm/ +echo "\n======================= 22. ISM4 + extended metadata =======================\n\n" +./scripts/IvasBuildAndRunChecks.py $complexity_cmd ltv_complexity_ISM_plus4_no_fec -m $ISM_plus4_modes -p $cfg $duration_arg $ism_md_cmd $max_num_workers | tee smoke_test_output_ISM_plus4.txt +rm -r ./COMPLEXITY/dec/ +rm -r ./COMPLEXITY/enc/ +rm -r ./COMPLEXITY/pcm/ -- GitLab From e263e11ff5785cce026bc80c4d006aa389aa042a Mon Sep 17 00:00:00 2001 From: Lauros Pajunen Date: Wed, 23 Oct 2024 11:56:48 +0300 Subject: [PATCH 3/6] Remove --skip_build from script --- scripts/IvasBuildAndRunChecks.py | 6 - scripts/pyivastest/IvasSvnBuilder.py | 219 ++++++++++++------------- scripts/smoke_test_complexity_basop.sh | 2 +- 3 files changed, 103 insertions(+), 124 deletions(-) diff --git a/scripts/IvasBuildAndRunChecks.py b/scripts/IvasBuildAndRunChecks.py index 57272b64e0..421b6800a9 100755 --- a/scripts/IvasBuildAndRunChecks.py +++ b/scripts/IvasBuildAndRunChecks.py @@ -105,11 +105,6 @@ class IvasBuildAndRunChecks(IvasScriptsCommon.IvasScript): help="build the basop version for instrumentation", action="store_true", ) - self.parser.add_argument( - "--skip_build", - help="skip instrumentation and build", - action="store_true", - ) def run(self): @@ -176,7 +171,6 @@ class IvasBuildAndRunChecks(IvasScriptsCommon.IvasScript): max_workers=self.args["max_workers"], mem_only=self.args["wmc_tool_mem_only"], basop=self.args["basop"], - skip_build=self.args["skip_build"], ) else: br.add_check( diff --git a/scripts/pyivastest/IvasSvnBuilder.py b/scripts/pyivastest/IvasSvnBuilder.py index a35278b780..004672d889 100644 --- a/scripts/pyivastest/IvasSvnBuilder.py +++ b/scripts/pyivastest/IvasSvnBuilder.py @@ -228,7 +228,6 @@ class IvasBuilder(IvasBaseClass): instrumented=False, mem_only=False, basop=False, - skip_build=False, ): """ @@ -267,129 +266,123 @@ class IvasBuilder(IvasBaseClass): build_log = open(build_log_name, "w") # build if instrumented: - if skip_build: - self.logger.console("Skipping instrumentation", logging.INFO) - else: - self.logger.console("Instrumenting...", logging.INFO) - make_dir = os.path.join(self.src_dir, "scripts", "c-code_instrument") - # remove if it c-code_instrument already exists - if os.path.exists(make_dir): - shutil.rmtree(make_dir) - instrument_cmd = [ - os.path.join(self.src_dir, "scripts", "prepare_instrumentation.sh") - ] - if mem_only: - instrument_cmd.append("-m") - instrument_cmd.append("mem_only") - if basop: - instrument_cmd.append("-p") - instrument_cmd.append("basop") - build_log.write(" ".join(instrument_cmd)) - build_log.write("\n") - build_result = subprocess.run( - instrument_cmd, capture_output=True, text=True, check=True - ) - build_log.write(build_result.stderr) - build_log.write(build_result.stdout) - build_log.write("\n") + self.logger.console("Instrumenting...", logging.INFO) + make_dir = os.path.join(self.src_dir, "scripts", "c-code_instrument") + # remove if it c-code_instrument already exists + if os.path.exists(make_dir): + shutil.rmtree(make_dir) + instrument_cmd = [ + os.path.join(self.src_dir, "scripts", "prepare_instrumentation.sh") + ] + if mem_only: + instrument_cmd.append("-m") + instrument_cmd.append("mem_only") + if basop: + instrument_cmd.append("-p") + instrument_cmd.append("basop") + build_log.write(" ".join(instrument_cmd)) + build_log.write("\n") + build_result = subprocess.run( + instrument_cmd, capture_output=True, text=True, check=True + ) + build_log.write(build_result.stderr) + build_log.write(build_result.stdout) + build_log.write("\n") else: make_dir = self.src_dir build_log.write("".join(["Build directory: ", make_dir])) build_log.write("\n") - if skip_build: - self.logger.console("Skipping building", logging.INFO) - else: - self.logger.console("Building...", logging.INFO) + self.logger.console("Building...", logging.INFO) - # to be safe remove existing binaries + # to be safe remove existing binaries + if os.path.exists( + os.path.join(make_dir, "".join(["IVAS_cod", self.binary_ext])) + ): + os.remove(os.path.join(make_dir, "".join(["IVAS_cod", self.binary_ext]))) + if os.path.exists( + os.path.join(make_dir, "".join(["IVAS_dec", self.binary_ext])) + ): + os.remove(os.path.join(make_dir, "".join(["IVAS_dec", self.binary_ext]))) + if os.path.exists( + os.path.join(make_dir, "".join(["EVS_cod", self.binary_ext])) + ): + os.remove(os.path.join(make_dir, "".join(["EVS_cod", self.binary_ext]))) + if os.path.exists( + os.path.join(make_dir, "".join(["EVS_dec", self.binary_ext])) + ): + os.remove(os.path.join(make_dir, "".join(["EVS_dec", self.binary_ext]))) + # remove also in the target directory if it exists + if os.path.abspath(make_dir) != os.path.abspath(sub_dir): if os.path.exists( - os.path.join(make_dir, "".join(["IVAS_cod", self.binary_ext])) + os.path.join(sub_dir, "".join(["IVAS_cod", self.binary_ext])) ): - os.remove(os.path.join(make_dir, "".join(["IVAS_cod", self.binary_ext]))) + os.remove(os.path.join(sub_dir, "".join(["IVAS_cod", self.binary_ext]))) if os.path.exists( - os.path.join(make_dir, "".join(["IVAS_dec", self.binary_ext])) + os.path.join(sub_dir, "".join(["IVAS_dec", self.binary_ext])) ): - os.remove(os.path.join(make_dir, "".join(["IVAS_dec", self.binary_ext]))) + os.remove(os.path.join(sub_dir, "".join(["IVAS_dec", self.binary_ext]))) if os.path.exists( - os.path.join(make_dir, "".join(["EVS_cod", self.binary_ext])) + os.path.join(sub_dir, "".join(["EVS_cod", self.binary_ext])) ): - os.remove(os.path.join(make_dir, "".join(["EVS_cod", self.binary_ext]))) + os.remove(os.path.join(sub_dir, "".join(["EVS_cod", self.binary_ext]))) if os.path.exists( - os.path.join(make_dir, "".join(["EVS_dec", self.binary_ext])) + os.path.join(sub_dir, "".join(["EVS_dec", self.binary_ext])) ): - os.remove(os.path.join(make_dir, "".join(["EVS_dec", self.binary_ext]))) - # remove also in the target directory if it exists - if os.path.abspath(make_dir) != os.path.abspath(sub_dir): - if os.path.exists( - os.path.join(sub_dir, "".join(["IVAS_cod", self.binary_ext])) - ): - os.remove(os.path.join(sub_dir, "".join(["IVAS_cod", self.binary_ext]))) - if os.path.exists( - os.path.join(sub_dir, "".join(["IVAS_dec", self.binary_ext])) - ): - os.remove(os.path.join(sub_dir, "".join(["IVAS_dec", self.binary_ext]))) - if os.path.exists( - os.path.join(sub_dir, "".join(["EVS_cod", self.binary_ext])) - ): - os.remove(os.path.join(sub_dir, "".join(["EVS_cod", self.binary_ext]))) - if os.path.exists( - os.path.join(sub_dir, "".join(["EVS_dec", self.binary_ext])) - ): - os.remove(os.path.join(sub_dir, "".join(["EVS_dec", self.binary_ext]))) - - build_success = -1 - if self.system == "Windows": - make_sln = os.path.join(make_dir, "Workspace_msvc", "Workspace_msvc.sln") - clean_cmd = [self.msbuild, make_sln, "/t:clean"] - build_log.write(" ".join(clean_cmd)) - build_log.write("\n") - make_cmd = [self.msbuild, make_sln] + make_options - build_result = subprocess.run( - clean_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE - ) - build_log.write(build_result.stderr.decode("cp1252")) - build_log.write(build_result.stderr.decode("cp1252")) - build_log.write(" ".join(make_cmd)) - build_log.write("\n") - build_result = subprocess.run( - list(filter(None, make_cmd)), - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - ) - build_success = build_result.returncode - build_log.write(build_result.stderr.decode("cp1252")) - build_log.write(build_result.stderr.decode("cp1252")) - else: - clean_cmd = ["make", "-C", make_dir, "clean"] - build_log.write(" ".join(clean_cmd)) - build_log.write("\n") - make_cmd = ["make", "-C", make_dir] + make_options - build_result = subprocess.run( - clean_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE - ) - build_log.write(build_result.stderr.decode()) - build_log.write(build_result.stdout.decode()) - build_log.write(" ".join(make_cmd)) - build_log.write("\n") - build_result = subprocess.run( - list(filter(None, make_cmd)), - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - ) - build_success = build_result.returncode - build_log.write(build_result.stderr.decode()) - build_log.write(build_result.stdout.decode()) + os.remove(os.path.join(sub_dir, "".join(["EVS_dec", self.binary_ext]))) - if build_success != 0: - self.logger.console( - f"Something went wrong with building, please check {build_log_name}!", - logging.ERROR, - ) - build_log.flush() - build_log.close() - else: - success = True + build_success = -1 + if self.system == "Windows": + make_sln = os.path.join(make_dir, "Workspace_msvc", "Workspace_msvc.sln") + clean_cmd = [self.msbuild, make_sln, "/t:clean"] + build_log.write(" ".join(clean_cmd)) + build_log.write("\n") + make_cmd = [self.msbuild, make_sln] + make_options + build_result = subprocess.run( + clean_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE + ) + build_log.write(build_result.stderr.decode("cp1252")) + build_log.write(build_result.stderr.decode("cp1252")) + build_log.write(" ".join(make_cmd)) + build_log.write("\n") + build_result = subprocess.run( + list(filter(None, make_cmd)), + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + ) + build_success = build_result.returncode + build_log.write(build_result.stderr.decode("cp1252")) + build_log.write(build_result.stderr.decode("cp1252")) + else: + clean_cmd = ["make", "-C", make_dir, "clean"] + build_log.write(" ".join(clean_cmd)) + build_log.write("\n") + make_cmd = ["make", "-C", make_dir] + make_options + build_result = subprocess.run( + clean_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE + ) + build_log.write(build_result.stderr.decode()) + build_log.write(build_result.stdout.decode()) + build_log.write(" ".join(make_cmd)) + build_log.write("\n") + build_result = subprocess.run( + list(filter(None, make_cmd)), + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + ) + build_success = build_result.returncode + build_log.write(build_result.stderr.decode()) + build_log.write(build_result.stdout.decode()) + + if build_success != 0: + self.logger.console( + f"Something went wrong with building, please check {build_log_name}!", + logging.ERROR, + ) + build_log.flush() + build_log.close() + else: + success = True # test for EVS vs IVAS # avoid copying if make_dir and sub_dir are identical @@ -657,7 +650,6 @@ class IvasSvnBuilder(IvasBuilder): instrumented=False, mem_only=False, basop=False, - skip_build=False, ): """ @@ -688,7 +680,6 @@ class IvasSvnBuilder(IvasBuilder): instrumented=instrumented, mem_only=mem_only, basop=basop, - skip_build=skip_build, ) @@ -798,7 +789,6 @@ class IvasBuilderAndRunner(IvasBaseClass): timeout=None, mem_only=False, basop=False, - skip_build=False, ): """ @@ -845,7 +835,6 @@ class IvasBuilderAndRunner(IvasBaseClass): self.build_and_run_dict[cfg_name]["mem_only"] = mem_only self.build_and_run_dict[cfg_name]["make_options"] = make_options self.build_and_run_dict[cfg_name]["basop"] = basop - self.build_and_run_dict[cfg_name]["skip_build"] = skip_build else: self.logger.console("Adding config {}".format(cfg_name), logging.INFO) run_dir = os.path.join(self.builder.src_dir, cfg_name) @@ -892,7 +881,6 @@ class IvasBuilderAndRunner(IvasBaseClass): "make_options": make_options, "analyzer": new_analyzer, "basop": basop, - "skip_build": skip_build, } } self.build_and_run_dict.update(cfg_dict) @@ -1077,7 +1065,6 @@ class IvasBuilderAndRunner(IvasBaseClass): instrumented=cfg["instrumented"], mem_only=cfg["mem_only"], basop=cfg["basop"], - skip_build=cfg["skip_build"] ) self.build_and_run_dict[cfg_name]["runner"].encoder = self.builder.encoder self.build_and_run_dict[cfg_name]["runner"].decoder = self.builder.decoder @@ -1280,7 +1267,6 @@ class IvasBuilderAndRunner(IvasBaseClass): max_workers=1, mem_only=False, basop=False, - skip_build=False, ): """ @@ -1315,7 +1301,6 @@ class IvasBuilderAndRunner(IvasBaseClass): max_workers=max_workers, mem_only=mem_only, basop=basop, - skip_build=skip_build, ) # TODO: this is used nowhere, is this still needed? diff --git a/scripts/smoke_test_complexity_basop.sh b/scripts/smoke_test_complexity_basop.sh index df7d915270..3a083c4bad 100644 --- a/scripts/smoke_test_complexity_basop.sh +++ b/scripts/smoke_test_complexity_basop.sh @@ -58,7 +58,7 @@ fi cfg=./scripts/config/ci_linux_ltv.json 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" duration_arg="" -complexity_cmd="--checks COMPLEXITY --wmc_tool_mem_only --basop --skip_build --create_complexity_tables" +complexity_cmd="--checks COMPLEXITY --wmc_tool_mem_only --basop --create_complexity_tables" max_num_workers="--max_workers $MAX_CORES" # prepare combined format test signals -- GitLab From 9f1f53554291ac17a393e951fc389d7f136d3cc7 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Mon, 4 Nov 2024 11:56:56 +0100 Subject: [PATCH 4/6] add -e and -d switches to IvasBuildAndRunChecks --- scripts/IvasBuildAndRunChecks.py | 87 ++++++++++++++++++---------- scripts/pyivastest/IvasSvnBuilder.py | 84 ++++++++++++++++++--------- 2 files changed, 114 insertions(+), 57 deletions(-) diff --git a/scripts/IvasBuildAndRunChecks.py b/scripts/IvasBuildAndRunChecks.py index 421b6800a9..c66b804be3 100755 --- a/scripts/IvasBuildAndRunChecks.py +++ b/scripts/IvasBuildAndRunChecks.py @@ -1,37 +1,38 @@ #!/usr/bin/env python3 """ - (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. +(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. """ import os.path import sys +import platform import pyivastest.constants as constants from pyivastest import IvasScriptsCommon @@ -39,6 +40,19 @@ from pyivastest.IvasSvnBuilder import * RET_CODE_FAILURE = 101 +bin_ext = "" +if platform.system() == "Windows": + bin_ext = ".exe" + +default_encdec_bin_path = constants.WC_BASE_DIR +default_enc = os.path.realpath( + os.path.join(default_encdec_bin_path, "IVAS_cod" + bin_ext) +) +default_dec = os.path.realpath( + os.path.join(default_encdec_bin_path, "IVAS_dec" + bin_ext) +) +default_out = os.path.join(".", "out") # change that to something else? + class IvasBuildAndRunChecks(IvasScriptsCommon.IvasScript): def __init__(self): @@ -105,9 +119,20 @@ class IvasBuildAndRunChecks(IvasScriptsCommon.IvasScript): help="build the basop version for instrumentation", action="store_true", ) + self.parser.add_argument( + "-e", + "--enc", + help="Encoder binary to use instead of instrumenting and building it anew", + default=None, + ) + self.parser.add_argument( + "-d", + "--dec", + help="Decoder binary to use instead of instrumenting and building it anew", + default=None, + ) def run(self): - self.parse_args() if self.args["error"] or self.args["exit"]: exit() @@ -147,6 +172,8 @@ class IvasBuildAndRunChecks(IvasScriptsCommon.IvasScript): sample_rate_dec_out=self.args["srout"], enable_logging=True, logger_name="{}.br".format(self.logger.name), + enc_ext=self.args["enc"], + dec_ext=self.args["dec"], ) elif self.args["srcdir"]: @@ -157,6 +184,8 @@ class IvasBuildAndRunChecks(IvasScriptsCommon.IvasScript): sample_rate_dec_out=self.args["srout"], enable_logging=True, logger_name="{}.br".format(self.logger.name), + enc_ext=self.args["enc"], + dec_ext=self.args["dec"], ) modes = self.args["formats"] @@ -187,7 +216,7 @@ class IvasBuildAndRunChecks(IvasScriptsCommon.IvasScript): br.build_and_run_dict[check]["analyzer"], self.args ) - if self.args["rebuild"] == True: + if self.args["rebuild"]: br.force_build = True checks_ret_val = list() diff --git a/scripts/pyivastest/IvasSvnBuilder.py b/scripts/pyivastest/IvasSvnBuilder.py index 004672d889..df6ec3ec8a 100644 --- a/scripts/pyivastest/IvasSvnBuilder.py +++ b/scripts/pyivastest/IvasSvnBuilder.py @@ -1,33 +1,33 @@ #!/usr/bin/env python3 """ - (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. +(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. """ import fileinput @@ -702,6 +702,8 @@ class IvasBuilderAndRunner(IvasBaseClass): console_logger_level="", logger_name="IvasBuilderAndRunner", log_level=logging.DEBUG, + enc_ext=None, + dec_ext=None, ): super().__init__( enable_logging=enable_logging, @@ -736,6 +738,8 @@ class IvasBuilderAndRunner(IvasBaseClass): self.sample_rate_enc_in = sample_rate_enc_in self.sample_rate_dec_out = sample_rate_dec_out self.force_build = False + self.enc_ext = enc_ext + self.dec_ext = dec_ext @classmethod def fromSvn( @@ -1090,11 +1094,23 @@ class IvasBuilderAndRunner(IvasBaseClass): if self.builder.src_dir == "": self.builder.get_svn_source() run_dir = os.path.join(self.builder.src_dir, cfg_name) + + # if both encoder and decoder are given as external binaries, create dir and copy both, this skips the build later + if self.dec_ext is not None and self.enc_ext is not None: + os.makedirs(run_dir, exist_ok=True) + shutil.copy( + self.enc_ext, os.path.join(run_dir, os.path.basename(self.enc_ext)) + ) + shutil.copy( + self.dec_ext, os.path.join(run_dir, os.path.basename(self.dec_ext)) + ) + if not os.path.exists(run_dir) or self.force_build: # we have to build first self.build(cfg_name) else: # check if binaries are in the directory + # first, copy external binaries # test for EVS vs IVAS if os.path.exists( os.path.join( @@ -1130,6 +1146,19 @@ class IvasBuilderAndRunner(IvasBaseClass): ) ) self.build(cfg_name) + # if one of the external binaries was given, copy it over, overwriting the existing one + # we should not get here if both are given, then building is skipped altogether + if self.enc_ext is not None: + shutil.copy( + self.enc_ext, + os.path.join(run_dir, os.path.basename(self.enc_ext)), + ) + if self.dec_ext is not None: + shutil.copy( + self.dec_ext, + os.path.join(run_dir, os.path.basename(self.dec_ext)), + ) + self.build_and_run_dict[cfg_name]["runner"].dir_name = run_dir self.build_and_run_dict[cfg_name]["analyzer"].dir = run_dir self.build_and_run_dict[cfg_name]["runner"].run() @@ -1207,7 +1236,6 @@ class IvasBuilderAndRunner(IvasBaseClass): max_workers=1, usan_supp_file=None, ): - n_cpus = cpu_count() # do not use all cores to avoid weird getting-stuck issues observed on Mac... make_options = ["-j", f"{n_cpus - 2}"] -- GitLab From dce4cf27467923a797ff58f773b5d821513b9a24 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Mon, 4 Nov 2024 12:18:07 +0100 Subject: [PATCH 5/6] fix case when only one binary is given --- scripts/pyivastest/IvasSvnBuilder.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/scripts/pyivastest/IvasSvnBuilder.py b/scripts/pyivastest/IvasSvnBuilder.py index df6ec3ec8a..af1783a503 100644 --- a/scripts/pyivastest/IvasSvnBuilder.py +++ b/scripts/pyivastest/IvasSvnBuilder.py @@ -1146,18 +1146,19 @@ class IvasBuilderAndRunner(IvasBaseClass): ) ) self.build(cfg_name) - # if one of the external binaries was given, copy it over, overwriting the existing one - # we should not get here if both are given, then building is skipped altogether - if self.enc_ext is not None: - shutil.copy( - self.enc_ext, - os.path.join(run_dir, os.path.basename(self.enc_ext)), - ) - if self.dec_ext is not None: - shutil.copy( - self.dec_ext, - os.path.join(run_dir, os.path.basename(self.dec_ext)), - ) + + # if one of the external binaries was given, copy it over, overwriting the existing one + # we should not get here if both are given, then building is skipped altogether + if self.enc_ext is not None: + shutil.copy( + self.enc_ext, + os.path.join(run_dir, os.path.basename(self.enc_ext)), + ) + if self.dec_ext is not None: + shutil.copy( + self.dec_ext, + os.path.join(run_dir, os.path.basename(self.dec_ext)), + ) self.build_and_run_dict[cfg_name]["runner"].dir_name = run_dir self.build_and_run_dict[cfg_name]["analyzer"].dir = run_dir -- GitLab From 9e01bc1904558202dceb45a2b05b6ce00907ed03 Mon Sep 17 00:00:00 2001 From: Lauros Pajunen Date: Mon, 4 Nov 2024 15:02:53 +0200 Subject: [PATCH 6/6] Revert changes to hrtf files and test script --- .../ivas_binaural_16kHz.bin | 4 ++-- .../ivas_binaural_32kHz.bin | 4 ++-- .../ivas_binaural_48kHz.bin | 4 ++-- tests/test_be_for_jbm_neutral_dly_profile.py | 16 ++++++++-------- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin b/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin index 9a988eb588..c52a50ae96 100644 --- a/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin +++ b/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_16kHz.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a263c5498fc7ec0407c4f448e78e1f0aaf97163234ef44f2f79a1dfcb5adc37f -size 1968026 +oid sha256:3eba5d2368bb525e80b08252761277fefcdd9d1b0d5d61c2e43af6730a6f59c1 +size 998652 diff --git a/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin b/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin index 73f151217e..269aadead0 100644 --- a/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin +++ b/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_32kHz.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8622b0f7969a3126f8ab147c10392916b5e9cbe8d8bd9c04798abd3836e36c76 -size 2431246 +oid sha256:ef8ac9d464c0cc82a7939a763330d367a6ae66efad8163c318b0bd51e7778192 +size 1228024 diff --git a/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin b/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin index d847e74613..015b8019c2 100644 --- a/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin +++ b/scripts/binauralRenderer_interface/binaural_renderers_hrtf_data/ivas_binaural_48kHz.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:30bcf48f0c851d4e676d5b92be7eb3032442f5106a1072ef8fc9b335d60d0fbf -size 2673694 +oid sha256:cb43290dae7ecbc1e2879b25fb520d31c039fe2d4b7d074aed8927f3e9a4b638 +size 1349608 diff --git a/tests/test_be_for_jbm_neutral_dly_profile.py b/tests/test_be_for_jbm_neutral_dly_profile.py index 743a4e0cfb..61bb168a2f 100644 --- a/tests/test_be_for_jbm_neutral_dly_profile.py +++ b/tests/test_be_for_jbm_neutral_dly_profile.py @@ -17,7 +17,7 @@ DTX_OFF = "DTX_OFF" # TODO: Clarify if this should also be tested with DTX, see #1122 TESTCASES = [ # stereo - ["stereo", 32000, "STEREO", "DTX_OFF"], + ["stereo", 32000, "EXT", "DTX_OFF"], ["stereo", 48000, "MONO", "DTX_OFF"], ["stereo", 16400, "5_1", "DTX_OFF"], ["stereo", 256000, "7_1_4", "DTX_OFF"], @@ -42,21 +42,21 @@ TESTCASES = [ # McMasa ["MC_5_1", 16400, "BINAURAL_ROOM_IR", "DTX_OFF"], ["MC_7_1_4", 80000, "mono", "DTX_OFF"], - ["MC_5_1_2", 24400, "5_1_2", "DTX_OFF"], + ["MC_5_1_2", 24400, "EXT", "DTX_OFF"], # paramMC ["MC_5_1_2", 48000, "BINAURAL", "DTX_OFF"], - ["MC_7_1", 80000, "7_1", "DTX_OFF"], + ["MC_7_1", 80000, "EXT", "DTX_OFF"], ["MC_7_1_4", 128000, "FOA", "DTX_OFF"], # paramUpmix ["MC_7_1_4", 160000, "stereo", "DTX_OFF"], # discrete MC ["MC_5_1_2", 512000, "BINAURAL_ROOM_REVERB", "DTX_OFF"], - ["MC_7_1", 128000, "7_1", "DTX_OFF"], + ["MC_7_1", 128000, "EXT", "DTX_OFF"], ["MC_7_1_4", 256000, "5_1", "DTX_OFF"], # SBA ["HOA3", 64000, "BINAURAL", "DTX_OFF"], ["FOA", 256000, "BINAURAL_ROOM_REVERB", "DTX_OFF"], - ["HOA2", 80000, "HOA2", "DTX_OFF"], + ["HOA2", 80000, "EXT", "DTX_OFF"], ["HOA3", 512000, "5_1_4", "DTX_OFF"], ["FOA", 80000, "stereo", "DTX_OFF"], # OMASA @@ -64,11 +64,11 @@ TESTCASES = [ ["OMASA_ISM2", 24400, "MONO", "DTX_OFF"], ["OMASA_ISM3", 80000, "7_1_4", "DTX_OFF"], ["OMASA_ISM4", 64000, "HOA3", "DTX_OFF"], - # ["OMASA_ISM2", 32000, "EXT", "DTX_OFF"], + ["OMASA_ISM2", 32000, "EXT", "DTX_OFF"], # OSBA ["OSBA_ISM2_HOA2", 64000, "BINAURAL_ROOM_IR", "DTX_OFF"], - # ["OSBA_ISM4_FOA", 512000, "BINAURAL_ROOM_REVERB", "DTX_OFF"], - # ["OSBA_ISM3_HOA3", 128000, "EXT", "DTX_OFF"], + ["OSBA_ISM4_FOA", 512000, "BINAURAL_ROOM_REVERB", "DTX_OFF"], + ["OSBA_ISM3_HOA3", 128000, "EXT", "DTX_OFF"], ["OSBA_ISM2_HOA3", 96000, "5_1", "DTX_OFF"], ["OSBA_ISM1_HOA2", 32000, "mono", "DTX_OFF"], ] -- GitLab