Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import vapoursynth as vs
- import functools
- import nnedi3_resample
- import edi_rpow2
- import fag3kdb
- import finesharp
- import havsfunc as haf
- import adaptivegrain as adg
- import edi_rpow2 as edr
- import kagefunc as kgf
- import Oyster as oys
- import vsTAAmbk as taa
- import fvsfunc as fvf
- import mvsfunc as mvf
- core = vs.get_core()
- core.max_cache_size = 20000
- clip1 = core.d2v.Source(r"I:\[NHK]\[DVDISO] Welcome to the N.H.K\NHK_NI_YOUKOSO_01.d2v")
- clip2 = core.d2v.Source(r"I:\[NHK]\USDVD WELCOME TO THE NHK\VTS_02_1.d2v")
- clip1 = core.std.SeparateFields(clip1,1)
- clip1 = core.std.Trim(clip1,first=2,last=85119)
- clip2 = core.std.SeparateFields(clip2,1)
- clip2 = core.std.Trim(clip2,first=22,last=85137)
- clip1 = core.std.DoubleWeave(clip1)
- clip1 = core.std.SelectEvery(clip1, 2, 0)
- clip2 = core.std.DoubleWeave(clip2)
- clip2 = core.std.SelectEvery(clip2, 2, 0)
- clip1 = core.std.CropRel(clip1, left=4, top=4, right=4, bottom=0)
- clip2 = core.std.CropRel(clip2, left=4, top=2, right=4, bottom=2)
- clip1 = core.std.Trim(clip1,first=1)
- y = core.std.ShufflePlanes(clip2, 0, colorfamily=vs.GRAY)
- u = core.std.ShufflePlanes(clip1, 1, colorfamily=vs.GRAY)
- v = core.std.ShufflePlanes(clip1, 2, colorfamily=vs.GRAY)
- clip2 = core.std.ShufflePlanes(clips=[y, u, v], planes = [0,0,0], colorfamily=vs.YUV)
- test = core.std.StackHorizontal(clips=[clip1,clip2])
- test = core.vivtc.VFM(test, order=1,mode=3)
- test = core.vivtc.VDecimate(test)
- test = fvf.Depth(test, 32)
- test = core.ftf.FixFades(test, mode=0, threshold=0.002, color=[0.0, 0.0, 0.0], opt=True)
- clip2 = core.std.CropRel(test, left=712, top=0, right=0, bottom=0)
- clip2 = nnedi3_resample.nnedi3_resample(clip2,2*clip2.width,2*clip2.height,csp = vs.YUV444P16, mats = "601", curves="709")
- myref=clip2.knlm.KNLMeansCL(a=2, h=0.4, d=3, s=8, device_type='gpu', device_id=0)
- clip2=mvf.BM3D(clip2, sigma=[4,0], radius1=2,ref=myref,matrix=6)
- clip2=haf.SMDegrain(clip2, tr=0.3, prefilter=3, RefineMotion=True, search=4)
- #clip2=core.deblock.Deblock(clip2)
- clip2=fvf.AutoDeblock(clip2)
- #out = taa.TAAmbk(out,aatype=1)
- out=core.resize.Spline16(clip=clip2,width=1024,height=576)
- ref = out
- out = ref.f3kdb.Deband(range=12, y=60, cb=25, cr=25, grainy=15, grainc=0,output_depth=16)
- mask = kgf.retinex_edgemask(ref).std.Inflate()
- merged = core.std.MaskedMerge(out, ref, mask)
- merged = kgf.adaptive_grain(merged,0.30)
- merged = fvf.Depth(merged, 10)
- merged.set_output()
Advertisement
Add Comment
Please, Sign In to add comment