Advertisement
mawen1250

Hunter X Hunter 2011 BD EP01 final4 by mawen1250

Apr 17th, 2012
407
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(800)
  6.  
  7. src = "D:\[BDMV][Hunter X Hunter][ハンターハンター Vol.2][KUNO-DIY]\BDMV\STREAM\00004.m2ts"
  8. cf = src + ".ffindex"
  9.  
  10. FFIndex(src, cachefile=cf, demuxer="lavf")
  11. FFVideoSource(src, cachefile=cf, seekmode=-1, threads=1)
  12.  
  13. #DSS2("D:\[BDMV][Hunter X Hunter][ハンターハンター Vol.1]\BDMV\STREAM\00004.m2ts")
  14.  
  15. ### inherit start ###
  16.  
  17. OP1=816
  18. OP2=2734
  19. ED1=31649
  20. ED2=33567
  21.  
  22. downscale=true
  23. shstrength = downscale ? 0 : 80
  24. Tlimit = true
  25. Tovershoot=2
  26.  
  27. ### inherit end ###
  28.  
  29. src=last
  30. sw=src.width
  31. sh=src.height
  32.  
  33. up=src.SoftCubicResize(sw*2, sh*2, soft=50)
  34. sm1=up.awarpsharp2(thresh=100,type=1,depth=16).Spline36Resize(sw, sh)
  35. sm2=up.awarpsharp2(thresh=100,type=1,depth=6).Spline36Resize(sw, sh)
  36. sm3 = MergeChroma(src, sm1.Trim(0,OP1+134)+sm2.Trim(OP1+135,OP1+440)+sm1.Trim(OP1+441,OP1+572)+sm2.Trim(OP1+573,OP2-1)+sm1.Trim(OP2,0), 1.0)
  37. #sm3 = downscale ? sm3.ResampleHQ(dw, dh, srcmatrix= "TV.709", dstmatrix="TV.709", kernel="Spline36", chroma_kernel="Spline36") : sm3
  38. mask=src.tcanny(sigma=1.0, mode=1, plane=1)
  39.  
  40. ### export clip: sm3, mask
  41.  
  42. ### prefetch: 8,4
  43. ### lock threads to cores
  44.  
  45. ### ###
  46.  
  47. ### platform: win32
  48.  
  49. SetMemoryMax(1000)
  50.  
  51. src=last
  52.  
  53. sharpmask = shstrength == 0 ? NOP() : mask.mt_lut("x 48 < 0 x 144 >= 399 x - x 2 << 188 - ? ?",U=1,V=1)
  54. dehalo = sm3.Dehalo_Alpha_mt(darkstr=0.2,brightstr=1.0,rx=1.8,ry=1.8,highsens=100,lowsens=30).binomialBlur(varY=0.5,varC=0.5,usemmx=true)
  55. sm4 = mt_adddiff(dehalo, mt_makediff(dehalo, dehalo.RemoveGrain(20), U=3, V=3).Repair(mt_makediff(src, dehalo, U=3, V=3), 13), U=3,V=3)
  56.  
  57. Sclp = shstrength == 0 ? sm4 : Tlimit ? LSFmod1(sm4,defaults="slow",Smode=5,Smethod=3,Lmode=4,strength=shstrength,sharpmask=sharpmask,preblur="OFF",secure=true,edgemode=0,soft=0,soothe=false,ss_x=1.00,ss_y=1.00) :
  58. \LSFmod1(sm4,defaults="slow",Smode=5,Smethod=3,Lmode=4,strength=shstrength,sharpmask=sharpmask,preblur="OFF",secure=true,edgemode=0,soft=-2,soothe=true,ss_x=1.00,ss_y=1.00)
  59.  
  60.   srcMVS = Tlimit ? src.MSuper(hpad=0,vpad=0,pel=2,sharp=2,chroma=false) : NOP()
  61.   f1v      = Tlimit ? MAnalyse(srcMVS, isb=false, delta=1, truemotion=false, blksize=16, overlap=8, pelsearch=2, search=2, searchparam=2, DCT=0, global=true, chroma=false) : NOP()
  62.   b1v      = Tlimit ? MAnalyse(srcMVS, isb=true,  delta=1, truemotion=false, blksize=16, overlap=8, pelsearch=2, search=2, searchparam=2, DCT=0, global=true, chroma=false) : NOP()
  63.   f1c      = Tlimit ? MCompensate(src, srcMVS, f1v, thSAD=300, thSCD1=300, thSCD2=100) : NOP()
  64.   b1c      = Tlimit ? MCompensate(src, srcMVS, b1v, thSAD=300, thSCD1=300, thSCD2=100) : NOP()
  65.   SAD_f1m = Tlimit ? MMask(src, f1v, kind=1, ml=300, gamma=0.999, Ysc=0) : NOP()
  66.   SAD_b1m = Tlimit ? MMask(src, b1v, kind=1, ml=300, gamma=0.999, Ysc=0) : NOP()
  67.   mM = Tlimit ? mt_average(SAD_f1m,SAD_b1m,U=1,V=1).mt_lut(expr="x 1.6 ^",U=1,V=1) : NOP()
  68.   mE = Tlimit ? mask.mt_lut(expr="x 1.5 ^",U=1,V=1) : NOP()
  69.   mL = Tlimit ? mt_logic(mM.invert(),mE,"min",U=1,V=1).removegrain(20,-1) : NOP()
  70.   Tmax = Tlimit ? src.mt_logic(f1c,"max",U=1,V=1).mt_logic(b1c,"max",U=1,V=1) : NOP()
  71.   Tmin = Tlimit ? src.mt_logic(f1c,"min",U=1,V=1).mt_logic(b1c,"min",U=1,V=1) : NOP()
  72.   shrp = Tlimit ? Sclp.mt_clamp(Tmax, Tmin, Tovershoot, Tovershoot, U=1, V=1) : NOP()
  73.   smA = Tlimit ? mt_merge(src,shrp,mL,luma=false,Y=3,U=4,V=4) : Sclp
  74.  
  75. smE = mt_merge(sm3,smA,mask.mt_lut("x 24 < 0 x 2 << ?", U=1, V=1),luma=true,U=3,V=3)
  76.  
  77. ### export clip: smE, mask, SAD_f1m, SAD_b1m
  78.  
  79. ### prefetch: 6,3
  80. ### lock threads to cores
  81.  
  82. ### ###
  83.  
  84. ### platform: win32
  85.  
  86. SetMemoryMax(1800)
  87.  
  88. src=last
  89. sw=src.width
  90. sh=src.height
  91. dw=sw*2/3
  92. dh=sh*2/3
  93.  
  94. deband1 = smE.GradFun3( smode=0, thr=0.18, elast=2.5, ampn=0, radius=16, ampo=0.8, dthr=0.011, lsb=true, lsb_in=false, mask=0 )
  95. deband2 = smE.GradFun3( smode=2, thr=0.25, elast=2.5, ampn=0, radius=16, ampo=0.8, dthr=0.011, lsb=true, lsb_in=false, mask=0 ).f3kdb(range=24, Y=48, Cb=33, Cr=33, grainY=0, grainC=0, dither_algo=2, dynamic_grain=true, keep_tv_range=false, input_mode=1, output_mode=1, output_depth=16)
  96. deband3 = smE.EPSlice(0,0,0,sh/2,sp1="f3kdb(range=24, Y=120, Cb=64, Cr=64, grainY=0, grainC=0, dither_algo=2, dynamic_grain=true, keep_tv_range=false, input_mode=0, output_mode=1, output_depth=16)",
  97. \sp2="f3kdb(range=24, Y=40, Cb=48, Cr=48, grainY=0, grainC=0, dither_algo=2, dynamic_grain=true, keep_tv_range=false, input_mode=0, output_mode=1, output_depth=16)")
  98. deband  = deband1.Trim(0,OP1+134)+deband2.Trim(OP1+135,OP1+235)+deband1.Trim(OP1+236,ED1+240)+deband2.Trim(ED1+241,ED1+492)+deband3.Trim(ED1+493,ED1+604)+deband1.Trim(ED1+605,0)
  99. addgrain= deband.GrainFL(lsb_in=true, lsb=true, th1=16, th2=24, th3=64, th4=96, g1str=0, g2str=4, g3str=0, g1shrp=60, g2shrp=66, g3shrp=80, g1size=1.50, g2size=1.50, g3size=1.50, g1soft=3,g2soft=3,g3soft=3)
  100. mask1   = mask.mt_lut("x 2 <= x x 5 << ?",U=1,V=1)
  101. mask2   = mask.mt_lut("x 3 <= x x 1 - 5 << ?",U=1,V=1)
  102. mask3   = mask.mt_lut("x 6 <= x x 4 - 5 << ?",U=1,V=1)
  103. dbmask  = mask1.Trim(0,OP1+134)+mask2.Trim(OP1+135,OP1+235)+mask1.Trim(OP1+236,ED1+240)+mask2.Trim(ED1+241,ED1+492)+mask3.Trim(ED1+493,ED1+604)+mask1.Trim(ED1+605,0)
  104. mM = Tlimit ? mt_average(SAD_f1m,SAD_b1m,U=1,V=1).mt_lut("x 1.8 ^",U=1,V=1) : NOP()
  105. mF = Tlimit ? mt_logic(mM,dbmask,"max",U=1,V=1) : dbmask
  106. db = Dither_merge16_8( addgrain, smE.Dither_convert_8_to_16(), mF, luma=true)
  107. final = downscale ? db.Dither_resize16(dw,dh,kernel="Spline36") : db
  108.  
  109. final.f3kdb(range=0, Y=0, Cb=0, Cr=0, grainY=0, grainC=0, dither_algo=2, dynamic_grain=true, keep_tv_range=false, input_mode=1, output_mode=2, output_depth=10)
  110.  
  111. """)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement