FN90 / openjpeg

Automatically exported from code.google.com/p/openjpeg
0 stars 0 forks source link

J2K codec issue on Windows Mobile #77

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Decoding a JP2K image on Windows Mobile
2. Display of bitmap on Windows Mobile

What is the expected output? What do you see instead?
  The source file are available under "test_original.j2k" and "test_changed.j2k"

  The screenshot of the image displayed on mobile is "j2k_sliced.png"

  The expected output image should be the face of a man but it appears in two parts shifted, cut in two and sliced. 

What version of the product are you using? On what operating system?
I am working on Windows Mobile 6 OS and using the OpenJPEG-1.4.0-revision-697 
library. 

Please provide any additional information below.

A discussion on this issue has already started, see 
http://groups.google.com/group/openjpeg/browse_thread/thread/d97c7fdc1aeda0b0

The first part of the JP2K header of the file "test_changed.j2k" has been 
removed to match the OpenJPEG format requirement.
The same image is correctly decoded on WindowsXP machine. Other kind of JPEG 
2000 image are correctly decoded on Windows Mobile. 

Thank you for your help.

Original issue reported on code.google.com by matthias...@gmail.com on 2 Aug 2011 at 12:24

Attachments:

GoogleCodeExporter commented 9 years ago
I have tested these files and found, that the original file
is broken. It does not start with a J2K MAGIC but with a
JP2 MAGIC. What follows is junk.

--------------------------------------------------------
#define JP2_RFC3745_MAGIC "\x00\x00\x00\x0c\x6a\x50\x20\x20\x0d\x0a\x87\x0a"
#define JP2_MAGIC "\x0d\x0a\x87\x0a"
#define J2K_CODESTREAM_MAGIC "\xff\x4f\xff\x51"

------------------ test_original -----------------------
read_j2k:

NOT A J2K FILE: test_original.j2k

0x00,0x00,0x00,0x0c, <== JP2_RFC3745_MAGIC part1
0x6a,0x50,0x20,0x20, <== JP2_RFC3745_MAGIC part2
0x0d,0x0a,0x87,0x0a, <== JP2_RFC3745_MAGIC part3

0x00,0x00,0x00,0xff, <== box_len

0x00,0x00,0x00,0x00, <== box_name

read_jp2:

NAME(test_original.j2k)
LENG(2963)

BOX_NAME(OÿQ) BOX_LEN(255)
BOX_NAME(^O~X,^_) BOX_LEN(2898778123)

The first box_name should be 'ftyp' (0x66,0x74,0x79,0x70)
e.g. :

NAME(file2.jp2)
LENG(452004)

BOX_NAME(ftyp) BOX_LEN(24)
   brand(jp2 ) minv(0)
   CL[0]()
   CL[1](jp2 )
BOX_NAME(jp2h) BOX_LEN(73)
BOX_NAME(ihdr) BOX_LEN(22)

--------------- test_changed ----------------------

read_j2k:

NAME(test_changed.j2k)
LENG(2948)

ENTER read_jp2c
marker(0xff4f) <== J2K_CODESTREAM_MAGIC part1
    soc len(0)
marker(0xff51) <== J2K_CODESTREAM_MAGIC part2
    siz len(47)
    capabilities(0)
    x(0 : 134) y(0 : 165)
    xt(0 : 134) yt(0 : 165)
    nr_components(3)
      component[0]signed(0) prec(8) hsep(1) vsep(1)
      component[1]signed(0) prec(8) hsep(1) vsep(1)
      component[2]signed(0) prec(8) hsep(1) vsep(1)
---------------------------------------------------

winfried

Original comment by szukw...@arcor.de on 2 Aug 2011 at 8:23

GoogleCodeExporter commented 9 years ago
test_original.j2k is not a valid JPEG 2000 file. What should openjpeg support 
it ? Closing issue.

Original comment by mathieu.malaterre on 11 Jan 2012 at 9:42