omxVCM4P10_DecodeChromaDcCoeffsToPairCAVLC.c revision 0c1bc742181ded4930842b46e9507372f0b1b963
1/* ---------------------------------------------------------------- 2 * 3 * 4 * File Name: omxVCM4P10_DecodeChromaDcCoeffsToPairCAVLC.c 5 * OpenMAX DL: v1.0.2 6 * Revision: 9641 7 * Date: Thursday, February 7, 2008 8 * 9 * (c) Copyright 2007-2008 ARM Limited. All Rights Reserved. 10 * 11 * 12 * 13 * H.264 decode coefficients module 14 * 15 */ 16 17#include "omxtypes.h" 18#include "armOMX.h" 19#include "omxVC.h" 20 21#include "armCOMM.h" 22#include "armVC.h" 23 24/** 25 * Function: omxVCM4P10_DecodeChromaDcCoeffsToPairCAVLC (6.3.4.1.1) 26 * 27 * Description: 28 * Performs CAVLC decoding and inverse raster scan for a 2x2 block of 29 * ChromaDCLevel. The decoded coefficients in the packed position-coefficient 30 * buffer are stored in reverse zig-zag order, i.e., the first buffer element 31 * contains the last non-zero postion-coefficient pair of the block. Within 32 * each position-coefficient pair, the position entry indicates the 33 * raster-scan position of the coefficient, while the coefficient entry 34 * contains the coefficient value. 35 * 36 * Input Arguments: 37 * 38 * ppBitStream - Double pointer to current byte in bit stream buffer 39 * pOffset - Pointer to current bit position in the byte pointed to by 40 * *ppBitStream; valid in the range [0,7]. 41 * 42 * Output Arguments: 43 * 44 * ppBitStream - *ppBitStream is updated after each block is decoded 45 * pOffset - *pOffset is updated after each block is decoded 46 * pNumCoeff - Pointer to the number of nonzero coefficients in this block 47 * ppPosCoefBuf - Double pointer to destination residual 48 * coefficient-position pair buffer. Buffer position 49 * (*ppPosCoefBuf) is updated upon return, unless there are only 50 * zero coefficients in the currently decoded block. In this case 51 * the caller is expected to bypass the transform/dequantization of 52 * the empty blocks. 53 * 54 * Return Value: 55 * 56 * OMX_Sts_NoErr, if the function runs without error. 57 * 58 * OMX_Sts_BadArgErr - bad arguments: if one of the following cases occurs: 59 * - ppBitStream or pOffset is NULL. 60 * - ppPosCoefBuf or pNumCoeff is NULL. 61 * OMX_Sts_Err - if one of the following is true: 62 * - an illegal code is encountered in the bitstream 63 * 64 */ 65 66OMXResult omxVCM4P10_DecodeChromaDcCoeffsToPairCAVLC ( 67 const OMX_U8** ppBitStream, 68 OMX_S32* pOffset, 69 OMX_U8* pNumCoeff, 70 OMX_U8** ppPosCoefbuf 71 ) 72 73{ 74 armRetArgErrIf(ppBitStream==NULL , OMX_Sts_BadArgErr); 75 armRetArgErrIf(*ppBitStream==NULL , OMX_Sts_BadArgErr); 76 armRetArgErrIf(pOffset==NULL , OMX_Sts_BadArgErr); 77 armRetArgErrIf(*pOffset<0 , OMX_Sts_BadArgErr); 78 armRetArgErrIf(*pOffset>7 , OMX_Sts_BadArgErr); 79 armRetArgErrIf(pNumCoeff==NULL , OMX_Sts_BadArgErr); 80 armRetArgErrIf(ppPosCoefbuf==NULL , OMX_Sts_BadArgErr); 81 armRetArgErrIf(*ppPosCoefbuf==NULL , OMX_Sts_BadArgErr); 82 83 return armVCM4P10_DecodeCoeffsToPair(ppBitStream, pOffset, pNumCoeff, 84 ppPosCoefbuf, 4, 4); 85 86} 87