Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.
6709 Discussions

ippiDecodeHuffman8x8_Direct_JPEG_1u16s_C1 problem!

cloud007
Beginner
279 Views
IPPAPI(IppStatus, ippiDecodeHuffman8x8_Direct_JPEG_1u16s_C1,(const Ipp8u *pSrc, int *pSrcBitsLen,
Ipp16s *pDst, Ipp16s *pDCPred,
int *pMarker, Ipp32u *pPrefetchedBits,
int *pNumValidPrefetchedBits,
const IppiDecodeHuffmanSpec *pDCHuffTable,
const IppiDecodeHuffmanSpec *pACHuffTable))

Can some one tell me the meaning of the following parameter:
1.pNumValidPrefetchedBits:this should indicate how much bits avaliable in pPrefetchedBits,does the available bits start from the lowest 0 bit or start from highest bit?
2.Assume *pNumValidPrefetchedBits is 10,*pSrcBitsLen=0,then call function ippiDecodeHuffman8x8_Direct_JPEG_1u16s_C1,if get the varaiable *pSrcBitsLen=10,then how much bits used? 10+10 or 10 bits?Does any bit in pSrc is used?
0 Kudos
3 Replies
Vladimir_Dudnik
Employee
279 Views
Hi Cloud,
1) This function uses bits prefetching to speedup processing of bitstream. It means, on the first call, function will prefetch bits from bitstream into buffer (this buffer can fit into processor register) and after that function will obtain bits from this buffer. Doing so we do not need to read bitstream at every call of the function. The most significan bit in prefetch buffer should be the first bit in bitstream.
2) With using such prefetch techinque it is possible to reach end of bitstream buffer (pointed by pSrc with len in pSrcBitsLen) before all bits will be processed. This is because some last bits which are near to the end of JPEG stream already contained in prefetch buffer. So, it is OK to call function even if counter of bits in bitstream, pointed by pSrcBitsLen reach zero.
You just need to provide pointer to Ipp32u variable and pointer to integer, function will update this variables automatically. Note, you need to initialize these variables with zero before first call, and after each restart interval marker in JPEG stream.
Regards,
Vladimir
0 Kudos
cloud007
Beginner
279 Views
Thanks for your detailed explaination.Now I can replace huffman decoding with this API.But there's no speed improvement,is this result correct?
0 Kudos
Vladimir_Dudnik
Employee
279 Views
Hi Cloud,
To be honest, in JPEG decoding the most time takes IDCT operation, so it is not enough to replace only huffman functions.
Regards,
Vladimir
0 Kudos
Reply