import vapoursynth as vs core = vs.core import havsfunc clip = core.lsmas.LWLibavSource(source="D:/Encode/Church/archive_test/2022-03-20_110000_deinterlaced_0500.mkv") clip = havsfunc.QTGMC(Input=clip, Preset="Slow", InputType=0, TFF=True, FPSDivisor=2, TR2=2, Sharpness=0.3, SourceMatch=1, Lossless=2, MatchPreset="Slow", MatchPreset2="Slow") clip = core.resize.Spline36(clip, format=vs.YUV420P10) compSharp = core.cas.CAS(clip, sharpness=0.2) # Sharpen clip for non-shown motion compensated frames, helps retain higher frequency detail at the expense of denoise strength super = core.mv.Super(clip, hpad=16, vpad=16, rfilter=4) # all levels for MAnalyse superSharp = core.mv.Super(compSharp, hpad=16, vpad=16, rfilter=4) # all levels for MAnalyse backward2 = core.mv.Analyse(super, isb=True, blksize=16, overlap=8, delta=2, search=3, dct=6) backward = core.mv.Analyse(super, isb=True, blksize=16, overlap=8, search=3, dct=6) forward = core.mv.Analyse(super, isb=False, blksize=16, overlap=8, search=3, dct=6) forward2 = core.mv.Analyse(super, isb=False, blksize=16, overlap=8, delta=2, search=3, dct=6) backward2 = core.mv.Recalculate(super, backward2, blksize=8, overlap=4, search=3, divide=2, dct=6) # Optionally Recalculate for higher consistency / quality backward = core.mv.Recalculate(super, backward, blksize=8, overlap=4, search=3, divide=2, dct=6) forward = core.mv.Recalculate(super, forward, blksize=8, overlap=4, search=3, divide=2, dct=6) forward2 = core.mv.Recalculate(super, forward2, blksize=8, overlap=4, search=3, divide=2, dct=6) backward_re2 = core.mv.Finest(backward2) backward_re = core.mv.Finest(backward) forward_re = core.mv.Finest(forward) forward_re2 = core.mv.Finest(forward2) clip = core.mv.Degrain2(clip, superSharp, backward_re, forward_re, backward_re2, forward_re2, thsad=220, thscd1=300) clip.set_output(0)