Skip to content

Commit

Permalink
fix_telecined_fades: deprecate tff parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
astiob committed Feb 7, 2024
1 parent 3f70c9f commit a6f6fca
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions vsdeinterlace/combing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from vsexprtools import ExprVars, complexpr_available, norm_expr
from vsrgtools import sbr
from vstools import (
ConvMode, CustomEnum, FieldBased, FieldBasedT, FuncExceptT, FunctionUtil, PlanesT, core, depth, expect_bits,
get_neutral_values, scale_8bit, vs
MISSING, ConvMode, CustomEnum, FieldBased, FieldBasedT, FuncExceptT, FunctionUtil, MissingT, PlanesT,
core, depth, expect_bits, get_neutral_values, scale_8bit, vs
)

__all__ = [
Expand All @@ -17,7 +17,7 @@


def fix_telecined_fades(
clip: vs.VideoNode, tff: bool | FieldBasedT | None = None, colors: float | list[float] = 0.0,
clip: vs.VideoNode, tff: bool | FieldBasedT | None | MissingT = MISSING, colors: float | list[float] = 0.0,
planes: PlanesT = None, func: FuncExceptT | None = None
) -> vs.VideoNode:
"""
Expand All @@ -28,19 +28,20 @@ def fix_telecined_fades(
Make sure to run this *after* IVTC/deinterlacing!
:param clip: Clip to process.
:param tff: Top-field-first. `False` sets it to Bottom-Field-First.
If `None`, get the field order from the _FieldBased prop.
:param tff: This parameter is deprecated and unused. It will be removed in
the future, so prefer keyword arguments and avoid passing `tff`.
:param colors: Color offset for the plane average.
:return: Clip with fades (and only fades) accurately deinterlaced.
:raises UndefinedFieldBasedError: No automatic ``tff`` can be determined.
"""
func = func or fix_telecined_fades

if not complexpr_available:
raise ExprVars._get_akarin_err()(func=func)

if tff is not MISSING:
print(DeprecationWarning('fix_telecined_fades: The tff parameter is unnecessary and therefore deprecated!'))

f = FunctionUtil(clip, func, planes, (vs.GRAY, vs.YUV), 32)

fields = f.work_clip.std.Limiter().std.SeparateFields(tff=True)
Expand Down

0 comments on commit a6f6fca

Please sign in to comment.