Evaluates number of zeros in a block.
IppStatus ippiCountZeros8x8_16s_C1(Ipp16s* pSrc, Ipp32u* pCount);
pSrc |
Pointer to the block. |
pCount |
Pointer to the number of zeros. |
This function is declared in the ippvc.h header file. The function ippiCountZeros8x8_16s_C1 is used to identify the type of a block by comparing the results from DCT of the first type and DCT of the second type performed on the block.
See Example "Usage of ippiCountZeros8x8", where pBlock is the pointer to the current block and WeightTableType0 represents tables of the weight coefficients for discrete cosine transform (see [SMPTE314M] Chapters 5.2 DCT Mode and 5.2.2 Weighting). The coefficients are real numbers that are multiplied by 32767 and reduced to short type through scaling by 215.
Ipp16s sTmp[64]; Ipp32u countzero, countzero1; memcpy(sTmp, pBlock->m_psData, 64 * sizeof(Ipp16s)); ippiDCT8x8Fwd_16s_C1I(pBlock->m_psData); ippsMul_16s_ISfs(WeightTableType0, pBlock->m_psData, 64, 16); ippiDCT2x4x8Frw_16s_C1I(sTmp); ippsMul_16s_ISfs(WeightTableType1, sTmp, 64, 16); ippiCountZeros8x8_16s_C1((Ipp16s *)(pBlock->m_psData), &countzero); ippiCountZeros8x8_16s_C1((Ipp16s *)sTmp, &countzero1); if (countzero >= countzero1) { pBlock->m_cM0 = 0; } else { pBlock->m_cM0 = 1; memcpy(pBlock->m_psData, sTmp, 64* sizeof(Ipp16s)); }
ippStsNoErr |
Indicates no error. |
ippStsNullPtrErr |
Indicates an error when at least one of the pointers is NULL. |
Copyright © 2000 - 2011, Intel Corporation. All rights reserved.