Example of Using VLC Coding Functions

The functions ippsVLCCountBits and ippsVLCEncodeBlock can be simply used in the wide range of different encoders (for example, for audio data). For example, if you need to quantize some vectors and encode them using no more bits than specified, these functions can be used as follows:

static IppsVLCTable_32s inputTable[]=
{
{value0, code0, length0};
{value1, code1, length1};
...
{valueN, codeN, lengthN};
}
ippsVLCEncodeGetSize_32s(InputTable, inputTableSize, &Size);
pVLCSpec = ippsMalloc_8u(Size); /* memory allocation */
ippsVLCEncodeInit_32s(pInputTable, inputTableSize, pVLCSpec);
...
Do {
//A some quantization algorithm should be here. Let pSrc is output of this algorithm.
... 
ippsVLCCountBits_16s32s(pSrc, srcLen, &bitNumber, pVLCSpec);
} while (bitNumber > allowedBitNumber);
ippsVLCEncodeBlock_16s1u (pSrc, srcLen, ppBitStream, pBitStreamBitsOffset, pVLCSpec);

Submit feedback on this help topic

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