JBP Block Codec¶
Version: 1.0
URI: https://awslabs.github.io/osml-imagery-io/codecs/jbp-block
Codec type: array-to-bytes
Decodes uncompressed JBP/NITF/NSIF image blocks into NumPy arrays. Performs interleave conversion (from the source IMODE to band-sequential) and big-endian to native-endian byte swap.
This codec is NITF-specific — it uses NITF interleave modes (IMODE) and pixel value types (PVTYPE) to interpret the raw pixel bytes.
Document Conventions¶
The key words “MUST”, “MUST NOT”, “SHOULD”, and “MAY” in this document are to be interpreted as described in RFC 2119.
Codec Identifier¶
The value of the name member in the codec metadata MUST be
https://awslabs.github.io/osml-imagery-io/codecs/jbp-block.
Encoded Representation¶
The encoded representation MUST be raw uncompressed pixel data as defined by
MIL-STD-2500C for NITF image data segments. The byte sequence contains pixel
values in big-endian byte order arranged according to the interleave mode
specified in the imode configuration parameter.
The total byte length MUST equal num_bands * block_height * block_width * (nbpp / 8).
Configuration Parameters¶
Field |
Type |
Required |
Description |
|---|---|---|---|
|
|
Yes |
Number of bands. |
|
|
Yes |
Block height in pixels. |
|
|
Yes |
Block width in pixels. |
|
|
Yes |
Bits per pixel per band ( |
|
|
Yes |
NITF interleave mode: |
|
|
Yes |
NITF pixel value type: |
PVTYPE / NBPP to NumPy dtype Mapping¶
PVTYPE |
NBPP |
NumPy dtype |
|---|---|---|
|
8 |
|
|
16 |
|
|
32 |
|
|
8 |
|
|
16 |
|
|
32 |
|
|
32 |
|
|
64 |
|
Algorithm¶
Decoding¶
Validate that the input data length equals
num_bands * block_height * block_width * (nbpp / 8)bytes.Convert the pixel data from the input
imodeto band-sequential (BSQ) format.Swap big-endian bytes to native-endian byte order.
Return an array with shape
(num_bands, block_height, block_width)and the dtype corresponding to thepvtype/nbppcombination.
Encoding¶
Encoding is not currently specified. See Implementation Notes.
Example Configuration¶
{
"name": "https://awslabs.github.io/osml-imagery-io/codecs/jbp-block",
"configuration": {
"num_bands": 3,
"block_height": 256,
"block_width": 256,
"nbpp": 16,
"imode": "P",
"pvtype": "INT"
}
}
References¶
MIL-STD-2500C — National Imagery Transmission Format (NITF)
RFC 2119 — Key words for use in RFCs to Indicate Requirement Levels
Implementation Notes¶
aws.osml.io.zarr_codecs.JbpBlockCodec — see API Reference.
Only the decode path is implemented. Calling encode() raises NotImplementedError.