Commit 3e35a332 authored by Anika Treffehn's avatar Anika Treffehn
Browse files

Merge branch '25-sba-no-way-to-limit-the-ivas-encoder-to-limited-format-e-g-hoa3-foa' into 'main'

Resolve "SBA: No way to limit the IVAS encoder to limited format (e.g. HOA3 -> FOA)"

See merge request !66
parents ba610ea6 5c952d0c
Loading
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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`.
+4 −0
Original line number Diff line number Diff line
@@ -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:
+1 −0
Original line number Diff line number Diff line
@@ -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)
    elif sba_in.is_planar:
        sba_out.audio = sba_in.audio
+16 −1
Original line number Diff line number Diff line
@@ -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)

+5 −2
Original line number Diff line number Diff line
@@ -38,8 +38,11 @@ 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)
        if name:
            self.name = name
        else:
            self.name = "post"

    def process(self, in_file: Path, out_file: Path, in_meta, logger: logging.Logger):