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