[Ffmpeg-devel] upsampling of subsampled video data

Rich Felker dalias
Wed Sep 13 22:19:37 CEST 2006


On Wed, Sep 13, 2006 at 03:42:54PM -0400, Dan Maas wrote:
> > No, the banding is an artifact of the bad colorspace conversion. If
> > you treat the YUV data as the original picture then the codecs
> > reproduce it quite well. The mistake is treating the RGB as the source
> > (unless it's genuine RGB-10 or 12...)
> 
> I've done experiments with non-dithered 8-bit YUV converted directly
> from floating-point RGB. The steps between successive 8-bit luma
> levels are still big enough to be visible on a good TV monitor (output
> via analog component from an Aja uncompressed video I/O
> unit). Dithering is necessary when using 8-bit YUV if you want to get
> perfectly smooth gradients. (10-bit YUV is OK without dithering).

I've run the tests on a good monitor and never been able to see
individual steps. IMO it only happens when the gamma ramp is incorrect
(overemphesis on the difference between low intensity levels, which
seems to be popular on recent hardware that looks like crap but not on
nice old hardware).

> The codec problem is that, to a lossy codec operating in frequency
> space, dithering looks like a very low-energy signal at very high
> frequency. So it's usually the first thing that is dropped to reduce
> the bitrate. With most DV and MPEG-2 encoders my experience is that
> carefully dithered, subtle gradients just end up as 8x8 blocks of
> solid color, with all of the high-frequency content knocked out.

Adding dither is obviously not the correct solution. Either using
enough bits or fixing the hardware so that successive intensity levels
are not visually distinct is the answer. If the hardware can't be
fixed just add some noise to the picture in software, or better add
some noise to the DAC output... ;)

Rich





More information about the ffmpeg-devel mailing list