[FFmpeg-devel] [PATCH] fix shifted picture in AMV video decoder when height is not dividable by 16

Michael Niedermayer michaelni
Fri Oct 12 21:35:25 CEST 2007


Hi

On Fri, Oct 12, 2007 at 08:49:31AM +0700, Vladimir Voroshilov wrote:
> 2007/10/12, Michael Niedermayer <michaelni at gmx.at>:
> > On Wed, Oct 10, 2007 at 09:34:07PM +0700, Vladimir Voroshilov wrote:
> > > Hi, All
> > >
> > > If picture height is not dividable by 16, AMV related flipping code in
> > > mjpeg decoder does not work correctly.
> > > You can easily see height%16 lines of garbage at the top of picture
> > > while the same number of bottom lines are not visible.
> > >
> > > Attached patch adds code which moves three YUV planes in buffer up
> > > after decoding picture.
> >
> > rejected
> >
> >
> > >
> > > Comments and (especialy) optimizations are welcome.
> >
> > a fix to the problem is welcome a memmove workaround is not
> 
> I'm afraid i'll never get solution :|
> 
> 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

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I wish the Xiph folks would stop pretending they've got something they
do not.  Somehow I fear this will remain a wish. -- M?ns Rullg?rd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20071012/dd6fdac0/attachment.pgp>



More information about the ffmpeg-devel mailing list