Commit 2ef9e79d authored by Jan Kiene's avatar Jan Kiene
Browse files

add --bs_length option to pyivastest scripts

parent 5c09b762
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -276,6 +276,12 @@ class IvasScriptArgParser(argparse.ArgumentParser):
                help="Cut frames from the beginning of the encoded bit stream until the first SID frame",
                action="store_true",
            )
            self.add_argument(
                "--bs_length",
                help="Cut bitstream to this (maximum) length. Is applied AFTER --sidstart processing, if this is given",
                type=int,
                default=-1,
            )
            self.add_argument(
                "--info",
                help="Ouput debug info in subfolders of /res (use with caution, this can generate a huge amount of data)",
@@ -604,6 +610,18 @@ def runner_setup(runner, args):
        ]
        add_to_proc_chain(bs_proc_chain, sidstart_cmd)

    if args["bs_length"] > 0:
        bs_len = args["bs_length"]
        bs_cut_cmd = [
            os.path.join(constants.SCRIPTS_BASE_DIR, "cut_bs.py"),
            "--length",
            f"{bs_len}",
            "{in_file}",
            "{out_file}",
            f"{bs_len}frames",
        ]
        add_to_proc_chain(bs_proc_chain, bs_cut_cmd)

    if bs_proc_chain != {}:
        runner.global_bitstream_processing = bs_proc_chain