EncodeLoadCodeBlock_JPEG2K

Loads a code block and prepares data for entropy encoding.

Syntax

IppStatus ippiEncodeLoadCodeBlock_JPEG2K_32s_C1R(const Ipp32s* pSrc, int srcStep, IppiSize codeBlockSize, IppiEncodeState_JPEG2K* pState, IppiWTSubband subband, int magnBits, IppiMQTermination mqTermType, IppiMQRateAppr mqRateAppr, int codeStyleFlags, int* pSfBits, int* pNOfPasses, int* pNOfTermPasses);

Parameters

pSrc

Pointer to the source code block.

srcStep

Distance in bytes between starts of consecutive lines in the code block.

codeBlockSize

Size of the code block.

pState

Pointer to allocated and initialized encoder state structure.

subband

Wavelet transform subband contained the given code block. Possible values are listed in the Table “Subband Parameter for the JPEG2000 Entropy Coder Functions”.

magnBits

Non-fractional bit count in integer representation.

codeStyleFlags

Specifies the options for encoding procedure. The possible values are listed in the Table “CodeStyleFlag Argument for the JPEG2000 Entropy Coder Functions”.

mqTermType

Termination mode for MQ-coder. Possible values are listed in the Table “MqTermType Argument for the JPEG2000 Entropy Coder Functions”.

mqRateAppr

Specifies the bit rate estimation model. Only one value, ippMQRateApprGood, that sets the non-optimal approximation model is available now.

pSfBits

Pointer to the variable that returns the number of significant bit planes.

pNOfPasses

Pointer to the variable that returns the number of coding passes.

pNOfTermPasses

Pointer to the variable that returns the number of terminated coding passes.

Description

The function ippiEncodeLoadCodeBlock_JPEG2K is declared in the ippj.h file. This function performs the first encoding procedure, that is, loads the specified code block, computes required parameters of the MQ-coder, and prepares data for the second encoding procedure. The wavelet transform subband should be specified in the subband parameter. Possible values are listed in the Table “Subband Parameter for the JPEG2000 Entropy Coder Functions”.

Subband Parameter for the JPEG2000 Entropy Coder Functions  
Value Description
ippWTSubbandLxLy Subband obtained by low-pass filtering along x and y directions
ippWTSubbandLxHy Subband obtained by low-pass filtering along x and high-pass filtering along y direction
ippWTSubbandHxLy Subband obtained by high-pass filtering along x and low-pass filtering along y direction
ippWTSubbandHxHy Subband obtained by high-pass filtering along x and y directions
CodeStyleFlag Argument for the JPEG2000 Entropy Coder Functions 
Value Description
IPP_JPEG2K_VERTICALLY_CAUSAL_CONTEXT Sets the creation of vertically causal context
IPP_JPEG2K_SELECTIVE_MQ_BYPASS Sets the selective MQ encoding bypass, which is raw encoding for some coding passes
IPP_JPEG2K_TERMINATE_ON_EVERY_PASS Sets the termination of MQ coder after every coding pass
IPP_JPEG2K_RESETCTX_ON_EVERY_PASS Sets the reset of MQ coder context after each coding pass
IPP_JPEG2K_USE_SEGMENTATION_SYMBOLS Uses the segmentation symbol sequence for error resilience
IPP_JPEG2K_LOSSLESS_MODE Indicates that the lossless wavelet transforms are used in the rate-distortion estimation
IPP_JPEG2K_DEC_CONCEAL_ERRORS Allows the error concealment in the last bit-plane where the errors were detected
IPP_JPEG2K_DEC_DO_NOT_CLEAR_CB Does not clear the code block data before decoding
IPP_JPEG2K_DEC_DO_NOT_RESET_LOW_BITS Does not reset low-order bits after decoding
IPP_JPEG2K_DEC_DO_NOT_CLEAR_SFBUFFER Does not clear the buffer before decoding to keep the previous significance state
IPP_JPEG2K_DEC_CHECK_PRED_TERM Verifies during decoding if the predictable termination is correct; if not - “damage in codeblock” error code is generated. It should be used in predictable termination mode.
MqTermType Argument for the JPEG2000 Entropy Coder Functions  
Value Description
ippMQTermSimple Simple termination - some extra bytes are added
ippMQTermNearOptimal Near optimal termination mode
ippMQTermPredictable Termination mode for predictable error resilience

The variable sfBits returns the number of significant bit planes only. For example, if all source pixels are non-negative and their maximum value is 0xA (binary 1010), then sfBits should return 4 significant bits. The higher bits are not coded.

Only significant non-fractional bits in integer representation are coded. magnBits specifies the number of non-fractional bits. For example, if magnBits = 11, the 20 (31-11) least significant bits will not be coded.

Negative integers in the code block should be presented in direct code with the sign in the most significant bit (31st in the zero-based numeration, when the least significant bit has a zero index). This code may be effectively obtained using the specially designed function ippiComplement.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error when any of the specified pointers is NULL.

ippStsSizeErr

Indicates an error condition if the width or height of the code block has zero or negative value.

ippStsContextMatchErr

Indicates an error condition if a pointer to an invalid state structure is passed.

ippStsStepErr

Indicates an error condition if srcStep has zero or negative value.

Submit feedback on this help topic

Copyright © 2000 - 2011, Intel Corporation. All rights reserved.