Skip to content

Commit

Permalink
Placebo._kernel_size: Use fallback, fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
LightArrowsEXE committed Nov 11, 2023
1 parent 49ea444 commit 0ab7a88
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions vskernels/kernels/placebo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 0ab7a88

Please sign in to comment.