Performs RLE decoding.
IppStatus ippsDecodeRLE_8u(const Ipp8u** ppSrc, int* pSrcLen, Ipp8u* pDst, int* pDstLen);
ppSrc |
Double pointer to the source data buffer. |
pSrcLen |
Pointer to the number of elements in the source buffer, after decoding pointer to the number of remaining elements. |
pDst |
Pointer to the destination data buffer. |
pDstLen |
Pointer to the number of elements in the destination buffer, after encoding to the actual number of elements in the destination buffer. |
The function ippsDecodeRLE is declared in the ippdc.h file. This function performs RLE decoding of srcLen elements of the source data buffer ppSrc and stores the result in the destination buffer pDst. After decoding the function updates the pSrcLen thus it points to the number of remaining elements of the source buffer, and pDstLen points to the actual number of elements stored in the destination buffer.
Sometimes the number of output elements can exceed the specified size of destination buffer. In this case the function returns the warning message and pointer to the number of not-decoded source elements. The user can call the function ippsDecodeRLE again to complete decoding.
Example below shows how to use the function ippsDecodeRLE_8u.
ippStsNoErr |
Indicates no error. |
ippStsNullPtrErr |
Indicates an error if one of the specicifed pointers is NULL. |
ippStsSizeErr |
Indicates an error if pSrcLen or pDstLen is less than or equal to 0. |
ippStsSrcDataErr |
Indicates an error if ppSrc contains unsupported data. |
ippStsDstSizeLessExpected |
Indicates a warning if size of the destination buffer is insufficient to store all output elements. |
void func_RLE()
{
Ipp8u* pSrc = (Ipp8u*)"aaadddddssadsaaddd";
int pSrcLen = 18;
int pDstLen = 18;
int pDstDLen = 18;
Ipp8u* pDst = ippsMalloc_8u(pDstLen);
Ipp8u* pDstD = ippsMalloc_8u(pDstDLen);
ippsEncodeRLE_8u(&pSrc, &pSrcLen, pDst, &pDstLen);
ippsDecodeRLE_8u(&pDst, &pDstLen, pDstD, &pDstDLen);
}
Result: pDst: aa1dd3ss0adsaa0dd1
pDstD: aaadddddssadsaaddd
Copyright © 2000 - 2010, Intel Corporation. All rights reserved.