Opened 10 years ago

Closed 10 years ago

#3929 closed defect (fixed)

mjpeg: vertical line at the right side

Reported by: ami_stuff Owned by:
Priority: important Component: avcodec
Version: git-master Keywords: mjpeg regression
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

C:\>ffmpeg -i line5.jpg out.bmp
ffmpeg version N-66012-g97b8809 Copyright (c) 2000-2014 the FFmpeg developers
  built on Sep  1 2014 00:07:41 with gcc 4.8.3 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-lib
modplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrw
b --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinge
r --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --en
able-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis
 --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-
libx265 --enable-libxavs --enable-libxvid --enable-decklink --enable-zlib
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  1.100 / 56.  1.100
  libavformat    56.  3.100 / 56.  3.100
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  0.103 /  5.  0.103
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  0.100 / 53.  0.100
Input #0, image2, from 'line5.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: mjpeg, yuvj422p(pc, bt470bg), 957x717 [SAR 96:96 DAR 319
:239], 25 tbr, 25 tbn, 25 tbc
[swscaler @ 02f08fe0] deprecated pixel format used, make sure you did set range
correctly
Output #0, image2, to 'out.bmp':
  Metadata:
    encoder         : Lavf56.3.100
    Stream #0:0: Video: bmp, bgr24, 957x717 [SAR 1:1 DAR 319:239], q=2-31, 200 k
b/s, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc56.1.100 bmp
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> bmp (native))
Press [q] to stop, [?] for help
frame=    1 fps=0.0 q=0.0 Lsize=N/A time=00:00:00.04 bitrate=N/A
video:2011kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing
overhead: unknown

Attachments (1)

line5.jpg (271.5 KB ) - added by ami_stuff 10 years ago.

Download all attachments as: .zip

Change History (4)

by ami_stuff, 10 years ago

Attachment: line5.jpg added

comment:1 by Carl Eugen Hoyos, 10 years ago

Component: undeterminedavcodec
Keywords: mjpeg regression added
Priority: normalimportant
Reproduced by developer: set
Status: newopen
Version: unspecifiedgit-master

Regression since bec402b5

comment:2 by Clément Bœsch, 10 years ago

This seems to do the trick:

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 827c24d..4d17c5f 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -2127,7 +2127,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]];

Edit: and the other instance above as well probably.

Last edited 10 years ago by Clément Bœsch (previous) (diff)

comment:3 by Michael Niedermayer, 10 years ago

Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.