Advertisement
mawen1250

Untitled

Mar 11th, 2012
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. MP_Pipeline("""
  2.  
  3. ### platform: win32
  4.  
  5. ### inherit start ###
  6.  
  7. downscale=false
  8. shstrength = downscale ? 40 : 60
  9. Tlimit = !downscale
  10. Tovershoot=2
  11. EdgeRepair = downscale
  12. OP1=0
  13. OP2=1918
  14. ED1=31649
  15. ED2=33567
  16.  
  17. ### inherit end ###
  18.  
  19. SetMemoryMax(768)
  20. src = "D:\[BDMV][Hunter X Hunter][ハンターハンター Vol.1]\BDMV\STREAM\00004.m2ts"
  21. cf = src + ".ffindex"
  22.  
  23. FFIndex(src, cachefile=cf, demuxer="lavf")
  24. FFVideoSource(src, cachefile=cf, seekmode=-1, threads=1)
  25.  
  26. #DSS2("D:\[BDMV][Hunter X Hunter][ハンターハンター Vol.1]\BDMV\STREAM\00004.m2ts")
  27.  
  28. src=last
  29. sw=src.width
  30. sh=src.height
  31. dw=sw*2/3
  32. dh=sh*2/3
  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=sm3.tcanny(sigma=1.0, mode=1)
  39.  
  40. ### export clip: sm3, mask
  41.  
  42. ### prefetch: 16, 2
  43.  
  44. ### ###
  45.  
  46. ### platform: win32
  47. SetMemoryMax(1536)
  48. sharpmask=mask.mt_lut("x 48 < 0 x 144 >= 399 x - x 2 << 188 - ? ?",U=1,V=1)
  49. src=sm3
  50.   Sclp = Tlimit ? LSFmod1(src,defaults="slow",Smode=5,Smethod=3,Lmode=4,overshoot=0,overshoot2=0,undershoot=1,undershoot2=2,strength=shstrength,sharpmask=sharpmask,preblur="ON",secure=true,edgemode=0,soft=0,soothe=false,ss_x=1.00,ss_y=1.00) :
  51.   \LSFmod1(src,defaults="slow",Smode=5,Smethod=3,Lmode=4,overshoot=0,overshoot2=0,undershoot=1,undershoot2=2,strength=shstrength,sharpmask=sharpmask,preblur="ON",secure=true,edgemode=0,soft=-2,soothe=true,ss_x=1.25,ss_y=1.25)
  52.  
  53.   srcMVS = Tlimit ? src.MSuper(hpad=0,vpad=0,pel=2,sharp=2,chroma=false) : NOP()
  54.   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()
  55.   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()
  56.   f1c      = Tlimit ? MCompensate(src, srcMVS, f1v, thSAD=300, thSCD1=300, thSCD2=100) : NOP()
  57.   b1c      = Tlimit ? MCompensate(src, srcMVS, b1v, thSAD=300, thSCD1=300, thSCD2=100) : NOP()
  58.   SAD_f1m = Tlimit ? MMask(src, f1v, kind=1, ml=300, gamma=0.999, Ysc=0) : NOP()
  59.   SAD_b1m = Tlimit ? MMask(src, b1v, kind=1, ml=300, gamma=0.999, Ysc=0) : NOP()
  60.   mM = Tlimit ? mt_average(SAD_f1m,SAD_b1m,U=1,V=1).mt_lut(expr="x 1.6 ^",U=1,V=1) : NOP()
  61.   mE = Tlimit ? mask.mt_lut(expr="x 1.5 ^",U=1,V=1) : NOP()
  62.   mL = Tlimit ? mt_logic(mM.invert(),mE,"min",U=1,V=1).removegrain(20,-1) : NOP()
  63.   Tmax = Tlimit ? src.mt_logic(f1c,"max",U=1,V=1).mt_logic(b1c,"max",U=1,V=1) : NOP()
  64.   Tmin = Tlimit ? src.mt_logic(f1c,"min",U=1,V=1).mt_logic(b1c,"min",U=1,V=1) : NOP()
  65.   shrp = Tlimit ? Sclp.mt_clamp(Tmax, Tmin, Tovershoot, Tovershoot, U=1, V=1) : NOP()
  66.   smB = Tlimit ? mt_merge(src,shrp,mL,U=1,V=1) : Sclp
  67.  
  68.   chroma=false
  69.   chr31 = chroma?3:1
  70.   #smC = Repair(Repair(src,smB.RemoveGrain(2,0),23),src.Dehalo_Alpha(darkstr=0.0,brightstr=1.0,rx=downscale ? 1.0 : 1.5,ry=downscale ? 1.0 : 1.5),23)
  71.   smC = EdgeRepair ? Repair(src,smB.Masked_DHA(darkstr=0.0,brightstr=1.0,rx=downscale ? 1.0 : 1.5,ry=downscale ? 1.0 : 1.5),23) : NOP()
  72.   diff1 = EdgeRepair ? mt_makediff(src,smB,Y=3,U=1,V=1) : NOP()
  73.   diff2 = EdgeRepair ? mt_makediff(smC, smC.RemoveGrain((src.width > 1100) ? 20 : 11), U=chr31, V=chr31).Repair(mt_makediff(src, smC, U=chr31, V=chr31), 13) : NOP()
  74.   smD = EdgeRepair ? mt_adddiff(smC,diff2, U=chr31,V=chr31) : NOP()
  75.   #mC  = mt_lutxy(mask,diff1,"y 127 < x 1 << y 129 > x 1 << 0 ? ?",U=1,V=1)
  76.   mC  = EdgeRepair ? mt_lut(diff1,"x 127 < 255 0 ?",U=1,V=1) : NOP()
  77.   smE = EdgeRepair ? mt_merge(smB,smD,mC,luma=chroma?true:false,U=chr31,V=chr31) : smB
  78.  
  79. ### export clip: smE, mask
  80.  
  81. ### prefetch: 16, 0
  82.  
  83. ### ###
  84.  
  85.  
  86. deband1 = smE.f3kdb(range= downscale ? 12 : 18 , Y=33, Cb=33, Cr=33, ditherY=0, ditherC=0, precision_mode=3, dynamic_dither_noise=true, keep_tv_range=false, input_mode=0, output_mode=1, output_depth=16)
  87. deband2 = smE.f3kdb(range= downscale ? 12 : 18 , Y=42, Cb=38, Cr=38, ditherY=0, ditherC=0, precision_mode=3, dynamic_dither_noise=true, keep_tv_range=false, input_mode=0, output_mode=1, output_depth=16)
  88. deband3 = smE.EPSlice(0,0,0,smE.height/2,sp1="f3kdb(range= 12 , Y=120, Cb=64, Cr=64, ditherY=0, ditherC=0, precision_mode=3, dynamic_dither_noise=true, keep_tv_range=false, input_mode=0, output_mode=1, output_depth=16)",
  89. \sp2="f3kdb(range= 12 , Y=40, Cb=48, Cr=48, ditherY=0, ditherC=0, precision_mode=3, dynamic_dither_noise=true, keep_tv_range=false, input_mode=0, output_mode=1, output_depth=16)")
  90. mask1    = mask.mt_lut("x 2 <= x x 6 << ?",U=1,V=1)
  91. mask2    = mask.mt_lut("x 3 <= x x 6 << ?",U=1,V=1)
  92. mask3    = mask.mt_lut("x 7 <= x x 5 << ?",U=1,V=1)
  93. Dither_merge16_8(
  94. \ 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),
  95. \ smE.Dither_convert_8_to_16(),
  96. \ 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),
  97. \ luma=true)
  98.  
  99. f3kdb(range=0, Y=0, Cb=0, Cr=0, ditherY=0, ditherC=0, precision_mode=3, dynamic_dither_noise=true, keep_tv_range=false, input_mode=1, output_mode=2, output_depth=10)
  100. """)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement