Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* MinBlurMod - slight modification of MinBlur
- (original: http://avisynth.nl/index.php/MinBlur)
- This has RGTools, RedAverage and Dither tools as dependencies. This is (mostly)
- identical to the original, but using a median of three clips instead of a
- two-input LUT. The wt parameter allows tweaking how much to blend in the blurred
- result; using a negative value would have a sharpening effect instead.
- */
- function MinBlurMod(clip clp, int r, int "uv", float "wt")
- {
- uv = default(uv,3)
- wt = default(wt,1.0)
- uv2 = (uv==2) ? 1 : uv
- rg4 = (uv==3) ? 4 : -1
- rg11 = (uv==3) ? 11 : -1
- rg20 = (uv==3) ? 20 : -1
- medf = (uv==3) ? 1 : -200
- RG11c = (r==1) ? clp.removegrain(11,rg11)
- \ : (r==2) ? clp.removegrain(11,rg11).removegrain(20,rg20)
- \ : clp.removegrain(11,rg11).removegrain(20,rg20).removegrain(20,rg20)
- RG4c = (r==1) ? clp.removegrain(4,rg4)
- \ : (r==2) ? clp.medianblur(2,2*medf,2*medf)
- \ : clp.medianblur(3,3*medf,3*medf)
- interleave(clp,rg11c,rg4c).rgtools_clense().selectevery(3,1)
- (wt==1.0) ? last : raveragew(clp,1-wt,last,wt,lsb_out=true).ditherpost(mode=6)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement