From 0d38404f50949666a7c239a4178106675355656d Mon Sep 17 00:00:00 2001 From: Oleg Oshmyan Date: Wed, 7 Feb 2024 02:00:38 +0200 Subject: [PATCH] fix_telecined_fades: make tff/bff handling simpler/saner Reflect the actual field placement in the property names. --- vsdeinterlace/combing.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/vsdeinterlace/combing.py b/vsdeinterlace/combing.py index 3d16159..5d08c93 100644 --- a/vsdeinterlace/combing.py +++ b/vsdeinterlace/combing.py @@ -55,16 +55,15 @@ def fix_telecined_fades( props_clip = core.akarin.PropExpr( [f.work_clip, fields[::2], fields[1::2]], lambda: { # type: ignore[misc] f'f{t}Avg{i}': f'{c}.P{i}Average {color} -' # type: ignore[has-type] - for t, c in ['ty', 'bz'] + for t, c in zip('tb' if tff.is_tff else 'bt', 'yz') for i, color in zip(f.norm_planes, f.norm_seq(colors)) } ) fix = norm_expr( - props_clip, 'Y 2 % x.f{t1}Avg{i} x.f{t2}Avg{i} ? AVG! ' + props_clip, 'Y 2 % x.fbAvg{i} x.ftAvg{i} ? AVG! ' 'AVG@ 0 = x x {color} - x.ftAvg{i} x.fbAvg{i} + 2 / AVG@ / * ? {color} +', planes, i=f.norm_planes, color=colors, force_akarin=func, - t1='b' if tff.is_tff else 't', t2='t' if tff.is_tff else 'b' ) return f.return_clip(fix)