PDA

View Full Version : One-dimensional resizing, or better: downsizing always a loss of information?


Benedikt
8th January 2006, 23:09
Hi there,

I'm currently thinking about Avisynth's resizing algorithms (e. g. Bicubic or Lanzcos) as they behave on shrinking/downsizing a movie file, say from 720x576 to 720x400. Is there always a loss of quality unavoidable, also in x-Dimension in my stated example? Are the 720 pixels width exactly the same 720 pixels after Lanzcos downsized the height from 576 to 400 pixels?
IMO a good resizing algorithm should only affect one dimension (as in my example), do Avisynth's algorithms work like that?

What about resizing a 720x576-clip to 720x576 (I'm serious), would the quality/resolution exactly the same?
And which kind of algorithm does actually achieve the best quality (the less reduction in quality) for downsizing?

Wilbert
9th January 2006, 00:03
IMO a good resizing algorithm should only affect one dimension (as in my example), do Avisynth's algorithms work like that?
Yup.

What about resizing a 720x576-clip to 720x576 (I'm serious), would the quality/resolution exactly the same?
Of course. If input and output size is the same no resizing is done.

And which kind of algorithm does actually achieve the best quality (the less reduction in quality) for downsizing?
http://www.avisynth.org/Resize

Benedikt
9th January 2006, 00:34
Of course. If input and output size is the same no resizing is done.

Hmm. Sure, that under the assumption that the filter is active and you use the same output resolution as the input resolution, the filter actually detects that this is the case and does no work? Is this a cause of the mathematical principle of the filter or a simple

if(outputRes=inputRes)
{
deactivateFilter();
}


I'm still a bit sceptical that albeit being useless resizing to the same output resolution doesn't affect the video at all. Because as I've read somewhere at serial processing chains there is almost always a quality loss involved as not stated explicitely otherwise.

squid_80
9th January 2006, 02:28
if(outputRes=inputRes)
{
deactivateFilter();
}
Yep, that's pretty much exactly what the resizers do. The exception is if you provide cropping arguments as well.

Manao
11th January 2006, 07:42
The resizing algorithms, applied not to resize the video, won't change it.

Basically, the resize works by interpolating the new pixel. Here is how the pixels are computed :

First, you choose a convolution kernel. All the kernels have the nice property of zeroing themselves on integer values ( except 0, of course ). Then, if you reduce the video, you have to scale the kernel to the inverse of the resizing ratio ( hence, you enlarge it if you downsize ).

Now, you want to interpolate a new pixel, you center the scaled kernel on it, and you compute the convole result.

In the case at hand, the kernel isn't scaled ( ratio = 1 ). New pixels are aligned on old pixels. So when you center the kernel, when making the convolution, all the other pixels will be multiplied by 0. Hence, it doesn't change the pixel value.