[FFmpeg-cvslog] avcodec/mjpegdec: Fix chroma width rounding

Clément Bœsch git at videolan.org
Sat Nov 1 15:56:41 CET 2014


ffmpeg | branch: release/2.3 | Clément Bœsch <clement at stupeflix.com> | Sat Sep 13 20:25:27 2014 +0200| [193b949f715edc81cedd0bf116b7060e20d6a112] | committer: Carl Eugen Hoyos

avcodec/mjpegdec: Fix chroma width rounding

Fixes vertical line at the right side
Fixes Ticket 3929

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit b96d864fd685aa1f661a5f8666224129d68b8eaf)

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

 libavcodec/mjpegdec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 6a02527..b29b340 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -2128,7 +2128,7 @@ the_end:
             if (!(s->upscale_v & (1<<p)))
                 continue;
             if (p==1 || p==2)
-                w >>= hshift;
+                w = FF_CEIL_RSHIFT(w, hshift);
             for (i = s->height - 1; i; i--) {
                 uint8_t *src1 = &((uint8_t *)s->picture_ptr->data[p])[i / 2 * s->linesize[p]];
                 uint8_t *src2 = &((uint8_t *)s->picture_ptr->data[p])[(i + 1) / 2 * s->linesize[p]];



More information about the ffmpeg-cvslog mailing list