Loading .gitlab-ci.yml +17 −15 Original line number Diff line number Diff line Loading @@ -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: Loading Loading @@ -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 Loading Loading @@ -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 Loading @@ -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 Loading @@ -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 Loading @@ -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 Loading @@ -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 Loading @@ -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 Loading ci/basop-pages/create_report_pages.py +19 −6 Original line number Diff line number Diff line Loading @@ -92,11 +92,12 @@ ARROW_DOWN = '<span class="arrowdown">⬂</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, Loading @@ -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 Loading Loading @@ -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: Loading ci/complexity_measurements/check_for_changes.py 0 → 100644 +48 −0 Original line number Diff line number Diff line import argparse import csv import sys THRESH = 0.01 COLS = [ [3, 5, 7, 9], # wmops_all [3,5,7,8,10,12,13,15,17], # ram_all [3,5,7,9,11,13,15,17,19], # rom_all ] def main(args): linewise_logfiles = [args.wmops_logfile, args.ram_logfile, args.rom_logfile] changes_found_linewise = any([check_linewise_logfile(f, c) for f, c in zip(linewise_logfiles, COLS)]) if changes_found_linewise: print("Global max of WMOPS, RAM or ROM changed") return int(changes_found_linewise) def check_linewise_logfile(filepath, cols): with open(filepath) as f: contents = [line for line in csv.reader(f, delimiter=" ")] curr = contents[-1] prev = contents[-2] 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 if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("wmops_logfile") parser.add_argument("ram_logfile") parser.add_argument("rom_logfile") args = parser.parse_args() sys.exit(main(args)) ci/complexity_measurements/getWmops.sh +6 −1 Original line number Diff line number Diff line Loading @@ -86,4 +86,9 @@ ${scriptDir}/parseNewsletterRom.py ${wmopsFilenameFlc}_PROM.csv ${wmopsFilenameF # generate java script from database tcsh ${scriptDir}/genWebpageData_Rom.csh ${destDir}/wmops/log_rom_all.txt ${destDir}/wmops/graphs_rom_flc.js Graphs_ROM python3 ${scriptDir}/check_for_changes.py ${destDir}/wmops/log_wmops_all.txt ${destDir}/wmops/log_ram_all.txt ${destDir}/wmops/log_rom_all.txt if [ "$?" != "0" ]; then ret_val=1 fi exit $ret_val ci/ivas_voip_be_test.shdeleted 100755 → 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
.gitlab-ci.yml +17 −15 Original line number Diff line number Diff line Loading @@ -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: Loading Loading @@ -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 Loading Loading @@ -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 Loading @@ -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 Loading @@ -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 Loading @@ -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 Loading @@ -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 Loading @@ -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 Loading
ci/basop-pages/create_report_pages.py +19 −6 Original line number Diff line number Diff line Loading @@ -92,11 +92,12 @@ ARROW_DOWN = '<span class="arrowdown">⬂</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, Loading @@ -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 Loading Loading @@ -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: Loading
ci/complexity_measurements/check_for_changes.py 0 → 100644 +48 −0 Original line number Diff line number Diff line import argparse import csv import sys THRESH = 0.01 COLS = [ [3, 5, 7, 9], # wmops_all [3,5,7,8,10,12,13,15,17], # ram_all [3,5,7,9,11,13,15,17,19], # rom_all ] def main(args): linewise_logfiles = [args.wmops_logfile, args.ram_logfile, args.rom_logfile] changes_found_linewise = any([check_linewise_logfile(f, c) for f, c in zip(linewise_logfiles, COLS)]) if changes_found_linewise: print("Global max of WMOPS, RAM or ROM changed") return int(changes_found_linewise) def check_linewise_logfile(filepath, cols): with open(filepath) as f: contents = [line for line in csv.reader(f, delimiter=" ")] curr = contents[-1] prev = contents[-2] 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 if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("wmops_logfile") parser.add_argument("ram_logfile") parser.add_argument("rom_logfile") args = parser.parse_args() sys.exit(main(args))
ci/complexity_measurements/getWmops.sh +6 −1 Original line number Diff line number Diff line Loading @@ -86,4 +86,9 @@ ${scriptDir}/parseNewsletterRom.py ${wmopsFilenameFlc}_PROM.csv ${wmopsFilenameF # generate java script from database tcsh ${scriptDir}/genWebpageData_Rom.csh ${destDir}/wmops/log_rom_all.txt ${destDir}/wmops/graphs_rom_flc.js Graphs_ROM python3 ${scriptDir}/check_for_changes.py ${destDir}/wmops/log_wmops_all.txt ${destDir}/wmops/log_ram_all.txt ${destDir}/wmops/log_rom_all.txt if [ "$?" != "0" ]; then ret_val=1 fi exit $ret_val
ci/ivas_voip_be_test.shdeleted 100755 → 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