Advertisement
mawen1250

EP NRDB Script for S;G

May 28th, 2012
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SetMemoryMax(1600)
  2.  
  3. src="D:\Steins;Gate 2011 [BluRay 1920x1080p x264-Hi10P FLAC] - Mysilu\S;G 07.mkv"
  4. cf = src + ".ffindex"
  5. #FFIndex(src, cachefile=cf, demuxer="lavf")
  6. #FFVideoSource(src, cachefile=cf, seekmode=-1, threads=1)
  7. DSS2(src)
  8. emask=last.tcanny(sigma=1.2, mode=1, plane=1)
  9.  
  10. aaed8=last
  11. aaed16=last.U16
  12.  
  13. #nr8=aaed8.MCTD(settings="medium", radius=3, sigma=4, limit=-1, limit2=0, chroma=false, twopass=false, useTTmpSm=true,
  14. #\pp=true, protect=true, deblock=false, useQED=true, enhance=false, GPU=false, fixband=false, sharp=false).Repair(aaed8,3,0)
  15.  
  16. prenr16=aaed16.dfttest(lsb_in=true,lsb=true,Y=true,U=false,V=false,sigma=4.0,sigma2=4.0,sbsize=8,sosize=6,tbsize=3,threads=2)
  17. prenr8=prenr16.DitherPost(mode=8, Y=3, U=1, V=1)
  18.  
  19. nr16=aaed8.SMDegrain(lsb_in=false,lsb=true,lsb_out=true,tr=3,Contrasharp=false,RefineMotion=true,plane=0,prefilter=prenr8,
  20. \thSAD=300,thSADC=150,blksize=16,thSCD1=200,thSCD2=100,Truemotion=false,Chroma=false,limit=4,limitC=1)
  21.  
  22. nrdiff1=makediff16(prenr16, aaed16, Y=3, U=1, V=1)
  23. nrdiff2=makediff16(nr16, aaed16, Y=3, U=1, V=1)
  24. abnrdiff1=Dither_lut16(nrdiff1, "x 32768 - abs", Y=3, U=1, V=1)
  25. abnrdiff2=Dither_lut16(nrdiff2, "x 32768 - abs", Y=3, U=1, V=1)
  26. abnrdiffdiff=makediff16(abnrdiff1, abnrdiff2, Y=3, U=1, V=1)
  27. nrbin=Dither_lut16(abnrdiffdiff, "x 32768 < 0 65535 ?", Y=3, U=1, V=1)
  28. lnr16=Dither_merge16(prenr16, nr16, nrbin, luma=false, Y=3, U=4, V=4)
  29.  
  30. #lnr8=lnr16.DitherPost(mode=-1, Y=3, U=1, V=1)
  31. #rep=Repair(lnr8,aaed8,3,0)
  32. #repdiff16=mt_makediff(rep, lnr8, Y=3, U=1, V=1).U16
  33. rep16=lnr16#.Dither_add16(repdiff16, Y=3, U=2, V=2, dif=true)
  34.  
  35. noise=makediff16(aaed16, rep16, Y=3, U=1, V=1)
  36. diff0=noise.Dither_lut16(Y=-32768,U=-32768,V=-32768)
  37. lumamask=aaed8.mt_lut("x 127 > 0 x 64 > 512 x 2 << - 255 ? ?",U=1,V=1).RemoveGrain(19, -1)
  38. noisereduc=Dither_merge16_8(diff0, noise, lumamask, luma=false)
  39.  
  40. db1=rep16.f3kdb(range=31, Y=48, Cb=40, Cr=40, grainY=0, grainC=0, dither_algo=3, dynamic_grain=true, keep_tv_range=false, input_mode=1, output_mode=1, output_depth=16)
  41. db2=rep16.f3kdb(range=6, Y=52, Cb=44, Cr=44, grainY=0, grainC=0, dither_algo=3, dynamic_grain=true, keep_tv_range=false, input_mode=1, output_mode=1, output_depth=16)
  42. dbdiff1=makediff16(db1, rep16, Y=3, U=3, V=3)
  43. dbdiff2=makediff16(db2, rep16, Y=3, U=3, V=3)
  44. abdbdiff1=Dither_lut16(dbdiff1, "x 32768 - abs", Y=3, U=3, V=3)
  45. abdbdiff2=Dither_lut16(dbdiff2, "x 32768 - abs", Y=3, U=3, V=3)
  46. abdbdiffdiff=makediff16(abdbdiff1, abdbdiff2, Y=3, U=3, V=3)
  47. dbbin=Dither_lut16(abdbdiffdiff, "x 32768 > 0 65535 ?", Y=3, U=3, V=3)
  48. db3=Dither_merge16(db1, db2, dbbin, luma=false, Y=3, U=3, V=3)
  49.  
  50. db=Dither_add16(db3, noisereduc, Y=3, U=2, V=2, dif=true)
  51.  
  52. dbmask=emask.mt_lut("x 7 > x 7 - 6 << 0 ?",Y=3,U=1,V=1).mt_inflate(Y=3,U=1,V=1)
  53.  
  54. Dither_merge16_8(db, aaed16, dbmask, luma=true)
  55. Down10(tvRange=true, stack=false)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement