1 /* ------------------------------------------------------------------
2  * Copyright (C) 1998-2009 PacketVideo
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
13  * express or implied.
14  * See the License for the specific language governing permissions
15  * and limitations under the License.
16  * -------------------------------------------------------------------
17  */
18 /*
19 -------------------------------------------------------------------
20                     MPEG-4 Simple Profile Video Decoder
21 -------------------------------------------------------------------
22 *
23 * This software module was originally developed by
24 *
25 *   Paulo Nunes (IST / ACTS-MoMuSyS)
26 *
27 * in the course of development of the MPEG-4 Video (ISO/IEC 14496-2) standard.
28 * This software module is an implementation of a part of one or more MPEG-4
29 * Video (ISO/IEC 14496-2) tools as specified by the MPEG-4 Video (ISO/IEC
30 * 14496-2) standard.
31 *
32 * ISO/IEC gives users of the MPEG-4 Video (ISO/IEC 14496-2) standard free
33 * license to this software module or modifications thereof for use in hardware
34 * or software products claiming conformance to the MPEG-4 Video (ISO/IEC
35 * 14496-2) standard.
36 *
37 * Those intending to use this software module in hardware or software products
38 * are advised that its use may infringe existing patents. The original
39 * developer of this software module and his/her company, the subsequent
40 * editors and their companies, and ISO/IEC have no liability for use of this
41 * software module or modifications thereof in an implementation. Copyright is
42 * not released for non MPEG-4 Video (ISO/IEC 14496-2) Standard conforming
43 * products.
44 *
45 * ACTS-MoMuSys partners retain full right to use the code for his/her own
46 * purpose, assign or donate the code to a third party and to inhibit third
47 * parties from using the code for non MPEG-4 Video (ISO/IEC 14496-2) Standard
48 * conforming products. This copyright notice must be included in all copies or
49 * derivative works.
50 *
51 * Copyright (c) 1996
52 *
53 *****************************************************************************/
54 
55 /***********************************************************HeaderBegin*******
56 *
57 * File: vlc_dec.h
58 *
59 * Author:   Paulo Nunes (IST) - Paulo.Nunes@lx.it.pt
60 * Created:
61 *
62 * Description: This is the header file for the "vlcdec" module.
63 *
64 * Notes:
65 *
66 * Modified: 9-May-96 Paulo Nunes: Reformatted. New headers.
67 *
68 * ================= PacketVideo Modification ================================
69 *
70 *       3/30/00  : initial modification to the
71 *                new PV-Decoder Lib format.
72 *
73 ***********************************************************CommentEnd********/
74 
75 
76 #ifndef _VLCDECODE_H_
77 #define _VLCDECODE_H_
78 
79 #include "mp4lib_int.h"
80 
81 #define VLC_ERROR_DETECTED(x) ((x) < 0)
82 #define VLC_IO_ERROR    (-1)
83 #define VLC_CODE_ERROR  (-2)
84 #define VLC_MB_STUFFING (-4)
85 #define VLC_NO_LAST_BIT (-5)
86 
87 #define VLC_ESCAPE_CODE  7167
88 
89 #ifdef __cplusplus
90 extern "C"
91 {
92 #endif /* __cplusplus */
93 
94     PV_STATUS DecodeUserData(BitstreamDecVideo *stream);
95     PV_STATUS PV_GetMBvectors(VideoDecData *, uint mode);
96     PV_STATUS PV_DecodeMBVec(BitstreamDecVideo *stream, MOT *mv_x, MOT *mv_y, int f_code_f);
97     PV_STATUS PV_DeScaleMVD(int f_code, int residual, int vlc_code_mag,  MOT *vector);
98 
99     PV_STATUS PV_VlcDecMV(BitstreamDecVideo *stream, int *mv);
100     int PV_VlcDecMCBPC_com_intra(BitstreamDecVideo *stream);
101     int PV_VlcDecMCBPC_com_inter(BitstreamDecVideo *stream);
102 #ifdef PV_ANNEX_IJKT_SUPPORT
103     int PV_VlcDecMCBPC_com_inter_H263(BitstreamDecVideo *stream);
104     PV_STATUS VlcDecTCOEFShortHeader_AnnexI(BitstreamDecVideo *stream, Tcoef *pTcoef);
105     PV_STATUS VlcDecTCOEFShortHeader_AnnexT(BitstreamDecVideo *stream, Tcoef *pTcoef); /* ANNEX_T */
106     PV_STATUS VlcDecTCOEFShortHeader_AnnexIT(BitstreamDecVideo *stream, Tcoef *pTcoef);
107 #endif
108     int PV_VlcDecCBPY(BitstreamDecVideo *stream, int intra);
109 
110     PV_STATUS VlcDecTCOEFIntra(BitstreamDecVideo *stream, Tcoef *pTcoef);
111     PV_STATUS VlcDecTCOEFInter(BitstreamDecVideo *stream, Tcoef *pTcoef);
112     PV_STATUS VlcDecTCOEFShortHeader(BitstreamDecVideo *stream, Tcoef *pTcoef);
113     PV_STATUS RvlcDecTCOEFIntra(BitstreamDecVideo *stream, Tcoef *pTcoef);
114     PV_STATUS RvlcDecTCOEFInter(BitstreamDecVideo *stream, Tcoef *pTcoef);
115     PV_STATUS PV_VlcDecIntraDCPredSize(BitstreamDecVideo *stream, int compnum, uint *DC_size);
116 
117 #ifdef __cplusplus
118 }
119 #endif /* __cplusplus  */
120 
121 #endif
122 
123