PackBits

Packs part of data bits from the vector to the bitstream.

Syntax

IppStatus ippsPackBits_32u8u(const Ipp32u* pSrcBit, const int* pSrcBits, int srcLen, Ipp8u* pDst, int dstBitOffset, int* pDstLenBit);

Parameters

pSrcBit

Pointer to the source vector with data.

pSrcBits

Pointer to the source vector that specifies the number of data bits.

srcLen

Number of elements in each source vector.

pDst

Pointer to the destination vector (bitstream).

dstBitOffset

Offset (in bits) in the first byte of the destination vector.

pDstLenBit

Pointer to the length in bits of the destination vector.

Description

The function ippsPackBits is declared in the ipps.h file. This function copies the certain number of bits from each element of the data source vector pSrcBit and stores them contiguously in the destination vector pDst starting from the bit position dstBitOffset. Each element of the source vector pSrcBits contains the number of bits that are copied from the corresponding element of the vector pSrcBit. If this number is less than 0, or greater than 32, then its value is set to 0 or 32 respectively. If such cases occur, the function returns the warning message after completing the operation. After completing the operation the function returns the length of the destination vector in bits pDstLenBit.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error when one of the specified pointers is NULL.

ippStsSizeErr

Indicates an error when srcLen is less than or equal to 0, or dstBitOffset is less than 0.

ippStsOverlongString

Indicates a warning when pSrcBits[i] is greater than 32 or less than 0.

Submit feedback on this help topic

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