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

Måns Rullgård mans
Tue Jul 15 18:29:59 CEST 2008

Michael Niedermayer 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.

Yes, of course.  I should have been specific using correct (or decent)

> I suspect that dithering could reduce the drift, for normal interpolation
> based filters

Possibly.  However, I doubt it's worth the effort, since as you say...

> but running 50 converters in a row is a stupid thing to do.

... and that I can agree with.

M?ns Rullg?rd
mans at mansr.com

More information about the ffmpeg-devel mailing list