Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function CalmGrain(clip clp,int "tstr",float "nboost",bool "soften")
- {
- # Requirements: RemoveGrain(SSE3).dll, FluxSmooth.dll, MaskTools2
- # By yours truly, Bloax.
- # ~~~~~ Wuzzis now?
- # This 'should' calm grain down, whether or not it improves compressibility is a good question.
- # It certainly reduces the eye-tearing effect of heavy noise compression artifacts post-encoding though. :-)
- # ~~~~~
- # ~~~~~ Wuzzis do now?
- # "tstr" Is the strength of FluxSmoothT, higher values cause more pixels to hang around for the ride.
- # Use values around 10 (for very slight reduction) to about 30-50 (or 255 if you so wish), too high values can look bad though.
- # "nboost" Is a little something I'd hope tricks RemoveGrain to detect more grain. (Contrast boosting, *cough*)
- # Just leave it at the default value, unless you feel like messing around with it.
- # "soften" Adds a little blurring before FluxSmooth kicks in.
- # Results are quite nice, though it blurs the scene a little bit.
- # ~~~~~
- tstr = Default(tstr, 25)
- nboost = Default(nboost, 1.5)
- soften = Default(soften, false)
- a = clp.IsYV12() ? clp : clp.ConvertToYV12()
- b = a.Tweak(Cont=1.66*nboost,Bright=-33*nboost,interp=0).RemoveGrain(mode=4,modeu=-1).RemoveGrain(mode=9,modeu=-1).Tweak(Cont=0.66/nboost,Bright=33)
- c = Mt_MakeDiff(a,b).Mt_Expand().Mt_Inflate()
- d = soften ? a.RemoveGrain(mode=19).FluxSmoothT(tstr) : a.FluxSmoothT(tstr)
- Mt_Merge(a,d,c)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement