From 0ab7a880b22c93a866da08780b54a20cb075d3e2 Mon Sep 17 00:00:00 2001 From: LightArrowsEXE Date: Sat, 11 Nov 2023 14:17:24 +0100 Subject: [PATCH] Placebo._kernel_size: Use fallback, fix typing --- vskernels/kernels/placebo.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vskernels/kernels/placebo.py b/vskernels/kernels/placebo.py index 30c0125..b505014 100644 --- a/vskernels/kernels/placebo.py +++ b/vskernels/kernels/placebo.py @@ -3,7 +3,7 @@ from math import ceil from typing import TYPE_CHECKING, Any -from vstools import Transfer, TransferT, core, inject_self, vs +from vstools import Transfer, TransferT, core, fallback, inject_self, vs from .complex import LinearScaler @@ -84,12 +84,12 @@ def get_params_args( lut_entries=self.lut_entries, trc=curve.value_libplacebo ) - def _kernel_size(self, taps: float | None = None, b: int | None = None, c: int | None = None) -> int: + def _kernel_size(self, taps: float | None = None, b: float | None = None, c: float | None = None) -> int: if taps: - return ceil(self.taps) + return ceil(taps) if b or c: - return 1 + ((b if b and b != 0 else 0, c if c and c != 0 else 0.5) != (0, 0)) + return 1 + ((fallback(b, 0), fallback(c, 0.5)) != (0, 0)) return 1