[FFmpeg-devel] pixel format convertion yuv422p->yuv420p->yuv411p->yuv422p degrade picture

Siarhei Siamashka siarhei.siamashka
Tue Jul 15 18:24:11 CEST 2008

On Tue, Jul 15, 2008 at 6:57 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Tue, Jul 15, 2008 at 04:22:33PM +0100, M?ns Rullg?rd wrote:
>> Maksym Veremeyenko wrote:
>> > Dear Developers!
>> >
>> > I was testing pixel format changing and found that convertions like:
>> > yuv422p->yuv420p->yuv411p->yuv422p
>> > degrade picture - it become greener.
>> >
>> > To prove this i did a shell script, see attached. On 50th iteration
>> > picture is almost compleately green.
>> >
>> > Is it normal behaviour for pixel format converting or it is a bug?
>> Apparently, rounding errors in the chroma interpolation are accumulating.
>> Without thinking a little harder, I don't know whether such a conversion
>> sequence is possible without such drift.  It will always be lossy, as I'm
>> sure you already realise.
> Its possible in principle without the drift, one example that does not drift
> would be nearest neighbor convertion.
> I suspect that dithering could reduce the drift, for normal interpolation
> based filters but running 50 converters in a row is a stupid thing to do.

Here is an interesting blog about related issues (don't know how it is
relevant to FFmpeg though):

More information about the ffmpeg-devel mailing list