omxVCM4P2_DecodeVLCZigzag_IntraACVLC.c revision 0c1bc742181ded4930842b46e9507372f0b1b963
1/**
2 *
3 * File Name:  omxVCM4P2_DecodeVLCZigzag_IntraACVLC.c
4 * OpenMAX DL: v1.0.2
5 * Revision:   9641
6 * Date:       Thursday, February 7, 2008
7 *
8 * (c) Copyright 2007-2008 ARM Limited. All Rights Reserved.
9 *
10 *
11 *
12 * Description:
13 * Contains modules for zigzag scanning and VLC decoding
14 * for intra block.
15 *
16 */
17
18#include "omxtypes.h"
19#include "armOMX.h"
20#include "omxVC.h"
21
22#include "armVC.h"
23#include "armCOMM.h"
24
25
26
27/**
28 * Function:  omxVCM4P2_DecodeVLCZigzag_IntraACVLC   (6.2.5.2.2)
29 *
30 * Description:
31 * Performs VLC decoding and inverse zigzag scan of AC and DC coefficients
32 * for one intra block.  Two versions of the function (DCVLC and ACVLC) are
33 * provided in order to support the two different methods of processing DC
34 * coefficients, as described in [ISO14496-2], subclause 7.4.1.4,  Intra DC
35 * Coefficient Decoding for the Case of Switched VLC Encoding.
36 *
37 * Input Arguments:
38 *
39 *   ppBitStream - pointer to the pointer to the current byte in the
40 *            bitstream buffer
41 *   pBitOffset - pointer to the bit position in the current byte referenced
42 *            by *ppBitStream.  The parameter *pBitOffset is valid in the
43 *            range [0-7]. Bit Position in one byte:  |Most Least| *pBitOffset
44 *            |0 1 2 3 4 5 6 7|
45 *   predDir - AC prediction direction; used to select the zigzag scan
46 *            pattern; takes one of the following values: OMX_VC_NONE - AC
47 *            prediction not used; performs classical zigzag scan.
48 *            OMX_VC_HORIZONTAL - Horizontal prediction; performs
49 *            alternate-vertical zigzag scan; OMX_VC_VERTICAL - Vertical
50 *            prediction; performs alternate-horizontal zigzag scan.
51 *   shortVideoHeader - binary flag indicating presence of
52 *            short_video_header; escape modes 0-3 are used if
53 *            shortVideoHeader==0, and escape mode 4 is used when
54 *            shortVideoHeader==1.
55 *   videoComp - video component type (luminance or chrominance) of the
56 *            current block
57 *
58 * Output Arguments:
59 *
60 *   ppBitStream - *ppBitStream is updated after the block is decoded such
61 *            that it points to the current byte in the bit stream buffer
62 *   pBitOffset - *pBitOffset is updated such that it points to the current
63 *            bit position in the byte pointed by *ppBitStream
64 *   pDst - pointer to the coefficient buffer of current block; must be
65 *            4-byte aligned.
66 *
67 * Return Value:
68 *
69 *    OMX_Sts_NoErr - no error
70 *    OMX_Sts_BadArgErr - bad arguments At least one of the following
71 *              pointers is NULL: ppBitStream, *ppBitStream, pBitOffset, pDst,
72 *              or At least one of the following conditions is true:
73 *              *pBitOffset exceeds [0,7], preDir exceeds [0,2], or pDst is
74 *              not 4-byte aligned
75 *    OMX_Sts_Err In DecodeVLCZigzag_IntraDCVLC, dc_size > 12 At least one of
76 *              mark bits equals zero Illegal stream encountered; code cannot
77 *              be located in VLC table Forbidden code encountered in the VLC
78 *              FLC table The number of coefficients is greater than 64
79 *
80 */
81
82
83OMXResult omxVCM4P2_DecodeVLCZigzag_IntraACVLC(
84     const OMX_U8 ** ppBitStream,
85     OMX_INT * pBitOffset,
86     OMX_S16 * pDst,
87     OMX_U8 predDir,
88     OMX_INT shortVideoHeader
89)
90{
91    OMX_U8 start = 0;
92
93    return armVCM4P2_DecodeVLCZigzag_Intra(
94     ppBitStream,
95     pBitOffset,
96     pDst,
97     predDir,
98     shortVideoHeader,
99     start);
100}
101
102/* End of file */
103
104