Welcome Guest ( Log In | Register )


Important

The forums will be closing permanently the weekend of March 15th. Please see the notice in the announcements forum for details.

 
Smart Deinterlacer - Anti-alias, Feature Request/Good new filter
« Next Oldest | Next Newest » Track this topic | Email this topic | Print this topic
Mouse124
Posted: Apr 5 2003, 07:54 PM


Unregistered









Is it possable to have an anti-alias option added to Smart Deinterlacer so I can chose Interpolate without the stairstepping? or is there a seperate filter that does just that? If it was a part of Smart Deinterlacer the anti-aliasing could be added to just the motion areas instead of the entire picture. Anti-alias works great for games and at 16x for interpolated deinterlacing, the picture would be great for thows movies that can't be IVTC'd.

Thanks - if there is another filter for antialiasing please reply, I want to try it out.
 
  Top
phaeron
Posted: Apr 5 2003, 10:11 PM


Virtualdub Developer


Group: Administrator
Posts: 7773
Member No.: 61
Joined: 30-July 02



Antialiasing works great for games because games draw primitives that are continuous entities that can be sampled at any resolution -- triangles. The textures themselves are finite and eventually must be interpolated, but the edges are exact and get supersampled to produce the antialiased borders. However, within a textured triangle you are limited to the resolution of the texture and FSAA won't help with the triangle interior once you have exceeded that limit. Well, the same is true of sampled video -- once you have hit the limit of the source resolution, you don't get any additional detail from supersampling.

Put another way, antialiasing only works when you have entities that are smaller than a pixel, and can alias. For polygons, that means the pixels along the polygon edge, where you know the color of both polygons touching that pixel. With textures, however, FSAA is largely useless because aliasing problems are already taken care of by texture filtering, including interpolation and mipmapping. The analogs in video are resampling filters (resize) and filtering video overlays (video acceleration).

Trust me on this. I've written 3D software polygon rasterizers and know exactly how FSAA works and what it can't do.

It is possible to improve video quality using antialiasing if you can somehow extract vector objects out of the scene, but no general algorithm exists for doing so, much less one that can give enough precision to allow improvement of video quality.
 
    Top
endorphin
Posted: Apr 6 2003, 06:49 PM


Advanced Member


Group: Members
Posts: 112
Member No.: 3488
Joined: 4-April 03



I was thinking about this the other day as I captured video from a skiing event. I had some footage that was interlaced NTSC and other footage that was progressive/full-frame. The prog footy was great but the interlaced stuff was giving me a headache. I noticed that even the best de-interlace settings could not avoid stairstepping of straight lines like ski poles (of which there are many in this footage so it's very obvious). I realized that if you zoom in and look at just a single "stair step" in what "should" be a straight line, where would the information come from to tell the deinterlacer how to smooth the line? That information exists neither in Field A or Field B. So it's a lost cause -- like phaeron says, the program would have to "know" that this object was supposed to be a straight line.

{The solution in this case was that I decided I was only going to output this video at 360x240 anyhow. Interlace demons disappeared accordingly.}

You could write a pretty CPU-intensive filter that does edge detection during deinterlacing and attempts to smooth any edges it finds (perhaps only edges that are above a given sharpness parameter) instead of allowing them to get stairstepped. But you'd pay a heavy price in artifacts and distortions when the algorithm guessed wrong. One thing that might make the effort worth it, would be to include enough user control over the filter parameters that you could back off the strength of the processing to a level where some improvement was made yet few if any errors were visible.

What I'm thinking is rather than extracting vector objects from the video (that's one of those eternally damned projects, like he says), you would find discrete "edgelets" using common edge-detection and thinning routines, plus some sort of heuristic that would hypothesize groups of edge pixels that are supposed to be continuous. Each of these would get matched to something like a bezier curve, and from this something like AA would be done. In addition to parameters controlling the edgelet heuristic, edge 'thickness', and bezier properties, there would be a slider parameter allowing you to mix the output of this filter with the unfiltered stream.

Sounds like a total nightmare!

 
     Top
MfA
Posted: Apr 8 2003, 09:00 PM


Unregistered









Everyone perceives stuff differently ... but let me ask you, have you seen a recent high end philips TV with natural motion turned on? Notice much staircasing there?

Deinterlacing needs to be improved, but cleaning up edges can wait ... good motion compensated deinterlacing, which we dont have, will avoid the need for what causes most staircasing in the first place. Generating pixels by interpolation.

There are good edge preserving interpolation methods, but to work on using them in a motion adaptive deinterlacer is putting the cart before the horse.
 
  Top
MfA
Posted: Apr 9 2003, 06:15 PM


Unregistered









Funny, the latest Transactions on Circuits and Systems for Video Technology (well at least the latest available electronically, the march edition) has an article on recovering the original edges from aliased images and anti-aliasing them. "An Efficient Low-Cost Antialiasing Method Based on Adaptive Postfiltering" by Rynson Lau, only available electronically from ieeexplore unfortunately.

Still it really is only meant for CGI, I say first things first ... add 8x8 block motion compensation to deinterlacing. Then work on better interpolation and post processing.

 
  Top
Mouse124
Posted: Apr 11 2003, 03:05 AM


Unregistered









This just poped into my head yesterday and today: what if you were to lower the colour palet to say 64 or even 256, find the edges that would show up and store the edge information, make your vectors input the origonal frame and tada, you have your vectors and now you can do an anti-alias.

This also poped into my head: What if there was a medium between Blend and Interpolate in smart deinterlacer where everything is blended and only interpolated where the surrounding fields have a "greater than a defined percentage" differance than the middle one. I hope this makes scence. Well anyways I think this would remove ghosting AND stairstepping both at the same time. Get the best of both. If the pixles are less than that defineable percentage than the stairstepping that would occour should not be noticed (unless your percentage is way low) then everything would be interpolated. And as a bonus thows extra fith frames that ends up being the same as the fourth frame would be a lot closer looking and would compress better...

and what about this: you load up smart smoother and invert it, It only smothes the edges, bluring out the aliasing. Then you could sharpen it.

This would really slooooow down the fps but you would get a great picture where IVTCing can't be done.
 
  Top
Mouse124
Posted: Apr 11 2003, 03:16 AM


Unregistered









Anyways...... I found a perfect (so far) combo/bunch of filter that can practically IVTC/De-interlace anything into Progressive, non ghosted, non stair-stepped frames.

OK here is what you do:

1. load up your movie
2. in the filters chose this one: "http://www.digtv.ws/html/filters/DFOC.php"
This makes it Progressive.
3. open up the decimate filter: http://shelob.mordor.net/dgraft/
This makes it into 23.976/anything you want, and it does it adaptivley. Yay
4. Follow the instructions in the decimate help file
5. load your avs file.
Now everything is progressive and good.
6. set up your filters (don't forget to include an de-interlacer for the interlaced frames that sneak in)
7. My spelling sucks.
8. save your movie. (I hope I didn't miss anything)

Mouse124


Oh yeah: an 800x600 movie riped from a dvd encodes at about 3-5 fps for me on my 2100 so it is verry slooooooooooow.

 
  Top
phaeron
Posted: Apr 11 2003, 03:37 AM


Virtualdub Developer


Group: Administrator
Posts: 7773
Member No.: 61
Joined: 30-July 02



Color quantization is essentially thresholding with multiple partitions in 3D color space. As with any thresholding, color quantization lowers the signal-to-noise ratio -- the smallest jitter can show up across any threshold if the jitter is across the right boundary. So the lower you drop the color count, the more indistinguishable noise and edges are. It also becomes harder to tell gradients and edges apart. Having worked on 8-bit video solutions before, I can tell you that dropping to 256 colors is most definitely [b]not[./b] going to help edge detection.

I'm sure the hybrid deinterlacing scheme you describe has been tried already in a few DScaler filters. It's most certainly not perfect, however. One big problem is that with the pure algorithm you end up with different decisions -- one pixel uses weave, the next uses bob, etc. and the result is speckling over the image. You can then apply median filtering to try to clean it up, but the algorithm rapidly becomes complex with very diminishing returns. Never mind the fact that the edges where you need adaptive deinterlacing most -- nearly horizontal lines -- are the ones that are the hardest to detect.

Incidentally, when a TV deinterlaces, it may be displaying more data than originally came in -- that is, 640x480 progressive or even 120 fields/sec! In other words, for a less flickery image and smoother motion, the TV may be upsampling to a higher field rate. You can do that on a computer too, but your compressed video file will be a bit bigger than you'd like.
 
    Top
MfA
Posted: Apr 11 2003, 05:15 AM


Unregistered









The point is, wether you are talking about state of the art deinterlacing/format-conversion/frame-interpolation ... it all uses motion compensation.

There is little use trying to cram ever more advanced techniques in a method of deinterlacing which is fundamentally behind the times ... if anyone were serious about doing this much work on a deinterlacer he would be more productive adding motion compensation first (TomsMoComp is cute but not entirely practical, it suffers severely from the aperture problem).
 
  Top
SynchronousArts
Posted: Apr 11 2003, 06:44 PM


Unregistered









QUOTE (Mouse124 @ Apr 5 2003, 11:54 AM)
Is it possable to have an anti-alias option added to Smart Deinterlacer so I can chose Interpolate without the stairstepping? or is there a seperate filter that does just that? If it was a part of Smart Deinterlacer the anti-aliasing could be added to just the motion areas instead of the entire picture. Anti-alias works great for games and at 16x for interpolated deinterlacing, the picture would be great for thows movies that can't be IVTC'd.

Thanks - if there is another filter for antialiasing please reply, I want to try it out.

This sounds like DCDi, the deinterlace method patented by Yves Faroudja.

Many home theater enthusiasts swear by their Scalers that use this.

See http://www.genesismicrochip.com/dcdi.phtml


My curious search on www.uspto.gov revealed a bunch of Patents under his name. For example Patent number 5,625,421 , "Suppression of sawtooth artifacts in an interlace-to-progressive converted signal"

For general video deinterlacing, I've had goog luck with GreedyHMA.


 
  Top
Mouse124
Posted: Apr 11 2003, 07:21 PM


Unregistered









Well there has to be a way.... The combo of filters I posted seems to work great for video that is interlaced, sometimes one or 2 frames sneek through but 1 or 2 Blended frames is WAY better than all of them beeing Stair-spepped or choppy playback.
 
  Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
10 replies since Apr 5 2003, 07:54 PM Track this topic | Email this topic | Print this topic

<< Back to VirtualDub Filters and Filter Development