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 Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 29th June 2004, 15:44   #1  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Hollola, Finland
Posts: 4,292
Request: someone please fix CNR2

I'm sure there are a lot of people who process analog captures and would like to have a good and fast chroma denoiser. CNR2 v2.4 doesn't work with CCE and v2.51 is just broken, the value for scdthr has to be insanely high for the filter to do anything and then the filter misses all the scenechanges.

Here's the latest version (v2.51), which doesn't crash in CCE but due to the scdthr issue is unusable at the moment.

http://cultact-server.novi.dk/kpo/avisynth/cnr2_51.zip

Could someone please take a look at the filter?
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 29th June 2004, 18:40   #2  |  Link
rfmmars
Registered User
 
Join Date: Feb 2004
Posts: 743
Need to fix the link.

richard
rfmmars is offline   Reply With Quote
Old 29th June 2004, 19:26   #3  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Hollola, Finland
Posts: 4,292
Hmm, it seems that sh0dan's not hosting the file anymore. Fortunately I've got it on my HD so here's a working link:

http://www.saunalahti.fi/sam08/cnr2_51.zip
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 29th June 2004, 22:53   #4  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,293
If someone want to look at it, here are the v2.4 sources (the last one which actually works):

http://www.geocities.com/wilbertdijkhof/Cnr_v24.zip
Wilbert is offline   Reply With Quote
Old 30th June 2004, 02:39   #5  |  Link
Video Dude
Senior Member
 
Join Date: Apr 2004
Posts: 1,039
Quote:
Originally posted by Boulder
I'm sure there are a lot of people who process analog captures and would like to have a good and fast chroma denoiser.
GuavaComb gives good results and it is very fast.
Video Dude is offline   Reply With Quote
Old 30th June 2004, 06:47   #6  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
Here you go.

Cnr_v261

Got bored and needed something to do . It should work fine now, and I changed the scene change detection to a more straight forward approach. It works how scene change detection works in temporalsoften, (i.e. percentage of total change). Even added the option to consider luma only or both chroma and luma in the decision (previous versions considered both, though both v2.51 and v2.4 were slightly broken in different ways). If there are any problems let me know.

Note: I didn't get permission from the original author, but hopefully it is ok as I doubt this thread would have started if he was still active and able to fix it. Though, if anyone wants me to take the link down I gladly will.

Last edited by tritical; 30th June 2004 at 22:37.
tritical is offline   Reply With Quote
Old 30th June 2004, 07:30   #7  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Hollola, Finland
Posts: 4,292
@tritical: Thank you Sir! I don't think MarcFD can complain, most of his filters are known to be troublesome at times and he hasn't done anything about that.

@Video Dude: GC is a nice filter but AFAIK it's for removing rainbows only, not for general chroma denoising. It also requires YUY2 data so I'd have to do the colorspace conversion in the middle of the script instead of the end. Thanks anyway
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 30th June 2004, 09:11   #8  |  Link
AS
Registered User
 
Join Date: Jan 2002
Posts: 76
Quote:
Originally posted by Boulder
@Video Dude: GC is a nice filter but AFAIK it's for removing rainbows only, not for general chroma denoising. It also requires YUY2 data so I'd have to do the colorspace conversion in the middle of the script instead of the end. Thanks anyway
Actually, GC is mainly for dotcrawl removals. The temporal lock also happen to kill rainbows as a side-effect.
AS is offline   Reply With Quote
Old 30th June 2004, 09:50   #9  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
Quote:
The temporal lock also happen to kill rainbows as a side-effect.
Actually, it is anything but a side-effect. GC works at filtering rainbows for the same reason it works on dot crawl... the method of filtering rainbows/dot crawl is exactly the same in stationary parts of the picture (where GC is suppose to work). For NTSC you average the pixels in the current frame with those 1 frame away which are exactly 180 degrees out of phase relative to the current frame (because of NTSC's 4 field color frame) and 2 frames away for PAL (PAL has an 8 field color frame). The reason GC tends to be more effective with filtering dot crawl is because "usually" the cross-luminance (dot crawl) oscillations tends to have less overall magnitude and tend to have somewhat more stable oscillation as compared to cross-chrominance (rainbowing) oscillations. That has a large impact on GC since it uses a max variation threshold and activation/recall settings.
tritical is offline   Reply With Quote
Old 30th June 2004, 22:37   #10  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
Well, I sat down and benchmarked v2.6 against v2.4 using avstimer. I was pretty sure v2.6 would be faster but just wanted to make sure. This was the case for YV12 processing, as I got an average of roughly 300 fps over 10,000 frames with v2.6 and about 180-190 fps with v2.4. However, for YUY2 processing v2.6 was actually more then 50% slower then v2.4 . Since this was definitely not acceptable, I took another look at the YUY2 code and found some areas that were in need of a few changes speed wise. After making the changes it now runs full speed again . Actually, YUY2 processing is very slightly faster in v2.6.1 then in v2.4 (5% or so... 90 fps vs 85 fps on my computer). The speed up for YUY2 processing is the only change between v2.6 and v2.6.1, there is no quality difference.
tritical is offline   Reply With Quote
Old 12th July 2004, 23:23   #11  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
Good work!
Fizick is offline   Reply With Quote
Old 29th May 2005, 20:00   #12  |  Link
codefish
Registered User
 
Join Date: Feb 2005
Location: Germany
Posts: 10
one late reply

@tritical: very good work; took a while for me to find this thread. After desperately trying to cnr2 my VHS-Caps I got a hint (link to this thread) on the german Forum which saved my day!
Do you (or does anyone) have connections to the people managing http://www.avisynth.org/warpenterprises/ ? I think the faulty 2.5-version of cnr2 should be replaced by your 2.61 as soon as possible because (in my opinion) it doesn't make sense to offer the 2.5-Version for download any longer.

saved-day-greetings from germany

codefish
codefish is offline   Reply With Quote
Old 29th May 2005, 21:11   #13  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,293
The one at that site is v2.61?
Wilbert is offline   Reply With Quote
Old 2nd June 2005, 14:51   #14  |  Link
codefish
Registered User
 
Join Date: Feb 2005
Location: Germany
Posts: 10
take care: at first I thought the 2.6.1 was perfect until I checked motion - the default values have to be lowered significantly (compared to the 2.4) to prevent ghosting. I'm still experimenting, but still I say: good work, much better than the 2.5.1

The one currently to be found at warpenterprises is the v2.5.1 (@Wilbert)
codefish is offline   Reply With Quote
Old 2nd June 2005, 20:43   #15  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,293
I don't get why you say it's v2.5.1. Tritical's download above is v2.61 with size 73728.

The dll in cnr2_25_dll_20040630 from WarpEnterprises has the same size. It is v2.61 according to the readme.
Wilbert is offline   Reply With Quote
Old 2nd June 2005, 20:54   #16  |  Link
codefish
Registered User
 
Join Date: Feb 2005
Location: Germany
Posts: 10
urrh have I had smoked something wrong? I must really have confused something, or the 2.6.1 is available since some few days only. I was pretty sure that I've downloaded the 2.5.1 just one week ago. It reads cnr_25_dll_20031118.zip...
I do apologize for this false information. The information about the ghosting remains true however ...

correcting-myself-greetings

codefish
codefish is offline   Reply With Quote
Old 5th June 2005, 04:31   #17  |  Link
hartford
Registered User
 
hartford's Avatar
 
Join Date: Nov 2003
Posts: 324
Yeah, the "defaults" do not work as advertized.

I'm waiting for a fixed version, ie, if I enter values as shown in readme.txt, they don't work.
hartford is offline   Reply With Quote
Old 5th June 2005, 05:56   #18  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
v2.6.1 is exactly the same as v2.4 except for 4 things:

1.) Speed, 2.6.1 is quite a bit faster in YV12
2.) rounding differences (maximum of +- 1 change in pixel values)
3.) scene change detection method is different
4.) 2.6.1 doesn't crash

So if you are noticing big differences between v2.4 and v2.6.1 it is the scene change detection as it resets filtering after scene changes. The default for 2.4 is really low (it has a lot of false detections) compared to v2.6.1. However, the default settings for the other variables are pretty strong so the false scene change detections on moderate movement help prevent ghosting. If you want v2.6.1 to act more like v2.4 lower the scene threshold to 7 or 8. Both versions have a "log" option that allows one to see when the filter has detected a scene change.

I also ran a test on a 5000 frame clip to make sure this was true, and indeed the clips matched exactly (except for +- 1 due to rounding) after both versions detected scene changes in the same places.
tritical is offline   Reply With Quote
Old 5th June 2005, 08:58   #19  |  Link
codefish
Registered User
 
Join Date: Feb 2005
Location: Germany
Posts: 10
so now to my experiences:
the defaults (doc-file) read:
Cnr2("oxx",8,35,192,47,255,47,255,false) which is really okay for the 2.4

approximately (I have not tested exactly, simply used my eyes cause they are what I'm finally filtering for ) the same results using 2.6.1 are achieved by the following settings:
Cnr2(mode="oxx",scdthr=8,ln=16,lm=192,un=23,um=255,vn=23,vm=255)

So it seems the n-values have to be halved for some reason. But then it works as expected. I didn't compare the SCDTHR however, I trust you (@tritical) with this

@hartford: try to halve the n-values and compare the results to the 2.4 please ... (using PNG to save a screenshot helps: if filesizes are about the same, then the result in this special case is about the same, too - my experience! Or use avscompare, to be found at doom9)

addendum: I only tested YUY2 because I'm filtering captures, and YUY2 (besides UYVY) is the only color space my capturing card supports.

Last edited by codefish; 5th June 2005 at 09:01.
codefish is offline   Reply With Quote
Old 5th June 2005, 18:38   #20  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
After further testing I know what the difference is. The dll avialable from marc fd's website which is labeled 2.4 does not match the YUY2 output from the source for 2.4 that Wilbert linked to earlier in this thread. YV12 output does match however. So that means 2.6.1 matches the YUY2/YV12 output from the source linked to before and matches the YV12 output from the dll on marc fd's website. What was changed for YUY2 I don't know...
tritical 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 22:02.


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