Any chance for a native Avisynth version of Neatvideo?

general questions about Neat Video
Post Reply
briankai
Posts: 6
Joined: Sun Oct 22, 2006 9:24 pm

Any chance for a native Avisynth version of Neatvideo?

Post by briankai »

I purchased Neatvideo for Virtualdub a few weeks ago, and have by and large been incredibley impressed with its performance. It is by far and away the best noise reduction plugin I have ever used.

My request/suggestion is of course based off my own personal needs, but I can imagine that it would benefit anyone who is encoding their video to DVD Mpeg-2 files or Divx/Xvid.

The problems I'm running into stem from the fact that Neatvideo does all of its filtering in the RGB colorspace, and that tends to result in wave-like banding in gradients in scenes with either low or high contrast details. Scenes with alot of dark blue, like night time scenes, tend to give me the most problems. I have been able to alleviate some of the banding by reintroducing some non-uniform noise back into the picture, and using different quantizer profiles in my Mpeg-2 encoder sometimes helps a bit as well, but it doesn't work all the time. I can provide test encodes displaying what I'm talking about if you think it would help.

A native avisynth version of Neatvideo that will process video in YV12 natively would be fantastic, and would probably eliminate alot of these potential issues... I know there are plans for Virtualdub to eventually allow for processing in the various colorspaces available, but there's no timeline for when that will be implemented as of yet.

Brian
NVTeam
Posts: 2745
Joined: Thu Sep 01, 2005 4:12 pm
Contact:

Post by NVTeam »

Brian,

Thank you for expressing your hosting preference, your vote for Avisynth is counted now. It is possible that there will be a specialized version of the filter for Avisynth in the future.

Regarding the working color space used for filtration, Neat Video does filtration in YCrCb by default (RBG is also available, but it is not default) so the option of switching away from RGB is already here.

Please send a sample video clip (before and after if possible, along with filter settings and noise profile you use) showing the effect you describe. We will check what is causing the effect and will try to find a solution.

Thank you,
Vlad
briankai
Posts: 6
Joined: Sun Oct 22, 2006 9:24 pm

Post by briankai »

Original
http://www.megaupload.com/?d=MC3D96CQ


http://www.megaupload.com/?d=DONKVUOD
Filtered-YV12

http://www.megaupload.com/?d=ZVUVC565
Filtered_RGB

I get the profile from one of the large flat areas on the pool table, since that is where most of the noise is.

For both the filtered clips, working color space is set to YCrCb. Here is a screenshot of the settings I'm using. Temporal filtering is set to 2 frames, 80% threshold:

Image

I know that the filter is doing its work in YCrCb, but what chroma subsampling does it use? I'm guessing 4:4:4, which is why when it gets converted down to 4:2:0 for the YV12 colorspace, there is such a steep drop off in quality.

Brian
NVTeam
Posts: 2745
Joined: Thu Sep 01, 2005 4:12 pm
Contact:

Post by NVTeam »

Brian,

Thank you for the samples.

I have tried to filter the original in VirtualDub to see whether the effect (as seen in filtered samples) is reproducable in VirtualDub itself. It looks like the clip shows no banding when filtered and displayed in VirtualDub. This indicates that the banding is introduced later in the workflow, probably during color conversion (it can be not very accurate) or during compression. One of possible solutions is to keep some grain in the filtered video data. Another would be to use a more accurate color conversion.

Yes, NV works in YCrCb with no subsampling (4:4:4), these data are accurately converted from RGB provided by VD and then are converted back to RGB. I think this shouldn't be a problem because all VD filters work this way and Avisynth should be able to accurately convert the RGB data back to YV12 as well.

Vlad
briankai
Posts: 6
Joined: Sun Oct 22, 2006 9:24 pm

Post by briankai »

NVTeam wrote:Brian,

Thank you for the samples.

I have tried to filter the original in VirtualDub to see whether the effect (as seen in filtered samples) is reproducable in VirtualDub itself. It looks like the clip shows no banding when filtered and displayed in VirtualDub. This indicates that the banding is introduced later in the workflow, probably during color conversion (it can be not very accurate) or during compression. One of possible solutions is to keep some grain in the filtered video data. Another would be to use a more accurate color conversion.

Yes, NV works in YCrCb with no subsampling (4:4:4), these data are accurately converted from RGB provided by VD and then are converted back to RGB. I think this shouldn't be a problem because all VD filters work this way and Avisynth should be able to accurately convert the RGB data back to YV12 as well.

Vlad
If you change the "colorspace" setting in VirtualDub to YV12 (4:2:0), the artifacts do appear in the preview... and that's Virtualdub doing the conversion. Otherwise, if the colorspace setting is left at the default of RGB24, then the codec will do the conversion.

Unfortunately, converting to 4:2:0 is necessary for Xvid/Divx or MPEG2 encoding, and I simply don't see any way around it... nor do I know of a codec or processing program that can make that conversion look any better. If you have any suggestions, I'd be very interested in hearing them. I do as a rule add some non-uniform grain back into the picture, since the banding tends to become more pronounced in the final encode, and the grain helps to lessen it.

Just from my experience with the various filters for Avisynth, I've always been able to achieve the best results when filtering in my intended output's native colorspace, and I doubt that in this case would there be any exception.

Brian
NVTeam
Posts: 2745
Joined: Thu Sep 01, 2005 4:12 pm
Contact:

Post by NVTeam »

If I change the Color Depth > Output format to compressor/display setting to 4:2:0 planar YCbCr (YV12) then VD shows no banding on my computer. Maybe it's just my tired eyes, I am not sure.

I agree with the general point: the less color conversions the better. However, I cannot directly see how working with color data in lower resolution would help avoid banding. Maybe I am missing something.

Vlad
briankai
Posts: 6
Joined: Sun Oct 22, 2006 9:24 pm

Post by briankai »

NVTeam wrote:If I change the Color Depth > Output format to compressor/display setting to 4:2:0 planar YCbCr (YV12) then VD shows no banding on my computer. Maybe it's just my tired eyes, I am not sure.

I agree with the general point: the less color conversions the better. However, I cannot directly see how working with color data in lower resolution would help avoid banding. Maybe I am missing something.

Vlad
If you don't think it makes any difference, then I guess there isn't really anything else to say. I'll just hope that you guys will still consider looking into it further, and leave it at that.

Thank you for your time.

Brian
NVTeam
Posts: 2745
Joined: Thu Sep 01, 2005 4:12 pm
Contact:

Post by NVTeam »

Brian,

As I said above, you vote for direct support for Avisynth is heard and this idea is already in our with list so there is a chance it will be implemented.

Regarding the banding, again, it is not clear what exactly is causing it: the color conversion itself or the subsampling change (or perhaps compression). If it is the conversion then the conversion rootines should be looked at or another implementation should be used. If it is the subsampling change, then I wonder how, theoretically, a filtered frame transformed from 4:4:4 to 4:2:0 could be worse than a result of filtration in 4:2:0. Usually, a more detailed representation produces higher quality result, not vise versa.

BTW, which version of VirtualDub you use? Perhaps there is a difference.

Please also see two frames from that clip: a frame from test_YV12.avi and a frame produced in VD (Color Depth > Output format to compressor/display = 4:2:0 planar YCbCr (YV12)) by NV (Y noise reduction amount 80%).

Vlad
briankai
Posts: 6
Joined: Sun Oct 22, 2006 9:24 pm

Post by briankai »

NVTeam wrote:Brian,

As I said above, you vote for direct support for Avisynth is heard and this idea is already in our with list so there is a chance it will be implemented.

Regarding the banding, again, it is not clear what exactly is causing it: the color conversion itself or the subsampling change (or perhaps compression). If it is the conversion then the conversion rootines should be looked at or another implementation should be used. If it is the subsampling change, then I wonder how, theoretically, a filtered frame transformed from 4:4:4 to 4:2:0 could be worse than a result of filtration in 4:2:0. Usually, a more detailed representation produces higher quality result, not vise versa.

BTW, which version of VirtualDub you use? Perhaps there is a difference.

Please also see two frames from that clip: a frame from test_YV12.avi and a frame produced in VD (Color Depth > Output format to compressor/display = 4:2:0 planar YCbCr (YV12)) by NV (Y noise reduction amount 80%).

Vlad
I honestly couldn't tell you. I don't have the greatest understanding of video processing out there, and am pretty much just going on what I've read over at Doom9 and personal experience.

Given that it looks perfectly fine in 4:4:4, if I had to guess I would say that it's the sub-sampling thats causing the banding to appear. If I'm understanding correctly, the colorspace conversion isn't about the number of colors available, its about the resolution of the Cb and Cr and how their sited, right? I do get similar artifacts if I try to output to 4:2:2 YUY2. But again, that's just a guess.

Easing off on the Cb and Cr filtering lessens the effect as well, but as you can probably see, most of the issues in the clip are the result of large analogic chroma noise... so heavier filtering is needed.

On the upside, most of the other scenes in the show I'm trying to process look absolutely fantastic. It just seems to be the darker gradients that give me all kinds of trouble.

Brian
NVTeam
Posts: 2745
Joined: Thu Sep 01, 2005 4:12 pm
Contact:

Post by NVTeam »

I would really like to reproduce the effect in VirtualDub's internal display. Could you double-check and let me know which settings should be adjusted to get that banding in VirtualDub's internal display when previewing filtration of your sample clip with your filtration settings (or with Y noise reduction amount 80%)?

Vlad
briankai
Posts: 6
Joined: Sun Oct 22, 2006 9:24 pm

Post by briankai »

NVTeam wrote:I would really like to reproduce the effect in VirtualDub's internal display. Could you double-check and let me know which settings should be adjusted to get that banding in VirtualDub's internal display when previewing filtration of your sample clip with your filtration settings (or with Y noise reduction amount 80%)?

Vlad
I'm actually in the middle of processing a large video now, but I'll check it as soon as its done.

Only 10 hours to go... :D
Maccara
Posts: 14
Joined: Fri Oct 13, 2006 7:17 am

Post by Maccara »

Hi, I would also like to add my vote for native AviSynth version of the plugin.

Less the colorspace conversions the better and many avisynth plugins require yv12/yuy2 for processing, often resulting in the script of the form: some processing->convertorgb->neatvideo->convertoyv12/yuy2->more processing, which also slows down the processing a little.

However, I haven't noticed any serious problems (anything beyond expected) in colorspace conversion. Maybe because I make sure it all happens in avisynth already with good matrices (usually PC.601 depending on intent).
Post Reply