Advertisement
mawen1250

Steins Gate BDrip test5 by mawen1250

May 29th, 2012
452
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. MP_Pipeline("""
  2.  
  3. ### platform: win32
  4.  
  5. SetMemoryMax(300)
  6.  
  7. src="E:\mawen1250\SG\STEINS;GATE 003\BDROM\BDMV\STREAM\00002.m2ts"
  8. cf = src + ".ffindex"
  9. FFIndex(src, cachefile=cf, demuxer="lavf")
  10. FFVideoSource(src, cachefile=cf, seekmode=-1, threads=1)
  11. #DSS2(src)
  12. emask=last.tcanny(sigma=1.2, mode=1, plane=1)
  13.  
  14. ### export clip: emask
  15.  
  16. ### prefetch: 24,12
  17.  
  18. ### ###
  19.  
  20. ### platform: win32
  21.  
  22. SetMemoryMax(600)
  23.  
  24. src=last
  25.  
  26.  w       = width(src)
  27.  h       = height(src)
  28.  upw4    = Round(w*0.375)*4
  29.  uph4    = Round(h*0.375)*4
  30.  dehalo = src.Dehalo_Alpha_mt(darkstr=0.0,brightstr=1.0,rx=1.8,ry=1.8,highsens=100,lowsens=30)
  31.  #aa_clip = dehalo.eedi2(field=1, mthresh=10, lthresh=20, vthresh=20, maxd=24, nt=50).Spline36Resize(w, h, 0, -0.5).TurnRight().eedi2(field=1, mthresh=10, lthresh=20, vthresh=20, maxd=24, nt=50).Spline36Resize(h, w, 0, -0.5).TurnLeft()
  32.  #aa_clip = dehalo.nnedi3_rpow2(rfactor=2, fwidth=upw4, fheight=upw4, nsize=1, nns=3, qual=2).SangNom(aa=48).TurnRight().SangNom(aa=48).binomialBlur(varY=1.0,varC=1.0,usemmx=true).Spline36Resize(h, w, 0.5, -0.5).TurnLeft()
  33.  aa_clip = dehalo.Spline64Resize(upw4, uph4).Repair(dehalo.GaussResize(upw4, uph4, p=100), 1).SangNom(aa=15).TurnRight().SangNom(aa=15).binomialBlur(varY=0.5,varC=0.5,usemmx=true).Spline36Resize(h, w).TurnLeft()
  34.  #dehalo_linear = dehalo.U16.Dither_y_gamma_to_linear(curve="709")
  35.  #up1 = dehalo_linear.Dither_resize16(upw4, uph4, kernel="Spline64", Y=3, U=1, V=1).Dither_y_linear_to_gamma(curve="709")
  36.  #up2 = dehalo_linear.Dither_resize16(upw4, uph4, kernel="Gauss", a1=100, Y=3, U=1, V=1).Dither_y_linear_to_gamma(curve="709")
  37.  #up1_8 = up1.DitherPost(mode=8, Y=3, U=1, V=1)
  38.  #up2_8 = up2.DitherPost(mode=8, Y=3, U=1, V=1)
  39.  #aa_clip_8 = up1_8.Repair(up2_8, 1, 0).SangNom(aa=15).TurnRight().SangNom(aa=15).TurnLeft().AssumeFrameBased()
  40.  #aadiff16 = mt_makediff(aa_clip_8, up1_8, Y=3, U=1, V=1).U16
  41.  #aa_clip16 = Dither_add16(up1, aadiff16, Y=3, U=1, V=1, dif=true).Dither_y_gamma_to_linear(curve="709").Dither_resize16(w, h, kernel="Gauss", a1=28, Y=3, U=1, V=1).Dither_y_linear_to_gamma(curve="709")
  42.  #aa_clip = aa_clip16.DitherPost(mode=8, Y=3, U=1, V=1)
  43.  aa_cs = mt_adddiff(aa_clip, mt_makediff(aa_clip, aa_clip.RemoveGrain(11,-1), Y=3, U=1, V=1).Repair(mt_makediff(dehalo, aa_clip, Y=3, U=1, V=1), 13, 0), Y=3, U=1, V=1)
  44.  blurc = src.Gaussianblur(nthreads=2,varY=0.35,varC=0.35,gfunc=1,gfuncc=1,pcr=1,pcrc=2,Y=3,U=2,V=2)
  45.  sharpmask = emask.mt_lut("x 48 < 0 x 144 >= 399 x - x 2 << 188 - ? ?", Y=3, U=1, V=1)
  46.  postaaC = aa_cs.LSFmod1(defaults="slow",Smode=5,Smethod=3,Lmode=0,strength=50,sharpmask=sharpmask,preblur="OFF",secure=true,edgemode=0,soft=0,soothe=false,ss_x=1.00,ss_y=1.00,source=blurc)
  47.  aamask = emask.mt_lut("x 20 < 0 x 20 - 3 << ?", Y=3, U=1, V=1).mt_inflate(Y=3, U=1, V=1)#.RemoveGrain(20, -1)
  48.  aaed8 = mt_merge(src, postaaC, aamask, luma=false, Y=3, U=2, V=2)
  49.  
  50. dbmask=emask.mt_lut("x 6 > x 6 - 6 << 0 ?", Y=3, U=1, V=1).mt_inflate(Y=3, U=1, V=1)
  51. aaed8
  52.  
  53. ### export clip: dbmask
  54.  
  55. ### prefetch: 12,6
  56.  
  57. ### ###
  58.  
  59. ### platform: win32
  60.  
  61. SetMemoryMax(1050)
  62.  
  63. aaed8=last
  64. aaed16=aaed8.U16
  65.  
  66. #nr8=aaed8.MCTD(settings="medium", radius=3, sigma=4, limit=-1, limit2=0, chroma=false, twopass=false, useTTmpSm=true,
  67. #\pp=true, protect=true, deblock=false, useQED=true, enhance=false, GPU=false, fixband=false, sharp=false).Repair(aaed8,3,0)
  68.  
  69. 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)
  70. prenr8=prenr16.DitherPost(mode=8, Y=3, U=1, V=1)
  71.  
  72. nr16=aaed8.SMDegrain(lsb_in=false,lsb=true,lsb_out=true,tr=3,Contrasharp=false,RefineMotion=true,plane=0,prefilter=prenr8,
  73. \thSAD=300,thSADC=150,blksize=16,thSCD1=200,thSCD2=100,Truemotion=false,Chroma=false,limit=4,limitC=1)
  74.  
  75. aaed16
  76.  
  77. ### export clip: aaed8,dbmask,prenr16,nr16
  78.  
  79. ### prefetch: 6,3
  80.  
  81. ### ###
  82.  
  83. SetMemoryMax(1150)
  84.  
  85. aaed16=last
  86.  
  87. nrdiff1=makediff16(prenr16, aaed16, Y=3, U=1, V=1)
  88. nrdiff2=makediff16(nr16, aaed16, Y=3, U=1, V=1)
  89. abnrdiff1=Dither_lut16(nrdiff1, "x 32768 - abs", Y=3, U=1, V=1)
  90. abnrdiff2=Dither_lut16(nrdiff2, "x 32768 - abs", Y=3, U=1, V=1)
  91. abnrdiffdiff=makediff16(abnrdiff1, abnrdiff2, Y=3, U=1, V=1)
  92. nrbin=Dither_lut16(abnrdiffdiff, "x 32768 < 0 65535 ?", Y=3, U=1, V=1)
  93. lnr16=Dither_merge16(prenr16, nr16, nrbin, luma=false, Y=3, U=4, V=4)
  94.  
  95. #lnr8=lnr16.DitherPost(mode=-1, Y=3, U=1, V=1)
  96. #rep=Repair(lnr8,aaed8,3,0)
  97. #repdiff16=mt_makediff(rep, lnr8, Y=3, U=1, V=1).U16
  98. rep16=lnr16#.Dither_add16(repdiff16, Y=3, U=2, V=2, dif=true)
  99.  
  100. noise=makediff16(aaed16, rep16, Y=3, U=1, V=1)
  101. diff0=noise.Dither_lut16(Y=-32768,U=-32768,V=-32768)
  102. lumamask=aaed8.mt_lut("x 127 > 0 x 64 > 512 x 2 << - 255 ? ?",U=1,V=1).RemoveGrain(19, -1)
  103. noisereduc=Dither_merge16_8(diff0, noise, lumamask, luma=false)
  104.  
  105. db1=rep16.f3kdb(range=24, Y=42, Cb=36, Cr=36, grainY=0, grainC=0, dither_algo=3, dynamic_grain=true, keep_tv_range=false, input_mode=1, output_mode=1, output_depth=16)
  106. db2=rep16.f3kdb(range=6, Y=52, Cb=42, Cr=42, grainY=0, grainC=0, dither_algo=3, dynamic_grain=true, keep_tv_range=false, input_mode=1, output_mode=1, output_depth=16)
  107. dbdiff1=makediff16(db1, rep16, Y=3, U=3, V=3)
  108. dbdiff2=makediff16(db2, rep16, Y=3, U=3, V=3)
  109. abdbdiff1=Dither_lut16(dbdiff1, "x 32768 - abs", Y=3, U=3, V=3)
  110. abdbdiff2=Dither_lut16(dbdiff2, "x 32768 - abs", Y=3, U=3, V=3)
  111. abdbdiffdiff=makediff16(abdbdiff1, abdbdiff2, Y=3, U=3, V=3)
  112. dbbin=Dither_lut16(abdbdiffdiff, "x 32768 > 0 65535 ?", Y=3, U=3, V=3)
  113. db3=Dither_merge16(db1, db2, dbbin, luma=false, Y=3, U=3, V=3)
  114.  
  115. db=Dither_add16(db3, noisereduc, Y=3, U=2, V=2, dif=true)
  116.  
  117. Dither_merge16_8(db, aaed16, dbmask, luma=true)
  118. Down10(tvRange=true, stack=false)
  119.  
  120. """)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement