utils ¶
Functions:
-
normalize_thscd
–Normalize and scale the thscd parameter.
-
planes_to_mvtools
–Convert a sequence of plane indices to MVTools' plane parameter value.
-
refine_blksize
–Normalize and refine blksize.
normalize_thscd ¶
normalize_thscd(
thscd: int | tuple[int | None, int | float | None] | None,
scale: bool = True,
) -> tuple[int | None, int | None]
Normalize and scale the thscd parameter.
Parameters:
-
thscd
¶int | tuple[int | None, int | float | None] | None
) –thscd value to scale and/or normalize.
-
scale
¶bool
, default:True
) –Whether to scale thscd2 from 0-100 percentage threshold to 0-255.
Returns:
Source code in vsdenoise/mvtools/utils.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
|
planes_to_mvtools ¶
Convert a sequence of plane indices to MVTools' plane parameter value.
MVTools uses a single integer to represent which planes to process
- 0: Process Y plane only
- 1: Process U plane only
- 2: Process V plane only
- 3: Process UV planes only
- 4: Process all planes
Parameters:
-
input_planes
¶Sequence of plane indices (0=Y, 1=U, 2=V) to process.
Returns:
-
int
–Integer value used by MVTools to specify which planes to process.
Source code in vsdenoise/mvtools/utils.py
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 37 |
|
refine_blksize ¶
refine_blksize(
blksize: int | tuple[int, int], divisor: int | tuple[int, int] = (2, 2)
) -> tuple[int, int]
Normalize and refine blksize.
Parameters:
-
blksize
¶int | tuple[int, int]
) –Block size to refine.
-
divisor
¶int | tuple[int, int]
, default:(2, 2)
) –Block size divisor.
Returns:
Source code in vsdenoise/mvtools/utils.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
|