Performs LZ77 encoding.
IppStatus ippsEncodeLZ77_8u (Ipp8u** ppSrc, int* pSrcLen, IppLZ77Pair** ppDst, int* pDstLen, IppLZ77Flush flush, IppLZ77State_8u* pLZ77State);
ppSrc |
Double pointer to the source buffer. |
pSrcLen |
Pointer to the length of the source buffer. |
ppDst |
Double pointer to the destination buffer. |
pDstLen |
Pointer to the length of the destination buffer. |
flush |
Specifies the encoding mode for data blocks (see flush Parameter). |
pLZ77State |
Pointer to the LZ77 encoding state structure. |
The function ippsEncodeLZ77 is declared in the ippdc.h file. This function performs ZLIB encoding [ Ziv77 ] using the sliding wind ow technique in accordance with the RFC1951 specification.
The function uses the LZ77 encoding state structure pLZ77State that must be previously initialized by the function ippsEncodeLZ77InitAlloc or ippsEncodeLZ77Init.
The output data are of IppLZ 77Pair type that is defined as follows:
typedef struct IppLZ77Pairs {
Ipp16u length;
Ipp16u offset;
} IppLZ77Pair;
where length is a match length, and offset is a distance between the far-left position of the look-ahead buffer and the first literal of the string match in the sliding window. If the match is not found, the offset field contains 0 and the length field contains a single-literal code.
Code example demonstrates how to use the function ippsEncodeLZ77.
ippStsNoErr |
Indicates no error. |
ippStsNullPtrErr |
Indicates an error if one of the specified pointers is NULL. |
ippStsSizeErr |
Indicates an error if dstLen is less than or equal to 0. |
ippStsDstSizeLessExpected |
Indicates a warning that the size of the destination buffer is insufficient for completing the operation. |
Copyright © 2000 - 2010, Intel Corporation. All rights reserved.