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" Does something to the difference mask, not quite sure of the big, bad details.
- # It does seem to improve compression by a little bit, so just leave it be.
- # "soften" Is a deprecated feature (for now, at least*), it softens the picture before FluxSmooth kicks in.
- # Which results in softer noise, or whatever the initial denoising catches.
- # * With me, that usually means for a long, long while!
- tstr = Default(tstr, 40)
- nboost = Default(nboost, 1.25)
- soften = Default(soften, false)
- a = clp.IsYV12() ? clp : clp.ConvertToYV12()
- b = a.RemoveGrain(1,-1).RemoveGrain(18,-1).RemoveGrain(17,-1)
- c = Mt_MakeDiff(a,b).Mt_Expand().Tweak(Cont=nboost,Bright=(0-nboost*8))
- d = soften ? a.RemoveGrain(19).FluxSmoothT(tstr) : a.FluxSmoothT(tstr)
- Mt_Merge(a,d,c)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement