Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function HQDering2(clip input, int "strength", int "overall", string "smoother", string "params") {
- strength = Default(strength, 255)#strength, 0 - 255
- overall = Default(overall, 0)#overall smoothing, 0 - 255
- smoother = Default(smoother, "Deen")#filter that smooths
- #params = default defined below # filter parameters - use Chr(34) for quotes
- defaultnull = Default(params, "")
- defaultdeen = Default(params, Chr(34) + "a3d" + Chr(34) + ", 4, 15, 15, 20")
- params = (smoother == "Deen") ? defaultdeen : defaultnull
- try {
- smoothedwparams = Eval(smoother + "(input, " + params + ")")
- } catch (err_msg) {
- smoothedwoparams = Eval(smoother + "(input)")
- }
- smoothed = (params == "") ? smoothedwoparams : smoothedwparams
- input.mt_edge("sobel",3, 255, 255, 255, Y = 3, V = 1, U = 1) .mt_inflate
- normalmask = last
- normalmask.Levels(0, 3.3, 90, 0, 255).Blur(1.0)
- amplifiedmask = last
- 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()
- thickmask = last
- mt_logic(amplifiedmask.mt_Invert(),thickmask,mode="min")
- Levels(60, 3.0, 140, overall, strength).mt_deflate
- ringingmask = last
- mt_Merge(input, smoothed, ringingmask)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement