Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm using VirtualDub for encoding with those settings. resize algorithms

However I record my stuff in 1920x1080 and resize it down to 1280x720. Now the question: which algorithm should I choose when making a balanced quality vs. file-size decision?

I always went with Lanczos because that's what was pre-configured. Those descriptions don't really help me at all in my question.

share|improve this question
add comment

2 Answers

up vote 11 down vote accepted

Why does it matter?

It could be argued that the resizing filters don't matter that much when you downscale a video. More importantly, they have an impact on the quality when upscaling, because you need to generate data where there isn't in the first place.

These filters all have only a marginal impact on file size. You therefore shouldn't worry about huge differences there.

Fact is, as always when encoding video, that the result heavily depends on the source material. You can't always predict the result, but just see what works best for you.

Different algorithms

As an example, here's bicubic vs. bilinear interpolation:

     enter image description here

See that bicubic interpolation results in smoother edges? That's a very general statement … but you can find an overview of image scaling algorithms here.

  • Bilinear interpolation uses a 2x2 environment of a pixel and then takes the average of these pixels to interpolate the new value. It's not the best algorithm, but rather fast.

  • Bicubic interpolation uses a 4x4 environment of a pixel, weighing the innermost pixels higher, and then takes the average to interpolate the new value. It's – as far as I'm concerned – the most popular.

  • Area averaging uses a mapping of source and destination pixels, averaging the source pixels with regards to the fraction of destination pixels that are covered. According to this page, it should produce better results when downsampling.

  • Spline and sinc interpolation use higher-order polynomials and are therefore harder to compute than bicubic interpolation. I don't think the overall increase in processing time is worth using them.

  • Lanczos resampling involves a sinc filter as well.

  • hqx as well as 2xSaI filters are used for pixel-art scaling (e.g. game emulators). I don't think there's a good reason for using them in video.

Jeff Atwood's comparison

It turns out Jeff Atwood did a comparison of image interpolation algorithms. His rule of thumb was to use bicubic interpolation for downsampling and bilinear interpolation when upsampling. However, he also mentioned that …

Reducing images is a completely safe and rational operation. You're simply reducing precision and resolution by discarding information. Make the image as small as you want, and you have complete fidelity-- within the bounds of the number of pixels you've allowed. You'll get good results no matter which algorithm you pick. (Well, unless you pick the nave Pixel Resize or Nearest Neighbor algorithms.)

Here are some more examples of image interpolation algorithms, including the ones I mentioned above.

So, which one to choose?

I finally found a document from the video encoding scene that explicitly bans bicubic filtering. Instead, it endorses Lanczos, Spline, or "Blackman" resampling. These guys probably know what they're talking about, so you might just want to stick to Lanczos filtering.

share|improve this answer
    
I used to always use "precise bicubic A=100". On a re-install of the updated program it was Lanczos defaulted, many people liked it. I left it that way for a long time. Eventually I get around to watching the later encoded Lanczos things, and thought that wasnt as good, next set of encodes, I turned it back to bicubic. I was crunching the compression also, I think Lanczos might have seemed better if I wasnt trying to reduce the total data size so much. –  Psycogeek Jan 7 '12 at 18:02
add comment

You are converting 3x3 original pixels to 2x2 target pixels.

If you want to keep sharp lines choose Lanczos or something that uses more surrounding pixels to not blur sharp lines (like fur or reflections)

Otherwise area average etc (also bilinear/trilinear) would suffice.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.