Log in

View Full Version : NNEDI - intra-field deinterlacing filter


Pages : 1 2 [3] 4 5

Boulder
26th December 2007, 10:08
The filter already supports multithreading. By default, the number of threads is the same as the number of detected CPUs.

foxyshadis
28th December 2007, 10:18
I was just curious, but did the combined power of that giant cluster ever net you a further demo that beat the pants off the current one?

tritical
28th December 2007, 12:41
I'm actually pretty close to one, but not quite there. Having access to the cluster definitely helped though. I was able to test a number of ideas I wouldn't have been able to without it. At this point a new version might only be a couple weeks away (if my current set of experiments work out) or it could be a couple months away. I plan to graduate next December so hopefully I can make it work by then :).

Chainmax
31st December 2007, 18:52
Don't forget to dedicate some time to unwinding, tritical :).

Archimedes
16th January 2008, 16:52
This filter turned out to be pretty good for resizing as well (limited to powers of 2 enlargement).
The filter does a good job on resizing images.

Original:
http://img167.imageshack.us/img167/3412/lhousevv5.png

4 x enlarged with NNEDI:
http://img136.imageshack.us/img136/3752/lhouse0592x0592nneditc1.png

badshah
26th January 2008, 11:14
MCBob_v03u is giving me speed of 0.5fps on my c2d with 1gb ram. can anyone help me ? :confused:

Guest
26th January 2008, 11:31
MCBob_v03u is giving me speed of 0.5fps on my c2d with 1gb ram. can anyone help me ? :confused: Wrong thread, pal. Please read and follow forum rule 3.

badshah
26th January 2008, 11:51
Wrong thread, pal. Please read and follow forum rule 3.

sorry :o

Undead Sega
31st January 2008, 22:20
is it possible to use this and replace EEDI2 in MCBob?

Adub
31st January 2008, 22:30
Yes, and it has already been done. See the MCBob thread, and scroll down a few posts, it's there.

Terranigma
31st January 2008, 22:30
is it possible to use this and replace EEDI2 in MCBob?

Amazing what one can find by doing a search (http://forum.doom9.org/showthread.php?p=1049555#post1049555)

Undead Sega
31st January 2008, 22:33
Yes, and it has already been done. See the MCBob thread, and scroll down a few posts, it's there.

really? so it has been done, literally replacing EEDI2 with NNEDI?

cause personally i think NNEDI is better than EEDI2, and form some results, EEDI2 causes 'buble blur' as dubbed by one of the users here, on straight lines.

how do you do it?

Adub
31st January 2008, 22:35
Read the fracking thread! Somebody did it for you!

Search is a beautiful thing.
http://forum.doom9.org/showthread.php?p=1055263#post1055263

Undead Sega
31st January 2008, 22:43
i found it of course, but now i am wondernig how to implant it.

do i basically replace the whole code of the original MCBob with NNEDI+MCBob code by Merlin?

Adub
31st January 2008, 23:38
If that is what you want, then yes.

Another alternative is to create a new avs file named something like "MCBob_NNEDI.avs", and then just import it in your script every time you use MCBob.

Oh, and on a side note, I didn't write that code, I just posted it.
It was originally made by Didee, then modded by Terranigma to support NNEDI.

Terranigma
31st January 2008, 23:38
i found it of course, but now i am wondernig how to implant it.

do i basically replace the whole code of the original MCBob with NNEDI+MCBob code by Merlin?
Sure. The link I was pointing to you to, was actually the origin of the modded mcbob. If you've scrolled down a few post, you would've came across this (http://forum.doom9.org/showthread.php?p=1052018#post1052018) post. :)

Undead Sega
1st February 2008, 17:34
Cheers everyone!

i finally hae done it (yesterday) and damn its such a slow process!

i wanted to deinterlace a 1 hour footage and encode it to huffyuv avi, but it took 15 hours to do 30mins of encoded footage! :( even on my (quite powerful) PC.

this would lead to the filter not efficient to everyone's needs, unless revisions were made to make it faster.

Dark Shikari
1st February 2008, 17:35
Cheers everyone!

i finally hae done it (yesterday) and damn its such a slow process!

i wanted to deinterlace a 1 hour footage and encode it to huffyuv avi, but it took 15 hours to do 30mins of encoded footage! :( even on my (quite powerful) PC.

this would lead to the filter not efficient to everyone's needs, unless revisions were made to make it faster.Yes, MCBob is slow. If you want speed, use Yadif or TDeint.

Undead Sega
1st February 2008, 17:39
i have used Yadif and TDeint, but results at the end didnt quite satisfied me completely, as Yadif gives an oil painting like image to the video which is asomething that took awhile for me to realise.

how can you speed up MCBob?

Dark Shikari
1st February 2008, 17:50
i have used Yadif and TDeint, but results at the end didnt quite satisfied me completely, as Yadif gives an oil painting like image to the video which is asomething that took awhile for me to realise.

how can you speed up MCBob?Multithreading, a faster CPU, or both.

scharfis_brain
1st February 2008, 17:56
one could try

yadifmod(mode=1, edeint=nnedi(field=-2))

Undead Sega
1st February 2008, 17:57
i see, and may i ask, how does this one differ to the original? hope u dont mind explaining.

Multithreading, a faster CPU, or both.

i already have a Dual Core processor (Intel Core 2 E6600 :D) with 2GB RAM and a 500GB hard drive. isnt that fast enough?

Adub
1st February 2008, 18:25
Nope, try a quad core. I am running the exact same get up, with my e6600 overclocked to 3ghz and about a terabyte of harddrive space and it sure as hell ain't fast enough.

Undead Sega
1st February 2008, 18:47
then that basically is the filter's fault, because the Quad Core from Intel isnt literally twice a powerful as a Dual Core.

although, i have been reading of an AviSynth on Multithread and Multiprocessor, would that happen to help?

Boulder
1st February 2008, 19:07
Since you save to a lossless file, you could split the video in two halves using Trim and process both halves simultaneously. It's faster than using the multithreaded Avisynth. Then join the two halves again in your script when you encode to the final format.

Undead Sega
1st February 2008, 19:11
into a lossless file is the final file, where it would be turned into an MPEG-2 with it being colour corrected (not your usual type), unless there is a way to frameserve the filter into TMPEGXpress 4, which doesnt accept whatsoever.

Adub
1st February 2008, 20:16
It's much faster to go straight to lossless and then convert the lossless to whatever you want afterwards. With lossless, almost all of the cpu cycles are devoted to MCBob + whatever other filters you are using, thus maximum speed ensues.

The same thing happens when you go from lossless to something else. It takes very little processing power to decode lossless, thus your final encoder gets most of the cpu, meaning more speed.

Undead Sega
1st February 2008, 20:31
well the lossless file is, as i said, is the final, and that is the straight route from virtualdub, frameserving it to TMPEGEnc Plus into a lossless avi.

from lossless to watever is something of a personal need and it does not match the speed whatsoever of MCBob.

Didée
1st February 2008, 21:25
@ UndeadSega - Short answer: If you think MCBob is too slow to justify its results, then don't use it. Simple as that.

Slightly longer: MCBob tries to do some things "better" than other bobbers do them. As a logical consequence, it's much slower than other filters, since it has to do lots and lots of calculations.
In its current state, metrics tests indicate that MCBob has a respecive edge over other bobbers. If MCBob would be "simplified" to achieve competitive speed, then it would no longer be "better", but just be another small fish in the big swarm.

You could as well ask for a H.264 implementation that needs as little ressources as Mpeg-1 implementation do, or for a ferrari as cheap as a bicycle. Dreamworld and reality are not always compatible.

Undead Sega
1st February 2008, 22:00
that is very understandable, but i will not refuse to not to use it, because it is a very good filter, when it is applied with NNEDI (implanted and seperately), and it was only that, that needed to clear things to explain it. how funny if companies started using it to deinterlace their hours of 50i footage? :D

but still, it is without doubt very slow, but i also asked, i have read on about AviSynth taking advantage on multithread and core processors, i would like to know about that and i will ask, what will the performance be like using MCBob on that?

Adub
1st February 2008, 22:07
When I use MT on my e6600, and use MT, I may get about 6fps instead of 3fps.

If you want information on how to use it, see the MT thread, as this is the wrong thread for it.

Inventive Software
24th February 2008, 00:48
At the risk of grave-digging, is there a theoretical advantage to doing calculations for MCBob and/or NNEDI on the GPU, a la CUDA or CTM? I ask because this filter, whilst great and gives me great results, seems rather slow and could use a new revolution.

I could attack it over the summer, if people are interested? :rolleyes:

Undead Sega
26th February 2008, 21:20
definately!

when mentioning GPU, i have a 8800 GTS, which does seem to be pretty powerful, so it might help and relax the CPU as well.

Adub
26th February 2008, 21:53
If you can port it, do it!! It's never a bad thing to have greater speed at no loss in quality.

Undead Sega
27th February 2008, 13:05
also, since u mentioned GPU, its Anti-Aliasing algorithm is much more sufficient and complex than the filters on AviSynth (or at the moment), maybe you use the GPU's Anti-Aliasing algorithm in combination with MCBob to give almost perfect deinterlacing :D

one could try

yadifmod(mode=1, edeint=nnedi(field=-2))

and would that rid of the oil painting effect on the video?

Didée
27th February 2008, 13:48
also, since u mentioned GPU, its Anti-Aliasing algorithm is much more sufficient and complex than the filters on AviSynth (or at the moment)
Perhaps I'm mistaken (I'm pretty much out of gaming for a longer time), but I don't think that will work. GPU's antialiasing is designed for rendering 3D meshs, and for textures that are displayed with any sort of geometrical skew.

Anti-aliasing a fixed bitmap at it's original size is a completely different task! Not sure if current GPU's have routines for this specific task at all ... and if they do, how the results compare.

*.mp4 guy
29th February 2008, 14:27
Anti-aliasing a fixed bitmap at it's original size is a completely different task! Not sure if current GPU's have routines for this specific task at all ... and if they do, how the results compare.

To the best of my knowledge gpu's don't have any routines for fixing aliasing in a source image.

To, add to what Didée said, what they do is make sure aliasing doesn't get created during 3d rendering of an image. i.e., a gpu's antialiasing filter actually works by keeping the gpu from ever creating aliasing in the first place, it doesn't actually remove aliasing that has already been introduced.

Revgen
1st March 2008, 08:09
Perhaps I'm mistaken (I'm pretty much out of gaming for a longer time), but I don't think that will work. GPU's antialiasing is designed for rendering 3D meshs, and for textures that are displayed with any sort of geometrical skew.

Anti-aliasing a fixed bitmap at it's original size is a completely different task! Not sure if current GPU's have routines for this specific task at all ... and if they do, how the results compare.

There's different kinds of AA. There's adaptive AA and Full Screen AA (FSAA). FSAA is typically slower since it applies to all pixels while adaptive just tries to do the edges to prevent jaggies. I'm not sure what FSAA would look like on video though.

Maccara
1st March 2008, 14:03
There's different kinds of AA. There's adaptive AA and Full Screen AA (FSAA). FSAA is typically slower since it applies to all pixels while adaptive just tries to do the edges to prevent jaggies. I'm not sure what FSAA would look like on video though.

Typically (in the past - haven't done 3d stuff for a while :)) FSAA has been implemented so that the original picture is rendered with a higher resolution internally (not interpolated) to begin with and then scaled down.

Does not work with bitmaps at all. (you can notice this, for example, when you have poor textures to begin with - manages to only smooth out the edges in those)

For video, you get the same effect by just interpolating 2x/4x/whatever and then doing simple bilinear resize back down - sure, you get a nice "smooth" picture. :)

Undead Sega
1st March 2008, 15:26
For video, you get the same effect by just interpolating 2x/4x/whatever and then doing simple bilinear resize back down - sure, you get a nice "smooth" picture.

but that is just resizing, not AA. i would really like to see a FSAA filter for video. or infact, get the algorithm of it and somewat try to use it for video (AA filter of course).

Didée
1st March 2008, 15:44
i would really like to see a FSAA filter for video. or infact, get the algorithm of it and somewat try to use it for video (AA filter of course).
To put it in other, simple, words:

When GPUs perform AA in 3D games, they are working with information that is not present in video sources to begin with.

(The next topic could be: "How to implement the zoom filter used in the CSI TV-series?")

tritical
5th March 2008, 00:57
At the risk of grave-digging, is there a theoretical advantage to doing calculations for MCBob and/or NNEDI on the GPU, a la CUDA or CTM? I ask because this filter, whilst great and gives me great results, seems rather slow and could use a new revolution.
It depends a lot on which video card and cpu you have. NNEDI is highly parallelizable (each pixel can be computed independently). The computation for a pixel just involves the evaluation of 1 to 2 neural networks and a distance calculation to some clusters. So it wouldn't be hard to implement with CUDA. Last fall I actually spent some time writing a CUDA implementation to offload part of the calculations used for training (which are pretty much the same ones used during normal operation). I only have an 8600 GTS so even after lots of time optimizing it it didn't turn out to be worth it compared to a multithreaded sse2 implementation running on my Q6600 (and definitely not once I got access to the university's cluster). However, if you have something like an 8800 GTX, 8800 Ultra, etc... and only a single or dual core cpu then I think it would definitely benefit. Hopefully, the source code for NNEDI will be available by the summer. I actually have a new version ready, I just need a free day to update the code.

MfA
5th March 2008, 02:30
It's a pity GPUs don't support 8/16 bit SIMD in shaders or it would be no contest, as it is a quad core CPU is pretty closely matched to a modern GPU as far as arithmetic operations on 8 bit data goes (of course the GPU is doing it with single precision floating point operations).

BBugsBunny
6th March 2008, 22:06
I actually have a new version ready, I just need a free day to update the code.
Hooray :)
I've been browsing the thread every now and then - good to hear that there is a new version ready soon!

Inventive Software
7th March 2008, 14:50
It depends a lot on which video card and cpu you have. NNEDI is highly parallelizable (each pixel can be computed independently). The computation for a pixel just involves the evaluation of 1 to 2 neural networks and a distance calculation to some clusters. So it wouldn't be hard to implement with CUDA. Last fall I actually spent some time writing a CUDA implementation to offload part of the calculations used for training (which are pretty much the same ones used during normal operation). I only have an 8600 GTS so even after lots of time optimizing it it didn't turn out to be worth it compared to a multithreaded sse2 implementation running on my Q6600 (and definitely not once I got access to the university's cluster). However, if you have something like an 8800 GTX, 8800 Ultra, etc... and only a single or dual core cpu then I think it would definitely benefit. Hopefully, the source code for NNEDI will be available by the summer. I actually have a new version ready, I just need a free day to update the code.

God bless universities and their computer systems. :) My uni's computers have C2Ds and 8600GTs, and if I'm nice I can possibly get access to a lab after hours. I keep an eye on the NVIDIA forums for news on CUDA. My laptop's only got an Xpress 1150 (X300), so I'd need my own box for something to be working, but from what you've said, it definitely sounds possible, so I'm very interested in making it work. :) I think having groups of pixels, or possibly 4x4, 8x8 or 16x16 macroblocks (or variations on a theme) would make it faster, since from what I've read, CUDA likes many kernel threads and lots of data.

Kumo
12th March 2008, 20:10
i'm trying to deinterlace an old anime ntsc r1 (usa) dvd.dgindex reports it as interlaced.here is a sample:
http://rapidshare.com/files/97003811...muxed.m2v.html
how should i combine nnedi with tfm to convert it to 24p?
i'm trying likeDGDecode_Mpeg2Source("H:\Kimagure Orange Road Movie 1\VTS_01_1.d2v",info=3)
colormatrix(hints=true,interlaced=true)
nnedi()
tfm(order=1,pp=1,clip2=nnedi).tdecimate(mode=1,hybrid=1)
but i think it's a wrong way(nnedi effects the whole clip).how call it properly?
should i try a different deinterlacer?

canuckerfan
28th March 2008, 01:18
how'd NNEDI 2.0 coming along, tritical?:)

TheRyuu
29th March 2008, 00:40
i'm trying to deinterlace an old anime ntsc r1 (usa) dvd.dgindex reports it as interlaced.here is a sample:
http://rapidshare.com/files/97003811...muxed.m2v.html
how should i combine nnedi with tfm to convert it to 24p?
i'm trying likeDGDecode_Mpeg2Source("H:\Kimagure Orange Road Movie 1\VTS_01_1.d2v",info=3)
colormatrix(hints=true,interlaced=true)
nnedi()
tfm(order=1,pp=1,clip2=nnedi).tdecimate(mode=1,hybrid=1)
but i think it's a wrong way(nnedi effects the whole clip).how call it properly?
should i try a different deinterlacer?

DGDecode_Mpeg2Source("H:\Kimagure Orange Road Movie 1\VTS_01_1.d2v",info=3)
interp=nnedi()
tfm(order=1,pp=1,clip2=interp).tdecimate(mode=1,hybrid=1)
colormatrix(hints=true,interlaced=false)

Mug Funky
30th March 2008, 06:54
hmm. we just got one of these at work:

http://store.nvidia.com/servlet/ControllerServlet?Action=DisplayPage&Env=BASE&Locale=en_US&SiteID=nvidia&id=ProductDetailsPage&productID=67049700

would love to throw something at it :)

btw, it handles 2048x1556 images with 23 layers of grading in 32 bits before it goes under 25fps :devil:

this thing really is a monster.

morsa
3rd April 2008, 22:58
Using what software?

Scratch or AfterFX?