omxVCM4P10_DecodeCoeffsToPairCAVLC.c revision 0c1bc742181ded4930842b46e9507372f0b1b963
10c1bc742181ded4930842b46e9507372f0b1b963James Dong/* ----------------------------------------------------------------
20c1bc742181ded4930842b46e9507372f0b1b963James Dong *
30c1bc742181ded4930842b46e9507372f0b1b963James Dong *
40c1bc742181ded4930842b46e9507372f0b1b963James Dong * File Name:  omxVCM4P10_DecodeCoeffsToPairCAVLC.c
50c1bc742181ded4930842b46e9507372f0b1b963James Dong * OpenMAX DL: v1.0.2
60c1bc742181ded4930842b46e9507372f0b1b963James Dong * Revision:   9641
70c1bc742181ded4930842b46e9507372f0b1b963James Dong * Date:       Thursday, February 7, 2008
80c1bc742181ded4930842b46e9507372f0b1b963James Dong *
90c1bc742181ded4930842b46e9507372f0b1b963James Dong * (c) Copyright 2007-2008 ARM Limited. All Rights Reserved.
100c1bc742181ded4930842b46e9507372f0b1b963James Dong *
110c1bc742181ded4930842b46e9507372f0b1b963James Dong *
120c1bc742181ded4930842b46e9507372f0b1b963James Dong *
130c1bc742181ded4930842b46e9507372f0b1b963James Dong * H.264 decode coefficients module
140c1bc742181ded4930842b46e9507372f0b1b963James Dong *
150c1bc742181ded4930842b46e9507372f0b1b963James Dong */
160c1bc742181ded4930842b46e9507372f0b1b963James Dong
170c1bc742181ded4930842b46e9507372f0b1b963James Dong#include "omxtypes.h"
180c1bc742181ded4930842b46e9507372f0b1b963James Dong#include "armOMX.h"
190c1bc742181ded4930842b46e9507372f0b1b963James Dong#include "omxVC.h"
200c1bc742181ded4930842b46e9507372f0b1b963James Dong
210c1bc742181ded4930842b46e9507372f0b1b963James Dong#include "armCOMM.h"
220c1bc742181ded4930842b46e9507372f0b1b963James Dong#include "armVC.h"
230c1bc742181ded4930842b46e9507372f0b1b963James Dong
240c1bc742181ded4930842b46e9507372f0b1b963James Dong/**
250c1bc742181ded4930842b46e9507372f0b1b963James Dong * Function: omxVCM4P10_DecodeCoeffsToPairCAVLC
260c1bc742181ded4930842b46e9507372f0b1b963James Dong *
270c1bc742181ded4930842b46e9507372f0b1b963James Dong * Description:
280c1bc742181ded4930842b46e9507372f0b1b963James Dong * Performs CAVLC decoding and inverse zigzag scan for 4x4 block of
290c1bc742181ded4930842b46e9507372f0b1b963James Dong * Intra16x16DCLevel, Intra16x16ACLevel,LumaLevel, and ChromaACLevel.
300c1bc742181ded4930842b46e9507372f0b1b963James Dong * Inverse field scan is not supported. The decoded coefficients in packed
310c1bc742181ded4930842b46e9507372f0b1b963James Dong * position-coefficient buffer are stored in increasing zigzag order instead
320c1bc742181ded4930842b46e9507372f0b1b963James Dong * of position order.
330c1bc742181ded4930842b46e9507372f0b1b963James Dong *
340c1bc742181ded4930842b46e9507372f0b1b963James Dong * Remarks:
350c1bc742181ded4930842b46e9507372f0b1b963James Dong *
360c1bc742181ded4930842b46e9507372f0b1b963James Dong * Parameters:
370c1bc742181ded4930842b46e9507372f0b1b963James Dong * [in]	ppBitStream		Double pointer to current byte in bit stream buffer
380c1bc742181ded4930842b46e9507372f0b1b963James Dong * [in]	pOffset			Pointer to current bit position in the byte pointed
390c1bc742181ded4930842b46e9507372f0b1b963James Dong *								to by *ppBitStream
400c1bc742181ded4930842b46e9507372f0b1b963James Dong * [in]	sMaxNumCoeff	Maximum number of non-zero coefficients in current
410c1bc742181ded4930842b46e9507372f0b1b963James Dong *								block
420c1bc742181ded4930842b46e9507372f0b1b963James Dong * [in]	sVLCSelect		VLC table selector, obtained from number of non-zero
430c1bc742181ded4930842b46e9507372f0b1b963James Dong *								AC coefficients of above and left 4x4 blocks. It is
440c1bc742181ded4930842b46e9507372f0b1b963James Dong *								equivalent to the variable nC described in H.264 standard
450c1bc742181ded4930842b46e9507372f0b1b963James Dong *								table 9-5, except its value can��t be less than zero.
460c1bc742181ded4930842b46e9507372f0b1b963James Dong * [out]	ppBitStream		*ppBitStream is updated after each block is decoded
470c1bc742181ded4930842b46e9507372f0b1b963James Dong * [out]	pOffset			*pOffset is updated after each block is decoded
480c1bc742181ded4930842b46e9507372f0b1b963James Dong * [out]	pNumCoeff		Pointer to the number of nonzero coefficients in
490c1bc742181ded4930842b46e9507372f0b1b963James Dong *								this block
500c1bc742181ded4930842b46e9507372f0b1b963James Dong * [out]	ppPosCoefbuf	Double pointer to destination residual
510c1bc742181ded4930842b46e9507372f0b1b963James Dong *								coefficient-position pair buffer
520c1bc742181ded4930842b46e9507372f0b1b963James Dong * Return Value:
530c1bc742181ded4930842b46e9507372f0b1b963James Dong * Standard omxError result. See enumeration for possible result codes.
540c1bc742181ded4930842b46e9507372f0b1b963James Dong *
550c1bc742181ded4930842b46e9507372f0b1b963James Dong */
560c1bc742181ded4930842b46e9507372f0b1b963James Dong
570c1bc742181ded4930842b46e9507372f0b1b963James DongOMXResult omxVCM4P10_DecodeCoeffsToPairCAVLC(
580c1bc742181ded4930842b46e9507372f0b1b963James Dong     const OMX_U8** ppBitStream,
590c1bc742181ded4930842b46e9507372f0b1b963James Dong     OMX_S32* pOffset,
600c1bc742181ded4930842b46e9507372f0b1b963James Dong     OMX_U8* pNumCoeff,
610c1bc742181ded4930842b46e9507372f0b1b963James Dong     OMX_U8**ppPosCoefbuf,
620c1bc742181ded4930842b46e9507372f0b1b963James Dong     OMX_INT sVLCSelect,
630c1bc742181ded4930842b46e9507372f0b1b963James Dong     OMX_INT sMaxNumCoeff
640c1bc742181ded4930842b46e9507372f0b1b963James Dong )
650c1bc742181ded4930842b46e9507372f0b1b963James Dong{
660c1bc742181ded4930842b46e9507372f0b1b963James Dong    return armVCM4P10_DecodeCoeffsToPair(ppBitStream, pOffset, pNumCoeff,
670c1bc742181ded4930842b46e9507372f0b1b963James Dong                                         ppPosCoefbuf, sVLCSelect, sMaxNumCoeff);
680c1bc742181ded4930842b46e9507372f0b1b963James Dong}
69