Commit 8e647446 authored by Anika Treffehn's avatar Anika Treffehn
Browse files

fixed bugs and removed jbm from tests

parent 0ac38003
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ experiments/selection/*/proc_input/*.wav
experiments/selection/*/proc_input/*.pcm
experiments/selection/*/proc_output/
*~
tests/tmp_output_*
tests/temp_output_*
tests/cut
tests/ref
tests/concatenation_folder
 No newline at end of file
+2 −1
Original line number Diff line number Diff line
@@ -25,7 +25,8 @@
### Any relative paths will be interpreted relative to the working directory the script is called from!
### Usage of absolute paths is recommended.
### Do not use file names with dots "." in them! This is not supported, use "_" instead
### For Windows user: please use double back slash '\\' in paths and add '.exe' to executable definitions
### Do not use "tmp_" in file or folder names ("temp_" is fine)
### For Windows user: please use double back slash '\\' in paths
### REQUIRED: Input path or file
input_path: ".../ivas/items/HOA3"
### REQUIRED: Output path or file
+2 −0
Original line number Diff line number Diff line
@@ -245,6 +245,7 @@ def get_processing_chain(
                    "in_fmt": tmp_in_fmt,
                    "out_fmt": "MONO",
                    "multiprocessing": cfg.multiprocessing,
                    "tx_condition": False,
                },
                name="mono_dmx",
            )
@@ -338,6 +339,7 @@ def get_processing_chain(
                        "in_fmt": tmp_in_fmt,
                        "out_fs": tmp_in_fs,
                        "out_fmt": cond_cfg.get("sba_fmt"),
                        "tx_condition": False,
                    },
                    name="sba_fmt_rend",
                )
+2 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ import platform
from itertools import repeat
from pathlib import Path
from shutil import copyfile
from typing import Optional, Union
from typing import Optional, Union, Tuple

from ivas_processing_scripts.audiotools import audio
from ivas_processing_scripts.audiotools.audiofile import (
@@ -234,6 +234,7 @@ class EVS(Processing):
        )

        # run all decoders twice with and without bitstream errors
        # TODO: voip mode only for processed bitstreams for jbm
        logger.debug(f"Running EVS decoders for {out_file.stem.split('.')[0]}")
        apply_func_parallel(
            self.dec,
+14 −18
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ import logging
import os.path
import platform
from pathlib import Path
from typing import Optional, Union
from typing import Optional, Union, Tuple

from ivas_processing_scripts.audiotools import audio
from ivas_processing_scripts.audiotools.audiofile import parse_wave_header, read
@@ -127,13 +127,13 @@ class IVAS(Processing):

        # apply bitstream processing and save unprocessed bitstream
        bitstream_noerror = bitstream
        bitstream = self.simulate_tx(in_file, bitstream, logger)
        bitstream, voip = self.simulate_tx(in_file, bitstream, logger)

        # decode twice with and without bitstream errors
        self.dec(bitstream, out_file, logger)
        self.dec(bitstream, out_file, voip=voip, logger=logger)
        if bitstream_noerror != bitstream and self.tx_condition:
            out_file_unprocessed = Path(f"{out_file.parent.joinpath(out_file.stem)}.noerror{out_file.suffix}")
            self.dec(bitstream_noerror, out_file_unprocessed, logger)
            self.dec(bitstream_noerror, out_file_unprocessed, voip=False, logger=logger)

    def enc(
        self,
@@ -222,7 +222,7 @@ class IVAS(Processing):
        in_file: Union[Path, str],
        bitstream: Path,
        logger: Optional[logging.Logger] = None,
    ) -> Union[Path, str]:
    ) -> Tuple[Union[Path, str], bool]:
        if self.tx is not None:
            if self.tx["type"] == "JBM":
                bs, ext = os.path.splitext(bitstream)
@@ -236,15 +236,8 @@ class IVAS(Processing):
                    self.tx["n_frames_per_packet"],
                    logger=logger,
                )
                # add -voip cmdline option to the decoder
                # TODO: tracefile also?
                if self.dec_opts:
                    if "-voip" not in self.dec_opts:
                        self.dec_opts.extend(["-voip"])

                else:
                    self.dec_opts = ["-voip"]
                return bitstream_processed
                voip = True
                return bitstream_processed, voip

            elif self.tx["type"] == "FER":
                bs, ext = os.path.splitext(bitstream)
@@ -270,13 +263,13 @@ class IVAS(Processing):
                    master_seed=self.tx["master_seed"],
                    prerun_seed=self.tx["prerun_seed"],
                )

                return bitstream_processed
                voip = False
                return bitstream_processed, voip
        else:
            return bitstream
            return bitstream, False

    def dec(
        self, bitstream: Path, out_file: Path, logger: Optional[logging.Logger] = None
        self, bitstream: Path, out_file: Path, voip=False, logger: Optional[logging.Logger] = None
    ) -> None:
        logger.debug(f"IVAS decoder {bitstream} -> {out_file}")

@@ -287,6 +280,9 @@ class IVAS(Processing):
        if hasattr(self, "trajectory"):
            cmd.extend(["-T", self.trajectory])

        # add -voip cmdline option to the decoder
        if voip:
            cmd.extend(["-voip"])
        if self.dec_opts:
            cmd.extend(self.dec_opts)

Loading