HuffGetDstBuffSize

Computes the size of a destination buffer for Huffman encoding/decoding by blocks.

Syntax

IppStatus ippsHuffGetDstBuffSize_8u(const int codeLenTable[256], int srcLen, int* pEncDstBuffSize, int* pDecDstBuffSize);

Parameters

codeLenTable

Table with lengths of Huffman codes.

srcLen

Number of elements in the source buffer.

pEncDstBuffSize

Pointer to the computed size of the destination buffer for Huffman encoding.

pDecDstBuffSize

Pointer to the computed size of the destination buffer for Huffman decoding.

Description

The function ippsHuffGetDstBuffSize is declared in the ippdc.h file. This function computes the size (in bytes) of destination buffer for Huffman encoding and decoding by blocks. It must be called prior to the encoding/decoding operations.

The function computes the size of destination buffers for both operations. To exclude one of them the correspondent pointer must be set to NULL.

Application Notes

The following formula can be used to estimate maximum sizes of the destination buffer for the Huffman encoding and decoding by blocks:

encDstBuffSize = srcLen*4,

decDstBuffSize = srcLen*8

You can use these values without calling the function ippsHuffGetDstBuffSize. Nevertheless the function ippsHuffGetDstBuffSize allows to minimize the sizes of the destination buffers.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error if the codeLenTable pointer is NULL.

Submit feedback on this help topic

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