Commit 3098d14d authored by Anika Treffehn's avatar Anika Treffehn
Browse files

added processing for ivas rend and comments in readme and yml file

parent a61ac998
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -554,6 +554,11 @@ The configuration of the IVAS condition is similar to the EVS condition. However
In addition to that, the encoder and decoder take some additional arguments defined by the key `opts`.
For the decoder an output format can be set. If this argument is not defined the format specified in postprocessing is used.

### IVAS External Renderer

The key `ivas_rend` can be added in each condition to apply the IVAS_rend external renderer after the condition (e.g. after encoding and decoding for `ivas`) but previous to the 
postprocessing.

---

## Supported audio formats
+16 −0
Original line number Diff line number Diff line
@@ -175,6 +175,14 @@ conditions_to_generate:
      type: ref
      ### optional low-pass cut-off frequency in Hz; default = null
      # out_fc: 22500
      ### optional use of IVAS_rend (can be used in all conditions)
      # ivas_rend:
        ### Path to renderer binary; default search for IVAS_rend in bin folder (primary) and PATH (secondary)
        # bin: ~/git/ivas-codec/IVAS_rend
        ### Additional commandline options; default = null
        # opts: []
        ### Renderer output format; default = postprocessing fmt
        # fmt: "BINAURAL"
  c02:
      ### REQUIRED: type of condition
      type: lp3k5
@@ -218,6 +226,14 @@ conditions_to_generate:
          # fs: 48000
          ### Additional commandline options; default = null
          # opts: ["-q", "-no_delay_cmp"]
      ### optional use of IVAS_rend (can be used in all conditions)
      # ivas_rend:
        ### Path to renderer binary; default search for IVAS_rend in bin folder (primary) and PATH (secondary)
        # bin: ~/git/ivas-codec/IVAS_rend
        ### Additional commandline options; default = null
        # opts: []
        ### Renderer output format; default = postprocessing fmt
        # fmt: "BINAURAL"
      ### Bitstream options
      # tx:
          ### For possible arguments see overall bitstream modification
+3 −1
Original line number Diff line number Diff line
@@ -462,10 +462,12 @@ def get_processing_chain(
                    "bin": get_abs_path(rend_cfg.get("bin", None)),
                    "opts": rend_cfg.get("opts"),
                    "use_windows_codec_binaries": cfg.use_windows_codec_binaries,
                    # TODO: multiprocessing, tx, preamble, tx_condition keys necessary?
                }
            )
        )
        # update values to reflect renderer output
        tmp_in_fs = rend_cfg.get("fs", tmp_in_fs)
        tmp_in_fmt = rend_cfg.get("fmt", tmp_out_fmt)

    # add postprocessing step based on condition
    post_fmt = post_cfg.get("fmt")
+20 −29
Original line number Diff line number Diff line
@@ -110,9 +110,8 @@ class IVAS(Processing):
        # set defaults in case input and output sampling rates were not specified
        if not self.in_fs:
            if in_file.suffix in [".pcm", ".raw"]:
                self.in_fs = 48000
                raise ValueError("Sampling rate has to be specified for headerless files!")
            elif in_file.suffix == ".txt":
                # TODO
                raise NotImplementedError(".txt file support is WIP!")
            else:
                self.in_fs = parse_wave_header(in_file)["fs"]
@@ -393,46 +392,38 @@ class IVAS_rend(Processing):
        in_meta,
        logger: Optional[logging.Logger] = None,
    ) -> None:
        # set defaults in case input and output sampling rates were not specified
        logger.debug(f"IVAS rend configuration : {self.__dict__}")
        logger.debug(f"IVAS rend {in_file.absolute()} -> {out_file.absolute()}")

        # set defaults in case input sampling rate is not specified
        if not self.in_fs:
            if in_file.suffix in [".pcm", ".raw"]:
                self.in_fs = 48000
                raise ValueError("Sampling rate has to be specified for headerless files!")
            elif in_file.suffix == ".txt":
                # TODO
                raise NotImplementedError(".txt file support is WIP!")
            else:
                self.in_fs = parse_wave_header(in_file)["fs"]

        if not self.out_fs:
            self.out_fs = self.in_fs

        raise NotImplementedError("IVAS Renderer support is WIP!")
                self.in_fs = parse_wave_header(str(in_file))["fs"]

        cmd = [self.bin]

        if self.fs:
            cmd.extend(["-fs", str(self.fs // 1000)])

        if self.metadata:
            cmd.append("-im")
            cmd.extend([str(f) for f in self.metadata])

        if self.trajectory:
            cmd.extend(["-tf", str(self.trajectory)])
        if self._use_wine:
            cmd.insert(0, "wine")

        cmd.extend(
            [
                "-q",
                "-i",
                str(in_file),
                "-if",
                str(self.in_fmt.name),
                "-o",
                str(out_file),
                "-of",
                str(self.out_fmt.name),
                "-fs", str(self.in_fs // 1000),
                "-i", str(in_file),
                "-if", self.in_fmt.name,
                "-o", str(out_file),
                "-of", self.out_fmt.name,
            ]
        )

        if in_meta:
            cmd.append("-im")
            cmd.extend([str(f) for f in in_meta])

        if self.opts:
            cmd.extend(self.opts)

        run(cmd, logger=logger)