EncodeHuffmanOne_JPEG

Performs Huffman encoding of one difference.

Syntax

IppStatus ippiEncodeHuffmanOne_JPEG_16s1u_C1(const Ipp16s* pSrc, Ipp8u* pDst, int nDstLenBytes, int* pDstCurrPos, const IppiEncodeHuffmanSpec* pEncHuffTable, IppiEncodeHuffmanState* pEncHuffState, int bFlushState);

Parameters

pSrc

Pointer to the difference to be encoded. This pointer can be NULL if bFlusfState = 1.

pDst

Pointer to the output bitstream buffer.

nDstLenBytes

Number of available bytes in the output buffer.

pDstCurrPos

Pointer to the current byte in the output buffer. This pointer is updated in the function.

pEncHuffTable

Pointer to the IppiEncodeHuffmanSpec structure that contains the Huffman code table. This pointer can be NULL if bFlusfState = 1.

pEncHuffState

Pointer to the IppiEncodeHuffmanState structure that contains the Huffman encoder state.

bFlushState

Setting this parameter to 1 forces the function to flush collected bits from the state structure to the bitstream, setting it to 0 forces to perform encoding.

Description

The function ippiEncodeHuffmanOne_JPEG is declared in the ippj.h file. This function encodes one difference pSrc using Huffman code table pEncHuffTable. Only full bytes are written to the output buffer. The IppiEncodeHuffmanState structure collects the bits that do not make up a complete byte. To force adding the bits accumulated in the IppiEncodeHuffmanState to the output buffer, the parameter bFlushState should be set to 1 when the last sample in scan or restart interval is encoded. In all other cases this parameter must be set to zero.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

When bFlushState=0, indicates an error condition if one of the specified pointers is NULL

When bFlushState=1, indicates an error condition if one of the pDst, pDstCurrPos, or pEncHuffState pointers is NULL.

ippStsSizeErr

Indicates an error condition if the nDstLenBytes parameter has zero or negative value, or if pDstCurrPos is out of nDstLenBytes limit.

Submit feedback on this help topic

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