Skip to content

Commit

Permalink
Use Matrix.from_param_or_video
Browse files Browse the repository at this point in the history
  • Loading branch information
Setsugennoao committed Nov 7, 2023
1 parent 196041a commit 46fef83
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vsscale/scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def scale( # type: ignore

if width > clip.width or height > clip.width:
if not matrix:
matrix = Matrix.from_param(matrix or self.matrix, self.__class__) or Matrix.from_video(clip, False)
matrix = Matrix.from_param_or_video(matrix or self.matrix, clip, False, self.__class__)

output = self._kernel.resample(output, vs.RGBS, Matrix.RGB, matrix)
output = output.std.Limiter()
Expand Down Expand Up @@ -321,7 +321,8 @@ def scale( # type:ignore

if clip.format.color_family is vs.YUV:
if not matrix:
matrix = Matrix.from_param(matrix or self.matrix, self.__class__) or Matrix.from_video(clip, False)
matrix = Matrix.from_param_or_video(matrix or self.matrix, clip, False, self.__class__)

wclip = self._kernel.resample(wclip, vs.RGBH if self.fp16 else vs.RGBS, Matrix.RGB, matrix)
else:
wclip = depth(wclip, 16 if self.fp16 else 32, vs.FLOAT)
Expand Down

0 comments on commit 46fef83

Please sign in to comment.