| synopsis || arguments || prev |
void encode( kdu_block * block, bool reversible=false, double msb_wmse=0.0F, kdu_uint16 estimated_slope_threshold=0)
Java: void Encode( Kdu_block block, boolean reversible, double msb_wmse, int estimated_slope_threshold)
[Declared in "../coresys/common/kdu_block_coding.h"]
Encodes a single block of samples.
On entry, block→num_passes indicates the number of coding passes which are to be processed and block→missing_msbs the number of most significant bit-planes which are known to be zero. The function should process all coding passes, unless this is not possible given the available implementation precision, or a non-zero estimated_slope_threshold argument allows it to determine that some passes can be skipped (see below).
The samples must be in the block→samples buffer, organized in raster scan order. The sample values themselves are expected to 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.
On exit, the block→byte_buffer and block→pass_lengths arrays should be filled out, although note that the num_passes value may have been reduced, if the function was able to determine that some passes would almost certainly be discarded during rate allocation later on (only if estimated_slope_threshold != 0).
Irrelevant unless distortion-length slopes are to be estimated (i.e., msb_wmse is non-zero). Whether the subband sample indices represent reversibly transformed image data or irreversibly transformed and quantized image data has a subtle impact on the generation of rate-distortion information.
If non-zero, the block processor is expected to generate distortion-length slope information and perform a convex hull analysis, writing the results to the block→pass_slopes array. Otherwise, the block→pass_slopes array's contents will not be touched — no assumption is made concerning their contents.
A non-zero value indicates an expected lower bound on the distortion-length slope threshold which is likely to be selected by the PCRD-opt rate control algorithm (the logarithmic representation is identical to that associated with the block→pass_slopes array). This enables some coding passes which are highly unlikely to be included in the final compressed representation to be skipped, thereby saving processing time. The capability is available only if msb_wmse is also non-zero, meaning that distortion-length slope values are to be estimated.