G2A Many GEOs
SHARE
TWEET

YAHRmod

a guest Apr 1st, 2018 270 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # YAHR's functions 2018-03-31
  2.  
  3. # Y'et A'nother H'alo R'educing script
  4.  
  5. function YAHR(clip clp)
  6. {
  7. b1    = clp.minblur(2).removegrain(11,-1)
  8. b1D   = mt_makediff(clp,b1)
  9. w1    = clp.aWarpSharp(depth=32,blurlevel=2,thresh=0.5)
  10. w1b1  = w1.minblur(2,1).removegrain(11,-1)
  11. w1b1D = mt_makediff(w1,w1b1)
  12. DD    = b1D.repair(w1b1D,13)
  13. DD2   = mt_makediff(b1D,DD)
  14. clp.mt_makediff(DD2,U=2,V=2)
  15. }
  16.  
  17.  
  18. # Y'et A'nother H'alo R'educing script
  19. # YAHR A.SONY mod 1.38, original YAHR was by Didée
  20. # good deHalo for modern DVD and other cases
  21.  
  22. function YAHR2(clip clp, int "depth", int "blur", bool "useawarp4", int "depthV", int "blurV")
  23. {
  24.  
  25. depth         = Default(depth, 8)
  26. useawarp4     = Default(useawarp4, false)
  27.  
  28. blur = defined(blurV) && !defined(blur) ? depth==0 ? 0 : blur : blur
  29.  
  30. defined(depthV) ? depthV != 0 && depth==0 ? eval("blurV=defined(blurV) ? blurV : blur Chr(3) blur=defined(blur) ? blur : 0") : depthV==0 && depth != 0 ? eval("blurV=defined(blurV) ? blurV : 0") : nop() : nop()
  31.  
  32. awarp_params = defined(depthV) ? ",depthV=" + string(depthV) : ""
  33. awarp_params = defined(blurV) ? awarp_params + ",blurV=" + string(blurV) : defined(depthV) ? depthV==0 ? ",blurV=0" : awarp_params : awarp_params
  34.  
  35. b1    = clp.minblur(2).removegrain(11,-1)
  36. b1D   = mt_makediff(clp,b1)
  37. w1    = useawarp4 ? clp.aWarpSharp4xx(depth=depth,blur=blur,chroma=1,useawarp4=true,depthV=depthV,blurV=blurV) : eval("clp.aWarpSharp2(depth=depth,blur=blur,chroma=1" + awarp_params + ")")
  38. w1b1  = w1.minblur(2,1).removegrain(11,-1)
  39. w1b1D = mt_makediff(w1,w1b1)
  40. DD    = b1D.repair(w1b1D,13)
  41. DD2   = mt_makediff(b1D,DD)
  42. clp.mt_makediff(DD2,U=2,V=2)
  43. }
  44.  
  45.  
  46. function YAHR3(clip src, int "depth", int "radius", int "blur", bool "useawarp4", int "depthV", int "blurV", bool "honly", bool "lumaonly")
  47. {
  48. depth         = Default(depth, 32)
  49. radius        = Default(radius, 6)
  50. src
  51. edgm = EMask_dhh(ColorYUV(autogain=true), 3, 140,true,honly=honly,lumaonly=lumaonly)
  52. hfil = YAHR2(depth=depth,blur=blur,useawarp4=useawarp4,depthV=depthV,blurV=blurV)
  53. RM2  = DR_Radius_dhh(edgm.mt_inflate(),radius,0).mt_inflate()
  54. DeRinging = mt_Merge(hfil, src, edgm.mt_inflate(155,155))
  55. mt_Merge(src, DeRinging, RM2, u=2, v=2)
  56. }
  57.  
  58.  
  59. # YAHRmask, by Tophf
  60. # With slight modifications (merging both functions into one). Output should be identical.
  61.  
  62. function YAHRmask(clip input, int "expand", int "warpdepth", int "blur", bool "useawarp4", clip "yahr", int "warpdepthV", int "blurV") {
  63.  
  64.     expand = Default(expand,     5)
  65.     warpde = Default(warpdepth, 32)
  66.     blur   = Default(blur,       2)
  67.    
  68.     yahr  = defined(yahr) ? yahr : input.YAHR2(warpde, blur, useawarp4, warpdepthV, blurV)
  69.    
  70.     input
  71.     vEdge = mt_lutxy(last, mt_expand().mt_expand(),"x y - abs 8 - 7 <<")
  72.    
  73.     mt_merge(yahr, vEdge.binomialblur(expand*2, u=1, v=1)
  74.     \ .mt_lut("x 4 <<")
  75.     \ .mt_logic(vEdge.removegrain(12, -1)
  76.     \ .mt_invert(), "min"), true)
  77. }
RAW Paste Data
Ledger Nano X - The secure hardware wallet
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top