First the function-should work with 2.0 series as well as 2.5 series
Function clean( clip clip, float c , float d ) {
vid =converttorgb32(clip)
vid1 =sharpen (vid,c)
vid1 = sharpen (vid1,c)
vid1 = layer (vid1,vid,"subtract",127)
vid= layer (vid,vid1,"subtract",127)
vid2 =blur (vid,d)
vid2 = layer (vid,vid2,"subtract",127)
vid= layer (vid,vid2,"subtract",127)
convertbacktoyuy2(vid)
return vid
}
usage
clean (clip,float clean,float unsharpen)
It can reduce
1.blockiness
2.jagged edges
3.leftover lines after deinterlacing
4.color blotches
Have tried it with VCD files with blockiness and jagged edges, TV captures with blotches and some amount of mosquito type noise, DVD rips which had some interlace lines left over after trying deinterlace filters available with me (Greedy,virtualdub blend and field bob). Manages to reduce most of these defects considerably and is also fairly fast.
Recommended values
float clean 0.5 to 1
float unsharpen 0.05 to 0.5
Tweaking the function
1. Change the return vid line in the function to
return vid1-and load the avs in Virtualdub-if you see anything very sharp-the clean value is too high.Very blocky VCD videos might need the value 1, DVD rips should be OK with 0.5.
2. The unsharpen value gives a kind of smoothing-0.25 is good standard choice.
Anyway, Pl. try it out and let me have your suggestions for improving it.
+ Reply to Thread
Results 1 to 2 of 2
-
-
I tried it with some more vids-in certain cases it fades colors-following modified function solves the problem- i have corrected my typo in the converbackto line.
The following is a better clean function in the sense that loss of saturation is avoided
Function clean( clip clip, float c , float d ,int e, int f) {
vid =converttorgb32(clip)
vid1 =sharpen (vid,c)
vid1 = sharpen (vid1,c)
vid1 = layer (vid1,vid,"subtract",128)
vid= layer (vid,vid1,"subtract",e)
vid2 =blur (vid,d)
vid2 = layer (vid,vid2,"subtract",128)
vid= layer (vid,vid2,"subtract",f)
vid=convertbacktoyuy2(vid)
return vid
}
usage-clean (clip , float clean, float unsharpen,int clean strength, int unsharpen strength)
e.g.
clean(0.5,0.5,64,64)
range for values
float clean 0 to 1
float unsharpen 0 to 1
int clean strength between 0 to 255- use 127 max-recommended 32-64
int unsharpen strength between 0 to 255- use 127 max-recommended 32-64
__________________
Similar Threads
-
AVISynth function to darken an area
By kinglerch in forum EditingReplies: 13Last Post: 9th Apr 2012, 17:26 -
Avisynth function to TBC old VHS video?
By Asterra in forum Capturing and VCRReplies: 4Last Post: 4th Sep 2011, 02:35 -
AviSynth: No function named LeakKernelDeint
By user2008 in forum Video ConversionReplies: 4Last Post: 23rd May 2010, 16:42 -
AVIsynth: is there such a function like repeat/until or for/next ?
By vhelp in forum EditingReplies: 4Last Post: 8th May 2010, 05:20 -
AviSynth function to add SUP subtitles?
By MilesAhead in forum SubtitleReplies: 11Last Post: 3rd Feb 2010, 13:16