shssoichiro / soifunc

Vapoursynth helper utilities
MIT License
9 stars 0 forks source link

SQTGMC Mode 2 8 Bit Only Mask color format #7

Closed Ironclad17 closed 8 months ago

Ironclad17 commented 1 year ago

In VSEditor

src = core.resize.Point(src, matrix_in_s="rgb", transfer_in_s="601", primaries_in_s="170m", range_in_s="full", format=vs.YUV444P16, matrix_s="170m", transfer_s="601", primaries_s="170m", range_s="full")
deint = soi.SQTGMC(src, preset="slowest", input_type=2, tff=True, fps_divisor=2, gpu=True, device=0)

Gave the error

Failed to evaluate the script:
Python exception: Mask: input clip must be GRAY8, YUV420P8, YUV422P8, YUV440P8, or YUV444P8, with constant dimensions.

Traceback (most recent call last):
File "src\cython\vapoursynth.pyx", line 2866, in vapoursynth._vpy_evaluate
File "src\cython\vapoursynth.pyx", line 2867, in vapoursynth._vpy_evaluate
File "E:\Editing\TFL.vpy", line 10, in 
deint = soi.SQTGMC(src, preset="slowest", input_type=2, tff=True, fps_divisor=2, gpu=True, device=0)
File "C:\Users\*\AppData\Local\Programs\Python\Python310\lib\site-packages\soifunc\deint.py", line 615, in SQTGMC
input_type_blend = core.mv.Mask(search_clip, b_vec1, kind=1, ml=prog_sad_mask)
File "src\cython\vapoursynth.pyx", line 2612, in vapoursynth.Function.__call__
vapoursynth.Error: Mask: input clip must be GRAY8, YUV420P8, YUV422P8, YUV440P8, or YUV444P8, with constant dimensions.

Only occurs when format is set to a bitdepth above 8. Can mask color format differ from the input clip?

adworacz commented 8 months ago

This is a known limitation of MVMask (it only supports 8bit right now): https://github.com/dubhater/vapoursynth-mvtools/issues/16

A workaround might be running MVMask on an 8-bit version of the clip, and then scaling the resulting mask clip back up to the desired bit depth.

Ironclad17 commented 8 months ago

Thanks for the clarification. I ended up doing the obvious and only changing bitdepth and colorspace after deinterlacing. That should also be more accurate.