Opened 11 years ago

Closed 11 years ago

#3283 closed defect (fixed)

libopenjpeg wrong color output for signed JPEG2000 input

Reported by: Frank Ma Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: libopenjpeg
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Summary of the bug:
The test JPEG2000 is source from openjpeg conformance test set and can be decoded correctly by openjpeg commend line. it is a signed JPEG2000 code stream, i.e.,

./j2k_dump -i ./p0_08.j2k

[INFO] tile 1 of 1
[INFO] - tiers-1 took 3.264204 s
[INFO] - dwt took 0.268017 s
[INFO] - tile decoded in 3.696231 s
image {
  x0=0, y0=0, x1=513, y1=3072
  numcomps=3
  comp 0 {
    dx=1, dy=1
    prec=12
    sgnd=1
  }
  comp 1 {
    dx=1, dy=1
    prec=12
    sgnd=1
  }
  comp 2 {
    dx=1, dy=1
    prec=12
    sgnd=1
  }
}

However, ffmpeg wirg -vcodec libopenjpeg produce wrong color output

How to reproduce:

./ffmpeg -vcodec libopenjpeg -i p0_08.j2k -pix_fmt rgb24 p0_08.png -loglevel verbose
ffmpeg version 2.1.1 Copyright (c) 2000-2013 the FFmpeg developers
  built on Jan  6 2014 14:46:04 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
  configuration: --prefix=/home/fma/netflixdev/encoding_services/transcoder/dev/builds/ffmpeg-2.1.1 --disable-doc --arch=x86 --target-os=linux --enable-runtime-cpudetect --disable-ffserver --disable-ffplay --disable-avdevice --disable-static --enable-shared --enable-libx264 --enable-libvorbis --enable-libfreetype --disable-decoder=jpeg2000 --enable-libopenjpeg --enable-gpl --enable-nonfree --extra-cflags=-I/home/fma/netflixdev/encoding_services/transcoder/dev/builds/include --extra-ldflags=-L/home/fma/netflixdev/encoding_services/transcoder/dev/builds/lib --extra-ldflags=-Xlinker --extra-ldflags='-rpath='\''rpath_placeholder_rpath_placeholder'\''' --extra-libs=-ldl --extra-libs=-lpthread
  libavutil      52. 48.101 / 52. 48.101
  libavcodec     55. 39.101 / 55. 39.101
  libavformat    55. 19.104 / 55. 19.104
  libavfilter     3. 90.100 /  3. 90.100
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Input #0, image2, from 'p0_08.j2k':
  Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: jpeg2000, rgb48le(12 bpc), 513x3072, 25 tbr, 25 tbn, 25 tbc
File 'p0_08.png' already exists. Overwrite ? [y/N] y
[graph 0 input from stream 0:0 @ 0x155ecc0] w:513 h:3072 pixfmt:rgb48le tb:1/25 fr:25/1 sar:0/1 sws_param:flags=2
[auto-inserted scaler 0 @ 0x1549860] w:iw h:ih flags:'0x4' interl:0
[format @ 0x1548800] auto-inserting filter 'auto-inserted scaler 0' between the filter 'Parsed_null_0' and the filter 'format'
[auto-inserted scaler 0 @ 0x1549860] w:513 h:3072 fmt:rgb48le sar:0/1 -> w:513 h:3072 fmt:rgb24 sar:0/1 flags:0x4
Output #0, image2, to 'p0_08.png':
  Metadata:
    encoder         : Lavf55.19.104
    Stream #0:0: Video: png, rgb24, 513x3072, q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (libopenjpeg -> png)
Press [q] to stop, [?] for help
No more output streams to write to, finishing.4:-32:-22.-77 bitrate=N/A    
frame=    1 fps=0.2 q=0.0 Lsize=N/A time=00:00:00.04 bitrate=N/A    
video:3370kB audio:0kB subtitle:0 global headers:0kB muxing overhead -100.000637%

Change History (4)

comment:1 by Frank Ma, 11 years ago

Priority: importantnormal

comment:2 by Carl Eugen Hoyos, 11 years ago

Reproduced by developer: set
Status: newopen
Version: 2.1.1git-master

Patch sent.

For future tickets: As explained on http://ffmpeg.org/bugreports.html, please always test current FFmpeg git head before reporting problems.

comment:3 by Frank Ma, 11 years ago

It failed on the current ffmpeg git as well:

fmpeg version N-59694-g2be1e1b Copyright (c) 2000-2014 the FFmpeg developers
  built on Jan  8 2014 16:56:29 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)

comment:4 by Carl Eugen Hoyos, 11 years ago

Resolution: fixed
Status: openclosed

Should be fixed in 8b7cce44
Thank you for the report!

Note: See TracTickets for help on using tickets.