aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPradeep Venkatasubbarao2013-11-15 05:05:01 -0600
committerPradeep Venkatasubbarao2013-12-03 01:26:09 -0600
commit9208d0f18664575c0a50420435c19c85ff9740dd (patch)
tree75f177ca0b42328ea1c8b7fd342970b7663e1ec6 /packages
parent31bb1282efc6e9afcfdc90ece237cfe156d4d853 (diff)
downloadrepo-libdce-9208d0f18664575c0a50420435c19c85ff9740dd.tar.gz
repo-libdce-9208d0f18664575c0a50420435c19c85ff9740dd.tar.xz
repo-libdce-9208d0f18664575c0a50420435c19c85ff9740dd.zip
Added VIDDEC2 interfaces for DSP codecs
This patch adds VIDDEC2 interfaces and libdce now supports both VIDDEC2 and VIDDEC3 interfaces. It initializes ipc based on the server name(IVA or DSP). Provisions are made to handle multiple instances of IPU and DSP codecs. Change-Id: Ie1869e626423a6250983711114dc9d0854022309 Signed-off-by: Pradeep Venkatasubbarao <pradeepv@ti.com>
Diffstat (limited to 'packages')
-rw-r--r--packages/codec_engine/Makefile.am1
-rw-r--r--packages/codec_engine/ti/sdo/ce/video2/viddec2.h399
-rw-r--r--packages/xdais/Makefile.am1
-rw-r--r--packages/xdais/ti/xdais/dm/ividdec2.h632
4 files changed, 1033 insertions, 0 deletions
diff --git a/packages/codec_engine/Makefile.am b/packages/codec_engine/Makefile.am
index 7a6c170..61e8d58 100644
--- a/packages/codec_engine/Makefile.am
+++ b/packages/codec_engine/Makefile.am
@@ -8,6 +8,7 @@ nobase_pkg_include_HEADERS = \
8 ti/sdo/ce/ServerDefs.h \ 8 ti/sdo/ce/ServerDefs.h \
9 ti/sdo/ce/video3/viddec3.h \ 9 ti/sdo/ce/video3/viddec3.h \
10 ti/sdo/ce/video2/videnc2.h \ 10 ti/sdo/ce/video2/videnc2.h \
11 ti/sdo/ce/video2/viddec2.h \
11 ti/sdo/ce/Server.h \ 12 ti/sdo/ce/Server.h \
12 ti/sdo/ce/skel.h \ 13 ti/sdo/ce/skel.h \
13 ti/sdo/ce/node/node.h \ 14 ti/sdo/ce/node/node.h \
diff --git a/packages/codec_engine/ti/sdo/ce/video2/viddec2.h b/packages/codec_engine/ti/sdo/ce/video2/viddec2.h
new file mode 100644
index 0000000..955c274
--- /dev/null
+++ b/packages/codec_engine/ti/sdo/ce/video2/viddec2.h
@@ -0,0 +1,399 @@
1/*
2 * Copyright 2013 by Texas Instruments Incorporated.
3 *
4 */
5
6/*
7 * Copyright (c) 2013, Texas Instruments Incorporated
8 * All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 *
14 * * Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 *
17 * * Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
20 *
21 * * Neither the name of Texas Instruments Incorporated nor the names of
22 * its contributors may be used to endorse or promote products derived
23 * from this software without specific prior written permission.
24 *
25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
27 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
29 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
32 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
33 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
34 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
35 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 *
37 */
38/*
39 * ======== viddec2.h ========
40 */
41/**
42 * @file ti/sdo/ce/video2/viddec2.h
43 *
44 * @brief The VIDDEC2 video decoder interface. Provides the user an
45 * interface to create and interact with XDAIS algorithms that are
46 * compliant with the XDM-defined IVIDDEC2 video decoder
47 * interface.
48 */
49/**
50 * @defgroup ti_sdo_ce_video2_VIDDEC2 VIDDEC2 - Video Decoder Interface
51 *
52 * This is the VIDDEC2 video decoder interface. Several of the data
53 * types in this API are specified by the XDM interface; please see
54 * the XDM documentation for those details.
55 */
56
57#ifndef ti_sdo_ce_video2_VIDDEC2_
58#define ti_sdo_ce_video2_VIDDEC2_
59
60#ifdef __cplusplus
61extern "C" {
62#endif
63
64#include <ti/xdais/dm/xdm.h>
65#include <ti/xdais/dm/ividdec2.h>
66
67#include <ti/sdo/ce/Engine.h>
68#include <ti/sdo/ce/visa.h>
69#include <ti/sdo/ce/skel.h>
70
71/** @ingroup ti_sdo_ce_video2_VIDDEC2 */
72/*@{*/
73
74typedef IVIDDEC2_Status VIDDEC2_Status; /**< @copydoc IVIDDEC2_Status */
75
76#define VIDDEC2_EOK IVIDDEC2_EOK /**< @copydoc IVIDDEC2_EOK */
77#define VIDDEC2_EFAIL IVIDDEC2_EFAIL /**< @copydoc IVIDDEC2_EFAIL */
78
79/**< @copydoc IVIDDEC2_EUNSUPPORTED */
80#define VIDDEC2_EUNSUPPORTED IVIDDEC2_EUNSUPPORTED
81
82#define VIDDEC2_ETIMEOUT VISA_ETIMEOUT /**< @copydoc VISA_ETIMEOUT */
83#define VIDDEC2_FOREVER VISA_FOREVER /**< @copydoc VISA_FOREVER */
84
85/**
86 * @brief The VISA type
87 */
88#define VIDDEC2_VISATYPE "ti.sdo.ce.video2.IVIDDEC2"
89
90/**
91 * @brief Name of stub functions. Use this name when registering the
92 * VIDDEC2_STUBS functions with Engine_addStubFxns.
93 *
94 * @sa Engine_addStubFxns
95 */
96#define VIDDEC2_STUBSNAME "VIDDEC2_STUBS"
97
98
99/**
100 * @brief Opaque handle to a VIDDEC2 codec.
101 */
102typedef VISA_Handle VIDDEC2_Handle;
103
104/**
105 * @brief This structure defines the parameters necessary to create an
106 * instance of a video decoder object.
107 */
108typedef struct IVIDDEC2_Params VIDDEC2_Params;
109
110/**
111 * @copydoc IVIDDEC2_InArgs
112 */
113typedef IVIDDEC2_InArgs VIDDEC2_InArgs;
114
115/**
116 * @copydoc IVIDDEC2_OutArgs
117 */
118typedef IVIDDEC2_OutArgs VIDDEC2_OutArgs;
119
120/**
121 * @copydoc IVIDDEC2_Cmd
122 */
123typedef IVIDDEC2_Cmd VIDDEC2_Cmd;
124
125/**
126 * @copydoc IVIDDEC2_DynamicParams
127 */
128typedef IVIDDEC2_DynamicParams VIDDEC2_DynamicParams;
129
130/** @cond INTERNAL */
131
132/**
133 * @brief An implementation of the skel interface; the skeleton side
134 * of the stubs.
135 */
136extern SKEL_Fxns VIDDEC2_SKEL;
137
138/**
139 * @brief Implementation of the IVIDDEC2 interface that is run remotely.
140 */
141extern IVIDDEC2_Fxns VIDDEC2_STUBS;
142
143/** @endcond */
144
145/**
146 * @brief Definition of IVIDDEC2 codec class configurable parameters
147 *
148 * @sa VISA_getCodecClassConfig()
149 */
150typedef struct IVIDDEC2_CodecClassConfig {
151 Bool manageInBufsCache [ XDM_MAX_IO_BUFFERS ];
152 Bool manageOutBufsCache [ XDM_MAX_IO_BUFFERS ];
153} IVIDDEC2_CodecClassConfig;
154
155
156/*
157 * ======== VIDDEC2_create ========
158 */
159/**
160 * @brief Create an instance of a video decoder algorithm.
161 *
162 * Instance handles must not be concurrently accessed by multiple threads;
163 * each thread must either obtain its own handle (via VIDDEC2_create()) or
164 * explicitly serialize access to a shared handle.
165 *
166 * @param[in] e Handle to an opened engine.
167 * @param[in] name String identifier of the type of video decoder
168 * to create.
169 * @param[in] params Creation parameters.
170 *
171 * @retval NULL An error has occurred.
172 * @retval non-NULL The handle to the newly created video decoder
173 * instance.
174 *
175 * @remarks @c params is optional. If it's not supplied, codec-specific
176 * default params will be used.
177 *
178 * @remark Depending on the configuration of the engine opened, this
179 * call may create a local or remote instance of the video
180 * decoder.
181 *
182 * @codecNameRemark
183 *
184 * @sa Engine_open()
185 * @sa VIDDEC2_delete()
186 */
187extern VIDDEC2_Handle VIDDEC2_create(Engine_Handle e, String name,
188 VIDDEC2_Params *params);
189
190
191/*
192 * ======== VIDDEC2_process ========
193 */
194/**
195 * @brief Execute the process() method in this instance of a video
196 * decoder algorithm.
197 *
198 * @param[in] handle Handle to a created video decoder instance.
199 * @param[in] inBufs A buffer descriptor containing input buffers.
200 * @param[out] outBufs A buffer descriptor containing output buffers.
201 * @param[in] inArgs Input Arguments.
202 * @param[out] outArgs Output Arguments.
203 *
204 * @pre @c handle is a valid (non-NULL) video decoder handle
205 * and the video decoder is in the created state.
206 *
207 * @retval #VIDDEC2_EOK Success.
208 * @retval #VIDDEC2_EFAIL Failure.
209 * @retval #VIDDEC2_EUNSUPPORTED Unsupported request.
210 *
211 * @remark Since the VIDDEC2 decoder contains support for asynchronous
212 * buffer submission and retrieval, this API becomes known as
213 * synchronous in nature.
214 *
215 * @remark This is a blocking call, and will return after the data
216 * has been decoded.
217 *
218 * @remark The buffers supplied to VIDDEC2_process() may have constraints
219 * put on them. For example, in dual-processor, shared memory
220 * architectures, where the codec is running on a remote
221 * processor, the buffers may need to be physically contiguous.
222 * Additionally, the remote processor may place restrictions on
223 * buffer alignment.
224 *
225 * @sa VIDDEC2_create()
226 * @sa VIDDEC2_delete()
227 * @sa VIDDEC2_control()
228 * @sa VIDDEC2_processAsync()
229 * @sa VIDDEC2_processWait()
230 * @sa IVIDDEC2_Fxns::process() - the reflected algorithm interface,
231 * which may contain further usage
232 * details.
233 */
234extern Int32 VIDDEC2_process(VIDDEC2_Handle handle, XDM1_BufDesc *inBufs,
235 XDM_BufDesc *outBufs, VIDDEC2_InArgs *inArgs, VIDDEC2_OutArgs *outArgs);
236
237
238/*
239 * ======== VIDDEC2_control ========
240 */
241/**
242 * @brief Execute the control() method in this instance of a video
243 * decoder algorithm.
244 *
245 * @param[in] handle Handle to a created video decoder instance.
246 * @param[in] id Command id for xDM control operation.
247 * @param[in] params Runtime control parameters used for decoding.
248 * @param[out] status Status info upon completion of decode operation.
249 *
250 * @pre @c handle is a valid (non-NULL) video decoder handle
251 * and the video decoder is in the created state.
252 *
253 * @retval #VIDDEC2_EOK Success.
254 * @retval #VIDDEC2_EFAIL Failure.
255 * @retval #VIDDEC2_EUNSUPPORTED Unsupported request.
256 *
257 * @remark This is a blocking call, and will return after the control
258 * command has been executed.
259 *
260 * @remark If an error is returned, @c status->extendedError may
261 * indicate further details about the error. See
262 * #VIDDEC2_Status::extendedError for details.
263 *
264 * @sa VIDDEC2_create()
265 * @sa VIDDEC2_delete()
266 * @sa IVIDDEC2_Fxns::process()
267 */
268extern Int32 VIDDEC2_control(VIDDEC2_Handle handle, VIDDEC2_Cmd id,
269 VIDDEC2_DynamicParams *params, VIDDEC2_Status *status);
270
271
272/*
273 * ======== VIDDEC2_delete ========
274 */
275/**
276 * @brief Delete the instance of a video decoder algorithm.
277 *
278 * @param[in] handle Handle to a created video decoder instance.
279 *
280 * @remark Depending on the configuration of the engine opened, this
281 * call may delete a local or remote instance of the video
282 * decoder.
283 *
284 * @pre @c handle is a valid (non-NULL) handle which is
285 * in the created state.
286 *
287 * @post All resources allocated as part of the VIDDEC2_create()
288 * operation (memory, DMA channels, etc.) are freed.
289 *
290 * @sa VIDDEC2_create()
291 */
292extern Void VIDDEC2_delete(VIDDEC2_Handle handle);
293
294
295/*
296 * ======== VIDDEC2_processAsync ========
297 */
298/**
299 * @brief Perform asynchronous submission to this instance of a video
300 * decoder algorithm.
301 *
302 * @param[in] handle Handle to a created video decoder instance.
303 * @param[in] inBufs A buffer descriptor containing input buffers.
304 * @param[out] outBufs A buffer descriptor containing output buffers.
305 * @param[in] inArgs Input Arguments.
306 * @param[out] outArgs Output Arguments.
307 *
308 * @pre @c handle is a valid (non-NULL) video decoder handle
309 * and the video decoder is in the created state.
310 *
311 * @retval #VIDDEC2_EOK Success.
312 * @retval #VIDDEC2_EFAIL Failure.
313 * @retval #VIDDEC2_EUNSUPPORTED Unsupported request.
314 *
315 * @remark This API is the asynchronous counterpart to the process()
316 * method. It allows for buffer and argument submission without
317 * waiting for retrieval. A response is retrieved using the
318 * VIDDEC2_processWait() API.
319 *
320 * @remark The buffers supplied to VIDDEC2_processAsync() may have
321 * constraints put on them. For example, in dual-processor,
322 * shared memory architectures, where the codec is running on a
323 * remote processor, the buffers may need to be physically
324 * contiguous. Additionally, the remote processor may place
325 * restrictions on buffer alignment.
326 *
327 * @sa VIDDEC2_create()
328 * @sa VIDDEC2_delete()
329 * @sa VIDDEC2_control()
330 * @sa VIDDEC2_process()
331 * @sa VIDDEC2_processWait()
332 * @sa IVIDDEC2_Fxns::process()
333 */
334extern XDAS_Int32 VIDDEC2_processAsync(VIDDEC2_Handle handle,
335 XDM1_BufDesc *inBufs, XDM_BufDesc *outBufs,
336 VIDDEC2_InArgs *inArgs, VIDDEC2_OutArgs *outArgs);
337
338
339/*
340 * ======== VIDDEC2_processWait ========
341 */
342/**
343 * @brief Wait for a return message from a previous invocation of
344 * VIDDEC2_processAsync() in this instance of an video decoder
345 * algorithm.
346 *
347 * @param[in] handle Handle to a created video decoder instance.
348 * @param[in] inBufs A buffer descriptor containing input buffers.
349 * @param[out] outBufs A buffer descriptor containing output buffers.
350 * @param[in] inArgs Input Arguments.
351 * @param[out] outArgs Output Arguments.
352 * @param[in] timeout Amount of "time" to wait (from 0 -> VIDDEC2_FOREVER)
353 *
354 * @pre @c handle is a valid (non-NULL) video decoder handle
355 * and the video decoder is in the created state.
356 *
357 * @retval #VIDDEC2_EOK Success.
358 * @retval #VIDDEC2_EFAIL Failure.
359 * @retval #VIDDEC2_EUNSUPPORTED Unsupported request.
360 * @retval #VIDDEC2_ETIMEOUT Operation timed out.
361 *
362 * @remark This is a blocking call, and will return after the data
363 * has been decoded.
364 *
365 * @remark "Polling" is supported by using a timeout of 0. Waiting
366 * forever is supported by using a timeout of VIDDEC2_EFOREVER.
367 *
368 * @remark There must have previously been an invocation of the
369 * VIDDEC2_processAsync() API.
370 *
371 * @remark The buffers supplied to VIDDEC2_processAsync() may have
372 * constraints put on them. For example, in dual-processor,
373 * shared memory architectures, where the codec is running on a
374 * remote processor, the buffers may need to be physically
375 * contiguous. Additionally, the remote processor may place
376 * restrictions on buffer alignment.
377 *
378 * @sa VIDDEC2_create()
379 * @sa VIDDEC2_delete()
380 * @sa VIDDEC2_control()
381 * @sa VIDDEC2_process()
382 * @sa VIDDEC2_processAsync()
383 */
384extern XDAS_Int32 VIDDEC2_processWait(VIDDEC2_Handle handle,
385 XDM1_BufDesc *inBufs, XDM_BufDesc *outBufs,
386 VIDDEC2_InArgs *inArgs, VIDDEC2_OutArgs *outArgs, UInt timeout);
387
388
389/*@}*/
390
391#ifdef __cplusplus
392}
393#endif
394
395#endif
396/*
397 * @(#) ti.sdo.ce.video2; 1, 0, 3,3; 6-13-2013 00:20:38; /db/atree/library/trees/ce/ce-w08/src/ xlibrary
398
399 */
diff --git a/packages/xdais/Makefile.am b/packages/xdais/Makefile.am
index 6aac227..0c5d9cc 100644
--- a/packages/xdais/Makefile.am
+++ b/packages/xdais/Makefile.am
@@ -4,6 +4,7 @@ pkg_includedir = $(includedir)/dce
4 4
5nobase_pkg_include_HEADERS = \ 5nobase_pkg_include_HEADERS = \
6 ti/xdais/dm/ividenc2.h \ 6 ti/xdais/dm/ividenc2.h \
7 ti/xdais/dm/ividdec2.h \
7 ti/xdais/dm/ividdec3.h \ 8 ti/xdais/dm/ividdec3.h \
8 ti/xdais/dm/ivideo.h \ 9 ti/xdais/dm/ivideo.h \
9 ti/xdais/dm/xdm.h \ 10 ti/xdais/dm/xdm.h \
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
56extern "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 */
82typedef struct IVIDDEC2_Obj {
83 struct IVIDDEC2_Fxns *fxns;
84} IVIDDEC2_Obj;
85
86
87/**
88 * @brief Opaque handle to an IVIDDEC2 object
89 */
90typedef 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 */
100typedef 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 */
142typedef 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 */
180typedef 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 */
230typedef 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 */
267typedef 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 */
328typedef 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 */
467typedef IALG_Cmd IVIDDEC2_Cmd;
468
469
470/**
471 * @brief Defines all of the operations on IVIDDEC2 objects
472 */
473typedef 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_ */