Commit 5a8a1376 authored by Anika Treffehn's avatar Anika Treffehn
Browse files

Merge branch 'main' of...

Merge branch 'main' of https://forge.3gpp.org/rep/ivas-codec-pc/ivas-processing-scripts into background_noise
parents ae52488d b9300741
Loading
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -470,9 +470,9 @@ The processing chain is as follows:
   - The postprocessing stage performs a final conversion from the output of the previous stage if necessary and applies the specified processing

---
## ITU Tools
## Additional Executables

The following binaries/executables are needed for the different processing steps:
The following additional executables are needed for the different processing steps:

| Processing step                 | Executable            | Where to find                                                                                               |
|---------------------------------|-----------------------|-------------------------------------------------------------------------------------------------------------|
@@ -483,7 +483,7 @@ The following binaries/executables are needed for the different processing steps
| Error pattern generation        | gen-patt              | https://www.itu.int/rec/T-REC-G.191-201003-S/en (Note: Version in https://github.com/openitu/STL is buggy!) |
| Filtering, Resampling           | filter                | https://www.3gpp.org/ftp/tsg_sa/WG4_CODEC/TSGS4_76/docs/S4-131277.zip                                       |
| Random offset/seed generation   | random                | https://www.3gpp.org/ftp/tsg_sa/WG4_CODEC/TSGS4_76/docs/S4-131277.zip                                       |
| JBM network similulator         | networkSimulator_g192 | https://www.3gpp.org/ftp/tsg_sa/WG4_CODEC/TSGS4_76/docs/S4-131277.zip                                       |
| JBM network simulator           | networkSimulator_g192 | https://www.3gpp.org/ftp/tsg_sa/WG4_CODEC/TSGS4_76/docs/S4-131277.zip                                       |
| MASA rendering                  | masaRenderer          | https://www.3gpp.org/ftp/TSG_SA/WG4_CODEC/TSGS4_122_Athens/Docs/S4-230221.zip                               |

The necessary binaries have to be placed in the [ivas_processing_scripts/bin](./ivas_processing_scripts/bin) folder.
+9 −2
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@
#  the United Nations Convention on Contracts on the International Sales of Goods.
#

import logging
import os.path
from pathlib import Path
from typing import Optional, Union
@@ -90,6 +91,7 @@ def network_simulator(
    out_bitstream: Union[str, Path],
    n_frames_per_packet: int,
    offset: int,
    logger: Optional[logging.Logger] = None,
) -> None:
    """
    Wrapper for networkSimulator_g192 binary to apply error patterns for the bitstream processing
@@ -106,6 +108,8 @@ def network_simulator(
        Number of frames per paket [1,2]
    offset: Optional[int]
        delay offset
    logger: Optional[logging.Logger]
        logger
    """

    # find binary
@@ -133,7 +137,7 @@ def network_simulator(
    ]

    # run command
    run(cmd)
    run(cmd, logger=logger)

    return

@@ -145,6 +149,7 @@ def apply_network_simulator(
    error_profile: Optional[int] = None,
    n_frames_per_packet: Optional[int] = None,
    offset: Optional[int] = 0,
    logger: Optional[logging.Logger] = None,
) -> None:
    """
    Function to apply a network simulator profile to a bitstreaam
@@ -163,6 +168,8 @@ def apply_network_simulator(
        Number of frames per paket
    offset: Optional[int]
        delay offset
    logger: Optional[logging.Logger]
        logger
    """

    if error_pattern is None:
@@ -192,7 +199,7 @@ def apply_network_simulator(

    # apply error pattern
    network_simulator(
        error_pattern, in_bitstream, out_bitstream, n_frames_per_packet, offset
        error_pattern, in_bitstream, out_bitstream, n_frames_per_packet, offset, logger
    )

    return
+1 −1
Original line number Diff line number Diff line
@@ -10,5 +10,5 @@ Necessary additional executables:
| Error pattern generation        | gen-patt              | https://www.itu.int/rec/T-REC-G.191-201003-S/en (Note: Version in https://github.com/openitu/STL is buggy!) |
| Filtering, Resampling           | filter                | https://www.3gpp.org/ftp/tsg_sa/WG4_CODEC/TSGS4_76/docs/S4-131277.zip                                       |
| Random offset/seed generation   | random                | https://www.3gpp.org/ftp/tsg_sa/WG4_CODEC/TSGS4_76/docs/S4-131277.zip                                       |
| JBM network similulator         | networkSimulator_g192 | https://www.3gpp.org/ftp/tsg_sa/WG4_CODEC/TSGS4_76/docs/S4-131277.zip                                       |
| JBM network simulator           | networkSimulator_g192 | https://www.3gpp.org/ftp/tsg_sa/WG4_CODEC/TSGS4_76/docs/S4-131277.zip                                       |
| MASA rendering                  | masaRenderer          | https://www.3gpp.org/ftp/TSG_SA/WG4_CODEC/TSGS4_122_Athens/Docs/S4-230221.zip                               |
+1 −1
Original line number Diff line number Diff line
@@ -310,7 +310,7 @@ def get_processing_chain(
                    "type": cfg.tx.get("type", None),
                    "error_pattern": cfg.tx.get("error_pattern", None),
                    "error_profile": cfg.tx.get("error_profile", None),
                    "n_frames_per_packet": cfg.tx.get("n_frames_per_packet", 1),
                    "n_frames_per_packet": cfg.tx.get("n_frames_per_packet", None),
                }
            else:
                raise ValueError(
+1 −0
Original line number Diff line number Diff line
@@ -225,6 +225,7 @@ class IVAS(Processing):
                    self.tx["error_pattern"],
                    self.tx["error_profile"],
                    self.tx["n_frames_per_packet"],
                    logger=logger,
                )
                # add -voip cmdline option to the decoder
                # TODO: tracefile also?