Performs inverse quantization and inverse weighting on a block according to DV100 standard.
IppStatus ippiQuantWeightBlockInv_DV100_16s_C1I(Ipp16s* pSrcDst, const Ipp16s* pWeightInvTable, Ipp32s quantValue);
pSrcDst |
Pointer to the source and destination 8x8 block. |
pWeightInvTable |
Pointer to an array that contains values of weight table for the current block. |
quantValue |
Quantification step for the current block. |
This standard deals with only one block type - 8x8 block.
This function is declared in the ippvc.h header file. The function ippiQuantWeightBlockInv_DV100_16s_C1I performs inverse quantization and inverse weighting on a block in accordance with SMPTE 370M-2006 (DV100) [SMPTE370M-06] standard.
See "DV100 One Block Decoding" for the DV100 frame decoding process.
Step 1 passes the pointer to the required stream. Step 2 is segment decoding. The HuffmanDecodeSegment_DV (...) function decodes the block along with multiplying its elements by 64, that is, performs <<6 shift. The ippiQuantWeightBlockInv_DV100_16s_C1I(...) function combines Steps 3 and 4. Choose appropriate quantization and weighting tables, that is, dequantization and deweighting tables for decoding. To choose the quantization table, use the values of two parameters - QNO (quantization number) and the appropriate block quant class number (see Example "ippiQuantWeightBlockInv_DV100_16s_C1I Usage" ). For details, see [SMPTE370M-06], Table 25 - Quantization step.
The ippiQuantWeightBlockInv_DV100_16s_C1I(...) function uses the following three pointers as input arguments:
pDataBlock |
Pointer to the current block |
quantValue |
Quantification step for the current block |
pWeightTable |
Pointer to the weighting table |
The function performs the following operations:
The function performs the following operations:
for (Ipp32s i = 0;i < 64; i+= 1)
pDataBlock[i] = (Ipp16s) (
( pDataBlock[i]* pWeightTable[i] ) )
* quantValue )>>11 );
After ippiQuantWeightBlockInv_DV100_16s_C1I(...) completes Steps 3 and 4, Step 5 of iDCT is performed before Step 6.
See Example "ippiQuantWeightBlockInv_DV100_16s_C1I Usage".
{ //For more details see SMPTE 370M-2002 standard. //You can similarly get tables LumaQuantizeMatrix_720System //and ChromaQuantizeMatrix_720System. const Ipp32s LumaQuantizeMatrix_1080System[64] = { 128, 16, 17, 18, 18, 19, 42, 44, 16, 17, 18, 18, 19, 38, 43, 45, 17, 18, 19, 19, 40, 41, 45, 48, 18, 18, 19, 40, 41, 42, 46, 49, 18, 19, 40, 41, 42, 43, 48, 101, 19, 38, 41, 42, 43, 44, 98, 104, 42, 43, 45, 46, 48, 98, 109, 116, 44, 45, 48, 49, 101, 104, 116, 123 }; const Ipp32s ChromaQuantizeMatrix_1080System[64]= { 128, 16, 17, 25, 26, 26, 42, 44, 16, 17, 25, 25, 26, 38, 43, 91, 17, 25, 26, 27, 40, 41, 91, 96, 25, 25, 27, 40, 41, 84, 93, 197, 26, 26, 40, 41, 84, 86, 191, 203, 26, 38, 41, 84, 86, 177, 197, 209, 42, 43, 91, 93, 191, 197, 219, 232, 44, 91, 96, 197, 203, 209, 232, 246 }; //For more details see SMPTE 370M-2002 standard static const Ipp32s QuantizationSteps[] = { //Class Number //0 1 2 3 //Quantization Number (QNO) 0, 0, 0, 0, // 0 1, 2, 4, 8, // 1 2, 4, 8, 0, // 2 3, 6, 12, 0, // 3 4, 8, 0, 0, // 4 5, 10, 0, 0, // 5 6, 12, 0, 0, // 6 7, 14, 0, 0, // 7 8, 0, 0, 0, // 8 16, 32, 64, 0, // 9 18, 36, 72, 0, // 10 20, 40, 80, 0, // 11 22, 44, 88, 0, // 12 24, 48, 96, 0, // 13 28, 56, 112, 0, // 14 52, 104, 0, 0 // 15 }; /* ..... Before quantization and weighting, you should perform Huffman decoding ..... */ //nMBNum - number of the current macroblock int nMBNum; //curent DCT block in macroblock int nDCTBlockNum; //array of BlockParam for each block from 5 macroblock (8 * 5 = 40) BlockParam BlParam[40]; //Pointer to current DCT block in macroblock Ipp16s* pCurrDCTBlock; for(nMBNum = 0; nMBNum < 5; nMBNum++) { Ipp8u QNO = BlParam[nMBNum * 8].qno; for(nDCTBlockNum = 0; nDCTBlockNum < 8; nDCTBlockNum++) { Ipp8u ClassNumber = BlParam[nMBNum * 8 + nDCTBlockNum].cl; Ipp32s QuantStep = QuantizationSteps[QNO*4 + ClassNumber]; const Ipp16s* pQuantizeTable; //Dequantize block //Select quantization table that depends on system type and type //of block (luma or chroma) if(m_System == System720_60p) pQuantizeTable = (nDCTBlockNum < 4) ? LumaQuantizeMatrix_720System : ChromaQuantizeMatrix_720System; else pQuantizeTable = (nDCTBlockNum < 4) ? LumaQuantizeMatrix_1080System : ChromaQuantizeMatrix_1080System; //Do quantization and weighting //For more performance you should align pCurrDCTBlock and //pQuantizeTable pointers on a 16-byte boundary. ippiQuantWeightBlockInv_DV100_16s_C1I(pCurrDCTBlock, (Ipp16s * )pQuantizeTable, QuantStep); //Do inverse DCT ippiDCT8x8Inv_16s_C1I(pCurrDCTBlock); pCurrDCTBlock += 64; }//for nDCTBlockNum = 0 to 7 } };
ippStsNoErr |
Indicates no error. |
ippStsNullPtrErr |
Indicates an error when the pSrcDst pointer is NULL. |
Copyright © 2000 - 2011, Intel Corporation. All rights reserved.