Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.


Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 15th February 2011, 01:36   #1  |  Link
Leader of Dual-Duality
TheProfileth's Avatar
Join Date: Aug 2010
Location: America
Posts: 134
DeFreqChroma4E : DFC4E

This being my the 4th attempt at trying to make a filter using avisynth, I decided to go with a simple approach and ended up yielding very good results. I would like criticism and feedback and hopefully ways to improve the filter.
Thank you as always for your feedback

#version 4E
#Release candidate
#Full working params and everything
#thr and thr2 are the amount that the clips being compared are allowed to change
#blurlevel allows you to change what blur type is being used
#practical values are 11,12,19,20 <- that is ascending order of strength
#strong add a very fast high pass noise remover which helps with compression by a great amount
#only side effect is slight blurring, and maybe some detail loss but usually not
#pref and postf are true false triggers for wether or not to use a pre or post filter
#prefiltering tends to keep the most detail (when sharpening at least) but hurts compression
#params1 goes to prefilter and params2 goes to postfilter correct param input looks like
#prefilter="filtername" and then fill in the parameters with params="what ever they should be"  
#only issue is if there are quotes will fix this eventually
#while postfiltering tends to be the best average option which is why I have it on default
#chroma calls nlmeanscl to do some nice chroma filtering for you and then merge that clip in at the end
#if nlmeanscl works for you then you should be fine, otherwise just use a different filter after or before to filter chroma
#Didee for Flux5frames and Tmedian and SBR and for the original idea that sparked this
#http://forum.doom9.org/showthread.php?p=1127757#post1127757 <-- that 
#Nikos for bringing my attention to it
#Thank you Kassandro for making removegrain and removegraint
#Nephilis for the sharpening mode which I modded for compatibility and have called SFM5 
#Thank you Torque,Telepathic,Light,Sashamaru,Evilliveshere, Chevy787 and for their support and help testing
#Version 4E
#Added parameters to combine all 3 modes
#Added blurlevel
#Added pre and post filter params
#Added chroma toggle
#Added strong mode toggle
#Changed thr so that it can be independently set for the first and second
#Borrowed a sharpening script from MCGRMultiSE, and modded it to work with better compatibility 
#great job on that Nephilis 
#Version 4
#Optimized a small amount increased strength
#Version 3
#Safer and more accurate and with different modes, but in separate avsi files
#Version 2
#Faster more accurate and safer
#still more of a blur than anything
#Version 1 was interested in script found on doom9
#Slight modifying

function DFC4E(clip, int "thr",int "thr2",bool "strong",bool "chroma",float "blurlevel",bool "PreF", string "prefilter", string "params1"\
,bool "PostF", string "postfilter", string "params2"){
thr = default(thr,4)
thr2 = default(thr2,thr)
blurlevel default( blurlevel, 12 )
PreF = default( PreF , false )
PostF = default( PostF , true )
chroma = default( chroma , true )
strong = default( strong , true )
prefilter= Default(prefilter, "sfm5")
postfilter= Default(postfilter, "sfm5")

params1 = Default(params1, prefilter=="sfm5" ? "Sstr=1,Slimit=6" : "")
prefiltered = Eval("c." + prefilter + "(" + params1 + ")")

prefilt = PreF ? prefiltered : c

f = c2.removegrain(blurlevel,0)
t = c2.Flux5framesT()
chr = chroma ? c.nlmeanscl(plane=3,h=0.5,hc=0.5,b=1) : c

f1=mt_LutXY(f,t,"x "+string(thr)+" + y < x "+string(thr)+" + x "+string(thr)+" - y > x "+string(thr)+" - y ? ?",U=2,V=2)

params2 = Default(params2, postfilter=="sfm5" ? "Sstr=1,Slimit=6" : "")
postfiltered = Eval("f2." + postfilter + "(" + params2 + ")")

pstfilt = PostF ? postfiltered : f2
str = strong ? pstfilt.sbr : pstfilt.removegrain(1,0)

final=mt_LutXY(c,str,"x "+string(thr)+" + y < x "+string(thr2)+" + x "+string(thr2)+" - y > x "+string(thr2)+" - y ? ?",U=2,V=2)

File and dependencies

Hopefully this time I won't disappoint Didee
(well I can always dream can't I)

Edit: Here are some comparison shots
I'm Mr.Fixit and I feel good, fixin all the sources in the neighborhood
My New filter is in the works, and will be out soon

Last edited by TheProfileth; 17th February 2011 at 01:20.
TheProfileth is offline   Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +1. The time now is 17:50.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.