Advertisement
blaze077

Akagami 24

Feb 23rd, 2017
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. AddAutoloadDir("C:\Program Files (x86)\AviSynth+\scripts", true)
  2. FFMS2("C:\Akagami\Shirayuki_24v2.mkv")
  3. source=last
  4. TV=MPEG2Source("C:\Akagami\mx24.d2v")
  5. TV=TV.Trim(1141, 5572) ++ TV.Trim(7674, 22987) ++ TV.Trim(24787, 48492)
  6. TV=TV.TFM().TDecimate().Crop(2,0,-2,0).Spline64Resize(1280, 720, -2, 0, 1440, 0).f3kdb(y=32, cb=32, cr=32, grainy=16, grainc=16, input_depth=8, output_depth=16, output_mode=1)
  7. HiAA(aa="eedi3", mthr=10)
  8. rfs(nnedi3(1), mappings="[0 1391] [3549 15727] [15800 34652]")
  9. OP=RawSource("C:\Akagami\AkagamiOP8Bit.y4m").ConvertBits(16).ConvertToStacked()
  10. OPchroma=OP.dither_resize16(1280, 720, kernel="blackmanminlobe", invks=true, taps=4, u=3, v=3)
  11. FinalOP=dither_merge16_8(OP.Debicubicy_precise(1280, 720, b=0.0, c=1.0), OPchroma, BlankClip(OP.framecount(), 1280, 720, "YV12"), u=4, v=4)
  12.  
  13. super = MSuper(pel=4)
  14. forwardvec=MAnalyse(super, blksize=16, overlap=8, truemotion=false)
  15. backwardvec=MAnalyse(super, isb=true, blksize=16, overlap=8, truemotion=false)
  16. forwardvec2=MAnalyse(super, blksize=16, delta=2, overlap=8, truemotion=false)
  17. backwardvec2=MAnalyse(super, isb=true, delta=2, blksize=16, overlap=8, truemotion=false)
  18. stacked=Dither_convert_8_to_16()
  19. MDegrain2(super, backwardvec, forwardvec, backwardvec2, forwardvec2, thSAD=64, thSADC=128, lsb=true)
  20.  
  21. chroma=dither_resize16(1280, 720, kernel="blackmanminlobe", invks=true, taps=4, u=3, v=3)
  22. dither_merge16_8(Debicubicy_precise(1280, 720, b=0.0, c=1.0), chroma, BlankClip(last.framecount(), 1280, 720, "YV12"), u=4, v=4)
  23. f3kdb(y=32, cb=32, cr=32, grainy=16, grainc=16, input_depth=16, output_depth=16, output_mode=1)
  24. Trim(0, 1391)++FinalOP.Trim(0,-1)++FinalOP.Trim(0,FinalOP.FrameCount()-3)++Trim(3549, 0)
  25. rfs(SMDegrain(thsad=300, thsadc=300, lsb_in=true, lsb_out=true), mappings="2732 2736 2744")
  26.  
  27. source2=source
  28. OPChroma2=OPChroma.BlankClip(1392) ++ OPChroma.Trim(0,-1) ++ OPChroma.Trim(0, OPChroma.FrameCount()-3) ++ OPchroma.BlankClip(31218)
  29. rfs(dither_merge16_8(last, OPchroma2, source2.Trim(1394, 1394).Loop(framecount()).mt_expand().mt_expand().mt_expand().mt_expand().mt_expand().mt_expand().mt_expand().mt_expand().mt_expand().Spline16Resize(1280, 720), u=3, v=3), mappings="[1392 1478]")
  30. rfs(dither_merge16_8(last, OPchroma2, source2.maskCredits(1514, 86, 232, 442, true).Spline16Resize(1280, 720), u=3, v=3), mappings="[1489 1563]")
  31. rfs(dither_merge16_8(last, OPchroma2, source2.maskCredits(200, 486, 238, 116, true).Spline16Resize(1280, 720), u=3, v=3), mappings="[1883 1953]")
  32. rfs(dither_merge16_8(last, OPchroma2, source2.maskCredits(170, 480, 364, 450, true).Spline16Resize(1280, 720), u=3, v=3), mappings="[1976 2053]")
  33. rfs(dither_merge16_8(last, OPchroma2, source2.maskCredits(1408, 104, 300, 456, true).Spline16Resize(1280, 720), u=3, v=3), mappings="[2054 2154]")
  34. rfs(dither_merge16_8(last, OPchroma2, source2.maskCredits(170, 480, 364, 450, true).Spline16Resize(1280, 720), u=3, v=3), mappings="[2155 2233]")
  35. rfs(dither_merge16_8(last, OPchroma2, source2.maskCredits(1356, 116, 239, 305, true).Spline16Resize(1280, 720), u=3, v=3), mappings="[2365 2447]")
  36. rfs(dither_merge16_8(last, OPchroma2, source2.maskCredits(214, 480, 248, 117, true).Spline16Resize(1280, 720), u=3, v=3), mappings="[2632 2677]")
  37. rfs(dither_merge16_8(last, OPchroma2, source2.maskCredits(632, 112, 652, 299, true).Spline16Resize(1280, 720), u=3, v=3), mappings="[2762 2842]")
  38. rfs(dither_merge16_8(last, source2.Spline36Resize(1280, 720).Dither_convert_8_to_16(), source2.Spline36Resize(1280, 720).maskCredits(498, 580, 285, 85, true), u=3, v=3), mappings="[2763 2842]")
  39. rfs(dither_merge16_8(last, OPchroma2, source2.maskCredits(174, 444, 266, 498, true).Spline16Resize(1280, 720), u=3, v=3), mappings="[3055 3166]")
  40. rfs(dither_merge16_8(last, OPchroma2, source2.maskCredits(832, 480, 257, 120, true).Spline16Resize(1280, 720), u=3, v=3), mappings="[3302 3400]")
  41. rfs(dither_merge16_8(last, OPchroma2, source2.maskCredits(242, 480, 341, 114, true).Spline16Resize(1280, 720), u=3, v=3), mappings="[3438 3490]")
  42. rfs(dither_merge16_8(last, OPchroma2, source2.maskCredits(694, 438, 564, 120, true).Spline16Resize(1280, 720), u=3, v=3), mappings="[3491 3549]")
  43. rfs(dither_merge16_8(last, source2.Spline36Resize(1280, 720).Dither_convert_8_to_16(), source2.maskCredits(592, 964, 736, 44, true).Spline16Resize(1280, 720), u=3, v=3), mappings="[3491 3549]")
  44. FreezeFrame(3492, 3492, 3493)
  45. FreezeFrame(3491, 3491, 3492)
  46.  
  47. rfs(dither_merge16_8(source2.Spline36Resize(1280, 720).Dither_convert_8_to_16(), last, source2.Spline16Resize(1280, 720).maskCredits(108, 534, 468, 124, true).mt_invert(), u=3, v=3), mappings="[3550 3661]")
  48.  
  49. Trim(0, 79)++Trim(84,85)++Trim(85,85)++Trim(86,3548)++Trim(3552,0)
  50. rfs(TV, mappings="[31259 33175]")
  51. f3kdb(preset="depth", input_depth=16, input_mode=1, output_depth=10, output_mode=2)
  52.  
  53. function maskCredits(clip c, int "offx", int "offy", int "w", int "h", bool "lutspa", bool "black"){
  54.     x = Default(offx, c.Height())
  55.     y = Default(offy, c.Width())
  56.     w = Default(w, 0)
  57.     h = Default(h, 0)
  58.     lutspa = Default(lutspa, false)
  59.     black = Default(black, false)
  60.    
  61.     x1 = String(offx)
  62.     y1 = String(offy)
  63.     x2 = String((offx+w))
  64.     y2 = String((offy+h))
  65.    
  66.     mask6=c.mt_lutspa(mode="absolute", expr="x "+x1+" > "+"x "+x2+" < & y "+y1+" > "+"y "+y2+" < & & 255 0 ?", chroma="128")
  67.     credits = black ? c.mt_binarize(180, upper=true) : c.mt_binarize(180)
  68.     credits=credits.mt_luts(credits, mode="max", pixels=mt_square(4), expr="y").mt_inflate()
  69.     lutspa ? mask6 : mt_logic(mask6, credits, "min")
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement