diff --git a/.gitignore b/.gitignore index 9427451343c0c8fc68ac908a7a11b57a58b48828..7855f81eeadf748ff2b38de86de256724be89df0 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/.gitlab-ci.yml b/.gitlab-ci.yml index a4cfa7c1b13e2919b545ebf846398db44bce5ae9..5c654af3366fa87cc1bd89b503cce57019cff757 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 + - python3 -m pytest tests/test_binaries_present.py + + # ------------------------------------ # functionality tests # ------------------------------------ diff --git a/README.md b/README.md index 76e717d5dcb373dc2ca1d9c9bbcf90559d945c9f..dbe7c1d1f600f1478d63b2dd07661e57c056ce30 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" fs: 48000 @@ -296,7 +296,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 ########################## @@ -389,13 +389,13 @@ conditions_to_generate: ### for multi-channel configs, code LFE with 9.6 kbps NB (as mandated by IVAS-3) evs_lfe_9k6bps_nb: true 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 ``` @@ -521,6 +521,7 @@ The following additional executables are needed for the different processing ste | Random offset/seed generation (necessary for background noise and FER bitstream processing) | 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 (also used in loudness measurement of MASA items) | 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 either placed in the [ivas_processing_scripts/bin](./ivas_processing_scripts/bin) folder or the path has to be specified in [ivas_processing_scripts/binary_paths.yml](./ivas_processing_scripts/binary_paths.yml). diff --git a/examples/TEMPLATE.yml b/examples/TEMPLATE.yml index f99384fcaf71989b7f7de567d8f343cf6f6fedd2..09881a3bc01b4977221423cb1f56f7dfe9a4f7fe 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 ########################## @@ -251,14 +251,14 @@ conditions_to_generate: evs_lfe_9k6bps_nb: true ### 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 + ### 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 ### Decoder options 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: EVS_dec ### Decoder output sampling rate; default = null (same as input) # fs: 48000 ### Bitstream options @@ -287,7 +287,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/ivas_processing_scripts/audiotools/audiofile.py b/ivas_processing_scripts/audiotools/audiofile.py index 954c91f8441a7a3fad3ae58794537af4a357742f..7ec547895611eca8d988b2e41e6247a4b843e219 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/audiotools/convert/channelbased.py b/ivas_processing_scripts/audiotools/convert/channelbased.py index 6bdd6b3378dfefc63cf9f17dafc94123094e3305..480d635e5019a9e0e2a496a3edeefc25285e13f3 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/audiotools/convert/scenebased.py b/ivas_processing_scripts/audiotools/convert/scenebased.py index b8295808b5046857c3a3bfd1c3dbe1bfe4bb13ec..ab22713d9fe733d0669f2e7c9371286bc538246c 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) diff --git a/ivas_processing_scripts/audiotools/wrappers/p50fbmnru.py b/ivas_processing_scripts/audiotools/wrappers/p50fbmnru.py index 4bc6b04676035d991b4ac39e4ac91c8cf968eab0..c31d0aae1219d654663b00659b9e8658e462eab4 100755 --- a/ivas_processing_scripts/audiotools/wrappers/p50fbmnru.py +++ b/ivas_processing_scripts/audiotools/wrappers/p50fbmnru.py @@ -30,6 +30,7 @@ # 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 @@ -72,14 +73,15 @@ 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 +101,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/ivas_processing_scripts/bin/README.txt b/ivas_processing_scripts/bin/README.md similarity index 92% rename from ivas_processing_scripts/bin/README.txt rename to ivas_processing_scripts/bin/README.md index 1951905713b89b63fc18f66d91862b1b93fc50f0..99b1f15feede2b770aea27866cc4eee765f6cf06 100755 --- a/ivas_processing_scripts/bin/README.txt +++ b/ivas_processing_scripts/bin/README.md @@ -12,3 +12,4 @@ Necessary additional executables: | Random offset/seed generation (necessary for background noise and FER bitstream processing) | 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 (also used in loudness measurement of MASA items) | 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 | diff --git a/ivas_processing_scripts/constants.py b/ivas_processing_scripts/constants.py index fbadd5238c567fa4b82294dffa3f1e40ce137fe1..f89e8589057c4024bc3ebfaa7ea7bddfa1090689 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 = { diff --git a/ivas_processing_scripts/processing/config.py b/ivas_processing_scripts/processing/config.py index 386f542e5448fc115e4e30b332e1ca01064f0295..77ab4e6392cfb598cd7caea0f343af4bc7cb79f9 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 diff --git a/ivas_processing_scripts/processing/processing.py b/ivas_processing_scripts/processing/processing.py index 0c1c72c0aca58c13d1660d15491e91954c726703..4b9d73f7b7fe55d9eaecf13486eac39f840e4fc0 100755 --- a/ivas_processing_scripts/processing/processing.py +++ b/ivas_processing_scripts/processing/processing.py @@ -130,10 +130,10 @@ 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.input.get("fs", 48000), + in_fs=cfg_pre2.in_fs, num_channels=tmp_num_chans, ) @@ -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) @@ -164,6 +167,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 +244,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.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 +291,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/ivas_processing_scripts/utils.py b/ivas_processing_scripts/utils.py index 916db8a4fec5999b137dadf136aa2e6b7e177b55..a858a6c054677bcef026cbb87707736d305872de 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/constants.py b/tests/constants.py index 11c48dc2c6dbbaaf03d06abe5f05a5eb55106e09..56a531a40095c8016b8bff690a54adf422c0c6c5 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/test_ISM.yml b/tests/data/test_ISM.yml index 8543d18031bf35f92f8f99028356ec8d3386a257..7122ab4e7a7c48c1ee8c31fa331f755ed0c51f04 100644 --- a/tests/data/test_ISM.yml +++ b/tests/data/test_ISM.yml @@ -14,32 +14,37 @@ ### 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" +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) 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: + 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" ### Select only a subset of items @@ -47,13 +52,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,7 +62,7 @@ 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 @@ -74,54 +72,94 @@ preprocessing: ### Define mask (HP50 or 20KBP) for input signal filtering; default = null # mask: "HP50" ### 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 ### 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: "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 + ## 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 @@ -129,19 +167,29 @@ conditions_to_generate: # out_fc: 22500 c02: ### REQUIRED: type of condition - type: lp3k5 - ### optional low-pass cut-off frequency in Hz; default = null - # out_fc: 22500 + type: lp7k + 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) @@ -155,22 +203,27 @@ 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 + type: "FER" + error_rate: 3 ### 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) @@ -178,36 +231,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 @@ -217,21 +276,21 @@ conditions_to_generate: postprocessing: ### REQUIRED: Target format for output fmt: "BINAURAL" - ### Target sampling rate in Hz for resampling; default = null (no resampling) - fs: 48000 + ### REQUIRED: Target sampling rate in Hz for resampling + fs: 32000 ### 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 + 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 414c2cdf5a65f6db621595330e1e74b1b5e6558b..9e2c748e0eae3fc9b2478b568639283ab70cb9b2 100644 --- a/tests/data/test_MC.yml +++ b/tests/data/test_MC.yml @@ -14,43 +14,39 @@ ### 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" +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) # 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,7 +57,7 @@ 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 @@ -69,56 +65,96 @@ preprocessing: ### Target format used in rendering from input format; default = null (no rendering) fmt: "7_1_4" ### Define mask (HP50 or 20KBP) for input signal filtering; default = null - # mask: "HP50" + mask: "HP50" ### 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); ### 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: ["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) + 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 @@ -126,21 +162,33 @@ conditions_to_generate: # out_fc: 22500 c02: ### REQUIRED: type of condition - type: lp3k5 + type: lp7k + 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,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 @@ -212,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 2fc2adfe6b46f78ec589b9b8b2b86e422f16415c..aa20a5fdc520fd5002fa6d2ae53ed1195c2046bd 100644 --- a/tests/data/test_SBA.yml +++ b/tests/data/test_SBA.yml @@ -14,54 +14,50 @@ ### 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" +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) # 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 @@ -71,54 +67,94 @@ preprocessing: ### Define mask (HP50 or 20KBP) for input signal filtering; default = null mask: "HP50" ### 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" diff --git a/tests/test_binaries_present.py b/tests/test_binaries_present.py new file mode 100755 index 0000000000000000000000000000000000000000..0ba0d4bb8a82584be68b7a58ec989ccf09e5d4d1 --- /dev/null +++ b/tests/test_binaries_present.py @@ -0,0 +1,52 @@ +#!/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 diff --git a/tests/test_processing.py b/tests/test_processing.py index b0576bc0784ccf9baafc507b9f608839d06b483b..edf9f031c8279ff89afd66f9c92d30a8da0cef02 100644 --- a/tests/test_processing.py +++ b/tests/test_processing.py @@ -30,9 +30,13 @@ # the United Nations Convention on Contracts on the International Sales of Goods. # +import shutil +from pathlib import Path + import pytest from ivas_processing_scripts import main as generate_test +from ivas_processing_scripts.processing.config import TestConfig from tests.constants import INPUT_CONFIG_FILES @@ -46,4 +50,35 @@ class Arguments: def test_generate_test_items(cfg): args = Arguments(cfg) + # read out input path + config = TestConfig(cfg) + input_path = Path(config.input_path).resolve().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"./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() + ) + shutil.copy(spectral, input_path.joinpath(spectral.name)) + generate_test(args)