Skip to content

Commit

Permalink
Fix vsrgtools function calls (Jaded-Encoding-Thaumaturgy#142)
Browse files Browse the repository at this point in the history
* fix vsrgtools blur function calls

* fix contrasharpening call
  • Loading branch information
Ichunjo committed Jan 19, 2025
1 parent 0f0acd4 commit caedbc5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions vsdenoise/prefilters.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from vsexprtools import ExprOp, complexpr_available, norm_expr
from vskernels import Bicubic, Bilinear, Scaler, ScalerT
from vsmasktools import retinex
from vsrgtools import bilateral, blur, gauss_blur, min_blur
from vsrgtools import bilateral, box_blur, gauss_blur, min_blur
from vstools import (
MISSING, ColorRange, ConvMode, CustomEnum, CustomIntEnum, CustomRuntimeError, MissingT, PlanesT, SingleOrArr,
SingleOrArrOpt, check_variable, clamp, core, depth, disallow_variable_format, disallow_variable_resolution,
Expand Down Expand Up @@ -71,13 +71,13 @@ def _run(clip: vs.VideoNode, planes: PlanesT, **kwargs: Any) -> vs.VideoNode:
return clip

if pref_type.value in {Prefilter.MINBLUR1, Prefilter.MINBLUR2, Prefilter.MINBLUR3}:
return min_blur(clip, int(pref_type._name_[-1]), planes)
return min_blur(clip, int(pref_type._name_[-1]), planes=planes)

if pref_type == Prefilter.MINBLURFLUX:
temp_thr, spat_thr = kwargs.get('temp_thr', 2), kwargs.get('spat_thr', 2)
return min_blur(clip, 2, planes).flux.SmoothST( # type: ignore
scale_value(temp_thr, 8, clip, ColorRange.FULL, ColorRange.FULL),
scale_value(spat_thr, 8, clip, ColorRange.FULL, ColorRange.FULL),
return min_blur(clip, 2, planes=planes).flux.SmoothST( # type: ignore
scale_delta(temp_thr, 8, clip),
scale_delta(spat_thr, 8, clip),
planes
)

Expand Down Expand Up @@ -149,7 +149,7 @@ def _run(clip: vs.VideoNode, planes: PlanesT, **kwargs: Any) -> vs.VideoNode:

downscale = downscaler.scale(clip, clip.width // scale, clip.height // scale)

boxblur = blur(downscale, kwargs.pop('radius', 1), kwargs.pop('mode', ConvMode.HV), planes)
boxblur = box_blur(downscale, kwargs.pop('radius', 1), mode=kwargs.pop('mode', ConvMode.HV), planes=planes)

return upscaler.scale(boxblur, clip.width, clip.height)

Expand All @@ -166,7 +166,7 @@ def _run(clip: vs.VideoNode, planes: PlanesT, **kwargs: Any) -> vs.VideoNode:
return gauss_blur(clip, **(kwargs | dict[str, Any](planes=planes)))

if pref_type in {Prefilter.GAUSSBLUR1, Prefilter.GAUSSBLUR2}:
boxblur = blur(clip, kwargs.pop('radius', 1), kwargs.get('mode', ConvMode.HV), planes=planes)
boxblur = box_blur(clip, kwargs.pop('radius', 1), mode=kwargs.get('mode', ConvMode.HV), planes=planes)

if 'sharp' not in kwargs and 'sigma' not in kwargs:
kwargs |= dict(sigma=1.75)
Expand Down

0 comments on commit caedbc5

Please sign in to comment.