よくある質問(FAQ)

How to extract low resolution packets from one JPEG2000 stream

The JPEG2000 stream contains information about different resolutions of the original input. The scalability feature of JPEG2000 allows to extract a lower resolution only, if this is required by the application.

In order to extract a low resolution version of the original data, set progression order to LRCP and enable PLT [Packet length, Tile Part header] markers.

Refer to the Programming Guide, Encode Parameter section.

The JPEG2000 stream is then output in the following order:

Y, Resolution 0 [smallest, contains only resolution 0]
Cb, Resolution 0 [smallest, contains only resolution 0]
Cr, Resolution 0 [smallest, contains only resolution 0]
Y, Resolution 1 [ contains resolutions 0 and 1]
Cb, Resolution 1 [contains resolutions 0 and 1]
Cr, Resolution 1 [contains resolutions 0 and 1]
.
.
.
.
.
Y, Resolution 5 [contains resolutions 0, 1, 2, 3, 4, 5]
Cb, Resolution 5 [contains resolutions 0,1,2,3,4,5]
Cr, Resolution 5 [contains resolutions 0,1,2,3,4,5]

Then extract for each component the required resolution packets. The PLT marker starts with code 0xFF58 and its header will include the length of this packet.

The main header would then have to be changed to:

In the SIZ marker, change the Xsiz, Ysiz, XTsiz, and YTsiz values to reflect the new image dimensions.

In the COD marker (SPcod parameter), change the number of decomposition levels accordingly, for example if resolution 4 is extracted, use 4 instead of 5.