shssoichiro/soifunc

SQTGMC Mode 2 8 Bit Only Mask color format

Closed this issue · 2 comments

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?

This is a known limitation of MVMask (it only supports 8bit right now): dubhater/vapoursynth-mvtools#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.

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