[Libav-user] JPEG2000 decoding

francesco at bltitalia.com francesco at bltitalia.com
Wed Oct 21 12:12:16 CEST 2015


Hi Carl Eugen
I apologize but was temporary disabled in receiving mail, so I can't reply
to that mail.
In order to provide a patch I need some info because I'm experienced in
pc programming under Borland C++ Builder and Visual Studio, but I have some
difficulties in programming under linux o similar environment.
I made a simple patch to the encoding of jpeg2000 in order to encode with
codeblocks of 64x128 instead of 64x64.  I think that including in codec context
this feature will be useful. Where I can find instruction for suggesting patch ?

Regarding hex dump I posted it because from JP2K header you can detect
compression type and order, tile format and coding order.

Here is the result for chroma only:

ffmpeg started on 2015-10-21 at 11:24:00
Report written to "ffmpeg-20151021-112400.log"
Command line:
ffmpeg -i chroma_only.j2c -loglevel verbose -report
ffmpeg version N-75480-ge859a3c Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.8.1 (GCC)
  configuration: --enable-shared --enable-pthreads --prefix=/mingw
--enable-gpl --disable-debug --enable-libx264 --enable-libvpx
--enable-libvorbis --enable-libtheora --enable-hwaccels
  libavutil      55.  2.100 / 55.  2.100
  libavcodec     57.  3.100 / 57.  3.100
  libavformat    57.  2.100 / 57.  2.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6.  7.100 /  6.  7.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.100 /  2.  0.100
  libpostproc    54.  0.100 / 54.  0.100
Splitting the commandline.
Reading option '-i' ... matched as input file with argument 'chroma_only.j2c'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging
level) with argument 'verbose'.
Reading option '-report' ... matched as option 'report' (generate a report)
with argument '1'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument verbose.
Applying option report (generate a report) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file chroma_only.j2c.
Successfully parsed a group of options.
Opening an input file: chroma_only.j2c.
[j2k_pipe @ 00036120] Format j2k_pipe probed with size=2048 and score=51
[j2k_pipe @ 00036120] Before avformat_find_stream_info() pos: 0 bytes
read:32768 seeks:0
[j2k_pipe @ 00036120] parser not found for codec jpeg2000, packets or times
may be invalid.
[j2k_pipe @ 00036120] parser not found for codec jpeg2000, packets or times
may be invalid.
[jpeg2000 @ 0003f480] Unknown pix_fmt, profile: 0, colour_space: 0,
components: 2, precision: 10
cdx[0]: 2, cdy[0]: 1
cdx[1]: 2, cdy[1]: 1
cdx[2]: 0, cdy[2]: 0
cdx[3]: 0, cdy[3]: 0
[jpeg2000 @ 0003f480] error during processing marker segment ff51
[j2k_pipe @ 00036120] decoding for stream 0 failed
[j2k_pipe @ 00036120] Could not find codec parameters for stream 0 (Video:
jpeg2000 (JPEG 2000 codestream restriction 0), 1 reference frame, none,
1920x540 (0x0)): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[j2k_pipe @ 00036120] After avformat_find_stream_info() pos: 41616 bytes
read:41616 seeks:0 frames:1
chroma_only.j2c: could not find codec parameters
Input #0, j2k_pipe, from 'chroma_only.j2c':
  Duration: N/A, bitrate: N/A
    Stream #0:0, 1, 1/25: Video: jpeg2000 (JPEG 2000 codestream restriction
0), 1 reference frame, none, 1920x540 (0x0), 25 tbr, 25 tbn, 25 tbc
Successfully opened the file.
At least one output file must be specified
[AVIOContext @ 0003eb00] Statistics: 41616 bytes read, 0 seeks


and this is the result for luma only:


ffmpeg started on 2015-10-21 at 11:25:29
Report written to "ffmpeg-20151021-112529.log"
Command line:
ffmpeg -i luma_only.j2c -loglevel verbose -report
ffmpeg version N-75480-ge859a3c Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.8.1 (GCC)
  configuration: --enable-shared --enable-pthreads --prefix=/mingw
--enable-gpl --disable-debug --enable-libx264 --enable-libvpx
--enable-libvorbis --enable-libtheora --enable-hwaccels
  libavutil      55.  2.100 / 55.  2.100
  libavcodec     57.  3.100 / 57.  3.100
  libavformat    57.  2.100 / 57.  2.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6.  7.100 /  6.  7.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.100 /  2.  0.100
  libpostproc    54.  0.100 / 54.  0.100
Splitting the commandline.
Reading option '-i' ... matched as input file with argument 'luma_only.j2c'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging
level) with argument 'verbose'.
Reading option '-report' ... matched as option 'report' (generate a report)
with argument '1'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument verbose.
Applying option report (generate a report) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file luma_only.j2c.
Successfully parsed a group of options.
Opening an input file: luma_only.j2c.
[j2k_pipe @ 00036120] Format j2k_pipe probed with size=2048 and score=51
[j2k_pipe @ 00036120] Before avformat_find_stream_info() pos: 0 bytes
read:32768 seeks:0
[j2k_pipe @ 00036120] parser not found for codec jpeg2000, packets or times
may be invalid.
[j2k_pipe @ 00036120] parser not found for codec jpeg2000, packets or times
may be invalid.
[jpeg2000 @ 0003f480] PLT marker at pos 0x6C
[jpeg2000 @ 0003f480] Missing EOC
[jpeg2000 @ 0003f480] Progression order LRCP
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 2
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 2
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 2
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 2
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 2
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 2
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 2
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 2
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 2
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 2
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 2
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 2
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 2
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 2
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 2
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 2
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 2
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[jpeg2000 @ 0003f480] End mismatch 1
[j2k_pipe @ 00036120] After avformat_find_stream_info() pos: 164680 bytes
read:164680 seeks:0 frames:1
Input #0, j2k_pipe, from 'luma_only.j2c':
  Duration: N/A, bitrate: N/A
    Stream #0:0, 1, 1/25: Video: jpeg2000 (JPEG 2000 codestream restriction
0), 1 reference frame, gray16le(10 bpc), 1920x540 (0x0), 25 tbr, 25 tbn, 25 tbc
Successfully opened the file.
At least one output file must be specified
[AVIOContext @ 0003eb00] Statistics: 164680 bytes read, 0 seeks


Regards
Francesco




More information about the Libav-user mailing list