types ¶
DescaleAttempt ¶
Bases: NamedTuple
Tuple representing a descale attempt.
diff instance-attribute
¶
diff: VideoNode
The subtractive difference between the original and descaled frame.
from_args classmethod
¶
from_args(
clip: VideoNode,
width: int,
height: int,
shift: tuple[float, float],
kernel: Kernel,
mode: DescaleModeWithInfo,
**kwargs: VSMapValue
) -> DescaleAttempt
Get a DescaleAttempt from args. Calculate difference nodes too.
Source code
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
|
DescaleMode ¶
Bases: CustomIntEnum
Descale modes for vsscale.descale.
KernelDiff class-attribute
instance-attribute
¶
KernelDiff = 3
Simple PlaneStats between original and descaled kernels differences.
KernelDiffMax class-attribute
instance-attribute
¶
KernelDiffMax = 4
Get the video descaled with the kernel with the maximum absolute difference from original.
KernelDiffMin class-attribute
instance-attribute
¶
KernelDiffMin = 5
Get the video descaled with the kernel with the minimum absolute difference from original.
PlaneDiff class-attribute
instance-attribute
¶
PlaneDiff = 0
Simple PlaneStatsDiff between original and descaled.
PlaneDiffMax class-attribute
instance-attribute
¶
PlaneDiffMax = 1
Get the video with the maximum absolute difference from original.
PlaneDiffMin class-attribute
instance-attribute
¶
PlaneDiffMin = 2
Get the video with the minimum absolute difference from original.
diff_op property
¶
diff_op: ComparatorFunc
Get the operator for calculating sort operation between two props.
res_op property
¶
res_op: ComparatorFunc
Get the operator for calculating sort operation between two resolutions.
__call__ ¶
__call__(
thr: float = 5e-08, op: ComparatorFunc | None = None
) -> DescaleModeWithInfo
Source code
136 137 |
|
prop_value ¶
prop_value(kind: PlaneStatsKind) -> str
Get props key for getting the value of the PlaneStatsKind.
Source code
186 187 188 189 |
|
DescaleModeWithInfo dataclass
¶
DescaleModeWithInfo(
mode: DescaleMode, thr: float = 5e-08, op: ComparatorFunc = lambda: max()
)
op class-attribute
instance-attribute
¶
Operator used for generic sorting.
DescaleResult dataclass
¶
DescaleResult(
descaled: VideoNode,
rescaled: VideoNode,
upscaled: VideoNode | None,
error_mask: VideoNode | None,
pproc_mask: VideoNode | None,
attempts: list[DescaleAttempt],
out: VideoNode,
)
Dataclass representing a complete result of vsscale.descale.
attempts instance-attribute
¶
attempts: list[DescaleAttempt]
Descale attempts made. These are used to determine the correct kernel if multiple "Kernels" were passed.
error_mask instance-attribute
¶
error_mask: VideoNode | None
The descale error mask. This catches the big differences between the source clip and the rescaled clip as a mask. If no "mask" is passed, this attribute will be None.
out instance-attribute
¶
out: VideoNode
The final clip that is returned during regular usage with "result=False".
pproc_mask instance-attribute
¶
pproc_mask: VideoNode | None
The post-processing mask. This is the second mask passed to "mask". If no "mask" is passed, this attribute will be None.
rescaled instance-attribute
¶
rescaled: VideoNode
The descaled clip reupscaled to the source resolution using the same kernel used to descale. Can be a variable resolution clip.
upscaled instance-attribute
¶
upscaled: VideoNode | None
The descaled clip reupscaled using the given upscaler.