DecodeRLE

Performs RLE decoding.

Syntax

IppStatus ippsDecodeRLE_8u(const Ipp8u** ppSrc, int* pSrcLen, Ipp8u* pDst, int* pDstLen);

Parameters

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.

Description

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.

Return Values

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.

Using RLE Encoding and Decoding Functions

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

Submit feedback on this help topic

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