Commit 7531ac45 authored by Anika Treffehn's avatar Anika Treffehn
Browse files

allow multiple output formats in ivas conditions

parent 0a1a7a8c
Loading
Loading
Loading
Loading
+17 −3
Original line number Diff line number Diff line
@@ -239,6 +239,7 @@ def get_processing_chain(
    tmp_esdru_alpha = None
    tx_condition = False
    ivas_jbm = False
    cond_fmt = []

    # override / add values based on specific conditions
    cond_cfg = cfg.conditions_to_generate[condition]
@@ -432,12 +433,18 @@ def get_processing_chain(
            )
            tmp_in_fmt = cod_fmt

        # allow list of output values for IVAS
        tmp_out_fmt = dec_cfg.get("fmt", tmp_out_fmt)
        if isinstance(tmp_out_fmt, list):
            cond_fmt.extend(tmp_out_fmt)
            tmp_out_fmt = tmp_out_fmt[0]

        chain["processes"].append(
            IVAS(
                {
                    "in_fmt": tmp_in_fmt,
                    "in_fs": tmp_in_fs,
                    "out_fmt": dec_cfg.get("fmt", tmp_out_fmt),
                    "out_fmt": tmp_out_fmt,
                    "out_fs": dec_cfg.get("fs", tmp_in_fs),
                    "bitrate": bitrate,
                    "cod_bin": get_abs_path(cod_cfg.get("bin", None)),
@@ -454,6 +461,9 @@ def get_processing_chain(
        )
        # update values to reflect decoder output
        tmp_in_fs = dec_cfg.get("fs", tmp_in_fs)
        if isinstance(dec_cfg.get("fmt", tmp_out_fmt), list):
            tmp_in_fmt = dec_cfg.get("fmt", tmp_out_fmt)[0]
        else:
            tmp_in_fmt = dec_cfg.get("fmt", tmp_out_fmt)
    else:
        raise SystemExit(f"Unknown condition {condition}!")
@@ -479,7 +489,11 @@ def get_processing_chain(

    # add postprocessing step based on condition
    post_fmt = post_cfg.get("fmt")
    if isinstance(post_fmt, list):
    if isinstance(post_fmt, list) or len(cond_fmt) > 0:
        if not isinstance(post_fmt, list):
            post_fmt = [post_fmt]
        cond_fmt.extend(post_fmt)
        post_fmt = cond_fmt
        pre_fmts = post_fmt[:-1]
        post_fmt = post_fmt[-1]