Skip to content

Commit

Permalink
Fix PelType values
Browse files Browse the repository at this point in the history
Fix #110
  • Loading branch information
Setsugennoao committed May 15, 2024
1 parent 665b80d commit 5e929b0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions vsdenoise/prefilters.py
Original file line number Diff line number Diff line change
Expand Up @@ -920,10 +920,12 @@ def scale(
def kernel_radius(self) -> int:
return self.scaler.kernel_radius

BILINEAR = CUSTOM(Bilinear)
BICUBIC = CUSTOM(Bicubic)
WIENER = CUSTOM(Bicubic(b=-0.6, c=0.4))

PelTypeBase.CUSTOM = CUSTOM
PelTypeBase.BILINEAR = BILINEAR
PelTypeBase.BICUBIC = BICUBIC
PelTypeBase.WIENER = WIENER

Expand Down Expand Up @@ -956,6 +958,9 @@ def scale( # type: ignore
) -> vs.VideoNode:
...

BILINEAR: CUSTOM
"""Performs scaling with the bilinear filter (:py:class:`vskernels.Bilinear`)."""

BICUBIC: CUSTOM
"""Performs scaling with default bicubic values (:py:class:`vskernels.Catrom`)."""

Expand Down Expand Up @@ -999,9 +1004,11 @@ def __call__(
else:
val = 1 << 3 - ceil(clip.height / 1000)

if val <= 1:
if val < 1:
pel_type = PelType.BILINEAR
elif val < 2:
pel_type = PelType.BICUBIC
elif val == 2:
elif val < 3:
pel_type = PelType.WIENER
else:
pel_type = PelType.NNEDI3
Expand Down

0 comments on commit 5e929b0

Please sign in to comment.