View Full Version : How do you use dynamic noise reduction in a avisynth script?
McQuaid
11th February 2002, 18:09
On this page (http://www.labdv.com/en/manuals/avisynth.php) in section 8 they talk about using virutaldub filters in avisynth scripts. It already supports many filters but I would like to add dynamic noise reduction to use in avisynth scripts. Donald graft mentions on his site that he modified it to have script support but I'm not sure how to implement it.
ARDA
12th February 2002, 20:46
I have not the script for Dinamic Noise Reduction and I am also a newbie with avisynth scripts,but maybe this one I have updated can help you.
By the way in avisynth doc. says the vdfilters.avs is old and it must be updated.
Many users and developers visit this forum maybe they could share the scripts they have add and tested with everybody ,and in that way we could update that file.I know that many filters have been adapted to be avisynth natives;(thanks to Dividee,Steady,Gabest,Tbarry,neuron2;forgive me if I forget somebody) and they work faster (yuy).
neuron2 is working a lot with Decomb but he says we would bring warmsharp to avisynth someday.But meanwhile this idea would be usefull, at least for newbies.
Thanks in advance to anyone
######################################
# 2D Cleaner by Jim Casaburi #
# optk7 by Jaan Kalda #
#Threshol (0-255) #
#Radi around source pixel #
#The values must satisfy #
#X and Y <=0 and (2x+1)(2y+1)<=121 #
#Either value, but not both may be 0 #
######################################
function VD_2DCleaneropt(clip clip, int "threshold", int "radius",int "radius", bool "interlaced")
{
LoadVirtualdubPlugin(VirtualDub_plugin_directory+"\2dcleanopt_k7.vdf", "_VD_2DCleaneropt")
return clip._VD_2DCleaneropt(default(interlaced,false)?1:0,default(threshold,10),default(radius,2),
default(radius,2))
}
##############################
# 2D Cleaner by Jim Casaburi #
# optP3 by Jaan Kalda #
##############################
function VD_2DCleaneroptp3(clip clip, int "threshold", int "radius",int "radius", bool "interlaced")
{
LoadVirtualdubPlugin(VirtualDub_plugin_directory+"\2dcleanopt_p3.vdf", "_VD_2DCleaneroptp3")
return clip._VD_2DCleaneroptp3(default(interlaced,false)?1:0,default(threshold,10),default(radius,2),
default(radius,2))
}
__________________________________
I have just tested the first ,but I think both work correctly
Just include this in vdfilters.avs
Regards Arda
ARDA
12th February 2002, 21:11
First of all welcome to neuron2 as our new moderator.
Second I ask you please, take a look at this script and
correct it; I am not completly sure about it.
##############################################
#Dinamic Noise Reduction Steven Don #
#Avery Lee ,Donald Graft (scriptable version #
##############################################
function VD_Dnr2(clip clip, int "threshold")
{
LoadVirtualdubPlugin (VirtualDub_plugin_directory+"\dnr2.vdf", "_VD_Dnr2")
return clip._VD_Dnr2 default(threshold,1)
}
____________________
Thanks in advance Arda
Guest
13th February 2002, 00:54
@ARDA
Thank you for the welcome.
Here's how I do it:
function VD_Dnr(clip clip, int "threshold")
{
LoadVirtualdubPlugin("d:\virtualdub\plugins\dnr.vdf", "_VD_Dnr")
return clip._VD_Dnr(threshold)
}
AVISource("g:\video test files\decomb\test\yawn.avi")
ConvertToRGB()
# max 31
VD_Dnr(25)
I don't usually bother coding defaults because leaving off the parens on an Avisynth command is a bad idea (as documented elsewhere in this forum). :)
ARDA
13th February 2002, 01:22
Thank you for your quickly replay; till I could understand better; I will follow your suggestion taking off the values of defaults.
Arda
McQuaid
13th February 2002, 01:33
Thanks both of you. I'm new to avisynth so I wouldn't know where to start with writing the scripts such as these(using vdub filters in avisynth scripts)
And btw, neuron2, thank you so much for your work on telecide and decimate. Its really amazing how accurate and fast it is. Makes a world of difference to encodings having a proper ivtc.
movmasty
15th February 2002, 03:25
where do i find the vdfilters.avs ?????????
Guest
15th February 2002, 06:27
@movmasty
Go here
http://www.math.berkeley.edu/~benrg/avisynth-beta.html
and download the source zip file for the 1.0beta3 source code. You'll find it in there.
movmasty
16th February 2002, 11:40
many thanks
SVCDNOW
16th February 2002, 20:35
Filtering my video when exporting from Premiere to TMPGEnc is excellent! I edit material that has noticable amounts of noise and this causes MPEG-2 encoders to waste bits encoding the video noise.
My SVCD video looks much better if I use the DNR filter as shown above.
I always encode interlace video. Is there any reason to split the two fields, filter odd/even separately and then re-interlace the fields?
Guest
17th February 2002, 00:09
@svcdnow
That is not a good idea for DNR, because by splitting the fields into frames of their own you will cause DNR to start comparing pixels in different fields. DNR wants to compare the same pixel location in successive frames. For spatial filters, however, that is a good idea if the filter doesn't provide a mode option for that (Smart Smoother and 2D Cleaner Optimized provide this option).
SVCDNOW
17th February 2002, 05:07
Thanks for the reply. Sorry that I failed to accurately describe my idea. (Reading my mind was required to understand the type of field splitting that I was considering.)
I had expected to use a filter like the one at:
http://www.geocities.com/siwalters_uk/viewfields.html
but I see that I would still need to write a filter to re-interlace the fields that had been split via the view fields filter.
Or I had thought that AviSynth could make an odd only clip and an even only clip, then each (odd/even only) would be filtered, and finally re-interlaced.
Your reply still provided information that I find useful. It sounds like DNR does not combine spatial smoothing with the temporal smoothing.
I had concerns about spatial smoothing of frames that contain interlaced fields. I expect that spatial filtering/smoothing of frames containing interlaced fields will work well most of the time. Frames with transitions/cuts that cause significantly different field content probably behave a bit like a cross disolve for that frame. The result would probably only be noticable if viewing the video in slow motion.
Summary:
I should stop worrying, just use DNR, and get back to editing/encoding my videos.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.