Advertisement
Seedmanc

hqdering based masktools2

Aug 27th, 2013
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function HQDering2(clip input, int "strength", int "overall", string "smoother", string "params") {
  2.     strength = Default(strength, 255)#strength, 0 - 255
  3.     overall = Default(overall, 0)#overall smoothing, 0 - 255
  4.     smoother = Default(smoother, "Deen")#filter that smooths
  5.     #params = default defined below # filter parameters - use Chr(34) for quotes
  6.  
  7.     defaultnull = Default(params, "")
  8.     defaultdeen = Default(params, Chr(34) + "a3d" + Chr(34) + ", 4, 15, 15, 20")
  9.  
  10.     params = (smoother == "Deen") ? defaultdeen : defaultnull
  11.  
  12.     try {
  13.         smoothedwparams = Eval(smoother + "(input, " + params + ")")
  14.     } catch (err_msg) {
  15.         smoothedwoparams = Eval(smoother + "(input)")
  16.     }
  17.  
  18.     smoothed = (params == "") ? smoothedwoparams : smoothedwparams
  19.  
  20.     input.mt_edge("sobel",3, 255, 255, 255, Y = 3, V = 1, U = 1)  .mt_inflate
  21.     normalmask = last
  22.  
  23.     normalmask.Levels(0, 3.3, 90, 0, 255).Blur(1.0)  
  24.     amplifiedmask = last
  25.  
  26.     normalmask.mt_Inflate().mt_Inflate().mt_Inflate().Levels(0, 3.3, 90, 0, 255).Blur(1.58).mt_Inflate().mt_Inflate().mt_Inflate().Levels(0, 3.3, 255, 0, 255).mt_Inflate().mt_Inflate()
  27.     thickmask = last
  28.  
  29.     mt_logic(amplifiedmask.mt_Invert(),thickmask,mode="min")
  30.  
  31.     Levels(60, 3.0, 140, overall, strength).mt_deflate
  32.     ringingmask = last
  33.     mt_Merge(input, smoothed, ringingmask)
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement