-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcombed.py
36 lines (25 loc) · 1.24 KB
/
combed.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from vsdeinterlace import vinverse
from vstools import replace_ranges, vs
from ...types import FilteringPositionEnum
from ...data.parse import WobblyParser
from .abstract import AbstractProcessingStrategy
__all__ = [
'DecombVinverseStrategy',
]
class DecombVinverseStrategy(AbstractProcessingStrategy):
"""Decomb strategy using vinverse to get rid of combed frames."""
def apply(self, clip: vs.VideoNode, wobbly_parsed: WobblyParser) -> vs.VideoNode:
"""
Use vinverse to get rid of combing on the given frames.
Note that vinverse may be destructive. Be cautious when applying this strategy.
:param clip: The clip to process.
:param wobbly_parsed: The parsed wobbly file. See the `WobblyParser` class for more information,
including all the data that is available.
:param kwargs: Additional keyword arguments.
:return: Clip with the processing applied to the selected frames.
"""
return replace_ranges(clip, vinverse(clip), wobbly_parsed.combed_frames)
@property
def position(self) -> FilteringPositionEnum:
"""When to perform filtering."""
return FilteringPositionEnum.PRE_DECIMATE