Decodes one RLE Segment.
IppStatus ippiUnpackBitsRow_TIFF_8u_C1(const Ipp8u* pSrc, int* pSrcCurrPos, int srcLenBytes, Ipp8u* pDst, int dstLenBytes);
pSrc |
Pointer to input buffer with RLE segment |
srcLenBytes |
Size of the input RLE segment, bytes. |
pSrcCurrPos |
Pointer to the current byte position in the input buffer. |
pDst |
Pointer to the output buffer. |
dstLenBytes |
Size of single uncompressed row, bytes. |
The function ippiUnpackBitsRow_TIFF is declared in the ippj.h file. This function decodes srcLenBytes data from the input buffer pSrc containing RLE Segment. Decoded Byte segment is stored in the output buffer pDst. The size of the input buffer must be sufficient to keep data for at least one row of Byte Segment. The function uses the decompression algorithm called UnPackBits (TIFF 6.0 specification) that can be expressed in pseudo-code as follows:
LOOP until the number of desired output bytes
Read the next source byte into N
IF N >= 0 and N <= 127 THEN
output the next N+1 bytes literally
ELSE IF N <= -1 and N >= -127 THEN
output the next byte -N+1 times
ELSE IF N = -128
output nothing
ENDIF
ENDLOOP
ippStsNoErr |
Indicates no error. |
ippStsNullPtrErr |
Indicates an error if pSrc or pDst pointer is NULL. |
ippStsSizeErr |
Indicates an error condition if pSrcCurrPos has an illegal value, or if dstLenBytes has a negative value. |
ippStsUnderRunErr |
Indicates an error condition if size of the buffer pSrc is insufficient to decompress row of the Byte segment. |
Copyright © 2000 - 2010, Intel Corporation. All rights reserved.