diff --git a/vskernels/kernels/bicubic.py b/vskernels/kernels/bicubic.py index a62bd90..d26798b 100644 --- a/vskernels/kernels/bicubic.py +++ b/vskernels/kernels/bicubic.py @@ -70,7 +70,9 @@ def get_params_args( @inject_self.property def kernel_size(self) -> int: - return 1 + ((self.b, self.c) != (0, 0)) + if (self.b, self.c) == (0, 0): + return 1 + return 2 class BSpline(Bicubic): diff --git a/vskernels/kernels/placebo.py b/vskernels/kernels/placebo.py index 8c44dfa..c9ada32 100644 --- a/vskernels/kernels/placebo.py +++ b/vskernels/kernels/placebo.py @@ -84,15 +84,14 @@ def get_params_args( lut_entries=self.lut_entries, trc=curve.value_libplacebo ) - def _kernel_size(self, taps: float | None = None, b: float | None = None, c: float | None = None) -> int: - if taps: - return ceil(taps) + @inject_self.property + def kernel_size(self) -> int: + from .bicubic import Bicubic - if b or c: - return 1 + ((fallback(b, 0), fallback(c, 0.5)) != (0, 0)) + if self.taps: + return ceil(self.taps) - return 1 + if self.b or self.c: + return Bicubic(self.b, self.c).kernel_size - @inject_self.property - def kernel_size(self) -> int: - return self._kernel_size(self.taps, self.b, self.c) + return 1