Skip to content

enums

FlowMode

Bases: CustomIntEnum

Controls how motion vectors are applied to pixels.

ABSOLUTE class-attribute instance-attribute

ABSOLUTE = 0

Motion vectors point directly to destination pixels.

RELATIVE class-attribute instance-attribute

RELATIVE = 1

Motion vectors describe how source pixels should be shifted.

MVDirection

Bases: IntFlag

Motion vector analyze direction.

BACK class-attribute instance-attribute

BACK = 2

Backwards motion detection.

BOTH class-attribute instance-attribute

BOTH = FWRD | BACK

Backwards and forwards motion detection.

FWRD class-attribute instance-attribute

FWRD = 1

Forwards motion detection.

MVToolsPlugin

Bases: CustomIntEnum

Abstraction around both mvtools plugin versions.

Analyze property

Get the Analyze function for analyzing motion vectors.

BlockFPS property

Get the BlockFPS function for block-based frame rate conversion.

Compensate property

Compensate: VSFunctionAllArgs

Get the Compensate function for motion compensation.

FLOAT class-attribute instance-attribute

FLOAT = 1

Fork by IFeelBloated. Only works with float single precision clips.

Flow property

Get the Flow function for motion vector visualization.

FlowBlur property

Get the FlowBlur function for motion-compensated frame blending.

FlowFPS property

Get the FlowFPS function for motion-compensated frame rate conversion.

FlowInter property

FlowInter: VSFunctionAllArgs

Get the FlowInter function for motion-compensated frame interpolation.

INTEGER class-attribute instance-attribute

INTEGER = 0

Original plugin. Only accepts integer 8-16 bits clips.

Mask property

Get the Mask function for generating motion masks.

Recalculate property

Recalculate: VSFunctionAllArgs

Get the Recalculate function for refining motion vectors.

SCDetection property

SCDetection: VSFunctionAllArgs

Get the SCDetection function for scene change detection.

Super property

Get the Super function for creating motion vector clips.

namespace property

namespace: Any

Get the appropriate MVTools namespace based on plugin type.

Degrain

Degrain(tr: int | None = None) -> VSFunctionAllArgs

Get the Degrain function for motion vector denoising.

Source code
104
105
106
107
108
109
110
111
112
113
def Degrain(self, tr: int | None = None) -> VSFunctionAllArgs:
    """Get the Degrain function for motion vector denoising."""

    if tr is None and self is not MVToolsPlugin.FLOAT:
        raise CustomValueError('This implementation needs a temporal radius!', f'{self.name}.Degrain')

    try:
        return cast(VSFunctionAllArgs, getattr(self.namespace, f"Degrain{fallback(tr, '')}"))
    except AttributeError:
        raise CustomValueError(f'This temporal radius isn\'t supported! ({tr})', f'{self.name}.Degrain')

from_video classmethod

from_video(clip: VideoNode) -> MVToolsPlugin

Automatically select the appropriate plugin based on the given clip.

Parameters:

  • clip

    (VideoNode) –

    The clip to process.

Returns:

  • MVToolsPlugin

    The accompanying MVTools plugin for the clip.

Source code
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
@classmethod
def from_video(cls, clip: vs.VideoNode) -> MVToolsPlugin:
    """
    Automatically select the appropriate plugin based on the given clip.

    :param clip:    The clip to process.

    :return:        The accompanying MVTools plugin for the clip.
    """

    assert clip.format

    if clip.format.sample_type is vs.FLOAT:
        if not hasattr(core, 'mvsf'):
            raise ImportError(
                "MVTools: With the current clip, the processing has to be done in float precision, "
                "but you're missing mvsf."
                "\n\tPlease download it from: https://github.com/IFeelBloated/vapoursynth-mvtools-sf"
            )

        return MVToolsPlugin.FLOAT

    elif not hasattr(core, 'mv'):
        raise ImportError(
            "MVTools: You're missing mvtools."
            "\n\tPlease download it from: https://github.com/dubhater/vapoursynth-mvtools"
        )

    return MVToolsPlugin.INTEGER

MaskMode

Bases: CustomIntEnum

Defines the type of analysis mask to generate.

COLORMAP class-attribute instance-attribute

COLORMAP = 5

Creates a color visualization of motion vectors, mapping x/y components to U/V planes.

HORIZONTAL class-attribute instance-attribute

HORIZONTAL = 3

Visualizes horizontal motion vector components. Values are in pixels + 128.

MOTION class-attribute instance-attribute

MOTION = 0

Generates a mask based on motion vector magnitudes.

OCCLUSION class-attribute instance-attribute

OCCLUSION = 2

Generates a mask highlighting areas where motion estimation fails due to occlusion.

SAD class-attribute instance-attribute

SAD = 1

Generates a mask based on SAD (Sum of Absolute Differences) values.

VERTICAL class-attribute instance-attribute

VERTICAL = 4

Visualizes vertical motion vector components. Values are in pixels + 128.

MotionMode

Bases: CustomIntEnum

Controls how motion vectors are searched and selected.

Provides presets that configure multiple motion estimation parameters like lambda, LSAD threshold, and penalty values to optimize for either raw SAD scores or motion coherence.

COHERENCE class-attribute instance-attribute

COHERENCE = 1

Optimize for motion vector coherence, preferring vectors that align with surrounding blocks.

SAD class-attribute instance-attribute

SAD = 0

Optimize purely for lowest SAD scores when searching motion vectors.

PenaltyMode

Bases: CustomIntEnum

Controls how motion estimation penalties scale with hierarchical levels.

LINEAR class-attribute instance-attribute

LINEAR = 1

Penalties scale linearly with hierarchical level size.

NONE class-attribute instance-attribute

NONE = 0

Penalties remain constant across all hierarchical levels.

QUADRATIC class-attribute instance-attribute

QUADRATIC = 2

Penalties scale quadratically with hierarchical level size.

RFilterMode

Bases: CustomIntEnum

Hierarchical levels smoothing and reducing (halving) filter.

AVERAGE class-attribute instance-attribute

AVERAGE = 0

Simple 4 pixels averaging.

CUBIC class-attribute instance-attribute

CUBIC = 4

Cubic filter for even more smoothing.

QUADRATIC class-attribute instance-attribute

QUADRATIC = 3

Quadratic filter for even more smoothing.

TRIANGLE class-attribute instance-attribute

TRIANGLE = 2

Triangle filter for even more smoothing.

TRIANGLE_SHIFTED class-attribute instance-attribute

TRIANGLE_SHIFTED = 1

Triangle (shifted) filter for more smoothing (decrease aliasing).

SADMode

Bases: CustomIntEnum

Specifies how block differences (SAD) are calculated between frames. Can use spatial data, DCT coefficients, SATD, or combinations to improve motion estimation.

ADAPTIVE_SATD_DCT class-attribute instance-attribute

ADAPTIVE_SATD_DCT = 8

Like ADAPTIVE_SPATIAL_DCT but uses SATD instead of SAD.

ADAPTIVE_SATD_LUMA class-attribute instance-attribute

ADAPTIVE_SATD_LUMA = 10

Adaptively use SATD weighted by SAD, but only when there are significant luma changes.

ADAPTIVE_SATD_MIXED class-attribute instance-attribute

ADAPTIVE_SATD_MIXED = 7

Like ADAPTIVE_SPATIAL_MIXED but uses SATD instead of SAD.

ADAPTIVE_SPATIAL_DCT class-attribute instance-attribute

ADAPTIVE_SPATIAL_DCT = 4

Adaptively choose between spatial data or DCT-weighted mixed mode for each block.

ADAPTIVE_SPATIAL_MIXED class-attribute instance-attribute

ADAPTIVE_SPATIAL_MIXED = 3

Adaptively choose between spatial data or an equal mix of spatial and DCT data for each block.

DCT class-attribute instance-attribute

DCT = 1

Calculate differences using DCT coefficients. Slower, especially for block sizes other than 8x8.

MIXED_SADEQSATD_DCT class-attribute instance-attribute

MIXED_SADEQSATD_DCT = 9

Mix of SAD, SATD and DCT data. Weight varies from SAD-only to equal SAD/SATD mix.

MIXED_SATD_DCT class-attribute instance-attribute

MIXED_SATD_DCT = 6

Like MIXED_SPATIAL_DCT but uses SATD instead of SAD.

MIXED_SPATIAL_DCT class-attribute instance-attribute

MIXED_SPATIAL_DCT = 2

Use both spatial and DCT data, weighted based on the average luma difference between frames.

SATD class-attribute instance-attribute

SATD = 5

Use Sum of Absolute Transformed Differences (SATD) instead of SAD for luma comparison.

SPATIAL class-attribute instance-attribute

SPATIAL = 0

Calculate differences using raw pixel values in spatial domain.

SearchMode

Bases: CustomIntEnum

Decides the type of search at every level.

DIAMOND class-attribute instance-attribute

DIAMOND = 2

Logarithmic search, also named Diamond Search.

EXHAUSTIVE class-attribute instance-attribute

EXHAUSTIVE = 3

Exhaustive search, square side is 2 * radius + 1. It's slow, but gives the best results SAD-wise.

EXHAUSTIVE_H class-attribute instance-attribute

EXHAUSTIVE_H = 6

Pure horizontal exhaustive search, width is 2 * radius + 1.

EXHAUSTIVE_V class-attribute instance-attribute

EXHAUSTIVE_V = 7

Pure vertical exhaustive search, height is 2 * radius + 1.

HEXAGON class-attribute instance-attribute

HEXAGON = 4

Hexagon search (similar to x264).

NSTEP class-attribute instance-attribute

NSTEP = 1

N step searches.

ONETIME class-attribute instance-attribute

ONETIME = 0

One time search.

UMH class-attribute instance-attribute

UMH = 5

Uneven Multi Hexagon search (similar to x264).

SharpMode

Bases: CustomIntEnum

Subpixel interpolation method for pel = 2 or 4.

This enum controls the calculation of the first level only. If pel=4, bilinear interpolation is always used to compute the second level.

BICUBIC class-attribute instance-attribute

BICUBIC = 1

Bicubic interpolation (4-tap Catmull-Rom).

BILINEAR class-attribute instance-attribute

BILINEAR = 0

Soft bilinear interpolation.

WIENER class-attribute instance-attribute

WIENER = 2

Sharper Wiener interpolation (6-tap, similar to Lanczos).

SmoothMode

Bases: CustomIntEnum

This is method for dividing coarse blocks into smaller ones.

BILINEAR class-attribute instance-attribute

BILINEAR = 1

Bilinear interpolation of 4 neighbors.

NEAREST class-attribute instance-attribute

NEAREST = 0

Use motion of nearest block.