diff options
Diffstat (limited to 'packages/xdais/ti/xdais/dm/ividdec2.h')
-rw-r--r-- | packages/xdais/ti/xdais/dm/ividdec2.h | 632 |
1 files changed, 632 insertions, 0 deletions
diff --git a/packages/xdais/ti/xdais/dm/ividdec2.h b/packages/xdais/ti/xdais/dm/ividdec2.h new file mode 100644 index 0000000..60137e6 --- /dev/null +++ b/packages/xdais/ti/xdais/dm/ividdec2.h | |||
@@ -0,0 +1,632 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2006-2012, Texas Instruments Incorporated | ||
3 | * All rights reserved. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions | ||
7 | * are met: | ||
8 | * | ||
9 | * * Redistributions of source code must retain the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer. | ||
11 | * | ||
12 | * * Redistributions in binary form must reproduce the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer in the | ||
14 | * documentation and/or other materials provided with the distribution. | ||
15 | * | ||
16 | * * Neither the name of Texas Instruments Incorporated nor the names of | ||
17 | * its contributors may be used to endorse or promote products derived | ||
18 | * from this software without specific prior written permission. | ||
19 | * | ||
20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | ||
22 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
23 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR | ||
24 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
25 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
26 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | ||
27 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | ||
28 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | ||
29 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, | ||
30 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
31 | * | ||
32 | */ | ||
33 | |||
34 | /** | ||
35 | * @file ti/xdais/dm/ividdec2.h | ||
36 | * | ||
37 | * @brief This header defines all types, constants, and functions | ||
38 | * shared by all implementations of the video decoder | ||
39 | * algorithms. | ||
40 | */ | ||
41 | /** | ||
42 | * @defgroup ti_xdais_dm_IVIDDEC2 IVIDDEC2 - XDM Video Decoder Interface | ||
43 | * | ||
44 | * This is the XDM IVIDDEC2 video decoder interface. | ||
45 | */ | ||
46 | |||
47 | #ifndef ti_xdais_dm_IVIDDEC2_ | ||
48 | #define ti_xdais_dm_IVIDDEC2_ | ||
49 | |||
50 | #include <ti/xdais/ialg.h> | ||
51 | #include <ti/xdais/xdas.h> | ||
52 | #include "xdm.h" | ||
53 | #include "ivideo.h" | ||
54 | |||
55 | #ifdef __cplusplus | ||
56 | extern "C" { | ||
57 | #endif | ||
58 | |||
59 | /** @ingroup ti_xdais_dm_IVIDDEC2 */ | ||
60 | /*@{*/ | ||
61 | |||
62 | /** | ||
63 | * @brief Maximum I/O Buffers. | ||
64 | * | ||
65 | * @remarks This IVIDDEC2-specific definition has been replaced with | ||
66 | * IVIDEO2_MAX_IO_BUFFERS. It has been kept for backward | ||
67 | * compatibility, but users are encouraged to use | ||
68 | * IVIDEO2_MAX_IO_BUFFERS instead. | ||
69 | * | ||
70 | * @sa IVIDEO2_MAX_IO_BUFFERS | ||
71 | */ | ||
72 | #define IVIDDEC2_MAX_IO_BUFFERS IVIDEO2_MAX_IO_BUFFERS | ||
73 | |||
74 | #define IVIDDEC2_EOK XDM_EOK /**< @copydoc XDM_EOK */ | ||
75 | #define IVIDDEC2_EFAIL XDM_EFAIL /**< @copydoc XDM_EFAIL */ | ||
76 | #define IVIDDEC2_EUNSUPPORTED XDM_EUNSUPPORTED /**< @copydoc XDM_EUNSUPPORTED */ | ||
77 | |||
78 | /** | ||
79 | * @brief This must be the first field of all IVIDDEC2 | ||
80 | * instance objects. | ||
81 | */ | ||
82 | typedef struct IVIDDEC2_Obj { | ||
83 | struct IVIDDEC2_Fxns *fxns; | ||
84 | } IVIDDEC2_Obj; | ||
85 | |||
86 | |||
87 | /** | ||
88 | * @brief Opaque handle to an IVIDDEC2 object | ||
89 | */ | ||
90 | typedef struct IVIDDEC2_Obj *IVIDDEC2_Handle; | ||
91 | |||
92 | |||
93 | /** | ||
94 | * @brief Video decoder output frame order | ||
95 | * | ||
96 | * @enumWarning | ||
97 | * | ||
98 | * @sa IVIDDEC2_DynamicParams::frameOrder | ||
99 | */ | ||
100 | typedef enum { | ||
101 | IVIDDEC2_DISPLAY_ORDER = 0, /**< The decoder provides decoded output in | ||
102 | * in the actual order of displaying the | ||
103 | * output buffer. The codec assumes the | ||
104 | * responsibility of reordering the frames. | ||
105 | * | ||
106 | * @remarks The output buffer will be | ||
107 | * delayed by one frame, | ||
108 | * regardless of whether the frame | ||
109 | * contains I/P or I/P/B frames. | ||
110 | * | ||
111 | * @remarks This is the default mode. | ||
112 | * | ||
113 | * @remarks This mode is required to be | ||
114 | * supported by all video decoder | ||
115 | * codecs. | ||
116 | */ | ||
117 | IVIDDEC2_DECODE_ORDER = 1, /**< The decoder provides decoded output in the | ||
118 | * the order of decoding. There will be no | ||
119 | * delay in the output buffers. | ||
120 | * | ||
121 | * @remarks It is the application's | ||
122 | * responsibility to handle the | ||
123 | * frame re-ordering. | ||
124 | * | ||
125 | * @remarks This mode is optional. If it | ||
126 | * is not supported by the | ||
127 | * decoder, IVIDDEC_EUNSUPPORTED | ||
128 | * will be returned. | ||
129 | */ | ||
130 | |||
131 | /** Default setting. */ | ||
132 | IVIDDEC2_FRAMEORDER_DEFAULT = IVIDDEC2_DISPLAY_ORDER | ||
133 | } IVIDDEC2_FrameOrder; | ||
134 | |||
135 | |||
136 | /** | ||
137 | * @brief Defines the creation time parameters for | ||
138 | * all IVIDDEC2 instance objects. | ||
139 | * | ||
140 | * @extensibleStruct | ||
141 | */ | ||
142 | typedef struct IVIDDEC2_Params { | ||
143 | XDAS_Int32 size; /**< @sizeField */ | ||
144 | XDAS_Int32 maxHeight; /**< Maximum video height in pixels. */ | ||
145 | XDAS_Int32 maxWidth; /**< Maximum video width in pixels. */ | ||
146 | XDAS_Int32 maxFrameRate; /**< Maximum frame rate in fps * 1000. | ||
147 | * For example, if max frame rate is 30 | ||
148 | * frames per second, set this field | ||
149 | * to 30000. | ||
150 | */ | ||
151 | XDAS_Int32 maxBitRate; /**< Maximum bit rate, bits per second. | ||
152 | * For example, if bit rate is 10 Mbps, set | ||
153 | * this field to 10000000 | ||
154 | */ | ||
155 | XDAS_Int32 dataEndianness; /**< Endianness of output data. | ||
156 | * | ||
157 | * @sa XDM_DataFormat | ||
158 | */ | ||
159 | XDAS_Int32 forceChromaFormat;/**< @copydoc XDM_ChromaFormat | ||
160 | * | ||
161 | * @sa XDM_ChromaFormat | ||
162 | */ | ||
163 | } IVIDDEC2_Params; | ||
164 | |||
165 | |||
166 | /** | ||
167 | * @brief This structure defines the codec parameters that can be | ||
168 | * modified after creation via control() calls. | ||
169 | * | ||
170 | * @remarks It is not necessary that a given implementation support all | ||
171 | * dynamic parameters to be configurable at run time. If a | ||
172 | * particular algorithm does not support run-time updates to | ||
173 | * a parameter that the application is attempting to change | ||
174 | * at runtime, it may indicate this as an error. | ||
175 | * | ||
176 | * @extensibleStruct | ||
177 | * | ||
178 | * @sa IVIDDEC2_Fxns::control() | ||
179 | */ | ||
180 | typedef struct IVIDDEC2_DynamicParams { | ||
181 | XDAS_Int32 size; /**< @sizeField */ | ||
182 | XDAS_Int32 decodeHeader; /**< @copydoc XDM_DecMode | ||
183 | * | ||
184 | * @sa XDM_DecMode | ||
185 | */ | ||
186 | XDAS_Int32 displayWidth; /**< Pitch. If set to zero, use the decoded | ||
187 | * image width. Else, use given display | ||
188 | * width in pixels. | ||
189 | */ | ||
190 | XDAS_Int32 frameSkipMode; /**< @copydoc IVIDEO_FrameSkip | ||
191 | * | ||
192 | * @sa IVIDEO_FrameSkip | ||
193 | */ | ||
194 | XDAS_Int32 frameOrder; /**< @copydoc IVIDDEC2_FrameOrder | ||
195 | * | ||
196 | * @sa IVIDDEC2_FrameOrder | ||
197 | */ | ||
198 | XDAS_Int32 newFrameFlag; /**< Flag to indicate that the algorithm should | ||
199 | * start a new frame. | ||
200 | * | ||
201 | * @remarks Valid values are XDAS_TRUE | ||
202 | * and XDAS_FALSE. | ||
203 | * | ||
204 | * @remarks This is useful for error | ||
205 | * recovery, for example when the | ||
206 | * end of frame cannot be detected | ||
207 | * by the codec but is known to the | ||
208 | * application. | ||
209 | */ | ||
210 | XDAS_Int32 mbDataFlag; /**< Flag to indicate that the algorithm should | ||
211 | * generate MB Data in addition to decoding | ||
212 | * the data. | ||
213 | * | ||
214 | * @remarks Valid values are XDAS_TRUE | ||
215 | * and XDAS_FALSE. | ||
216 | * | ||
217 | * @sa IVIDDEC2_OutArgs::mbDataBuf | ||
218 | */ | ||
219 | } IVIDDEC2_DynamicParams; | ||
220 | |||
221 | |||
222 | /** | ||
223 | * @brief Defines the input arguments for all IVIDDEC2 instance | ||
224 | * process function. | ||
225 | * | ||
226 | * @extensibleStruct | ||
227 | * | ||
228 | * @sa IVIDDEC2_Fxns::process() | ||
229 | */ | ||
230 | typedef struct IVIDDEC2_InArgs { | ||
231 | XDAS_Int32 size; /**< @sizeField */ | ||
232 | XDAS_Int32 numBytes; /**< Size of input data in bytes, provided | ||
233 | * to the algorithm for decoding. | ||
234 | */ | ||
235 | XDAS_Int32 inputID; /**< The decoder will attach | ||
236 | * this ID with the corresponding output | ||
237 | * frames. | ||
238 | * | ||
239 | * @remarks This is useful when frames | ||
240 | * require re-ordering (e.g. B frames). | ||
241 | * | ||
242 | * @remarks When there is no re-ordering, | ||
243 | * IVIDDEC2_OutArgs#outputID will be same | ||
244 | * as this inputID field. | ||
245 | * | ||
246 | * @remarks Zero (0) is not a supported | ||
247 | * inputID. This value is | ||
248 | * reserved for cases when there | ||
249 | * is no output buffer provided in | ||
250 | * IVIDDEC2_OutArgs::displayBufs. | ||
251 | * | ||
252 | * @sa IVIDDEC2_OutArgs::outputID. | ||
253 | */ | ||
254 | } IVIDDEC2_InArgs; | ||
255 | |||
256 | |||
257 | /** | ||
258 | * @brief Defines instance status parameters. | ||
259 | * | ||
260 | * @extensibleStruct | ||
261 | * | ||
262 | * @remarks All fields correspond to latest IVIDDEC2_Fxns::process() call | ||
263 | * on the particular instance of the decoder. | ||
264 | * | ||
265 | * @sa IVIDDEC2_Fxns::control() | ||
266 | */ | ||
267 | typedef struct IVIDDEC2_Status { | ||
268 | XDAS_Int32 size; /**< @sizeField */ | ||
269 | XDAS_Int32 extendedError; /**< @extendedErrorField */ | ||
270 | XDM1_SingleBufDesc data; /**< Buffer descriptor for data passing. | ||
271 | * | ||
272 | * @remarks If this field is not used, | ||
273 | * the application <b>must</b> | ||
274 | * set @c data.buf to NULL. | ||
275 | * | ||
276 | * @remarks This buffer can be used as | ||
277 | * either input or output, | ||
278 | * depending on the command. | ||
279 | * | ||
280 | * @remarks The buffer will be provided | ||
281 | * by the application, and | ||
282 | * returned to the application | ||
283 | * upon return of the | ||
284 | * IVIDDEC2_Fxns.control() | ||
285 | * call. The algorithm must | ||
286 | * not retain a pointer to this | ||
287 | * data. | ||
288 | * | ||
289 | * @sa #XDM_GETVERSION | ||
290 | */ | ||
291 | XDAS_Int32 maxNumDisplayBufs; /**< The maximum number of buffers that will | ||
292 | * be required by the codec. | ||
293 | * | ||
294 | * @remarks The maximum number of buffers | ||
295 | * can be IVIDEO2_MAX_IO_BUFFERS. | ||
296 | */ | ||
297 | XDAS_Int32 outputHeight; /**< Output height in pixels. */ | ||
298 | XDAS_Int32 outputWidth; /**< Output width in pixels. */ | ||
299 | XDAS_Int32 frameRate; /**< Average frame rate in fps * 1000. | ||
300 | * For example, if average frame rate is 30 | ||
301 | * frames per second, this field should be | ||
302 | * 30000. | ||
303 | */ | ||
304 | XDAS_Int32 bitRate; /**< Average bit rate, in bits per second. */ | ||
305 | XDAS_Int32 contentType; /**< @copydoc IVIDEO_ContentType | ||
306 | * | ||
307 | * @sa IVIDEO_ContentType | ||
308 | */ | ||
309 | XDAS_Int32 outputChromaFormat; /**< @copydoc XDM_ChromaFormat | ||
310 | * | ||
311 | * @sa XDM_ChromaFormat | ||
312 | */ | ||
313 | XDM_AlgBufInfo bufInfo; /**< Input and output buffer information. | ||
314 | * | ||
315 | * @sa XDM_AlgBufInfo | ||
316 | */ | ||
317 | } IVIDDEC2_Status; | ||
318 | |||
319 | |||
320 | /** | ||
321 | * @brief Defines the run time output arguments for | ||
322 | * all IVIDDEC2 instance objects. | ||
323 | * | ||
324 | * @extensibleStruct | ||
325 | * | ||
326 | * @sa IVIDDEC2_Fxns::process() | ||
327 | */ | ||
328 | typedef struct IVIDDEC2_OutArgs { | ||
329 | XDAS_Int32 size; /**< @sizeField */ | ||
330 | XDAS_Int32 bytesConsumed; /**< Number of bytes consumed during the | ||
331 | * process() call. | ||
332 | */ | ||
333 | |||
334 | XDAS_Int32 outputID[IVIDEO2_MAX_IO_BUFFERS]; /**< Output ID corresponding | ||
335 | * to displayBufs[]. | ||
336 | * | ||
337 | * @remarks A value of zero (0) indicates | ||
338 | * an invalid ID. The first zero | ||
339 | * entry in array will indicate | ||
340 | * end of valid outputIDs within | ||
341 | * the array. Hence the | ||
342 | * application can stop reading the | ||
343 | * array when it encounters the | ||
344 | * first zero entry. | ||
345 | * | ||
346 | * @sa IVIDDEC2_OutArgs#displayBufs | ||
347 | * @sa IVIDDEC2_InArgs#inputID | ||
348 | */ | ||
349 | IVIDEO1_BufDesc decodedBufs; /**< The decoder fills this structure with | ||
350 | * buffer pointers to the decoded frame. | ||
351 | * Related information fields for the | ||
352 | * decoded frame are also populated. | ||
353 | * | ||
354 | * When frame decoding is not complete, as | ||
355 | * indicated by @c outBufsInUseFlag, | ||
356 | * the frame data in this structure will be | ||
357 | * incomplete. However, the algorithm will | ||
358 | * provide incomplete decoded frame data | ||
359 | * in case application may choose to use | ||
360 | * it for error recovery purposes. | ||
361 | * | ||
362 | * @sa IVIDDEC2_OutArgs#outBufsInUseFlag | ||
363 | */ | ||
364 | IVIDEO1_BufDesc displayBufs[IVIDEO2_MAX_IO_BUFFERS]; /**< Array | ||
365 | * containing display frames | ||
366 | * corresponding to valid ID entries | ||
367 | * in the @c outputID[] array. | ||
368 | * | ||
369 | * @remarks The | ||
370 | * @c displayBufs[].bufDesc[].bufSize | ||
371 | * fields returned correspond to | ||
372 | * the actual size of the | ||
373 | * memory buffers. Other fields | ||
374 | * (e.g. pitch, width, height, | ||
375 | * chroma) can be used to determine | ||
376 | * the contents in those buffers. | ||
377 | * | ||
378 | * @remarks Entries in the array | ||
379 | * corresponding to invalid | ||
380 | * ID values (zero) in | ||
381 | * @c outputID[] will set | ||
382 | * zero value for the following | ||
383 | * fields in the IVIDEO1_BufDesc | ||
384 | * structure: @c numBufs, | ||
385 | * @c frameWidth, @c frameHeight, | ||
386 | * and @c framePitch. | ||
387 | * | ||
388 | * @remarks Implied by the previous remark, | ||
389 | * as this array corresponds to | ||
390 | * buffer IDs indicated by | ||
391 | * @c outputID[], elements of | ||
392 | * this array are undefined if | ||
393 | * the corresponding @c outputID[] | ||
394 | * element is zero (0). | ||
395 | */ | ||
396 | XDAS_Int32 outputMbDataID; /**< Output ID corresponding with the MB Data | ||
397 | * | ||
398 | * @remarks This will be set to zero when | ||
399 | * there is no MB Data Buffer | ||
400 | */ | ||
401 | XDM1_SingleBufDesc mbDataBuf; /**< The decoder populates the last buffer | ||
402 | * among the buffers supplied within | ||
403 | * outBufs->bufs[] with the decoded MB data | ||
404 | * generated by the ECD module. The pointer | ||
405 | * buffer along with the buffer size is | ||
406 | * output via this buffer descriptor. | ||
407 | */ | ||
408 | XDAS_Int32 freeBufID[IVIDEO2_MAX_IO_BUFFERS]; /**< This is an | ||
409 | * array of inputID's corresponding to the | ||
410 | * buffers that have been unlocked in the | ||
411 | * current process call. | ||
412 | * | ||
413 | * @remarks Buffers returned to the | ||
414 | * application for display (via | ||
415 | * IVIDDEC2_OutArgs#displayBufs) | ||
416 | * continue to be owned by the | ||
417 | * algorithm until they are | ||
418 | * released - indicated by | ||
419 | * the ID being returned in this | ||
420 | * @c freeBuf array. | ||
421 | * | ||
422 | * @remarks The buffers released by the | ||
423 | * algorithm are indicated by | ||
424 | * their non-zero ID (previously | ||
425 | * provided via | ||
426 | * IVIDDEC2_InArgs#inputID). | ||
427 | * | ||
428 | * @remarks A value of zero (0) indicates | ||
429 | * an invalid ID. The first zero | ||
430 | * entry in array will indicate | ||
431 | * end of valid freeBufIDs within | ||
432 | * the array. Hence the | ||
433 | * application can stop searching | ||
434 | * the array when it encounters the | ||
435 | * first zero entry. | ||
436 | * | ||
437 | * @remarks If no buffer was unlocked in | ||
438 | * the process call, | ||
439 | * @c freeBufID[0] will | ||
440 | * have a value of zero. | ||
441 | * | ||
442 | * @sa IVIDDEC2_InArgs#inputID | ||
443 | * @sa IVIDDEC2_OutArgs#displayBufs | ||
444 | */ | ||
445 | XDAS_Int32 outBufsInUseFlag; /**< Flag to indicate that the @c outBufs | ||
446 | * provided with the process() call are in | ||
447 | * use. No outBufs are required to be | ||
448 | * supplied with the next process() call. | ||
449 | * | ||
450 | * @remarks Valid values are XDAS_TRUE | ||
451 | * and XDAS_FALSE. | ||
452 | */ | ||
453 | |||
454 | } IVIDDEC2_OutArgs; | ||
455 | |||
456 | |||
457 | /** | ||
458 | * @brief Defines the control commands for the IVIDDEC2 module. | ||
459 | * | ||
460 | * @remarks This ID can be extended in IMOD interface for | ||
461 | * additional controls. | ||
462 | * | ||
463 | * @sa XDM_CmdId | ||
464 | * | ||
465 | * @sa IVIDDEC2_Fxns::control() | ||
466 | */ | ||
467 | typedef IALG_Cmd IVIDDEC2_Cmd; | ||
468 | |||
469 | |||
470 | /** | ||
471 | * @brief Defines all of the operations on IVIDDEC2 objects | ||
472 | */ | ||
473 | typedef struct IVIDDEC2_Fxns { | ||
474 | IALG_Fxns ialg; /**< XDAIS algorithm interface. | ||
475 | * | ||
476 | * @sa IALG_Fxns | ||
477 | */ | ||
478 | |||
479 | /** | ||
480 | * @brief Basic video decoding call | ||
481 | * | ||
482 | * @param[in] handle Handle to an algorithm instance. | ||
483 | * @param[in,out] inBufs Input buffer descriptors. | ||
484 | * @param[in,out] outBufs Output buffer descriptors. The algorithm | ||
485 | * may modify the output buffer pointers. | ||
486 | * @param[in] inArgs Input arguments. This is a required | ||
487 | * parameter. | ||
488 | * @param[out] outArgs Ouput results. This is a required parameter. | ||
489 | * | ||
490 | * @remarks process() is a blocking call. When process() returns, the | ||
491 | * algorithm's processing is complete. | ||
492 | * | ||
493 | * @remarks process() enables codecs to support error resiliency and | ||
494 | * error concealment. As a result, even if #IVIDDEC2_EFAIL | ||
495 | * is returned from process() because the encoded buffer has | ||
496 | * an error, it's possible that decoded buffers | ||
497 | * (@c outArgs->decodedBufs) and display buffers | ||
498 | * (@c outArgs->displayBufs) could still be returned. | ||
499 | * The codec can indicate that buffers are available by | ||
500 | * <i>not</i> setting the #XDM_ISFATALERROR bit | ||
501 | * in the respective @c displayBufs and @c decodedBufs | ||
502 | * @c extendedError field if the buffers contain valid data. | ||
503 | * | ||
504 | * @remarks By extension then, if the @c outArgs->decodedBufs and | ||
505 | * @c outArgs->displayBufs buffers are <i>not</i> valid, even | ||
506 | * if the codec's process() call returns IVIDDEC2_EFAIL, it must | ||
507 | * also be sure to set the #XDM_ISFATALERROR bit in the | ||
508 | * respective @c extendedError fields. Failure to do so may | ||
509 | * result in applications accessing these buffers and causing | ||
510 | * system instability. | ||
511 | * | ||
512 | * @pre @c inBufs->numBufs will indicate the total number of input | ||
513 | * buffers supplied for input frame, and conditionally, the | ||
514 | * encoders MB data buffer. | ||
515 | * | ||
516 | * @pre If IVIDDEC2_DynamicParams::mbDataFlag was set to #XDAS_FALSE | ||
517 | * in a previous control() call, the application only needs to | ||
518 | * provide buffers for reconstruction frames. | ||
519 | * | ||
520 | * @pre If IVIDDEC2_DynamicParams::mbDataFlag was set to #XDAS_TRUE | ||
521 | * in a previous control() call, | ||
522 | * @c outBufs->bufs[outBufs->numBufs - 1] is a buffer descriptor | ||
523 | * into which the algorithm will write MB data for each macro | ||
524 | * block. The size of the MB data buffer will vary based on the | ||
525 | * decoder type. H.264 may generate N264 bytes per MB, while | ||
526 | * Mpeg2 may generate NMP2 bytes. The exact size of the buffers | ||
527 | * should be obtained by calling the algorithm's control() method | ||
528 | * with XDM_GETBUFINFO. | ||
529 | * | ||
530 | * @pre @c inArgs must not be NULL, and must point to a valid | ||
531 | * IVIDDEC2_InArgs structure. | ||
532 | * | ||
533 | * @pre @c outArgs must not be NULL, and must point to a valid | ||
534 | * IVIDDEC2_OutArgs structure. | ||
535 | * | ||
536 | * @pre @c inBufs must not be NULL, and must point to a valid | ||
537 | * XDM1_BufDesc structure. | ||
538 | * | ||
539 | * @pre @c inBufs->descs[0].buf must not be NULL, and must point to | ||
540 | * a valid buffer of data that is at least | ||
541 | * @c inBufs->descs[0].bufSize bytes in length. | ||
542 | * | ||
543 | * @pre @c outBufs must not be NULL, and must point to a valid | ||
544 | * XDM_BufDesc structure. | ||
545 | * | ||
546 | * @pre @c outBufs->buf[0] must not be NULL, and must point to | ||
547 | * a valid buffer of data that is at least | ||
548 | * @c outBufs->bufSizes[0] bytes in length. | ||
549 | * | ||
550 | * @pre The buffers in @c inBufs and @c outBufs are physically | ||
551 | * contiguous and owned by the calling application. | ||
552 | * | ||
553 | * @post The algorithm <b>must not</b> modify the contents of @c inArgs. | ||
554 | * | ||
555 | * @post The algorithm <b>must not</b> modify the contents of | ||
556 | * @c inBufs, with the exception of @c inBufs.bufDesc[].accessMask. | ||
557 | * That is, the data and buffers pointed to by these parameters | ||
558 | * must be treated as read-only. | ||
559 | * | ||
560 | * @post The algorithm <b>must</b> modify the contents of | ||
561 | * @c inBufs->descs[].accessMask and appropriately indicate the | ||
562 | * mode in which each of the buffers in @c inBufs were read. | ||
563 | * For example, if the algorithm only read from | ||
564 | * @c inBufs.descs[0].buf using the algorithm processor, it | ||
565 | * could utilize #XDM_SETACCESSMODE_READ to update the appropriate | ||
566 | * @c accessMask fields. | ||
567 | * The application <i>may</i> utilize these | ||
568 | * returned values to appropriately manage cache. | ||
569 | * | ||
570 | * @post The buffers in @c inBufs are | ||
571 | * owned by the calling application. | ||
572 | * | ||
573 | * @retval IVIDDEC2_EOK @copydoc IVIDDEC2_EOK | ||
574 | * @retval IVIDDEC2_EFAIL @copydoc IVIDDEC2_EFAIL | ||
575 | * See IVIDDEC2_Status#extendedError | ||
576 | * for more detailed further error | ||
577 | * conditions. | ||
578 | * @retval IVIDDEC2_EUNSUPPORTED @copydoc IVIDDEC2_EUNSUPPORTED | ||
579 | */ | ||
580 | XDAS_Int32 (*process)(IVIDDEC2_Handle handle, XDM1_BufDesc *inBufs, | ||
581 | XDM_BufDesc *outBufs, IVIDDEC2_InArgs *inArgs, | ||
582 | IVIDDEC2_OutArgs *outArgs); | ||
583 | |||
584 | |||
585 | /** | ||
586 | * @brief Control behavior of an algorithm. | ||
587 | * | ||
588 | * @param[in] handle Handle to an algorithm instance. | ||
589 | * @param[in] id Command id. See #XDM_CmdId. | ||
590 | * @param[in] params Dynamic parameters. This is a required | ||
591 | * parameter. | ||
592 | * @param[out] status Output results. This is a required parameter. | ||
593 | * | ||
594 | * @pre @c handle must be a valid algorithm instance handle. | ||
595 | * | ||
596 | * @pre @c params must not be NULL, and must point to a valid | ||
597 | * IVIDDEC2_DynamicParams structure. | ||
598 | * | ||
599 | * @pre @c status must not be NULL, and must point to a valid | ||
600 | * IVIDDEC2_Status structure. | ||
601 | * | ||
602 | * @pre If a buffer is provided in the @c status->data field, | ||
603 | * it must be physically contiguous and owned by the calling | ||
604 | * application. | ||
605 | * | ||
606 | * @post The algorithm <b>must not</b> modify the contents of @c params. | ||
607 | * That is, the data pointed to by this parameter must be | ||
608 | * treated as read-only. | ||
609 | * | ||
610 | * @post If a buffer was provided in the @c status->data field, | ||
611 | * it is owned by the calling application. | ||
612 | * | ||
613 | * @retval IVIDDEC2_EOK @copydoc IVIDDEC2_EOK | ||
614 | * @retval IVIDDEC2_EFAIL @copydoc IVIDDEC2_EFAIL | ||
615 | * See IVIDDEC2_Status#extendedError | ||
616 | * for more detailed further error | ||
617 | * conditions. | ||
618 | * @retval IVIDDEC2_EUNSUPPORTED @copydoc IVIDDEC2_EUNSUPPORTED | ||
619 | */ | ||
620 | XDAS_Int32 (*control)(IVIDDEC2_Handle handle, IVIDDEC2_Cmd id, | ||
621 | IVIDDEC2_DynamicParams *params, IVIDDEC2_Status *status); | ||
622 | |||
623 | } IVIDDEC2_Fxns; | ||
624 | |||
625 | |||
626 | /*@}*/ | ||
627 | |||
628 | #ifdef __cplusplus | ||
629 | } | ||
630 | #endif | ||
631 | |||
632 | #endif /* ti_xdais_dm_IVIDDEC2_ */ | ||