[FFmpeg-devel] [PATCH] fix shifted picture in AMV video decoder when height is not dividable by 16
Sat Oct 13 05:27:59 CEST 2007
2007/10/13, Michael Niedermayer <michaelni at gmx.at>:
> On Fri, Oct 12, 2007 at 08:49:31AM +0700, Vladimir Voroshilov wrote:
> > Well. I'll try to explain where the problem is.
> > 0. Imagine you have picture with height 24
> > 1. av_get_buffer will expand buffer to be enough large for picture
> > height 32 (16-lines alignment)
> > 2a. Non-flipped picture will be decoded as: 1st row of macroblocks
> > will fill lines 1-16, 2nd (not complete) - lines 17-32 (where lines
> > 25-32 will contain garbage, but since they are expanded and thus not
> > visible, picture is ok)
> > 2b. Flipped picture will be decoded as: 1st row of macroblocks will
> > fill lines 32-17 (while should fill 24-9), and 2nd (not complete) will
> > fill lines 16-1 (where 8-1 will contain garbage and thus picture will
> > be wrong, i.e. shifted by 8 lines down)
> uhm, who designed this, this is sick ...
> anyway, remove CODEC_CAP_DR1
> and clear the CODEC_FLAG_EMU_EDGE flag before every call to get_bufffer()
> and just write into data-WHATEVER
> that should work
It works. I tried to use this first, but without knowledge about
EMU_EDGE i have dropped out that code due to possible "out of bounds"
Updated patch attached.
Just say "ok" and i'll apply it immediately ;).
Vladimir Voroshilov mailto:voroshil at gmail.com
JID: voroshil at gmail.com, voroshil at jabber.ru
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1082 bytes
Desc: not available
More information about the ffmpeg-devel