Advertisement
mawen1250

Rurouni Kenshin Shin Kyoto BDrip v2 by mawen1250

May 15th, 2012
364
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="D:\Rurouni Kenshin Shin Kyoto\00000.ts"
  8. cf = src + ".ffindex"
  9. #FFIndex(src, cachefile=cf, demuxer="lavf")
  10. #FFVideoSource(src, cachefile=cf, seekmode=-1, threads=1)
  11. DSS2(src)
  12.  
  13. emask = last.tcanny(sigma=1.2, mode=1, plane=1)
  14.  
  15. ### export clip: emask
  16.  
  17. ### prefetch: 32,16
  18. ### lock threads to cores
  19.  
  20. ### ###
  21.  
  22. ### platform: win32
  23.  
  24. SetMemoryMax(1000)
  25.  
  26. src       = last
  27. nr        = src.MCTD(settings="medium", radius=3, sigma=4, limit=-1, limit2=0, chroma=false, twopass=false, useTTmpSm=false,
  28. \pp=true, protect=true, deblock=false, useQED=true, enhance=false, GPU=false, fixband=false, sharp=false)
  29. mask1     = emask.mt_lut("x 3 <= 0 x 3 - 5 << ?",Y=3,U=1,V=1).mt_deflate()
  30. lumamask1 = src.mt_lut("x 192 > 0 x 96 > 192 x - 1 << 192 ? ?",U=1,V=1).RemoveGrain(19, -1)
  31. nrmask    = mt_logic(mask1,lumamask1,"max")
  32. mnr       = mt_merge(nr,src,nrmask,luma=false,Y=3,U=2,V=2)
  33.  
  34. last      = mnr
  35.  
  36. ### export clip: emask
  37.  
  38. ### prefetch: 8,4
  39. ### lock threads to cores
  40.  
  41. ### ###
  42.  
  43. SetMemoryMax(500)
  44.  
  45. mnr      = last
  46.  
  47.  w        = width(mnr)
  48.  h        = height(mnr)
  49.  upw4     = Round(w*0.375)*4
  50.  uph4     = Round(h*0.375)*4
  51.  dehalo   = mnr.Dehalo_Alpha_mt(darkstr=0.0,brightstr=1.0,rx=1.8,ry=1.8,highsens=100,lowsens=30)
  52.  #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()
  53.  aa_clip  = dehalo.Spline64Resize(upw4, uph4).Repair(dehalo.GaussResize(upw4, uph4, p=100), 1).SangNom(aa=13).TurnRight().SangNom(aa=13).binomialBlur(varY=0.5,varC=0.5,usemmx=true).Spline36Resize(h, w).TurnLeft()
  54.  #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()
  55.  aa_cs    = mt_adddiff(aa_clip, mt_makediff(aa_clip, aa_clip.RemoveGrain(20,11), U=3, V=3).Repair(mt_makediff(mnr, aa_clip, U=3, V=3), 13), U=3,V=3)
  56.  aamask   = emask.mt_lut("x 20 < 0 x 20 - 3 << ?", U=1, V=1).mt_deflate()#.RemoveGrain(20, -1)
  57.  aaed     = mt_merge(mnr, aa_cs, aamask, luma=true, U=3, V=3 )
  58.  
  59. mask2      = emask.mt_lut("x 5 <= 0 x 5 - 4 << ?", U=1, V=1).mt_inflate()
  60. lumamask2  = aaed.mt_lut("x 160 > 255 x 75 > x 3 * 225 - 0 ? ?",U=1,V=1).RemoveGrain(19, -1)
  61. dbmask     = mt_logic(mask2,lumamask2,"max")
  62.  
  63. last     = aaed
  64.  
  65. ### export clip: dbmask
  66.  
  67. ### prefetch: 8,4
  68. ### lock threads to cores
  69.  
  70. ### ###
  71.  
  72. SetMemoryMax(1600)
  73.  
  74. aaed16    = last.U16
  75.  
  76. s_str     = 1.2
  77. s_reverse = s_str + 0.25
  78. s_divisor = 1.5
  79. s_indexR  = 1.281
  80. sstring   = "x 128 - abs "+String(s_divisor)+" / 1 "+String(s_indexR)+" / ^ "+String(s_str)+" * x 128 - x 128 - abs 0.001 + / * x 128 - 2 ^ x 128 - 2 ^ "+String(s_reverse)+" + / * 128 +"
  81.  
  82. pre_nr    = RemoveGrain(11, 11).RemoveGrain(4, 4)
  83. dif_nr    = mt_makediff(pre_nr, Y=3, U=3, V=3)
  84.  
  85. nr      = pre_nr.U16.Dither_resize16(width, height, kernel="Gauss", fh=-1, fv=-1, a1=1)
  86. noise   = makediff16( aaed16, nr, Y=3, U=3, V=3 )
  87. nrdb16  = nr.GradFun3(thr=0.35, radius=16, smode=2, mask=0, ampn=0, lsb=true, lsb_in=true)
  88. db16    = Dither_add16( nrdb16, noise, Y=3, U=3, V=3, dif=true)
  89.  
  90. db8     = db16.DitherPost(mode=0)
  91. sharp8  = dif_nr.mt_lut(sstring)
  92. dif_db  = mt_makediff(pre_nr, db8).mt_lut(sstring)
  93. shfx8   = sharp8.Repair(dif_db, 1, -1)
  94. shfx8   = mt_lutxy(sharp8, shfx8, "x 128 - abs y 128 - abs < x y ?")
  95. shfx16  = shfx8.U16
  96. sharp16 = sharp8.U16.Dither_limit_dif16(shfx8.U16, thr=2.5, U=1, V=1)
  97.  
  98. d_lm8   = mt_lutxy(sharp8, shfx8, "x y != 255 0 ?")
  99. shpFin  = shfx16.Dither_merge16_8(sharp16, d_lm8, U=1, V=1)
  100.  
  101. dark    = db16.Dither_add16(shpFin, Y=3, U=2, V=2, dif=true)
  102.  
  103. Dither_merge16_8(dark, aaed16, dbmask, luma=true, U=3, V=3)
  104. Down10(depth=10,dither=-2,smooth=0,tvrange=true,stack=false)
  105.  
  106. """)
  107.  
  108. Interleave( DSS2("D:\Rurouni Kenshin Shin Kyoto\00000.ts").Dither_Convert_YUV_TO_RGB(mode=8, ampn=0), last.Dither_Convert_YUV_TO_RGB(mode=8, lsb_in=true, ampn=0))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement