1 /* |
|
2 * Copyright (c) 2010 Ixonos Plc. |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - Initial contribution |
|
11 * |
|
12 * Contributors: |
|
13 * Ixonos Plc |
|
14 * |
|
15 * Description: |
|
16 * Header for macroblock decoding functions. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 #ifndef _DECMB_H_ |
|
23 #define _DECMB_H_ |
|
24 |
|
25 /* |
|
26 * Includes |
|
27 */ |
|
28 |
|
29 #include "epoclib.h" |
|
30 |
|
31 #include "biblin.h" |
|
32 |
|
33 #include "block.h" |
|
34 #include "core.h" |
|
35 #include "vdcmvc.h" |
|
36 |
|
37 |
|
38 /* |
|
39 * Defines |
|
40 */ |
|
41 |
|
42 // unify error codes |
|
43 #define DMB_BIT_ERR H263D_OK_BUT_BIT_ERROR |
|
44 #define DMB_OK H263D_OK |
|
45 #define DMB_ERR H263D_ERROR |
|
46 |
|
47 |
|
48 /* |
|
49 * Structs and typedefs |
|
50 */ |
|
51 |
|
52 /* {{-output"dmbIFrameMBInParam_t_info.txt" -ignore"*" -noCR}} |
|
53 This structure is used to pass input parameters to |
|
54 the dmbGetAndDecodeIFrameMB function. |
|
55 {{-output"dmbIFrameMBInParam_t_info.txt"}} */ |
|
56 |
|
57 /* {{-output"dmbIFrameMBInParam_t.txt"}} */ |
|
58 typedef struct { |
|
59 bibBuffer_t *inBuffer; /* Bit Buffer instance data */ |
|
60 |
|
61 |
|
62 bibBuffer_t *outBuffer; /* Out Bit Buffer instance data */ |
|
63 bibBufferEdit_t *bufEdit; |
|
64 int iColorEffect; |
|
65 TBool iGetDecodedFrame; //Do we need to get decoded data. |
|
66 int StartByteIndex; |
|
67 int StartBitIndex; |
|
68 |
|
69 |
|
70 int xPosInMBs; /* Horizontal position of the macroblock |
|
71 (in macroblocks), |
|
72 0 .. (numMBsInMBLine - 1) */ |
|
73 |
|
74 int yPosInMBs; /* Vertical position of the macroblock, |
|
75 (in macroblocks), 0 .. */ |
|
76 |
|
77 vdcPictureParam_t *pictParam; /* Picture attributes */ |
|
78 |
|
79 int fGOBHeaderPresent; /* 1 if GOB header present */ |
|
80 |
|
81 int numMBsInSegment; /* Number of MBs in either GOB or Slice Segment */ |
|
82 int sliceStartMB; /* MB address of starting MB of the slice */ |
|
83 |
|
84 |
|
85 } dmbIFrameMBInParam_t; |
|
86 /* {{-output"dmbIFrameMBInParam_t.txt"}} */ |
|
87 |
|
88 |
|
89 /* {{-output"dmbIFrameMBInOutParam_t_info.txt" -ignore"*" -noCR}} |
|
90 This structure is used to pass input parameters to |
|
91 the dmbGetAndDecodeIFrameMB function. The function may also modify |
|
92 these parameters (or the structures pointed by the parameters). |
|
93 {{-output"dmbIFrameMBInOutParam_t_info.txt"}} */ |
|
94 |
|
95 /* {{-output"dmbIFrameMBInOutParam_t.txt"}} */ |
|
96 typedef struct { |
|
97 u_char *fCodedMBs; /* Array for coded macroblock flags in |
|
98 scan-order, 1 = coded, 0 = not coded */ |
|
99 |
|
100 int numOfCodedMBs; /* Number of coded macroblocks */ |
|
101 |
|
102 /*** MPEG-4 REVISION ***/ |
|
103 int currMBNum; /* current MB number */ |
|
104 int currMBNumInVP; /* current MB in VP */ |
|
105 |
|
106 aicData_t *aicData; /* MPEG-4 Advanced Intra Coding module |
|
107 instance data */ |
|
108 /*** End MPEG-4 REVISION ***/ |
|
109 |
|
110 int quant; /* Current quantizer */ |
|
111 |
|
112 u_char *yMBInFrame; /* Pointer to the top-left corner of |
|
113 the current macroblock in a frame */ |
|
114 u_char *uBlockInFrame; |
|
115 u_char *vBlockInFrame; |
|
116 |
|
117 int StartByteIndex; |
|
118 int StartBitIndex; |
|
119 |
|
120 } dmbIFrameMBInOutParam_t; |
|
121 /* {{-output"dmbIFrameMBInOutParam_t.txt"}} */ |
|
122 |
|
123 |
|
124 /* {{-output"dmbPFrameMBInParam_t_info.txt" -ignore"*" -noCR}} |
|
125 This structure is used to pass input parameters to |
|
126 the dmbGetAndDecodePFrameMB function. |
|
127 {{-output"dmbPFrameMBInParam_t_info.txt"}} */ |
|
128 |
|
129 /* {{-output"dmbPFrameMBInParam_t.txt"}} */ |
|
130 typedef struct { |
|
131 bibBuffer_t *inBuffer; /* Bit Buffer instance data */ |
|
132 |
|
133 bibBuffer_t *outBuffer; /* Out Bit Buffer instance data */ |
|
134 bibBufferEdit_t *bufEdit; |
|
135 int iColorEffect; |
|
136 TBool iGetDecodedFrame; |
|
137 int StartByteIndex; |
|
138 int StartBitIndex; |
|
139 |
|
140 |
|
141 int xPosInMBs; /* Horizontal position of the macroblock |
|
142 (in macroblocks), |
|
143 0 .. (numMBsInMBLine - 1) */ |
|
144 |
|
145 int yPosInMBs; /* Vertical position of the macroblock, |
|
146 (in macroblocks), 0 .. */ |
|
147 |
|
148 vdcPictureParam_t *pictParam; /* Picture attributes */ |
|
149 |
|
150 int fGOBHeaderPresent; /* Non-zero indicates that the GOB header |
|
151 is present in the GOB to which the current |
|
152 macroblock belongs */ |
|
153 |
|
154 u_char *refY; /* Reference frame */ |
|
155 u_char *refU; |
|
156 u_char *refV; |
|
157 |
|
158 u_char *currPY; /* Current P (or I) frame */ |
|
159 u_char *currPU; |
|
160 u_char *currPV; |
|
161 |
|
162 |
|
163 int numMBsInSegment; /* Number of MBs in either GOB or Slice Segment */ |
|
164 int sliceStartMB; /* MB address of starting MB of the slice */ |
|
165 |
|
166 int mbOnRightOfBorder; |
|
167 int mbOnOfBottomBorder; |
|
168 int mbOnLeftOfBorder; |
|
169 |
|
170 } dmbPFrameMBInParam_t; |
|
171 /* {{-output"dmbPFrameMBInParam_t.txt"}} */ |
|
172 |
|
173 |
|
174 /* {{-output"dmbPFrameMBInOutParam_t_info.txt" -ignore"*" -noCR}} |
|
175 This structure is used to pass input parameters to |
|
176 the dmbGetAndDecodePFrameMB function. The function may also modify |
|
177 these parameters (or the structures pointed by the parameters). |
|
178 {{-output"dmbPFrameMBInOutParam_t_info.txt"}} */ |
|
179 |
|
180 /* {{-output"dmbPFrameMBInOutParam_t.txt"}} */ |
|
181 typedef struct { |
|
182 |
|
183 |
|
184 bibBuffer_t *outBuffer; /* Out Bit Buffer instance data */ |
|
185 int StartByteIndex; |
|
186 int StartBitIndex; |
|
187 |
|
188 |
|
189 u_char *fCodedMBs; /* Array for coded macroblock flags in |
|
190 scan-order, 1 = coded, 0 = not coded */ |
|
191 |
|
192 int numOfCodedMBs; /* Number of coded macroblocks */ |
|
193 |
|
194 /*** MPEG-4 REVISION ***/ |
|
195 int currMBNum; /* current MB number */ |
|
196 int currMBNumInVP; /* current MB in VP */ |
|
197 |
|
198 aicData_t *aicData; /* Advanced Intra Coding module instance data */ |
|
199 /*** End MPEG-4 REVISION ***/ |
|
200 |
|
201 int quant; /* Current quantizer */ |
|
202 |
|
203 u_char *yMBInFrame; /* Pointer to the top-left corner of |
|
204 the current macroblock in a frame */ |
|
205 u_char *uBlockInFrame; |
|
206 u_char *vBlockInFrame; |
|
207 |
|
208 mvcData_t *mvcData; /* Motion Vector Count module instance data */ |
|
209 |
|
210 blcDiffMB_t *diffMB; /* Storage for the previous prediction error |
|
211 blocks */ |
|
212 |
|
213 } dmbPFrameMBInOutParam_t; |
|
214 /* {{-output"dmbPFrameMBInOutParam_t.txt"}} */ |
|
215 |
|
216 |
|
217 /* |
|
218 * Function prototypes |
|
219 */ |
|
220 |
|
221 int dmbGetAndDecodeIFrameMB( |
|
222 const dmbIFrameMBInParam_t *inParam, |
|
223 dmbIFrameMBInOutParam_t *inOutParam, |
|
224 u_char fMPEG4, CMPEG4Transcoder *hTranscoder); |
|
225 |
|
226 int dmbGetAndDecodePFrameMB( |
|
227 const dmbPFrameMBInParam_t *inParam, |
|
228 dmbPFrameMBInOutParam_t *inOutParam, |
|
229 u_char fMPEG4, CMPEG4Transcoder *hTranscoder); |
|
230 |
|
231 #endif |
|
232 // End of File |
|