|
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 content blocks decoding functions. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 #ifndef _DECMBDCT_H_ |
|
24 #define _DECMBDCT_H_ |
|
25 |
|
26 /* |
|
27 * Includes |
|
28 */ |
|
29 |
|
30 #include "block.h" |
|
31 #include "vdcaic.h" |
|
32 |
|
33 #include "biblin.h" |
|
34 |
|
35 class CMPEG4Transcoder; |
|
36 |
|
37 /* |
|
38 * Defines |
|
39 */ |
|
40 |
|
41 // unify error codes |
|
42 #define DMD_BIT_ERR H263D_OK_BUT_BIT_ERROR |
|
43 #define DMD_OK H263D_OK |
|
44 #define DMD_ERR H263D_ERROR |
|
45 |
|
46 |
|
47 /* |
|
48 * Structs and typedefs |
|
49 */ |
|
50 |
|
51 /* {{-output"dmdBOfPBParam_t_info.txt" -ignore"*" -noCR}} |
|
52 This structure is used to pass parameters to |
|
53 the dmdGetAndDecodeBOfPBMBBlocks function. |
|
54 {{-output"dmdBOfPBParam_t_info.txt"}} */ |
|
55 |
|
56 /* {{-output"dmdBOfPBParam_t.txt"}} */ |
|
57 typedef struct { |
|
58 bibBuffer_t *inBuffer; /* Bit Buffer instance data */ |
|
59 |
|
60 |
|
61 bibBuffer_t *outBuffer; /* Out Bit Buffer instance data */ |
|
62 int StartByteIndex; |
|
63 int StartBitIndex; |
|
64 |
|
65 int cbpb; /* Coded block pattern for B-blocks */ |
|
66 |
|
67 int quant; /* Current quantizer */ |
|
68 |
|
69 BLC_COPY_PREDICTION_MB_PARAM /* See block.h */ |
|
70 |
|
71 int fMQ; /* Modified Quantization Mode flag */ |
|
72 |
|
73 } dmdBOfPBParam_t; |
|
74 /* {{-output"dmdBOfPBParam_t.txt"}} */ |
|
75 |
|
76 |
|
77 /* {{-output"dmdIParam_t_info.txt" -ignore"*" -noCR}} |
|
78 This structure is used to pass parameters to |
|
79 the dmdGetAndDecodeIMBBlocks function. |
|
80 {{-output"dmdIParam_t_info.txt"}} */ |
|
81 |
|
82 /* {{-output"dmdIParam_t.txt"}} */ |
|
83 typedef struct { |
|
84 bibBuffer_t *inBuffer; /* Bit Buffer instance data */ |
|
85 |
|
86 |
|
87 bibBuffer_t *outBuffer; /* Out Bit Buffer instance data */ |
|
88 bibBufferEdit_t *bufEdit; |
|
89 int iColorEffect; |
|
90 TBool iGetDecodedFrame; |
|
91 int StartByteIndex; |
|
92 int StartBitIndex; |
|
93 |
|
94 |
|
95 int cbpy; /* Coded block pattern for luminance */ |
|
96 |
|
97 int cbpc; /* Coded block pattern for chrominance */ |
|
98 |
|
99 int quant; /* Current quantizer */ |
|
100 |
|
101 int yWidth; /* Picture width in luminance pixels */ |
|
102 |
|
103 u_char *yMBInFrame; /* Current macroblock in frame */ |
|
104 u_char *uBlockInFrame; |
|
105 u_char *vBlockInFrame; |
|
106 |
|
107 int xPosInMBs; /* Horizontal position of the macroblock |
|
108 (in macroblocks), |
|
109 0 .. (numMBsInMBLine - 1) */ |
|
110 |
|
111 int yPosInMBs; /* Vertical position of the macroblock, |
|
112 (in macroblocks), 0 .. */ |
|
113 |
|
114 int numMBLinesInGOB; /* Number of macroblock lines in GOB */ |
|
115 |
|
116 int pictureType; /* Picture type is one of the following: |
|
117 VDX_PIC_TYPE_I INTRA |
|
118 VDX_PIC_TYPE_P INTER |
|
119 VDX_PIC_TYPE_PB PB (Annex G) |
|
120 VDX_PIC_TYPE_IPB Improved PB |
|
121 VDX_PIC_TYPE_B B (Annex O) |
|
122 VDX_PIC_TYPE_EI EI (Annex O) |
|
123 VDX_PIC_TYPE_EP EP (Annex O) */ |
|
124 |
|
125 int numMBsInMBLine; /* Number of MBs in one MB Line */ |
|
126 |
|
127 int fGOBHeaderPresent; /* 1 if GOB header is present.*/ |
|
128 |
|
129 int predMode; /* prediction mode given by INTRA_MODE field */ |
|
130 |
|
131 int fMQ; /* Modified Quantization Mode flag */ |
|
132 |
|
133 int sumBEI; /* Sum (bit-wise OR) of bit error indications for the whole MB */ |
|
134 |
|
135 int rightOfBorder; /* There is a border on the left of the current MB */ |
|
136 |
|
137 int downOfBorder; /* There is a border on top of the current MB */ |
|
138 |
|
139 } dmdIParam_t; |
|
140 /* {{-output"dmdIParam_t.txt"}} */ |
|
141 |
|
142 /* {{-output"dmdMPEGIParam_t_info.txt" -ignore"*" -noCR}} |
|
143 This structure is used to pass parameters to |
|
144 the dmdGetAndDecodeMPEGIMBBlocks function. |
|
145 {{-output"dmdMPEGIParam_t_info.txt"}} */ |
|
146 |
|
147 /* {{-output"dmdMPEGIParam_t.txt"}} */ |
|
148 typedef struct { |
|
149 bibBuffer_t *inBuffer; /* Bit Buffer instance data */ |
|
150 |
|
151 |
|
152 bibBuffer_t *outBuffer; /* Out Bit Buffer instance data */ |
|
153 bibBufferEdit_t *bufEdit; |
|
154 int iColorEffect; |
|
155 TBool iGetDecodedFrame; |
|
156 int StartByteIndex; |
|
157 int StartBitIndex; |
|
158 |
|
159 int cbpy; /* Coded block pattern for luminance */ |
|
160 |
|
161 int cbpc; /* Coded block pattern for chrominance */ |
|
162 |
|
163 int quant; /* Current quantizer */ |
|
164 |
|
165 int yWidth; /* Picture width in luminance pixels */ |
|
166 |
|
167 int switched; /* if TRUE instead of optimized IntraDC |
|
168 decoding IntraAC VLC table is used for |
|
169 DC coefficient coding */ |
|
170 |
|
171 int currMBNum; /* current MB Number */ |
|
172 |
|
173 u_char fTopOfVP; /* The current Macroblock is in the top row |
|
174 of the current Video Packet */ |
|
175 u_char fLeftOfVP; /* The current Macroblock is the first |
|
176 (on the left) of the current Video Packet */ |
|
177 u_char fBBlockOut; /* The "B" AC/DC prediction block for the |
|
178 current Macroblock is outside of the |
|
179 current Video Packet */ |
|
180 |
|
181 aicData_t *aicData; /* storage for the intra prediction (AIC) data */ |
|
182 |
|
183 u_char data_partitioned; |
|
184 int *DC; /* if data_partitioned, this is the array of |
|
185 the DC coefficients decoded in the previous |
|
186 partition of the VP */ |
|
187 |
|
188 u_char reversible_vlc; /* TRUE if reversible VLC is used */ |
|
189 u_char vlc_dec_direction; /* 0: forward, 1: backward decoding of RVLC */ |
|
190 |
|
191 u_char *yMBInFrame; /* Current macroblock in frame */ |
|
192 u_char *uBlockInFrame; |
|
193 u_char *vBlockInFrame; |
|
194 |
|
195 int xPosInMBs; /* Horizontal position of the macroblock |
|
196 (in macroblocks), |
|
197 0 .. (numMBsInMBLine - 1) */ |
|
198 |
|
199 int yPosInMBs; /* Vertical position of the macroblock, |
|
200 (in macroblocks), 0 .. */ |
|
201 |
|
202 int numMBsInMBLine; /* Number of macroblocks in one line */ |
|
203 |
|
204 int numMBLinesInGOB; /* Number of macroblock lines in GOB */ |
|
205 |
|
206 int pictureType; /* Picture type is one of the following: |
|
207 VDX_PIC_TYPE_I INTRA |
|
208 VDX_PIC_TYPE_P INTER |
|
209 VDX_PIC_TYPE_PB PB (Annex G) |
|
210 VDX_PIC_TYPE_IPB Improved PB |
|
211 VDX_PIC_TYPE_B B (Annex O) |
|
212 VDX_PIC_TYPE_EI EI (Annex O) |
|
213 VDX_PIC_TYPE_EP EP (Annex O) */ |
|
214 |
|
215 int fMQ; |
|
216 int fAIC; |
|
217 |
|
218 } dmdMPEGIParam_t; |
|
219 /* {{-output"dmdMPEGIParam_t.txt"}} */ |
|
220 |
|
221 /* {{-output"dmdPParam_t_info.txt" -ignore"*" -noCR}} |
|
222 This structure is used to pass parameters to |
|
223 the dmdGetAndDecodeIMBBlocks function. |
|
224 {{-output"dmdPParam_t_info.txt"}} */ |
|
225 |
|
226 /* {{-output"dmdPParam_t.txt"}} */ |
|
227 typedef struct { |
|
228 bibBuffer_t *inBuffer; /* Bit Buffer instance data */ |
|
229 |
|
230 |
|
231 bibBuffer_t *outBuffer; /* Out Bit Buffer instance data */ |
|
232 bibBufferEdit_t *bufEdit; |
|
233 int iColorEffect; |
|
234 TBool iGetDecodedFrame; |
|
235 int StartByteIndex; |
|
236 int StartBitIndex; |
|
237 |
|
238 int cbpy; /* Coded block pattern for luminance */ |
|
239 |
|
240 int cbpc; /* Coded block pattern for chrominance */ |
|
241 |
|
242 int quant; /* Current quantizer */ |
|
243 |
|
244 BLC_COPY_PREDICTION_MB_PARAM /* See block.h */ |
|
245 |
|
246 /*** MPEG-4 REVISION ***/ |
|
247 u_char reversible_vlc; /* TRUE if reversible VLC is used */ |
|
248 u_char vlc_dec_direction; /* 0: forward, 1: backward decoding of RVLC */ |
|
249 /*** End MPEG-4 REVISION ***/ |
|
250 |
|
251 int xPosInMBs; /* Horizontal position of the macroblock |
|
252 (in macroblocks), |
|
253 0 .. (numMBsInMBLine - 1) */ |
|
254 |
|
255 int yPosInMBs; /* Vertical position of the macroblock, |
|
256 (in macroblocks), 0 .. */ |
|
257 |
|
258 int numMBsInMBLine; /* Number of MBs in one MB Line */ |
|
259 |
|
260 int fGOBHeaderPresent; /* 1 if GOB header is present.*/ |
|
261 |
|
262 int mbType; |
|
263 |
|
264 |
|
265 } dmdPParam_t; |
|
266 /* {{-output"dmdPParam_t.txt"}} */ |
|
267 |
|
268 |
|
269 /* |
|
270 * Function prototypes |
|
271 */ |
|
272 |
|
273 int dmdGetAndDecodeBOfPBMBBlocks( |
|
274 dmdBOfPBParam_t *param); |
|
275 |
|
276 int dmdGetAndDecodeIMBBlocks( |
|
277 dmdIParam_t *param, CMPEG4Transcoder *hTranscoder); |
|
278 |
|
279 int dmdGetAndDecodePMBBlocks( |
|
280 dmdPParam_t *param, CMPEG4Transcoder *hTranscoder); |
|
281 |
|
282 int dmdGetAndDecodeAdvIMBBlocks( |
|
283 dmdIParam_t *inpParam); |
|
284 |
|
285 /*** MPEG-4 REVISION ***/ |
|
286 int dmdGetAndDecodeMPEGPMBBlocks( |
|
287 dmdPParam_t *param, CMPEG4Transcoder *hTranscoder); |
|
288 |
|
289 int dmdGetAndDecodeMPEGIMBBlocks( |
|
290 dmdMPEGIParam_t *param, CMPEG4Transcoder *hTranscoder); |
|
291 /*** End MPEG-4 REVISION ***/ |
|
292 |
|
293 #endif |
|
294 // End of File |