[Ffmpeg-devel] upsampling of subsampled video data

Rich Felker dalias
Sun Sep 10 18:26:12 CEST 2006

On Sun, Sep 10, 2006 at 10:34:54AM +0200, Attila Kinali wrote:
> Moin,
> On the OGP mailinglist there is currently a discussion going on
> on how and when to perform upsampling of subsampled YUV data.
> My biggest question is whether the U and V data is just
> coppied to all the pixels or is it interpolated between
> the sample points?
> If it's interpolated, how much image quality los would it
> be to just copy it?

Absolutely horrid. This is what the old matrox cards do with chroma
for vertical scaling and it looks disgusting. You're a smart guy;
throw in what you know about sampling theory and the fact that you're
not dealing with "pixels" but samples and I'm sure you can realize for
yourself how offensively wrong nearest-neighbor resampling is.

Most hardware does bicubic interpolation. Lanczos/sinc would be more
theoretically correct but gauss is the most artifact-immune and also
IMO the most theoretically correct since it's the only filter that's
radially decreasing in both spatial and frequency domains. But
probably anything more than bicubic is too expensive to do in

> Additionaly, would it be enough to support only 4:2:2 and 4:2:0
> as the most common formats, or shall other "odd" formats like 4:1:1,
> 3:1:1 or 3:1:0 ?

4:1:1 is actually used for DV. Anything that's not powers of 2 is
irrelevant IMO but some stupid ancient (Quicktime?) formats use it
IIRC. I would say support it only if it's not difficult to do so.


More information about the ffmpeg-devel mailing list