diff --git a/examples/TEMPLATE.yml b/examples/TEMPLATE.yml index 8c5fdd8e9e0df61640a48cb16147c03ff3accd21..e34d627c4f017c809c1c565ee011e2340e9ce648 100755 --- a/examples/TEMPLATE.yml +++ b/examples/TEMPLATE.yml @@ -201,6 +201,9 @@ conditions_to_generate: # fs: 48000 ### Additional commandline options; default = null # opts: ["-q", "-no_delay_cmp"] + ### Bitstream options + # tx: + ### For possible arguments see overall bitstream modification ### IVAS condition ############################### c07: @@ -228,6 +231,9 @@ conditions_to_generate: # fs: 48000 ### Additional commandline options; default = null # opts: ["-q", "-no_delay_cmp"] + ### Bitstream options + # tx: + ### For possible arguments see overall bitstream modification ### EVS condition ################################ c08: @@ -249,6 +255,9 @@ conditions_to_generate: bin: ~/git/ivas-codec/IVAS_dec ### Decoder output sampling rate; default = null (same as input) # fs: 48000 + ### Bitstream options + # tx: + ### For possible arguments see overall bitstream modification ################################################ ### Post-processing diff --git a/ivas_processing_scripts/processing/chains.py b/ivas_processing_scripts/processing/chains.py index f830a18b15f55508bf5d49b1f082b29b1cc92855..db5df6ab7d00a9b285d3d896bcdceee661d354fb 100755 --- a/ivas_processing_scripts/processing/chains.py +++ b/ivas_processing_scripts/processing/chains.py @@ -239,23 +239,27 @@ def get_processing_chain( dec_cfg = cond_cfg["dec"] # Frame error pattern bitstream modification - if "tx" in cond_cfg.keys(): - tx_cfg = cond_cfg["tx"] - elif hasattr(cfg, "tx"): - if cfg.tx.get("type", None) == "FER": + if "tx" in cond_cfg.keys() or hasattr(cfg, "tx"): + # local specification overwrites global one + if "tx" in cond_cfg.keys(): + tx_cfg_tmp = cond_cfg["tx"] + else: + tx_cfg_tmp = cfg.tx + + if tx_cfg_tmp.get("type", None) == "FER": tx_cfg = { - "type": cfg.tx.get("type", None), - "error_pattern": cfg.tx.get("error_pattern", None), - "error_rate": cfg.tx.get("error_rate", None), + "type": tx_cfg_tmp.get("type", None), + "error_pattern": tx_cfg_tmp.get("error_pattern", None), + "error_rate": tx_cfg_tmp.get("error_rate", None), "master_seed": cfg.master_seed, - "prerun_seed": cfg.tx.get("prerun_seed", 0), + "prerun_seed": tx_cfg_tmp.get("prerun_seed", 0), } - elif cfg.tx.get("type", None) == "JBM": + elif tx_cfg_tmp.get("type", None) == "JBM": tx_cfg = { - "type": cfg.tx.get("type", None), - "error_pattern": cfg.tx.get("error_pattern", None), - "error_profile": cfg.tx.get("error_profile", None), - "n_frames_per_packet": cfg.tx.get("n_frames_per_packet", 1), + "type": tx_cfg_tmp.get("type", None), + "error_pattern": tx_cfg_tmp.get("error_pattern", None), + "error_profile": tx_cfg_tmp.get("error_profile", None), + "n_frames_per_packet": tx_cfg_tmp.get("n_frames_per_packet", None), } else: raise ValueError( @@ -294,23 +298,27 @@ def get_processing_chain( dec_cfg = cond_cfg["dec"] # Frame error pattern bitstream modification - if "tx" in cond_cfg.keys(): - tx_cfg = cond_cfg["tx"] - elif hasattr(cfg, "tx"): - if cfg.tx.get("type", None) == "FER": + if "tx" in cond_cfg.keys() or hasattr(cfg, "tx"): + # local specification overwrites global one + if "tx" in cond_cfg.keys(): + tx_cfg_tmp = cond_cfg["tx"] + else: + tx_cfg_tmp = cfg.tx + + if tx_cfg_tmp.get("type", None) == "FER": tx_cfg = { - "type": cfg.tx.get("type", None), - "error_pattern": cfg.tx.get("error_pattern", None), - "error_rate": cfg.tx.get("error_rate", None), + "type": tx_cfg_tmp.get("type", None), + "error_pattern": tx_cfg_tmp.get("error_pattern", None), + "error_rate": tx_cfg_tmp.get("error_rate", None), "master_seed": cfg.master_seed, - "prerun_seed": cfg.tx.get("prerun_seed", 0), + "prerun_seed": tx_cfg_tmp.get("prerun_seed", 0), } - elif cfg.tx.get("type", None) == "JBM": + elif tx_cfg_tmp.get("type", None) == "JBM": tx_cfg = { - "type": cfg.tx.get("type", None), - "error_pattern": cfg.tx.get("error_pattern", None), - "error_profile": cfg.tx.get("error_profile", None), - "n_frames_per_packet": cfg.tx.get("n_frames_per_packet", None), + "type": tx_cfg_tmp.get("type", None), + "error_pattern": tx_cfg_tmp.get("error_pattern", None), + "error_profile": tx_cfg_tmp.get("error_profile", None), + "n_frames_per_packet": tx_cfg_tmp.get("n_frames_per_packet", None), } else: raise ValueError(