Skip to content

Commit

Permalink
Address a few @Ichunjo comments
Browse files Browse the repository at this point in the history
  • Loading branch information
LightArrowsEXE committed Jun 28, 2022
1 parent dc88aa2 commit 31b67eb
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 17 deletions.
4 changes: 2 additions & 2 deletions lvsfunc/deblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def autodb_dpir(clip: vs.VideoNode, edgevalue: int = 24,
strs: Sequence[float] = [10, 50, 75],
thrs: Sequence[Tuple[float, float, float]] = [(1.5, 2.0, 2.0), (3.0, 4.5, 4.5), (5.5, 7.0, 7.0)],
matrix: Matrix | int | None = None,
kernel: Kernel | str = Bicubic(b=0, c=0.5),
kernel: Kernel | str = Bicubic(b=0, c=1/2),
cuda: bool = True, write_props: bool = False,
**vsdpir_args: Any) -> vs.VideoNode:
r"""
Expand Down Expand Up @@ -152,7 +152,7 @@ def dpir(
matrix: Matrix | int | None = None, cuda: bool | Literal['trt'] | None = None, i444: bool = False,
tiles: int | Tuple[int, int] | None = None, overlap: int | Tuple[int, int] | None = 8,
zones: List[Tuple[Range | List[Range] | None, SupportsFloat | vs.VideoNode | None]] | None = None,
fp16: bool | None = None, num_streams: int = 1, device_id: int = 0, kernel: Kernel | str = Bicubic(b=0, c=0.5)
fp16: bool | None = None, num_streams: int = 1, device_id: int = 0, kernel: Kernel | str = Bicubic(b=0, c=1/2)
) -> vs.VideoNode:
"""
DPIR, or Plug-and-Play Image Restoration with Deep Denoiser Prior, is a denoise and deblocking neural network.
Expand Down
2 changes: 1 addition & 1 deletion lvsfunc/deinterlace.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ def _pp(n: int, f: vs.VideoFrame, clip: vs.VideoNode, pp: vs.VideoNode) -> vs.Vi

def descale_fields(clip: vs.VideoNode, tff: bool = True,
width: int | None = None, height: int = 720,
kernel: Kernel | str = Bicubic(b=0, c=0.5),
kernel: Kernel | str = Bicubic(b=0, c=1/2),
src_top: float = 0.0) -> vs.VideoNode:
"""
Descale interwoven upscaled fields, also known as a cross conversion.
Expand Down
12 changes: 5 additions & 7 deletions lvsfunc/mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,20 +487,18 @@ def mt_xxpand_multi(clip: vs.VideoNode,
case Shapes.LOSANGE: coordinates = [[0, 1, 0, 1, 1, 0, 1, 0]] * 3
case _: coordinates = [[1] * 8] * 3

clips = [clip]
clips: List[vs.VideoNode] = [clip]
end = int(min(sw, sh)) + start

for x in range(start, end):
clips += [m__imum(clips[-1], coordinates=coordinates[x % 3], **params)] # type:ignore[list-item]

clips += [m__imum(clips[-1], coordinates=coordinates[x % 3], **params)]
for x in range(end, int(end + sw - sh)):
clips += [m__imum(clips[-1], coordinates=[0, 0, 0, 1, 1, 0, 0, 0], **params)] # type:ignore[list-item]

clips += [m__imum(clips[-1], coordinates=[0, 0, 0, 1, 1, 0, 0, 0], **params)]
for x in range(end, int(end + sh - sw)):
clips += [m__imum(clips[-1], coordinates=[0, 1, 0, 0, 0, 0, 1, 0], **params) # type:ignore[list-item]
clips += [m__imum(clips[-1], coordinates=[0, 1, 0, 0, 0, 0, 1, 0], **params)
.std.Limiter()]

return clips # type:ignore[return-value]
return clips


maxm = partial(mt_xxpand_multi, m__imum=core.std.Maximum)
Expand Down
2 changes: 1 addition & 1 deletion lvsfunc/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def source(path: os.PathLike[str] | str, ref: vs.VideoNode | None = None,
:param force_lsmas: Force files to be imported with L-SMASH (Default: False).
:param kernel: py:class:`vskernels.Kernel` object used for converting the `clip` to match `ref`.
This can also be the string name of the kernel
(Default: py:class:`vskernels.Bicubic(b=0, c=0.5)`).
(Default: py:class:`vskernels.Bicubic(b=0, c=1/2)`).
:param tail_lines: Lines to check on the tail of the dgi file.
Increase this value if FILM and ORDER do exist in your dgi file
but it's having trouble finding them.
Expand Down
4 changes: 2 additions & 2 deletions lvsfunc/noise.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def chickendream(clip: vs.VideoNode, sigma: float = 0.35,
rad: float = 0.025, res: int = 1024,
chroma: bool = False, seed: int = 42069,
matrix: Matrix | int | None = None,
kernel: Kernel | str = Bicubic(b=0, c=0.5), **chkdr_args: Any) -> vs.VideoNode:
kernel: Kernel | str = Bicubic(b=0, c=1/2), **chkdr_args: Any) -> vs.VideoNode:
"""
Realistic film grain generator.
Expand Down Expand Up @@ -145,7 +145,7 @@ def chickendream(clip: vs.VideoNode, sigma: float = 0.35,
in which case it stays as `None`.
:param kernel: py:class:`vskernels.Kernel` object used for conversions between YUV <-> RGB.
This can also be the string name of the kernel
(Default: py:class:`vskernels.Bicubic(b=0, c=0.5)`).
(Default: py:class:`vskernels.Bicubic(b=0, c=1/2)`).
:param chkdr_args: Additional args to pass to chickendream.
:return: Grained clip in the given clip's format.
Expand Down
4 changes: 2 additions & 2 deletions lvsfunc/scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def reupscale(clip: vs.VideoNode,
:param height: Upscale height (Default: 1080).
:param kernel: py:class:`vskernels.Kernel` object used for downscaling the super-sampled clip.
This can also be the string name of the kernel
(Default: py:class:`vskernels.Bicubic(b=0, c=0.5)`).
(Default: py:class:`vskernels.Bicubic(b=0, c=1/2)`).
:param kwargs: Arguments passed to znedi3 (Default: nsize=4, nns=4, qual=2, pscrn=2).
:return: Reupscaled clip.
Expand Down Expand Up @@ -549,7 +549,7 @@ def mixed_rescale(clip: vs.VideoNode, width: None | int = None, height: int = 72
:param height: Upscale height (Default: 720).
:param kernel: py:class:`vskernels.Kernel` object used for the descaling.
This can also be the string name of the kernel
(Default: py:class:`vskernels.Bicubic(b=0, c=0.5)`).
(Default: py:class:`vskernels.Bicubic(b=0, c=1/2)`).
:param downscaler: Kernel or custom scaler used to downscale the clip.
This can also be the string name of the kernel
(Default: py:func:`lvsfunc.scale.ssim_downsample`).
Expand Down
1 change: 0 additions & 1 deletion lvsfunc/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
__all__: List[str] = [
'Coefs', 'Coordinate', 'CreditMask', 'CURVES', 'CustomScaler', 'Direction', 'F', 'Matrix', 'Position', 'Range',
'RegressClips', 'Resolution', 'ScaleAttempt', 'SceneChangeMode', 'Size', 'T', 'VideoProp', 'VSFunction',
'_VideoNode'
]


Expand Down
2 changes: 1 addition & 1 deletion lvsfunc/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ def match_clip(clip: vs.VideoNode, ref: vs.VideoNode,
:param length: Match clip length (Default: False).
:param kernel: py:class:`vskernels.Kernel` object used for the format conversion.
This can also be the string name of the kernel
(Default: py:class:`vskernels.Bicubic(b=0, c=0.5)`).
(Default: py:class:`vskernels.Bicubic(b=0, c=1/2)`).
:return: Clip that matches the ref clip in format.
"""
Expand Down

0 comments on commit 31b67eb

Please sign in to comment.