| synopsis || arguments || prev |
void decode( kdu_block * block)
Java: void Decode( Kdu_block block)
[Declared in "../coresys/common/kdu_block_coding.h"]
Decodes a single block of samples. The dimensions of the block are in block→size — none of the geometric transformation flags in block→size have any meaning here.
On entry, block→num_passes indicates the number of coding passes which are to be decoded and block→missing_msbs the number of most significant bit-planes which are to be skipped. The function processes all coding passes, unless unable to do so for reasons of available implementation precision limitations, or an error was detected by error resilience mechanisms and corrected by discarding passes believed to be erroneous.
On exit, the decoded samples are in the block→sample_buffer array, organized in scan-line order. The sample values themselves have a sign-magnitude representation, with the most significant magnitude bit-plane appearing in bit position 30 and the sign (1 for -ve) in bit position 31. At each sample location, if p is the index of the least significant decoded magnitude bit and the sample is non-zero, the function sets bit p-1. This has the effect of both signalling the location of the least significant decoded magnitude bit-plane and also implementing the default mid-point rounding rule for dequantization. The value of block→K_max_prime identifies the maximum number of magnitude bit-planes (including missing MSB's) which could have been coded. Knowledge of this value allows the function to determine whether or not all coding passes have been decoded, without truncation — this in turn, affects the behaviour of the error resilience mechanisms.