Skip to content

Commit

Permalink
fix_telecined_fades: fix regression to no-op
Browse files Browse the repository at this point in the history
Commit 67c08e1 attempted to make
fix_telecined_fades work for BFF clips but actually made it do nothing
at all, regardless of field order: t1 and t2 were meant to be listed
in the opposite order in the two lines of the expression in order to
select one field and then the other field), but the order was, in fact,
identical, so the same field was selected twice and divided by itself.

This could be fixed by swapping the second instance of t1 and t2,
but instead, take the opportunity to simplify the expression further:
the second line just wants the sum of both fields, so there's no need
to switch based on BF@ once again and look for "the other" field;
just take "both fields" explicitly.
  • Loading branch information
astiob committed Feb 7, 2024
1 parent 67c08e1 commit efb9e7b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vsdeinterlace/combing.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ def fix_telecined_fades(
)

fix = norm_expr(
props_clip, 'Y 2 % BF! BF@ x.f{t1}Avg{i} x.f{t2}Avg{i} ? AVG! '
'AVG@ 0 = x x {color} - AVG@ BF@ x.f{t1}Avg{i} x.f{t2}Avg{i} ? + 2 / AVG@ / * ? {color} +',
props_clip, 'Y 2 % x.f{t1}Avg{i} x.f{t2}Avg{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'
)
Expand Down

0 comments on commit efb9e7b

Please sign in to comment.