Opened 7 years ago

Closed 7 years ago

#829 closed defect (fixed)

jpg: bad quality with progressive rgb file

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

Description

imagemagick/firefox decodes attached file correctly

C:\>ffmpeg -i rgb_progressive.jpg out.bmp
ffmpeg version N-35966-g1d0ae92, Copyright (c) 2000-2011 the FFmpeg developers
  built on Dec 19 2011 13:01:15 with gcc 4.6.2
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-ru
ntime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libope
ncore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --en
able-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger -
-enable-libspeex --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwben
c --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-
libxvid --enable-zlib
  libavutil    51. 32. 0 / 51. 32. 0
  libavcodec   53. 46. 1 / 53. 46. 1
  libavformat  53. 27. 0 / 53. 27. 0
  libavdevice  53.  4. 0 / 53.  4. 0
  libavfilter   2. 53. 0 /  2. 53. 0
  libswscale    2.  1. 0 /  2.  1. 0
  libpostproc  51.  2. 0 / 51.  2. 0
Input #0, image2, from 'rgb_progressive.jpg':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: mjpeg, gbrp, 1024x768, 25 tbr, 25 tbn, 25 tbc
Incompatible pixel format 'gbrp' for codec 'bmp', auto-selecting format 'bgr24'
[buffer @ 020E1820] w:1024 h:768 pixfmt:gbrp tb:1/1000000 sar:0/1 sws_param:
[buffersink @ 020E1AA0] auto-inserting filter 'auto-inserted scale 0' between th
e filter 'src' and the filter 'out'
[scale @ 020E1EE0] w:1024 h:768 fmt:gbrp -> w:1024 h:768 fmt:bgr24 flags:0x4
Output #0, image2, to 'out.bmp':
  Metadata:
    encoder         : Lavf53.27.0
    Stream #0:0: Video: bmp, bgr24, 1024x768, q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg -> bmp)
Press [q] to stop, [?] for help
frame=    1 fps=  0 q=0.0 Lsize=       0kB time=00:00:00.04 bitrate=   0.0kbits/
s
video:2304kB audio:0kB global headers:0kB muxing overhead -100.000000%

Attachments (1)

rgb_progressive.jpg (500.4 KB) - added by ami_stuff 7 years ago.

Download all attachments as: .zip

Change History (5)

Changed 7 years ago by ami_stuff

comment:1 Changed 7 years ago by cehoyos

  • Component changed from undetermined to avcodec
  • Keywords jpg gbr24p added
  • Reproduced by developer set
  • Status changed from new to open
  • Version changed from unspecified to git-master

Shows artefacts with FFmpeg, not a regression afaict.

comment:2 Changed 7 years ago by cehoyos

  • Keywords mjpeg added; jpg removed

comment:3 Changed 7 years ago by cehoyos

This is related to

        if(nb_components == 3 && s->nb_components == 3 && s->avctx->pix_fmt == PIX_FMT_GBR24P)
            index = (i+2)%3;

in libavcodec/mjpegdec.c, removing this hunk produces output files (with incorrect colours but) without artefacts.

comment:4 Changed 7 years ago by michael

  • Resolution set to fixed
  • Status changed from open to closed

Cant reproduce anymore so one of the jpeg fixes in the last few month must have fixed this

Note: See TracTickets for help on using tickets.