darkswordsman

VPY - [DSM] Komi Can't Communicate - S1E01 [WEBRip 1080p HEVC EAC3]

Jan 5th, 2022
577
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.99 KB | None | 0 0
  1. import vapoursynth as vs
  2. core = vs.core
  3. import vsutil
  4. import vardefunc
  5. from lvsfunc import kernels
  6.  
  7. src = core.lsmas.LWLibavSource(r'komi-s1e1.mkv')
  8.  
  9. src = src.std.Trim(first=264,last=34595)
  10.  
  11. depth = vsutil.depth(src, 32)
  12.  
  13. def dft(ingest, sigma):
  14.   return ingest.dfttest.DFTTest(sigma=sigma, tbsize=1)
  15.  
  16. def descale(ingest):
  17.   y, u, v = vsutil.split(ingest)
  18.   w = vsutil.get_w(height=956,)
  19.   descaled = y.descale.Debicubic(w, 956, b=0.33, c=0.33)
  20.   rescale = vardefunc.scale.nnedi3cl_double(descaled, pscrn=1)
  21.   rescale = kernels.Bicubic(b=-1/2, c=1/4).scale(rescale, 1920, 1080)
  22.  
  23.   rescale = vsutil.join([rescale, u, v])
  24.   rescale = vsutil.depth(rescale, 16)
  25.  
  26.   return rescale
  27.  
  28. def deband(ingest, grainy, grainc):
  29.   return core.f3kdb.Deband(ingest, range=15, y=64, cb=64, cr=64, grainy=grainy, grainc=grainc, dynamic_grain=True, sample_mode=2)
  30.  
  31. output = dft(depth, 4)
  32. output = descale(output)
  33. output = deband(output, 32, 32)
  34.  
  35. final = vsutil.depth(output, 10)
  36. final.set_output()
Advertisement
Add Comment
Please, Sign In to add comment