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

Reply
 
Thread Tools Search this Thread Display Modes
Old 11th February 2002, 18:09   #1  |  Link
McQuaid
Registered User
 
Join Date: Feb 2002
Posts: 93
How do you use dynamic noise reduction in a avisynth script?

On this page 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.
McQuaid is offline   Reply With Quote
Old 12th February 2002, 20:46   #2  |  Link
ARDA
Registered User
 
Join Date: Nov 2001
Posts: 291
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

Last edited by ARDA; 12th February 2002 at 20:57.
ARDA is offline   Reply With Quote
Old 12th February 2002, 21:11   #3  |  Link
ARDA
Registered User
 
Join Date: Nov 2001
Posts: 291
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
ARDA is offline   Reply With Quote
Old 13th February 2002, 00:54   #4  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,924
@ARDA

Thank you for the welcome.

Here's how I do it:

Code:
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).
Guest is offline   Reply With Quote
Old 13th February 2002, 01:22   #5  |  Link
ARDA
Registered User
 
Join Date: Nov 2001
Posts: 291
Thank you for your quickly replay; till I could understand better; I will follow your suggestion taking off the values of defaults.

Arda
ARDA is offline   Reply With Quote
Old 13th February 2002, 01:33   #6  |  Link
McQuaid
Registered User
 
Join Date: Feb 2002
Posts: 93
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.
McQuaid is offline   Reply With Quote
Old 15th February 2002, 03:25   #7  |  Link
movmasty
Registered User
 
Join Date: Feb 2002
Posts: 970
where do i find the vdfilters.avs ?????????
movmasty is offline   Reply With Quote
Old 15th February 2002, 06:27   #8  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,924
@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.
Guest is offline   Reply With Quote
Old 16th February 2002, 11:40   #9  |  Link
movmasty
Registered User
 
Join Date: Feb 2002
Posts: 970
many thanks
movmasty is offline   Reply With Quote
Old 16th February 2002, 20:35   #10  |  Link
SVCDNOW
Registered User
 
Join Date: Feb 2002
Posts: 3
Should I split even/odd fields when using DNR?

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?
SVCDNOW is offline   Reply With Quote
Old 17th February 2002, 00:09   #11  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,924
@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).
Guest is offline   Reply With Quote
Old 17th February 2002, 05:07   #12  |  Link
SVCDNOW
Registered User
 
Join Date: Feb 2002
Posts: 3
Re: Should I split even/odd fields when using DNR?

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.
SVCDNOW is offline   Reply With Quote
Reply

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 00:04.


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