Skip to content

Commit

Permalink
Support dynamic size in ComplexKernel
Browse files Browse the repository at this point in the history
  • Loading branch information
Setsugennoao committed Nov 16, 2023
1 parent d467b80 commit 1f8cf53
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions vskernels/kernels/complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,18 @@ def scale( # type: ignore[override]
) -> vs.VideoNode:
check_correct_subsampling(clip, width, height)

kwargs = self._get_kwargs_keep_ar(sar, dar, keep_ar, **kwargs)
const_size = 0 not in (clip.width, clip.height)

kwargs, shift, out_sar = self._handle_crop_resize_kwargs(clip, width, height, shift, **kwargs)
if const_size:
kwargs = self._get_kwargs_keep_ar(sar, dar, keep_ar, **kwargs)

kwargs, shift, out_sar = self._handle_crop_resize_kwargs(clip, width, height, shift, **kwargs)

kwargs = self.get_scale_args(clip, shift, width, height, **kwargs)

clip = self.scale_function(clip, **kwargs)

if out_sar:
if const_size and out_sar:
clip = out_sar.apply(clip)

return clip
Expand Down

0 comments on commit 1f8cf53

Please sign in to comment.