From a3db971fbcd879d2b8f5cb0aa1aec08274393983 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Tue, 1 Jul 2025 16:25:44 +0200 Subject: [PATCH 1/3] add dly_error_profile_I1.dat --- .../dly_error_profiles/dly_error_profile_I1.dat | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 ivas_processing_scripts/dly_error_profiles/dly_error_profile_I1.dat diff --git a/ivas_processing_scripts/dly_error_profiles/dly_error_profile_I1.dat b/ivas_processing_scripts/dly_error_profiles/dly_error_profile_I1.dat new file mode 100644 index 00000000..ecf898b3 --- /dev/null +++ b/ivas_processing_scripts/dly_error_profiles/dly_error_profile_I1.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:854e83b31b5aa6f120e793336e8732281681fc242c86819496901a8c2a65558f +size 25512 -- GitLab From d8d8a3fbd26c382aba930a3d508f814e0a7b083b Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Wed, 2 Jul 2025 16:12:54 +0200 Subject: [PATCH 2/3] update link to patch for networkSimulator_g192 --- ivas_processing_scripts/bin/README.md | 33 +++++++++++++++------------ 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/ivas_processing_scripts/bin/README.md b/ivas_processing_scripts/bin/README.md index 494ed5ed..413de93a 100755 --- a/ivas_processing_scripts/bin/README.md +++ b/ivas_processing_scripts/bin/README.md @@ -1,17 +1,20 @@ - Necessary additional executables: -| Processing step | Executable | Where to find | -|-------------------------------------------------|-----------------------|-------------------------------------------------------------------------------------------------------------| -| Loudness measurement and adjustment | bs1770demo | https://github.com/ErikNorvell-Ericsson/STL (Note branch) | -| MNRU | p50fbmnru | https://github.com/openitu/STL | -| ESDRU | esdru | https://github.com/openitu/STL | -| Frame error pattern application | eid-xor | https://github.com/openitu/STL | -| Reverberation module | reverb | https://github.com/openitu/STL | -| Error pattern generation | gen-patt | https://www.itu.int/rec/T-REC-G.191-201003-S/en (Note: Version in https://github.com/openitu/STL is buggy!) | -| Filtering, Resampling | filter | https://www.3gpp.org/ftp/tsg_sa/WG4_CODEC/TSGS4_76/docs/S4-131277.zip | -| 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 | -| EVS JBM conditions | dlyerr_2_errpat | http://ftp.3gpp.org/tsg_sa/WG4_CODEC/TSGS4_70/Docs/S4-121077.zip | \ No newline at end of file +| Processing step | Executable | Where to find | +| ---------------------------------------------------------------- | --------------------- | ----------------------------------------------------------------------------------------------------------- | +| Loudness measurement and adjustment | bs1770demo | https://github.com/ErikNorvell-Ericsson/STL (Note branch) | +| MNRU | p50fbmnru | https://github.com/openitu/STL | +| ESDRU | esdru | https://github.com/openitu/STL | +| Frame error pattern application | eid-xor | https://github.com/openitu/STL | +| Reverberation module | reverb | https://github.com/openitu/STL | +| Error pattern generation | gen-patt | https://www.itu.int/rec/T-REC-G.191-201003-S/en (Note: Version in https://github.com/openitu/STL is buggy!) | +| Filtering, Resampling | filter | https://www.3gpp.org/ftp/tsg_sa/WG4_CODEC/TSGS4_76/docs/S4-131277.zip | +| Random offset/seed generation [^1] | random | https://www.3gpp.org/ftp/tsg_sa/WG4_CODEC/TSGS4_76/docs/S4-131277.zip | +| JBM network simulator [^2] | networkSimulator_g192 | https://www.3gpp.org/ftp/tsg_sa/WG4_CODEC/TSGS4_76/docs/S4-131277.zip | +| Patch to MAX_FRAME_SIZE for JBM network simulator from above | networkSimulator_g192 | https://www.3gpp.org/ftp/TSG_SA/WG4_CODEC/TSGS4_123-e/Docs/S4-230604.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 | +| EVS JBM conditions | dlyerr_2_errpat | http://ftp.3gpp.org/tsg_sa/WG4_CODEC/TSGS4_70/Docs/S4-121077.zip | + +[^1]: necessary for background noise and FER bitstream processing +[^2]: requires manual patching -- GitLab From 8f023818e1f28c8ae26fc7a8f380f920e5cbbe35 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Mon, 18 Aug 2025 13:57:59 +0200 Subject: [PATCH 3/3] add support for converting a delay error profile to an error pattern; add offset delay error profile --- examples/TEMPLATE.yml | 6 +-- .../audiotools/wrappers/dlyerr_2_errpat.py | 4 +- .../audiotools/wrappers/networkSimulator.py | 2 +- ...ile_I1.dat => dly_error_profile_I1.O1.dat} | 0 .../dly_error_profile_I1.O2.dat | 3 ++ ivas_processing_scripts/processing/ivas.py | 45 ++++++++++++++++--- ivas_processing_scripts/processing/tx.py | 2 +- 7 files changed, 48 insertions(+), 14 deletions(-) rename ivas_processing_scripts/dly_error_profiles/{dly_error_profile_I1.dat => dly_error_profile_I1.O1.dat} (100%) create mode 100644 ivas_processing_scripts/dly_error_profiles/dly_error_profile_I1.O2.dat diff --git a/examples/TEMPLATE.yml b/examples/TEMPLATE.yml index f3a39b0a..774edca1 100755 --- a/examples/TEMPLATE.yml +++ b/examples/TEMPLATE.yml @@ -147,11 +147,11 @@ input: ### 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: - ### REQUIRED: Type of bitstream processing; possible types: "JBM" or "FER" + ### REQUIRED: Type of bitstream processing; possible types: "JBM" or "FER" or "JBM2FER" # type: "JBM" - ### JBM - ### REQUIRED: either error_pattern (and errpatt_late_loss_rate or errpatt_delay) or error_profile + ### JBM or JBM2FER + ### REQUIRED: either error_pattern (and errpatt_late_loss_rate or errpatt_delay for EVS or JBM2FER ) or error_profile ### delay error profile file # error_pattern: ".../dly_error_profile.dat" ### Late loss rate in percent for EVS diff --git a/ivas_processing_scripts/audiotools/wrappers/dlyerr_2_errpat.py b/ivas_processing_scripts/audiotools/wrappers/dlyerr_2_errpat.py index 40889939..fe8e133c 100644 --- a/ivas_processing_scripts/audiotools/wrappers/dlyerr_2_errpat.py +++ b/ivas_processing_scripts/audiotools/wrappers/dlyerr_2_errpat.py @@ -170,7 +170,7 @@ def evs_jbm( shift = random_seed((0, len_pattern - 1), master_seed, errpatt_seed) elif error_profile is not None: - # if eror profile number is given + # if error profile number is given if error_profile == 1 or error_profile == 2 or error_profile == 3: delay = 200 num_frames_packet = 1 @@ -288,6 +288,6 @@ def validate_evs_jbm( ) if n_frames_per_packet is not None and n_frames_per_packet not in [1, 2]: raise ValueError( - f"n_frames_per_paket is {n_frames_per_packet}. Should be 1 or 2. Please check your configuration." + f"n_frames_per_packet is {n_frames_per_packet}. Should be 1 or 2. Please check your configuration." ) return diff --git a/ivas_processing_scripts/audiotools/wrappers/networkSimulator.py b/ivas_processing_scripts/audiotools/wrappers/networkSimulator.py index 615c846c..83556a92 100644 --- a/ivas_processing_scripts/audiotools/wrappers/networkSimulator.py +++ b/ivas_processing_scripts/audiotools/wrappers/networkSimulator.py @@ -90,7 +90,7 @@ def validate_network_simulator( ) if n_frames_per_packet is not None and n_frames_per_packet not in [1, 2]: raise ValueError( - f"n_frames_per_paket is {n_frames_per_packet}. Should be 1 or 2. Please check your configuration." + f"n_frames_per_packet is {n_frames_per_packet}. Should be 1 or 2. Please check your configuration." ) return diff --git a/ivas_processing_scripts/dly_error_profiles/dly_error_profile_I1.dat b/ivas_processing_scripts/dly_error_profiles/dly_error_profile_I1.O1.dat similarity index 100% rename from ivas_processing_scripts/dly_error_profiles/dly_error_profile_I1.dat rename to ivas_processing_scripts/dly_error_profiles/dly_error_profile_I1.O1.dat diff --git a/ivas_processing_scripts/dly_error_profiles/dly_error_profile_I1.O2.dat b/ivas_processing_scripts/dly_error_profiles/dly_error_profile_I1.O2.dat new file mode 100644 index 00000000..e7c11ad6 --- /dev/null +++ b/ivas_processing_scripts/dly_error_profiles/dly_error_profile_I1.O2.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8062f7f527088c256638baf3199e0aba7e4f5ca05e0ce6ee2c1cb61438f5b2a7 +size 25452 diff --git a/ivas_processing_scripts/processing/ivas.py b/ivas_processing_scripts/processing/ivas.py index 6a5f23d4..9008ceef 100755 --- a/ivas_processing_scripts/processing/ivas.py +++ b/ivas_processing_scripts/processing/ivas.py @@ -40,14 +40,18 @@ from ivas_processing_scripts.audiotools import audio from ivas_processing_scripts.audiotools.audiofile import parse_wave_header, read from ivas_processing_scripts.audiotools.constants import IVAS_FRAME_LEN_MS from ivas_processing_scripts.audiotools.utils import truncate_trajectory_3dof +from ivas_processing_scripts.audiotools.wrappers.dlyerr_2_errpat import dlyerr_2_errpat from ivas_processing_scripts.audiotools.wrappers.eid_xor import ( create_and_apply_error_pattern, + eid_xor, validate_error_pattern_application, ) from ivas_processing_scripts.audiotools.wrappers.networkSimulator import ( apply_network_simulator, + length_pattern, validate_network_simulator, ) +from ivas_processing_scripts.audiotools.wrappers.random_seed import random_seed from ivas_processing_scripts.processing.processing import Processing from ivas_processing_scripts.utils import run, use_wine @@ -232,9 +236,10 @@ class IVAS(Processing): logger: Optional[logging.Logger] = None, ) -> Tuple[Union[Path, str], bool]: if self.tx is not None: + bs, ext = os.path.splitext(bitstream) + bitstream_processed = Path(f"{bs}_processed{ext}") + voip = False if self.tx["type"] == "JBM": - bs, ext = os.path.splitext(bitstream) - bitstream_processed = Path(f"{bs}_processed{ext}") logger.debug(f"Network simulator {bitstream} -> {bitstream_processed}") apply_network_simulator( bitstream, @@ -247,11 +252,36 @@ class IVAS(Processing): logger=logger, ) voip = True - return bitstream_processed, voip + elif self.tx["type"] == "JBM2FER": + delay_profile = self.tx["error_pattern"] + len_pattern = length_pattern(delay_profile) + + if not self.tx.get("errpat_late_loss_rate") and not self.tx.get( + "delay" + ): + raise KeyError( + "Either errpat_late_loss_rate or errpat_delay must be specified for converting a delay error profile to an error profile!" + ) + + errpat = bitstream.with_name( + f"{bitstream.stem}_{delay_profile.stem}_to_err.192" + ) + shift = random_seed( + (0, len_pattern - 1), + self.tx["master_seed"], + self.tx.get("errpatt_seed", 0), + False, + ) + dlyerr_2_errpat( + delay_profile, + delay=self.tx.get("errpat_delay"), + fer_pattern=errpat, + late_loss_rate=self.tx.get("errpat_late_loss_rate"), + shift=shift, + ) + eid_xor(errpat, bitstream, bitstream_processed) elif self.tx["type"] == "FER": - bs, ext = os.path.splitext(bitstream) - bitstream_processed = Path(f"{bs}_processed{ext}") signal, _ = read( in_file, fs=self.in_fs, nchannels=self.in_fmt.num_channels ) @@ -273,8 +303,9 @@ class IVAS(Processing): master_seed=self.tx["master_seed"], prerun_seed=self.tx["prerun_seed"], ) - voip = False - return bitstream_processed, voip + + return bitstream_processed, voip + else: return bitstream, False diff --git a/ivas_processing_scripts/processing/tx.py b/ivas_processing_scripts/processing/tx.py index 3ec929cb..312b7e3e 100755 --- a/ivas_processing_scripts/processing/tx.py +++ b/ivas_processing_scripts/processing/tx.py @@ -55,7 +55,7 @@ def get_tx_cfg(cfg: TestConfig, cond_cfg: dict, is_EVS: bool = False) -> Optiona "master_seed": cfg.master_seed, "prerun_seed": cfg.prerun_seed, } - elif tx_cfg_tmp.get("type", None) == "JBM": + elif tx_cfg_tmp.get("type", None).startswith("JBM"): tx_cfg = { "type": tx_cfg_tmp.get("type"), "error_pattern": get_abs_path(tx_cfg_tmp.get("error_pattern", None)), -- GitLab