| synopsis || functions || variables |

kdu_block [struct]

Java: Kdu_block

[Declared in "../coresys/common/kdu_compressed.h"]


Synopsis

This structure is used for intermediate storage of code-block information. Compressed code-blocks are stored in a much more efficient form, which is translated to and from the form in this structure by the kdu_subband::open_block, kdu_precinct::open_block, kdu_subband::close_block and kdu_subband::close_block functions. The present form of the structure is designed to facilitate block coding activities.

Unlike kdu_codestream, kdu_tile, kdu_tile_comp, kdu_resolution, kdu_subband and kdu_precinct, this structure is not simply an interface to the internal machinery. It provides publically accessible member functions for efficient manipulation by block encoder and decoder implementations.

To obtain a pointer to a kdu_block structure, you will need to use one of the functions, kdu_subband::open_block (most common) or kdu_precinct::open_block (usually for interactive servers). Do not construct your own instance of kdu_block!

The kdu_block structure manages shared storage for encoders and decoders. Specifically, the sample_buffer and context_buffer arrays are provided for the benefit of the block encoding and decoding implementations. Their size is not automatically determined by the code-block dimensions. Instead, it is the responsibility of the block coding implementation to check the size of these arrays and augment them, if necessary, using the set_max_samples and set_max_contexts functions.


Public Functions

get_max_passes {Java: Get_max_passes}

set_max_passes {Java: Set_max_passes}

get_max_bytes {Java: Get_max_bytes}

set_max_bytes {Java: Set_max_bytes}

set_max_samples {Java: Set_max_samples}

set_max_contexts {Java: Set_max_contexts}

get_size {Java: Get_size}

set_size {Java: Set_size}

get_region {Java: Get_region}

set_region {Java: Set_region}

get_transpose {Java: Get_transpose}

set_transpose {Java: Set_transpose}

get_vflip {Java: Get_vflip}

set_vflip {Java: Set_vflip}

get_hflip {Java: Get_hflip}

set_hflip {Java: Set_hflip}

get_modes {Java: Get_modes}

set_modes {Java: Set_modes}

get_orientation {Java: Get_orientation}

set_orientation {Java: Set_orientation}

get_missing_msbs {Java: Get_missing_msbs}

set_missing_msbs {Java: Set_missing_msbs}

get_num_passes {Java: Get_num_passes}

set_num_passes {Java: Set_num_passes}

get_pass_lengths {Java: Get_pass_lengths}

set_pass_lengths {Java: Set_pass_lengths}

get_pass_slopes {Java: Get_pass_slopes}

set_pass_slopes {Java: Set_pass_slopes}

get_buffered_bytes {Java: Get_buffered_bytes}

set_buffered_bytes {Java: Set_buffered_bytes}

start_timing {Java: Start_timing}

finish_timing {Java: Finish_timing}

initialize_timing {Java: Initialize_timing}

get_timing_stats {Java: Get_timing_stats}

Public Variables

size [kdu_coords]

Records the dimensions of the code-block. These are the true dimensions, used by the block encoder or decoder — they are unaffected by regions of interest or geometric transformations.

region [kdu_dims]

Identifies the region of interest inside the block. This region is not corrected for any prevailing geometric transformations, which may be in force. region.pos identifies the upper left hand corner of the region, relative to the upper left hand corner of the code-block. Thus, if the region of interest is the entire code-block, region.pos will equal (0,0) and region.size will equal size, regardless of the geometric transformation flags described.

transpose [bool]

Together, the transpose, vflip and hflip fields identify any geometric transformations which need to be applied to the code-block samples after they have been decoded, or before they are encoded. These quantities are to be interpreted as follows:

vflip [bool]

See description of transpose.

hflip [bool]

See description of transpose.

modes [int]

Holds the logical OR of the coding mode flags. These flags may be tested using the Cmodes_BYPASS, Cmodes_RESET, Cmodes_RESTART, Cmodes_CAUSAL, Cmodes_ERTERM and Cmodes_SEGMARK macros defined in "kdu_params.h". For more information on the coding modes, see the description of the Cmodes attribute offered by the cod_params parameter class.

orientation [int]

Holds one of LL_BAND, HL_BAND (horizontally high-pass), LH_BAND (vertically high-pass) or HH_BAND. The subband orientation affects context formation for block encoding and decoding. The value of this member is unaffected by the geometric transformation flags, since it has nothing to do with apparent dimensions.

resilient [bool]

Encourages a block decoder to attempt to locate and conceal errors in the embedded bit-stream it is decoding. For a discussion of how this may be accomplished, the reader is referred to Section 12.4.3 in the book by Taubman and Marcellin.

For more information regarding the interpretation of the resilient mode, consult the comments appearing with the declaration of kdu_codestream::set_resilient.

fussy [bool]

Encourages a block decoder to check for compliance, generating an error message through kdu_error if any problems are detected.

For more information regarding the interpretation of the resilient mode, consult the comments appearing with the declaration of kdu_codestream::set_fussy.

K_max_prime [int]

Maximum number of magnitude bit-planes for the subband, including ROI adjustments. See kdu_subband::get_K_max_prime for further discussion of this quantity.

missing_msbs [int]

Written by the encoder; read by the decoder. For an explanation of this quantity, refer to Section 8.4.2 in the book by Taubman and Marcellin.

num_passes [int]

Written by the encoder; read by the decoder. Number of coding passes generated (encoder) or available (decoder), starting from the first bit-plane after the initial missing_msbs bit-planes.

pass_lengths [int *]

Entries are written by the encoder; read by the decoder. The first entry holds the total number of code bytes associated with the first coding pass of the first bit-plane following the initial missing_msbs empty bit-planes. Subsequent entries identify lengths of the incremental contributions made by each consecutive coding pass to the total embedded bit-stream for the code-block.

Use max_passes and set_max_passes to make sure this array contains sufficient elements.

pass_slopes [kdu_uint16 *]

The entries in this array must be strictly decreasing, with the exception that 0's may be interspersed into the sequence.

Use max_passes and set_max_passes to make sure this array contains sufficient elements.

byte_buffer [kdu_byte *]

This array is allocated in such a way as to allow access to elements with indices in the range -1 through max_bytes-1. This can be useful when working with the MQ encoder.

Use max_bytes and set_max_bytes to make sure this array contains sufficient elements.

max_passes [int]

Current size of the pass_lengths and pass_slopes arrays.

max_bytes [int]

Current size of the byte_buffer array.

sample_buffer [kdu_int32 *]

Not used by the internal code-stream management machinery itself, this array provides a convenient shared resource for the benefit of block encoder and decoder implementations. Use max_samples and set_max_samples to make sure the array contains sufficient elements.

context_buffer [kdu_int32 *]

Not used by the internal code-stream management machinery itself, this array provides a convenient shared resource for the benefit of block encoder and decoder implementations. Use max_contexts and set_max_contexts to make sure the array contains sufficient elements.

max_samples [int]

Current size of the sample_buffer array.

max_contexts [int]

Current size of the context_buffer array.

errors_detected [bool]

True if a warning message has already been issued by the block decoder when operating in resilient mode — saves a massive number of warnings from being delivered when a heavily corrupted code-stream is encountered.

insufficient_precision_detected [bool]

True if a warning message has already been issued by the block encoder to indicate that the 32-bit implementation has insufficient precision to represent ROI foreground and background regions completely losslessly.


| top || synopsis || functions || variables |