From c309d113763d9ff2918fbde4dc326b39a2dc193c Mon Sep 17 00:00:00 2001 From: veeravt Date: Wed, 26 Apr 2023 15:11:20 +0200 Subject: [PATCH 01/22] Changed IVAS to EVS for evs binaries :P --- README.md | 14 +++++++------- examples/TEMPLATE.yml | 6 +++--- ivas_processing_scripts/constants.py | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index d70343e2..911a0023 100755 --- a/README.md +++ b/README.md @@ -103,9 +103,9 @@ conditions_to_generate: bitrates: - 9600 cod: - bin: ~/git/ivas-codec/IVAS_cod + bin: ~/git/ivas-codec/EVS_cod dec: - bin: ~/git/ivas-codec/IVAS_dec + bin: ~/git/ivas-codec/EVS_dec postprocessing: fmt: "BINAURAL" ``` @@ -267,7 +267,7 @@ input: ### mnru generate MNRU condition ### esdru generate ESDRU condition ### mono_dmx generate mono downmix condition -### evs generate an EVS coded condition (see below examples for additional required keys) (currently uses IVAS EVS mode) +### evs generate an EVS coded condition (see below examples for additional required keys) ### ivas generate an IVAS coded condition (see below examples for additional required keys) conditions_to_generate: ### Reference and anchor conditions ########################## @@ -358,13 +358,13 @@ conditions_to_generate: # - 9600 - [13200, 13200, 8000, 13200, 9600] cod: - ### Path to encoder binary; default search for IVAS_cod in bin folder (primary) and PATH (secondary) - bin: ~/git/ivas-codec/IVAS_cod + ### Path to encoder binary; default search for EVS_cod in bin folder (primary) and PATH (secondary) + bin: ~/git/ivas-codec/EVS_cod ### Encoder input sampling rate in Hz (resampling performed in case of mismatch); default = null (no resampling) # fs: 32000 dec: - ### Path to encoder binary; default search for IVAS_dec in bin folder (primary) and PATH (secondary) - bin: ~/git/ivas-codec/IVAS_dec + ### Path to encoder binary; default search for EVS_dec in bin folder (primary) and PATH (secondary) + bin: ~/git/ivas-codec/EVS_dec ### Decoder output sampling rate; default = null (same as input) # fs: 48000 ``` diff --git a/examples/TEMPLATE.yml b/examples/TEMPLATE.yml index 441250ae..4f600adf 100755 --- a/examples/TEMPLATE.yml +++ b/examples/TEMPLATE.yml @@ -151,7 +151,7 @@ input: ### mnru generate MNRU condition ### esdru generate ESDRU condition ### mono_dmx generate mono downmix condition -### evs generate an EVS coded condition (see below examples for additional required keys) (currently uses IVAS EVS mode) +### evs generate an EVS coded condition (see below examples for additional required keys) ### ivas generate an IVAS coded condition (see below examples for additional required keys) conditions_to_generate: ### Reference and anchor conditions ########################## @@ -243,12 +243,12 @@ conditions_to_generate: - [13200, 13200, 8000, 13200, 9600] cod: ### Path to encoder binary; default search for IVAS_cod in bin folder (primary) and PATH (secondary) - bin: ~/git/ivas-codec/IVAS_cod + bin: ~/git/ivas-codec/EVS_cod ### Encoder input sampling rate in Hz (resampling performed in case of mismatch); default = null (no resampling) # fs: 32000 dec: ### Path to encoder binary; default search for IVAS_dec in bin folder (primary) and PATH (secondary) - bin: ~/git/ivas-codec/IVAS_dec + bin: ~/git/ivas-codec/EVS_dec ### Decoder output sampling rate; default = null (same as input) # fs: 48000 diff --git a/ivas_processing_scripts/constants.py b/ivas_processing_scripts/constants.py index c2731016..3e7ce483 100755 --- a/ivas_processing_scripts/constants.py +++ b/ivas_processing_scripts/constants.py @@ -69,10 +69,10 @@ DEFAULT_CONFIG = { } DEFAULT_CONFIG_EVS = { "cod": { - "bin": find_binary("IVAS_cod", raise_error=False), + "bin": find_binary("EVS_cod", raise_error=False), }, "dec": { - "bin": find_binary("IVAS_dec", raise_error=False), + "bin": find_binary("EVS_dec", raise_error=False), }, } DEFAULT_CONFIG_IVAS = { -- GitLab From fdf3f029a074632101505080962c5cc00a3f7945 Mon Sep 17 00:00:00 2001 From: knj Date: Wed, 26 Apr 2023 18:18:01 +0200 Subject: [PATCH 02/22] only run jobs on single runner with test setup --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a4cfa7c1..220976e5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -39,7 +39,7 @@ stages: test_audiotools_convert: stage: test tags: - - linux + - test_fhg_1 script: - *print-common-info - python3 -m pytest -n auto tests/test_audiotools_convert.py @@ -48,7 +48,7 @@ test_audiotools_convert: test_processing: stage: test tags: - - linux + - test_fhg_1 script: - *print-common-info - *get-codec-binaries @@ -61,7 +61,7 @@ test_processing: lint: stage: analyze tags: - - linux + - test_fhg_1 allow_failure: true script: - flake8 --max-line-length 88 --extend-ignore=E203,E501,E741 @@ -72,7 +72,7 @@ format: ARTIFACT_BASE_NAME: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--formatting-fix" ARTIFACT_FOLDER: "formatting-patch" tags: - - linux + - test_fhg_1 allow_failure: true script: - mkdir $ARTIFACT_FOLDER -- GitLab From 20ebb92d9cb925bd6ea6e0d3dbe2b651f2521770 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 27 Apr 2023 11:03:33 +0200 Subject: [PATCH 03/22] add reference to EVS 26.443 v17.0.0 --- README.md | 1 + ivas_processing_scripts/bin/README.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 911a0023..b70fab00 100755 --- a/README.md +++ b/README.md @@ -489,6 +489,7 @@ The following additional executables are needed for the different processing ste | Random offset/seed generation | random | https://www.3gpp.org/ftp/tsg_sa/WG4_CODEC/TSGS4_76/docs/S4-131277.zip | | JBM network simulator | networkSimulator_g192 | https://www.3gpp.org/ftp/tsg_sa/WG4_CODEC/TSGS4_76/docs/S4-131277.zip | | MASA rendering | masaRenderer | https://www.3gpp.org/ftp/TSG_SA/WG4_CODEC/TSGS4_122_Athens/Docs/S4-230221.zip | +| EVS reference conditions | EVS_cod, EVS_dec | https://www.3gpp.org/ftp/Specs/archive/26_series/26.443/26443-h00.zip | The necessary binaries have to be placed in the [ivas_processing_scripts/bin](./ivas_processing_scripts/bin) folder. For most of the tools it is sufficient to copy the binaries while it is necessary to add some additional files for the MASA renderer. diff --git a/ivas_processing_scripts/bin/README.txt b/ivas_processing_scripts/bin/README.txt index f8fe6ac0..06b0f077 100755 --- a/ivas_processing_scripts/bin/README.txt +++ b/ivas_processing_scripts/bin/README.txt @@ -12,3 +12,4 @@ Necessary additional executables: | Random offset/seed generation | random | https://www.3gpp.org/ftp/tsg_sa/WG4_CODEC/TSGS4_76/docs/S4-131277.zip | | JBM network simulator | networkSimulator_g192 | https://www.3gpp.org/ftp/tsg_sa/WG4_CODEC/TSGS4_76/docs/S4-131277.zip | | MASA rendering | masaRenderer | https://www.3gpp.org/ftp/TSG_SA/WG4_CODEC/TSGS4_122_Athens/Docs/S4-230221.zip | +| EVS reference conditions | EVS_cod, EVS_dec | https://www.3gpp.org/ftp/Specs/archive/26_series/26.443/26443-h00.zip | -- GitLab From 77e0e404121eaeb1701cfeca2b9a8d6f6fc8ab71 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 27 Apr 2023 11:04:57 +0200 Subject: [PATCH 04/22] rename file --- ivas_processing_scripts/bin/{README.txt => README.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ivas_processing_scripts/bin/{README.txt => README.md} (100%) diff --git a/ivas_processing_scripts/bin/README.txt b/ivas_processing_scripts/bin/README.md similarity index 100% rename from ivas_processing_scripts/bin/README.txt rename to ivas_processing_scripts/bin/README.md -- GitLab From e89c945e890c143263bf97d4f32380ffe1d74ab6 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Thu, 27 Apr 2023 11:08:19 +0200 Subject: [PATCH 05/22] leave out path for EVS_cod, EVS_dec - this should hopefull work together with branch 1-problem-with-relative-directories-for-input-items; at least we shouldn't point toe the IVAS repo --- examples/TEMPLATE.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/TEMPLATE.yml b/examples/TEMPLATE.yml index 4f600adf..fc0766bb 100755 --- a/examples/TEMPLATE.yml +++ b/examples/TEMPLATE.yml @@ -243,12 +243,12 @@ conditions_to_generate: - [13200, 13200, 8000, 13200, 9600] cod: ### Path to encoder binary; default search for IVAS_cod in bin folder (primary) and PATH (secondary) - bin: ~/git/ivas-codec/EVS_cod + bin: EVS_cod ### Encoder input sampling rate in Hz (resampling performed in case of mismatch); default = null (no resampling) # fs: 32000 dec: ### Path to encoder binary; default search for IVAS_dec in bin folder (primary) and PATH (secondary) - bin: ~/git/ivas-codec/EVS_dec + bin: EVS_dec ### Decoder output sampling rate; default = null (same as input) # fs: 48000 -- GitLab From a7939ef876e6ef6094c70d12fbbd1dc013c4321f Mon Sep 17 00:00:00 2001 From: veeravt Date: Thu, 27 Apr 2023 11:45:42 +0200 Subject: [PATCH 06/22] Changed IVAS_ to EVS_. --- examples/TEMPLATE.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/TEMPLATE.yml b/examples/TEMPLATE.yml index fc0766bb..854c0cea 100755 --- a/examples/TEMPLATE.yml +++ b/examples/TEMPLATE.yml @@ -242,12 +242,12 @@ conditions_to_generate: # - 9600 - [13200, 13200, 8000, 13200, 9600] cod: - ### Path to encoder binary; default search for IVAS_cod in bin folder (primary) and PATH (secondary) + ### Path to encoder binary; default search for EVS_cod in bin folder (primary) and PATH (secondary) bin: EVS_cod ### Encoder input sampling rate in Hz (resampling performed in case of mismatch); default = null (no resampling) # fs: 32000 dec: - ### Path to encoder binary; default search for IVAS_dec in bin folder (primary) and PATH (secondary) + ### Path to encoder binary; default search for EVS_dec in bin folder (primary) and PATH (secondary) bin: EVS_dec ### Decoder output sampling rate; default = null (same as input) # fs: 48000 -- GitLab From 0da4804c3f6eea40beac6a01171a7be9f2cad153 Mon Sep 17 00:00:00 2001 From: Treffehn Date: Fri, 28 Apr 2023 10:39:24 +0200 Subject: [PATCH 07/22] enabled options in the test configs --- examples/TEMPLATE.yml | 4 +- tests/data/test_ISM.yml | 197 ++++++++++++++++++++++++++-------------- tests/data/test_MC.yml | 194 +++++++++++++++++++++++++-------------- tests/data/test_SBA.yml | 192 ++++++++++++++++++++++++++------------- 4 files changed, 384 insertions(+), 203 deletions(-) diff --git a/examples/TEMPLATE.yml b/examples/TEMPLATE.yml index 4e6c5715..590a8ce8 100755 --- a/examples/TEMPLATE.yml +++ b/examples/TEMPLATE.yml @@ -283,7 +283,7 @@ postprocessing: # bin_dataset: SADIE ### Render LFE to binaural output with the specified gain (only valid for channel-based input); default = null # bin_lfe_gain: 1 - ### Flag whether output should be limited to avoid clipping (can alter target loudness); default = true - # limit: false + ### Flag whether output should be limited to avoid clipping (can alter target loudness); default = false + # limit: true ### Head-tracking trajectory file for binaural output; default = null # trajectory: "path/to/file" diff --git a/tests/data/test_ISM.yml b/tests/data/test_ISM.yml index 6be2b377..6d64d82a 100644 --- a/tests/data/test_ISM.yml +++ b/tests/data/test_ISM.yml @@ -14,10 +14,13 @@ ### Deletion of temporary directories containing ### intermediate processing files, bitstreams etc.; default = false # delete_tmp: true +### Master seed for random processes like bitstream error pattern generation; default = 0 +# master_seed: 5 ### Any relative paths will be interpreted relative to the working directory the script is called from! ### Usage of absolute paths is recommended. ### Do not use file names with dots "." in them! This is not supported, use "_" instead +### For Windows user: please use double back slash '\\' in paths and add '.exe' to executable definitions ### REQUIRED: Input path or file input_path: "./tests/data/pinknoise/pink_noise_4ch_48kHz.wav" ### REQUIRED: Output path or file @@ -27,19 +30,19 @@ output_path: "./tmp_output_ISM" ### default = null (for ISM search for item_name.{wav, raw, pcm}.{0-3}.csv in input folder, otherise ignored) metadata_path: ### Path can be set for all items with the 'all_items' key (automatic search for item_name.{wav, raw, pcm}.{0-3}.csv within this folder) - # all_items: "../path" + # all_items: ".../metadata_folder" ### Path can be set for all items individually with 'item{1-4}' keys - ### 'item{1-4}' keys can also be renamed to the input file names with extension + ### 'item{1-4}' keys can also be renamed to the input file names including extension {wav, raw, pcm} + ### Either list individual files for all objects or name folder for automatic search for one item pink_noise_4ch_48kHz.wav: - ### Either list individual files for all objects or give folder for automatic search - "./tests/data/ism_metadata/stvISM1.csv" - "./tests/data/ism_metadata/stvISM2.csv" - "./tests/data/ism_metadata/stvISM3.csv" - "./tests/data/ism_metadata/stvISM4.csv" # item2: - # - ".../meta_name.csv" - # - ".../different_name.csv" - # noise: + # - ".../meta_obj1.csv" + # - ".../meta_ob2.csv" + # noise.wav: # - ".../metadata_folder_for_noise_item" ### Select only a subset of items @@ -47,13 +50,6 @@ metadata_path: # input_select: # - "48kHz" -### Horizontally concatenate input items into one long file; default = false -# concatenate_input: true -### Specify silence duration (ms) to add in between concatenated items; default = null -# concat_silence: - # pre: 0 - # post: 0 - ################################################ ### Input configuration ################################################ @@ -64,62 +60,104 @@ input: # fs: 32000 ################################################ -### Pre-processing +### Pre-processing on individual items ################################################ ### Pre-processing step performed prior to core processing for all conditions ### If not defined, preprocessing step is skipped preprocessing: ### Target format used in rendering from input format; default = null (no rendering) # fmt: "7_1_4" + ### Flag for application of 50Hz high-pass filter; default = false + # hp50: true ### Target sampling rate in Hz for resampling; default = null (no resampling) - # fs: 16000 + fs: 48000 ### Target loudness in LKFS; default = null (no loudness change applied) - # loudness: -26 + loudness: -26 ### Spatial audio format in which loudness is adjusted (only used if preprocessing loudness is not null); ### default = null (uses preprocessing fmt if possible) - # loudness_fmt: BINAURAL - ### Pre-/post-trim signal (ms) (negative values pad silence); default = 0 - trim: - - 40 - - -60 - ### Flag for using noise instead of silence for padding - pad_noise: true + # loudness_fmt: "BINAURAL" + ### Pre-/post-trim individual signal(s) (ms) (negative values pad silence); default = 0 + # trim: + # - 50 + # - -50 + ### Flag for using noise (amplitude +-4) instead of silence for padding; default = false (silence) + # pad_noise: true ### Value for application of delay (ms) (negative values advance); default = 0 - # delay: 20 + delay: 20 ### Length of window used at start/end of signal (ms); default = 0 # window: 100 + +################################################ +### Pre-processing on whole signal(s) +################################################ +preprocessing_2: + ### Options for processing of the concatenated item (concatenate_input: true) or + ### the individual items (concatenate_input: false) after previous pre-processing step + ### Horizontally concatenate input items into one long file; default = false + # concatenate_input: true + ### Specify the concatenation order in a list of strings. If not specified, the concatenation order would be + ### as per the filesystem on the users' device + ### Should only be used if concatenate_input = true + ### Specify the filename with extension. + ### For example, concatenation_order: ["file3.wav", "file1.wav", "file4.wav", "file2.wav"] + # concatenation_order: [] + ### Specify preamble duration in ms; default = 0 + preamble: 10000 + ### Flag wheter to use noise (amplitude +-4) for the preamble or silence; default = false (silence) + preamble_noise: true + ### Additive background noise + # background_noise: + ### REQUIRED: SNR for background noise in dB + # snr: 10 + ### REQUIRED: Path to background noise, must have same format and sampling rate as input signal(s) + # background_noise_path: ".../noise.wav" + ### Seed for delay offest; default = 0 + # seed_delay: 10 ################################################# -### bitstream processing +### Bitstream processing ################################################# -### bistream processing (transport simulation) done after encoding and before decoding +### Bitstream processing (transport simulation) done after encoding and before decoding ### e.g. frame error insertion or transport simulation for JBM testing -# tx: - ### other options for generating error files,.... - ### maybe directly give something like fer and generate error_pottern and bs_proc_opts internally - # fer: - # error_rate: 5 ### in percent - ### Path to network simulation binary (mandatory) - # bs_proc_bin: C:/local/bay/ivas/VR/src/ivas_python_testscripts/networkSimulator_g192.exe - ### Path to error pattern (mandatory if no information for generating the error pattern is given) - # error_pattern: C:/local/bay/ivas/VR/src/ivas_python_testscripts/dly_error_profiles/dly_error_profile_6.dat - ### options for the binary, possible placeholders are {error_pattern} for the error pattern, - ### {bitstream} for the bitstream to process and {bitstream_processed} for the processed bitstream - # bs_proc_opts: [ "{error_pattern}", "{bitstream}", "{processed_bitstream}", "{processed_bitstream}_tracefile_sim", "2", "0" ] - +### can be given globally here or in individual conditions of type ivas or evs +tx: + ### REQUIRED: Type of bitstream processing; possible types: "JBM" or "FER" + type: "JBM" + + ### JBM + ### REQUIRED: either error_pattern or error_profile + ### delay error profile file + # error_pattern: ".../dly_error_profile.dat" + ### Index of one of the existing delay error profile files to use (1-11) + error_profile: 5 + ## nFramesPerPacket parameter for the network simulator; default = 1 + n_frames_per_packet: 2 + + ### FER + ### REQUIRED: either error_pattern or error_rate + ### Frame error pattern file + # error_pattern: "path/pattern.192" + ### Error rate in percent + # error_rate: 5 + ### Additional seed to specify number of preruns; default = 0 + # prerun_seed: 2 + ################################################ ### Configuration for conditions under test ################################################ ### List of conditions to generate ### Name of the key will be used as output directory name ### conditions must specify the "type" key which may be one of the following options: -### ref generate the reference condition -### lp3k5 generate a low-pass anchor with cut-off frequency 3.5 kHz -### lp7k generate a low-pass anchor with cut-off frequency 7 kHz -### evs generate an EVS coded condition (see below examples for additional required keys) -### ivas generate an IVAS coded condition (see below examples for additional required keys) +### ref generate the reference condition +### lp3k5 generate a low-pass anchor with cut-off frequency 3.5 kHz +### lp7k generate a low-pass anchor with cut-off frequency 7 kHz +### mnru generate MNRU condition +### esdru generate ESDRU condition +### mono_dmx generate mono downmix condition +### evs generate an EVS coded condition (see below examples for additional required keys) +### ivas generate an IVAS coded condition (see below examples for additional required keys) conditions_to_generate: - ### Reference condition ########################## + ### Reference and anchor conditions ########################## c01: ### REQUIRED: type of condition type: ref @@ -128,18 +166,28 @@ conditions_to_generate: c02: ### REQUIRED: type of condition type: lp3k5 - ### optional low-pass cut-off frequency in Hz; default = null - # out_fc: 22500 + c03: + ### REQUIRED: type of condition + type: mnru + ### REQUIRED: the ratio of speech power to modulated noise power in dB + q: 20 + c04: + ### REQUIRED: type of condition + type: esdru + ### REQUIRED: spatial degradation value between 0 and 1 + alpha: 0.5 + c05: + ### REQUIRED: type of condition + type: mono_dmx ### IVAS condition ############################### - c03: + c06: ### REQUIRED: type of condition type: ivas ### REQUIRED: Bitrates to use for coding bitrates: - 160000 - # - 32000 - # TODO bitstream corruption + - 32000 ### Encoder options cod: ### Path to encoder binary; default search for IVAS_cod in bin folder (primary) and PATH (secondary) @@ -153,22 +201,25 @@ conditions_to_generate: ### Path to decoder binary; default search for IVAS_dec in bin folder (primary) and PATH (secondary) #bin: ~/git/ivas-codec/IVAS_dec ### Decoder output format; default = postprocessing fmt - #fmt: HOA3 + fmt: "ISM4" ### Decoder output sampling rate; default = null (same as input) # fs: 48000 ### Additional commandline options; default = null # opts: ["-q", "-no_delay_cmp"] + ### Bitstream options + # tx: + ### For possible arguments see overall bitstream modification ### IVAS condition ############################### - #c04: + c07: ### REQUIRED: type of condition - #type: ivas + type: ivas ### REQUIRED: Bitrates to use for coding - #bitrates: - #- 160000 + bitrates: + - 160000 # - 32000 ### Encoder options - #cod: + cod: ### Path to encoder binary; default search for IVAS_cod in bin folder (primary) and PATH (secondary) #bin: ~/git/ivas-codec/IVAS_cod ### Encoder input sampling rate in Hz (resampling performed in case of mismatch); default = null (no resampling) @@ -176,36 +227,42 @@ conditions_to_generate: ### Additional commandline options; default = null # opts: ["-q", "-dtx", 4] ### Decoder options - #dec: + dec: ### Path to decoder binary; default search for IVAS_dec in bin folder (primary) and PATH (secondary) #bin: ~/git/ivas-codec/IVAS_dec ### Decoder output format; default = postprocessing fmt - #fmt: CICP19 + #fmt: "7_1_4" ### Decoder output sampling rate; default = null (same as input) # fs: 48000 ### Additional commandline options; default = null # opts: ["-q", "-no_delay_cmp"] + ### Bitstream options + # tx: + ### For possible arguments see overall bitstream modification ### EVS condition ################################ - c05: + c08: ### REQUIRED: type of condition type: evs ### REQUIRED: Bitrates to use for coding ### For EVS mono, this may be a per-channel bitrate configuration (must match input/preprocessing format!) ### the last value will be repeated if too few are specified bitrates: - - 9600 - #- [13200, 13200, 8000, 13200, 9600] + # - 9600 + - [13200, 13200, 8000, 13200, 9600] cod: ### Path to encoder binary; default search for EVS_cod in bin folder (primary) and PATH (secondary) - #bin: ~/git/ivas-codec/IVAS_cod + #bin: EVS_cod ### Encoder input sampling rate in Hz (resampling performed in case of mismatch); default = null (no resampling) # fs: 32000 dec: ### Path to encoder binary; default search for EVS_dec in bin folder (primary) and PATH (secondary) - #bin: ~/git/ivas-codec/IVAS_dec + #bin: EVS_dec ### Decoder output sampling rate; default = null (same as input) # fs: 48000 + ### Bitstream options + # tx: + ### For possible arguments see overall bitstream modification ################################################ ### Post-processing @@ -215,21 +272,21 @@ conditions_to_generate: postprocessing: ### REQUIRED: Target format for output fmt: "BINAURAL" - ### Target sampling rate in Hz for resampling; default = null (no resampling) + ### REQUIRED: Target sampling rate in Hz for resampling fs: 48000 ### Low-pass cut-off frequency in Hz; default = null (no filtering) - # lp_cutoff: 24000 + lp_cutoff: 24000 ### Target loudness in LKFS; default = null (no loudness change applied) - # loudness: -26 + loudness: -26 ### Spatial audio format in which loudness is adjusted (only used if preprocessing loudness is not null); ### default = null (uses postprocessing fmt if possible) # loudness_fmt: null ### Name of custom binaural dataset (without prefix or suffix); - ### default = null (ORANGE53 for BINAURAL, IISofficialMPEG222UC for BINAURAL_ROOM) + ### default = null (ORANGE53(_Dolby) for BINAURAL, IISofficialMPEG222UC for BINAURAL_ROOM) # bin_dataset: SADIE ### Render LFE to binaural output with the specified gain (only valid for channel-based input); default = null # bin_lfe_gain: 1 - ### Flag whether output should be limited to avoid clipping (can alter target loudness); default = true - # limit: false + ### Flag whether output should be limited to avoid clipping (can alter target loudness); default = false + # limit: true ### Head-tracking trajectory file for binaural output; default = null - # trajectory: path/to/file + # trajectory: "path/to/file" diff --git a/tests/data/test_MC.yml b/tests/data/test_MC.yml index 81cb3446..270e157e 100644 --- a/tests/data/test_MC.yml +++ b/tests/data/test_MC.yml @@ -14,10 +14,13 @@ ### Deletion of temporary directories containing ### intermediate processing files, bitstreams etc.; default = false # delete_tmp: true +### Master seed for random processes like bitstream error pattern generation; default = 0 +master_seed: 5 ### Any relative paths will be interpreted relative to the working directory the script is called from! ### Usage of absolute paths is recommended. ### Do not use file names with dots "." in them! This is not supported, use "_" instead +### For Windows user: please use double back slash '\\' in paths and add '.exe' to executable definitions ### REQUIRED: Input path or file input_path: "./tests/data/pinknoise/pink_noise_2ch_48kHz.wav" ### REQUIRED: Output path or file @@ -27,30 +30,23 @@ output_path: "./tmp_output_MC" ### default = null (for ISM search for item_name.{wav, raw, pcm}.{0-3}.csv in input folder, otherise ignored) # metadata_path: ### Path can be set for all items with the 'all_items' key (automatic search for item_name.{wav, raw, pcm}.{0-3}.csv within this folder) - # all_items: "..\path" + # all_items: ".../metadata_folder" ### Path can be set for all items individually with 'item{1-4}' keys - ### 'item{1-4}' keys can also be renamed to the input file names with extension + ### 'item{1-4}' keys can also be renamed to the input file names including extension {wav, raw, pcm} + ### Either list individual files for all objects or name folder for automatic search for one item # item1: - ### Either list individual files for all objects or give folder for automatic search - # - "...\\metadata_folder" + # - ".../meta_all_obj" # item2: - # - "...\\meta_name.csv" - # - "...\\different_name.csv" - # noise: - # - "...\\metadata_folder_for_noise_item" + # - ".../meta_obj1.csv" + # - ".../meta_ob2.csv" + # noise.wav: + # - ".../metadata_folder_for_noise_item" ### Select only a subset of items ### searches for the specified substring in found filenames; default = null # input_select: # - "48kHz" -### Horizontally concatenate input items into one long file; default = false -# concatenate_input: true -### Specify silence duration (ms) to add in between concatenated items; default = null -# concat_silence: - # pre: 0 - # post: 0 - ################################################ ### Input configuration ################################################ @@ -61,62 +57,104 @@ input: # fs: 32000 ################################################ -### Pre-processing +### Pre-processing on individual items ################################################ ### Pre-processing step performed prior to core processing for all conditions ### If not defined, preprocessing step is skipped preprocessing: ### Target format used in rendering from input format; default = null (no rendering) fmt: "7_1_4" + ### Flag for application of 50Hz high-pass filter; default = false + hp50: true ### Target sampling rate in Hz for resampling; default = null (no resampling) fs: 16000 ### Target loudness in LKFS; default = null (no loudness change applied) loudness: -26 ### Spatial audio format in which loudness is adjusted (only used if preprocessing loudness is not null); ### default = null (uses preprocessing fmt if possible) - # loudness_fmt: STEREO - ### Pre-\\post-trim signal (ms) (negative values pad silence); default = 0 + loudness_fmt: "BINAURAL" + ### Pre-/post-trim individual signal(s) (ms) (negative values pad silence); default = 0 # trim: # - 50 # - -50 - ### Flag for using noise instead of silence for padding + ### Flag for using noise (amplitude +-4) instead of silence for padding; default = false (silence) # pad_noise: true ### Value for application of delay (ms) (negative values advance); default = 0 delay: 20 - ### Length of window used at start\\end of signal (ms); default = 0 + ### Length of window used at start/end of signal (ms); default = 0 window: 100 + +################################################ +### Pre-processing on whole signal(s) +################################################ +preprocessing_2: + ### Options for processing of the concatenated item (concatenate_input: true) or + ### the individual items (concatenate_input: false) after previous pre-processing step + ### Horizontally concatenate input items into one long file; default = false + # concatenate_input: true + ### Specify the concatenation order in a list of strings. If not specified, the concatenation order would be + ### as per the filesystem on the users' device + ### Should only be used if concatenate_input = true + ### Specify the filename with extension. + ### For example, concatenation_order: ["file3.wav", "file1.wav", "file4.wav", "file2.wav"] + # concatenation_order: [] + ### Specify preamble duration in ms; default = 0 + preamble: 10000 + ### Flag wheter to use noise (amplitude +-4) for the preamble or silence; default = false (silence) + preamble_noise: true + ### Additive background noise + # background_noise: + ### REQUIRED: SNR for background noise in dB + # snr: 10 + ### REQUIRED: Path to background noise, must have same format and sampling rate as input signal(s) + # background_noise_path: ".../noise.wav" + ### Seed for delay offest; default = 0 + # seed_delay: 10 ################################################# -### bitstream processing +### Bitstream processing ################################################# -### bistream processing (transport simulation) done after encoding and before decoding +### Bitstream processing (transport simulation) done after encoding and before decoding ### e.g. frame error insertion or transport simulation for JBM testing -# tx: - ### other options for generating error files,.... - ### maybe directly give something like fer and generate error_pottern and bs_proc_opts internally - # fer: - # error_rate: 5 ### in percent - ### Path to network simulation binary (mandatory) - # bs_proc_bin: C:\\local\\bay\\ivas\\VR\\src\\ivas_python_testscripts\\networkSimulator_g192.exe - ### Path to error pattern (mandatory if no information for generating the error pattern is given) - # error_pattern: C:\\local\\bay\\ivas\\VR\\src\\ivas_python_testscripts\\dly_error_profiles\\dly_error_profile_6.dat - ### options for the binary, possible placeholders are {error_pattern} for the error pattern, - ### {bitstream} for the bitstream to process and {bitstream_processed} for the processed bitstream - # bs_proc_opts: [ "{error_pattern}", "{bitstream}", "{processed_bitstream}", "{processed_bitstream}_tracefile_sim", "2", "0" ] - +### can be given globally here or in individual conditions of type ivas or evs +tx: + ### REQUIRED: Type of bitstream processing; possible types: "JBM" or "FER" + type: "JBM" + + ### JBM + ### REQUIRED: either error_pattern or error_profile + ### delay error profile file + # error_pattern: ".../dly_error_profile.dat" + ### Index of one of the existing delay error profile files to use (1-11) + error_profile: 5 + ## nFramesPerPacket parameter for the network simulator; default = 1 + n_frames_per_packet: 2 + + ### FER + ### REQUIRED: either error_pattern or error_rate + ### Frame error pattern file + # error_pattern: "path/pattern.192" + ### Error rate in percent + # error_rate: 5 + ### Additional seed to specify number of preruns; default = 0 + # prerun_seed: 2 + ################################################ ### Configuration for conditions under test ################################################ ### List of conditions to generate ### Name of the key will be used as output directory name ### conditions must specify the "type" key which may be one of the following options: -### ref generate the reference condition -### lp3k5 generate a low-pass anchor with cut-off frequency 3.5 kHz -### lp7k generate a low-pass anchor with cut-off frequency 7 kHz -### evs generate an EVS coded condition (see below examples for additional required keys) -### ivas generate an IVAS coded condition (see below examples for additional required keys) +### ref generate the reference condition +### lp3k5 generate a low-pass anchor with cut-off frequency 3.5 kHz +### lp7k generate a low-pass anchor with cut-off frequency 7 kHz +### mnru generate MNRU condition +### esdru generate ESDRU condition +### mono_dmx generate mono downmix condition +### evs generate an EVS coded condition (see below examples for additional required keys) +### ivas generate an IVAS coded condition (see below examples for additional required keys) conditions_to_generate: - ### Reference condition ########################## + ### Reference and anchor conditions ########################## c01: ### REQUIRED: type of condition type: ref @@ -125,20 +163,32 @@ conditions_to_generate: c02: ### REQUIRED: type of condition type: lp3k5 + c03: + ### REQUIRED: type of condition + type: mnru + ### REQUIRED: the ratio of speech power to modulated noise power in dB + q: 20 + c04: + ### REQUIRED: type of condition + type: esdru + ### REQUIRED: spatial degradation value between 0 and 1 + alpha: 0.5 + c05: + ### REQUIRED: type of condition + type: mono_dmx ### IVAS condition ############################### - c03: + c06: ### REQUIRED: type of condition type: ivas ### REQUIRED: Bitrates to use for coding bitrates: - 160000 - 32000 - # TODO bitstream corruption ### Encoder options cod: ### Path to encoder binary; default search for IVAS_cod in bin folder (primary) and PATH (secondary) - #bin: ~\\git\\ivas-codec\\IVAS_cod + #bin: ~/git/ivas-codec/IVAS_cod ### Encoder input sampling rate in Hz (resampling performed in case of mismatch); default = null (no resampling) # fs: 32000 ### Additional commandline options; default = null @@ -146,61 +196,73 @@ conditions_to_generate: ### Decoder options dec: ### Path to decoder binary; default search for IVAS_dec in bin folder (primary) and PATH (secondary) - #bin: ~\\git\\ivas-codec\\IVAS_dec + #bin: ~/git/ivas-codec/IVAS_dec ### Decoder output format; default = postprocessing fmt fmt: "5_1" ### Decoder output sampling rate; default = null (same as input) # fs: 48000 ### Additional commandline options; default = null # opts: ["-q", "-no_delay_cmp"] + ### Bitstream options + tx: + ### For possible arguments see overall bitstream modification + type: "FER" + error_rate: 3 + prerun_seed: 2 ### IVAS condition ############################### - #c04: + c07: ### REQUIRED: type of condition - #type: ivas + type: ivas ### REQUIRED: Bitrates to use for coding - #bitrates: - #- 160000 + bitrates: + - 160000 # - 32000 ### Encoder options - #cod: + cod: ### Path to encoder binary; default search for IVAS_cod in bin folder (primary) and PATH (secondary) - #bin: ~\\git\\ivas-codec\\IVAS_cod + #bin: ~/git/ivas-codec/IVAS_cod ### Encoder input sampling rate in Hz (resampling performed in case of mismatch); default = null (no resampling) # fs: 32000 ### Additional commandline options; default = null # opts: ["-q", "-dtx", 4] ### Decoder options - #dec: + dec: ### Path to decoder binary; default search for IVAS_dec in bin folder (primary) and PATH (secondary) - #bin: ~\\git\\ivas-codec\\IVAS_dec + #bin: ~/git/ivas-codec/IVAS_dec ### Decoder output format; default = postprocessing fmt - #fmt: CICP19 + fmt: "7_1_4" ### Decoder output sampling rate; default = null (same as input) # fs: 48000 ### Additional commandline options; default = null # opts: ["-q", "-no_delay_cmp"] + ### Bitstream options + # tx: + ### For possible arguments see overall bitstream modification ### EVS condition ################################ - c05: + c08: ### REQUIRED: type of condition type: evs ### REQUIRED: Bitrates to use for coding - ### For EVS mono, this may be a per-channel bitrate configuration (must match input\\preprocessing format!) + ### For EVS mono, this may be a per-channel bitrate configuration (must match input/preprocessing format!) ### the last value will be repeated if too few are specified bitrates: - - 9600 - #- [13200, 13200, 8000, 13200, 9600] + # - 9600 + - [13200, 13200, 8000, 13200, 9600] cod: ### Path to encoder binary; default search for EVS_cod in bin folder (primary) and PATH (secondary) - #bin: ~\\git\\ivas-codec\\IVAS_cod + #bin: EVS_cod ### Encoder input sampling rate in Hz (resampling performed in case of mismatch); default = null (no resampling) # fs: 32000 dec: ### Path to encoder binary; default search for EVS_dec in bin folder (primary) and PATH (secondary) - #bin: ~\\git\\ivas-codec\\IVAS_dec + #bin: EVS_dec ### Decoder output sampling rate; default = null (same as input) # fs: 48000 + ### Bitstream options + # tx: + ### For possible arguments see overall bitstream modification ################################################ ### Post-processing @@ -210,21 +272,21 @@ conditions_to_generate: postprocessing: ### REQUIRED: Target format for output fmt: "BINAURAL" - ### Target sampling rate in Hz for resampling; default = null (no resampling) + ### REQUIRED: Target sampling rate in Hz for resampling fs: 48000 ### Low-pass cut-off frequency in Hz; default = null (no filtering) # lp_cutoff: 24000 ### Target loudness in LKFS; default = null (no loudness change applied) - # loudness: -26 + loudness: -26 ### Spatial audio format in which loudness is adjusted (only used if preprocessing loudness is not null); ### default = null (uses postprocessing fmt if possible) # loudness_fmt: null ### Name of custom binaural dataset (without prefix or suffix); - ### default = null (ORANGE53 for BINAURAL, IISofficialMPEG222UC for BINAURAL_ROOM) + ### default = null (ORANGE53(_Dolby) for BINAURAL, IISofficialMPEG222UC for BINAURAL_ROOM) # bin_dataset: SADIE ### Render LFE to binaural output with the specified gain (only valid for channel-based input); default = null # bin_lfe_gain: 1 - ### Flag whether output should be limited to avoid clipping (can alter target loudness); default = true - # limit: false + ### Flag whether output should be limited to avoid clipping (can alter target loudness); default = false + # limit: true ### Head-tracking trajectory file for binaural output; default = null - # trajectory: path\\to\\file + # trajectory: "path/to/file" diff --git a/tests/data/test_SBA.yml b/tests/data/test_SBA.yml index da243a21..84daaff2 100644 --- a/tests/data/test_SBA.yml +++ b/tests/data/test_SBA.yml @@ -14,10 +14,13 @@ ### Deletion of temporary directories containing ### intermediate processing files, bitstreams etc.; default = false # delete_tmp: true +### Master seed for random processes like bitstream error pattern generation; default = 0 +master_seed: 5 ### Any relative paths will be interpreted relative to the working directory the script is called from! ### Usage of absolute paths is recommended. ### Do not use file names with dots "." in them! This is not supported, use "_" instead +### For Windows user: please use double back slash '\\' in paths and add '.exe' to executable definitions ### REQUIRED: Input path or file input_path: "./tests/data/pinknoise/pink_noise_4ch_48kHz.wav" ### REQUIRED: Output path or file @@ -27,98 +30,131 @@ output_path: "./tmp_output_SBA" ### default = null (for ISM search for item_name.{wav, raw, pcm}.{0-3}.csv in input folder, otherise ignored) # metadata_path: ### Path can be set for all items with the 'all_items' key (automatic search for item_name.{wav, raw, pcm}.{0-3}.csv within this folder) - # all_items: "../path" + # all_items: ".../metadata_folder" ### Path can be set for all items individually with 'item{1-4}' keys - ### 'item{1-4}' keys can also be renamed to the input file names with extension + ### 'item{1-4}' keys can also be renamed to the input file names including extension {wav, raw, pcm} + ### Either list individual files for all objects or name folder for automatic search for one item # item1: - ### Either list individual files for all objects or give folder for automatic search - # - ".../metadata_folder" + # - ".../meta_all_obj" # item2: - # - ".../meta_name.csv" - # - ".../different_name.csv" - # noise: - # - ".../metadata_folder_for_noise_item" + # - ".../meta_obj1.csv" + # - ".../meta_ob2.csv" + # noise.wav: + # - ".../metadata_folder_for_noise_item" ### Select only a subset of items ### searches for the specified substring in found filenames; default = null # input_select: # - "48kHz" -### Horizontally concatenate input items into one long file; default = false -# concatenate_input: true -### Specify silence duration (ms) to add in between concatenated items; default = null -# concat_silence: - # pre: 0 - # post: 0 - ################################################ ### Input configuration ################################################ input: ### REQUIRED: Input format - fmt: FOA + fmt: "FOA" ### Input sampling rate in Hz needed for headerless audio files; default = 48000 # fs: 32000 ################################################ -### Pre-processing +### Pre-processing on individual items ################################################ ### Pre-processing step performed prior to core processing for all conditions ### If not defined, preprocessing step is skipped -# preprocessing: +preprocessing: ### Target format used in rendering from input format; default = null (no rendering) # fmt: "7_1_4" ### Flag for application of 50Hz high-pass filter; default = false hp50: true ### Target sampling rate in Hz for resampling; default = null (no resampling) - # fs: 16000 + fs: 32000 ### Target loudness in LKFS; default = null (no loudness change applied) - # loudness: -26 + loudness: -26 ### Spatial audio format in which loudness is adjusted (only used if preprocessing loudness is not null); ### default = null (uses preprocessing fmt if possible) - # loudness_fmt: BINAURAL - ### Pre-/post-trim signal (ms) (negative values pad silence); default = 0 - trim: - - 50 - - -50 - ### Flag for using noise instead of silence for padding - pad_noise: true + loudness_fmt: "MONO" + ### Pre-/post-trim individual signal(s) (ms) (negative values pad silence); default = 0 + # trim: + # - 50 + # - -50 + ### Flag for using noise (amplitude +-4) instead of silence for padding; default = false (silence) + # pad_noise: true ### Value for application of delay (ms) (negative values advance); default = 0 - # delay: 20 + delay: 20 ### Length of window used at start/end of signal (ms); default = 0 window: 100 + +################################################ +### Pre-processing on whole signal(s) +################################################ +preprocessing_2: + ### Options for processing of the concatenated item (concatenate_input: true) or + ### the individual items (concatenate_input: false) after previous pre-processing step + ### Horizontally concatenate input items into one long file; default = false + # concatenate_input: true + ### Specify the concatenation order in a list of strings. If not specified, the concatenation order would be + ### as per the filesystem on the users' device + ### Should only be used if concatenate_input = true + ### Specify the filename with extension. + ### For example, concatenation_order: ["file3.wav", "file1.wav", "file4.wav", "file2.wav"] + # concatenation_order: [] + ### Specify preamble duration in ms; default = 0 + preamble: 10000 + ### Flag wheter to use noise (amplitude +-4) for the preamble or silence; default = false (silence) + # preamble_noise: true + ### Additive background noise + # background_noise: + ### REQUIRED: SNR for background noise in dB + # snr: 10 + ### REQUIRED: Path to background noise, must have same format and sampling rate as input signal(s) + # background_noise_path: ".../noise.wav" + ### Seed for delay offest; default = 0 + # seed_delay: 10 ################################################# -### bitstream processing +### Bitstream processing ################################################# -### bistream processing (transport simulation) done after encoding and before decoding +### Bitstream processing (transport simulation) done after encoding and before decoding ### e.g. frame error insertion or transport simulation for JBM testing +### can be given globally here or in individual conditions of type ivas or evs # tx: - ### other options for generating error files,.... - ### maybe directly give something like fer and generate error_pottern and bs_proc_opts internally - # fer: - # error_rate: 5 ### in percent - ### Path to network simulation binary (mandatory) - # bs_proc_bin: C:\local\bay\ivas\VR\src\ivas_python_testscripts\networkSimulator_g192.exe - ### Path to error pattern (mandatory if no information for generating the error pattern is given) - # error_pattern: C:\local\bay\ivas\VR\src\ivas_python_testscripts\dly_error_profiles\dly_error_profile_6.dat - ### options for the binary, possible placeholders are {error_pattern} for the error pattern, - ### {bitstream} for the bitstream to process and {bitstream_processed} for the processed bitstream - # bs_proc_opts: [ "{error_pattern}", "{bitstream}", "{processed_bitstream}", "{processed_bitstream}_tracefile_sim", "2", "0" ] - + ### REQUIRED: Type of bitstream processing; possible types: "JBM" or "FER" + # type: "JBM" + + ### JBM + ### REQUIRED: either error_pattern or error_profile + ### delay error profile file + # error_pattern: ".../dly_error_profile.dat" + ### Index of one of the existing delay error profile files to use (1-11) + # error_profile: 5 + ## nFramesPerPacket parameter for the network simulator; default = 1 + # n_frames_per_packet: 2 + + ### FER + ### REQUIRED: either error_pattern or error_rate + ### Frame error pattern file + # error_pattern: "path/pattern.192" + ### Error rate in percent + # error_rate: 5 + ### Additional seed to specify number of preruns; default = 0 + # prerun_seed: 2 + ################################################ ### Configuration for conditions under test ################################################ ### List of conditions to generate ### Name of the key will be used as output directory name ### conditions must specify the "type" key which may be one of the following options: -### ref generate the reference condition -### lp3k5 generate a low-pass anchor with cut-off frequency 3.5 kHz -### lp7k generate a low-pass anchor with cut-off frequency 7 kHz -### evs generate an EVS coded condition (see below examples for additional required keys) -### ivas generate an IVAS coded condition (see below examples for additional required keys) +### ref generate the reference condition +### lp3k5 generate a low-pass anchor with cut-off frequency 3.5 kHz +### lp7k generate a low-pass anchor with cut-off frequency 7 kHz +### mnru generate MNRU condition +### esdru generate ESDRU condition +### mono_dmx generate mono downmix condition +### evs generate an EVS coded condition (see below examples for additional required keys) +### ivas generate an IVAS coded condition (see below examples for additional required keys) conditions_to_generate: - ### Reference condition ########################## + ### Reference and anchor conditions ########################## c01: ### REQUIRED: type of condition type: ref @@ -127,20 +163,32 @@ conditions_to_generate: c02: ### REQUIRED: type of condition type: lp3k5 + c03: + ### REQUIRED: type of condition + type: mnru + ### REQUIRED: the ratio of speech power to modulated noise power in dB + q: 20 + c04: + ### REQUIRED: type of condition + type: esdru + ### REQUIRED: spatial degradation value between 0 and 1 + alpha: 0.5 + c05: + ### REQUIRED: type of condition + type: mono_dmx ### IVAS condition ############################### - c03: + c06: ### REQUIRED: type of condition type: ivas ### REQUIRED: Bitrates to use for coding bitrates: - 160000 # - 32000 - # TODO bitstream corruption ### Encoder options cod: ### Path to encoder binary; default search for IVAS_cod in bin folder (primary) and PATH (secondary) - # bin: ~/git/ivas-codec/IVAS_cod + #bin: ~/git/ivas-codec/IVAS_cod ### Encoder input sampling rate in Hz (resampling performed in case of mismatch); default = null (no resampling) # fs: 32000 ### Additional commandline options; default = null @@ -148,16 +196,19 @@ conditions_to_generate: ### Decoder options dec: ### Path to decoder binary; default search for IVAS_dec in bin folder (primary) and PATH (secondary) - # bin: ~/git/ivas-codec/IVAS_dec + #bin: ~/git/ivas-codec/IVAS_dec ### Decoder output format; default = postprocessing fmt - fmt: FOA + fmt: "HOA3" ### Decoder output sampling rate; default = null (same as input) # fs: 48000 ### Additional commandline options; default = null # opts: ["-q", "-no_delay_cmp"] + ### Bitstream options + # tx: + ### For possible arguments see overall bitstream modification ### IVAS condition ############################### - c04: + c07: ### REQUIRED: type of condition type: ivas ### REQUIRED: Bitrates to use for coding @@ -167,7 +218,7 @@ conditions_to_generate: ### Encoder options cod: ### Path to encoder binary; default search for IVAS_cod in bin folder (primary) and PATH (secondary) - # bin: ~/git/ivas-codec/IVAS_cod + #bin: ~/git/ivas-codec/IVAS_cod ### Encoder input sampling rate in Hz (resampling performed in case of mismatch); default = null (no resampling) # fs: 32000 ### Additional commandline options; default = null @@ -175,16 +226,22 @@ conditions_to_generate: ### Decoder options dec: ### Path to decoder binary; default search for IVAS_dec in bin folder (primary) and PATH (secondary) - # bin: ~/git/ivas-codec/IVAS_dec + #bin: ~/git/ivas-codec/IVAS_dec ### Decoder output format; default = postprocessing fmt - fmt: CICP19 + fmt: "CICP19" ### Decoder output sampling rate; default = null (same as input) # fs: 48000 ### Additional commandline options; default = null # opts: ["-q", "-no_delay_cmp"] + ### Bitstream options + tx: + ### For possible arguments see overall bitstream modification + type: "FER" + error_rate: 3 + prerun_seed: 2 ### EVS condition ################################ - c05: + c08: ### REQUIRED: type of condition type: evs ### REQUIRED: Bitrates to use for coding @@ -195,14 +252,19 @@ conditions_to_generate: - [13200, 13200, 8000, 13200, 9600] cod: ### Path to encoder binary; default search for EVS_cod in bin folder (primary) and PATH (secondary) - # bin: ~/git/ivas-codec/IVAS_cod + #bin: EVS_cod ### Encoder input sampling rate in Hz (resampling performed in case of mismatch); default = null (no resampling) # fs: 32000 dec: ### Path to encoder binary; default search for EVS_dec in bin folder (primary) and PATH (secondary) - # bin: ~/git/ivas-codec/IVAS_dec + #bin: EVS_dec ### Decoder output sampling rate; default = null (same as input) # fs: 48000 + ### Bitstream options + tx: + ### For possible arguments see overall bitstream modification + type: "JBM" + error_profile: 3 ################################################ ### Post-processing @@ -212,7 +274,7 @@ conditions_to_generate: postprocessing: ### REQUIRED: Target format for output fmt: "BINAURAL" - ### Target sampling rate in Hz for resampling; default = null (no resampling) + ### REQUIRED: Target sampling rate in Hz for resampling fs: 48000 ### Low-pass cut-off frequency in Hz; default = null (no filtering) # lp_cutoff: 24000 @@ -222,11 +284,11 @@ postprocessing: ### default = null (uses postprocessing fmt if possible) # loudness_fmt: null ### Name of custom binaural dataset (without prefix or suffix); - ### default = null (ORANGE53 for BINAURAL, IISofficialMPEG222UC for BINAURAL_ROOM) + ### default = null (ORANGE53(_Dolby) for BINAURAL, IISofficialMPEG222UC for BINAURAL_ROOM) # bin_dataset: SADIE ### Render LFE to binaural output with the specified gain (only valid for channel-based input); default = null # bin_lfe_gain: 1 - ### Flag whether output should be limited to avoid clipping (can alter target loudness); default = true - # limit: false + ### Flag whether output should be limited to avoid clipping (can alter target loudness); default = false + limit: true ### Head-tracking trajectory file for binaural output; default = null - # trajectory: path/to/file + # trajectory: "path/to/file" -- GitLab From 2adb732ad2eff962bd1ca05948939a447a712a10 Mon Sep 17 00:00:00 2001 From: Treffehn Date: Fri, 28 Apr 2023 11:37:06 +0200 Subject: [PATCH 08/22] added concatenation in test files --- .../ISM/pink_noise_4ch_48kHz.wav | 3 +++ .../ISM/spectral_test_4ch_48kHz.wav | 3 +++ .../concatenation_folder/MC/pink_noise_2ch_48kHz.wav | 3 +++ .../MC/spectral_test_2ch_48kHz.wav | 3 +++ .../SBA/pink_noise_4ch_48kHz.wav | 3 +++ .../SBA/spectral_test_4ch_48kHz.wav | 3 +++ tests/data/test_ISM.yml | 12 +++++++----- tests/data/test_MC.yml | 6 +++--- tests/data/test_SBA.yml | 4 ++-- 9 files changed, 30 insertions(+), 10 deletions(-) create mode 100644 tests/data/concatenation_folder/ISM/pink_noise_4ch_48kHz.wav create mode 100644 tests/data/concatenation_folder/ISM/spectral_test_4ch_48kHz.wav create mode 100644 tests/data/concatenation_folder/MC/pink_noise_2ch_48kHz.wav create mode 100644 tests/data/concatenation_folder/MC/spectral_test_2ch_48kHz.wav create mode 100644 tests/data/concatenation_folder/SBA/pink_noise_4ch_48kHz.wav create mode 100644 tests/data/concatenation_folder/SBA/spectral_test_4ch_48kHz.wav diff --git a/tests/data/concatenation_folder/ISM/pink_noise_4ch_48kHz.wav b/tests/data/concatenation_folder/ISM/pink_noise_4ch_48kHz.wav new file mode 100644 index 00000000..7881c149 --- /dev/null +++ b/tests/data/concatenation_folder/ISM/pink_noise_4ch_48kHz.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a9310f2e04af7f544f70dfd7360b93c9bafff7e35d9c919e003b27ed549974d8 +size 384044 diff --git a/tests/data/concatenation_folder/ISM/spectral_test_4ch_48kHz.wav b/tests/data/concatenation_folder/ISM/spectral_test_4ch_48kHz.wav new file mode 100644 index 00000000..6b9296e2 --- /dev/null +++ b/tests/data/concatenation_folder/ISM/spectral_test_4ch_48kHz.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:80437a0e2cbb2adb8d9b6ca8a8fab8da229d88af6a14ce64f1cd703f4645bebf +size 384080 diff --git a/tests/data/concatenation_folder/MC/pink_noise_2ch_48kHz.wav b/tests/data/concatenation_folder/MC/pink_noise_2ch_48kHz.wav new file mode 100644 index 00000000..0e0e43f6 --- /dev/null +++ b/tests/data/concatenation_folder/MC/pink_noise_2ch_48kHz.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ce34623cf87d56cf5d695e79388d1229f74ba266e0977c18cdf03df174675e3d +size 192044 diff --git a/tests/data/concatenation_folder/MC/spectral_test_2ch_48kHz.wav b/tests/data/concatenation_folder/MC/spectral_test_2ch_48kHz.wav new file mode 100644 index 00000000..334a4799 --- /dev/null +++ b/tests/data/concatenation_folder/MC/spectral_test_2ch_48kHz.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f612f319abdd28cf859d75ae912364fd73b2b591200e307ab6903c629bc10e4 +size 192044 diff --git a/tests/data/concatenation_folder/SBA/pink_noise_4ch_48kHz.wav b/tests/data/concatenation_folder/SBA/pink_noise_4ch_48kHz.wav new file mode 100644 index 00000000..7881c149 --- /dev/null +++ b/tests/data/concatenation_folder/SBA/pink_noise_4ch_48kHz.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a9310f2e04af7f544f70dfd7360b93c9bafff7e35d9c919e003b27ed549974d8 +size 384044 diff --git a/tests/data/concatenation_folder/SBA/spectral_test_4ch_48kHz.wav b/tests/data/concatenation_folder/SBA/spectral_test_4ch_48kHz.wav new file mode 100644 index 00000000..6b9296e2 --- /dev/null +++ b/tests/data/concatenation_folder/SBA/spectral_test_4ch_48kHz.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:80437a0e2cbb2adb8d9b6ca8a8fab8da229d88af6a14ce64f1cd703f4645bebf +size 384080 diff --git a/tests/data/test_ISM.yml b/tests/data/test_ISM.yml index 6d64d82a..b0263898 100644 --- a/tests/data/test_ISM.yml +++ b/tests/data/test_ISM.yml @@ -22,7 +22,7 @@ ### Do not use file names with dots "." in them! This is not supported, use "_" instead ### For Windows user: please use double back slash '\\' in paths and add '.exe' to executable definitions ### REQUIRED: Input path or file -input_path: "./tests/data/pinknoise/pink_noise_4ch_48kHz.wav" +input_path: "./tests/data/concatenation_folder/ISM" ### REQUIRED: Output path or file output_path: "./tmp_output_ISM" ### Metadata path or file(s) @@ -39,9 +39,11 @@ metadata_path: - "./tests/data/ism_metadata/stvISM2.csv" - "./tests/data/ism_metadata/stvISM3.csv" - "./tests/data/ism_metadata/stvISM4.csv" - # item2: - # - ".../meta_obj1.csv" - # - ".../meta_ob2.csv" + spectral_test_4ch_48kHz.wav: + - "./tests/data/ism_metadata/ism_0a_0e.csv" + - "./tests/data/ism_metadata/ism_90a_0e.csv" + - "./tests/data/ism_metadata/ism_-90a_0e.csv" + - "./tests/data/ism_metadata/ism_180a_0e.csv" # noise.wav: # - ".../metadata_folder_for_noise_item" @@ -94,7 +96,7 @@ preprocessing_2: ### Options for processing of the concatenated item (concatenate_input: true) or ### the individual items (concatenate_input: false) after previous pre-processing step ### Horizontally concatenate input items into one long file; default = false - # concatenate_input: true + concatenate_input: true ### Specify the concatenation order in a list of strings. If not specified, the concatenation order would be ### as per the filesystem on the users' device ### Should only be used if concatenate_input = true diff --git a/tests/data/test_MC.yml b/tests/data/test_MC.yml index 270e157e..873a27f5 100644 --- a/tests/data/test_MC.yml +++ b/tests/data/test_MC.yml @@ -22,7 +22,7 @@ master_seed: 5 ### Do not use file names with dots "." in them! This is not supported, use "_" instead ### For Windows user: please use double back slash '\\' in paths and add '.exe' to executable definitions ### REQUIRED: Input path or file -input_path: "./tests/data/pinknoise/pink_noise_2ch_48kHz.wav" +input_path: "./tests/data/concatenation_folder/MC" ### REQUIRED: Output path or file output_path: "./tmp_output_MC" ### Metadata path or file(s) @@ -91,13 +91,13 @@ preprocessing_2: ### Options for processing of the concatenated item (concatenate_input: true) or ### the individual items (concatenate_input: false) after previous pre-processing step ### Horizontally concatenate input items into one long file; default = false - # concatenate_input: true + concatenate_input: true ### Specify the concatenation order in a list of strings. If not specified, the concatenation order would be ### as per the filesystem on the users' device ### Should only be used if concatenate_input = true ### Specify the filename with extension. ### For example, concatenation_order: ["file3.wav", "file1.wav", "file4.wav", "file2.wav"] - # concatenation_order: [] + concatenation_order: ["spectral_test_2ch_48kHz.wav", "pink_noise_2ch_48kHz.wav"] ### Specify preamble duration in ms; default = 0 preamble: 10000 ### Flag wheter to use noise (amplitude +-4) for the preamble or silence; default = false (silence) diff --git a/tests/data/test_SBA.yml b/tests/data/test_SBA.yml index 84daaff2..b8d4218a 100644 --- a/tests/data/test_SBA.yml +++ b/tests/data/test_SBA.yml @@ -22,7 +22,7 @@ master_seed: 5 ### Do not use file names with dots "." in them! This is not supported, use "_" instead ### For Windows user: please use double back slash '\\' in paths and add '.exe' to executable definitions ### REQUIRED: Input path or file -input_path: "./tests/data/pinknoise/pink_noise_4ch_48kHz.wav" +input_path: "./tests/data/concatenation_folder/SBA" ### REQUIRED: Output path or file output_path: "./tmp_output_SBA" ### Metadata path or file(s) @@ -91,7 +91,7 @@ preprocessing_2: ### Options for processing of the concatenated item (concatenate_input: true) or ### the individual items (concatenate_input: false) after previous pre-processing step ### Horizontally concatenate input items into one long file; default = false - # concatenate_input: true + concatenate_input: true ### Specify the concatenation order in a list of strings. If not specified, the concatenation order would be ### as per the filesystem on the users' device ### Should only be used if concatenate_input = true -- GitLab From 08e4617152c98169be7020d54784a4a751edc051 Mon Sep 17 00:00:00 2001 From: Treffehn Date: Fri, 28 Apr 2023 13:53:17 +0200 Subject: [PATCH 09/22] removed folders and added temporary ones --- .gitignore | 4 +++ tests/conftest.py | 2 +- tests/constants.py | 2 +- .../ISM/pink_noise_4ch_48kHz.wav | 3 --- .../ISM/spectral_test_4ch_48kHz.wav | 3 --- .../MC/pink_noise_2ch_48kHz.wav | 3 --- .../MC/spectral_test_2ch_48kHz.wav | 3 --- .../SBA/pink_noise_4ch_48kHz.wav | 3 --- .../SBA/spectral_test_4ch_48kHz.wav | 3 --- tests/data/test_ISM.yml | 2 +- tests/data/test_MC.yml | 2 +- tests/data/test_SBA.yml | 2 +- tests/test_processing.py | 26 +++++++++++++++++++ 13 files changed, 35 insertions(+), 23 deletions(-) delete mode 100644 tests/data/concatenation_folder/ISM/pink_noise_4ch_48kHz.wav delete mode 100644 tests/data/concatenation_folder/ISM/spectral_test_4ch_48kHz.wav delete mode 100644 tests/data/concatenation_folder/MC/pink_noise_2ch_48kHz.wav delete mode 100644 tests/data/concatenation_folder/MC/spectral_test_2ch_48kHz.wav delete mode 100644 tests/data/concatenation_folder/SBA/pink_noise_4ch_48kHz.wav delete mode 100644 tests/data/concatenation_folder/SBA/spectral_test_4ch_48kHz.wav diff --git a/.gitignore b/.gitignore index 94274513..7855f81e 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,7 @@ proc_input/*.wav proc_input/*.pcm proc_output/ *~ +tests/tmp_output_* +tests/cut +tests/ref +tests/concatenation_folder \ No newline at end of file diff --git a/tests/conftest.py b/tests/conftest.py index 7b135743..8c0b40ac 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -30,7 +30,7 @@ from pathlib import Path import pytest -from .constants import OUTPUT_PATH_CUT, OUTPUT_PATH_REF +from .constants import OUTPUT_PATH_CUT, OUTPUT_PATH_REF, INPUT_PATH_CONCATENATION @pytest.fixture(scope="session", autouse=True) diff --git a/tests/constants.py b/tests/constants.py index 11c48dc2..56a531a4 100644 --- a/tests/constants.py +++ b/tests/constants.py @@ -42,6 +42,7 @@ SCENE_DESC_DIR = TEST_VECTOR_DIR.joinpath("scene_description") OUTPUT_PATH_REF = TESTS_DIR.joinpath("ref") OUTPUT_PATH_CUT = TESTS_DIR.joinpath("cut") +INPUT_PATH_CONCATENATION = TESTS_DIR.joinpath("concatenation_folder") CUSTOM_LAYOUT_DIR = TEST_VECTOR_DIR.joinpath("ls_layouts") HR_TRAJECTORY_DIR = TEST_VECTOR_DIR.joinpath("trajectories") @@ -193,7 +194,6 @@ HR_TRAJECTORIES_TO_TEST = [ ] """ Generate Test Items Configs """ -# TODO reorganize later INPUT_CONFIG_FILES = [ str(TEST_VECTOR_DIR.joinpath("test_ISM.yml")), # str(TEST_VECTOR_DIR.joinpath("test_MASA.yml")), # TODO diff --git a/tests/data/concatenation_folder/ISM/pink_noise_4ch_48kHz.wav b/tests/data/concatenation_folder/ISM/pink_noise_4ch_48kHz.wav deleted file mode 100644 index 7881c149..00000000 --- a/tests/data/concatenation_folder/ISM/pink_noise_4ch_48kHz.wav +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a9310f2e04af7f544f70dfd7360b93c9bafff7e35d9c919e003b27ed549974d8 -size 384044 diff --git a/tests/data/concatenation_folder/ISM/spectral_test_4ch_48kHz.wav b/tests/data/concatenation_folder/ISM/spectral_test_4ch_48kHz.wav deleted file mode 100644 index 6b9296e2..00000000 --- a/tests/data/concatenation_folder/ISM/spectral_test_4ch_48kHz.wav +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:80437a0e2cbb2adb8d9b6ca8a8fab8da229d88af6a14ce64f1cd703f4645bebf -size 384080 diff --git a/tests/data/concatenation_folder/MC/pink_noise_2ch_48kHz.wav b/tests/data/concatenation_folder/MC/pink_noise_2ch_48kHz.wav deleted file mode 100644 index 0e0e43f6..00000000 --- a/tests/data/concatenation_folder/MC/pink_noise_2ch_48kHz.wav +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ce34623cf87d56cf5d695e79388d1229f74ba266e0977c18cdf03df174675e3d -size 192044 diff --git a/tests/data/concatenation_folder/MC/spectral_test_2ch_48kHz.wav b/tests/data/concatenation_folder/MC/spectral_test_2ch_48kHz.wav deleted file mode 100644 index 334a4799..00000000 --- a/tests/data/concatenation_folder/MC/spectral_test_2ch_48kHz.wav +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2f612f319abdd28cf859d75ae912364fd73b2b591200e307ab6903c629bc10e4 -size 192044 diff --git a/tests/data/concatenation_folder/SBA/pink_noise_4ch_48kHz.wav b/tests/data/concatenation_folder/SBA/pink_noise_4ch_48kHz.wav deleted file mode 100644 index 7881c149..00000000 --- a/tests/data/concatenation_folder/SBA/pink_noise_4ch_48kHz.wav +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a9310f2e04af7f544f70dfd7360b93c9bafff7e35d9c919e003b27ed549974d8 -size 384044 diff --git a/tests/data/concatenation_folder/SBA/spectral_test_4ch_48kHz.wav b/tests/data/concatenation_folder/SBA/spectral_test_4ch_48kHz.wav deleted file mode 100644 index 6b9296e2..00000000 --- a/tests/data/concatenation_folder/SBA/spectral_test_4ch_48kHz.wav +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:80437a0e2cbb2adb8d9b6ca8a8fab8da229d88af6a14ce64f1cd703f4645bebf -size 384080 diff --git a/tests/data/test_ISM.yml b/tests/data/test_ISM.yml index b0263898..7c4766ab 100644 --- a/tests/data/test_ISM.yml +++ b/tests/data/test_ISM.yml @@ -22,7 +22,7 @@ ### Do not use file names with dots "." in them! This is not supported, use "_" instead ### For Windows user: please use double back slash '\\' in paths and add '.exe' to executable definitions ### REQUIRED: Input path or file -input_path: "./tests/data/concatenation_folder/ISM" +input_path: "./concatenation_folder/ISM" ### REQUIRED: Output path or file output_path: "./tmp_output_ISM" ### Metadata path or file(s) diff --git a/tests/data/test_MC.yml b/tests/data/test_MC.yml index 873a27f5..918c3e5b 100644 --- a/tests/data/test_MC.yml +++ b/tests/data/test_MC.yml @@ -22,7 +22,7 @@ master_seed: 5 ### Do not use file names with dots "." in them! This is not supported, use "_" instead ### For Windows user: please use double back slash '\\' in paths and add '.exe' to executable definitions ### REQUIRED: Input path or file -input_path: "./tests/data/concatenation_folder/MC" +input_path: "./concatenation_folder/MC" ### REQUIRED: Output path or file output_path: "./tmp_output_MC" ### Metadata path or file(s) diff --git a/tests/data/test_SBA.yml b/tests/data/test_SBA.yml index b8d4218a..469ee0c9 100644 --- a/tests/data/test_SBA.yml +++ b/tests/data/test_SBA.yml @@ -22,7 +22,7 @@ master_seed: 5 ### Do not use file names with dots "." in them! This is not supported, use "_" instead ### For Windows user: please use double back slash '\\' in paths and add '.exe' to executable definitions ### REQUIRED: Input path or file -input_path: "./tests/data/concatenation_folder/SBA" +input_path: "./concatenation_folder/SBA" ### REQUIRED: Output path or file output_path: "./tmp_output_SBA" ### Metadata path or file(s) diff --git a/tests/test_processing.py b/tests/test_processing.py index b0576bc0..a35edc0d 100644 --- a/tests/test_processing.py +++ b/tests/test_processing.py @@ -31,9 +31,12 @@ # import pytest +from pathlib import Path +import shutil from ivas_processing_scripts import main as generate_test from tests.constants import INPUT_CONFIG_FILES +from ivas_processing_scripts.processing.config import TestConfig class Arguments: @@ -46,4 +49,27 @@ class Arguments: def test_generate_test_items(cfg): args = Arguments(cfg) + # read out input path + config = TestConfig(cfg) + input_path = Path(config.input_path).absolute() + + # deduce number of channels based on name + if "MC" in cfg: + num_channels = 2 # test stereo + elif "ISM" in cfg: + num_channels = 4 # test ISM4 + elif "SBA" in cfg: + num_channels = 4 # test FOA + else: + raise ValueError("Test setup missing") + + # create input folder for MC, SBA and ISM tests with concatenation + input_path.mkdir(exist_ok=True, parents=True) + + # copy items to folder -> pink noise and spectral test + pink_noise = Path(f"./data/pinknoise/pink_noise_{num_channels}ch_48kHz.wav").absolute() + shutil.copy(pink_noise, input_path.joinpath(pink_noise.name)) + spectral = Path(f"./data/spectral/spectral_test_{num_channels}ch_48kHz.wav").absolute() + shutil.copy(spectral, input_path.joinpath(spectral.name)) + generate_test(args) -- GitLab From e565dcbe3432c133c93214baba3fe9c3a930c6bf Mon Sep 17 00:00:00 2001 From: Treffehn Date: Fri, 28 Apr 2023 15:35:44 +0200 Subject: [PATCH 10/22] added resolve and changed paths --- tests/data/test_ISM.yml | 4 ++-- tests/data/test_MC.yml | 4 ++-- tests/data/test_SBA.yml | 4 ++-- tests/test_processing.py | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/data/test_ISM.yml b/tests/data/test_ISM.yml index 7c4766ab..5dd229a9 100644 --- a/tests/data/test_ISM.yml +++ b/tests/data/test_ISM.yml @@ -22,9 +22,9 @@ ### Do not use file names with dots "." in them! This is not supported, use "_" instead ### For Windows user: please use double back slash '\\' in paths and add '.exe' to executable definitions ### REQUIRED: Input path or file -input_path: "./concatenation_folder/ISM" +input_path: "./tests/concatenation_folder/ISM" ### REQUIRED: Output path or file -output_path: "./tmp_output_ISM" +output_path: "./tests/tmp_output_ISM" ### Metadata path or file(s) ### If input format is ISM{1-4} a path for the metadata files can be specified; ### default = null (for ISM search for item_name.{wav, raw, pcm}.{0-3}.csv in input folder, otherise ignored) diff --git a/tests/data/test_MC.yml b/tests/data/test_MC.yml index 918c3e5b..f870bf7c 100644 --- a/tests/data/test_MC.yml +++ b/tests/data/test_MC.yml @@ -22,9 +22,9 @@ master_seed: 5 ### Do not use file names with dots "." in them! This is not supported, use "_" instead ### For Windows user: please use double back slash '\\' in paths and add '.exe' to executable definitions ### REQUIRED: Input path or file -input_path: "./concatenation_folder/MC" +input_path: "./tests/concatenation_folder/MC" ### REQUIRED: Output path or file -output_path: "./tmp_output_MC" +output_path: "./tests/tmp_output_MC" ### Metadata path or file(s) ### If input format is ISM{1-4} a path for the metadata files can be specified; ### default = null (for ISM search for item_name.{wav, raw, pcm}.{0-3}.csv in input folder, otherise ignored) diff --git a/tests/data/test_SBA.yml b/tests/data/test_SBA.yml index 469ee0c9..72e2a7b0 100644 --- a/tests/data/test_SBA.yml +++ b/tests/data/test_SBA.yml @@ -22,9 +22,9 @@ master_seed: 5 ### Do not use file names with dots "." in them! This is not supported, use "_" instead ### For Windows user: please use double back slash '\\' in paths and add '.exe' to executable definitions ### REQUIRED: Input path or file -input_path: "./concatenation_folder/SBA" +input_path: "./tests/concatenation_folder/SBA" ### REQUIRED: Output path or file -output_path: "./tmp_output_SBA" +output_path: "./tests/tmp_output_SBA" ### Metadata path or file(s) ### If input format is ISM{1-4} a path for the metadata files can be specified; ### default = null (for ISM search for item_name.{wav, raw, pcm}.{0-3}.csv in input folder, otherise ignored) diff --git a/tests/test_processing.py b/tests/test_processing.py index a35edc0d..d0c95cb2 100644 --- a/tests/test_processing.py +++ b/tests/test_processing.py @@ -51,7 +51,7 @@ def test_generate_test_items(cfg): # read out input path config = TestConfig(cfg) - input_path = Path(config.input_path).absolute() + input_path = Path(config.input_path).resolve().absolute() # deduce number of channels based on name if "MC" in cfg: @@ -67,9 +67,9 @@ def test_generate_test_items(cfg): input_path.mkdir(exist_ok=True, parents=True) # copy items to folder -> pink noise and spectral test - pink_noise = Path(f"./data/pinknoise/pink_noise_{num_channels}ch_48kHz.wav").absolute() + pink_noise = Path(f"./tests/data/pinknoise/pink_noise_{num_channels}ch_48kHz.wav").resolve().absolute() shutil.copy(pink_noise, input_path.joinpath(pink_noise.name)) - spectral = Path(f"./data/spectral/spectral_test_{num_channels}ch_48kHz.wav").absolute() + spectral = Path(f"./tests/data/spectral/spectral_test_{num_channels}ch_48kHz.wav").resolve().absolute() shutil.copy(spectral, input_path.joinpath(spectral.name)) generate_test(args) -- GitLab From 20c1aab57c0a94946f9bd7f537c8f4670e1b3d93 Mon Sep 17 00:00:00 2001 From: Treffehn Date: Fri, 28 Apr 2023 15:42:36 +0200 Subject: [PATCH 11/22] test run now but fail --- ivas_processing_scripts/processing/processing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ivas_processing_scripts/processing/processing.py b/ivas_processing_scripts/processing/processing.py index 0d2097fa..939f55e0 100755 --- a/ivas_processing_scripts/processing/processing.py +++ b/ivas_processing_scripts/processing/processing.py @@ -232,7 +232,7 @@ def preprocess(cfg, logger): and cfg.preprocessing_2.get("concatenate_input", False) and cfg.preprocessing_2.get("concatenation_order", None) is not None ): - cfg.items_list = reorder_items_list(cfg.items_list, cfg.concatenation_order) + cfg.items_list = reorder_items_list(cfg.items_list, cfg["concatenation_order"]) if cfg.metadata_path[0] is not None: for item_idx in range(len(cfg.metadata_path)): -- GitLab From 63051b13fd10e19abd10ea9b79bea781c4e77b6b Mon Sep 17 00:00:00 2001 From: knj Date: Fri, 28 Apr 2023 15:49:43 +0200 Subject: [PATCH 12/22] Revert "only run jobs on single runner with test setup" This reverts commit fdf3f029a074632101505080962c5cc00a3f7945. --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 220976e5..a4cfa7c1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -39,7 +39,7 @@ stages: test_audiotools_convert: stage: test tags: - - test_fhg_1 + - linux script: - *print-common-info - python3 -m pytest -n auto tests/test_audiotools_convert.py @@ -48,7 +48,7 @@ test_audiotools_convert: test_processing: stage: test tags: - - test_fhg_1 + - linux script: - *print-common-info - *get-codec-binaries @@ -61,7 +61,7 @@ test_processing: lint: stage: analyze tags: - - test_fhg_1 + - linux allow_failure: true script: - flake8 --max-line-length 88 --extend-ignore=E203,E501,E741 @@ -72,7 +72,7 @@ format: ARTIFACT_BASE_NAME: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--formatting-fix" ARTIFACT_FOLDER: "formatting-patch" tags: - - test_fhg_1 + - linux allow_failure: true script: - mkdir $ARTIFACT_FOLDER -- GitLab From 1d981df060b04d2300fd2011163a453ff51d56e2 Mon Sep 17 00:00:00 2001 From: Treffehn Date: Fri, 28 Apr 2023 18:42:55 +0200 Subject: [PATCH 13/22] fix at least some errors in the pipeline --- .../audiotools/convert/channelbased.py | 1 + .../processing/processing.py | 21 ++++++++++--------- tests/data/test_MC.yml | 2 +- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/ivas_processing_scripts/audiotools/convert/channelbased.py b/ivas_processing_scripts/audiotools/convert/channelbased.py index 6bdd6b33..480d635e 100755 --- a/ivas_processing_scripts/audiotools/convert/channelbased.py +++ b/ivas_processing_scripts/audiotools/convert/channelbased.py @@ -139,6 +139,7 @@ def render_cba_to_binaural( bin.audio += bin_lfe bin.audio = resample_itu(bin, old_fs) + bin.fs = old_fs def render_custom_ls_binaural( diff --git a/ivas_processing_scripts/processing/processing.py b/ivas_processing_scripts/processing/processing.py index 939f55e0..3434f791 100755 --- a/ivas_processing_scripts/processing/processing.py +++ b/ivas_processing_scripts/processing/processing.py @@ -133,7 +133,7 @@ def concat_setup(cfg: TestConfig, chain, logger: logging.Logger): cfg.splits = concat( cfg.items_list, cfg.concat_file, - in_fs=cfg.input.get("fs", 48000), + in_fs=cfg_pre2.in_fs, num_channels=tmp_num_chans, ) @@ -164,6 +164,15 @@ def concat_teardown(cfg: TestConfig, logger: logging.Logger): logger.info(f"Splitting output file in directory {cfg.output_path}") + # if sampling rate changed, adjust splits + fs_new = float(cfg.postprocessing["fs"]) + fs_old = float(cfg.pre2.in_fs) + relative_fs_change = fs_new / fs_old + new_splits = [] + for split_i in cfg.splits: + new_splits.append(int(float(split_i) * relative_fs_change)) + cfg.splits = new_splits + for odir in cfg.out_dirs: path_input = odir / cfg.items_list[0].name out_paths = split( @@ -232,7 +241,7 @@ def preprocess(cfg, logger): and cfg.preprocessing_2.get("concatenate_input", False) and cfg.preprocessing_2.get("concatenation_order", None) is not None ): - cfg.items_list = reorder_items_list(cfg.items_list, cfg["concatenation_order"]) + cfg.items_list = reorder_items_list(cfg.items_list, cfg.preprocessing_2["concatenation_order"]) if cfg.metadata_path[0] is not None: for item_idx in range(len(cfg.metadata_path)): @@ -277,14 +286,6 @@ def preprocess_2(cfg, logger): cfg.out_dirs[0], select_list=getattr(cfg, "input_select", None) ) - # Re-ordering items based on concatenation order - if ( - hasattr(cfg, "preprocessing_2") - and cfg.preprocessing_2.get("concatenate_input", False) - and cfg.preprocessing_2.get("concatenation_order", None) is not None - ): - cfg.items_list = reorder_items_list(cfg.items_list, cfg.concatenation_order) - if cfg.metadata_path[0] is not None: for item_idx in range(len(cfg.metadata_path)): for obj_idx in range(len(cfg.metadata_path[item_idx])): diff --git a/tests/data/test_MC.yml b/tests/data/test_MC.yml index f870bf7c..9412166d 100644 --- a/tests/data/test_MC.yml +++ b/tests/data/test_MC.yml @@ -67,7 +67,7 @@ preprocessing: ### Flag for application of 50Hz high-pass filter; default = false hp50: true ### Target sampling rate in Hz for resampling; default = null (no resampling) - fs: 16000 + fs: 32000 ### Target loudness in LKFS; default = null (no loudness change applied) loudness: -26 ### Spatial audio format in which loudness is adjusted (only used if preprocessing loudness is not null); -- GitLab From 4170d05ca87e434acf3b5fcc66e406ecfa0b3614 Mon Sep 17 00:00:00 2001 From: knj Date: Tue, 2 May 2023 09:29:10 +0200 Subject: [PATCH 14/22] add test for binaries present and fix in find_binary --- .gitlab-ci.yml | 13 ++++++++++ ivas_processing_scripts/utils.py | 11 +++++---- tests/test_binaries_present.py | 41 ++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 4 deletions(-) create mode 100755 tests/test_binaries_present.py diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a4cfa7c1..5566b457 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,6 +7,7 @@ default: stages: + - check - test - analyze @@ -31,6 +32,18 @@ stages: - cd $dir +# ------------------------------------ +# check pre-conditions are met +# ------------------------------------ +check_for_binaries: + stage: check + tags: + - linux + script: + - *print-common-info + - tests/test_binaries_present.py + + # ------------------------------------ # functionality tests # ------------------------------------ diff --git a/ivas_processing_scripts/utils.py b/ivas_processing_scripts/utils.py index c689ce76..70884386 100755 --- a/ivas_processing_scripts/utils.py +++ b/ivas_processing_scripts/utils.py @@ -138,7 +138,7 @@ def find_binary( binary: str, raise_error: Optional[bool] = True, logger: Optional[logging.Logger] = None, - binary_path: Optional[str] = None, + binary_path: Optional[Path] = None, ) -> Union[Path, None]: """Attempt to find and return the path to the given binary""" # prioritise binaries placed in the directory over $PATH @@ -150,9 +150,12 @@ def find_binary( bin = which(binary) if not bin and raise_error: - raise FileNotFoundError( - f"Binary {binary} was neither found in {binary_path.absolute()} nor in {BIN_DIR.absolute()} or in $PATH!" - ) + msg = f"Binary {binary} was not found - neither in {BIN_DIR.absolute()} nor in $PATH" + if binary_path is None: + msg += " and binary_paths.yml file contains no items." + else: + msg += " nor in {binary_path.absolute()}." + raise FileNotFoundError(msg) elif not bin: if logger: logger.debug(f"Couldn't find binary {binary}") diff --git a/tests/test_binaries_present.py b/tests/test_binaries_present.py new file mode 100755 index 00000000..b78ef46a --- /dev/null +++ b/tests/test_binaries_present.py @@ -0,0 +1,41 @@ +#!/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 pytest +from ivas_processing_scripts.utils import find_binary + +BINARIES = ["bs1770demo", "p50fbmnru", "esdru", "eid-xor", "gen-patt", "filter", "random", "networkSimulator_g192", "masaRenderer"] + + +@pytest.mark.parametrize("binary", BINARIES) +def test_find_binary(binary): + assert(find_binary(binary, raise_error=False) is not None) -- GitLab From a39c720ab220e6c4b7b66423300c30b9ac74d77e Mon Sep 17 00:00:00 2001 From: knj Date: Tue, 2 May 2023 09:35:03 +0200 Subject: [PATCH 15/22] correctly call pytest on test script --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5566b457..5c654af3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -41,7 +41,7 @@ check_for_binaries: - linux script: - *print-common-info - - tests/test_binaries_present.py + - python3 -m pytest tests/test_binaries_present.py # ------------------------------------ -- GitLab From 668f6ea12e1cdd0e80156498028804423ac9180a Mon Sep 17 00:00:00 2001 From: Treffehn Date: Wed, 3 May 2023 19:16:57 +0200 Subject: [PATCH 16/22] changed MC test from 3k5 to 7k lp filter to acoid nan in bs1770demo --- tests/data/test_MC.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/data/test_MC.yml b/tests/data/test_MC.yml index 9412166d..edbc0782 100644 --- a/tests/data/test_MC.yml +++ b/tests/data/test_MC.yml @@ -162,7 +162,7 @@ conditions_to_generate: # out_fc: 22500 c02: ### REQUIRED: type of condition - type: lp3k5 + type: lp7k c03: ### REQUIRED: type of condition type: mnru -- GitLab From fbf210a8bd7bed0dc55ff3cd8b1b237aaafa3c62 Mon Sep 17 00:00:00 2001 From: Treffehn Date: Wed, 3 May 2023 20:50:33 +0200 Subject: [PATCH 17/22] fixed small samplingrate bug --- ivas_processing_scripts/audiotools/convert/scenebased.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ivas_processing_scripts/audiotools/convert/scenebased.py b/ivas_processing_scripts/audiotools/convert/scenebased.py index b8295808..ab22713d 100755 --- a/ivas_processing_scripts/audiotools/convert/scenebased.py +++ b/ivas_processing_scripts/audiotools/convert/scenebased.py @@ -123,6 +123,7 @@ def render_sba_to_binaural( sba.fs = 48000 bin.audio = binaural_fftconv(sba.audio, IR, sba.num_channels) + bin.fs = 48000 # compensate delay from binaural dataset bin.audio = delay(bin.audio, bin.fs, -latency_smp, samples=True) -- GitLab From c394351bf6689203c0b129ab4b950fe55bb24a9a Mon Sep 17 00:00:00 2001 From: Treffehn Date: Thu, 4 May 2023 12:21:34 +0200 Subject: [PATCH 18/22] fixed ISM bug --- ivas_processing_scripts/processing/processing.py | 7 +++++-- tests/data/test_ISM.yml | 8 +++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ivas_processing_scripts/processing/processing.py b/ivas_processing_scripts/processing/processing.py index 3434f791..f22890e6 100755 --- a/ivas_processing_scripts/processing/processing.py +++ b/ivas_processing_scripts/processing/processing.py @@ -364,13 +364,16 @@ def process_item( out_dir_wav = True else: processing_paths.append(tmp_file.with_suffix(f".{p.name}{tmp_file.suffix}")) - try: + try: # TODO: clean up try except blocks out_format = p.out_fmt except AttributeError: # EVS has no attribute out_fmt out_format = p.in_fmt try: - bool_ism = out_format.startswith("ISM") + if p.name == "pre_2": + bool_ism = p.in_fmt.startswith("ISM") + else: + bool_ism = out_format.startswith("ISM") except Exception: bool_ism = out_format.name.startswith("ISM") diff --git a/tests/data/test_ISM.yml b/tests/data/test_ISM.yml index 5dd229a9..2e8c4a33 100644 --- a/tests/data/test_ISM.yml +++ b/tests/data/test_ISM.yml @@ -167,7 +167,7 @@ conditions_to_generate: # out_fc: 22500 c02: ### REQUIRED: type of condition - type: lp3k5 + type: lp7k c03: ### REQUIRED: type of condition type: mnru @@ -209,8 +209,10 @@ conditions_to_generate: ### Additional commandline options; default = null # opts: ["-q", "-no_delay_cmp"] ### Bitstream options - # tx: + tx: ### For possible arguments see overall bitstream modification + type: "FER" + error_rate: 3 ### IVAS condition ############################### c07: @@ -277,7 +279,7 @@ postprocessing: ### REQUIRED: Target sampling rate in Hz for resampling fs: 48000 ### Low-pass cut-off frequency in Hz; default = null (no filtering) - lp_cutoff: 24000 + lp_cutoff: 10000 ### Target loudness in LKFS; default = null (no loudness change applied) loudness: -26 ### Spatial audio format in which loudness is adjusted (only used if preprocessing loudness is not null); -- GitLab From 1bcae77adb52c6709fa36c468a2ae45dd1d146cb Mon Sep 17 00:00:00 2001 From: Treffehn Date: Fri, 5 May 2023 13:16:11 +0200 Subject: [PATCH 19/22] slight changes in ISM test and added resampling in mnru --- .../audiotools/wrappers/p50fbmnru.py | 24 +++++++++++-------- tests/data/test_ISM.yml | 12 +++++----- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/ivas_processing_scripts/audiotools/wrappers/p50fbmnru.py b/ivas_processing_scripts/audiotools/wrappers/p50fbmnru.py index 4bc6b046..a4389e9c 100755 --- a/ivas_processing_scripts/audiotools/wrappers/p50fbmnru.py +++ b/ivas_processing_scripts/audiotools/wrappers/p50fbmnru.py @@ -33,6 +33,7 @@ from pathlib import Path from tempfile import TemporaryDirectory from warnings import warn +from copy import copy import numpy as np @@ -72,14 +73,13 @@ def p50fbmnru( else: binary = find_binary("p50fbmnru") - if input.fs != 48000: - warn("P.50 Fullband MNRU requires a sampling rate of 48kHz.") - tmp_sig = resample_itu(input, 48000) - else: - tmp_sig = input.audio + tmp_audio_obj = copy(input) - tmp_input_signal = tmp_sig - tmp_output_signal = np.ones((48000, input.num_channels)) + # resample signal to 48kHz + if input.fs != 48000: + warn("P.50 Fullband MNRU requires a sampling rate of 48kHz. Resampling will be applied") + tmp_audio_obj.audio = resample_itu(tmp_audio_obj, 48000) + tmp_audio_obj.fs = 48000 with TemporaryDirectory() as tmp_dir: tmp_dir = Path(tmp_dir) @@ -99,12 +99,16 @@ def p50fbmnru( ] # write temporary file - write(tmp_input_file, tmp_input_signal) - write(tmp_output_file, tmp_output_signal) + write(tmp_input_file, tmp_audio_obj.audio) # run command run(cmd) - tmp_output_signal, out_fs = read(tmp_output_file, input.num_channels) + tmp_output_signal, _ = read(tmp_output_file, input.num_channels) + tmp_audio_obj.audio = tmp_output_signal + + # revert resampling + if input.fs != 48000: + tmp_output_signal = resample_itu(tmp_audio_obj, input.fs) return tmp_output_signal diff --git a/tests/data/test_ISM.yml b/tests/data/test_ISM.yml index 2e8c4a33..a91b5c6f 100644 --- a/tests/data/test_ISM.yml +++ b/tests/data/test_ISM.yml @@ -85,7 +85,7 @@ preprocessing: ### Flag for using noise (amplitude +-4) instead of silence for padding; default = false (silence) # pad_noise: true ### Value for application of delay (ms) (negative values advance); default = 0 - delay: 20 + # delay: 20 ### Length of window used at start/end of signal (ms); default = 0 # window: 100 @@ -124,23 +124,23 @@ preprocessing_2: ### can be given globally here or in individual conditions of type ivas or evs tx: ### REQUIRED: Type of bitstream processing; possible types: "JBM" or "FER" - type: "JBM" + type: "FER" ### JBM ### REQUIRED: either error_pattern or error_profile ### delay error profile file # error_pattern: ".../dly_error_profile.dat" ### Index of one of the existing delay error profile files to use (1-11) - error_profile: 5 + # error_profile: 5 ## nFramesPerPacket parameter for the network simulator; default = 1 - n_frames_per_packet: 2 + # n_frames_per_packet: 2 ### FER ### REQUIRED: either error_pattern or error_rate ### Frame error pattern file # error_pattern: "path/pattern.192" ### Error rate in percent - # error_rate: 5 + error_rate: 5 ### Additional seed to specify number of preruns; default = 0 # prerun_seed: 2 @@ -277,7 +277,7 @@ postprocessing: ### REQUIRED: Target format for output fmt: "BINAURAL" ### REQUIRED: Target sampling rate in Hz for resampling - fs: 48000 + fs: 32000 ### Low-pass cut-off frequency in Hz; default = null (no filtering) lp_cutoff: 10000 ### Target loudness in LKFS; default = null (no loudness change applied) -- GitLab From 1ab954644796b55bfb293dbad2f49eecebd0ce46 Mon Sep 17 00:00:00 2001 From: Treffehn Date: Fri, 5 May 2023 13:51:14 +0200 Subject: [PATCH 20/22] added attribute to testconfig class to avoid pytest confusion --- ivas_processing_scripts/processing/config.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ivas_processing_scripts/processing/config.py b/ivas_processing_scripts/processing/config.py index 386f542e..77ab4e63 100755 --- a/ivas_processing_scripts/processing/config.py +++ b/ivas_processing_scripts/processing/config.py @@ -64,6 +64,9 @@ def merge_dicts(base: dict, other: dict) -> None: class TestConfig: + # avoid confusion with pytest tests due to naming + __test__ = False + def __init__(self, filename: str): """Parse a YAML or JSON configuration file""" # init lists of conditions and associated dirs -- GitLab From 21c124f11424f0676a06a3ba2ffddc34986c507b Mon Sep 17 00:00:00 2001 From: Treffehn Date: Fri, 5 May 2023 15:24:50 +0200 Subject: [PATCH 21/22] formatting --- .../audiotools/wrappers/gen_patt.py | 2 +- .../audiotools/wrappers/p50fbmnru.py | 6 ++++-- .../processing/processing.py | 4 +++- tests/conftest.py | 2 +- tests/test_binaries_present.py | 15 +++++++++++++-- tests/test_processing.py | 19 ++++++++++++++----- 6 files changed, 36 insertions(+), 12 deletions(-) diff --git a/ivas_processing_scripts/audiotools/wrappers/gen_patt.py b/ivas_processing_scripts/audiotools/wrappers/gen_patt.py index f801b07b..d8737ef4 100644 --- a/ivas_processing_scripts/audiotools/wrappers/gen_patt.py +++ b/ivas_processing_scripts/audiotools/wrappers/gen_patt.py @@ -138,7 +138,7 @@ def create_error_pattern( gen_patt(100, "ep.g192", 5, working_dir=tmp_dir_test) if not tmp_sta_file_test.exists(): raise RuntimeError( - "Used version of gen-patt was detected to be faulty (unable to write \"sta\"-file). See bin/README.md for details." + 'Used version of gen-patt was detected to be faulty (unable to write "sta"-file). See bin/README.md for details.' ) with TemporaryDirectory() as tmp_dir: diff --git a/ivas_processing_scripts/audiotools/wrappers/p50fbmnru.py b/ivas_processing_scripts/audiotools/wrappers/p50fbmnru.py index a4389e9c..c31d0aae 100755 --- a/ivas_processing_scripts/audiotools/wrappers/p50fbmnru.py +++ b/ivas_processing_scripts/audiotools/wrappers/p50fbmnru.py @@ -30,10 +30,10 @@ # the United Nations Convention on Contracts on the International Sales of Goods. # +from copy import copy from pathlib import Path from tempfile import TemporaryDirectory from warnings import warn -from copy import copy import numpy as np @@ -77,7 +77,9 @@ def p50fbmnru( # resample signal to 48kHz if input.fs != 48000: - warn("P.50 Fullband MNRU requires a sampling rate of 48kHz. Resampling will be applied") + warn( + "P.50 Fullband MNRU requires a sampling rate of 48kHz. Resampling will be applied" + ) tmp_audio_obj.audio = resample_itu(tmp_audio_obj, 48000) tmp_audio_obj.fs = 48000 diff --git a/ivas_processing_scripts/processing/processing.py b/ivas_processing_scripts/processing/processing.py index f22890e6..6d82e779 100755 --- a/ivas_processing_scripts/processing/processing.py +++ b/ivas_processing_scripts/processing/processing.py @@ -241,7 +241,9 @@ def preprocess(cfg, logger): and cfg.preprocessing_2.get("concatenate_input", False) and cfg.preprocessing_2.get("concatenation_order", None) is not None ): - cfg.items_list = reorder_items_list(cfg.items_list, cfg.preprocessing_2["concatenation_order"]) + cfg.items_list = reorder_items_list( + cfg.items_list, cfg.preprocessing_2["concatenation_order"] + ) if cfg.metadata_path[0] is not None: for item_idx in range(len(cfg.metadata_path)): diff --git a/tests/conftest.py b/tests/conftest.py index 8c0b40ac..7b135743 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -30,7 +30,7 @@ from pathlib import Path import pytest -from .constants import OUTPUT_PATH_CUT, OUTPUT_PATH_REF, INPUT_PATH_CONCATENATION +from .constants import OUTPUT_PATH_CUT, OUTPUT_PATH_REF @pytest.fixture(scope="session", autouse=True) diff --git a/tests/test_binaries_present.py b/tests/test_binaries_present.py index b78ef46a..0ba0d4bb 100755 --- a/tests/test_binaries_present.py +++ b/tests/test_binaries_present.py @@ -31,11 +31,22 @@ # import pytest + from ivas_processing_scripts.utils import find_binary -BINARIES = ["bs1770demo", "p50fbmnru", "esdru", "eid-xor", "gen-patt", "filter", "random", "networkSimulator_g192", "masaRenderer"] +BINARIES = [ + "bs1770demo", + "p50fbmnru", + "esdru", + "eid-xor", + "gen-patt", + "filter", + "random", + "networkSimulator_g192", + "masaRenderer", +] @pytest.mark.parametrize("binary", BINARIES) def test_find_binary(binary): - assert(find_binary(binary, raise_error=False) is not None) + assert find_binary(binary, raise_error=False) is not None diff --git a/tests/test_processing.py b/tests/test_processing.py index d0c95cb2..edf9f031 100644 --- a/tests/test_processing.py +++ b/tests/test_processing.py @@ -30,13 +30,14 @@ # the United Nations Convention on Contracts on the International Sales of Goods. # -import pytest -from pathlib import Path import shutil +from pathlib import Path + +import pytest from ivas_processing_scripts import main as generate_test -from tests.constants import INPUT_CONFIG_FILES from ivas_processing_scripts.processing.config import TestConfig +from tests.constants import INPUT_CONFIG_FILES class Arguments: @@ -67,9 +68,17 @@ def test_generate_test_items(cfg): input_path.mkdir(exist_ok=True, parents=True) # copy items to folder -> pink noise and spectral test - pink_noise = Path(f"./tests/data/pinknoise/pink_noise_{num_channels}ch_48kHz.wav").resolve().absolute() + pink_noise = ( + Path(f"./tests/data/pinknoise/pink_noise_{num_channels}ch_48kHz.wav") + .resolve() + .absolute() + ) shutil.copy(pink_noise, input_path.joinpath(pink_noise.name)) - spectral = Path(f"./tests/data/spectral/spectral_test_{num_channels}ch_48kHz.wav").resolve().absolute() + spectral = ( + Path(f"./tests/data/spectral/spectral_test_{num_channels}ch_48kHz.wav") + .resolve() + .absolute() + ) shutil.copy(spectral, input_path.joinpath(spectral.name)) generate_test(args) -- GitLab From 50ccf621a6adc5f0084c0b4dbf811e248ba9e80f Mon Sep 17 00:00:00 2001 From: Treffehn Date: Fri, 5 May 2023 16:21:01 +0200 Subject: [PATCH 22/22] fixed small issues --- ivas_processing_scripts/audiotools/audiofile.py | 10 +++++----- ivas_processing_scripts/processing/processing.py | 5 ++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/ivas_processing_scripts/audiotools/audiofile.py b/ivas_processing_scripts/audiotools/audiofile.py index 954c91f8..7ec54789 100755 --- a/ivas_processing_scripts/audiotools/audiofile.py +++ b/ivas_processing_scripts/audiotools/audiofile.py @@ -157,7 +157,7 @@ def concat( pad_noise: Optional[bool] = False, preamble: Optional[int] = None, pad_noise_preamble: Optional[bool] = False, -) -> list: +) -> Tuple[list, int]: """ Horizontally concatenates audio files into one long file @@ -198,7 +198,7 @@ def concat( # pad with very low amplitude noise x = trim( - x, in_fs, (-silence_pre, -silence_post), samples=True, pad_noise=pad_noise + x, fs, (-silence_pre, -silence_post), samples=True, pad_noise=pad_noise ) # add the length to our splits list @@ -209,11 +209,11 @@ def concat( # add preamble if preamble: - y = trim(y, in_fs, (-preamble, 0), pad_noise_preamble) + y = trim(y, fs, (-preamble, 0), pad_noise_preamble) - write(out_file, y, fs=in_fs) + write(out_file, y, fs=fs) - return splits[1:] + return splits[1:], fs def split( diff --git a/ivas_processing_scripts/processing/processing.py b/ivas_processing_scripts/processing/processing.py index 6d82e779..05a608b0 100755 --- a/ivas_processing_scripts/processing/processing.py +++ b/ivas_processing_scripts/processing/processing.py @@ -130,7 +130,7 @@ def concat_setup(cfg: TestConfig, chain, logger: logging.Logger): tmp_audio = audio.fromtype(cfg_pre2.in_fmt) tmp_num_chans = tmp_audio.num_channels - cfg.splits = concat( + cfg.splits, fs = concat( cfg.items_list, cfg.concat_file, in_fs=cfg_pre2.in_fs, @@ -144,6 +144,9 @@ def concat_setup(cfg: TestConfig, chain, logger: logging.Logger): # set input to the concatenated file we have just written to the output dir cfg.items_list = [cfg.concat_file] + # save input sampling rate for splitting at the end + cfg.pre2.in_fs = fs + # write out splits with open(cfg.concat_file.with_suffix(".splits.log"), "w") as f: print(", ".join([str(s) for s in cfg.splits]), file=f) -- GitLab