funcs ¶
This module contains general denoising functions built on top of base denoisers.
Functions:
-
mc_clamp
– -
mc_degrain
–Perform temporal denoising using motion compensation.
-
waifu2x_denoise
–
mc_clamp ¶
mc_clamp(
flt: VideoNode,
src: VideoNode,
mv_obj: MVTools,
ref: VideoNode | None = None,
clamp: int | float | tuple[int | float, int | float] = 0,
**kwargs: Any
) -> ConstantFormatVideoNode
Source code
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
|
mc_degrain ¶
mc_degrain(
clip: VideoNode,
vectors: MotionVectors | None = None,
prefilter: (
VideoNode
| PrefilterPartial
| VSFunctionNoArgs[VideoNode, VideoNode]
| None
) = None,
mfilter: VideoNode | VSFunctionNoArgs[VideoNode, VideoNode] | None = None,
preset: MVToolsPreset = HQ_SAD,
tr: int = 1,
blksize: int | tuple[int, int] = 16,
refine: int = 1,
thsad: int | tuple[int, int] = 400,
thsad2: int | tuple[int | None, int | None] | None = None,
thsad_recalc: int | None = None,
limit: int | tuple[int | None, int | None] | None = None,
thscd: int | tuple[int | None, int | None] | None = None,
export_globals: Literal[False] = ...,
planes: PlanesT = None,
) -> VideoNode
mc_degrain(
clip: VideoNode,
vectors: MotionVectors | None = None,
prefilter: (
VideoNode
| PrefilterPartial
| VSFunctionNoArgs[VideoNode, VideoNode]
| None
) = None,
mfilter: VideoNode | VSFunctionNoArgs[VideoNode, VideoNode] | None = None,
preset: MVToolsPreset = HQ_SAD,
tr: int = 1,
blksize: int | tuple[int, int] = 16,
refine: int = 1,
thsad: int | tuple[int, int] = 400,
thsad2: int | tuple[int | None, int | None] | None = None,
thsad_recalc: int | None = None,
limit: int | tuple[int | None, int | None] | None = None,
thscd: int | tuple[int | None, int | None] | None = None,
export_globals: Literal[True] = ...,
planes: PlanesT = None,
) -> tuple[VideoNode, MVTools]
mc_degrain(
clip: VideoNode,
vectors: MotionVectors | None = None,
prefilter: (
VideoNode
| PrefilterPartial
| VSFunctionNoArgs[VideoNode, VideoNode]
| None
) = None,
mfilter: VideoNode | VSFunctionNoArgs[VideoNode, VideoNode] | None = None,
preset: MVToolsPreset = HQ_SAD,
tr: int = 1,
blksize: int | tuple[int, int] = 16,
refine: int = 1,
thsad: int | tuple[int, int] = 400,
thsad2: int | tuple[int | None, int | None] | None = None,
thsad_recalc: int | None = None,
limit: int | tuple[int | None, int | None] | None = None,
thscd: int | tuple[int | None, int | None] | None = None,
export_globals: bool = ...,
planes: PlanesT = None,
) -> VideoNode | tuple[VideoNode, MVTools]
mc_degrain(
clip: VideoNode,
vectors: MotionVectors | None = None,
prefilter: (
VideoNode
| PrefilterPartial
| VSFunctionNoArgs[VideoNode, VideoNode]
| None
) = None,
mfilter: VideoNode | VSFunctionNoArgs[VideoNode, VideoNode] | None = None,
preset: MVToolsPreset = HQ_SAD,
tr: int = 1,
blksize: int | tuple[int, int] = 16,
refine: int = 1,
thsad: int | tuple[int, int] = 400,
thsad2: int | tuple[int | None, int | None] | None = None,
thsad_recalc: int | None = None,
limit: int | tuple[int | None, int | None] | None = None,
thscd: int | tuple[int | None, int | None] | None = None,
export_globals: bool = False,
planes: PlanesT = None,
) -> VideoNode | tuple[VideoNode, MVTools]
Perform temporal denoising using motion compensation.
Motion compensated blocks from previous and next frames are averaged with the current frame. The weighting factors for each block depend on their SAD from the current frame.
Parameters:
-
clip
¶VideoNode
) –The clip to process.
-
vectors
¶MotionVectors | None
, default:None
) –Motion vectors to use. Can be a MotionVectors object or another MVTools instance.
-
prefilter
¶VideoNode | PrefilterPartial | VSFunctionNoArgs[VideoNode, VideoNode] | None
, default:None
) –Filter or clip to use when performing motion vector search.
-
mfilter
¶VideoNode | VSFunctionNoArgs[VideoNode, VideoNode] | None
, default:None
) –Filter or clip to use where degrain couldn't find a matching block.
-
preset
¶MVToolsPreset
, default:HQ_SAD
) –MVTools preset defining base values for the MVTools object.
-
tr
¶int
, default:1
) –The temporal radius. This determines how many frames are analyzed before/after the current frame.
-
blksize
¶int | tuple[int, int]
, default:16
) –Size of a block. Larger blocks are less sensitive to noise, are faster, but also less accurate.
-
refine
¶int
, default:1
) –Number of times to recalculate motion vectors with halved block size.
-
thsad
¶int | tuple[int, int]
, default:400
) –Defines the soft threshold of block sum absolute differences. Blocks with SAD above this threshold have zero weight for averaging (denoising). Blocks with low SAD have highest weight. The remaining weight is taken from pixels of source clip.
-
thsad2
¶int | tuple[int | None, int | None] | None
, default:None
) –Define the SAD soft threshold for frames with the largest temporal distance. The actual SAD threshold for each reference frame is interpolated between thsad (nearest frames) and thsad2 (furthest frames). Only used with the FLOAT MVTools plugin.
-
thsad_recalc
¶int | None
, default:None
) –Only bad quality new vectors with a SAD above this will be re-estimated by search. thsad value is scaled to 8x8 block size.
-
limit
¶int | tuple[int | None, int | None] | None
, default:None
) –Maximum allowed change in pixel values.
-
thscd
¶int | tuple[int | None, int | None] | None
, default:None
) –Scene change detection thresholds: - First value: SAD threshold for considering a block changed between frames. - Second value: Percentage of changed blocks needed to trigger a scene change.
-
export_globals
¶bool
, default:False
) –Whether to return the MVTools object.
-
planes
¶PlanesT
, default:None
) –Which planes to process. Default: None (all planes).
Returns:
-
VideoNode | tuple[VideoNode, MVTools]
–Motion compensated and temporally filtered clip with reduced noise. If export_globals is true: A tuple containing the processed clip and the MVTools object.
Source code
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
|
waifu2x_denoise ¶
waifu2x_denoise(
clip: VideoNode,
noise: Literal[0, 1, 2, 3] = 1,
model: type[BaseWaifu2x] = Cunet,
**kwargs: Any
) -> VideoNode
Source code
172 173 174 175 176 177 178 179 180 181 182 |
|