Opened 6 years ago

Closed 3 months ago

Last modified 3 months ago

#4322 closed defect (fixed)

Tile size in NITF header needs to match tile size in JPEG2000 codestream

Reported by: jeepingben Owned by: warmerdam
Priority: normal Milestone: 2.2.0
Component: default Version: svn-trunk
Severity: normal Keywords:
Cc:

Description

When writing a NTIF using JPEG2000 compression, the tile size stored in the NITF header (NPBBH and NPPBV) need to match the tile size used in the JPEG2000 codestream (passed using :

BLOCKXSIZE and BLOCKYSIZE in JP2KAK driver TILE_WIDTH and TILE_HEIGHT for JP2ECW driver <tilesize> %d %d </tilesize> for JP2MrSID driver BLOCKXSIZE and BLOCKYSIZE for JP2OpenJPEG driver)

The default sizes are large (at least in the JP2KAK driver), X is 20000 and y is the image height. NBPPH only has 4 digits, so it can't exceed 9999 (I saw 8192 as a limit in the NITF documentation), so the codestream tiling should be adjusted rather than adjusting NPPBH and NPPBV.

Change History (5)

comment:1 Changed 6 years ago by Even Rouault

What is the reference for the fact that the tile size stored in the NITF header (NPBBH and NPPBV) need to match the tile size used in the JPEG2000 codestream ?

comment:2 Changed 6 years ago by jeepingben

http://isotc.iso.org/livelink/livelink/fetch/2000/2122/327993/327973/654328/6208440/documents/24n3111%20(BPJ2K0110).pdf page 41 says NPPBH and NPPBV must be 0 if the image is larger than 8192 and is not tiled.

http://www.gwg.nga.mil/ntb/baseline/docs/stdi0006/FSTDI-0006-NCDRD-15Sep05.doc page 2-30 This isn't exactly a NITF spec, but describes matching tile size to jpeg block size for NITF commercial products.

It sounds like at a minimum, NPPB* should be set to 0 for large untiled images. Tiling speeds up random access and chipping operations. Large images (like geoeye) are difficult to work with when they are untiled.

comment:3 Changed 3 months ago by Even Rouault

Resolution: fixed
Status: newclosed

In 38085:

NITF: add support for writing JPEG2000 compressed images with JP2OpenJPEG driver; fix writing with JP2KAK driver (emit codestream only instead of JP2 format); fix setting of NBPR/NBPC/NPPBH/NPPBV fields for JPEG2000 (fixes #4322); in JP2ECW case, make sure that the default PROFILE=NPJE implies 1024 block size at the NITF level

comment:4 Changed 3 months ago by Even Rouault

In 38086:

NITF: add support for writing JPEG2000 compressed images with JP2OpenJPEG driver; fix writing with JP2KAK driver (emit codestream only instead of JP2 format); fix setting of NBPR/NBPC/NPPBH/NPPBV fields for JPEG2000 (fixes #4322); in JP2ECW case, make sure that the default PROFILE=NPJE implies 1024 block size at the NITF level

comment:5 Changed 3 months ago by Even Rouault

Milestone: 2.2.0
Note: See TracTickets for help on using tickets.