[FFmpeg-devel] [PATCH] Fix nonsense non-mod16 AMV flipping code.
Michael Niedermayer
michaelni at gmx.at
Sun Apr 29 21:45:42 CEST 2012
On Sat, Apr 28, 2012 at 11:37:08PM +0200, Reimar Döffinger wrote:
> It is obviously nonsense since it produces wrong results
> or even crashes (crashes should be encode-only though).
> Fixes trac issue #1092.
>
> Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
> ---
> libavcodec/mjpegdec.c | 3 +--
> libavcodec/mjpegenc.c | 2 +-
> libavcodec/mpegvideo_enc.c | 5 -----
> 3 files changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
> index a841384..fe54b45 100644
> --- a/libavcodec/mjpegdec.c
> +++ b/libavcodec/mjpegdec.c
> @@ -972,8 +972,7 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah,
> s->coefs_finished[c] |= 1;
> if (s->flipped) {
> // picture should be flipped upside-down for this codec
> - int offset = (linesize[c] * (s->v_scount[i] *
> - (8 * s->mb_height - ((s->height / s->v_max) & 7)) - 1));
> + int offset = linesize[c] * (s->v_scount[c] * s->height / s->v_max - 1);
this will draw above the image i think, is this ok for all MB sizes
and interlacing ?
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120429/8e69bbe0/attachment.asc>
More information about the ffmpeg-devel
mailing list