From db5018f00d42559ed3c02d9cfec28103a2718c0c Mon Sep 17 00:00:00 2001 From: Treffehn Date: Fri, 19 May 2023 15:54:28 +0200 Subject: [PATCH 1/2] added sba format conversion step in IVAS --- .../audiotools/convert/scenebased.py | 1 + ivas_processing_scripts/processing/chains.py | 17 ++++++++++++++++- .../processing/postprocessing.py | 7 +++++-- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/ivas_processing_scripts/audiotools/convert/scenebased.py b/ivas_processing_scripts/audiotools/convert/scenebased.py index ab22713d..fa7729fb 100755 --- a/ivas_processing_scripts/audiotools/convert/scenebased.py +++ b/ivas_processing_scripts/audiotools/convert/scenebased.py @@ -174,6 +174,7 @@ def render_sba_to_sba( sba_out.audio = sba_in.audio[:, : sba_out.num_channels] if sba_out.is_planar: + sba_out.audio = sba_in.audio zero_vert_channels(sba_out) diff --git a/ivas_processing_scripts/processing/chains.py b/ivas_processing_scripts/processing/chains.py index 5c35dc3a..c11be9a1 100755 --- a/ivas_processing_scripts/processing/chains.py +++ b/ivas_processing_scripts/processing/chains.py @@ -255,7 +255,8 @@ def get_processing_chain( "multiprocessing": cfg.multiprocessing, "mnru_q": tmp_mnru_q, "esdru_alpha": tmp_esdru_alpha, - } + }, + name="mono_dmx", ) ) tmp_in_fmt = "MONO" @@ -333,6 +334,20 @@ def get_processing_chain( cod_cfg = cond_cfg["cod"] dec_cfg = cond_cfg["dec"] + if cond_cfg.get("sba_fmt"): + chain["processes"].append( + Postprocessing( + { + "in_fs": tmp_in_fs, + "in_fmt": tmp_in_fmt, + "out_fs": tmp_in_fs, + "out_fmt": cond_cfg.get("sba_fmt"), + }, + name="sba_fmt_rend", + ) + ) + tmp_in_fmt = cond_cfg.get("sba_fmt") + # 9.6 kbit/s NB for EVS LFE coding only applies to EVS conditions evs_lfe_9k6bps_nb = cond_cfg.get("evs_lfe_9k6bps_nb", None) diff --git a/ivas_processing_scripts/processing/postprocessing.py b/ivas_processing_scripts/processing/postprocessing.py index a8287f65..1d2f2240 100755 --- a/ivas_processing_scripts/processing/postprocessing.py +++ b/ivas_processing_scripts/processing/postprocessing.py @@ -38,9 +38,12 @@ from ivas_processing_scripts.processing.processing import Processing class Postprocessing(Processing): - def __init__(self, attrs: dict): + def __init__(self, attrs: dict, name=None): super().__init__(attrs) - self.name = "post" + if name: + self.name = name + else: + self.name = "post" def process(self, in_file: Path, out_file: Path, in_meta, logger: logging.Logger): logger.debug(f"Postprocessing configuration : {self.__dict__}") -- GitLab From 5c952d0cb1de6ddf296d4352508b435bb18ffd81 Mon Sep 17 00:00:00 2001 From: Treffehn Date: Fri, 19 May 2023 15:59:35 +0200 Subject: [PATCH 2/2] added info in template and readme --- README.md | 6 +++++- examples/TEMPLATE.yml | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4707e1d1..b0a09124 100755 --- a/README.md +++ b/README.md @@ -356,6 +356,8 @@ conditions_to_generate: # fs: 48000 ### Additional commandline options; default = null # opts: ["-q", "-no_delay_cmp"] + ### Option to use SBA format of lower or same order (planar also possible) for SBA input formats + # sba_fmt: "PLANARFOA" ### IVAS condition ############################### c07: @@ -383,6 +385,8 @@ conditions_to_generate: # fs: 48000 ### Additional commandline options; default = null # opts: ["-q", "-no_delay_cmp"] + ### Option to use SBA format of lower or same order (planar also possible) for SBA input formats + # sba_fmt: "PLANARFOA" ### EVS condition ################################ c08: @@ -480,8 +484,8 @@ This configuration has to match the channel configuration. If the provided list For the encoding stage `cod` and the decoding stage `dec`, the path to the IVAS_cod and IVAS_dec binaries can be specified under the key `bin`. Additionally some resampling can be applied by using the key `fs` followed by the desired sampling rate. The general bitstream processing configuration can be locally overwritten for each EVS and IVAS condition with the key `tx`. +For IVAS and EVS conditions the `sba_fmt` key is available to specify a SBA format of lower or same order compared to the input for SBA input formats. The additional key `evs_lfe_9k6bps_nb` is only available for EVS conditions and ensures a bitrate of 9.6kbps and narrow band processing of the LFE channel(s). -Also only available for EVS conditions is the `sba_fmt` key where a SBA format of lower order than the input can be specified for SBA input formats. #### IVAS The configuration of the IVAS condition is similar to the EVS condition. However, only one bitrate for all channels (and metadata) can be specified. In addition to that, the encoder and decoder take some additional arguments defined by the key `opts`. diff --git a/examples/TEMPLATE.yml b/examples/TEMPLATE.yml index 382825bc..a5039d4d 100755 --- a/examples/TEMPLATE.yml +++ b/examples/TEMPLATE.yml @@ -211,6 +211,8 @@ conditions_to_generate: ### Bitstream options # tx: ### For possible arguments see overall bitstream modification + ### Option to use SBA format of lower or same order (planar also possible) for SBA input formats + # sba_fmt: "PLANARFOA" ### IVAS condition ############################### c07: @@ -241,6 +243,8 @@ conditions_to_generate: ### Bitstream options # tx: ### For possible arguments see overall bitstream modification + ### Option to use SBA format of lower or same order (planar also possible) for SBA input formats + # sba_fmt: "PLANARFOA" ### EVS condition ################################ c08: -- GitLab