kriNon

Untitled

Sep 14th, 2017
457
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.41 KB | None | 0 0
  1. import vapoursynth as vs
  2. import functools
  3.  
  4. import nnedi3_resample
  5. import edi_rpow2
  6. import fag3kdb
  7. import finesharp
  8. import havsfunc as haf
  9. import adaptivegrain as adg
  10. import edi_rpow2 as edr
  11. import kagefunc as kgf
  12. import Oyster as oys
  13. import vsTAAmbk as taa
  14. import fvsfunc as fvf
  15. import mvsfunc as mvf
  16.  
  17. core = vs.get_core()
  18. core.max_cache_size = 20000
  19.  
  20. clip1 = core.d2v.Source(r"I:\[NHK]\[DVDISO] Welcome to the N.H.K\NHK_NI_YOUKOSO_01.d2v")
  21. clip2 = core.d2v.Source(r"I:\[NHK]\USDVD WELCOME TO THE NHK\VTS_02_1.d2v")
  22.  
  23. clip1 = core.std.SeparateFields(clip1,1)
  24. clip1 = core.std.Trim(clip1,first=2,last=85119)
  25.  
  26. clip2 = core.std.SeparateFields(clip2,1)
  27. clip2 = core.std.Trim(clip2,first=22,last=85137)
  28.  
  29. clip1 = core.std.DoubleWeave(clip1)
  30. clip1 = core.std.SelectEvery(clip1, 2, 0)
  31. clip2 = core.std.DoubleWeave(clip2)
  32. clip2 = core.std.SelectEvery(clip2, 2, 0)
  33.  
  34. clip1 = core.std.CropRel(clip1, left=4, top=4, right=4, bottom=0)
  35. clip2 = core.std.CropRel(clip2, left=4, top=2, right=4, bottom=2)
  36.  
  37. clip1 = core.std.Trim(clip1,first=1)
  38.  
  39. y = core.std.ShufflePlanes(clip2, 0, colorfamily=vs.GRAY)
  40. u = core.std.ShufflePlanes(clip1, 1, colorfamily=vs.GRAY)
  41. v = core.std.ShufflePlanes(clip1, 2, colorfamily=vs.GRAY)
  42. clip2 = core.std.ShufflePlanes(clips=[y, u, v], planes = [0,0,0], colorfamily=vs.YUV)
  43.  
  44. test = core.std.StackHorizontal(clips=[clip1,clip2])
  45. test = core.vivtc.VFM(test, order=1,mode=3)
  46. test = core.vivtc.VDecimate(test)
  47. test = fvf.Depth(test, 32)
  48. test = core.ftf.FixFades(test, mode=0, threshold=0.002, color=[0.0, 0.0, 0.0], opt=True)
  49.  
  50. clip2 = core.std.CropRel(test, left=712, top=0, right=0, bottom=0)
  51.  
  52. clip2 = nnedi3_resample.nnedi3_resample(clip2,2*clip2.width,2*clip2.height,csp = vs.YUV444P16, mats = "601", curves="709")
  53.  
  54. myref=clip2.knlm.KNLMeansCL(a=2, h=0.4, d=3, s=8, device_type='gpu', device_id=0)
  55. clip2=mvf.BM3D(clip2, sigma=[4,0], radius1=2,ref=myref,matrix=6)
  56. clip2=haf.SMDegrain(clip2, tr=0.3, prefilter=3, RefineMotion=True, search=4)
  57. #clip2=core.deblock.Deblock(clip2)
  58. clip2=fvf.AutoDeblock(clip2)
  59.  
  60. #out = taa.TAAmbk(out,aatype=1)
  61.  
  62. out=core.resize.Spline16(clip=clip2,width=1024,height=576)
  63.  
  64. ref = out
  65. out = ref.f3kdb.Deband(range=12, y=60, cb=25, cr=25, grainy=15, grainc=0,output_depth=16)
  66. mask = kgf.retinex_edgemask(ref).std.Inflate()
  67. merged = core.std.MaskedMerge(out, ref, mask)
  68. merged = kgf.adaptive_grain(merged,0.30)
  69. merged = fvf.Depth(merged, 10)
  70.  
  71. merged.set_output()
Advertisement
Add Comment
Please, Sign In to add comment