Log in

View Full Version : What order to apply filters in?


drbuzz0
27th June 2008, 21:08
I searched for a thread on this and found a couple which had some info, but not exactly what I am looking for. Also, they're somewhat conflictory.

One thing I've been having trouble getting down is what is the best oder to apply filters to a video in. For example, if I have a video which is blocky, interlaced, has some noise and has black bar areas around the border then I'm going to want to apply a denoise, deblock, deinterlace, crop and possibly resize filter to it.

Generally, I had been doing the transform filters last (crop and resize) becasue I figured it was best to allow the noise or block filters to work with the raw video before it's resized. However, I have seen pages that suggest enlarging the video will give the denoise algorithm "more to work with." - Seems to make sense on some level, but it also would enlarge the noise and it does not increase the information in the picture, only transforms the image.

Then there's the issue of deinterlacing. I figured I should put deinterlacing before deblocking, as deblocking might distort the interlace lines and thus confuse the filter that is trying to rebuild the image. However, since the image is generally interlaced before its compressed, it seems like perhaps I should deblock first.

Eh.. then there's the issue of adjusting color and brightness/contrast. Or for that matter, deflictering and so on.

LoRd_MuldeR
28th June 2008, 00:17
1. Do the the deinterlacing first, unless there is a very good reason to do otherwise
2. If you really need to apply a filter before deinterlacing, do it like this: Separate Fields > Some Filter > Merge Fields > Deinterlace
3. After deinterlacing do all the rest, like: denoise, deblocking and whatever
4. The last filters should be: Some Filters > Crop > Resize
5. Only a sharpen filter might make sens after resizing (to counteract the smooth effect of the resizer)

So I think a common filter chain might look like this:
Source > Deinterlace > Deblocking > Denoise > Crop > Resize > Sharpen > Output

GodofaGap
28th June 2008, 07:06
I'd do denoising after resizing if you are downsizing and before resizing if you are upsizing. The processing time will be notably less and the effect pretty much the same.