[Ffmpeg-devel] upsampling of subsampled video data

Michael Niedermayer michaelni
Wed Sep 13 23:54:50 CEST 2006


Hi

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).
> 
> Note that I'm talking about digitally generated images with perfectly
> clean black-to-white gradients. On noisy images, like anything
> captured with a real video camera, the problem is less apparent.
> 
> 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.

which isnt wrong or is it? the high freq noise after all isnt correct
and its pretty hard to represent low energy coefficients if the lowest
(quantized) values you can store are larger, the problem rather is that
either the dc coefficient has to be quantized to coarsly or that even if
its quantized finely enough the idct will not do any dithering and will
thus output a constant 8bit colored block, there are 3 ways to fix that
1. design or choose a video codec which works with more then 8bit per
sample
2. design a video codec which does dithering in the idct and loop filter
(dunno if that would have any sideeffects)
3. use a good postprocessing filter, mplayer -vf spp should remove all
banding artifacts, if not change its options a little or try -vf uspp

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-devel mailing list