Skip to content

enums

Classes:

  • MVDirection

    Motion vector analyze direction.

  • MaskMode

    Defines the type of analysis mask to generate.

  • PenaltyMode

    Controls how motion estimation penalties scale with hierarchical levels.

  • RFilterMode

    Hierarchical levels smoothing and reducing (halving) filter.

  • SearchMode

    Decides the type of search at every level.

  • SharpMode

    Subpixel interpolation method for pel = 2 or 4.

MVDirection

Bases: IntFlag

Motion vector analyze direction.

Attributes:

  • BACKWARD

    Backward motion compensation.

  • BOTH

    Backward and forward motion compensation.

  • FORWARD

    Forward motion compensation.

BACKWARD class-attribute instance-attribute

BACKWARD = 1

Backward motion compensation.

BOTH class-attribute instance-attribute

BOTH = BACKWARD | FORWARD

Backward and forward motion compensation.

FORWARD class-attribute instance-attribute

FORWARD = 2

Forward motion compensation.

MaskMode

Bases: CustomIntEnum

Defines the type of analysis mask to generate.

Methods:

Attributes:

  • OCCLUSION

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

  • SAD

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

  • VECTOR_LENGTH

    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.

VECTOR_LENGTH class-attribute instance-attribute

VECTOR_LENGTH = 0

Generates a mask based on motion vector magnitudes.

from_param classmethod

from_param(value: Any, func_except: FuncExcept | None = None) -> Self

Return the enum value from a parameter.

Parameters:

  • value

    (Any) –

    Value to instantiate the enum class.

  • func_except

    (FuncExcept | None, default: None ) –

    Exception function.

Returns:

  • Self

    Enum value.

Raises:

Source code in jetpytools/enums/base.py
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
@classmethod
def from_param(cls, value: Any, func_except: FuncExcept | None = None) -> Self:
    """
    Return the enum value from a parameter.

    Args:
        value: Value to instantiate the enum class.
        func_except: Exception function.

    Returns:
        Enum value.

    Raises:
        NotFoundEnumValue: Variable not found in the given enum.
    """
    func_except = func_except or cls.from_param

    try:
        return cls(value)
    except (ValueError, TypeError):
        pass

    if isinstance(func_except, tuple):
        func_name, var_name = func_except
    else:
        func_name, var_name = func_except, repr(cls)

    raise NotFoundEnumValueError(
        'The given value for "{var_name}" argument must be a valid {enum_name}, not "{value}"!\n'
        "Valid values are: [{readable_enum}].",
        func_name,
        var_name=var_name,
        enum_name=cls,
        value=value,
        readable_enum=(f"{name} ({value!s})" for name, value in cls.__members__.items()),
        reason=value,
    ) from None

value

value() -> int
Source code in jetpytools/enums/base.py
86
87
@enum_property
def value(self) -> int: ...

PenaltyMode

Bases: CustomIntEnum

Controls how motion estimation penalties scale with hierarchical levels.

Methods:

Attributes:

  • LINEAR

    Penalties scale linearly with hierarchical level size.

  • NONE

    Penalties remain constant across all hierarchical levels.

  • QUADRATIC

    Penalties scale quadratically with hierarchical level size.

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.

from_param classmethod

from_param(value: Any, func_except: FuncExcept | None = None) -> Self

Return the enum value from a parameter.

Parameters:

  • value

    (Any) –

    Value to instantiate the enum class.

  • func_except

    (FuncExcept | None, default: None ) –

    Exception function.

Returns:

  • Self

    Enum value.

Raises:

Source code in jetpytools/enums/base.py
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
@classmethod
def from_param(cls, value: Any, func_except: FuncExcept | None = None) -> Self:
    """
    Return the enum value from a parameter.

    Args:
        value: Value to instantiate the enum class.
        func_except: Exception function.

    Returns:
        Enum value.

    Raises:
        NotFoundEnumValue: Variable not found in the given enum.
    """
    func_except = func_except or cls.from_param

    try:
        return cls(value)
    except (ValueError, TypeError):
        pass

    if isinstance(func_except, tuple):
        func_name, var_name = func_except
    else:
        func_name, var_name = func_except, repr(cls)

    raise NotFoundEnumValueError(
        'The given value for "{var_name}" argument must be a valid {enum_name}, not "{value}"!\n'
        "Valid values are: [{readable_enum}].",
        func_name,
        var_name=var_name,
        enum_name=cls,
        value=value,
        readable_enum=(f"{name} ({value!s})" for name, value in cls.__members__.items()),
        reason=value,
    ) from None

value

value() -> int
Source code in jetpytools/enums/base.py
86
87
@enum_property
def value(self) -> int: ...

RFilterMode

Bases: CustomIntEnum

Hierarchical levels smoothing and reducing (halving) filter.

Methods:

Attributes:

  • AVERAGE

    Simple 4 pixels averaging.

  • BILINEAR

    Triangle filter for even more smoothing.

  • CUBIC

    Cubic filter for even more smoothing.

AVERAGE class-attribute instance-attribute

AVERAGE = 0

Simple 4 pixels averaging.

BILINEAR class-attribute instance-attribute

BILINEAR = 1

Triangle filter for even more smoothing.

CUBIC class-attribute instance-attribute

CUBIC = 2

Cubic filter for even more smoothing.

from_param classmethod

from_param(value: Any, func_except: FuncExcept | None = None) -> Self

Return the enum value from a parameter.

Parameters:

  • value

    (Any) –

    Value to instantiate the enum class.

  • func_except

    (FuncExcept | None, default: None ) –

    Exception function.

Returns:

  • Self

    Enum value.

Raises:

Source code in jetpytools/enums/base.py
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
@classmethod
def from_param(cls, value: Any, func_except: FuncExcept | None = None) -> Self:
    """
    Return the enum value from a parameter.

    Args:
        value: Value to instantiate the enum class.
        func_except: Exception function.

    Returns:
        Enum value.

    Raises:
        NotFoundEnumValue: Variable not found in the given enum.
    """
    func_except = func_except or cls.from_param

    try:
        return cls(value)
    except (ValueError, TypeError):
        pass

    if isinstance(func_except, tuple):
        func_name, var_name = func_except
    else:
        func_name, var_name = func_except, repr(cls)

    raise NotFoundEnumValueError(
        'The given value for "{var_name}" argument must be a valid {enum_name}, not "{value}"!\n'
        "Valid values are: [{readable_enum}].",
        func_name,
        var_name=var_name,
        enum_name=cls,
        value=value,
        readable_enum=(f"{name} ({value!s})" for name, value in cls.__members__.items()),
        reason=value,
    ) from None

value

value() -> int
Source code in jetpytools/enums/base.py
86
87
@enum_property
def value(self) -> int: ...

SearchMode

Bases: CustomIntEnum

Decides the type of search at every level.

Methods:

Attributes:

  • DIAMOND

    Logarithmic search, also named Diamond Search.

  • EXHAUSTIVE

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

  • EXHAUSTIVE_H

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

  • EXHAUSTIVE_V

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

  • HEXAGON

    Hexagon search (similar to x264).

  • UMH

    Uneven Multi Hexagon search (similar to x264).

DIAMOND class-attribute instance-attribute

DIAMOND = 0

Logarithmic search, also named Diamond Search.

EXHAUSTIVE class-attribute instance-attribute

EXHAUSTIVE = 1

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 = 4

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

EXHAUSTIVE_V class-attribute instance-attribute

EXHAUSTIVE_V = 5

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

HEXAGON class-attribute instance-attribute

HEXAGON = 2

Hexagon search (similar to x264).

UMH class-attribute instance-attribute

UMH = 3

Uneven Multi Hexagon search (similar to x264).

from_param classmethod

from_param(value: Any, func_except: FuncExcept | None = None) -> Self

Return the enum value from a parameter.

Parameters:

  • value

    (Any) –

    Value to instantiate the enum class.

  • func_except

    (FuncExcept | None, default: None ) –

    Exception function.

Returns:

  • Self

    Enum value.

Raises:

Source code in jetpytools/enums/base.py
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
@classmethod
def from_param(cls, value: Any, func_except: FuncExcept | None = None) -> Self:
    """
    Return the enum value from a parameter.

    Args:
        value: Value to instantiate the enum class.
        func_except: Exception function.

    Returns:
        Enum value.

    Raises:
        NotFoundEnumValue: Variable not found in the given enum.
    """
    func_except = func_except or cls.from_param

    try:
        return cls(value)
    except (ValueError, TypeError):
        pass

    if isinstance(func_except, tuple):
        func_name, var_name = func_except
    else:
        func_name, var_name = func_except, repr(cls)

    raise NotFoundEnumValueError(
        'The given value for "{var_name}" argument must be a valid {enum_name}, not "{value}"!\n'
        "Valid values are: [{readable_enum}].",
        func_name,
        var_name=var_name,
        enum_name=cls,
        value=value,
        readable_enum=(f"{name} ({value!s})" for name, value in cls.__members__.items()),
        reason=value,
    ) from None

value

value() -> int
Source code in jetpytools/enums/base.py
86
87
@enum_property
def value(self) -> int: ...

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.

Methods:

Attributes:

  • BICUBIC

    Bicubic interpolation (4-tap Catmull-Rom).

  • BILINEAR

    Soft bilinear interpolation.

  • WIENER

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

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).

from_param classmethod

from_param(value: Any, func_except: FuncExcept | None = None) -> Self

Return the enum value from a parameter.

Parameters:

  • value

    (Any) –

    Value to instantiate the enum class.

  • func_except

    (FuncExcept | None, default: None ) –

    Exception function.

Returns:

  • Self

    Enum value.

Raises:

Source code in jetpytools/enums/base.py
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
@classmethod
def from_param(cls, value: Any, func_except: FuncExcept | None = None) -> Self:
    """
    Return the enum value from a parameter.

    Args:
        value: Value to instantiate the enum class.
        func_except: Exception function.

    Returns:
        Enum value.

    Raises:
        NotFoundEnumValue: Variable not found in the given enum.
    """
    func_except = func_except or cls.from_param

    try:
        return cls(value)
    except (ValueError, TypeError):
        pass

    if isinstance(func_except, tuple):
        func_name, var_name = func_except
    else:
        func_name, var_name = func_except, repr(cls)

    raise NotFoundEnumValueError(
        'The given value for "{var_name}" argument must be a valid {enum_name}, not "{value}"!\n'
        "Valid values are: [{readable_enum}].",
        func_name,
        var_name=var_name,
        enum_name=cls,
        value=value,
        readable_enum=(f"{name} ({value!s})" for name, value in cls.__members__.items()),
        reason=value,
    ) from None

value

value() -> int
Source code in jetpytools/enums/base.py
86
87
@enum_property
def value(self) -> int: ...