[FFmpeg-cvslog] avcodec/mjpegdec: remove new flipping code

Michael Niedermayer git at videolan.org
Thu Jan 9 21:46:48 CET 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Jan  9 21:23:16 2014 +0100| [af15c17daa5d8d2940c0263ba4d3ecec761c11ee] | committer: Michael Niedermayer

avcodec/mjpegdec: remove new flipping code

It stored images wrong in the user provided buffers (that is you would
end up with a wrongly flipped image if you used direct rendering).
Also it used wrong dimensions as noticed by ubitux

Enable the old code unconditionally so flipping works correctly
again.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=af15c17daa5d8d2940c0263ba4d3ecec761c11ee
---

 libavcodec/mjpegdec.c |   11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 0ad5382..f7e0745 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1909,15 +1909,6 @@ eoi_parser:
             }
             if ((ret = av_frame_ref(frame, s->picture_ptr)) < 0)
                 return ret;
-            if (s->flipped) {
-                int i;
-                for (i = 0; frame->data[i]; i++) {
-                    int h = frame->height >> ((i == 1 || i == 2) ?
-                                              s->pix_desc->log2_chroma_h : 0);
-                    frame->data[i] += frame->linesize[i] * (h - 1);
-                    frame->linesize[i] *= -1;
-                }
-            }
             *got_frame = 1;
             s->got_picture = 0;
 
@@ -2009,7 +2000,7 @@ the_end:
             dst -= s->linesize[s->upscale_v];
         }
     }
-    if (s->flipped && (s->avctx->flags & CODEC_FLAG_EMU_EDGE)) {
+    if (s->flipped) {
         int j;
         avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift);
         for (index=0; index<4; index++) {



More information about the ffmpeg-cvslog mailing list