Loading ivas_processing_scripts/processing/chains.py +22 −5 Original line number Diff line number Diff line Loading @@ -58,7 +58,10 @@ def init_processing_chains(cfg: TestConfig) -> None: # TODO we may need to change this to ensure it is only one value for IVAS and a possible list for EVS # condition naming will also need to be checked since we rename to {cond_name}_{bitrate} # this may not be desired if len(bitrates) > 1: multiple_bitrates_flag = True else: multiple_bitrates_flag = False if bitrates: for bitrate in bitrates: # check if a list was specified Loading @@ -66,14 +69,24 @@ def init_processing_chains(cfg: TestConfig) -> None: # flatten the list of lists for IVAS [ cfg.proc_chains.append( get_processing_chain(cond_name, cond_cfg, extend_br) get_processing_chain( cond_name, cond_cfg, extend_br, multiple_bitrates=multiple_bitrates_flag, ) ) for extend_br in bitrate ] else: # otherwise pass the list; EVS will interpret as per-channel bitrate cfg.proc_chains.append( get_processing_chain(cond_name, cfg, bitrate) get_processing_chain( cond_name, cfg, bitrate, multiple_bitrates=multiple_bitrates_flag, ) ) else: # non coding condition Loading Loading @@ -174,7 +187,10 @@ def get_preprocessing_2(cfg: TestConfig) -> dict: def get_processing_chain( condition: str, cfg: TestConfig, bitrate: Optional[int] = None condition: str, cfg: TestConfig, bitrate: Optional[int] = None, multiple_bitrates: Optional[bool] = False, ) -> dict: """Mapping from test configuration to condition and postprocessing keyword arguments""" name = f"{condition}" Loading @@ -183,6 +199,7 @@ def get_processing_chain( if isinstance(bitrate, list): name += f"_{sum(bitrate)}" else: if multiple_bitrates is True: name += f"_{bitrate}" chain = { Loading ivas_processing_scripts/processing/config.py +7 −2 Original line number Diff line number Diff line Loading @@ -141,8 +141,13 @@ class TestConfig: # validate preprocessing on concatenated file stage if (pre_proc_2 := getattr(cfg, "preprocessing_2", None)) is not None: bg_noise_folder = Path(pre_proc_2["background_noise_path"]).parent if bg_noise_folder.resolve().absolute() == cfg.input_path.resolve().absolute(): raise ValueError(f"Background noise file has to be placed outside the input folder!") if ( bg_noise_folder.resolve().absolute() == cfg.input_path.resolve().absolute() ): raise ValueError( f"Background noise file has to be placed outside the input folder!" ) for cond_name, cond_cfg in cfg.get("conditions_to_generate").items(): type = cond_cfg.get("type") Loading Loading
ivas_processing_scripts/processing/chains.py +22 −5 Original line number Diff line number Diff line Loading @@ -58,7 +58,10 @@ def init_processing_chains(cfg: TestConfig) -> None: # TODO we may need to change this to ensure it is only one value for IVAS and a possible list for EVS # condition naming will also need to be checked since we rename to {cond_name}_{bitrate} # this may not be desired if len(bitrates) > 1: multiple_bitrates_flag = True else: multiple_bitrates_flag = False if bitrates: for bitrate in bitrates: # check if a list was specified Loading @@ -66,14 +69,24 @@ def init_processing_chains(cfg: TestConfig) -> None: # flatten the list of lists for IVAS [ cfg.proc_chains.append( get_processing_chain(cond_name, cond_cfg, extend_br) get_processing_chain( cond_name, cond_cfg, extend_br, multiple_bitrates=multiple_bitrates_flag, ) ) for extend_br in bitrate ] else: # otherwise pass the list; EVS will interpret as per-channel bitrate cfg.proc_chains.append( get_processing_chain(cond_name, cfg, bitrate) get_processing_chain( cond_name, cfg, bitrate, multiple_bitrates=multiple_bitrates_flag, ) ) else: # non coding condition Loading Loading @@ -174,7 +187,10 @@ def get_preprocessing_2(cfg: TestConfig) -> dict: def get_processing_chain( condition: str, cfg: TestConfig, bitrate: Optional[int] = None condition: str, cfg: TestConfig, bitrate: Optional[int] = None, multiple_bitrates: Optional[bool] = False, ) -> dict: """Mapping from test configuration to condition and postprocessing keyword arguments""" name = f"{condition}" Loading @@ -183,6 +199,7 @@ def get_processing_chain( if isinstance(bitrate, list): name += f"_{sum(bitrate)}" else: if multiple_bitrates is True: name += f"_{bitrate}" chain = { Loading
ivas_processing_scripts/processing/config.py +7 −2 Original line number Diff line number Diff line Loading @@ -141,8 +141,13 @@ class TestConfig: # validate preprocessing on concatenated file stage if (pre_proc_2 := getattr(cfg, "preprocessing_2", None)) is not None: bg_noise_folder = Path(pre_proc_2["background_noise_path"]).parent if bg_noise_folder.resolve().absolute() == cfg.input_path.resolve().absolute(): raise ValueError(f"Background noise file has to be placed outside the input folder!") if ( bg_noise_folder.resolve().absolute() == cfg.input_path.resolve().absolute() ): raise ValueError( f"Background noise file has to be placed outside the input folder!" ) for cond_name, cond_cfg in cfg.get("conditions_to_generate").items(): type = cond_cfg.get("type") Loading