Commit 7f0b84fa authored by bayers's avatar bayers
Browse files

updated Readme and template with correct info about JBM processing, fixed a general typo

parent c33730a0
Loading
Loading
Loading
Loading
Loading
+19 −7
Original line number Diff line number Diff line
@@ -222,16 +222,28 @@ input:
<summary>Click to expand</summary>

```yaml
### Bistream processing (transport simulation) done after encoding and before decoding
### Bitstream processing (transport simulation) done after encoding and before decoding
### e.g. frame error insertion or transport simulation for JBM testing
### can be given globally or in individual conditions of type ivas or evs
# tx:
    ### REQUIRED: Path to network simulation binary
    # bs_proc_bin: ".../ivas_python_testscripts/networkSimulator_g192.exe"
    ### Path to error pattern (mandatory if no information for generating the error pattern is given)
    ### REQUIRED: Type of bitstream processing; possible types: "jbm" or "fer"
    #type: "jbm"
    
    ### JBM
    ### REQUIRED: either error_pattern or error_profile
    ### delay error profile file
    # error_pattern: ".../dly_error_profile.dat"
    ### options for the binary, possible placeholders are {error_pattern} for the error pattern,
    ### {bitstream} for the bitstream to process and {bitstream_processed} for the processed bitstream
    # bs_proc_opts: [ "{error_pattern}",  "{bitstream}",  "{processed_bitstream}",  "{processed_bitstream}_tracefile_sim", "2", "0" ]
    ### Index of one of the existing delay error profile files to use (1-11)
    # error_profile: 5
    ## nFramesPerPacket parameter for the network simulator (optional); default = 1
    # n_frames_per_packet: 2
    
    ### FER
    ### REQUIRED: either error_pattern or error_rate
    ### Frame error pattern file
    # error_pattern: "path/pattern.192"
    ### Error rate in percent
    # error_rate: 5
```
</details>

+9 −7
Original line number Diff line number Diff line
@@ -92,19 +92,21 @@ input:
#################################################
### Bitstream processing
#################################################
### Bistream processing (transport simulation) done after encoding and before decoding
### Bitstream processing (transport simulation) done after encoding and before decoding
### e.g. frame error insertion or transport simulation for JBM testing
### can be given globally here or in individual conditions of type ivas or evs
# tx:
    ### REQUIRED: Type of bitsream processing; possible types: "jbm" or "fer"
    ### REQUIRED: Type of bitstream processing; possible types: "jbm" or "fer"
    #type: "jbm"
    
    ### JBM
    ### Path to delay error pattern (mandatory if no information for generating the error pattern is given)
    ### REQUIRED: either error_pattern or error_profile
    ### delay error profile file
    # error_pattern: ".../dly_error_profile.dat"
    ##
    # error_profile: 
    ## ; defalt = 1
    # n_frames_per_paket: 2
    ### Index of one of the existing delay error profile files to use (1-11)
    # error_profile: 5
    ## nFramesPerPacket parameter for the network simulator (optional); default = 1
    # n_frames_per_packet: 2
    
    ### FER
    ### REQUIRED: either error_pattern or error_rate
+9 −9
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ ERROR_PATTERNS_DIR = Path(__file__).parent.parent.parent.joinpath("dly_error_pro
def validate_network_simulator(
    error_pattern: Optional[Union[Path, str]] = None,
    error_profile: Optional[int] = None,
    n_frames_per_paket: Optional[int] = None,
    n_frames_per_packet: Optional[int] = None,
) -> None:
    """
    Validate settings for the network simulator
@@ -77,7 +77,7 @@ def validate_network_simulator(
            raise ValueError(
                f"JBM profile number {error_profile} does not exist, should be between {LIST_JBM_PROFILES[0]} and {LIST_JBM_PROFILES[-1]}"
            )
    if n_frames_per_paket is not None and n_frames_per_paket not in [1, 2]:
    if n_frames_per_packet is not None and n_frames_per_packet not in [1, 2]:
        raise ValueError(
            f"n_frames_per_paket is {n_frames_per_paket}. Should be 1 or 2. Please check your configuration."
        )
@@ -89,7 +89,7 @@ def network_simulator(
    error_pattern: Union[str, Path],
    in_bitstream: Union[str, Path],
    out_bitstream: Union[str, Path],
    n_frames_per_paket: int,
    n_frames_per_packet: int,
) -> None:
    """
    Wrapper for networkSimulator_g192 binary to apply error patterns for the bitstream processing
@@ -126,7 +126,7 @@ def network_simulator(
        in_bitstream,
        out_bitstream,
        f"{out_bitstream}_tracefile_sim",
        str(n_frames_per_paket),
        str(n_frames_per_packet),
        "0"
    ]

@@ -141,7 +141,7 @@ def apply_network_simulator(
    out_bitstream: Union[Path, str],
    error_pattern: Optional[Union[Path, str]] = None,
    error_profile: Optional[int] = None,
    n_frames_per_paket: Optional[int] = None,
    n_frames_per_packet: Optional[int] = None,
) -> None:
    """
    Function to apply a network simulator profile to a bitstreaam
@@ -178,12 +178,12 @@ def apply_network_simulator(
            "JBM pattern and JBM profile number are specified for bitstream processing. Can't use both"
        )

    if n_frames_per_paket is None:
        n_frames_per_paket = 1
    if n_frames_per_packet is None:
        n_frames_per_packet = 1
        if error_profile is not None and error_profile == 5:
            n_frames_per_paket = 2
            n_frames_per_packet = 2

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

    return
+1 −1
Original line number Diff line number Diff line
@@ -226,7 +226,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_paket": cfg.tx.get("n_frames_per_paket", 1),
                    "n_frames_per_packet": cfg.tx.get("n_frames_per_packet", 1),
                }
            else:
                raise ValueError("Type of bitstream procesing either missing or not valid")
+2 −2
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ class IVAS(Processing):
            if self.tx.get("type", None) == "JBM":
                validate_network_simulator(self.tx["error_pattern"],
                                           self.tx["error_profile"],
                                           self.tx["n_frames_per_paket"])
                                           self.tx["n_frames_per_packet"])
            elif self.tx.get("type", None) == "FER":
                # TODO
                pass
@@ -218,7 +218,7 @@ class IVAS(Processing):
                    bitstream_processed,
                    self.tx["error_pattern"],
                    self.tx["error_profile"],
                    self.tx["n_frames_per_paket"],
                    self.tx["n_frames_per_packet"],
                )
                # add -voip cmdline option to the decoder
                # TODO: tracefile also?