diff --git a/av1an.py b/av1an.py index dd7ae95..66dd414 100755 --- a/av1an.py +++ b/av1an.py @@ -129,12 +129,13 @@ class Av1an: source, target = Path(commands[-1][0]), Path(commands[-1][1]) frame_probe_source = frame_probe(source) + # TODO(n9Mtq4): reuse of first pass doesn't work with boosting and vmaf_target # Target Vmaf Mode if self.vmaf_target: tg_cq = self.target_vmaf(source) cm1 = man_cq(commands[0], tg_cq) - if self.passes == 2 and (not self.reuse_first_pass): + if self.passes == 2: cm2 = man_cq(commands[1], tg_cq) commands = (cm1, cm2) + commands[2:] else: @@ -142,7 +143,7 @@ class Av1an: # Boost if self.boost: - commands = boosting(self.boost_limit, self.boost_range, source, commands, self.passes, self.reuse_first_pass) + commands = boosting(self.boost_limit, self.boost_range, source, commands, self.passes) log(f'Enc: {source.name}, {frame_probe_source} fr\n') diff --git a/utils/boost.py b/utils/boost.py index c316bcc..a649e2e 100644 --- a/utils/boost.py +++ b/utils/boost.py @@ -26,12 +26,12 @@ def boost(command: str, brightness, b_limit, b_range, new_cq=0): print(f'Error in encoding loop {e}\nAt line {exc_tb.tb_lineno}') -def boosting(bl, br, source, commands, passes, reuse_first_pass): +def boosting(bl, br, source, commands, passes): try: brightness = get_brightness(source.absolute().as_posix()) com0, cq = boost(commands[0], brightness, bl, br ) - if passes == 2 and (not reuse_first_pass): + if passes == 2: com1, _ = boost(commands[1], brightness, bl, br, new_cq=cq) commands = (com0, com1) + commands[2:] else: