asarian
18th May 2025, 02:46
Currently, I only need to deinterlace source; like
vid = haf.QTGMC (vid, InputType=0, Preset="Slower", TR2=3, EdiQual=2, TFF=True)
This goes, however, much slower than expected (I usually just denoise with KNLMEANSCL). Can I speed this up somehow, using the GPU? I tried 'NNEDI3' for Edi, but that only made things even slower.
Thanks.
Selur
18th May 2025, 07:45
a. use a faster preset
b. try https://github.com/Selur/VapoursynthScriptsInHybrid/blob/master/qtgmc.py
it has an opencl option and will use akarin, nlm_cuda, knlmeanscl, dfttest2_nvrtc, zsmooth, when available.
Cu Selur
asarian
18th May 2025, 10:09
a. use a faster preset
b. try https://github.com/Selur/VapoursynthScriptsInHybrid/blob/master/qtgmc.py
it has an opencl option and will use akarin, nlm_cuda, knlmeanscl, dfttest2_nvrtc, zsmooth, when available.
Cu Selur
Thank you kindly! :thanks:
asarian
18th May 2025, 22:07
a. use a faster preset
b. try https://github.com/Selur/VapoursynthScriptsInHybrid/blob/master/qtgmc.py
it has an opencl option and will use akarin, nlm_cuda, knlmeanscl, dfttest2_nvrtc, zsmooth, when available.
Cu Selur
I realized -- too late -- opencl does not work on YUV420P10. Still useful to have that opencl QTGMC version. :)
Selur
19th May 2025, 04:28
NNEDI3CL should work fine with YUV420P10, 'only constant format 8-16 bit integer and 32 bit float input supported', so YUV420P10 should work.
Cu Selur
asarian
19th May 2025, 14:10
NNEDI3CL should work fine with YUV420P10, 'only constant format 8-16 bit integer and 32 bit float input supported', so YUV420P10 should work.
Cu Selur
Well, I used the following:
vid = QTGMCA(vid, InputType=0, Preset="Slower", TR2=3, EdiQual=2, TFF=True, EdiMode="nnedi3cl", opencl=True)
(QTGMCA being the standalone, cuda enabled version of QTGMC you pointed me to)
This was on YUV420P10 material. No errors reported, but I saw no GPU load of any kind, and x265 indicated the entire process would take about as long as without opencl.
Selur
19th May 2025, 15:20
opencl=True will nnedi3 instead of znedi3 or nnedi3 when it's used, which it is not with your setting choice.
Looking at:
def QTGMC_Interpolate(
Input: vs.VideoNode,
InputType: int,
EdiMode: str,
NNSize: int,
NNeurons: int,
EdiQual: int,
EdiMaxD: int,
Fallback: Optional[vs.VideoNode] = None,
ChromaEdi: str = '',
TFF: Optional[bool] = None,
nnedi3_args: Mapping[str, Any] = {},
eedi3_args: Mapping[str, Any] = {},
opencl: bool = False,
device: Optional[int] = None,
) -> vs.VideoNode:
'''
Interpolate input clip using method given in EdiMode. Use Fallback or Bob as result if mode not in list. If ChromaEdi string if set then interpolate chroma
separately with that method (only really useful for EEDIx). The function is used as main algorithm starting point and for first two source-match stages
'''
is_gray = Input.format.color_family == vs.GRAY
if is_gray:
ChromaEdi = ''
planes = [0, 1, 2] if ChromaEdi == '' and not is_gray else [0]
field = 3 if TFF else 2
if opencl:
nnedi3 = partial(core.nnedi3cl.NNEDI3CL, field=field, device=device, **nnedi3_args)
if hasattr(core, 'EEDI3CL'):
eedi3 = partial(core.eedi3m.EEDI3CL, field=field, planes=planes, mdis=EdiMaxD, device=device, **eedi3_args)
else:
eedi3 = partial(core.eedi3m.EEDI3, field=field, planes=planes, mdis=EdiMaxD, **eedi3_args)
else:
if hasattr(core, 'znedi3'):
nnedi3 = partial(core.znedi3.nnedi3, field=field, **nnedi3_args)
else:
nnedi3 = partial(core.nnedi3.nnedi3, field=field, **nnedi3_args)
if hasattr(core, 'EEDI3CL'):
eedi3 = partial(core.eedi3m.EEDI3CL, field=field, planes=planes, mdis=EdiMaxD, device=device, **eedi3_args)
else:
eedi3 = partial(core.eedi3m.EEDI3, field=field, planes=planes, mdis=EdiMaxD, **eedi3_args)
if InputType == 1:
return Input
elif EdiMode == 'nnedi3':
interp = nnedi3(Input, planes=planes, nsize=NNSize, nns=NNeurons, qual=EdiQual)
elif EdiMode == 'eedi3+nnedi3':
interp = eedi3(Input, sclip=nnedi3(Input, planes=planes, nsize=NNSize, nns=NNeurons, qual=EdiQual))
elif EdiMode == 'eedi3':
interp = eedi3(Input)
elif EdiMode == 'bwdif':
interp = Input.bwdif.Bwdif(field=field)
else:
interp = fallback(Fallback, Input.resize.Bob(tff=TFF, filter_param_a=0, filter_param_b=0.5))
if ChromaEdi == 'nnedi3':
interpuv = nnedi3(Input, planes=[1, 2], nsize=4, nns=0, qual=1)
elif ChromaEdi == 'bwdif':
interpuv = Input.bwdif.Bwdif(field=field)
elif ChromaEdi == 'bob':
interpuv = Input.resize.Bob(tff=TFF, filter_param_a=0, filter_param_b=0.5)
else:
return interp
return core.std.ShufflePlanes([interp, interpuv], planes=[0, 1, 2], colorfamily=Input.format.color_family)
see: https://github.com/Selur/VapoursynthScriptsInHybrid/blob/1ce7655ee4682c4a829e8d767b1051d1450223ce/qtgmc.py#L1170
Thanks to opencl=True, nnedi3 will be mapped to core.nnedi3cl.NNEDI3CL, but since you used an unknown EdiMode:
interp = fallback(Fallback, Input.resize.Bob(tff=TFF, filter_param_a=0, filter_param_b=0.5))
will be used, which uses the default BOD deinterlacer. :)
=> If you use 'nnedi3' as EdiMode interp and interpuv will use NNEDI3CL. :)
Cu Selur
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.