]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/libdce2.git/blob - packages/xdais/ti/xdais/dm/xdm.h
[LIBDCE] Added codec, xdais and xdctools headers
[glsdk/libdce2.git] / packages / xdais / ti / xdais / dm / xdm.h
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  */
34 /**
35  *  @file       ti/xdais/dm/xdm.h
36  *
37  *  @brief      This header defines all types, constants, and functions
38  *              shared across the various XDM classes of algorithms.
39  */
40 /**
41  *  @addtogroup   ti_xdais_dm_XDM       XDM - Shared XDM Definitions
42  *
43  *  This is the XDM interface.
44  */
46 #ifndef ti_xdais_dm_XDM_
47 #define ti_xdais_dm_XDM_
49 #include <ti/xdais/ialg.h>
50 #include <ti/xdais/xdas.h>
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
56 /** @ingroup    ti_xdais_dm_XDM */
57 /*@{*/
59 #define XDM_EOK                 IALG_EOK    /**< Success. */
60 #define XDM_EFAIL               IALG_EFAIL  /**< General failure. */
61 #define XDM_EUNSUPPORTED        -3          /**< Request is unsupported. */
64 #ifdef XDM_INCLUDE_DOT9_SUPPORT
65 /**
66  *  @brief      General runtime failure.
67  *
68  *  @deprecated This is only supported on 0.9 XDM.  To use it, you must
69  *              define "XDM_INCLUDE_DOT9_SUPPORT".
70  *              In XDM 1.00+, it is required that codecs return "EFAIL", as
71  *              "ERUNTIME" is not supported.
72  */
73 #define XDM_ERUNTIME            -2
74 #endif
76 #define XDM_MAX_IO_BUFFERS      16          /**< Max I/O Buffers */
78 /**
79  *  @brief      Buffer descriptor for multiple buffers.
80  *
81  *  @dot
82  *  digraph example {
83  *    rankdir=LR;
84  *    node [shape=record];
85  *    XDM_BufDesc [ style=filled, fillcolor=gray98, label="<bufs> XDAS_Int8 **bufs | <numBufs> XDAS_Int32 numBufs | <bufSizes> XDAIS_Int32 *bufSizes"];
86  *    bufArray [ label="<f0> ptr to buf 0 |<f1> ptr to buf 1|<f2> ptr to buf 2|.\n.\n.\n" ];
87  *    buf0 [ label="<f0> data buf 0" ];
88  *    buf1 [ label="<f0> data buf 1" ];
89  *    buf2 [ label="<f0> data buf 2" ];
90  *    bufSizes [ label="<f0> size of data buf 0 | size of data buf 1 | size of data buf 2|.\n.\n.\n" ];
91  *    XDM_BufDesc:bufs -> bufArray:f0;
92  *    bufArray:f0 -> buf0:f0;
93  *    bufArray:f1 -> buf1:f0;
94  *    bufArray:f2 -> buf2:f0;
95  *    XDM_BufDesc:bufSizes -> bufSizes:f0;
96  *  }
97  *  @enddot
98  *
99  *  @pre        @c numBufs can not be larger than #XDM_MAX_IO_BUFFERS.  Related,
100  *              @c *bufs and @c *bufSizes will never be indexed beyond
101  *              #XDM_MAX_IO_BUFFERS elements.
102  *
103  *  @remarks    This data type is commonly used to manage input and output
104  *              buffers.
105  *
106  *  @remarks    If @c *bufs is a sparse array, @c *bufSizes will be a similar
107  *              sparse array.  The @c NULL indexes in @c bufs will be ignored
108  *              in @c bufSizes.
109  *
110  *  @remarks    @c numBufs describes the number of buffers in this descriptor.
111  *              if @c *bufs is a sparse array, @c numBufs describes
112  *              the number of non-NULL buffers in this descriptor;
113  *              this is not necessarily the maximum index of the last
114  *              buffer pointed to by @c *bufs.
115  *
116  *  @remarks    An example utilizing XDM_BufDesc as a sparse array would be
117  *              the following:
118  *  @code
119  *              XDM_BufDesc outBufs;
120  *              XDAS_Int32  bufSizeArray[XDM_MAX_IO_BUFFERS];
121  *              XDAS_Int8  *pBuffers[XDM_MAX_IO_BUFFERS];
122  *              XDAS_Int8   buffer1[4096];
123  *              XDAS_Int8   buffer2[1024];
124  *
125  *              // ensure all pBuffers and bufSizeArray are initially NULL
126  *              memset(pBuffers, 0, sizeof(pBuffers[0]) * XDM_MAX_IO_BUFFERS);
127  *              memset(bufSizeArray, 0,
128  *                  sizeof(bufSizeArray[0]) * XDM_MAX_IO_BUFFERS);
129  *
130  *              pBuffers[0] = buffer1;
131  *              pBuffers[4] = buffer2;
132  *
133  *              bufSizeArray[0] = 4096;
134  *              bufSizeArray[4] = 1024;
135  *
136  *              outBufs.bufs = pBuffers;
137  *              outBufs.numBufs = 2;
138  *              outBufs.bufSizes = bufSizeArray;
139  *  @endcode
140  *
141  *  @remarks    The following diagram describes graphically the example above.
142  *
143  *  @dot
144  *  digraph example {
145  *    rankdir=LR;
146  *    node [shape=record];
147  *    XDM_BufDesc [ style=filled, fillcolor=gray98, label="<bufs> bufs = pBuffers | <numBufs> numBufs = 2 | <bufSizes> bufSizes = bufSizeArray"];
148  *    bufArray [ label="<f0> pBuffers[0] |<f1> NULL |<f2> NULL|<f3> NULL|<f4> pBuffers[4]|NULL|NULL|.\n.\n.\n" ];
149  *    buf0 [ label="<f0> buffer1" ];
150  *    buf4 [ label="<f0> buffer2" ];
151  *    bufSizes [ label="<f0> 4096|0|0|0|1024|0|0| .\n.\n.\n" ];
152  *    XDM_BufDesc:bufs -> bufArray:f0;
153  *    bufArray:f0 -> buf0:f0;
154  *    bufArray:f4 -> buf4:f0;
155  *    XDM_BufDesc:bufSizes -> bufSizes:f0;
156  *  }
157  *  @enddot
158  *
159  */
160 typedef struct XDM_BufDesc {
161     XDAS_Int8   **bufs;     /**< Pointer to an array containing buffer
162                              *   addresses.
163                              */
164     XDAS_Int32   numBufs;   /**< Number of buffers. */
165     XDAS_Int32  *bufSizes;  /**< Size of each buffer in 8-bit bytes. */
166 } XDM_BufDesc;
169 /**
170  *  @brief      Single buffer descriptor.
171  */
172 typedef struct XDM_SingleBufDesc {
173     XDAS_Int8   *buf;       /**< Pointer to a buffer address. */
174     XDAS_Int32  bufSize;    /**< Size of @c buf in 8-bit bytes. */
175 } XDM_SingleBufDesc;
179 /**
180  *  @brief      Single buffer descriptor.
181  */
182 typedef struct XDM1_SingleBufDesc {
183     XDAS_Int8   *buf;       /**< Pointer to a buffer address. */
184     XDAS_Int32  bufSize;    /**< Size of @c buf in 8-bit bytes. */
185     XDAS_Int32  accessMask; /**< Mask filled by the algorithm, declaring
186                              *   how the buffer was accessed <b>by the
187                              *   algorithm processor</b>.
188                              *
189                              *   @remarks  If the buffer was <b>not</b>
190                              *             accessed by the algorithm
191                              *             processor (e.g., it was filled
192                              *             via DMA or other hardware
193                              *             accelerator that <i>doesn't</i>
194                              *             write through the algorithm's
195                              *             CPU), then no bits in this mask
196                              *             should be set.
197                              *
198                              *   @remarks  It is acceptible (and
199                              *             appropriate!)to set several
200                              *             bits in this mask if the
201                              *             algorithm accessed the buffer
202                              *             in several ways.
203                              *
204                              *   @remarks  This mask is often used by the
205                              *             application and/or framework
206                              *             to appropriately manage cache
207                              *             on cache-based systems.
208                              *
209                              *   @sa XDM_AccessMode
210                              */
211 } XDM1_SingleBufDesc;
214 /**
215  *  @brief      Union describing a buffer size
216  *
217  *  @remarks    More advanced memory types (e.g. tiled memory) cannot
218  *              indicate buffer size using a simple integer, but rather
219  *              must indicate memory size using a width and height.
220  */
221 typedef union {
222     struct {
223         XDAS_Int32 width;   /**< Width of @c buf in 8-bit bytes. */
224         XDAS_Int32 height;  /**< Height of @c buf in 8-bit bytes. */
225     } tileMem;
226     XDAS_Int32 bytes;       /**< Size of @c buf in 8-bit bytes. */
227 } XDM2_BufSize;
229 /**
230  *  @brief      Single buffer descriptor
231  *
232  *  @remarks    This buffer descriptor contains a @c memType field, and uses
233  *              the XDM_BufSize union to indicate the size of the buffer.
234  *              As a result, this data type can be used to describe
235  *              complex memory types (e.g. tiled memory).
236  */
237 typedef struct XDM2_SingleBufDesc {
238     XDAS_Int8   *buf;       /**< Pointer to a buffer address. */
239     XDAS_Int16  memType;    /**< Memory type.
240                              *
241                              *   @sa XDM_MemoryType
242                              */
243     XDAS_Int16 usageMode;   /**< Memory usage descriptor.
244                              *
245                              *   @remarks   This field is set by the owner
246                              *              of the buffer (typically the
247                              *              application), and read by users
248                              *              of the buffer (including the
249                              *              algorithm).
250                              *
251                              *   @sa XDM_MemoryUsageMode
252                              */
253     XDM2_BufSize bufSize;   /**< Buffer size(for tile memory/row memory */
254     XDAS_Int32  accessMask; /**< Mask filled by the algorithm, declaring
255                              *   how the buffer was accessed <b>by the
256                              *   algorithm processor</b>.
257                              *
258                              *   @remarks  If the buffer was <b>not</b>
259                              *             accessed by the algorithm
260                              *             processor (e.g., it was filled
261                              *             via DMA or other hardware
262                              *             accelerator that <i>doesn't</i>
263                              *             write through the algorithm's
264                              *             CPU), then no bits in this mask
265                              *             should be set.
266                              *
267                              *   @remarks  It is acceptible (and
268                              *             appropriate!)to set several
269                              *             bits in this mask if the
270                              *             algorithm accessed the buffer
271                              *             in several ways.
272                              *
273                              *   @remarks  This mask is often used by the
274                              *             application and/or framework
275                              *             to appropriately manage cache
276                              *             on cache-based systems.
277                              *
278                              *   @sa XDM_AccessMode
279                              */
280 } XDM2_SingleBufDesc;
283 /**
284  *  @brief      Buffer descriptor.
285  */
286 typedef struct XDM1_BufDesc {
287     XDAS_Int32   numBufs;   /**< Number of buffers in @c descs array.
288                              *
289                              *   @remarks  Must be less than
290                              *             #XDM_MAX_IO_BUFFERS.
291                              */
292     XDM1_SingleBufDesc descs[XDM_MAX_IO_BUFFERS]; /** Array of buffer
293                              * descriptors.
294                              */
295 } XDM1_BufDesc;
297 /**
298  *  @brief      Buffer descriptor
299  *
300  *  @remarks    This advanced buffer uses the XDM2_SingleBufDesc, and is
301  *              typically used for codecs which must reflect <i>types</i>
302  *              of memory.  For example, video codecs may need to indicate
303  *              whether tiled memory is used.
304  */
305 typedef struct XDM2_BufDesc {
306     XDAS_Int32   numBufs;   /**< Number of buffers in @c descs array.
307                              *
308                              *   @remarks  Must be less than
309                              *             #XDM_MAX_IO_BUFFERS.
310                              */
311     XDM2_SingleBufDesc descs[XDM_MAX_IO_BUFFERS]; /** Array of buffer
312                              * descriptors.
313                              */
314 } XDM2_BufDesc;
317 /**
318  *  @brief      Access modes used to declare how the algorithm accessed buffers.
319  *
320  *  @remarks    This indicates how the algorithm's <b>CPU</b> accessed the
321  *              buffer, independent of DMA or other hardware accellerators.
322  *              For example, if the buffer was written to with DMA (as
323  *              opposed to writing to the buffer with the CPU write
324  *              instructions), the algorithm should <b>not</b> set the
325  *              XDM_ACCESSMODE_WRITE bit.
326  *
327  *  @remarks    The value of the enum is the bit offset into a mask.  The value
328  *              of the enum is not the value to assign the mask.
329  *
330  *
331  *  @enumWarning
332  *
333  *  @sa         XDM1_SingleBufDesc
334  *  @sa         XDM1_BufDesc
335  */
336 typedef enum {
337     XDM_ACCESSMODE_READ = 0,      /**< The algorithm <i>read</i> from the
338                                    *   buffer using the CPU.
339                                    *
340                                    *   @sa      XDM_SETACCESSMODE_READ
341                                    *   @sa      XDM_ISACCESSMODE_READ
342                                    */
343     XDM_ACCESSMODE_WRITE = 1      /**< The algorithm <i>wrote</i> to the
344                                    *   buffer using the CPU.
345                                    *
346                                    *   @sa      XDM_SETACCESSMODE_WRITE
347                                    *   @sa      XDM_ISACCESSMODE_WRITE
348                                    */
349 } XDM_AccessMode;
352 /**
353  *  @brief      Check an access mask for CPU read access.
354  *
355  *  @param      x       access mask.
356  *
357  *  @remarks    This is typically used by an application.
358  *
359  *  @sa         XDM1_SingleBufDesc::accessMask
360  *  @sa         XDM_ISACCESSMODE_WRITE
361  */
362 #define XDM_ISACCESSMODE_READ(x)    (((x) >> XDM_ACCESSMODE_READ) & 0x1)
365 /**
366  *  @brief      Check an access mask for CPU write access.
367  *
368  *  @param      x       access mask.
369  *
370  *  @remarks    This is typically used by an application.
371  *
372  *  @sa         XDM1_SingleBufDesc::accessMask
373  *  @sa         XDM_ISACCESSMODE_READ
374  */
375 #define XDM_ISACCESSMODE_WRITE(x)   (((x) >> XDM_ACCESSMODE_WRITE) & 0x1)
378 /**
379  *  @brief      Clear the "CPU read access" bit in an access mask.
380  *
381  *  @param      x       access mask.
382  *
383  *  @remarks    This is typically used by an algorithm.
384  *
385  *  @sa         XDM_SETACCESSMODE_READ
386  *  @sa         XDM1_SingleBufDesc::accessMask
387  */
388 #define XDM_CLEARACCESSMODE_READ(x)   ((x) &= (~(0x1 << XDM_ACCESSMODE_READ)))
391 /**
392  *  @brief      Clear the "CPU write access" bit in an access mask.
393  *
394  *  @param      x       access mask.
395  *
396  *  @remarks    This is typically used by an algorithm.
397  *
398  *  @sa         XDM_SETACCESSMODE_WRITE
399  *  @sa         XDM1_SingleBufDesc::accessMask
400  */
401 #define XDM_CLEARACCESSMODE_WRITE(x)   ((x) &= (~(0x1 << XDM_ACCESSMODE_WRITE)))
404 /**
405  *  @brief      Set the bit to indicate CPU read access in an access mask.
406  *
407  *  @param      x       access mask.
408  *
409  *  @remarks    This is typically used by an algorithm.
410  *
411  *  @sa         XDM1_SingleBufDesc::accessMask
412  */
413 #define XDM_SETACCESSMODE_READ(x)   ((x) |= (0x1 << XDM_ACCESSMODE_READ))
416 /**
417  *  @brief      Set the bit to indicate CPU write access in an access mask.
418  *
419  *  @param      x       access mask.
420  *
421  *  @remarks    This is typically used by an algorithm.
422  *
423  *  @sa         XDM1_SingleBufDesc::accessMask
424  */
425 #define XDM_SETACCESSMODE_WRITE(x)  ((x) |= (0x1 << XDM_ACCESSMODE_WRITE))
428 /**
429  *  @brief      Buffer information descriptor for input and output buffers.
430  */
431 typedef struct XDM1_AlgBufInfo {
432     XDAS_Int32 minNumInBufs;       /**< Minimum number of input buffers. */
433     XDAS_Int32 minNumOutBufs;      /**< Minimum number of output buffers. */
434     XDM2_BufSize minInBufSize[XDM_MAX_IO_BUFFERS];  /**< Minimum size required
435                                     * for each input buffer.
436                                     */
437     XDM2_BufSize minOutBufSize[XDM_MAX_IO_BUFFERS]; /**< Minimum size required
438                                     * for each output buffer.
439                                     */
440     XDAS_Int32 inBufMemoryType[XDM_MAX_IO_BUFFERS]; /**< Required memory type
441                                     * for each input buffer.
442                                     *
443                                     *   @sa XDM_MemoryType
444                                     */
445     XDAS_Int32 outBufMemoryType[XDM_MAX_IO_BUFFERS]; /**< Required memory type
446                                     * for each output buffer.
447                                     *
448                                     *   @sa XDM_MemoryType
449                                     */
450     XDAS_Int32 minNumBufSets;      /**< Minimum number of buffer sets for
451                                     *   buffer management.
452                                     *
453                                     *   @todo  need more details
454                                     */
455 } XDM1_AlgBufInfo;
458 /**
459  *  @brief      Buffer information descriptor for input and output buffers.
460  */
461 typedef struct XDM_AlgBufInfo {
462     XDAS_Int32 minNumInBufs;       /**< Minimum number of input buffers. */
463     XDAS_Int32 minNumOutBufs;      /**< Minimum number of output buffers. */
464     XDAS_Int32 minInBufSize[XDM_MAX_IO_BUFFERS];  /**< Minimum size, in 8-bit
465                                     * bytes, required for each input buffer.
466                                     */
467     XDAS_Int32 minOutBufSize[XDM_MAX_IO_BUFFERS]; /**< Minimum size, in 8-bit
468                                     * bytes, required for each output buffer.
469                                     */
470 } XDM_AlgBufInfo;
473 /**
474  *  @brief      Base of algorithm-specific enum values
475  *
476  *  @remarks    This is provided to ensure that future updates to XDM-defined
477  *              enumerations don't conflict with algorithm-proprietary
478  *              enumerations.
479  *
480  *  @remarks    Custom enumerations should be defined like the following
481  *              (@c USERENUM0 and @c USERENUM1 are simply examples):
482  *  @code
483  *  #define MYMODULE_MYVENDOR_USERENUM0 (XDM_CUSTOMENUMBASE + 0)
484  *  #define MYMODULE_MYVENDOR_USERENUM1 (XDM_CUSTOMENUMBASE + 1)
485  *  @endcode
486  */
487 #define XDM_CUSTOMENUMBASE 0x100
490 /**
491  *  @brief      Base of algorithm-specific commands
492  *
493  *  @remarks    This is provided to ensure that future updates to XDM_CmdId's
494  *              enumeration don't conflict with algorithm-proprietary
495  *              command ID's.
496  *
497  *  @remarks    Custom command ID's should be defined like the following
498  *              (@c USERCMD0 and @c USERCMD1 are simply examples):
499  *  @code
500  *  #define MYMODULE_MYVENDOR_USERCMD0 (XDM_CUSTOMCMDBASE + 0)
501  *  #define MYMODULE_MYVENDOR_USERCMD1 (XDM_CUSTOMCMDBASE + 1)
502  *  @endcode
503  *
504  *  @sa XDM_CmdId
505  */
506 #define XDM_CUSTOMCMDBASE 0x100
508 /**
509  *  @brief      Standard control commands that must be implemented by
510  *              XDM compliant multimedia algorithms.
511  *
512  *  @remarks    If an algorithm receives a command it doesn't handle or
513  *              understand, it must return EUNSUPPORTED.
514  *
515  *  @remarks    XDM_GETCONTEXTINFO need only be implemented by split codecs.
516  *              Standard algorithms should return EUNSUPPORTED if they receive
517  *              the XDM_GETCONTEXTINFO command.
518  *
519  *  @remarks    Any control ID extension in IMOD interface should start
520  *              from XDM_CUSTOMCMDBASE onward.  The ID range from 0 to
521  *              XDM_CUSTOMCMDBASE is reserved.
522  *
523  *  @enumWarning
524  *
525  *  @sa XDM_CUSTOMCMDBASE
526  */
527 typedef enum {
528     XDM_GETSTATUS = 0,      /**< Query algorithm to fill status structure.
529                              *
530                              *   @remarks   Some XDM interfaces provide an
531                              *              embedded "DynamicParams" struct in
532                              *              the base class "Status" struct in
533                              *              which the current state of an
534                              *              algorithm's dynamic params can be
535                              *              returned (e.g.
536                              *              #IVIDENC2_Status.encDynamicParams);
537                              *              other codec classes do not (and
538                              *              algs could provide this via
539                              *              an extended Status struct).
540                              */
541     XDM_SETPARAMS = 1,      /**< Set run time dynamic parameters. */
542     XDM_RESET = 2,          /**< Reset the algorithm.  All fields in the
543                              *   internal data structures are reset and all
544                              *   internal buffers are flushed.
545                              */
546     XDM_SETDEFAULT = 3,     /**< Restore the algorithm's internal state
547                              *   to its original, default values.
548                              *
549                              *   @remarks       The application only needs
550                              *                  to initialize the
551                              *                  @c dynamicParams.size and
552                              *                  @c status.size fields
553                              *                  prior to calling control()
554                              *                  with XDM_SETDEFAULT.
555                              *
556                              *   @remarks       The algorithm must only
557                              *                  write to the
558                              *                  @c status.extendedError field,
559                              *                  and potentially algorithm
560                              *                  specific, extended fields.
561                              *
562                              *   @remarks       XDM_SETDEFAULT differs from
563                              *                  XDM_RESET.  In addition to
564                              *                  restoring the algorithm's
565                              *                  internal state, XDM_RESET
566                              *                  additionally resets any
567                              *                  channel related state.
568                              */
569     XDM_FLUSH = 4,          /**< Handle end of stream conditions.  This
570                              *   command forces the algorithm to output
571                              *   data without additional input.  The
572                              *   recommended sequence is to call the
573                              *   control() function (with XDM_FLUSH)
574                              *   followed by repeated calls to the
575                              *   process() function until it returns an
576                              *   error.
577                              *
578                              *   @remarks    The algorithm should return
579                              *               the appropriate, class-specific
580                              *               "EFAIL" error (e.g.
581                              *               ISPHDEC1_EFAIL, IVIDENC1_EFAIL,
582                              *               etc), when flushing is
583                              *               complete.
584                              */
585     XDM_GETBUFINFO = 5,     /**< Query algorithm instance regarding its
586                              *   properties of input and output
587                              *   buffers.
588                              *
589                              *   @remarks   The application only needs
590                              *              to initialize the
591                              *              @c dynamicParams.size, the
592                              *              @c status.size, and set
593                              *              any buffer descriptor fields
594                              *              (e.g. @c status.data) to
595                              *              @c NULL prior to calling
596                              *              control() with XDM_GETBUFINFO.
597                              *
598                              */
599     XDM_GETVERSION = 6,     /**< Query the algorithm's version.  The result
600                              *   will be returned in the @c data field of the
601                              *   respective _Status structure.
602                              *
603                              *   @remarks   There is no specific format
604                              *              defined for version returned by
605                              *              the algorithm.
606                              */
607     XDM_GETCONTEXTINFO = 7, /**< Query a split codec part for its context
608                              *   needs.
609                              *
610                              *   @remarks   Only split codecs are required
611                              *              to implement this command.
612                              */
613     XDM_GETDYNPARAMSDEFAULT = 8,  /**<  Query the algorithm to fill the
614                              *   default values for the parameters which
615                              *   can be configured dynamically.
616                              *
617                              *   @remarks   The algorithm provides the
618                              *              default dynamic params by
619                              *              writing into the @c dynamicParams
620                              *              structure.  Note that this is
621                              *              an exception to the general rule
622                              *              that the algorithm should not
623                              *              write into @c dynamicParams.
624                              *
625                              *   @remarks   The application only needs
626                              *              to initialize the
627                              *              @c dynamicParams.size and
628                              *              @c status.size fields
629                              *              prior to calling control()
630                              *              with #XDM_GETDYNPARAMSDEFAULT.
631                              *
632                              *   @remarks   Other than the @c .size field,
633                              *              values in the @c status struct
634                              *              are undefined upon returning
635                              *              from this call.
636                              *
637                              *   @remarks   To get the <i>current</i> value of
638                              *              an algorithm instance's dynamic
639                              *              parameters, it's recommended that
640                              *              the alg provide them via the
641                              *              #XDM_GETSTATUS call.
642                              */
643     XDM_SETLATEACQUIREARG = 9, /**< Set an algorithm's 'late acquire' argument.
644                              *
645                              *   @remarks   Handling this command is optional.
646                              *
647                              *   @remarks   Only algorithms that utilize the
648                              *              late acquire IRES feature may
649                              *              implement this command.
650                              */
651     XDM_MOVEBUFS = 10       /**< Move (replace) data buffers an algorithm is
652                              *   currently referencing.
653                              *
654                              *   @remarks   Handling this command is optional.
655                              *
656                              *   @remarks   An application can use this command
657                              *              to move data buffers that an
658                              *              algorithm is currently referencing.
659                              *
660                              *   @remarks   Only algorithms tracking buffers
661                              *              with id's (e.g. IVIDDEC3) can
662                              *              implement this command.
663                              *
664                              *   @remarks   Only algorithms who's @c _Status
665                              *              struct includes a @c data field
666                              *              (e.g. IVIDDEC3) can implement this
667                              *              command.  This @c data field is a
668                              *              buffer descriptor.  When using the
669                              *              XDM_MOVEBUFS command, this @c data
670                              *              buffer is an IN buffer (read-only
671                              *              to the algorithm) which
672                              *              contains an array of one or
673                              *              more XDM2_MoveBufDesc elements.
674                              *              Each element indicates (via the id
675                              *              field), a buffer which the
676                              *              algorithm is referencing that
677                              *              needs to be "moved".
678                              *
679                              *   @remarks   The application is responsible for
680                              *              indicating the number of
681                              *              XDM2_MoveBufDesc elements by
682                              *              appropriately setting the
683                              *              @c _Status.data.bufSize field.
684                              *
685                              *   @remarks   As with all control() processing,
686                              *              the algorithm is responsible for
687                              *              appropriately setting the
688                              *              @c _Status.data.accessMask field
689                              *              indicating if/how the algorithm
690                              *              accessed the data buffer.
691                              *              Typically for this cmd, the
692                              *              algorithm reads from the @c data
693                              *              buffer, so it should set the
694                              *              #XDM_ACCESSMODE_READ bit in the
695                              *              @c _Status.data.accessMask field.
696                              *              Frameworks/apps can use this
697                              *              to appropriately handle cache for
698                              *              that @c data buffer.
699                              *
700                              *   @sa    XDM2_MoveBufDesc
701                              */
702 } XDM_CmdId;
705 /**
706  *  @brief      Extended error information.
707  *
708  *  @remarks    When an internal error occurs, the algorithm will return
709  *              an error return value (e.g. EFAIL, EUNSUPPORTED)
710  *
711  *  @remarks    The value of each enum is the bit which is set.
712  *
713  *  @remarks    Bits 31-16 are reserved.  Bits 7-0 are codec and
714  *              implementation specific.
715  *
716  *  @remarks    The algorithm can set multiple bits to 1 based on conditions.
717  *              e.g. it will set bits #XDM_FATALERROR (fatal) and
718  *              #XDM_UNSUPPORTEDPARAM (unsupported params) in case
719  *              of unsupported run time parameters.
720  *
721  *  @enumWarning
722  */
723 typedef enum {
724     XDM_PARAMSCHANGE = 8,       /**< Bit 8 - Sequence Parameters Change.
725                                   *
726                                   *   @remarks  This error is applicable
727                                   *             for transcoders. It is
728                                   *             set when some key parameter
729                                   *             of the input sequence changes.
730                                   *             The transcoder simply
731                                   *             returns after setting this error
732                                   *             field and the correct input
733                                   *             sequence parameters are
734                                   *             updated in outArgs.
735                                   */
736     XDM_APPLIEDCONCEALMENT = 9,  /**< Bit 9 - Applied concealment.
737                                   *
738                                   *   @remarks  This error is applicable
739                                   *             for decoders.  It is
740                                   *             set when the decoder
741                                   *             was not able to able
742                                   *             to decode the
743                                   *             bitstream, and the
744                                   *             decoder has concealed
745                                   *             the bitstream error
746                                   *             and produced the
747                                   *             concealed output.
748                                   */
749     XDM_INSUFFICIENTDATA = 10,   /**< Bit 10 - Insufficient input data.
750                                   *
751                                   *   @remarks  This error is typically
752                                   *             applicable for
753                                   *             decoders. This is set
754                                   *             when the input data
755                                   *             provided is not
756                                   *             sufficient to produce
757                                   *             of one frame of data.
758                                   *             This can be also be
759                                   *             set for encoders when
760                                   *             the number of valid
761                                   *             samples in the input
762                                   *             frame is not
763                                   *             sufficient to process
764                                   *             a frame.
765                                   */
766     XDM_CORRUPTEDDATA = 11,      /**< Bit 11 - Data problem/corruption.
767                                   *
768                                   *   @remarks  This error is typically
769                                   *             applicable for
770                                   *             decoders.  This is set
771                                   *             when the bitstream has
772                                   *             an error and not
773                                   *             compliant to the
774                                   *             standard syntax.
775                                   */
776     XDM_CORRUPTEDHEADER = 12,    /**< Bit 12 - Header problem/corruption.
777                                   *
778                                   *   @remarks  This error is typically
779                                   *             applicable for
780                                   *             decoders.  This is set
781                                   *             when the header
782                                   *             information in the
783                                   *             bitstream is
784                                   *             incorrect.  For example,
785                                   *             it is set when
786                                   *             Sequence/Picture/Slice
787                                   *             etc. are incorrect in
788                                   *             video decoders.
789                                   */
790     XDM_UNSUPPORTEDINPUT = 13,   /**< Bit 13 - Unsupported feature/parameter
791                                   *   in input.
792                                   *
793                                   *   @remarks  This error is set when the
794                                   *             algorithm is not able
795                                   *             process a certain
796                                   *             input data/bitstream
797                                   *             format.  It can also be
798                                   *             set when a subset of
799                                   *             features in a standard
800                                   *             are not supported by
801                                   *             the algorithm.
802                                   *
803                                   *   @remarks  For example, if a video
804                                   *             encoder only supports
805                                   *             4:2:2 format, it can
806                                   *             set this error for any
807                                   *             other type of input
808                                   *             video format.
809                                   */
810     XDM_UNSUPPORTEDPARAM = 14,   /**< Bit 14 - Unsupported input parameter or
811                                   *   configuration.
812                                   *
813                                   *   @remarks  This error is set when the
814                                   *             algorithm doesn't
815                                   *             support certain
816                                   *             configurable
817                                   *             parameters.  For
818                                   *             example, if the video
819                                   *             decoder doesn't
820                                   *             support the "display
821                                   *             width" feature, it
822                                   *             shall return
823                                   *             XDM_UNSUPPORTEDPARAM
824                                   *             when the control
825                                   *             function is called for
826                                   *             setting the
827                                   *             @c displayWidth
828                                   *             attribute.
830                                   */
831     XDM_FATALERROR = 15          /**< Bit 15 - Fatal error (stop the codec).
832                                   *   If there is an error and this
833                                   *   bit is not set, the error is a
834                                   *   recoverable one.
835                                   *
836                                   *   @remarks  This error is set when the
837                                   *             algorithm cannot
838                                   *             recover from the
839                                   *             current state.  It
840                                   *             informs the system not
841                                   *             to try the next frame
842                                   *             and possibly delete
843                                   *             the multimedia
844                                   *             algorithm instance.  It
845                                   *             implies the codec
846                                   *             shall not work when
847                                   *             reset.
848                                   *
849                                   *   @remarks  The user should delete the
850                                   *             current instance of
851                                   *             the codec.
852                                   */
853 } XDM_ErrorBit;
855 /** Check for fatal error */
856 #define XDM_ISFATALERROR(x)         (((x) >> XDM_FATALERROR) & 0x1)
857 /** Check for unsupported parameter */
858 #define XDM_ISUNSUPPORTEDPARAM(x)   (((x) >> XDM_UNSUPPORTEDPARAM) & 0x1)
859 /** Check for unsupported input */
860 #define XDM_ISUNSUPPORTEDINPUT(x)   (((x) >> XDM_UNSUPPORTEDINPUT) & 0x1)
861 /** Check for corrupted header */
862 #define XDM_ISCORRUPTEDHEADER(x)    (((x) >> XDM_CORRUPTEDHEADER) & 0x1)
863 /** Check for corrupted data */
864 #define XDM_ISCORRUPTEDDATA(x)      (((x) >> XDM_CORRUPTEDDATA) & 0x1)
865 /** Check for insufficient data */
866 #define XDM_ISINSUFFICIENTDATA(x)   (((x) >> XDM_INSUFFICIENTDATA) & 0x1)
867 /** Check for applied concealment */
868 #define XDM_ISAPPLIEDCONCEALMENT(x) (((x) >> XDM_APPLIEDCONCEALMENT) & 0x1)
870 /** Set fatal error bit */
871 #define XDM_SETFATALERROR(x)         ((x) |= (0x1 << XDM_FATALERROR))
872 /** Set unsupported parameter bit */
873 #define XDM_SETUNSUPPORTEDPARAM(x)   ((x) |= (0x1 << XDM_UNSUPPORTEDPARAM))
874 /** Set unsupported input bit */
875 #define XDM_SETUNSUPPORTEDINPUT(x)   ((x) |= (0x1 << XDM_UNSUPPORTEDINPUT))
876 /** Set corrupted header bit */
877 #define XDM_SETCORRUPTEDHEADER(x)    ((x) |= (0x1 << XDM_CORRUPTEDHEADER))
878 /** Set corrupted data bit */
879 #define XDM_SETCORRUPTEDDATA(x)      ((x) |= (0x1 << XDM_CORRUPTEDDATA))
880 /** Set insufficient data bit */
881 #define XDM_SETINSUFFICIENTDATA(x)   ((x) |= (0x1 << XDM_INSUFFICIENTDATA))
882 /** Set applied concealment bit */
883 #define XDM_SETAPPLIEDCONCEALMENT(x) ((x) |= (0x1 << XDM_APPLIEDCONCEALMENT))
886 /**
887  *  @brief      Endianness of data
888  *
889  *  @enumWarning
890  *
891  *  @extendedEnum
892  */
893 typedef enum {
894     XDM_BYTE = 1,           /**< Big endian stream. */
895     XDM_LE_16 = 2,          /**< 16 bit little endian stream. */
896     XDM_LE_32 = 3,          /**< 32 bit little endian stream. */
897     XDM_LE_64 = 4,          /**< 64 bit little endian stream. */
898     XDM_BE_16 = 5,          /**< 16 bit big endian stream. */
899     XDM_BE_32 = 6,          /**< 32 bit big endian stream. */
900     XDM_BE_64 = 7           /**< 64 bit big endian stream. */
901 } XDM_DataFormat;
904 /**
905  *  @brief      Descriptor for a buffer to move.
906  */
907 typedef struct XDM2_MoveBufDesc {
908     XDAS_Int32 id;           /**< Id of the buffer to move */
909     XDM2_BufDesc bufDesc;    /**< New buffer descriptor */
910 } XDM2_MoveBufDesc;
913 /**
914  *  @brief      Date and time
915  */
916 typedef struct XDM_Date {
917     XDAS_Int32 msecsOfDay;   /**< Milliseconds of the day */
918     XDAS_Int32 month;        /**< Month (0 = January, 11 = December) */
919     XDAS_Int32 dayOfMonth;   /**< Month (1 - 31) */
920     XDAS_Int32 dayOfWeek;    /**< Day of week (0 = Sunday, 6 = Saturday) */
921     XDAS_Int32 year;         /**< Year (since 0) */
922 } XDM_Date;
925 /**
926  *  @brief      2-dimensional point
927  */
928 typedef struct XDM_Point {
929     XDAS_Int32 x;
930     XDAS_Int32 y;
931 } XDM_Point;
934 /**
935  *  @brief      Rectangle
936  */
937 typedef struct XDM_Rect {
938     XDM_Point topLeft;
939     XDM_Point bottomRight;
940 } XDM_Rect;
942 /**
943  *  @brief      Maximum number of context buffers.
944  */
945 #define XDM_MAX_CONTEXT_BUFFERS   32
948 /**
949  *  @brief      Buffer information descriptor for input and output buffers.
950  */
951 typedef struct XDM_ContextInfo {
952     XDAS_Int32 minContextSize;     /**< Minimum size, in 8-bit bytes,
953                                     *   required for the alg context.
954                                     */
955     XDAS_Int32 minIntermediateBufSizes[XDM_MAX_CONTEXT_BUFFERS];  /**< Minimum
956                                     *   size, in 8-bit bytes, required for each
957                                     *   intermediate buffer.
958                                     *
959                                     *   @remarks   The codec indicates the
960                                     *              number of intermediate
961                                     *              buffers required by
962                                     *              zero-terminating this array.
963                                     */
964 } XDM_ContextInfo;
967 /**
968  *  @brief      Context used by split codecs.
969  */
970 typedef struct XDM_Context {
971     XDM1_SingleBufDesc algContext;  /**< App allocated and provided.
972                                      *
973                                      *   @remarks  Split codecs can use this
974                                      *             for passing scalar data to
975                                      *             the next part.
976                                      */
978     XDAS_Int32 numInBufs;           /**< Number of input data buffers */
979     XDAS_Int32 numOutBufs;          /**< Number of output data buffers */
980     XDAS_Int32 numInOutBufs;        /**< Number of in/out data buffers */
981     XDM1_SingleBufDesc inBufs[XDM_MAX_CONTEXT_BUFFERS];  /**< Input data
982                                      *   Cbuffers.
983                                      *
984                                      *   @remarks  This is a sparse array.
985                                      */
986     XDM1_SingleBufDesc outBufs[XDM_MAX_CONTEXT_BUFFERS]; /**< Output data
987                                      *   buffers.
988                                      *
989                                      *   @remarks  This is a sparse array.
990                                      */
991     XDM1_SingleBufDesc inOutBufs[XDM_MAX_CONTEXT_BUFFERS]; /**< Input/Output
992                                      *   data buffers.
993                                      *
994                                      *   @remarks  This is a sparse array.
995                                      */
997     XDM1_SingleBufDesc intermediateBufs[XDM_MAX_CONTEXT_BUFFERS]; /**< Intermediate, working buffers.
998                                      *
999                                      *   @remarks   For FRONT codec parts,
1000                                      *              these buffers are
1001                                      *              treated as OUT
1002                                      *              buffers (i.e.,
1003                                      *              written to by the
1004                                      *              algorithm).  For
1005                                      *              BACK codec parts,
1006                                      *              these buffers are
1007                                      *              treated as IN
1008                                      *              buffers (i.e., read
1009                                      *              from by the
1010                                      *              algorithm).  For
1011                                      *              MIDDLE codec parts,
1012                                      *              these buffers are
1013                                      *              treated as IN/OUT
1014                                      *              buffers (i.e., the
1015                                      *              codec can read
1016                                      *              from, and write to
1017                                      *              them).
1018                                      *
1019                                      *   @remarks   This is a null-terminated
1020                                      *              array
1021                                      */
1022 } XDM_Context;
1025 /**
1026  *  @brief      Encoding presets.
1027  *
1028  *  @enumWarning
1029  *
1030  *  @extendedEnum
1031  */
1032 typedef enum {
1033     XDM_DEFAULT = 0,                /**< Default setting of encoder.  See
1034                                      *   codec specific documentation for its
1035                                      *   encoding behaviour.
1036                                      */
1037     XDM_HIGH_QUALITY = 1,           /**< High quality encoding. */
1038     XDM_HIGH_SPEED = 2,             /**< High speed encoding. */
1039     XDM_USER_DEFINED = 3,           /**< User defined configuration, using
1040                                      *   advanced parameters.
1041                                      */
1042     XDM_HIGH_SPEED_MED_QUALITY = 4, /**< High speed, medium quality
1043                                      *   encoding.
1044                                      */
1045     XDM_MED_SPEED_MED_QUALITY = 5,  /**< Medium speed, medium quality
1046                                      *   encoding.
1047                                      */
1048     XDM_MED_SPEED_HIGH_QUALITY = 6, /**< Medium speed, high quality
1049                                      *   encoding.
1050                                      */
1052     XDM_ENCODING_PRESET_MAX  = 7,   /**< @todo need to add documentation */
1053     XDM_PRESET_DEFAULT = XDM_MED_SPEED_MED_QUALITY /**< Default setting of
1054                                      *   encoder.  See codec specific
1055                                      *   documentation for its encoding
1056                                      *   behaviour.
1057                                      */
1058 } XDM_EncodingPreset;
1061 /**
1062  *  @brief      Decode entire access unit or only header.
1063  *
1064  *  @enumWarning
1065  *
1066  *  @extendedEnum
1067  */
1068 typedef enum {
1069     XDM_DECODE_AU = 0,      /**< Decode entire access unit, including all
1070                              *   the headers.
1071                              */
1072     XDM_PARSE_HEADER = 1    /**< Decode only header. */
1073 } XDM_DecMode;
1076 /**
1077  *  @brief      Encode entire access unit or only header.
1078  *
1079  *  @enumWarning
1080  *
1081  *  @extendedEnum
1082  */
1083 typedef enum {
1084     XDM_ENCODE_AU = 0,      /**< Encode entire access unit, including the
1085                              *   headers.
1086                              */
1087     XDM_GENERATE_HEADER = 1 /**< Encode only header. */
1088 } XDM_EncMode;
1091 /**
1092  *  @brief      Chroma formats.
1093  *
1094  *  @enumWarning
1095  *
1096  *  @extendedEnum
1097  */
1098 typedef enum {
1099     XDM_CHROMA_NA = -1,     /**< Chroma format not applicable. */
1100     XDM_YUV_420P = 1,       /**< YUV 4:2:0 planer. */
1101     XDM_YUV_422P = 2,       /**< YUV 4:2:2 planer. */
1102     XDM_YUV_422IBE = 3,     /**< YUV 4:2:2 interleaved (big endian). */
1103     XDM_YUV_422ILE = 4,     /**< YUV 4:2:2 interleaved (little endian). */
1104     XDM_YUV_444P = 5,       /**< YUV 4:4:4 planer. */
1105     XDM_YUV_411P = 6,       /**< YUV 4:1:1 planer. */
1106     XDM_GRAY = 7,           /**< Gray format. */
1107     XDM_RGB = 8,            /**< RGB color format. */
1108     XDM_YUV_420SP = 9,      /**< YUV 420 semi_planar format.(Luma 1st plane,
1109                              *   CbCr interleaved 2nd plane)
1110                              */
1111     XDM_ARGB8888 = 10,      /**< Alpha plane. */
1112     XDM_RGB555 = 11,        /**< RGB 555 color format. */
1113     XDM_RGB565 = 12,        /**< RGB 565 color format. */
1114     XDM_YUV_444ILE = 13,    /**< YUV 4:4:4 interleaved (little endian). */
1115     /** Default setting. */
1116     XDM_CHROMAFORMAT_DEFAULT = XDM_YUV_422ILE
1117 } XDM_ChromaFormat;
1120 /**
1121  *  @brief      Memory space attributes
1122  *
1123  *  @enumWarning
1124  *
1125  *  @extendedEnum
1126  */
1127  typedef enum {
1128     XDM_MEMTYPE_ROW = 0,        /**< Linear (standard) memory.
1129                                  *
1130                                  * @deprecated  The XDM_MEMTYPE_ROW value
1131                                  *        is deprecated.  Please use
1132                                  *        #XDM_MEMTYPE_RAW (which, by design,
1133                                  *        has the same underyling value)
1134                                  *        instead.
1135                                  *
1136                                  * @remarks     XDM_MEMTYPE_ROW may be
1137                                  *              removed in a future
1138                                  *              release.
1139                                  *
1140                                  * @sa XDM_MemoryType::XDM_MEMTYPE_RAW
1141                                  */
1142     XDM_MEMTYPE_RAW = 0,        /**< Linear (standard) memory.
1143                                  *
1144                                  * @todo  add documentation
1145                                  */
1146     XDM_MEMTYPE_TILED8 = 1,     /**< @todo  add documentation */
1147     XDM_MEMTYPE_TILED16 = 2,    /**< @todo  add documentation */
1148     XDM_MEMTYPE_TILED32 = 3,    /**< @todo  add documentation */
1149     XDM_MEMTYPE_TILEDPAGE = 4   /**< @todo  add documentation */
1150 } XDM_MemoryType;
1153 /**
1154  *  @brief      Memory space attributes
1155  *
1156  *  @enumWarning
1157  */
1158  typedef enum {
1159     XDM_MEMUSAGE_DATASYNC = 0     /**< Bit 0 - Data Sync mode
1160                                    *
1161                                    *  @remarks  If this bit is set,
1162                                    *            the memory will be
1163                                    *            used in data sync mode.
1164                                    *
1165                                    *  @remarks  When in data sync mode, the
1166                                    *            algorithm is responsible for
1167                                    *            ensuring any XDAIS rules are
1168                                    *            met for the buffer (e.g.
1169                                    *            managing cache coherency).
1170                                    *
1171                                    *  @remarks  If an algorithm is running in
1172                                    *            mode other than data sync, and
1173                                    *            receives a buffer with this
1174                                    *            bit set, it should return an
1175                                    *            error, likely
1176                                    *            #XDM_UNSUPPORTEDINPUT.
1177                                    */
1178 } XDM_MemoryUsageMode;
1181 /**
1182  *  @brief          Descriptor for the chunk of data being
1183  *                  transferred in one call to putData or getData
1184  */
1185 typedef struct XDM_DataSyncDesc {
1186     XDAS_Int32 size;            /**< @sizeField */
1187     XDAS_Int32 scatteredBlocksFlag; /**< Flag indicating whether the
1188                                  *   individual data blocks may
1189                                  *   be scattered in memory.
1190                                  *
1191                                  *   @remarks   Note that each individual
1192                                  *              block must be physically
1193                                  *              contiguous.
1194                                  *
1195                                  *   @remarks   Valid values are XDAS_TRUE
1196                                  *              and XDAS_FALSE.
1197                                  *
1198                                  *   @remarks   If set to XDAS_FALSE, the
1199                                  *              @c baseAddr field points
1200                                  *              directly to the start of the
1201                                  *              first block, and is not treated
1202                                  *              as a pointer to an array.
1203                                  *
1204                                  *   @remarks   If set to XDAS_TRUE, the
1205                                  *              @c baseAddr array must
1206                                  *              contain the base address of
1207                                  *              each individual block.
1208                                  */
1209     XDAS_Int32 *baseAddr;       /**< Base address of single data block or
1210                                  *              pointer to an array of
1211                                  *              data block addresses of
1212                                  *              size @c numBlocks.
1213                                  *
1214                                  *   @remarks   If @c scatteredBlocksFlag is
1215                                  *              set to XDAS_FALSE, this
1216                                  *              field points
1217                                  *              directly to the start of the
1218                                  *              first block, and is not treated
1219                                  *              as a pointer to an array.
1220                                  *
1221                                  *   @remarks   If @c scatteredBlocksFlag is
1222                                  *              set to XDAS_TRUE, this
1223                                  *              field points to an array of
1224                                  *              pointers to the data blocks.
1225                                  */
1226     XDAS_Int32 numBlocks;       /**< Number of blocks available */
1227     XDAS_Int32 varBlockSizesFlag; /**< Flag indicating whether any of the
1228                                  *   data blocks vary in size.
1229                                  *
1230                                  *   @remarks   Valid values are XDAS_TRUE
1231                                  *              and XDAS_FALSE.
1232                                  */
1233     XDAS_Int32 *blockSizes;     /**< Variable block sizes array.
1234                                  *
1235                                  *  @remarks     If @c varBlockSizesFlag is
1236                                  *               XDAS_TRUE, this array
1237                                  *               contains the sizes of each
1238                                  *               block.  If @c varBlockSizesFlag
1239                                  *               is XDAS_FALSE, this contains
1240                                  *               the size of same-size blocks.
1241                                  *
1242                                  *   @remarks    Memory for this array
1243                                  *               (of size @c numBlocks) has
1244                                  *               to be allocated by the
1245                                  *               caller of the putData API.
1246                                  */
1247 } XDM_DataSyncDesc;
1250 /**
1251  *  @brief          Handle that identifies the DataSync FIFO.
1252  *
1253  *  @sa XDM_DataSyncPutFxn()
1254  *  @sa XDM_DataSyncGetFxn()
1255  *  @sa XDM_DataSyncGetBufferFxn()
1256  *  @sa XDM_DataSyncPutBufferFxn()
1257  */
1258 typedef Void * XDM_DataSyncHandle;
1261 /**
1262  *  @brief      Non-blocking API to signal "data ready" to one or more
1263  *              consumers.
1264  *
1265  *  @param[in]  dataSyncHandle  Handle to a data sync instance.
1266  *  @param[out] dataSyncDesc    Full data sync descriptor.  This includes one
1267  *                              or more filled data buffers.
1268  *
1269  *
1270  *  @todo       Needs review
1271  *
1272  *  @sa IVIDDEC3_DynamicParams::putDataFxn()
1273  *  @sa IVIDENC2_DynamicParams::putDataFxn()
1274  *  @sa IVIDENC2_DynamicParams::getBufferFxn()
1275  *  @sa XDM_DataSyncGetBufferFxn
1276  */
1277 typedef Void (*XDM_DataSyncPutFxn)(XDM_DataSyncHandle dataSyncHandle,
1278         XDM_DataSyncDesc *dataSyncDesc);
1280 /**
1281  *  @brief          API to obtain data information from a consumer.
1282  *
1283  *  @param[in]  dataSyncHandle  Handle to a data sync instance.
1284  *  @param[out] dataSyncDesc    Empty data sync descriptor to be filled by
1285  *                              the producer.  Only the @c size field must
1286  *                              be initialized by the caller.
1287  *
1288  *  @post       Upon return, the @c dataSyncDesc will contain details about
1289  *              the provided data.
1290  *
1291  *  @remarks    Given that this is an input buffer, the implementation of this
1292  *              fxn must make the provided external or shared memory coherent
1293  *              with respect to the algorithm processor's cache.
1294  *
1295  *  @todo       Needs review
1296  *
1297  *  @sa IVIDDEC3_DynamicParams::getDataFxn()
1298  *  @sa IVIDDEC3_DynamicParams::putBufferFxn()
1299  *  @sa IVIDENC2_DynamicParams::getDataFxn()
1300  *  @sa XDM_DataSyncPutBufferFxn
1301  */
1302 typedef XDAS_Int32 (*XDM_DataSyncGetFxn)(XDM_DataSyncHandle dataSyncHandle,
1303         XDM_DataSyncDesc *dataSyncDesc);
1305 /**
1306  *  @brief      API to obtain empty bitstream buffers from an allocator
1307  *              to be filled by the algorithm.
1308  *
1309  *  @param[in]  dataSyncHandle  Handle to a data sync instance.
1310  *  @param[out] dataSyncDesc    Empty data sync descriptor to be filled by
1311  *                              the allocator.  Only the @c size field must
1312  *                              be initialized by the caller.
1313  *
1314  *  @post       Upon return, the @c dataSyncDesc will contain details about
1315  *              the allocated buffer(s).
1316  *
1317  *  @remarks    Given that this is an output buffer, the implementation of this
1318  *              fxn (i.e., the allocator) must make the provided external or
1319  *              shared memory coherent with respect to the algorithm
1320  *              processor's cache.  This typically implies it must be cache
1321  *              invalidated since the alg may fill this buffer via DMA.
1322  *
1323  *  @remarks    The allocator may not zero-initialize this buffer.  If the
1324  *              allocator <i>does</i> initialize the buffer, it must ensure the
1325  *              cache coherency via writeback-invalidate.
1326  *
1327  *  @retval     XDM_EOK            Allocator is able to provide the buffer or
1328  *                                 is not able to provide the buffer but
1329  *                                 indicates that it can provide the buffers
1330  *                                 in future such calls.
1331  *  @retval     XDM_EFAIL          Allocator is unable to provide the buffer
1332  *                                 and it will not be able to provide the
1333  *                                 buffer in the future.
1334  *
1335  *  @sa IVIDENC2_DynamicParams::putDataFxn()
1336  *  @sa IVIDENC2_Fxns::process()
1337  */
1338 typedef XDAS_Int32 (*XDM_DataSyncGetBufferFxn)(XDM_DataSyncHandle dataSyncHandle,
1339         XDM_DataSyncDesc *dataSyncDesc);
1342 /**
1343  *  @brief      API to return consumed bitstream buffers to the original
1344  *              provider.
1345  *
1346  *  @param[in]  dataSyncHandle  Handle to a data sync instance.
1347  *  @param[out] dataSyncDesc    Data sync descriptor.
1348  *
1349  *  @todo       What cache coherency responsibilities are placed on this
1350  *              buffer?
1351  *
1352  *  @todo       Needs review and further detail
1353  *
1354  *  @sa IVIDDEC3_DynamicParams::getDataFxn()
1355  *  @sa IVIDDEC3_Fxns::process()
1356  */
1357 typedef XDAS_Int32 (*XDM_DataSyncPutBufferFxn)(XDM_DataSyncHandle dataSyncHandle,
1358         XDM_DataSyncDesc *dataSyncDesc);
1360 /*@}*/
1363 #ifdef __cplusplus
1365 #endif
1367 #endif  /* ti_xdais_dm_XDM_ */