aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.txt30
-rw-r--r--packages/codec_engine/ti/sdo/ce/Engine.h1584
-rw-r--r--packages/codec_engine/ti/sdo/ce/Server.h761
-rw-r--r--packages/codec_engine/ti/sdo/ce/ServerDefs.h76
-rw-r--r--packages/codec_engine/ti/sdo/ce/ipc/Comm.h235
-rw-r--r--packages/codec_engine/ti/sdo/ce/node/node.h209
-rw-r--r--packages/codec_engine/ti/sdo/ce/skel.h137
-rw-r--r--packages/codec_engine/ti/sdo/ce/video2/videnc2.h401
-rw-r--r--packages/codec_engine/ti/sdo/ce/video3/viddec3.h396
-rw-r--r--packages/codec_engine/ti/sdo/ce/visa.h690
-rw-r--r--packages/ivahd_codecs/ti/sdo/codecs/h264enc/ih264enc.h3503
-rw-r--r--packages/ivahd_codecs/ti/sdo/codecs/h264svcenc/ih264svcenc.h295
-rw-r--r--packages/ivahd_codecs/ti/sdo/codecs/h264svcvdec/ih264svcvdec.h443
-rwxr-xr-xpackages/ivahd_codecs/ti/sdo/codecs/h264vdec/ih264vdec.h2692
-rw-r--r--packages/ivahd_codecs/ti/sdo/codecs/jpegvdec/ijpegvdec.h587
-rw-r--r--packages/ivahd_codecs/ti/sdo/codecs/mpeg2vdec/impeg2vdec.h509
-rw-r--r--packages/ivahd_codecs/ti/sdo/codecs/mpeg4enc/impeg4enc.h1275
-rwxr-xr-xpackages/ivahd_codecs/ti/sdo/codecs/mpeg4vdec/impeg4vdec.h1064
-rw-r--r--packages/ivahd_codecs/ti/sdo/codecs/vc1enc/ivc1enc.h996
-rw-r--r--packages/ivahd_codecs/ti/sdo/codecs/vc1vdec/ivc1vdec.h734
-rwxr-xr-xpackages/xdais/ti/xdais/dm/ividdec3.h1011
-rwxr-xr-xpackages/xdais/ti/xdais/dm/ividenc2.h937
-rwxr-xr-xpackages/xdais/ti/xdais/dm/ivideo.h829
-rwxr-xr-xpackages/xdais/ti/xdais/dm/xdm.h1367
-rwxr-xr-xpackages/xdais/ti/xdais/ialg.h762
-rwxr-xr-xpackages/xdais/ti/xdais/xdas.h79
-rw-r--r--packages/xdctools/google/targets/arm/std.h42
-rw-r--r--packages/xdctools/google/targets/std.h78
-rw-r--r--packages/xdctools/qnx/targets/arm/std.h42
-rw-r--r--packages/xdctools/xdc/std.h354
30 files changed, 22114 insertions, 4 deletions
diff --git a/README.txt b/README.txt
index 05996e8..1979601 100644
--- a/README.txt
+++ b/README.txt
@@ -1,4 +1,6 @@
1## Building LIBDCE for QNX ## 1************** LIBDCE Build **************
2
3## For QNX ##
2 4
3Exporting QNX variables: 5Exporting QNX variables:
4export QNX_ROOT=/opt/qnx650 6export QNX_ROOT=/opt/qnx650
@@ -13,6 +15,7 @@ export QNX_USERNAME=<registered email-id at QNX> //not important
13eval `qconfig -n "QNX Software Development Platform 6.5.0" -e` 15eval `qconfig -n "QNX Software Development Platform 6.5.0" -e`
14 16
15If previous eval doesn't work, that is it doesn't output: 17If previous eval doesn't work, that is it doesn't output:
18"
16export QNX_HOST="/opt/qnx650/host/linux/x86"; 19export QNX_HOST="/opt/qnx650/host/linux/x86";
17export QNX_TARGET="/opt/qnx650/target/qnx6"; 20export QNX_TARGET="/opt/qnx650/target/qnx6";
18export PATH="/opt/qnx650/host/linux/x86/usr/bin:/opt/qnx650/host/linux/x86/bin:/opt/qnx650/host/ 21export PATH="/opt/qnx650/host/linux/x86/usr/bin:/opt/qnx650/host/linux/x86/bin:/opt/qnx650/host/
@@ -21,16 +24,14 @@ export PATH="/opt/qnx650/host/linux/x86/usr/bin:/opt/qnx650/host/linux/x86/bin:/
21 /opt/qnx650:/etc/qnx/bin:/etc/qnx/bin:/etc/qnx/bin:/etc/qnx/bin"; 24 /opt/qnx650:/etc/qnx/bin:/etc/qnx/bin:/etc/qnx/bin:/etc/qnx/bin";
22export LD_LIBRARY_PATH="/opt/qnx650/host/linux/x86/usr/lib"; 25export LD_LIBRARY_PATH="/opt/qnx650/host/linux/x86/usr/lib";
23export MAKEFLAGS="-I/opt/qnx650/target/qnx6/usr/include"; 26export MAKEFLAGS="-I/opt/qnx650/target/qnx6/usr/include";
27"
24 28
25then try : /opt/qnx650/host/linux/x86/usr/bin/qconfig -n "QNX Software Development Platform 6.5.0" -e 29then try : /opt/qnx650/host/linux/x86/usr/bin/qconfig -n "QNX Software Development Platform 6.5.0" -e
26 30
27Exporting LIBDCE variables: 31Exporting LIBDCE variables:
28export TITOOLSROOT=<path to XDC, XDAIS>
29export TIVIDEOTOOLSROOT=<path to CE, FC>
30export IPCHEADERS=<path to IPC Headers> 32export IPCHEADERS=<path to IPC Headers>
31export INSTALL_ROOT=<path for copying output binaries> 33export INSTALL_ROOT=<path for copying output binaries>
32export QCONF_OVERRIDE=<absolute path to libdce/nto/qconf-override.mk> 34export QCONF_OVERRIDE=<absolute path to libdce/nto/qconf-override.mk>
33export IVAHDCODECS=<path to ipumm/extrel/ti/ivahd_codecs>
34 35
35For IPCHEADERS - Headers should be at: 36For IPCHEADERS - Headers should be at:
36$(IPCHEADERS)/usr/include/memmgr 37$(IPCHEADERS)/usr/include/memmgr
@@ -49,3 +50,24 @@ Location of Binaries:
49INSTALL_ROOT/armle-v7/usr/lib/libdce.so 50INSTALL_ROOT/armle-v7/usr/lib/libdce.so
50INSTALL_ROOT/armle-v7/usr/lib/libdce.so.1 51INSTALL_ROOT/armle-v7/usr/lib/libdce.so.1
51INSTALL_ROOT/armle-v7/bin/dce_test 52INSTALL_ROOT/armle-v7/bin/dce_test
53INSTALL_ROOT/armle-v7/bin/dce_enc_test
54
55
56**** Version Info of Headers included in packages folder ****
57
58Tools:
59XDC version : xdctools_3_25_02_70
60CE version : codec_engine_3_24_00_08
61XDAIS version: xdais_7_24_00_04
62
63IVAHD_Codecs:
64H.264 Dec : 02.00.13.00
65MJPEG Dec : 01.00.11.01
66MPEG-4 Dec : 01.00.13.00
67VC-1 Dec : 01.00.00.11
68MPEG-2 Dec : 01.00.12.00
69SVC Dec : 00.06.00.00
70H.264 Enc : 02.00.06.01
71MJPEG Enc : 01.00.02.01
72SVC Enc : 00.02.00.05
73
diff --git a/packages/codec_engine/ti/sdo/ce/Engine.h b/packages/codec_engine/ti/sdo/ce/Engine.h
new file mode 100644
index 0000000..936c61f
--- /dev/null
+++ b/packages/codec_engine/ti/sdo/ce/Engine.h
@@ -0,0 +1,1584 @@
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 * ======== Engine.h ========
40 */
41
42/**
43 * @file ti/sdo/ce/Engine.h
44 *
45 * @brief The Codec Engine Runtime.
46 *
47 * @remarks Provides the user an interface to
48 * open and manipulate an Engine which can instantiate
49 * and communicate with XDAIS algorithms that run either
50 * on the local CPU or on a "remote" Server.
51 */
52/**
53 * @addtogroup CODECENGINE Codec Engine Runtime
54 */
55
56#ifndef Engine_
57#define Engine_
58
59#ifdef __cplusplus
60extern "C" {
61#endif
62
63
64#include <ti/sdo/ce/ServerDefs.h>
65#include <ti/sdo/ce/ipc/Comm.h>
66#include <ti/xdais/ialg.h>
67#include <ti/sdo/ce/node/node.h>
68
69#include <stddef.h> /* def of size_t */
70#include <stdio.h> /* def of FILE * */
71
72/** @ingroup CODECENGINE */
73/*@{*/
74
75/**
76 * @brief Name to pass to Diags_setMask() to enable logging for Engine
77 * functions.
78 *
79 * @par Example Usage:
80 * The following code turns on all Log statements in the Engine
81 * module.
82 * @code
83 * Diags_setMask(Engine_MODNAME "+EX1234567");
84 * @endcode
85 *
86 * @remarks Using Diags_setMask() to enable Engine Logging must be called
87 * after CERuntime_init() (which creates and initializes the
88 * Engine trace mask) to have any effect.
89 */
90#define Engine_MODNAME "ti.sdo.ce.Engine"
91
92/**
93 * @brief Opaque handle to an engine.
94 */
95typedef struct Engine_Obj *Engine_Handle;
96
97/**
98 * @brief Engine error code
99 */
100typedef Int Engine_Error;
101
102#define Engine_EOK 0 /**< Success. */
103#define Engine_EEXIST 1 /**< Name does not exist. */
104#define Engine_ENOMEM 2 /**< Unable to allocate memory. */
105#define Engine_EDSPLOAD 3 /**< Unable to load the DSP. */
106#define Engine_ENOCOMM 4 /**< Unable to create a comm connection to
107 * the DSP.
108 */
109#define Engine_ENOSERVER 5 /**< Unable to locate the server on the DSP. */
110#define Engine_ECOMALLOC 6 /**< Unable to allocate communication buffer. */
111#define Engine_ERUNTIME 7 /**< Internal engine runtime failure. */
112#define Engine_ECODECCREATE 8 /**< Creation of the Codec failed. */
113#define Engine_ECODECSTART 9 /**< Start of the Codec failed. For codecs
114 * which are implemented as a thread, this
115 * implies that the codec thread of execution
116 * failed to start.
117 */
118#define Engine_EINVAL 10 /**< Bad paramater passed to method. */
119#define Engine_EBADSERVER 11 /**< Incompatible server specified. */
120#define Engine_ENOTAVAIL 12 /**< Service not available. */
121#define Engine_EWRONGSTATE 13 /**< Call can not be made at this time. */
122#define Engine_EINUSE 14 /**< Call can't be made at this time because
123 * a required name/resource is in use.
124 */
125#define Engine_ENOTFOUND 15 /**< Entity was not found. */
126#define Engine_ETIMEOUT 16 /**< Timeout-based operation timed out. */
127
128/** @cond INTERNAL */
129
130/**
131 * @brief Opaque handle to a node.
132 */
133typedef struct Engine_NodeObj *Engine_Node;
134
135/**
136 * @brief Special value for timeout parameter of Engine_callWait()
137 */
138#define Engine_FOREVER Comm_FOREVER
139
140/** @endcond */
141
142/**
143 * @brief Attributes of an Engine
144 *
145 * @sa Engine_initAttrs().
146 * @sa Engine_open().
147 */
148typedef struct Engine_Attrs {
149 String procId; /**< id of the processor that runs the server; only
150 * needed in the case that there's more than one
151 * processor that can provide the same server.
152 */
153} Engine_Attrs;
154
155/**
156 * @brief Properties of an Engine algorithm
157 *
158 * @sa Engine_getAlgInfo()
159 */
160typedef struct Engine_AlgInfo {
161 Int algInfoSize; /**< Size of this structure. */
162 String name; /**< Name of algorithm. */
163 String *typeTab; /**< Inheritance hierarchy. */
164 Bool isLocal; /**< If TRUE, run locally. */
165} Engine_AlgInfo;
166
167/**
168 * @brief Properties of an Engine algorithm.
169 *
170 * @remarks This structure is identical to Engine_AlgInfo except that the
171 * @c typeTab array of strings is replaced by a single string
172 * called @c types. The string, @c types, represents a ';'
173 * separated list of inheritance hierarchies of the algorithm,
174 * for example,
175 * "ti.sdo.ce.video.IVIDDEC;ti.sdo.ce.test.xvideo.IVIDE".
176 *
177 * @sa Engine_getAlgInfo2()
178 */
179typedef struct Engine_AlgInfo2 {
180 Int algInfoSize; /**< Size of this structure. */
181 String name; /**< Name of algorithm. */
182 String types; /**< Inheritance hierarchy. */
183 Bool isLocal; /**< If TRUE, run locally. */
184} Engine_AlgInfo2;
185
186/**
187 * @brief Default engine attributes.
188 *
189 * @deprecated Engine_ATTRS is no longer recommended. Please use
190 * Engine_initAttrs() instead.
191 *
192 * @sa Engine_initAttrs()
193 */
194extern Engine_Attrs Engine_ATTRS; /**< Default attrs. */
195
196/** @cond INTERNAL */
197
198typedef Int Engine_Ctrl;
199
200#define Engine_CEXIT 0
201#define Engine_MAXSEGNAMELENGTH 32
202
203/** @endcond */
204
205/**
206 * @brief Engine Cacheable Memory types.
207 *
208 * @enumWarning
209 */
210typedef enum Engine_CachedMemType {
211 Engine_USECACHEDMEM_DEFAULT = -1, /**< Use default cache setting */
212 Engine_USECACHEDMEM_NONCACHED = 0, /**< Use non-cached memory */
213 Engine_USECACHEDMEM_CACHED = 1 /**< Use cached memory */
214} Engine_CachedMemType;
215
216
217/*
218 * ======== Engine_AlgDesc ========
219 */
220/**
221 * @brief Descriptor for an alg. This object can be passed to
222 * @c Engine_addAlg(), to dynamically add an alg to an engine.
223 *
224 * @sa Engine_initAlgDesc()
225 * @sa Engine_addAlg()
226 */
227typedef struct Engine_AlgDesc {
228 /**
229 * @brief The name of the algorithm. This is used by the application
230 * when instantiating an instance of the algorithm through one
231 * of the VISA APIs.
232 */
233 String name;
234
235 NODE_Uuid uuid; /**< Id of alg if running on remote target. No need
236 * to set this field.
237 */
238
239 /**
240 * @brief The address of the XDAIS alg function table.
241 * All XDAIS algorithms must define an IALG_Fxns structure that
242 * contains implementations of the IALG methods. This field
243 * is simply the address of this structure.
244 */
245 IALG_Fxns *fxns;
246
247 /**
248 * @brief The address of the IDMA3_Fxns function table, if the algorithm
249 * uses DMA. If the algorithm does not use DMA, this field should
250 * set to NULL.
251 * @idmaDeprecated
252 */
253 Ptr idmaFxns;
254
255 String *typeTab; /**< inheritance hierarchy - Do not modify. */
256
257 /**
258 * @brief If true, the algorithm will be instantiated on the
259 * "local" CPU. Otherwise the server will create an
260 * instance of the algorithm.
261 */
262 Bool isLocal;
263
264 /**
265 * @brief This id specifies which resource sharing group that this
266 * alg will be placed into. This 'group' concept
267 * is used by the framework to ensure algorithms in the
268 * same group don't pre-empt each other and corrupt the
269 * shared resources.
270 * This parameter will be ignored if @c isLocal is FALSE.
271 */
272 Int groupId;
273
274 Int rpcProtocolVersion; /**< Protocol version. Do not modify */
275
276 /**
277 * @brief Address of the XDAIS alg IRES Interface function table
278 * All XDAIS algorithms that use an IRES resource must define an
279 * IRES_Fxns structure containing the pointers to functions
280 * implementatng the IRES interface.
281 * If the algorithm does not use an IRES resource this field
282 * should be set to NULL.
283 */
284 Ptr iresFxns;
285
286 /**
287 * @brief Codec class configuration data, if any.
288 */
289 Void *codecClassConfig;
290
291 /**
292 * @brief Indicates the type of memory the alg's memory requests will
293 * be allocated from.
294 * The alg's memory will be allocated from cached memory, if
295 * memType = Engine_USECACHEDMEM_CACHED,
296 * from non-cached memory, if
297 * memType = Engine_USECACHEDMEM_NONCACHED,
298 * Otherwise, if
299 * memType = Engine_USECACHEDMEM_DEFAULT,
300 * memory allocations will be determined by the value of
301 * ti_sdo_ce_alg_Algorithm_useCache (cached, if TRUE, non-cached,
302 * if FALSE).
303 *
304 * @sa Engine_CachedMemType
305 */
306 Engine_CachedMemType memType; /**< Memory type for alg's mem reqs. */
307
308 /**
309 * @brief A string idicating the type(s) of algorithm this is.
310 * This should be a ';' separated string of inherited types.
311 * In most cases, @c types will just be set to the VISA type
312 * defined in the Codec Engine algorithm interface header
313 * file included by the algorithm, depending on the XDM interface
314 * the algorithm implements.
315 *
316 * For example, if the algorithm implements the ISPHDEC1
317 * interface as defined by XDM, @c types should be set
318 * to
319 * @c SPHDEC1_VISATYPE
320 * (defined as "ti.sdo.ce.speech1.ISPHDEC1" in the header file
321 * ti/sdo/ce/speech1/sphdec1.h).
322 *
323 * Another example to illustrate multiple typss specified in
324 * @c typss, if the algorithm implements the (made-up)
325 * interface, ti.sdo.ce.test.xvideo.IVIDE, which in turn
326 * implements the IVIDDEC interface, we could then set @c types
327 * to
328 * VIDDEC_VISATYPE";ti.sdo.ce.test.xvideo.IVIDE"
329 * or
330 * "ti.sdo.ce.test.xvideo.IVIDE;"VIDDEC_VISATYPE
331 */
332 String types;
333} Engine_AlgDesc;
334
335
336/**
337 * @brief Name of function that a dynamically loaded codec must supply.
338 */
339#define Engine_GETALGDESCFXN "GetEngineAlgDesc"
340
341/*
342 * ======== Engine_DllAlgDesc ========
343 * An alg that will be dynamically loaded must have a descriptor of this type.
344 */
345/**
346 * @brief Descriptor for a dynamically loaded alg. A dynamic library
347 * for a codec must export a function that fills in a structure
348 * of this type.
349 *
350 * @sa Engine_GetAlgDescFxn
351 */
352typedef struct Engine_DllAlgDesc {
353 /**
354 * @brief Pointer to codec's IALG_Fxns. This can not be NULL.
355 */
356 IALG_Fxns *fxns;
357
358 /**
359 * @brief Pointer to codec's IDMA3_Fxns table. If the codec does not
360 * use DMA, this should be NULL.
361 */
362 Ptr idmaFxns;
363
364 /**
365 * @brief Pointer to codec's IRES_Fxns function table. This should be
366 * NULL if the codec does not implement the IRES_Fxns.
367 */
368 Ptr iresFxns;
369
370 /**
371 * @brief Inheritance hierarchy of codec. This is a ';' separated
372 * string that lists the interfaces inherited by the code. For
373 * example:
374 *
375 * "ti.sdo.ce.speech1.ISPHDEC1"
376 *
377 * or, in the case where a test IVIDE interface inherits IVIDDEC:
378 *
379 * "ti.sdo.ce.video.IVIDDEC;ti.sdo.ce.test.xvideo.IVIDE"
380 *
381 */
382 String types;
383
384 /**
385 * @brief codec class config data, if any.
386 *
387 * @todo Figure out what this is.
388 */
389 Void *codecClassConfig;
390} Engine_DllAlgDesc;
391
392
393/*
394 * ======== Engine_GetAlgDescFxn ========
395 * A dynamically loaded codec library must supply a function of this type to
396 * get properties of the library's algorithm.
397 */
398/**
399 * @brief Prototype of function that must be supplied by a dynamic
400 * codec library to fill in a @c Engine_DllAlgDesc structure.
401 *
402 * @remarks This function will be called by @c Engine_addAlg() to fill
403 * in the dynamic codec's descriptor.
404 *
405 * @sa Engine_DllAlgDesc
406 */
407typedef Int (*Engine_GetAlgDescFxn)(Engine_DllAlgDesc *dllAlgDesc);
408
409
410/*
411 * ======== Engine_Desc ========
412 */
413/**
414 * @brief This structure is passed to @c Engine_add(), and contains
415 * parameters to specify an engine.
416 *
417 * @sa Engine_add()
418 * @sa Engine_open()
419 */
420typedef struct Engine_Desc {
421 String name; /**< Name of the Engine
422 *
423 * @remarks This must not be NULL
424 */
425 Engine_AlgDesc *algTab; /**< No longer used, set to NULL */
426 String remoteName; /**< Name of Server image, if applicable
427 *
428 * @remarks If this Engine has no remote
429 * algorithms, this can be NULL.
430 *
431 * @remarks On SysLink-based systems, this
432 * is the name of a file, and is
433 * passed unchanged to
434 * ProcMgr_load().
435 */
436 String memMap; /**< Name of a file containing the slave
437 * memory map
438 *
439 * @remarks If this Engine has no remote
440 * algorithms, this can be NULL.
441 *
442 * @remarks If the remote algorithms are
443 * on a Server whos MMU is not
444 * enabled, this can be NULL.
445 *
446 * @remarks The format of this file matches
447 * the SysLink format described at
448 * http://processors.wiki.ti.com/index.php/SysLink_MMU_Support
449 *
450 * @remarks If useExtLoader is FALSE, this
451 * field can be NULL.
452 */
453 Bool useExtLoader; /**< Indicates whether the Server containing
454 * any remote algorithms will be loaded using
455 * an external loader (e.g. SysLink's
456 * slaveloader)
457 *
458 * @remarks If @c useExtLoader is TRUE,
459 * Engine_open() will not load
460 * the slave.
461 *
462 * @remarks If @c useExtLoader is FALSE,
463 * Engine_open() will load the
464 * Server with the file specified
465 * by @c remoteName.
466 */
467 Int numAlgs; /**< No longer used, set to zero */
468 Int heapId; /**< No longer used, set to zero */
469} Engine_Desc;
470
471
472/** @cond INTERNAL */
473
474/*
475 * ======== Engine_AlgCreateAttrs ========
476 */
477typedef struct Engine_AlgCreateAttrs {
478 Bool useExtHeap; /**< Use a single external heap for alg's
479 * memory requests if TRUE, otherwise attempt
480 * to honor the alg's algAlloc() function for
481 * memory heap assignments.
482 */
483 Int priority; /**< Alg instance priority (-1: use value from
484 * configuration). */
485} Engine_AlgCreateAttrs;
486
487
488/*
489 * ======== Engine_Config ========
490 */
491typedef struct Engine_Config {
492 Engine_Desc *engineTab;
493 String localEngine;
494} Engine_Config;
495
496/*
497 * ======== Engine_MemStat ========
498 * This structure must match Server_MemStat.
499 */
500typedef struct Engine_MemStat {
501 Char name[Engine_MAXSEGNAMELENGTH + 1]; /* Name of memory segment */
502 Uint32 base; /* Base address of memory segment */
503 Uint32 size; /* Original size of the memory segment. */
504 Uint32 used; /* Number of bytes used. */
505 Uint32 maxBlockLen; /* Size of the largest contiguous free block. */
506} Engine_MemStat;
507
508/* Default alg create attributes */
509extern Engine_AlgCreateAttrs Engine_ALGCREATEATTRS;
510
511/*
512 * ======== Engine_config ========
513 */
514extern Engine_Config Engine_config;
515
516/** @endcond */
517
518
519/*
520 * ======== Engine_addStubFxns ========
521 */
522/**
523 * @brief Register stub functions through which a remote algorithm
524 * can be called
525 *
526 * @param[in] fxnsName The name of the stub function table (e.g.
527 * "UNIVERSAL_STUBS")
528 * @param[in] fxns Address of stub function table
529 * (e.g. &UNIVERSAL_STUBS)
530 *
531 * @pre As with all Codec Engine API's, CERuntime_init() must have
532 * previously been called.
533 *
534 * @remarks This service is not necessary if you configure your Engine
535 * at build/config time using Engine.createFromServer().
536 * When using Engine.createFromServer(), the appropriate
537 * alg-specific stubs are added to the system automatically.
538 *
539 * @remarks When on an RTOS (e.g. SYS/BIOS), the stubs registered are
540 * available to all Engines in the system. When on a HLOS
541 * (e.g. Linux, WinCE), the stubs registered are available to
542 * all Engines in the calling application's process.
543 *
544 * @remarks The symbol passed to the @c fxns argument can often be found
545 * in the class-specific VISA header file (e.g. UNIVERSAL_STUBS
546 * is declared in ti/sdo/ce/universal/universal.h).
547 *
548 * @remarks For example, to register "UNIVERSAL_STUBS" for use by an
549 * IUNIVERSAL-compliant algorithm at runtime, you can
550 * do the following:
551 * @code
552 * #include <ti/sdo/ce/Engine.h>
553 * #include <ti/sdo/ce/universal/universal.h>
554 *
555 * Engine_register("UNIVERSAL_STUBS",
556 * (IALG_Fxns *)&UNIVERSAL_STUBS);
557 * @endcode
558 *
559 * @retval Engine_EOK Success.
560 * @retval Engine_ENOMEM Memory allocation failed.
561 *
562 * @sa Engine_open()
563 */
564extern Engine_Error Engine_addStubFxns(String fxnsName, IALG_Fxns *fxns);
565
566/*
567 * ======== Engine_add ========
568 */
569/**
570 * @brief Add an Engine to the database of engines that can be opened with
571 * Engine_open()
572 *
573 * @param[in] pDesc The handle of an Engine Descriptor object.
574 * Before setting the fields of pDesc, it must
575 * first be initialized with @c Engine_initDesc().
576 *
577 * @retval Engine_EINVAL Bad parameter passed, such as @c pDesc = NULL,
578 * or @c pDesc->name = NULL.
579 * @retval Engine_EINUSE An engine with the name @c pDesc->name already
580 * exists.
581 * @retval Engine_ENOMEM A memory allocation failed.
582 * @retval Engine_EOK Success.
583 *
584 * @pre As with all Codec Engine API's, CERuntime_init() must have
585 * previously been called.
586 *
587 * @post If the return value is Engine_EOK, Engine_open() can be
588 * called with @c pDesc->name.
589 *
590 * @par Example Usage:
591 * @code
592 * #include <ti/sdo/ce/Engine.h>
593 *
594 * Engine_Desc desc;
595 *
596 * Engine_initDesc(&desc);
597 *
598 * desc.name = "myEngine";
599 * desc.remoteName = "myServer.x64P";
600 * Engine_add(&desc);
601 * @endcode
602 *
603 * @sa Engine_remove()
604 * @sa Engine_open()
605 */
606extern Engine_Error Engine_add(Engine_Desc *pDesc);
607
608/*
609 * ======== Engine_addAlg ========
610 */
611/**
612 * @brief Dynamically add an algorithm to an Engine.
613 *
614 * @remarks If the Engine has not been opened, the name of the Engine is
615 * used, otherwise, a handle to the opened Engine. If the Engine
616 * has been opened, the added alg will only be accessible to the
617 * caller of this function. Either one or the other, but not
618 * both, of @c name and @c engine should be non-NULL.
619 *
620 * @param[in] name The name of the engine. @c name is
621 * specified in the engine configuration, or
622 * the name of an engine added with
623 * @c Engine_add(). This can only be non-NULL if
624 * the engine is not opened, otherwise, use
625 * an engine handle and set @c name to NULL.
626 * @param[in] engine The handle of an engine returned by
627 * Engine_open(). If @c engine is non-NULL, set
628 * @c name to NULL.
629 * @param[in] location String identifying the location of the
630 * algorithm. Often this is a file name, but for
631 * systems without a file system, it may be a
632 * system-specific string identifier. This may
633 * be NULL if the algorithm is built into the
634 * executable.
635 * @param[in] pAlgDesc Parameters describing the algorithm being
636 * added. Before setting the fields of this
637 * structure, it should first be initialized
638 * with @c Engine_initAlgDesc(), to set all
639 * fields to default values.
640 * If location is non-NULL (a dynamic library),
641 * then the following fields of pAlgDesc must
642 * be specified:
643 * pAlgDesc->name
644 * pAlgDesc->isLocal
645 * pAlgDesc->groupId
646 * All other Engine_AlgDesc fields will be
647 * from the dynamic library.
648 * If location is NULL (not a dynamic library),
649 * the user must set the following fields of
650 * pAlgDesc:
651 * pAlgDesc->name
652 * pAlgDesc->fxns
653 * pAlgDesc->idmaFxns, if applicable
654 * pAlgDesc->iresFxns, if applicable
655 * pAlgDesc->isLocal
656 * pAlgDesc->groupId
657 * pAlgDesc->types
658 *
659 * @pre As with all Codec Engine API's, CERuntime_init() must have
660 * previously been called.
661 *
662 * @pre @c engine is a valid (non-NULL) engine handle which is
663 * in the open state.
664 *
665 * @remarks If there is an existing algorithm in the engine already named
666 * @c name, an error will be returned.
667 *
668 * @retval Engine_EOK Success.
669 * @retval Engine_EINUSE The Engine @c name is non-NULL, and the
670 * Engine is open.
671 * @retval Engine_EINVAL @c pAlgDesc or @c pAlgDesc->name is NULL.
672 * @retval Engine_EINVAL Both @c name and @c engine are NULL. Ensure
673 * one of these is non-NULL.
674 * @retval Engine_EINVAL Both @c name and @c engine are non-NULL.
675 * Ensure that one of these is NULL.
676 * @retval Engine_EEXIST There is no engine with the given name.
677 * @retval Engine_EINUSE The name of the alg in @c pAlgDesc->name is
678 * already in use.
679 * @par Example Usage:
680 * @code
681 * #include <ti/sdo/ce/Engine.h>
682 *
683 * Engine_AlgDesc desc;
684 *
685 * Engine_initAlgDesc(&desc);
686 *
687 * desc.groupId = 2;
688 * desc.isLocal = TRUE;
689 * desc.fxns = &UNIVERSALCOPY_TI_IUNIVERSALCOPY;
690 * desc.idmaFxns = NULL;
691 * desc.iresFxns = NULL;
692 * desc.memType = Engine_USECACHEDMEM_DEFAULT;
693 * desc.types = UNIVERSAL_VISATYPE;
694 *
695 * status = Engine_addAlg("myEngine", NULL, NULL, &desc);
696 *
697 * @endcode
698 *
699 * @sa Engine_initAlgDesc()
700 * @sa Engine_open()
701 * @sa Engine_removeAlg()
702 */
703extern Engine_Error Engine_addAlg(String name, Engine_Handle engine,
704 String location, Engine_AlgDesc *pAlgDesc);
705
706/*
707 * ======== Engine_removeAlg ========
708 */
709/**
710 * @brief Dynamically remove an algorithm that was added to an Engine
711 * with Engine_addAlg().
712 *
713 * @remarks The same values of the parameters @c name and @c engine that
714 * were passed to Engine_addAlg() should be used here. In
715 * particular, if @c name was used to add the alg, all handles to
716 * the engine must be closed before calling Engine_removeAlg().
717 *
718 *
719 * @param[in] name The name of the engine or NULL, that was
720 * passed to Engine_addAlg().
721 * @param[in] engine The handle to an engine, previously acquired
722 * by a call to Engine_open(), or NULL, that was
723 * used in Engine_addAlg().
724 * @param[in] algName Name of the algorithm to remove.
725 *
726 * @retval Engine_EOK Success.
727 * @retval Engine_EEXIST The engine @c name does not exist.
728 * @retval Engine_ENOTFOUND @c algName could not be found in @c engine.
729 * @retval Engine_EINUSE The Engine @c name is still open.
730 *
731 * @sa Engine_open()
732 * @sa Engine_addAlg()
733 */
734extern Engine_Error Engine_removeAlg(String name, Engine_Handle engine,
735 String algName);
736
737/** @cond INTERNAL */
738
739/*
740 * ======== Engine_call ========
741 */
742extern Int Engine_call(Engine_Node node, Comm_Msg *msg);
743
744/*
745 * ======== Engine_callAsync ========
746 */
747extern Int Engine_callAsync(Engine_Node node, Comm_Msg *msg);
748
749/*
750 * ======== Engine_callWait ========
751 */
752extern Int Engine_callWait(Engine_Node node, Comm_Msg *msg, UInt timeout);
753
754/*
755 * ======== Engine_ctrlNode ========
756 */
757extern Int Engine_ctrlNode(Engine_Node node, Comm_Msg *msg, Engine_Ctrl code);
758
759/** @endcond */
760
761/*
762 * ======== Engine_close ========
763 */
764/**
765 * @brief Close an Engine
766 *
767 * @param[in] engine The handle to an engine, previously acquired
768 * by a call to Engine_open().
769 *
770 * @pre @c engine must not be referenced by any algorithm instance
771 * objects; i.e., you must first delete all algorithm instances
772 * associated with @c engine before closing it.
773 *
774 * @pre @c engine is a valid (non-NULL) engine handle which is
775 * in the open state.
776 *
777 * @sa Engine_open()
778 */
779extern Void Engine_close(Engine_Handle engine);
780
781/** @cond INTERNAL */
782/*
783 * ======== Engine_createNode ========
784 */
785/**
786 * @brief Create a remote algorithm
787 *
788 * @param[in] engine The handle to an engine, previously acquired
789 * by a call to Engine_open().
790 * @param[in] name Name of the algorithm to create.
791 * @param[in] msgSize Size of the internal message required to
792 * communicate with the remote algorithm.
793 * @param[in] nodeAttrs Creation parameters for the remote algorithm.
794 * @param[in] attrs Attributes used by the framework for creating
795 * the remote algorithm.
796 *
797 * @pre @c engine is a valid (non-NULL) engine handle which is
798 * in the open state.
799 *
800 * @remarks Engine_createNode2() was added after Engine_createNode() to
801 * support more use cases. Engine_createNode() is a wrapper
802 * around Engine_createNode2(), and is maintained for compatibility.
803 *
804 * @retval NULL Failure
805 * @retval non-NULL A handle to the created remote algorithm.
806 *
807 * @sa Engine_createNode2()
808 * @sa Engine_deleteNode()
809 */
810extern Engine_Node Engine_createNode(Engine_Handle engine, String name,
811 size_t msgSize, IALG_Params *nodeAttrs, Engine_AlgCreateAttrs *attrs);
812
813
814/*
815 * ======== Engine_createNode2 ========
816 */
817/**
818 * @brief Create a remote algorithm
819 *
820 * @param[in] engine The handle to an engine, previously acquired
821 * by a call to Engine_open().
822 * @param[in] name Name of the algorithm to create.
823 * @param[in] msgSize Size of the internal message required to
824 * communicate with the remote algorithm.
825 * @param[in] nodeAttrs Creation parameters for the remote algorithm.
826 * @param[in] nodeAttrsSize Size of @c nodeAttrs.
827 * @param[in] attrs Attributes used by the framework for creating
828 * the remote algorithm.
829 *
830 * @pre @c engine is a valid (non-NULL) engine handle which is
831 * in the open state.
832 *
833 * @remarks Engine_createNode() is the preferred method to create remote
834 * algorithms. However, some algorithm interfaces incorrectly
835 * fail to provide a size field of type "Int" as the first field
836 * in their creation parameters, which the XDAIS spec defines.
837 * This service allows the creation of remote algorithms where the
838 * size of the creation params is specified "some other way" than
839 * the XDAIS spec defines.
840 *
841 * @retval NULL Failure
842 * @retval non-NULL A handle to the created remote algorithm.
843 *
844 * @sa Engine_createNode()
845 * @sa Engine_deleteNode()
846 */
847extern Engine_Node Engine_createNode2(Engine_Handle engine, String name,
848 size_t msgSize, IALG_Params *nodeAttrs, Int nodeAttrsSize,
849 Engine_AlgCreateAttrs *attrs);
850
851
852/*
853 * ======== Engine_deleteNode ========
854 */
855extern Void Engine_deleteNode(Engine_Node node);
856
857/*
858 * ======== Engine_getAlgMemRecs ========
859 */
860/**
861 * @brief Get the IALG_MemRecs used by an algorithm
862 *
863 * @param[in] node Handle to an algorithm instance.
864 * @param[out] memTab Location to store the IALG_MemRecs.
865 * @param[in] size Maximum number of IALG_MemRecs to put in memTab array.
866 * @param[out] numRecs Actual number of IALG_MemRecs copied into memTab array.
867 *
868 * @retval Engine_EOK Success.
869 * @retval Engine_ERUNTIME Failure.
870 *
871 * @sa Engine_getAlgNumRecs()
872 */
873extern Engine_Error Engine_getAlgMemRecs(Engine_Node node, IALG_MemRec *memTab, Int size,
874 Int *numRecs);
875
876/*
877 * ======== Engine_getAlgNumRecs ========
878 */
879/**
880 * @brief Get the number of IALG_MemRecs used by a remote algorithm
881 *
882 * @param[in] node Handle to an algorithm instance.
883 * @param[out] numRecs Location to store the number of IALG_MemRecs used.
884 *
885 * @retval Engine_EOK Success.
886 * @retval Engine_ERUNTIME Failure.
887 *
888 * @sa Engine_getAlgMemRecs()
889 */
890extern Engine_Error Engine_getAlgNumRecs(Engine_Node node, Int *numRecs);
891
892/*
893 * ======== Engine_getConstName ========
894 */
895extern String Engine_getConstName(Engine_Handle engine, String name,
896 String type);
897
898/*
899 * ======== Engine_getFxns ========
900 */
901extern IALG_Fxns *Engine_getFxns(Engine_Handle svr, String name, String type,
902 Bool *isLocal, Ptr *idmaFxns, Ptr *iresFxns, Int *groupId,
903 Engine_CachedMemType *memType);
904
905/*
906 * ======== Engine_getMemId ========
907 */
908extern Int Engine_getMemId(Engine_Handle engine);
909
910/*
911 * ======== Engine_getLocalEngine ========
912 */
913extern Engine_Handle Engine_getLocalEngine(Void);
914
915/*
916 * ======== Engine_getEngine ========
917 */
918extern Engine_Handle Engine_getEngine(Engine_Node node);
919
920/*
921 * ======== Engine_getMemStat ========
922 */
923extern Engine_Error Engine_getMemStat(Server_Handle server, Int segNum,
924 Engine_MemStat *stat);
925
926/*
927 * ======== Engine_getNumMemSegs ========
928 */
929extern Engine_Error Engine_getNumMemSegs(Server_Handle server, Int *numSegs);
930
931/*
932 * ======== Engine_getNumEngines ========
933 */
934extern Int Engine_getNumEngines();
935
936/*
937 * ======== Engine_getProcId ========
938 */
939extern String Engine_getProcId(Engine_Handle engine);
940
941/*
942 * ======== Engine_hasServer ========
943 */
944extern Bool Engine_hasServer(Engine_Handle engine);
945
946/*
947 * ======== Engine_init ========
948 */
949extern Void Engine_init(Void);
950
951
952/** @endcond */
953
954/*
955 * ======== Engine_initAlgDesc ========
956 */
957/**
958 * @brief Initialize an Engine_AlgDesc structure with default values.
959 *
960 * @param[in] pAlgDesc Location of Engine_AlgDesc object to initialize.
961 * The fields of pAlgDesc will be set to the following:
962 *
963 * pAlgDesc->name = NULL;
964 * pAlgDesc->uuid.data = 0;
965 * pAlgDesc->fxns = NULL;
966 * pAlgDesc->idmaFxns = NULL;
967 * pAlgDesc->typeTab = NULL;
968 * pAlgDesc->isLocal = TRUE;
969 * pAlgDesc->groupId = 0;
970 * pAlgDesc->rpcProtocolVersion = 0;
971 * pAlgDesc->iresFxns = NULL;
972 * pAlgDesc->codecClassConfig = NULL;
973 * pAlgDesc->memType = Engine_USECACHEDMEM_DEFAULT;
974 * pAlgDesc->types = NULL;
975 *
976 * @sa Engine_addAlg()
977 */
978extern Void Engine_initAlgDesc(Engine_AlgDesc *pAlgDesc);
979
980/*
981 * ======== Engine_initAttrs ========
982 */
983/**
984 * @brief Initialize an Engine_Attrs structure with default values.
985 *
986 * @param[in] pAttrs Location of Engine_Attrs object to initialize.
987 *
988 * @sa Engine_open()
989 */
990extern Void Engine_initAttrs(Engine_Attrs *pAttrs);
991
992/*
993 * ======== Engine_initDesc ========
994 */
995/**
996 * @brief Initialize an Engine_Desc structure with default values.
997 *
998 * @param[in] pDesc Location of Engine_Desc object to initialize.
999 * The fields of pDesc will be set to the following:
1000 *
1001 * pDesc->name = NULL;
1002 * pDesc->remoteName = NULL;
1003 * pDesc->heapId = 0;
1004 *
1005 * @sa Engine_add()
1006 */
1007extern Void Engine_initDesc(Engine_Desc *pDesc);
1008
1009/** @cond INTERNAL */
1010
1011/*
1012 * ======== Engine_getRemoteVisa ========
1013 */
1014extern UInt32 Engine_getRemoteVisa(Engine_Node node);
1015
1016/*
1017 * ======== Engine_getCodecClassConfig ========
1018 */
1019extern Ptr Engine_getCodecClassConfig(Engine_Handle engine, String name,
1020 String type);
1021
1022/*
1023 * ======== Engine_getNodeQueues ========
1024 */
1025extern Void Engine_getNodeQueues(Engine_Node node, Comm_Id *stdIn, Comm_Handle *stdOut);
1026
1027
1028/*
1029 * ======== Engine_initFromServer ========
1030 */
1031extern Engine_Error Engine_initFromServer(Engine_Handle engine);
1032
1033
1034/*
1035 * ======== Engine_redefineHeap ========
1036 */
1037extern Engine_Error Engine_redefineHeap(Server_Handle server, String name,
1038 Uint32 base, Uint32 size);
1039
1040/*
1041 * ======== Engine_releaseTraceToken ========
1042 */
1043extern Bool Engine_releaseTraceToken(Server_Handle server);
1044
1045/*
1046 * ======== Engine_requestTraceToken ========
1047 */
1048extern Engine_Error Engine_requestTraceToken(Server_Handle server);
1049
1050/*
1051 * ======== Engine_restoreHeap ========
1052 */
1053extern Engine_Error Engine_restoreHeap(Server_Handle server, String name);
1054
1055/** @endcond */
1056
1057/*
1058 * ======== Engine_open ========
1059 */
1060/**
1061 * @brief Open an Engine
1062 *
1063 * The handle returned may be used to create one or more instances of an
1064 * algorithm contained in the specified Engine.
1065 *
1066 * An Engine may be opened more than once; each open returns a unique
1067 * handle that can be used to create algorithm instances or get status of the
1068 * Engine.
1069 *
1070 * Engine handles must not be concurrently accessed by multiple threads; each
1071 * thread must either obtain its own handle (via Engine_open()) or explicitly
1072 * serialize access to a shared handle.
1073 *
1074 * @param[in] name The name of the engine to open. @c name is
1075 * specified in the engine configuration.
1076 * @param[in] attrs Attributes for the open engine.
1077 * @param[out] ec Optional output error code
1078 *
1079 * @retval NULL An error has occurred.
1080 * @retval non-NULL The handle to the opened engine.
1081 *
1082 * @pre @c name is a non-NULL string.
1083 *
1084 * @pre @c name is a valid, pre-configured name of an engine.
1085 *
1086 * @pre As with all Codec Engine API's, CERuntime_init() must have
1087 * previously been called.
1088 *
1089 * @post If the return handle is NULL and @c ec is non-NULL, @c *ec
1090 * is set to a non-zero value indicating the cause of the failure.
1091 *
1092 * @post If @c ec is non-NULL, the Engine_Error value is set to one of
1093 * the following values:
1094 * - #Engine_EOK success
1095 * - #Engine_EEXIST name does not exist
1096 * - #Engine_ENOMEM can't allocate memory
1097 * - #Engine_EDSPLOAD can't load the DSP
1098 * - #Engine_ENOCOMM can't create a comm connection to DSP
1099 * - #Engine_ENOSERVER can't locate the server on the DSP
1100 * - #Engine_ECOMALLOC can't allocate communication buffer
1101 *
1102 * @sa Engine_close()
1103 * @sa Engine_add()
1104 * @sa Engine_remove()
1105 */
1106extern Engine_Handle Engine_open(String name, Engine_Attrs *attrs,
1107 Engine_Error *ec);
1108
1109/*
1110 * ======== Engine_fwriteTrace ========
1111 */
1112/**
1113 * @brief Write Server's trace buffer to specifed file stream
1114 *
1115 * @param[in] engine The handle to the opened engine.
1116 *
1117 * @param[in] prefix A string to prepend to each line output; this
1118 * allows one to easily identify trace from the
1119 * server from the application's trace, for
1120 * example.
1121 * @param[in] out A open FILE stream used to output the
1122 * Server's trace characters.
1123 *
1124 * @retval Integer number of characters copied to the specified
1125 * FILE stream.
1126 *
1127 * @pre @c engine is a valid (non-NULL) engine handle and the engine
1128 * is in the open state.
1129 *
1130 * @post In the event a negative value is returned,
1131 * Engine_getLastError() will return one of the following values:
1132 * - #Engine_ERUNTIME Either an internal runtime error
1133 * occured or the underlying server
1134 * error occured.
1135 * - #Engine_EINUSE Server trace resource is already in use.
1136 */
1137extern Int Engine_fwriteTrace(Engine_Handle engine, String prefix, FILE *out);
1138
1139/*
1140 * ======== Engine_getAlgInfo ========
1141 */
1142/**
1143 * @brief Get details of an algorithm configured into an engine
1144 *
1145 * @param[in] name The name of the engine. @c name is
1146 * specified in the engine configuration.
1147 * @param[out] algInfo Structure to store algorithm details. The
1148 * @c algInfoSize field of this structure must
1149 * be set to @c sizeof(Engine_AlgInfo) by the
1150 * application.
1151 * @param[out] index The index of the algorithm to get the information.
1152 *
1153 * @retval Engine_EOK Success.
1154 * @retval Engine_EEXIST There is no engine with the given name.
1155 * @retval Engine_ENOTFOUND @c index is greater than or equal to the
1156 * total number of algorithms configured for
1157 * the engine, or @c index < 0.
1158 * @retval Engine_EINVAL The value of @c algInfoSize passed to this
1159 * function does not match the CE library's
1160 * @c sizeof(Engine_AlgInfo).
1161 *
1162 * @pre @c name is a non-NULL string.
1163 *
1164 * @pre @c algInfo is non-NULL.
1165 *
1166 * @pre As with all Codec Engine API's, CERuntime_init() must have
1167 * previously been called.
1168 *
1169 * @post If @c name is a valid engine name and 0 <= @c index < the
1170 * total number of algorithms configured for the engine, then
1171 * @c algInfo will contain the information for the engine's
1172 * ith (i = @c index) algorithm.
1173 *
1174 * @sa Engine_getNumAlgs()
1175 */
1176extern Engine_Error Engine_getAlgInfo(String name, Engine_AlgInfo *algInfo,
1177 Int index);
1178
1179/*
1180 * ======== Engine_getAlgInfo2 ========
1181 */
1182/**
1183 * @brief Get details of an algorithm.
1184 *
1185 * @param[in] name The name of the engine. @c name is
1186 * specified in the engine configuration. This
1187 * may be NULL if @c engine contains a valid
1188 * engine handle.
1189 * @param[in] engine The handle of an engine returned by Engine_open().
1190 * If this is NULL, only information for a static
1191 * alg can be obtained.
1192 * @param[out] algInfo2 Structure to store algorithm details. The
1193 * @c algInfoSize field of this structure must
1194 * be set to @c sizeof(Engine_AlgInfo2) by the
1195 * application.
1196 * @param[out] index The index of the algorithm to get the information.
1197 *
1198 * @retval Engine_EOK Success.
1199 * @retval Engine_EEXIST There is no engine with the given name.
1200 * @retval Engine_ENOTFOUND @c index is greater than or equal to the
1201 * total number of algorithms configured for
1202 * the engine, or @c index < 0.
1203 * @retval Engine_EINVAL The value of @c algInfoSize passed to this
1204 * function does not match the CE library's
1205 * @c sizeof(Engine_AlgInfo2).
1206 *
1207 * @pre @c name is a non-NULL string or @c engine is non-NULL.
1208 *
1209 * @pre @c algInfo2 is non-NULL.
1210 *
1211 * @pre As with all Codec Engine API's, CERuntime_init() must have
1212 * previously been called.
1213 *
1214 * @post If @c name is a valid engine name and 0 <= @c index < the
1215 * total number of algorithms configured for the engine, then
1216 * @c algInfo2 will contain the information for the engine's
1217 * ith (i = @c index) algorithm.
1218 *
1219 * @remarks This service supports algorithms statically configured into
1220 * an Engine at build/config time, or algorithms that have been
1221 * dynamically added to an opened engine. If the Engine has not
1222 * been opened yet, the name of the Engine is used to get the
1223 * statically configured alg. If the Engine has been opened, the
1224 * Engine handle can be used to get either information for a
1225 * statically configured alg, or a remote alg that was added when
1226 * the server was queried during Engine_open().
1227 *
1228 * @sa Engine_getNumAlgs2().
1229 */
1230extern Engine_Error Engine_getAlgInfo2(String name, Engine_Handle engine,
1231 Engine_AlgInfo2 *algInfo2, Int index);
1232
1233
1234/** @cond INTERNAL */
1235/*
1236 * ======== Engine_getCpuLoad ========
1237 */
1238/**
1239 * @brief Get Server's cpu usage in percent
1240 *
1241 * @deprecated This service has been replaced by Server_getCpuLoad()
1242 * to better indicate that this API is not intended for
1243 * obtaining the current processor's CPU load, rather it
1244 * obtains the CPU load of a remote Server.
1245 *
1246 * @param[in] engine The handle to the opened engine.
1247 *
1248 * @retval integer between 0-100 indicating percentage
1249 * of time the Server is processing measured
1250 * over a period of approximately 1 second. If
1251 * the load is unavailable, a negative value is
1252 * returned.
1253 *
1254 * @pre @c engine is a valid (non-NULL) engine handle and the engine
1255 * is in the open state.
1256 *
1257 * @post In the event a negative value is returned,
1258 * Engine_getLastError() will return one of the following values:
1259 * - #Engine_ERUNTIME Either an internal runtime error
1260 * occured or the underlying server
1261 * error occured.
1262 * - #Engine_ENOTAVAIL The CPU load can not be computed.
1263 *
1264 * @sa Server_getCpuLoad()
1265 */
1266extern Int Engine_getCpuLoad(Engine_Handle engine);
1267
1268/** @endcond */
1269
1270
1271/*
1272 * ======== Engine_getDesc ========
1273 */
1274/**
1275 * @brief Fill in an Engine_Desc structure with the values of the
1276 * Engine descriptor for an Engine.
1277 *
1278 * @param[in] name The name of the Engine. @c name is
1279 * specified in the engine configuration or a
1280 * a name that was passed to @c Engine_add().
1281 * @param[out] desc The structure where the descriptor of the
1282 * Engine specified by @c name will be copied to.
1283 *
1284 * @retval Engine_EOK Success.
1285 * @retval Engine_EEXIST There is no engine with the given name.
1286 *
1287 * @pre @c name is a non-NULL string.
1288 *
1289 * @pre @c desc is non-NULL.
1290 *
1291 * @pre As with all Codec Engine API's, CERuntime_init() must have
1292 * previously been called.
1293 *
1294 * @post If @c name is a valid engine name, then desc will contain
1295 * the descriptor of the engine @c name.
1296 *
1297 * @sa Engine_setDesc().
1298 */
1299extern Engine_Error Engine_getDesc(String name, Engine_Desc *desc);
1300
1301/*
1302 * ======== Engine_getLastError ========
1303 */
1304/**
1305 * @brief Get error code of the last failed operation
1306 *
1307 * @param[in] engine The handle to the opened engine.
1308 *
1309 * @retval error code (Engine_Error) of the last failed
1310 * engine operation.
1311 *
1312 * @pre As with all Codec Engine API's, CERuntime_init() must have
1313 * previously been called.
1314 *
1315 * @pre @c engine is a valid (non-NULL) engine handle and the engine
1316 * is in the open state.
1317 */
1318extern Engine_Error Engine_getLastError(Engine_Handle engine);
1319
1320/*
1321 * ======== Engine_getName ========
1322 */
1323/**
1324 * @brief Get the name of an opened engine
1325 *
1326 * @param[in] engine The handle to the opened engine.
1327 *
1328 * @pre As with all Codec Engine API's, CERuntime_init() must have
1329 * previously been called.
1330 *
1331 * @retval NULL An error has occurred.
1332 * @retval non-NULL The name of the opened engine.
1333 */
1334extern String Engine_getName(Engine_Handle engine);
1335
1336
1337/*
1338 * ======== Engine_getNumAlgs ========
1339 */
1340/**
1341 * @brief Get the number of algorithms configured into an Engine
1342 *
1343 * @param[in] name The name of the Engine. @c name is
1344 * specified in the engine configuration.
1345 * @param[out] numAlgs The number of algorithms that are configured
1346 * in the given engine.
1347 *
1348 * @retval Engine_EOK Success.
1349 * @retval Engine_EEXIST There is no engine with the given name.
1350 *
1351 * @pre @c name is a non-NULL string.
1352 *
1353 * @pre @c numAlgs is non-NULL.
1354 *
1355 * @pre As with all Codec Engine API's, CERuntime_init() must have
1356 * previously been called.
1357 *
1358 * @post If @c name is a valid engine name, then numAlgs will contain
1359 * the number of algorithms configured for the given engine.
1360 *
1361 * @sa Engine_getAlgs().
1362 */
1363extern Engine_Error Engine_getNumAlgs(String name, Int *numAlgs);
1364
1365/*
1366 * ======== Engine_getNumAlgs2 ========
1367 */
1368/**
1369 * @brief Get the number of algorithms statically configured into an engine
1370 * or the total number of algorithms both statically configured and
1371 * dynamically added through server information when the engine was
1372 * opened.
1373 *
1374 * @param[in] name The name of the engine. @c name is
1375 * specified in the engine configuration. @c name
1376 * can be NULL, if @c engine is a valid
1377 * Engine_Handle.
1378 * @param[in] engine The handle of an engine returned by
1379 * Engine_open(). If @c engine is NULL, @c name
1380 * must be non-NULL, and only the number of
1381 * statically configured algorithms will be
1382 * returned in @c numAlgs.
1383 * specified in the engine configuration.
1384 * @param[out] numAlgs The number of algorithms that are configured
1385 * in the given engine.
1386 *
1387 * @retval Engine_EOK Success.
1388 * @retval Engine_EEXIST There is no engine with the given name.
1389 *
1390 * @pre @c name is a non-NULL string or @c engine is non-NULL.
1391 *
1392 * @pre @c numAlgs is non-NULL.
1393 *
1394 * @pre As with all Codec Engine API's, CERuntime_init() must have
1395 * previously been called.
1396 *
1397 * @post If @c name is a valid engine name, then numAlgs will contain
1398 * the number of algorithms configured for the given engine.
1399 *
1400 * @remarks If the engine has a server, but was not configured with
1401 * Engine.createFromServer() number of remote algorithms (if any)
1402 * that were statically configured into the engine, will be
1403 * counted twice: once for the static alg table, and once for
1404 * the information queried from the server.
1405 *
1406 * @sa Engine_getAlgs().
1407 */
1408extern Engine_Error Engine_getNumAlgs2(String name, Engine_Handle engine,
1409 Int *numAlgs);
1410
1411/*
1412 * ======== Engine_getServer ========
1413 */
1414/**
1415 * @brief Get handle to an Engine's Server
1416 *
1417 * This function returns the handle to an Engines server, that can be used
1418 * with Server APIs to obtain information from and control the remote DSP
1419 * server.
1420 *
1421 * @param[in] engine The handle to the opened engine.
1422 *
1423 * @retval Handle to engine's server.
1424 *
1425 * @pre As with all Codec Engine API's, CERuntime_init() must have
1426 * previously been called.
1427 *
1428 * @pre @c engine is a valid (non-NULL) engine handle and the engine
1429 * is in the open state.
1430 */
1431extern Server_Handle Engine_getServer(Engine_Handle engine);
1432
1433
1434/*
1435 * ======== Engine_getUsedMem ========
1436 */
1437/**
1438 * @brief Get Server's total memory usage
1439 *
1440 * @deprecated This service has been replaced by Server_getMemStat()
1441 * to better indicate that this API is not intended for
1442 * obtaining the current processor's memory statistics,
1443 * rather it obtains the memory statistics of a remote
1444 * Server. Also, Server_getMemStat() provides more granularity
1445 * than Engine_getUsedMem().
1446 *
1447 * @param[in] engine The handle to the opened engine.
1448 *
1449 * @retval Total amount of used memory (in MAUs). If the amount is not
1450 * available, 0 is returned and the reason can be retrieved via
1451 * Engine_getLastError().
1452 *
1453 * @pre As with all Codec Engine API's, CERuntime_init() must have
1454 * previously been called.
1455 *
1456 * @pre @c engine is a valid (non-NULL) engine handle and the engine
1457 * is in the open state.
1458 *
1459 * @post in the event that 0 is returned, Engine_getLastError() will
1460 * return one of the following values:
1461 * - #Engine_ERUNTIME Either an internal runtime error
1462 * occured or the underlying server
1463 * error occured.
1464 * - #Engine_ENOTAVAIL The memory usage can not be computed.
1465 */
1466extern UInt32 Engine_getUsedMem(Engine_Handle engine);
1467
1468
1469/*
1470 * ======== Engine_remove ========
1471 */
1472/**
1473 * @brief Remove an engine from the list of engines that can be opened
1474 *
1475 * @param[in] engineName The name of the engine to be removed.
1476 *
1477 * @pre As with all Codec Engine API's, CERuntime_init() must have
1478 * previously been called.
1479 *
1480 * @pre @c engineName is non-NULL.
1481 *
1482 * @retval Engine_EINUSE The engine cannot be removed because
1483 * an instance of it is still opened.
1484 * @retval Engine_EEXIST No engine by this name exists.
1485 * @retval Engine_EOK Success.
1486 *
1487 * @sa Engine_add()
1488 */
1489extern Engine_Error Engine_remove(String engineName);
1490
1491
1492/*
1493 * ======== Engine_setDesc ========
1494 */
1495/**
1496 * @brief Set values for an Engine's descriptor. This function should
1497 * only be called when the Engine has not yet been opened.
1498 *
1499 * @param[in] name The name of the Engine. @c name is
1500 * specified in the engine configuration or a
1501 * a name that was passed to @c Engine_add().
1502 * @param[in] desc The structure where descriptor values for the
1503 * Engine specified by @c name will be copied
1504 * from.
1505 *
1506 * @retval Engine_EOK Success.
1507 * @retval Engine_EEXIST There is no engine with the given name.
1508 * @retval Engine_EINUSE The Engine @c name has already been opened.
1509 *
1510 * @pre @c name is a non-NULL string.
1511 *
1512 * @pre @c desc is non-NULL.
1513 *
1514 * @pre As with all Codec Engine API's, CERuntime_init() must have
1515 * previously been called.
1516 *
1517 * @post If @c name is a valid engine name, then the desscriptor for
1518 * the engine @c name will have been updated with values from
1519 * @c desc.
1520 *
1521 * @remarks Use @c Engine_getDesc() to fill in the descriptor, override
1522 * the fields you want to change, and then pass the descriptor
1523 * to Engine_setDesc().
1524 * Only the following fields of the Engine_Desc are allowed to
1525 * be modified:
1526 * @c memMap
1527 * @c useExtLoader
1528 * @c heapId
1529 *
1530 * @sa Engine_getDesc().
1531 */
1532extern Engine_Error Engine_setDesc(String name, Engine_Desc *desc);
1533
1534
1535/*
1536 * ======== Engine_setTrace ========
1537 */
1538/**
1539 * @brief Set Server's trace mask
1540 *
1541 * @param[in] engine The handle to the opened engine.
1542 * @param[in] mask Trace mask, e.g. "*=01234567"
1543 *
1544 * @retval Engine_ENOSERVER No server for this engine.
1545 * @retval Engine_EINUSE Trace resource is already in use.
1546 * @retval Engine_ERUNTIME Internal runtime error has occurred.
1547 *
1548 * @pre As with all Codec Engine API's, CERuntime_init() must have
1549 * previously been called.
1550 *
1551 * @pre @c engine is a valid (non-NULL) engine handle and the engine
1552 * is in the open state.
1553 *
1554 * @remarks This only sets the trace for a remote server. To change
1555 * the trace mask for the application-side of the framework,
1556 * use Diags_setMask(), or Diags_setMaskMeta().
1557 *
1558 * @sa xdc.runtime.Diags
1559 */
1560extern Int Engine_setTrace(Engine_Handle engine, String mask);
1561
1562
1563/** @cond INTERNAL */
1564
1565/*
1566 * ======== Engine_getDesc ========
1567 * Internal for testing.
1568 */
1569extern Engine_Desc *_Engine_getDesc(Int i);
1570
1571/** @endcond */
1572
1573/*@}*/
1574
1575#ifdef __cplusplus
1576}
1577#endif
1578
1579#endif
1580/*
1581 * @(#) ti.sdo.ce; 1, 0, 6,3; 6-13-2013 00:10:03; /db/atree/library/trees/ce/ce-w08/src/ xlibrary
1582
1583 */
1584
diff --git a/packages/codec_engine/ti/sdo/ce/Server.h b/packages/codec_engine/ti/sdo/ce/Server.h
new file mode 100644
index 0000000..447c3ef
--- /dev/null
+++ b/packages/codec_engine/ti/sdo/ce/Server.h
@@ -0,0 +1,761 @@
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 * ======== Server.h ========
40 * DSP Server module
41 *
42 * APIs for accessing information from remote server.
43 */
44
45/**
46 * @file ti/sdo/ce/Server.h
47 *
48 * @brief The Codec Engine Server Interface. Provides the user an
49 * inteface to open and manipulate a Server which contains
50 * remote algorithms.
51 */
52/**
53 * @addtogroup ti_sdo_ce_Server Codec Engine Server Interface
54 */
55#ifndef ti_sdo_ce_Server_
56#define ti_sdo_ce_Server_
57
58#ifdef __cplusplus
59extern "C" {
60#endif
61
62
63#include <ti/sdo/ce/ServerDefs.h>
64#include <ti/sdo/ce/Engine.h>
65#include <ti/sdo/ce/skel.h>
66
67#include <stdio.h> /* def of FILE * */
68
69/** @ingroup ti_sdo_ce_Server */
70/*@{*/
71
72/**
73 * @brief Name to pass to Diags_setMask() to enable logging for Server
74 * functions. For example,
75 * Diags_setMask(Server_MODNAME"+EX1234567");
76 * turns on all Log statements in this module.
77 * Diags_setMask() must be called after initialization to take
78 * effect.
79 */
80#define Server_MODNAME "ti.sdo.ce.Server"
81
82/**
83 * @brief Maximum number of characters used in memory segment names.
84 */
85#define Server_MAXSEGNAMELENGTH 32
86
87/**
88 * @brief Server error code
89 */
90typedef enum Server_Status {
91 Server_EOK = 0, /**< Success. */
92 Server_ENOSERVER = 1, /**< Engine has no server. */
93 Server_ENOMEM = 2, /**< Unable to allocate memory. */
94 Server_ERUNTIME = 3, /**< Internal runtime failure. */
95 Server_EINVAL = 4, /**< Bad value passed to function. */
96 Server_EWRONGSTATE =5, /**< Server is not in the correct state to
97 * execute the requested function. */
98 Server_EINUSE = 6, /**< Server call did not succeed because a
99 * because a required resource is in use. */
100 Server_ENOTFOUND = 7, /**< An entity was not found */
101 Server_EFAIL = 8, /**< Unknown failure */
102 Server_ENOTSUPPORTED = 9 /**< API not supported for given parameters. */
103} Server_Status;
104
105/*
106 * ======== Server_AlgDesc ========
107 */
108typedef struct Server_AlgDesc {
109 /**
110 * @brief The name of the algorithm. This is used by the application
111 * when instantiating an instance of the algorithm through one
112 * of the VISA APIs.
113 */
114 String name;
115
116 /**
117 * @brief The address of the XDAIS alg function table.
118 *
119 * @remarks
120 * All XDAIS algorithms must define an IALG_Fxns structure that
121 * contains implementations of the IALG methods. This field
122 * is simply the address of this structure.
123 */
124 IALG_Fxns *fxns;
125
126 /**
127 * @brief The address of the IDMA3_Fxns function table, if the algorithm
128 * uses DMA. If the algorithm does not use DMA, this field should
129 * set to NULL. Valid for local algorithm only.
130 */
131 Ptr idmaFxns;
132
133 /**
134 * @brief If true, the algorithm will be instantiated on the
135 * "local" CPU. Otherwise the server will create an
136 * instance of the algorithm.
137 */
138 Bool isLocal;
139
140 /**
141 * @brief This id specifies which resource sharing group that this
142 * alg will be placed into.
143 *
144 * @remarks
145 * This 'group' concept is used by the framework for sharing
146 * resources. Algorithms in the same group share resources, and
147 * therefore, must not run at the same time. If you assign the
148 * same groupId to multiple algorithms, these algorithms must
149 * not pre-empt eachother, or the shared resources may be
150 * corrupted.
151 * When server algorithms are configured statically in a .cfg
152 * file, if the @c groupId parameter for the algorithm has
153 * not been set, the configuration process assigns the @c groupId
154 * will be assigned automatically, based on the priority that
155 * the algorithm will run at. However, when Server_addAlg() is
156 * used to dynamically add the algorithm to the server, you must
157 * ensure that the @c groupId is appropriately. If two algorithms
158 * will run at the same time, you must assign them different
159 * group Ids.
160 *
161 * Algorithms in different groups do not share resources.
162 *
163 * @sa http://processors.wiki.ti.com/index.php/Codec_Engine_GroupIds
164 */
165 Int groupId;
166
167 /**
168 * @brief Address of the XDAIS alg IRES Interface function table.
169 *
170 * @remarks
171 * All XDAIS algorithms that use an IRES resource must define an
172 * IRES_Fxns structure containing the pointers to functions
173 * implementatng the IRES interface.
174 * If the algorithm does not use an IRES resource this field
175 * should be set to NULL.
176 */
177 Ptr iresFxns;
178
179 /*
180 * Currently not used.
181 * Codec class configuration data for stub side, if any. We
182 * generate this structure for both sides, although it is
183 * currently only used in the skeletons.
184 */
185 Void *stubsCodecClassConfig;
186
187 /**
188 * @brief Codec class configuration data, if any.
189 */
190 Void *codecClassConfig;
191
192 /*
193 * Currently not used.
194 * Indicates the type of memory the alg's memory requests will
195 * be allocated from.
196 * The alg's memory will be allocated from cached memory, if
197 * memType = Engine_USECACHEDMEM_CACHED,
198 * from non-cached memory, if
199 * memType = Engine_USECACHEDMEM_NONCACHED,
200 * Otherwise, if
201 * memType = Engine_USECACHEDMEM_DEFAULT,
202 * memory allocations will be determined by the value of
203 * ti_sdo_ce_alg_Algorithm_useCache (cached, if TRUE, non-cached,
204 * if FALSE).
205 *
206 * @sa Engine_CachedMemType
207 */
208 Engine_CachedMemType memType; /**< Memory type for alg's mem reqs. */
209
210 /**
211 * @brief A string idicating the type(s) of algorithm this is.
212 * This should be a ';' separated string of inherited types.
213 *
214 * @remarks
215 * In most cases, @c types will just be set to the VISA type
216 * defined in the Codec Engine algorithm interface header
217 * file included by the algorithm, depending on the XDM interface
218 * the algorithm implements.
219 *
220 * For example, if the algorithm implements the ISPHDEC1
221 * interface as defined by XDM, @c types should be set
222 * to
223 * @c SPHDEC1_VISATYPE
224 * (defined as "ti.sdo.ce.speech1.ISPHDEC1" in the header file
225 * ti/sdo/ce/speech1/sphdec1.h).
226 *
227 * Another example to illustrate multiple typss specified in
228 * @c typss, if the algorithm implements the (made-up)
229 * interface, ti.sdo.ce.test.xvideo.IVIDE, which in turn
230 * implements the IVIDDEC interface, we could then set @c types
231 * to
232 * VIDDEC_VISATYPE";ti.sdo.ce.test.xvideo.IVIDE"
233 * or
234 * "ti.sdo.ce.test.xvideo.IVIDE;"VIDDEC_VISATYPE
235 */
236 String types;
237
238 /**
239 * @brief A string idicating the name of the stub functions. This is
240 * needed by remote apps that call Engine_initFromServer().
241 */
242 String stubFxnsName;
243
244 /**
245 * @brief The skel functions needed to invoke the alg remotely
246 */
247 SKEL_Fxns *skelFxns;
248
249 /**
250 * @brief The priority the alg will run at.
251 */
252 Int priority;
253
254 /**
255 * @brief Algorithm stack size.
256 */
257 Int stackSize;
258
259 /*
260 * Currently not used.
261 * Memory heap for algorithm stack.
262 */
263 Int stackSeg;
264} Server_AlgDesc;
265
266/**
267 * @brief Information for a memory heap of a remote DSP server.
268 *
269 * @remarks Sizes are given in DSP data MAUs.
270 * @sa Server_getMemStat().
271 *
272 */
273typedef struct Server_MemStat {
274 Char name[Server_MAXSEGNAMELENGTH + 1]; /**< Name of memory heap. */
275 Uint32 base; /**< Base address of the memory segment. */
276 Uint32 size; /**< Original size of the memory segment. */
277 Uint32 used; /**< Number of bytes used. */
278 Uint32 maxBlockLen; /**< Length of the largest contiguous free block. */
279} Server_MemStat;
280
281
282/*
283 * ======== Server_addAlg ========
284 */
285/**
286 * @brief Dynamically add an algorithm to a Server.
287 *
288 * @param[in] server The handle of a server returned by
289 * Engine_getServer(). Set to NULL when adding
290 * a local algorithm to the server. In the
291 * future, this handle will be used to
292 * dynamically add algorithms to a remote server.
293 * @param[in] location String identifying the location of the
294 * algorithm. Often this is a file name, but for
295 * systems without a file system, it may be a
296 * system-specific string identifier. This may
297 * be NULL if the algorithm is built into the
298 * executable. Currently not supported - set to
299 * NULL.
300 * @param[in] pAlgDesc Parameters describing the algorithm being
301 * added. Before setting the fields of this
302 * structure, it should first be initialized
303 * with @c Server_initAlgDesc(), to set all
304 * fields to default values.
305 *
306 * The user must set the following fields of
307 * pAlgDesc:
308 * pAlgDesc->name
309 * pAlgDesc->fxns
310 * pAlgDesc->idmaFxns, if applicable
311 * pAlgDesc->iresFxns, if applicable
312 *
313 * pAlgDesc->groupId
314 * pAlgDesc->priority
315 * pAlgDesc->stackSize
316 *
317 * pAlgDesc->types
318 * pAlgDesc->stubFxnsName
319 * pAlgDesc->skelFxns
320 *
321 * Currently, adding only local algorithms is
322 * supported, so the default value of TRUE can
323 * be used for:
324 * pAlgDesc->isLocal
325 *
326 * @pre As with all Codec Server API's, CERuntime_init() must have
327 * previously been called.
328 *
329 * @remarks If adding a local algorithm to a server that is built with
330 * BIOS, this function must be called after CERuntime_init()
331 * has been called, but before BIOS_start(). This is necessary
332 * to ensure that the algorithm will be visible to the remote
333 * app that loaded the server.
334 *
335 * @remarks If adding a remote algorithm to a remote server, the server
336 * handle for the opened Engine must be used. The server handle
337 * is obtained by calling Engine_getServer() with the handle of
338 * the opened engine.
339 * In this case, the added algorithm will only be accessible to
340 * the caller of this function.
341 * Adding a remote algorithm is not yet supported.
342 *
343 * @remarks If there is an existing algorithm in the server already named
344 * @c name, an error will be returned.
345 *
346 * @retval Server_EOK Success.
347 * @retval Server_EINVAL @c pAlgDesc or @c pAlgDesc->name is NULL.
348 * @retval Server_EINUSE The name of the alg in @c pAlgDesc->name is
349 * already in use.
350 * @retval Server_ENOTSUPPORTED @c pAlgDesc->isLocal = FALSE is currently
351 * not supported.
352 *
353 * @par Example Usage:
354 * @code
355 * #include <ti/sdo/ce/Server.h>
356 *
357 * Server_AlgDesc desc;
358 *
359 * Server_initAlgDesc(&desc);
360 *
361 * desc.groupId = 2;
362 * desc.isLocal = TRUE;
363 * desc.fxns = &UNIVERSALCOPY_TI_IUNIVERSALCOPY;
364 * desc.idmaFxns = NULL;
365 * desc.iresFxns = NULL;
366 * desc.priority = 2;
367 * desc.stackSize = 0x2000;
368 * desc.types = UNIVERSAL_VISATYPE;
369 * desc.stubFxnsName = "UNIVERSAL_STUBS";
370 * desc.skelFxns = &UNIVERSAL_SKEL;
371 *
372 * status = Server_addAlg(NULL, NULL, &desc);
373 *
374 * @endcode
375 *
376 * @sa Server_AlgDesc
377 * @sa Server_initAlgDesc()
378 * @sa Engine_getServer()
379 */
380extern Server_Status Server_addAlg(Server_Handle server, String location,
381 Server_AlgDesc *pAlgDesc);
382
383
384/*
385 * ======== Server_connectTrace ========
386 */
387/**
388 * @brief Connect to server for purposes of collecting
389 * trace and/or LOG data.
390 *
391 * @param[in] server Server handle obtained from Engine_getServer().
392 *
393 * @param[in] token Address to store connection token. This token
394 * should be specified in the companion call to
395 * Server_disconnectTrace().
396 *
397 * @retval Server_EOK Success, trace token was acquired.
398 * @retval Server_EINUSE A connection for server trace is already
399 * established.
400 * @retval Server_ERUNTIME An internal runtime error occurred.
401 *
402 * @pre @c server is non-NULL.
403 * @pre @c token is non-NULL.
404 *
405 * @sa Server_disconnectTrace().
406 *
407 */
408extern Server_Status Server_connectTrace(Server_Handle server, Int * token);
409
410/*
411 * ======== Server_disconnectTrace ========
412 */
413/**
414 * @brief Disconnect from server when finished collecting
415 * trace and/or LOG data.
416 *
417 * @param[in] server Server handle obtained from Engine_getServer().
418 *
419 * @param[in] token Connection token (as obtained from earlier,
420 * companion call to Server_connectTrace()).
421 *
422 * @retval Server_EOK Success.
423 * @retval Server_ERUNTIME An internal runtime error occurred.
424 *
425 * @pre @c server is non-NULL.
426 *
427 * @sa Server_connectTrace().
428 *
429 */
430extern Server_Status Server_disconnectTrace(Server_Handle server, Int token);
431
432/*
433 * ======== Server_fwriteTrace ========
434 */
435/**
436 * @brief Write Server's trace buffer to specifed file stream
437 *
438 * @param[in] server Server handle, obtained from Engine_getServer().
439 *
440 * @param[in] prefix A string to prepend to each line output; this
441 * allows one to easily identify trace from the
442 * server from the application's trace, for
443 * example.
444 * @param[in] out An open FILE stream used to output the
445 * Server's trace characters.
446 *
447 * @retval Integer number of characters copied to the specified
448 * FILE stream.
449 *
450 * @pre @c server is non-NULL.
451 * @pre @c Corresponding engine is in the open state.
452 *
453 * @post In the event a negative value is returned,
454 * Engine_getLastError() will return the value:
455 * - #Engine_ERUNTIME Either an internal runtime error
456 * occured or the underlying server
457 * error occured.
458 */
459extern Int Server_fwriteTrace(Server_Handle server, String prefix, FILE *out);
460
461/*
462 * ======== Server_getCpuLoad ========
463 */
464/**
465 * @brief Get Server's CPU usage in percent.
466 *
467 * @param[in] server Server handle, obtained from Engine_getServer().
468 *
469 * @retval Integer between 0-100 indicating percentage
470 * of time the Server is processing measured
471 * over a period of approximately 1 second. If
472 * the load is unavailable, a negative value is
473 * returned.
474 *
475 * @pre @c server is non-NULL.
476 *
477 * @post In the event a negative value is returned,
478 * Engine_getLastError() will return one of the following values:
479 * - #Engine_ERUNTIME Either an internal runtime error
480 * occured or an underlying server
481 * error occured.
482 * - #Engine_EINVAL The Server handle is not valid.
483 *
484 */
485extern Int Server_getCpuLoad(Server_Handle server);
486
487/*
488 * ======== Server_getMemStat ========
489 */
490/**
491 * @brief Get information on a memory heap segment of a remote DSP server.
492 *
493 * @param[in] server Server handle obtained from Engine_getServer().
494 * @param[in] segNum The heap number of a segment on the DSP.
495 * @param[out] memStat Structure to store memory segment information.
496 *
497 * @retval Server_EOK Success.
498 * @retval Server_ENOTFOUND @c segNum is out of range.
499 * @retval Server_ERUNTIME Internal runtime error occurred.
500 *
501 * @pre @c server is non-NULL.
502 * @pre @c memStat is non-NULL.
503 *
504 * @post On success, memStat will contain information about the memory
505 * heap @c segNum on the DSP.
506 *
507 * @sa Server_getNumMemSegs().
508 *
509 * @remarks This API only returns statistics for BIOS HeapMem heaps
510 * that have been statically configured into the server.
511 */
512extern Server_Status Server_getMemStat(Server_Handle server, Int segNum,
513 Server_MemStat *memStat);
514
515/*
516 * ======== Server_getNumMemSegs ========
517 */
518/**
519 * @brief Get the number of memory heap segments of a remote DSP server.
520 *
521 * @param[in] server Server handle obtained from Engine_getServer().
522 * @param[out] numSegs The number of heap segments of the DSP server.
523 *
524 * @retval Server_EOK Success.
525 * @retval Server_ERUNTIME Internal runtime error occurred.
526 * @retval Server_ENOSERVER Engine has no server.
527 *
528 * @pre @c server is non-NULL.
529 * @pre @c numSegs is non-NULL.
530 *
531 * @post On success, numSegs will contain the number of memory heaps
532 * on the DSP.
533 *
534 * @sa Server_getMemStat().
535 *
536 * @remarks This API returns only the number of BIOS HeapMem heaps that
537 * have been statically configured into the server.
538 */
539extern Server_Status Server_getNumMemSegs(Server_Handle server, Int *numSegs);
540
541/** @cond INTERNAL */
542/*
543 * ======== Server_init ========
544 */
545extern Void Server_init(Void);
546/** @endcond */
547
548/*
549 * ======== Server_initAlgDesc ========
550 */
551/**
552 * @brief Initialize an Server_AlgDesc structure with default values.
553 *
554 * @param[in] pAlgDesc Location of Server_AlgDesc object to initialize.
555 * The fields of pAlgDesc will be set to the following:
556 * @code
557 * pAlgDesc->name = NULL;
558 * pAlgDesc->uuid.data = 0;
559 * pAlgDesc->fxns = NULL;
560 * pAlgDesc->idmaFxns = NULL;
561 * pAlgDesc->typeTab = NULL;
562 * pAlgDesc->isLocal = TRUE;
563 * pAlgDesc->groupId = 0;
564 * pAlgDesc->iresFxns = NULL;
565 * pAlgDesc->codecClassConfig = NULL;
566 * pAlgDesc->priority = 1;
567 * pAlgDesc->stackSize = 1024;
568 * pAlgDesc->types = NULL;
569 * pAlgDesc->stubFxnsName = NULL;
570 * pAlgDesc->skelFxns = NULL;
571 *
572 * Unused fields below are initialized to the
573 * following:
574 *
575 * pAlgDesc->rpcProtocolVersion = 0;
576 * pAlgDesc->memType = Engine_USECACHEDMEM_DEFAULT;
577 * pAlgDesc->stackSeg = 0;
578 *
579 * @endcode
580 *
581 * @sa Server_addAlg()
582 */
583extern Void Server_initAlgDesc(Server_AlgDesc *pAlgDesc);
584
585/*
586 * ======== Server_redefineHeap ========
587 */
588/**
589 * @brief Set the base address and size of a remote DSP server heap.
590 *
591 * @remarks
592 * This API is used to move and/or resize a named heap of the remote DSP
593 * server. The address passed to this API is a DSP address and the
594 * memory from @c base to @c base + @c size must be contiguous in physical
595 * memory. The size of the heap should be given in DSP MADUs (minimum
596 * addressable data units).
597 * The name of the heap can be at most #Server_MAXSEGNAMELENGTH
598 * characters long.
599 *
600 * For example, in the case of DM644x, suppose that an application wants
601 * to allocate a block of memory on the GPP to be used by the DSP server
602 * for the memory segment named "DDRALGHEAP". A block of physically
603 * contiguous memory could be obtained by Memory_alloc() and the
604 * corresponding DSP address obtained with
605 * Memory_getBufferPhysicalAddress(). This DSP address and the size
606 * of the block could then be passed to Server_redefineHeap().
607 * For example:
608 *
609 * @code
610 * Server_redefineHeap(server, "DDRALGHEAP", base, size);
611 * @endcode
612 *
613 * This function can only be called when there is no memory currently
614 * allocated in the heap (since the heap cannot be changed if it is being
615 * used).
616 *
617 * @param[in] server Server handle obtained from Engine_getServer().
618 * @param[in] name Name of heap to be redefined.
619 * @param[in] base Base address for algorithm heap.
620 * @param[in] size Size (DSP MADUs) of new heap.
621 *
622 * @retval Server_EOK Success.
623 * @retval Server_ERUNTIME Internal runtime error occurred.
624 * @retval Server_ENOTFOUND No heap with the specified name was found.
625 * @retval Server_EINVAL Changing to the new base and size would
626 * cause an overlap with another heap.
627 * @retval Server_EINUSE Memory is currently allocated in the heap.
628 *
629 * @pre @c server is non-NULL.
630 * @pre @c base is a DSP address of a physically contiguous
631 * block of memory.
632 * @pre @c base is aligned on an 8-byte boundary.
633 *
634 * @post On success, the server's algorithm heap base will have been
635 * set to @c base, and the size will have been set to @c size.
636 *
637 * @sa Server_restoreHeap().
638 *
639 * @remarks This API is not supported in Codec Engine 3.20.
640 */
641extern Server_Status Server_redefineHeap(Server_Handle server, String name,
642 Uint32 base, Uint32 size);
643
644#if 0
645/*
646 * ======== Server_removeAlg ========
647 */
648/*
649 * Currently not implemented.
650 *
651 * @brief Dynamically remove an algorithm that was added to a Server
652 * with Server_addAlg().
653 *
654 * @remarks The same values of the parameters @c name and @c server that
655 * were passed to Server_addAlg() should be used here. In
656 * particular, if @c name was used to add the alg, all handles to
657 * the engine named @c name must be closed before calling
658 * Server_removeAlg().
659 *
660 *
661 * @param[in] name The name of the engine or NULL, that was
662 * passed to Server_addAlg(). Set to NULL for now.
663 * Currently, only the default "local" engine is
664 * supported.
665 * @param[in] server The handle to a server, previously acquired
666 * by a call to Engine_getServer(), or NULL.
667 * Set to NULL for now. In the future, this will
668 * be used to dynamically remove remote
669 * algorithms from a server.
670 * @param[in] algName Name of the algorithm to remove.
671 *
672 * @retval Server_EOK Success.
673 * @retval Server_ENOTFOUND The server's underlying engine, @c name,
674 * does not exist.
675 * @retval Server_ENOTFOUND @c algName could not be found in the
676 * server's underlying engine table.
677 * @retval Server_EINUSE The server's underlying engine, @c name,
678 * is still open.
679 *
680 * @sa Server_addAlg()
681 */
682extern Server_Status Server_removeAlg(String name, Server_Handle server,
683 String algName);
684#endif
685
686/*
687 * ======== Server_restoreHeap ========
688 */
689/**
690 * @brief Set the base address and size of a remote DSP server heap
691 * back to their original values.
692 *
693 * This function resets the base address and size of a named heap of
694 * the remote server, back to their values before the first call to
695 * Server_redefineHeap() was made. The name of the heap can be at most
696 * #Server_MAXSEGNAMELENGTH characters long, otherwise this function
697 * will return #Server_ENOTFOUND.
698 *
699 * As with Server_redefineHeap(), this function can only be called when
700 * no memory is currently allocated from the heap (as the heap cannot be
701 * changed if it is being used).
702 *
703 * @param[in] server Server handle obtained through Engine_getServer().
704 * @param[in] name Name of the heap to be restored.
705 *
706 * @retval Server_EOK Success.
707 * @retval Server_ERUNTIME Internal runtime error occurred.
708 * @retval Server_ENOTFOUND No heap with the specified name was found.
709 * @retval Server_EINVAL Changing back to the original base and size
710 * would cause an overlap with another heap.
711 * @retval Server_EINUSE Memory is currently allocated in the heap.
712 *
713 * @pre @c server is non-NULL.
714 *
715 * @post On success, the server's algorithm heap base and size will
716 * have been reset to their original value.
717 *
718 * @sa Server_redefineHeap().
719 *
720 * @remarks This API is not supported in Codec Engine 3.20.
721 */
722extern Server_Status Server_restoreHeap(Server_Handle server, String name);
723
724/*
725 * ======== Server_setTrace ========
726 */
727/**
728 * @brief Set Server's trace mask
729 *
730 * @param[in] server Server handle obtained through Engine_getServer().
731 * @param[in] mask Trace mask, e.g. "*=01234567"
732 *
733 * @retval Server_EOK Success.
734 * @retval Server_EINUSE A connection for server trace is already
735 * established.
736 * @retval Server_ENOSERVER No server for the engine.
737 * @retval Server_ERUNTIME Internal runtime error occurred.
738 *
739 * @pre @c server is non-NULL.
740 * @pre @c Corresponding engine is in the open state.
741 *
742 * @remarks This only sets the trace for a remote server. To change
743 * the trace mask for the application-side of the framework,
744 * use Diags_setMask or Diags_setMaskMeta.
745 *
746 * @sa xdc.runtime.Diags
747 */
748extern Int Server_setTrace(Server_Handle server, String mask);
749
750/*@}*/ /* ingroup */
751
752#ifdef __cplusplus
753}
754#endif
755
756#endif
757/*
758 * @(#) ti.sdo.ce; 1, 0, 6,3; 6-13-2013 00:10:03; /db/atree/library/trees/ce/ce-w08/src/ xlibrary
759
760 */
761
diff --git a/packages/codec_engine/ti/sdo/ce/ServerDefs.h b/packages/codec_engine/ti/sdo/ce/ServerDefs.h
new file mode 100644
index 0000000..ec773e0
--- /dev/null
+++ b/packages/codec_engine/ti/sdo/ce/ServerDefs.h
@@ -0,0 +1,76 @@
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 * ======== ServerDefs.h ========
40 * Defs for Server module
41 */
42
43/**
44 * @file ti/sdo/ce/ServerDefs.h
45 *
46 * @brief The Codec Engine Server Definitions.
47 */
48/**
49 * @addtogroup ti_sdo_ce_Server Codec Engine Server Interface
50 */
51#ifndef ti_sdo_ce_ServerDefs_
52#define ti_sdo_ce_ServerDefs_
53
54#ifdef __cplusplus
55extern "C" {
56#endif
57
58
59/**
60 * @brief Opaque handle to the server for an engine.
61 */
62typedef struct Server_Obj *Server_Handle;
63
64
65/*@}*/ /* ingroup */
66
67#ifdef __cplusplus
68}
69#endif
70
71#endif
72/*
73 * @(#) ti.sdo.ce; 1, 0, 6,3; 6-13-2013 00:10:03; /db/atree/library/trees/ce/ce-w08/src/ xlibrary
74
75 */
76
diff --git a/packages/codec_engine/ti/sdo/ce/ipc/Comm.h b/packages/codec_engine/ti/sdo/ce/ipc/Comm.h
new file mode 100644
index 0000000..2e3877c
--- /dev/null
+++ b/packages/codec_engine/ti/sdo/ce/ipc/Comm.h
@@ -0,0 +1,235 @@
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 * ======== Comm.h ========
40 */
41#ifndef ti_sdo_ce_ipc_Comm_
42#define ti_sdo_ce_ipc_Comm_
43
44#ifdef __cplusplus
45extern "C" {
46#endif
47
48/**
49 * @brief Name to pass to Diags_setMask() to enable logging for Comm
50 * functions. For example,
51 * Diags_setMask(Comm_MODNAME"+EX1234567");
52 * turns on all Log statements in this module.
53 * Diags_setMask() must be called after initialization to take
54 * effect.
55 */
56#define Comm_MODNAME "ti.sdo.ce.ipc.Comm"
57
58#define Comm_GTNAME "OC"
59
60/*
61 * ======== Comm_MSGSIZE ========
62 * Maximum size of communication buffers, defined by the configuration
63 * parameter in Global.xdc.
64 */
65extern UInt32 Comm_MSGSIZE;
66
67typedef UInt32 Comm_Id;
68
69/*
70 * ======== Comm_Handle ========
71 */
72typedef struct Comm_Obj *Comm_Handle;
73
74/*
75 * ======== Comm_QType ========
76 */
77typedef enum {
78 Comm_PEND,
79 Comm_CALL
80} Comm_QType;
81
82/*
83 * ======== Comm_CallFxn ========
84 */
85typedef Void (*Comm_CallFxn)(Ptr callHandle);
86
87/*
88 * ======== Comm_Attrs ========
89 */
90typedef struct Comm_Attrs {
91 Comm_QType type;
92 Ptr callHandle;
93 Comm_CallFxn callFxn;
94} Comm_Attrs;
95
96extern Comm_Attrs Comm_ATTRS; /* default attrs */
97
98/*
99 * ======== Comm_MsgHeader ========
100 * Comm header must be defined, but its fields are irrelevant for the user
101 * Note: this header must be larger than all underlying msgq implementations
102 * (which require a header to maintain message control/transport information)
103 */
104typedef struct Comm_MsgHeader {
105 UInt32 reserved[2]; /* reserved[0] doubles as "next" in the linked list */
106 UInt32 size; /* UInt32 msgSize; */
107 UInt16 reserved1; /* UInt16 flags; */
108 UInt16 msgId; /* UInt16 msgId; */
109 UInt16 reserved3; /* UInt16 dstId; */
110 UInt16 reserved4; /* UInt16 dstProc; */
111 UInt16 reserved5; /* UInt16 replyId; */
112 UInt16 reserved6; /* UInt16 replyProc; */
113 UInt16 reserved7; /* UInt16 srcProc; */
114 UInt16 reserved8; /* UInt16 heapId; */
115 UInt16 reserved9; /* UInt16 seqNum; */
116 UInt32 reserved10; /* UInt32 reserved; */
117} Comm_MsgHeader, *Comm_Msg;
118
119/*
120 * ======== Comm_INVALIDMSGQ ========
121 */
122#define Comm_INVALIDMSGQ 0xFFFF
123#define Comm_INVALIDHANDLE NULL
124
125/*
126 * ======== error status codes ========
127 */
128#define Comm_EOK 0
129#define Comm_EFAIL 1
130#define Comm_ETIMEOUT 2
131
132/*
133 * ======== timeout values ========
134 */
135#define Comm_FOREVER ((UInt)-1)
136#define Comm_POLL ((UInt)0)
137
138/*
139 * ======== Comm_locate ========
140 * Locate an existing communication queue
141 */
142extern Int Comm_locate(String queueName, Comm_Id *msgqId);
143
144/*
145 * ======== Comm_alloc ========
146 * Allocate a message that can be sent to a communication queue
147 */
148extern Int Comm_alloc(UInt16 poolId, Comm_Msg *msg, UInt16 size);
149
150/*
151 * ======== Comm_free ========
152 * Free a previously allocated (Comm_alloc) message
153 */
154extern Int Comm_free(Comm_Msg msg);
155
156/*
157 * ======== Comm_put ========
158 * Send message to specified communication queue
159 */
160extern Int Comm_put(Comm_Id msgqId, Comm_Msg msg);
161
162/*
163 * ======== Comm_get ========
164 * Recieve a message from the specified queue
165 */
166extern Int Comm_get(Comm_Handle comm, Comm_Msg *msg, UInt timeout);
167
168/*
169 * ======== Comm_getMsgSize ========
170 * Get size of the specified message
171 */
172extern Int Comm_getMsgSize(Comm_Msg msg);
173
174/*
175 * ======== Comm_getSrcQueue ========
176 * Get id of sender queue from message
177 */
178extern Int Comm_getSendersId(Comm_Msg msg, Comm_Id *msgqId);
179
180/*
181 * ======== Comm_getId ========
182 * Get MessageQ_QueueId from MessageQ_Handle
183 */
184extern Comm_Id Comm_getId(Comm_Handle comm);
185
186/*
187 * ======== Comm_staticMsgInit ========
188 * Initialize fields of a static Comm_Msg.
189 */
190extern Void Comm_staticMsgInit(Comm_Msg msg, UInt32 size);
191
192/*
193 * ======== Comm_setSrcQueue ========
194 * Put id of sender queue into message
195 */
196extern Void Comm_setReplyToHandle(Comm_Msg msg, Comm_Handle comm);
197
198/*
199 * ======== Comm_create ========
200 * Create a new communication queue
201 */
202extern Comm_Handle Comm_create(String queueName, Comm_Attrs *myAttrs);
203
204/*
205 * ======== Comm_delete ========
206 * its evil twin, the delete() function
207 */
208extern Void Comm_delete(Comm_Handle msgq);
209
210/*
211 * ======== Comm_init ========
212 */
213extern Bool Comm_init(Void);
214
215/*
216 * ======== Comm_exit ========
217 */
218extern Void Comm_exit(Void);
219
220/*
221 * ======== Comm_release ========
222 */
223extern Int Comm_release(Comm_Id msgqId);
224
225
226#ifdef __cplusplus
227}
228#endif
229
230#endif
231/*
232 * @(#) ti.sdo.ce.ipc; 2, 0, 1,3; 6-13-2013 00:15:57; /db/atree/library/trees/ce/ce-w08/src/ xlibrary
233
234 */
235
diff --git a/packages/codec_engine/ti/sdo/ce/node/node.h b/packages/codec_engine/ti/sdo/ce/node/node.h
new file mode 100644
index 0000000..b71b9d1
--- /dev/null
+++ b/packages/codec_engine/ti/sdo/ce/node/node.h
@@ -0,0 +1,209 @@
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 * ======== node.h ========
40 * NODE module definitions.
41 */
42/**
43 * @file ti/sdo/ce/node/node.h
44 *
45 * @brief The Codec Engine Internal NODE API.
46 */
47/**
48 * @addtogroup ti_sdo_ce_NODE CE NODE API
49 */
50
51#ifndef ti_sdo_ce_node_NODE_
52#define ti_sdo_ce_node_NODE_
53
54#include <ti/sdo/ce/ipc/Comm.h>
55
56#ifdef __cplusplus
57extern "C" {
58#endif
59
60/** @ingroup ti_sdo_ce_NODE */
61/*@{*/
62
63/** @cond INTERNAL */
64
65#define NODE_FOREVER (UInt)-1 /* infinite timeout (Comm_FOREVER) */
66#define NODE_TOGPP 0 /* GPP is the destination for message */
67
68typedef struct NODE_Obj *NODE_EnvPtr; /* pointer to a node's environment */
69
70typedef struct NODE_Config {
71 Int OBJSEG; /* allocate node instances from this MEM seg id */
72 Int MSGQPOOLID; /* Segment to allocate message frames */
73 Int FIXEDMSGSIZE; /* if >0, size NODE must use with Comm_alloc */
74} NODE_Config;
75
76extern NODE_Config *NODE;
77
78/*
79 * ======== NODE_Cmd ========
80 */
81typedef struct NODE_Cmd {
82 Int id;
83 UArg arg1;
84 UArg arg2;
85} NODE_Cmd;
86
87#define NODE_CCALL 0 /* "normal" call command id */
88#define NODE_CEXIT 1 /* exit command id */
89
90/*
91 * ======== NODE_MsgHeader ========
92 */
93typedef struct NODE_MsgHeader {
94 Comm_MsgHeader header;
95 NODE_Cmd cmd;
96} NODE_MsgHeader;
97
98/*
99 * ======== NODE_Msg ========
100 */
101typedef struct NODE_MsgHeader *NODE_Msg;
102
103/**
104 * @brief NODE error code
105 */
106typedef Int NODE_Status;
107
108#define NODE_EOK 0 /**< Success. */
109#define NODE_EOUTOFMEMORY 1 /**< Unable to allocate memory. */
110#define NODE_ERESOURCE 2 /**< Unable to obtain a necessary resource. */
111#define NODE_ETASK 3 /**< Unable to create a task. */
112#define NODE_EFAIL 4 /**< General error. */
113
114/* The Node UUID structure */
115typedef struct NODE_Uuid {
116 UInt32 data;
117} NODE_Uuid;
118
119/*
120 * ======== NODE_allocMsgBuf ========
121 * Allocate a data buffer whose descriptor will be passed to the GPP within
122 * a message.
123 *
124 * Parameters:
125 * node: Node's environment.
126 * size: Size of buffer, in DSP MAUs.
127 * align: Buffer alignment.
128 *
129 * Returns:
130 * On Success: Address of the allocated buffer.
131 * On Failure: NULL.
132 *
133 */
134extern Ptr NODE_allocMsgBuf(NODE_EnvPtr node, UInt size, UInt align);
135
136
137/*
138 * ======== NODE_freeMsgBuf ========
139 * Free a data buffer previously allocated with NODE_allocMsgBuf.
140 *
141 * Parameters:
142 * node: Node's environment.
143 * addr: Address of the data buffer.
144 * size: Size of the allocated buffer, in DSP MAUs.
145 *
146 * Returns:
147 * On Success: TRUE.
148 * On Failure: FALSE. A failure occurs when the specified address does
149 * not reside in the memory segment used for allocations by
150 * NODE_allocMsgBuf().
151 *
152 */
153extern Bool NODE_freeMsgBuf(NODE_EnvPtr node, Ptr addr, UInt size);
154
155
156/*
157 * ======== NODE_getPri ========
158 * Retrieve the task priority of a node.
159 *
160 * Parameters:
161 * node: Node's environment.
162 *
163 * Returns:
164 * taksPriority: the task priority set for the node
165 *
166 * Constraints:
167 * none
168 *
169 * Requires:
170 * node != NULL
171 *
172 */
173extern UInt NODE_getPri(NODE_EnvPtr node);
174
175/*
176 * ======== NODE_init ========
177 */
178extern Void NODE_init(Void);
179
180/*
181 * ======== NODE_exit ========
182 */
183extern Void NODE_exit(Void);
184
185/*
186 * ======== NODE_uuidMatch ========
187 *
188 * Determine whether a uuid matches another.
189 *
190 */
191static inline Bool NODE_uuidMatch(NODE_Uuid *uuid1, NODE_Uuid *uuid2)
192{
193 return (uuid1->data == uuid2->data);
194}
195
196/** @endcond */
197
198/*@}*/
199
200#ifdef __cplusplus
201}
202#endif
203
204#endif
205/*
206 * @(#) ti.sdo.ce.node; 1, 0, 0,3; 6-13-2013 00:16:28; /db/atree/library/trees/ce/ce-w08/src/ xlibrary
207
208 */
209
diff --git a/packages/codec_engine/ti/sdo/ce/skel.h b/packages/codec_engine/ti/sdo/ce/skel.h
new file mode 100644
index 0000000..58cde54
--- /dev/null
+++ b/packages/codec_engine/ti/sdo/ce/skel.h
@@ -0,0 +1,137 @@
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 * ======== skel.h ========
40 */
41/**
42 * @file ti/sdo/ce/skel.h
43 *
44 * @brief The Codec Engine System Programming Interface (SPI) for
45 * skeleton developers.
46 */
47/**
48 * @addtogroup ti_sdo_ce_SKEL CE Skeleton SPI
49 */
50
51#ifndef ti_sdo_ce_SKEL_
52#define ti_sdo_ce_SKEL_
53
54#ifdef __cplusplus
55extern "C" {
56#endif
57
58#include <ti/sdo/ce/visa.h>
59
60/** @ingroup ti_sdo_ce_SKEL */
61/*@{*/
62
63/**
64 * @brief Prototype for a skeleton's call() implementation
65 *
66 * @param[in] handle A handle to the current skeleton.
67 * @param[in] msg A message sent by the algorithm's stub
68 */
69typedef VISA_Status (*SKEL_CALLFXN)(VISA_Handle handle, VISA_Msg msg);
70
71/**
72 * @brief Prototype for a skeleton's create() API.
73 *
74 * @param[in] reserved Reserved.
75 * @param[in] name Name of the algorithm to create.
76 * @param[in] params Creation parameters for the algorithm.
77 *
78 * @retval NULL Error, unable to create the algorithm.
79 * @retval non-NULL Handle to the successfully created algorithm.
80 */
81typedef VISA_Handle (*SKEL_CREATEFXN)(Void *reserved, String name,
82 Void *params);
83
84/**
85 * @brief Prototype for a skeleton's destroy() API.
86 *
87 * @param[in] handle A handle to the current skeleton.
88 * @param[in] msg A message sent by the algorithm's stub
89 */
90typedef Void (*SKEL_DESTROYFXN)(VISA_Handle handle);
91
92
93/*
94 * ======== SKEL_Fxns ========
95 */
96/**
97 * @brief Table of functions defining the interface of a skeleton.
98 */
99typedef struct SKEL_Fxns {
100 SKEL_CALLFXN call; /**< A skeleton's "call" implementation. */
101 SKEL_CREATEFXN apiCreate; /**< A skeleton's "create" API. */
102 SKEL_DESTROYFXN apiDestroy; /**< A skeleton's "destroy" API. */
103} SKEL_Fxns;
104
105/** @cond INTERNAL */
106
107/**
108 * @brief Cache policies for managing i/o buffers.
109 */
110#define SKEL_LOCALBUFFERINVWB 0
111#define SKEL_WBINVALL 1
112#define SKEL_CACHENONE 2
113
114/**
115 * @brief Cache policy that will be used by all skeletons for managing
116 * i/o buffers. This is auto-generated by Server.xdt.
117 */
118extern Int ti_sdo_ce_Server_skelCachingPolicy;
119
120#define SKEL_cachingPolicy ti_sdo_ce_Server_skelCachingPolicy
121
122
123/** @endcond */
124
125
126/*@}*/
127
128#ifdef __cplusplus
129}
130#endif
131
132#endif /* _SKEL_ */
133/*
134 * @(#) ti.sdo.ce; 1, 0, 6,3; 6-13-2013 00:10:04; /db/atree/library/trees/ce/ce-w08/src/ xlibrary
135
136 */
137
diff --git a/packages/codec_engine/ti/sdo/ce/video2/videnc2.h b/packages/codec_engine/ti/sdo/ce/video2/videnc2.h
new file mode 100644
index 0000000..9f4041c
--- /dev/null
+++ b/packages/codec_engine/ti/sdo/ce/video2/videnc2.h
@@ -0,0 +1,401 @@
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 * ======== videnc2.h ========
40 */
41/**
42 * @file ti/sdo/ce/video2/videnc2.h
43 *
44 * @brief The VIDENC2 video encoder interface. Provides the user an
45 * interface to create and interact with XDAIS algorithms that are
46 * compliant with the XDM-defined IVIDENC2 video encoder
47 * interface.
48 */
49/**
50 * @defgroup ti_sdo_ce_video2_VIDENC2 VIDENC2 - Video Encoder Interface
51 *
52 * This is the VIDENC2 video encoder interface. Several of the data
53 * types in this API are specified by the XDM IVIDENC2 interface; please see
54 * the XDM documentation for those details.
55 */
56
57#ifndef ti_sdo_ce_video2_VIDENC2_
58#define ti_sdo_ce_video2_VIDENC2_
59
60#ifdef __cplusplus
61extern "C" {
62#endif
63
64#include <ti/xdais/dm/xdm.h>
65#include <ti/xdais/dm/ividenc2.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_VIDENC2 */
72/*@{*/
73
74#define VIDENC2_EOK IVIDENC2_EOK /**< @copydoc IVIDENC2_EOK */
75#define VIDENC2_EFAIL IVIDENC2_EFAIL /**< @copydoc IVIDENC2_EFAIL */
76
77/** @copydoc IVIDENC2_EUNSUPPORTED */
78#define VIDENC2_EUNSUPPORTED IVIDENC2_EUNSUPPORTED
79
80#define VIDENC2_ETIMEOUT VISA_ETIMEOUT /**< @copydoc VISA_ETIMEOUT */
81#define VIDENC2_FOREVER VISA_FOREVER /**< @copydoc VISA_FOREVER */
82
83
84/**
85 * @brief The VISA type
86 */
87#define VIDENC2_VISATYPE "ti.sdo.ce.video2.IVIDENC2"
88
89/**
90 * @brief Name of stub functions. Use this name when registering the
91 * VIDENC2_STUBS functions with Engine_addStubFxns.
92 *
93 * @sa Engine_addStubFxns
94 */
95#define VIDENC2_STUBSNAME "VIDENC2_STUBS"
96
97
98/**
99 * @brief Opaque handle to a VIDENC2 codec.
100 */
101typedef VISA_Handle VIDENC2_Handle;
102
103/* The following are just wrapper typedefs */
104
105/** @copydoc IVIDENC2_Params */
106typedef struct IVIDENC2_Params VIDENC2_Params;
107
108/** @copydoc IVIDENC2_InArgs */
109typedef IVIDENC2_InArgs VIDENC2_InArgs;
110
111/** @copydoc IVIDENC2_OutArgs */
112typedef IVIDENC2_OutArgs VIDENC2_OutArgs;
113
114/** @copydoc IVIDENC2_Cmd */
115typedef IVIDENC2_Cmd VIDENC2_Cmd;
116
117/** @copydoc IVIDENC2_DynamicParams */
118typedef IVIDENC2_DynamicParams VIDENC2_DynamicParams;
119
120/** @copydoc IVIDENC2_Status */
121typedef IVIDENC2_Status VIDENC2_Status;
122
123/** @cond INTERNAL */
124
125/**
126 * @brief An implementation of the skel interface; the skeleton side
127 * of the stubs.
128 */
129extern SKEL_Fxns VIDENC2_SKEL;
130
131/**
132 * @brief Implementation of the IVIDENC interface that is run remotely.
133 */
134extern IVIDENC2_Fxns VIDENC2_STUBS;
135
136/** @endcond */
137
138/**
139 * @brief Definition of IVIDENC2 codec class configurable parameters
140 *
141 * @sa VISA_getCodecClassConfig()
142 */
143typedef struct IVIDENC2_CodecClassConfig {
144 Bool manageInBufsPlaneDescCache[IVIDEO_MAX_NUM_PLANES];
145 Bool manageInBufsMetaPlaneDescCache[IVIDEO_MAX_NUM_METADATA_PLANES];
146 Bool manageOutBufsCache[XDM_MAX_IO_BUFFERS];
147} IVIDENC2_CodecClassConfig;
148
149
150/*
151 * ======== VIDENC2_control ========
152 */
153/**
154 * @brief Execute the control() method in this instance of a video
155 * encoder algorithm.
156 *
157 * @param[in] handle Handle to a created video encoder instance.
158 * @param[in] id Command id for XDM control operation.
159 * @param[in] params Runtime control parameters used for encoding.
160 * @param[out] status Status info upon completion of encode operation.
161 *
162 * @pre @c handle is a valid (non-NULL) video encoder handle
163 * and the video encoder is in the created state.
164 *
165 * @retval #VIDENC2_EOK Success.
166 * @retval #VIDENC2_EFAIL Failure.
167 * @retval #VIDENC2_EUNSUPPORTED The requested operation
168 * is not supported.
169 *
170 * @remark This is a blocking call, and will return after the control
171 * command has been executed.
172 *
173 * @remark If an error is returned, @c status->extendedError may
174 * indicate further details about the error. See
175 * #VIDENC2_Status::extendedError for details.
176 *
177 * @sa VIDENC2_create()
178 * @sa VIDENC2_delete()
179 * @sa IVIDENC2_Fxns::process()
180 */
181extern Int32 VIDENC2_control(VIDENC2_Handle handle, VIDENC2_Cmd id,
182 VIDENC2_DynamicParams *params, VIDENC2_Status *status);
183
184
185/*
186 * ======== VIDENC2_create ========
187 */
188/**
189 * @brief Create an instance of a video encoder algorithm.
190 *
191 * Instance handles must not be concurrently accessed by multiple threads;
192 * each thread must either obtain its own handle (via VIDENC2_create()) or
193 * explicitly serialize access to a shared handle.
194 *
195 * @param[in] e Handle to an opened engine.
196 * @param[in] name String identifier of the type of video encoder
197 * to create.
198 * @param[in] params Creation parameters.
199 *
200 * @retval NULL An error has occurred.
201 * @retval non-NULL The handle to the newly created video encoder
202 * instance.
203 *
204 * @remarks @c params is optional. If it's not supplied, codec-specific
205 * default params will be used.
206 *
207 * @remark Depending on the configuration of the engine opened, this
208 * call may create a local or remote instance of the video
209 * encoder.
210 *
211 * @codecNameRemark
212 *
213 * @sa Engine_open()
214 * @sa VIDENC2_delete()
215 */
216extern VIDENC2_Handle VIDENC2_create(Engine_Handle e, String name,
217 VIDENC2_Params *params);
218
219
220/*
221 * ======== VIDENC2_delete ========
222 */
223/**
224 * @brief Delete the instance of a video encoder algorithm.
225 *
226 * @param[in] handle Handle to a created video encoder instance.
227 *
228 * @remark Depending on the configuration of the engine opened, this
229 * call may delete a local or remote instance of the video
230 * encoder.
231 *
232 * @pre @c handle is a valid (non-NULL) handle which is
233 * in the created state.
234 *
235 * @post All resources allocated as part of the VIDENC2_create()
236 * operation (memory, DMA channels, etc.) are freed.
237 *
238 * @sa VIDENC2_create()
239 */
240extern Void VIDENC2_delete(VIDENC2_Handle handle);
241
242
243/*
244 * ======== VIDENC2_process ========
245 */
246/**
247 * @brief Execute the process() method in this instance of a video
248 * encoder algorithm.
249 *
250 * @param[in] handle Handle to a created video encoder instance.
251 * @param[in] inBufs A buffer descriptor containing input buffers.
252 * @param[out] outBufs A buffer descriptor containing output buffers.
253 * @param[in] inArgs Input Arguments.
254 * @param[out] outArgs Output Arguments.
255 *
256 * @pre @c handle is a valid (non-NULL) video encoder handle
257 * and the video encoder is in the created state.
258 *
259 * @retval #VIDENC2_EOK Success.
260 * @retval #VIDENC2_EFAIL Failure.
261 * @retval #VIDENC2_EUNSUPPORTED The requested operation
262 * is not supported.
263 *
264 * @remark Since the VIDENC2 decoder contains support for asynchronous
265 * buffer submission and retrieval, this API becomes known as
266 * synchronous in nature.
267 *
268 * @remark This is a blocking call, and will return after the data
269 * has been encoded.
270 *
271 * @remark The buffers supplied to VIDENC2_process() may have constraints
272 * put on them. For example, in dual-processor, shared memory
273 * architectures, where the codec is running on a remote
274 * processor, the buffers may need to be physically contiguous.
275 * Additionally, the remote processor may place restrictions on
276 * buffer alignment.
277 *
278 * @remark If an error is returned, @c outArgs->extendedError may
279 * indicate further details about the error. See
280 * #VIDENC2_OutArgs::extendedError for details.
281 *
282 * @sa VIDENC2_create()
283 * @sa VIDENC2_delete()
284 * @sa VIDENC2_control()
285 * @sa VIDENC2_processAsync()
286 * @sa VIDENC2_processWait()
287 * @sa IVIDENC2_Fxns::process() - the reflected algorithm interface,
288 * which may contain further usage
289 * details.
290 */
291extern Int32 VIDENC2_process(VIDENC2_Handle handle, IVIDEO2_BufDesc *inBufs,
292 XDM2_BufDesc *outBufs, VIDENC2_InArgs *inArgs,
293 VIDENC2_OutArgs *outArgs);
294
295
296/*
297 * ======== VIDENC2_processAsync ========
298 */
299/**
300 * @brief Perform asynchronous submission to this instance of a video
301 * decoder algorithm.
302 *
303 * @param[in] handle Handle to a created video decoder instance.
304 * @param[in] inBufs A buffer descriptor containing input buffers.
305 * @param[out] outBufs A buffer descriptor containing output buffers.
306 * @param[in] inArgs Input Arguments.
307 * @param[out] outArgs Output Arguments.
308 *
309 * @pre @c handle is a valid (non-NULL) video decoder handle
310 * and the video decoder is in the created state.
311 *
312 * @retval #VIDENC2_EOK Success.
313 * @retval #VIDENC2_EFAIL Failure.
314 * @retval #VIDENC2_EUNSUPPORTED Unsupported request.
315 *
316 * @remark This API is the asynchronous counterpart to the process()
317 * method. It allows for buffer and argument submission without
318 * waiting for retrieval. A response is retrieved using the
319 * VIDENC2_processWait() API.
320 *
321 * @remark The buffers supplied to VIDENC2_processAsync() may have
322 * constraints put on them. For example, in dual-processor,
323 * shared memory architectures, where the codec is running on a
324 * remote processor, the buffers may need to be physically
325 * contiguous. Additionally, the remote processor may place
326 * restrictions on buffer alignment.
327 *
328 * @sa VIDENC2_create()
329 * @sa VIDENC2_delete()
330 * @sa VIDENC2_control()
331 * @sa VIDENC2_process()
332 * @sa VIDENC2_processWait()
333 * @sa IVIDENC2_Fxns::process()
334 */
335extern XDAS_Int32 VIDENC2_processAsync(VIDENC2_Handle handle,
336 IVIDEO2_BufDesc *inBufs, XDM2_BufDesc *outBufs,
337 IVIDENC2_InArgs *inArgs, IVIDENC2_OutArgs *outArgs);
338
339
340/*
341 * ======== VIDENC2_processWait ========
342 */
343/**
344 * @brief Wait for a return message from a previous invocation of
345 * VIDENC2_processAsync() in this instance of an video decoder
346 * algorithm.
347 *
348 * @param[in] handle Handle to a created video decoder instance.
349 * @param[in] inBufs A buffer descriptor containing input buffers.
350 * @param[out] outBufs A buffer descriptor containing output buffers.
351 * @param[in] inArgs Input Arguments.
352 * @param[out] outArgs Output Arguments.
353 * @param[in] timeout Amount of "time" to wait (from 0 -> #VIDENC2_FOREVER)
354 *
355 * @pre @c handle is a valid (non-NULL) video decoder handle
356 * and the video decoder is in the created state.
357 *
358 * @retval #VIDENC2_EOK Success.
359 * @retval #VIDENC2_EFAIL Failure.
360 * @retval #VIDENC2_EUNSUPPORTED Unsupported request.
361 * @retval #VIDENC2_ETIMEOUT Operation timed out.
362 *
363 * @remark This is a blocking call, and will return after the data
364 * has been decoded.
365 *
366 * @remark "Polling" is supported by using a timeout of 0. Waiting
367 * forever is supported by using a timeout of #VIDENC2_FOREVER.
368 *
369 * @remark There must have previously been an invocation of the
370 * VIDENC2_processAsync() API.
371 *
372 * @remark The buffers supplied to VIDENC2_processAsync() may have
373 * constraints put on them. For example, in dual-processor,
374 * shared memory architectures, where the codec is running on a
375 * remote processor, the buffers may need to be physically
376 * contiguous. Additionally, the remote processor may place
377 * restrictions on buffer alignment.
378 *
379 * @sa VIDENC2_create()
380 * @sa VIDENC2_delete()
381 * @sa VIDENC2_control()
382 * @sa VIDENC2_process()
383 * @sa VIDENC2_processAsync()
384 */
385extern XDAS_Int32 VIDENC2_processWait(VIDENC2_Handle handle,
386 IVIDEO2_BufDesc *inBufs, XDM2_BufDesc *outBufs, IVIDENC2_InArgs *inArgs,
387 IVIDENC2_OutArgs *outArgs, UInt timeout);
388
389
390/*@}*/
391
392#ifdef __cplusplus
393}
394#endif
395
396#endif
397/*
398 * @(#) ti.sdo.ce.video2; 1, 0, 3,3; 6-13-2013 00:20:38; /db/atree/library/trees/ce/ce-w08/src/ xlibrary
399
400 */
401
diff --git a/packages/codec_engine/ti/sdo/ce/video3/viddec3.h b/packages/codec_engine/ti/sdo/ce/video3/viddec3.h
new file mode 100644
index 0000000..0272755
--- /dev/null
+++ b/packages/codec_engine/ti/sdo/ce/video3/viddec3.h
@@ -0,0 +1,396 @@
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 * ======== viddec3.h ========
40 */
41/**
42 * @file ti/sdo/ce/video3/viddec3.h
43 *
44 * @brief The VIDDEC3 video decoder interface. Provides the user an
45 * interface to create and interact with XDAIS algorithms that are
46 * compliant with the XDM-defined IVIDDEC3 video decoder
47 * interface.
48 */
49/**
50 * @defgroup ti_sdo_ce_video3_VIDDEC3 VIDDEC3 - Video Decoder Interface
51 *
52 * This is the VIDDEC3 video decoder interface. Several of the data
53 * types in this API are specified by the XDM IVIDDEC3 interface; please see
54 * the XDM documentation for those details.
55 */
56
57#ifndef ti_sdo_ce_video3_VIDDEC3_
58#define ti_sdo_ce_video3_VIDDEC3_
59
60#ifdef __cplusplus
61extern "C" {
62#endif
63
64#include <ti/xdais/dm/xdm.h>
65#include <ti/xdais/dm/ividdec3.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_video3_VIDDEC3 */
72/*@{*/
73
74#define VIDDEC3_EOK IVIDDEC3_EOK /**< @copydoc IVIDDEC3_EOK */
75#define VIDDEC3_EFAIL IVIDDEC3_EFAIL /**< @copydoc IVIDDEC3_EFAIL */
76
77/**< @copydoc IVIDDEC3_EUNSUPPORTED */
78#define VIDDEC3_EUNSUPPORTED IVIDDEC3_EUNSUPPORTED
79
80#define VIDDEC3_ETIMEOUT VISA_ETIMEOUT /**< @copydoc VISA_ETIMEOUT */
81#define VIDDEC3_FOREVER VISA_FOREVER /**< @copydoc VISA_FOREVER */
82
83/**
84 * @brief The VISA type
85 */
86#define VIDDEC3_VISATYPE "ti.sdo.ce.video3.IVIDDEC3"
87
88/**
89 * @brief Name of stub functions. Use this name when registering the
90 * VIDDEC3_STUBS functions with Engine_addStubFxns.
91 *
92 * @sa Engine_addStubFxns
93 */
94#define VIDDEC3_STUBSNAME "VIDDEC3_STUBS"
95
96
97/**
98 * @brief Opaque handle to a VIDDEC3 codec.
99 */
100typedef VISA_Handle VIDDEC3_Handle;
101
102/** @copydoc IVIDDEC3_Params */
103typedef struct IVIDDEC3_Params VIDDEC3_Params;
104
105/** @copydoc IVIDDEC3_InArgs */
106typedef IVIDDEC3_InArgs VIDDEC3_InArgs;
107
108/** @copydoc IVIDDEC3_OutArgs */
109typedef IVIDDEC3_OutArgs VIDDEC3_OutArgs;
110
111/** @copydoc IVIDDEC3_Cmd */
112typedef IVIDDEC3_Cmd VIDDEC3_Cmd;
113
114/** @copydoc IVIDDEC3_DynamicParams */
115typedef IVIDDEC3_DynamicParams VIDDEC3_DynamicParams;
116
117/** @copydoc IVIDDEC3_Status */
118typedef IVIDDEC3_Status VIDDEC3_Status;
119
120
121/** @cond INTERNAL */
122
123/**
124 * @brief An implementation of the skel interface; the skeleton side
125 * of the stubs.
126 */
127extern SKEL_Fxns VIDDEC3_SKEL;
128
129/**
130 * @brief Implementation of the IVIDDEC3 interface that is run remotely.
131 */
132extern IVIDDEC3_Fxns VIDDEC3_STUBS;
133
134/** @endcond */
135
136/**
137 * @brief Definition of IVIDDEC3 codec class configurable parameters
138 *
139 * @sa VISA_getCodecClassConfig()
140 */
141typedef struct IVIDDEC3_CodecClassConfig {
142 Bool manageInBufsCache [ XDM_MAX_IO_BUFFERS ];
143 Bool manageOutBufsCache [ XDM_MAX_IO_BUFFERS ];
144} IVIDDEC3_CodecClassConfig;
145
146
147/*
148 * ======== VIDDEC3_control ========
149 */
150/**
151 * @brief Execute the control() method in this instance of a video
152 * decoder algorithm.
153 *
154 * @param[in] handle Handle to a created video decoder instance.
155 * @param[in] id Command id for XDM control operation.
156 * @param[in] params Runtime control parameters used for decoding.
157 * @param[out] status Status info upon completion of decode operation.
158 *
159 * @pre @c handle is a valid (non-NULL) video decoder handle
160 * and the video decoder is in the created state.
161 *
162 * @retval #VIDDEC3_EOK Success.
163 * @retval #VIDDEC3_EFAIL Failure.
164 * @retval #VIDDEC3_EUNSUPPORTED Unsupported request.
165 *
166 * @remark This is a blocking call, and will return after the control
167 * command has been executed.
168 *
169 * @remark If an error is returned, @c status->extendedError may
170 * indicate further details about the error. See #XDM_ErrorBit
171 * for details.
172 *
173 * @sa VIDDEC3_create()
174 * @sa VIDDEC3_delete()
175 * @sa IVIDDEC3_Fxns::process()
176 */
177extern Int32 VIDDEC3_control(VIDDEC3_Handle handle, VIDDEC3_Cmd id,
178 VIDDEC3_DynamicParams *params, VIDDEC3_Status *status);
179
180
181/*
182 * ======== VIDDEC3_create ========
183 */
184/**
185 * @brief Create an instance of a video decoder algorithm.
186 *
187 * Instance handles must not be concurrently accessed by multiple threads;
188 * each thread must either obtain its own handle (via VIDDEC3_create) or
189 * explicitly serialize access to a shared handle.
190 *
191 * @param[in] e Handle to an opened engine.
192 * @param[in] name String identifier of the type of video decoder
193 * to create.
194 * @param[in] params Creation parameters.
195 *
196 * @retval NULL An error has occurred.
197 * @retval non-NULL The handle to the newly created video decoder
198 * instance.
199 *
200 * @remark @c params is optional. If it's not supplied, codec-specific
201 * default params will be used.
202 *
203 * @remark Depending on the configuration of the engine opened, this
204 * call may create a local or remote instance of the video
205 * decoder.
206 *
207 * @codecNameRemark
208 *
209 * @sa Engine_open()
210 * @sa VIDENC3_delete()
211 */
212extern VIDDEC3_Handle VIDDEC3_create(Engine_Handle e, String name,
213 VIDDEC3_Params *params);
214
215
216/*
217 * ======== VIDDEC3_delete ========
218 */
219/**
220 * @brief Delete the instance of a video decoder algorithm.
221 *
222 * @param[in] handle Handle to a created video decoder instance.
223 *
224 * @remark Depending on the configuration of the engine opened, this
225 * call may delete a local or remote instance of the video
226 * decoder.
227 *
228 * @pre @c handle is a valid (non-NULL) handle which is
229 * in the created state.
230 *
231 * @post All resources allocated as part of the VIDDEC3_create()
232 * operation (memory, DMA channels, etc.) are freed.
233 *
234 * @sa VIDDEC3_create()
235 */
236extern Void VIDDEC3_delete(VIDDEC3_Handle handle);
237
238
239/*
240 * ======== VIDDEC3_process ========
241 */
242/**
243 * @brief Execute the process() method in this instance of a video
244 * decoder algorithm.
245 *
246 * @param[in] handle Handle to a created video decoder instance.
247 * @param[in] inBufs A buffer descriptor containing input buffers.
248 * @param[out] outBufs A buffer descriptor containing output buffers.
249 * @param[in] inArgs Input Arguments.
250 * @param[out] outArgs Output Arguments.
251 *
252 * @pre @c handle is a valid (non-NULL) video decoder handle
253 * and the video decoder is in the created state.
254 *
255 * @retval #VIDDEC3_EOK Success.
256 * @retval #VIDDEC3_EFAIL Failure.
257 * @retval #VIDDEC3_EUNSUPPORTED Unsupported request.
258 *
259 * @remark Since the VIDDEC3 decoder contains support for asynchronous
260 * buffer submission and retrieval, this API becomes known as
261 * synchronous in nature.
262 *
263 * @remark This is a blocking call, and will return after the data
264 * has been decoded.
265 *
266 * @remark The buffers supplied to VIDDEC3_process() may have constraints
267 * put on them. For example, in dual-processor, shared memory
268 * architectures, where the codec is running on a remote
269 * processor, the buffers may need to be physically contiguous.
270 * Additionally, the remote processor may place restrictions on
271 * buffer alignment.
272 *
273 * @remark If an error is returned, @c outArgs->extendedError may
274 * indicate further details about the error. See #XDM_ErrorBit
275 * for details.
276 *
277 * @sa VIDDEC3_create()
278 * @sa VIDDEC3_delete()
279 * @sa VIDDEC3_control()
280 * @sa VIDDEC3_processAsync()
281 * @sa VIDDEC3_processWait()
282 * @sa IVIDDEC3_Fxns::process()
283 */
284extern Int32 VIDDEC3_process(VIDDEC3_Handle handle, XDM2_BufDesc *inBufs,
285 XDM2_BufDesc *outBufs, VIDDEC3_InArgs *inArgs, VIDDEC3_OutArgs *outArgs);
286
287
288#if 0 /* async not yet supported */
289
290/*
291 * ======== VIDDEC3_processAsync ========
292 */
293/**
294 * @brief Perform asynchronous submission to this instance of a video
295 * decoder algorithm.
296 *
297 * @param[in] handle Handle to a created video decoder instance.
298 * @param[in] inBufs A buffer descriptor containing input buffers.
299 * @param[out] outBufs A buffer descriptor containing output buffers.
300 * @param[in] inArgs Input Arguments.
301 * @param[out] outArgs Output Arguments.
302 *
303 * @pre @c handle is a valid (non-NULL) video decoder handle
304 * and the video decoder is in the created state.
305 *
306 * @retval #VIDDEC3_EOK Success.
307 * @retval #VIDDEC3_EFAIL Failure.
308 * @retval #VIDDEC3_EUNSUPPORTED Unsupported request.
309 *
310 * @remark This API is the asynchronous counterpart to the process()
311 * method. It allows for buffer and argument submission without
312 * waiting for retrieval. A response is retrieved using the
313 * VIDDEC3_processWait() API.
314 *
315 * @remark The buffers supplied to VIDDEC3_processAsync() may have
316 * constraints put on them. For example, in dual-processor,
317 * shared memory architectures, where the codec is running on a
318 * remote processor, the buffers may need to be physically
319 * contiguous. Additionally, the remote processor may place
320 * restrictions on buffer alignment.
321 *
322 * @sa VIDDEC3_create()
323 * @sa VIDDEC3_delete()
324 * @sa VIDDEC3_control()
325 * @sa VIDDEC3_process()
326 * @sa VIDDEC3_processWait()
327 * @sa IVIDDEC3_Fxns::process()
328 */
329extern XDAS_Int32 VIDDEC3_processAsync(VIDDEC3_Handle handle,
330 XDM1_BufDesc *inBufs, XDM_BufDesc *outBufs,
331 VIDDEC3_InArgs *inArgs, VIDDEC3_OutArgs *outArgs);
332
333/*
334 * ======== VIDDEC3_processWait ========
335 */
336/**
337 * @brief Wait for a return message from a previous invocation of
338 * VIDDEC3_processAsync() in this instance of an video decoder
339 * algorithm.
340 *
341 * @param[in] handle Handle to a created video decoder instance.
342 * @param[in] inBufs A buffer descriptor containing input buffers.
343 * @param[out] outBufs A buffer descriptor containing output buffers.
344 * @param[in] inArgs Input Arguments.
345 * @param[out] outArgs Output Arguments.
346 * @param[in] timeout Amount of "time" to wait (from 0 -> VIDDEC3_FOREVER)
347 *
348 * @pre @c handle is a valid (non-NULL) video decoder handle
349 * and the video decoder is in the created state.
350 *
351 * @retval #VIDDEC3_EOK Success.
352 * @retval #VIDDEC3_EFAIL Failure.
353 * @retval #VIDDEC3_EUNSUPPORTED Unsupported request.
354 * @retval #VIDDEC3_ETIMEOUT Operation timed out.
355 *
356 * @remark This is a blocking call, and will return after the data
357 * has been decoded.
358 *
359 * @remark "Polling" is supported by using a timeout of 0. Waiting
360 * forever is supported by using a timeout of VIDDEC3_EFOREVER.
361 *
362 * @remark There must have previously been an invocation of the
363 * VIDDEC3_processAsync() API.
364 *
365 * @remark The buffers supplied to VIDDEC3_processAsync() may have
366 * constraints put on them. For example, in dual-processor,
367 * shared memory architectures, where the codec is running on a
368 * remote processor, the buffers may need to be physically
369 * contiguous. Additionally, the remote processor may place
370 * restrictions on buffer alignment.
371 *
372 * @sa VIDDEC3_create()
373 * @sa VIDDEC3_delete()
374 * @sa VIDDEC3_control()
375 * @sa VIDDEC3_process()
376 * @sa VIDDEC3_processAsync()
377 */
378extern XDAS_Int32 VIDDEC3_processWait(VIDDEC3_Handle handle,
379 XDM1_BufDesc *inBufs, XDM_BufDesc *outBufs,
380 VIDDEC3_InArgs *inArgs, VIDDEC3_OutArgs *outArgs, UInt timeout);
381
382#endif
383
384
385/*@}*/ /* ingroup */
386
387#ifdef __cplusplus
388}
389#endif
390
391#endif
392/*
393 * @(#) ti.sdo.ce.video3; 1, 0, 0,3; 6-13-2013 00:21:02; /db/atree/library/trees/ce/ce-w08/src/ xlibrary
394
395 */
396
diff --git a/packages/codec_engine/ti/sdo/ce/visa.h b/packages/codec_engine/ti/sdo/ce/visa.h
new file mode 100644
index 0000000..820a734
--- /dev/null
+++ b/packages/codec_engine/ti/sdo/ce/visa.h
@@ -0,0 +1,690 @@
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 * ======== visa.h ========
40 */
41/**
42 * @file ti/sdo/ce/visa.h
43 *
44 * @brief The Codec Engine System Programming Interface. Provides
45 * system developers with services necessary to implement
46 * stubs and skeletons.
47 */
48/**
49 * @addtogroup ti_sdo_ce_VISA_GEN VISA - Alg-independent user APIs
50 *
51 * Codec Engine Algorithm-independent shared definitions and services.
52 */
53/**
54 * @addtogroup ti_sdo_ce_VISA_STUB VISA - CE Stub SPIs
55 *
56 * Codec Engine System Programming Interface (SPI) for stub implementors.
57 */
58/**
59 * @addtogroup ti_sdo_ce_VISA_API VISA - CE interface SPIs
60 *
61 * Codec Engine System Programming Interface (SPI) for class interface
62 * implementors.
63 */
64
65#ifndef ti_sdo_ce_VISA_
66#define ti_sdo_ce_VISA_
67
68#include <stddef.h> /* for size_t */
69
70#include <ti/sdo/ce/node/node.h>
71#include <ti/xdais/ialg.h>
72#include <ti/sdo/ce/Engine.h>
73
74#ifdef __cplusplus
75extern "C" {
76#endif
77
78/**
79 * @brief VISA result data type
80 * @ingroup ti_sdo_ce_VISA_GEN
81 */
82typedef Int VISA_Status;
83
84/**
85 * @brief Success.
86 * @ingroup ti_sdo_ce_VISA_GEN
87 */
88#define VISA_EOK 0
89
90/**
91 * @brief Internal runtime error.
92 * @ingroup ti_sdo_ce_VISA_GEN
93 */
94#define VISA_ERUNTIME -1
95
96/**
97 * @brief General system error.
98 * @ingroup ti_sdo_ce_VISA_GEN
99 */
100#define VISA_EFAIL -2
101
102/**
103 * @brief The API is not suported for the given system configuration.
104 * @ingroup ti_sdo_ce_VISA_GEN
105 */
106#define VISA_EUNSUPPORTED -3
107
108/**
109 * @brief Timeout occurred.
110 * @ingroup ti_sdo_ce_VISA_GEN
111 */
112#define VISA_ETIMEOUT -100
113
114/**
115 * @brief Special value for timeout parameter indicating never timeout.
116 * @ingroup ti_sdo_ce_VISA_GEN
117 */
118#define VISA_FOREVER Engine_FOREVER
119
120/**
121 * @brief Name to pass to Diags_setMask() to enable logging for VISA
122 * functions. For example,
123 * Diags_setMask(VISA_MODNAME"+EX1234567");
124 * turns on all Log statements in this module.
125 * Diags_setMask() must be called after initialization to take
126 * effect.
127 */
128#define VISA_MODNAME "ti.sdo.ce.VISA"
129
130/**
131 * @brief Opaque handle to a node.
132 */
133typedef struct VISA_Obj *VISA_Handle;
134
135/**
136 * @brief VISA message header.
137 *
138 * @ingroup ti_sdo_ce_VISA_STUB
139 *
140 * @remarks This must be the first field in a message
141 */
142typedef struct VISA_MsgHeader {
143 NODE_MsgHeader header;
144 Int cmd; /**< Command id */
145 VISA_Status status; /**< Return status */
146} VISA_MsgHeader;
147
148/*
149 * ======== VISA_Msg ========
150 */
151typedef VISA_MsgHeader *VISA_Msg;
152
153/*
154 * ======== VISA_allocMsg ========
155 */
156/**
157 * @brief Obtain an algorithm instance's message.
158 *
159 * @ingroup ti_sdo_ce_VISA_STUB
160 *
161 * @param[in] visa Handle to an algorithm instance.
162 *
163 * @retval NULL General system error
164 * @retval non-NULL The remote algorithm's message.
165 *
166 * @remarks This is typically called by an algorithm class' stub.
167 *
168 * @sa VISA_allocMsg()
169 */
170extern VISA_Msg VISA_allocMsg(VISA_Handle visa);
171
172/*
173 * ======== VISA_call ========
174 */
175/**
176 * @brief Invoke the operation specified in the message and wait for
177 * it to complete.
178 *
179 * @ingroup ti_sdo_ce_VISA_STUB
180 *
181 * @param[in] visa Handle to an algorithm instance.
182 * @param[out] msg The remote algorithm's message,
183 * to be sent to the skeleton.
184 *
185 * @remarks This is typically called by an algorithm class' stub.
186 *
187 * @retval VISA_EOK Success
188 * @retval VISA_ERUNTIME General system error
189 *
190 * @sa VISA_callAsync()
191 */
192extern VISA_Status VISA_call(VISA_Handle visa, VISA_Msg *msg);
193
194/*
195 * ======== VISA_callAsync ========
196 */
197/**
198 * @brief Invoke the operation specified in the message and return
199 * without waiting for it to complete.
200 *
201 * @ingroup ti_sdo_ce_VISA_STUB
202 *
203 * @param[in] visa Handle to an algorithm instance.
204 * @param[out] msg The remote algorithm's message,
205 * to be sent to the skeleton.
206 *
207 * @remarks This is typically called by an algorithm class' stub.
208 *
209 * @retval VISA_EOK Success
210 * @retval VISA_ERUNTIME General system error
211 *
212 * @sa VISA_wait()
213 * @sa VISA_call()
214 */
215extern VISA_Status VISA_callAsync(VISA_Handle visa, VISA_Msg *msg);
216
217/*
218 * ======== VISA_wait ========
219 */
220/**
221 * @brief Wait for the oldest operation from a command specified with
222 * VISA_callAsync() to complete.
223 *
224 * @ingroup ti_sdo_ce_VISA_STUB
225 *
226 * @param[in] visa Handle to an algorithm instance.
227 * @param[out] msg Placeholder for the remote algorithm's return message,
228 * retrieved from the skeleton.
229 * @param[in] timeout Amount of "time" to wait ("time" depends on underlying
230 * mechanism, such as that used with MSGQ_Get()).
231 *
232 * @remarks This is typically called by an algorithm class' stub.
233 *
234 * @retval VISA_EOK Success
235 * @retval VISA_ERUNTIME General system error
236 * @retval VISA_ETIMEOUT Operation timed out
237 *
238 * @sa VISA_callAsync()
239 */
240extern VISA_Status VISA_wait(VISA_Handle visa, VISA_Msg *msg, UInt timeout);
241
242/*
243 * ======== VISA_freeMsg ========
244 */
245/**
246 * @brief Release an algorithm instance's message.
247 *
248 * @ingroup ti_sdo_ce_VISA_STUB
249 *
250 * @param[in] visa Handle to an algorithm instance.
251 * @param[in] msg Message to free, obtained through a call to
252 * VISA_allocMsg().
253 *
254 * @retval NULL General system error
255 * @retval non-NULL The remote algorithm's message.
256 *
257 * @remarks This is typically called by an algorithm class' stub.
258 *
259 * @sa VISA_allocMsg()
260 */
261extern Void VISA_freeMsg(VISA_Handle visa, VISA_Msg msg);
262
263
264/** @ingroup ti_sdo_ce_VISA_API */
265/*@{*/
266
267/*
268 * ======== VISA_create ========
269 */
270/**
271 * @brief Create a new instance of an algorithm.
272 *
273 * @param[in] engine Handle to an engine in which the algorithm has been
274 * configured.
275 * @param[in] name Name of the algorithm to create. @c name is
276 * specified in the engine configuration.
277 * @param[in] params Creation parameters.
278 * @param[in] msgSize Size of the message which will be allocated in
279 * the event that this algorithm is configured to
280 * run remotely.
281 * @param[in] type String name of the "type" of algorithm.
282 *
283 * @retval NULL General failure.
284 * @retval non-NULL Handle to an algorithm instance.
285 *
286 * @remarks @c type <b>must</b> match the package/module name of the
287 * interface which the algorithm implements. For example, the VISA
288 * interface shipped with CE to support XDM video
289 * decoders is named "ti.sdo.ce.video.IVIDDEC". That is,
290 * the module IVIDDEC is in the package "ti.sdo.ce.video".
291 * You will, by definition, find a file named IVIDDEC.xdc in the
292 * ti.sdo.ce.video package.
293 *
294 * @remarks When calling VISA_create(), a string comparison is done
295 * between the @c type parameter and the actual name of the
296 * module (described in the previous paragraph). If these strings
297 * don't match exactly, VISA_create() will fail.
298 *
299 * @sa VISA_delete()
300 */
301extern VISA_Handle VISA_create(Engine_Handle engine, String name,
302 IALG_Params *params, size_t msgSize, String type);
303
304/*
305 * ======== VISA_delete ========
306 */
307/**
308 * @brief Delete an instance of an algorithm.
309 *
310 * @param[in] visa Handle to an algorithm instance to delete.
311 *
312 * @sa VISA_create()
313 */
314extern Void VISA_delete(VISA_Handle visa);
315
316
317/*
318 * ======== VISA_create2 ========
319 */
320/**
321 * @brief Create a new instance of an algorithm.
322 *
323 * @param[in] engine Handle to an engine in which the algorithm has been
324 * configured.
325 * @param[in] name Name of the algorithm to create. @c name is
326 * specified in the engine configuration.
327 * @param[in] params Creation parameters.
328 * @param[in] paramsSize Size of @c params.
329 * @param[in] msgSize Size of the message which will be allocated in
330 * the event that this algorithm is configured to
331 * run remotely.
332 * @param[in] type String name of the "type" of algorithm.
333 *
334 * @retval NULL General failure.
335 * @retval non-NULL Handle to an algorithm instance.
336 *
337 * @remarks @c type <b>must</b> match the package/module name of the
338 * interface which the algorithm implements. For example, the VISA
339 * interface shipped with CE to support XDM video
340 * decoders is named "ti.sdo.ce.video.IVIDDEC". That is,
341 * the module IVIDDEC is in the package "ti.sdo.ce.video".
342 * You will, by definition, find a file named IVIDDEC.xdc in the
343 * ti.sdo.ce.video package.
344 *
345 * @remarks When calling VISA_create2(), a string comparison is done
346 * between the @c type parameter and the actual name of the
347 * module (described in the previous paragraph). If these strings
348 * don't match exactly, VISA_create2() will fail.
349 *
350 * @remarks VISA_create() is the preferred method to create algorithms.
351 * VISA_create2() is provided to enable creation of algorithms
352 * which violate the XDAIS spec and do <b>not</b> have a @c size
353 * field of type "Int" as the first field of @c params.
354 *
355 * @sa VISA_create()
356 * @sa VISA_delete()
357 */
358extern VISA_Handle VISA_create2(Engine_Handle engine, String name,
359 IALG_Params *params, Int paramsSize, size_t msgSize, String type);
360
361
362/*
363 * ======== VISA_enter ========
364 */
365/**
366 * @brief Enter an algorithm's critical section. This must be called
367 * before any of the algorithm's IALG_Fxns are invoked.
368 *
369 * @param[in] visa Handle to an algorithm instance.
370 *
371 * @remarks This is typically called by an algorithm class' application API.
372 *
373 * @remarks This call has the same semantics as IALG's activate fxn.
374 *
375 * @sa VISA_exit()
376 */
377extern Void VISA_enter(VISA_Handle visa);
378
379/*
380 * ======== VISA_exit ========
381 */
382/**
383 * @brief Leave an algorithm's critical section. This must be called
384 * after the API has completed calling an algorithm's IALG_Fxns.
385 *
386 * @param[in] visa Handle to an algorithm instance.
387 *
388 * @remarks This call has the same semantics as IALG's de-activate fxn.
389 *
390 * @sa VISA_enter()
391 */
392extern Void VISA_exit(VISA_Handle visa);
393
394/*
395 * ======== VISA_getAlgHandle ========
396 */
397/**
398 * @brief Obtains an algorithm's handle. This is the handle required
399 * to be passed to the algorithm's IALG_Fxns.
400 *
401 * @param[in] visa Handle to an algorithm instance.
402 *
403 * @retval NULL General system error
404 * @retval non-NULL The remote algorithm's message.
405 *
406 * @remarks This is typically called by an algorithm class' application API.
407 *
408 * @sa VISA_getAlgFxns()
409 */
410extern Ptr VISA_getAlgHandle(VISA_Handle visa);
411
412/*
413 * ======== VISA_getAlgorithmHandle ========
414 */
415/**
416 * @brief Obtains an algorithm's handle. If the algorithm is local, this is the
417 * handle that can be passed to Algorithm APIs, not to the IALG_Fxns.
418 *
419 * @param[in] visa Handle to an algorithm instance.
420 *
421 * @retval NULL General system error
422 * @retval non-NULL The Algorithm handle.
423 *
424 * @remarks This is used internally.
425 *
426 * @sa VISA_getAlgHandle()
427 */
428extern Ptr VISA_getAlgorithmHandle(VISA_Handle visa);
429
430/*
431 * ======== VISA_getAlgFxns ========
432 */
433/**
434 * @brief Get implementation functions for this algorithm
435 *
436 * @param[in] visa Handle to an algorithm instance.
437 *
438 * @retval NULL An error has occurred.
439 * @retval non-NULL The algorithm's IALG_Fxns.
440 *
441 * @remarks This is typically called by an algorithm class' application API.
442 *
443 * @remarks Both local and remote implementations return a non-NULL
444 * pointer. However, the IALG_Fxns functions may be NULL.
445 *
446 * @remarks In the case of a local algorithm, the algorithm's IALG_Fxns
447 * returned. In the case of a remote algorithm, its stubs are
448 * returned. In either case, the handle passed as the first arg
449 * to the IALG_Fxns must be the value returned by
450 * VISA_getAlgHandle().
451 *
452 * @sa VISA_getAlgHandle()
453 */
454extern IALG_Fxns *VISA_getAlgFxns(VISA_Handle visa);
455
456/*@}*/ /* ingroup */
457
458/*
459 * ======== VISA_getAlgMemRecs ========
460 */
461/**
462 * @brief Get the IALG_MemRec memory assigned to an algorithm instance
463 *
464 * @ingroup ti_sdo_ce_VISA_GEN
465 *
466 * @param[in] visa Handle to an algorithm instance.
467 * @param[out] memTab Location to store the IALG_MemRecs.
468 * @param[in] size Maximum number of IALG_MemRecs to put in memTab array.
469 * @param[out] numRecs Actual number of IALG_MemRecs copied into memTab array.
470 *
471 * @remarks Any algorithm instance handle (e.g. VIDDEC2_Handle,
472 * AUDDEC1_Handle, etc), can be cast to a @c visa handle.
473 *
474 * @par Example:
475 *
476 * @code
477 * AUDDEC1_Handle decoder;
478 *
479 * decoder = AUDDEC1_create(...);
480 *
481 * ... likely use VISA_getAlgNumRecs() to alloc enough mem...
482 *
483 * VISA_getAlgMemRecs((VISA_Handle)decoder, ...);
484 * @endcode
485 *
486 * @retval #VISA_EOK Success.
487 * @retval #VISA_EFAIL Failure.
488 *
489 * @sa VISA_getAlgNumRecs()
490 */
491extern VISA_Status VISA_getAlgMemRecs(VISA_Handle visa, IALG_MemRec *memTab,
492 Int size, Int *numRecs);
493
494/*
495 * ======== VISA_getAlgNumRecs ========
496 */
497/**
498 * @brief Get the number of IALG_MemRecs assigned to an algorithm.
499 *
500 * @ingroup ti_sdo_ce_VISA_GEN
501 *
502 * @param[in] visa Handle to an algorithm instance.
503 * @param[out] numRecs Location to store the number of IALG_MemRecs used.
504 *
505 * @remarks Any algorithm instance handle (e.g. VIDDEC2_Handle,
506 * AUDDEC1_Handle, etc), can be cast to a @c visa handle.
507 *
508 * @par Example:
509 *
510 * @code
511 * Int numRecs;
512 * AUDDEC1_Handle decoder;
513 *
514 * decoder = AUDDEC1_create(...);
515 *
516 * VISA_getAlgNumRecs((VISA_Handle)decoder, &numRecs);
517 * @endcode
518 *
519 * @retval #VISA_EOK Success.
520 * @retval #VISA_EFAIL Failure.
521 *
522 * @sa VISA_getAlgMemRecs()
523 */
524extern VISA_Status VISA_getAlgNumRecs(VISA_Handle visa, Int *numRecs);
525
526
527/*
528 * ======== VISA_getContext ========
529 */
530/**
531 * @brief Get optional context parameter.
532 *
533 * @ingroup ti_sdo_ce_VISA_STUB
534 *
535 * @param[in] visa Handle to an algorithm instance.
536 * @param[out] pContext Location to store context.
537 *
538 * @pre @c visa <b>must</b> be a valid algorithm instance handle.
539 *
540 * @pre @c pContext <b>must</b> be a valid pointer.
541 *
542 * @remarks The VISA_setContext() / VISA_getContext() pair does <b>not</b>
543 * work across processors. That is, the context can only be
544 * stored and retrieved on the local processor.
545 *
546 * @sa VISA_setContext()
547 */
548extern Void VISA_getContext(VISA_Handle visa, UInt32 * pContext);
549
550/*
551 * ======== VISA_getCodecClassConfig ========
552 */
553/**
554 * @brief Get codec-specific values for the VISA class-specific
555 * (or codec-specific if the codec doesn't extend VISA) stub-and/
556 * or-skeleton configuration data (that some classes have)
557 *
558 * @ingroup ti_sdo_ce_VISA_GEN
559 *
560 * @param[in] visa Handle to an algorithm instance.
561 *
562 * @retval address of the codec class config data structure, or NULL if
563 * codec class config data not defined for the codec; the format
564 * of the structure is class-specific, and the data in it is codec-
565 * specific
566 *
567 * @pre @c visa <b>must</b> be a valid algorithm instance handle.
568 */
569extern Ptr VISA_getCodecClassConfig(VISA_Handle visa);
570
571
572/*
573 * ======== VISA_getMaxMsgSize ========
574 */
575/**
576 * @brief Returns max size of messages allocated by VISA_allocMsg()
577 *
578 * @ingroup ti_sdo_ce_VISA_GEN
579 *
580 * @retval maxMsgSize Max size of messages allocated by
581 * VISA_allocMsg()
582 *
583 * @remarks This is typically called by an algorithm class' stub.
584 *
585 * @sa VISA_allocMsg()
586 */
587extern UInt VISA_getMaxMsgSize(VISA_Handle visa);
588
589/*
590 * ======== _VISA_init ========
591 */
592/**
593 * @brief Ininitilize VISA module.
594 *
595 * @ingroup ti_sdo_ce_VISA_GEN
596 *
597 * @remarks This is typically called by CERuntime_init().
598 *
599 * @sa _VISA_exit()
600 */
601extern Void _VISA_init(Void);
602
603/*
604 * ======== _VISA_exit ========
605 */
606/**
607 * @brief Exit VISA module.
608 *
609 * @ingroup ti_sdo_ce_VISA_GEN
610 *
611 * @remarks This is typically called by CERuntime_exit().
612 *
613 * @sa _VISA_init()
614 */
615extern Void _VISA_exit(Void);
616
617
618/*
619 * Semi-internal variable generatd by Settings.xdt - used in the following
620 * inline
621 */
622extern Bool VISA_checked;
623
624/*
625 * ======== VISA_isChecked ========
626 */
627/**
628 * @brief Indicates whether VISA libraries were built with
629 * debug + additional checking enabled
630 *
631 * @ingroup ti_sdo_ce_VISA_GEN
632 *
633 * @retval false VISA libraries with no debug/checking are used
634 * @retval true VISA libraries with debug/checking are used
635 *
636 * @remarks This is typically called by an algorithm class' stub.
637 *
638 * @sa VISA_allocMsg()
639 */
640static inline Bool VISA_isChecked(Void)
641{
642 return (VISA_checked);
643}
644
645/*
646 * ======== VISA_setContext ========
647 */
648/**
649 * @brief Set optional context parameter.
650 *
651 * @ingroup ti_sdo_ce_VISA_STUB
652 *
653 * @param[in] visa Handle to an algorithm instance.
654 * @param[in] context Context.
655 *
656 * @pre @c visa <b>must</b> be a valid algorithm instance handle.
657 *
658 * @remarks The VISA_setContext() / VISA_getContext() pair does <b>not</b>
659 * work across processors. That is, the context can only be
660 * stored and retrieved on the local processor.
661 *
662 * @sa VISA_getContext()
663 */
664extern Void VISA_setContext(VISA_Handle visa, UInt32 context);
665
666/*
667 * ======== VISA_isLocal ========
668 */
669/**
670 * @brief Indicates whether VISA codecs run on a remote or local CPU.
671 *
672 * @ingroup ti_sdo_ce_VISA_GEN
673 *
674 * @retval FALSE VISA codecs run on remote CPU
675 * @retval TRUE VISA codecs run on local CPU
676 *
677 * @remarks This is typically called by an algorithm class' stub.
678 */
679extern Bool VISA_isLocal(VISA_Handle visa);
680
681#ifdef __cplusplus
682}
683#endif
684
685#endif
686/*
687 * @(#) ti.sdo.ce; 1, 0, 6,3; 6-13-2013 00:10:04; /db/atree/library/trees/ce/ce-w08/src/ xlibrary
688
689 */
690
diff --git a/packages/ivahd_codecs/ti/sdo/codecs/h264enc/ih264enc.h b/packages/ivahd_codecs/ti/sdo/codecs/h264enc/ih264enc.h
new file mode 100644
index 0000000..979c1df
--- /dev/null
+++ b/packages/ivahd_codecs/ti/sdo/codecs/h264enc/ih264enc.h
@@ -0,0 +1,3503 @@
1/*
2 *******************************************************************************
3 *
4 * HDVICP2.0 Based H.264 HP Encoder
5 *
6 * "HDVICP2.0 Based H.264 HP Encoder" is software module developed on TI's
7 * HDVICP2 based SOCs. This module is capable of compressing a 4:2:0 Raw
8 * video into a high/main/baseline profile bit-stream. Based on ISO/IEC
9 * 14496-10."
10 * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
11 * ALL RIGHTS RESERVED
12 *******************************************************************************
13*/
14
15/**
16 ******************************************************************************
17 * @file ih264enc.h
18 *
19 * @brief IH264ENC Interface Header
20 *
21 * @author Pramod Kumar Swami (pramods@ti.com)
22 *
23 * @version 0.1 - Nov 30,2008 : Initial Version [Pramod]
24 *
25 * @version 0.2 - March 16,2009 [Pramod]
26 * A. Name change of interface file ih264venc.h to ih264enc.h
27 * B.Change the name of macros/enums
28 * MAXNUMSLCGPS --> IH264ENC_MAXNUMSLCGPS
29 * MAX_NUM_SLICE_START_OFFSET --> IH264ENC_MAX_NUM_SLICE_START_OFFSET
30 * IH264ENC_GOPSTRUCTURE_OPEN --> IH264ENC_GOPSTRUCTURE_NONUNIFORM
31 * IH264ENC_GOPSTRUCTURE_CLOSE --> IH264ENC_GOPSTRUCTURE_UNIFORM
32 * C. Definition of IH264ENC_BufferLevel changed from buffer to time
33 * D. mbMetaDataEnable is defined
34 * E. Following information (fields/definition) is newly added
35 * IH264ENC_VERSION_LENGTH : For getting the encoder version via Control
36 * method
37 * meta data support (IH264ENC_MAX_SEI_METADTA_BUFSIZE)
38 * Support and definition of Error Codes
39 * Enum for level 3.0 and 3.1 was missing added
40 * Poc type 1 enum added
41 * Support for NALU masks: no change in definition
42 * Few more enumeration added for IH264ENC_VUICodingPreset,
43 * IH264ENC_VideoFormat and IH264ENC_AspectRatioIdc
44 * IH264ENC_VUICodingParams structure parameter added to creation
45 * time parameters
46 * New enumeration added to IH264ENC_InterlaceCodingType: MRF, SPF
47 *
48 * @version 0.3 - November 2009 [Pramod]
49 * A. Added interface for force SKIP, it is temporarily here and will be
50 * used from base class of IVIDENC later
51 * B. Added user defined scaling matrix bit in input meta data
52 * @version 0.4 - Feb 2010 [Deepak]
53 * Addition of error bit(IH264ENC_ErrorBit : bit 7) for max bit rate
54 * voilation scenario in tighter RC scenario
55 * @version 0.5 - Mar 2010 [Kumar] : Added more enumerations to have all
56 * levels supported by H264 standard to make it future proof.
57 * @version 0.6 - Apr 2010 [Kumar] : Added error bit for checking
58 * hdvicp state IH264ENC_IMPROPER_HDVICP2_STATE
59 * @version 0.7 - Jun 2010 : [Nirmal, Pramod] Changed default value of
60 * BufferLevel since its is not good for
61 * low delay applications (IR: SDOCM00071692)
62 * @version 0.8 - Apr 2010 [Uday] : Modified the definition of initial
63 * buffer level from taking in descrete values to continuas values
64 * @version 0.9 - May 2010 [Uday] : converted the reserve parameter for
65 * enabling GMV in SEI to dedicated parameter
66 *
67 * @version 0.10 - May 2010 [Uday] : Extended the outArgs to return the
68 * initial buffer level
69 * @version 0.11 -Jun 2010 [Uday] : Added interface constraint set flags
70 * @version 0.12 - Aug 2010 [Nirmal] : Added data elements for static MB
71 * count support
72 * @version 0.13 -Aug 2010 [Girish Murthy] : Added interface for
73 * RCDO profile support
74 * @ version 0.14 -Sep 2010 [Kumar] : Defined a bit for
75 * IH264ENC_MAX_BYTES_VOILATION_IN_SLICEMODE_BYTES
76 * @ version 0.15 -Sep 2010 [Kumar] : Added a new extenetd parameter for
77 * algorithm creation enableLongTermRefFrame
78 * @version 0.16- Sept 2010[Girish]: Support for PRC and partial frame
79 * skip control
80 * @version 0.17 Sep 2010 : Added flag to control the insertion of
81 * HRD parameters in VUI part of bit-stream[Nirmal]
82 * @version 0.18 Sep2010 : Added error bit IH264ENC_DATASYNCH_RUN_TIME_ERROR
83 * multiplexed with IH264ENC_UNSUPPORTED_FMOCODINGPARAMS
84 * @version 0.19 Sep2010 : Added IH264ENC_FramePackingParams structure
85 * required for encoding the frame packing SEI
86 * @version 0.20 Sep 2010 : [Gajanan] Added IH264ENC_StereoInfoParams
87 * Structure for Steroe Video Coding
88 * parameters and StereoInfoPreset enums.
89 * @version 0.21 Apr 2011 : [Kumar] Added support for new long-
90 * trem frame referencing scheme
91 * IH264ENC_LTRP_REFERTOP_PROACTIVE
92 * @version 0.22 June 2011: Inroduction of new preset
93 * IH264_INTERCODING_MED_SPEED_HIGH_QUALITY for
94 * inter coding preset.
95 * @version 0.23 July 2011: Added discardSavedBits in RateControl structure
96 * SDOCM00082533
97 * @version 0.24 July 2011: Added structures and enum for ROI support.[Gajanan]
98 * @version 1.0 Dec 2011: Added parameter for HRD compliance control[Girish]
99 * @version 1.1 Dec 2011: Added frameSkipThMulQ5 & vbvUseLevelThQ5 in
100 * RateControl structure for CBR quality improvement
101 * [Karthick]
102 * @version 1.2 Jan 2012: Renamed MAX_ROI macro as IH264ENC_MAX_ROI
103 * [Harris]
104 * @version 1.3 Mar 2012: Added a parameter enableErrorCheck in
105 * IH264ENC_ProcessParamsList.[Santoshkumar S K]
106 * @version 1.4 May 2012: Changed parameter name. Replaced
107 * inArgs->lateAcquireArg by inArgs->processId.
108 * [Santoshkumar S K]
109 * @version 1.5 May 2012: SDOCM00091641 : Added temporalId parameter to
110 * IH264ENC_OutArgs.This holds the Temporal
111 * layer Id of current frame in H-P encoding.
112 * (for base layer value is 0)[Santoshkumar S K]
113 * @version 1.6 Aug 2012: Redundant exposure of GDR configuration
114 * parameters as a part of Extended Dynamic structure
115 * are removed(SDOCM00095027)[Santoshkumar S K]
116 * @version 1.7 Sep 2012: Default value of scalingmatrixPreset is changed
117 * from NONE(0) to NORMAL(1)[Santoshkumar S K]
118 * @version 1.8 Feb 2013: Fix for OMAPS00288660: Ducati returns an error
119 * when setting a slice size larger than 32768.
120 * Fix : sliceUnitSize parameter's data type is changed
121 * from XDAS_Int16 to XDAS_Int32 [Santoshkumar S K]
122 * @version 1.9 Mar 2013: a. Added IH264ENC_ExtErrBits enum structure to fix
123 * SDOCM00099577(Encoder does not give refined error
124 * codes in case of creation fail or run time parameter
125 * set fail)
126 * b. Parameter extErrorCode[] is added in
127 * IH264ENC_Status and IH264ENC_OutArgs structure
128 * [Santoshkumar S K]
129 *****************************************************************************
130*/
131
132/**
133 * @defgroup HDVICP2H264 IH264ENC_TI (V7M)
134 * @ingroup m3
135 *
136 * The IH264ENC_TI interface enables encoding in H264 format
137 *
138 */
139
140#ifndef _IH264ENC_H_ /* --{ */
141
142#define _IH264ENC_H_
143
144#include <ti/xdais/ialg.h>
145#include <ti/xdais/dm/ividenc2.h>
146
147/** @ingroup HDVICP2H264 */
148/*@{*/
149
150
151#ifdef __cplusplus
152extern "C" {
153#endif
154
155
156/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
157/* Definition of all the macros define by this interafce */
158/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
159
160/**
161 Maximum number of slice groups supported by H.264 Encoder
162*/
163#define IH264ENC_MAXNUMSLCGPS (2)
164
165/**
166 Maximum Number of slice start points
167*/
168#define IH264ENC_MAX_NUM_SLICE_START_OFFSET (3)
169
170/** maximum size for SEI_USER_DATA_UNREGISTERED SEI message */
171#define IH264ENC_MAX_SEI_METADTA_BUFSIZE (0x3FF)
172
173/**
174 Length of the version string. The memory to get version
175 number is owned by application
176*/
177#define IH264ENC_VERSION_LENGTH (64)
178
179/**
180 control method commands
181*/
182#define IH264ENC_GETSTATUS XDM_GETSTATUS
183#define IH264ENC_SETPARAMS XDM_SETPARAMS
184#define IH264ENC_RESET XDM_RESET
185#define IH264ENC_FLUSH XDM_FLUSH
186#define IH264ENC_SETDEFAULT XDM_SETDEFAULT
187#define IH264ENC_GETBUFINFO XDM_GETBUFINFO
188
189/**
190 Maximum number of ROIs supported inside the frame.
191*/
192#define IH264ENC_MAX_ROI 36
193
194typedef IVIDENC2_Cmd IH264ENC_Cmd;
195
196/**
197 Macro to set particular NAL bit in the nal unit mask
198*/
199#define IH264ENC_SET_NALU(naluPresentMask, NALU) \
200 { \
201 naluPresentMask = ((naluPresentMask) | (1 << IH264_NALU_TYPE_##NALU));\
202 }
203
204/**
205 Macro to clear particular NAL bit in the nal unit mask
206*/
207#define IH264ENC_CLEAR_NALU(naluPresentMask, NALU) \
208 { \
209 naluPresentMask = ((naluPresentMask) & (~(1 << IH264_NALU_TYPE_##NALU)));\
210 }
211
212/**
213 Macro to get particular NAL bit in the nal unit mask
214*/
215#define IH264ENC_GET_NALU(naluPresentMask, NALU)\
216 ((naluPresentMask) & (1 << IH264_NALU_TYPE_##NALU))
217
218
219
220/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
221/* Definition of all the Enumeration define by this interafce */
222/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
223
224/**
225 * @enum IH264ENC_ErrorBit
226 * @brief error informations of IVAHD H264 encoder implementation by TI.
227 *
228 * @remarks When an internal error occurs, the algorithm will return
229 * an error return value (e.g. EFAIL, EUNSUPPORTED)
230 *
231 * @remarks The value of each enum is the bit which is set.
232 *
233 * @remarks Bits 8-15 are defined by XDM and hence not used by codec
234 * implementation.
235 * rest all bits are used. XDM defined error bits are also active.
236 *
237 * @remarks The algorithm can set multiple bits to 1 based on conditions.
238 * e.g. it will set bits #XDM_FATALERROR (fatal) and
239 * #XDM_UNSUPPORTEDPARAM (unsupported params) in case
240 * of unsupported run time parameters.
241 *
242 */
243
244typedef enum {
245 IH264ENC_LEVEL_INCOMPLAINT_PARAMETER = 0,
246 /**< Bit 0 - level incomplaint parameters.
247 * @remarks This error is applicable when some parameters are set
248 * which are not meeting the limit defined by H.264 standard
249 * Table A-1 Level limits. It can be categorized under
250 * following category :
251 * IH264ENC_LEVEL_INCOMPLAINT_RESOLUTION : Invalid width/height
252 * IH264ENC_LEVEL_INCOMPLAINT_HRDBUFSZIE : Invalid HrdBufferSize
253 * IH264ENC_LEVEL_INCOMPLAINT_BITRATE : Invalid Bit Rate
254 * IH264ENC_LEVEL_INCOMPLAINT_MBSPERSECOND : Invalid FrameRate/
255 * resolution
256 * IH264ENC_LEVEL_INCOMPLAINT_DPBSIZE : Invalid DPB size
257 * For above 5 situations, only a signle bit (bit-0) is set as true
258 */
259
260 IH264ENC_PROFILE_INCOMPLAINT_CONTENTTYPE = 1,
261 /**< Bit 1 - Profile incomplaint content type.
262 * @remarks This error is applicable when
263 * IVIDENC2_Params::inputContentType is not set as
264 * IVIDEO_PROGRESSIVE but IVIDENC2_Params::profile is set
265 * as IH264_BASELINE_PROFILE
266 */
267
268 IH264ENC_PROFILE_INCOMPLAINT_FMO_SETTING = 2,
269 /**< Bit 2 - Profile incomplaint FMO setting.
270 * @remarks This error is applicable when FMO is enabled but
271 * IVIDENC2_Params::profile is not set as IH264_BASELINE_PROFILE
272 */
273
274 IH264ENC_PROFILE_INCOMPLAINT_TRANSFORMBLOCKSIZE = 3,
275 /**< Bit 3 - Profile incomplaint transform block size.
276 * @remarks This error is set when
277 * IH264ENC_Params::transformBlockSize != IH264_TRANSFORM_4x4 &&
278 * IVIDENC2_Params::profile != IH264_HIGH_PROFILE
279 */
280
281 IH264ENC_PROFILE_INCOMPLAINT_INTERFRAMEINTERVAL = 4,
282 /**< Bit 4 - Profile incomplaint interframeInterval.
283 * @remarks This error is set when B frames are used with
284 * IH264_BASELINE_PROFILE
285 */
286
287 IH264ENC_PROFILE_INCOMPLAINT_SCALINGMATRIXPRESET = 5,
288 /**< Bit 5 - Profile incomplaint scaling matrix setting.
289 * @remarks This error is set when scaling matrix is used
290 * without IH264_HIGH_PROFILE
291 */
292
293 IH264ENC_PROFILE_INCOMPLAINT_ENTROPYCODINGMODE = 6,
294 /**< Bit 6 - Profile incomplaint entropy coding mode setting.
295 * @remarks This error is set when cabac is used
296 * without IH264_HIGH_PROFILE/MAIN profile
297 */
298
299 IH264ENC_MAX_BYTES_VOILATION_IN_SLICEMODE_BYTES = 6,
300 /**< Bit 6 - If number of bytes encoded in any of the
301 * slice in the currently encoded picture is crossing
302 * maximum unbit size then this bit will be set
303 * @remarks This error bit is shared between the
304 * create time parameter entropy coding mode
305 *
306 */
307
308 IH264ENC_MAX_BIT_RATE_VOILATION = 7,
309 /**< Bit 7 - Max bits for one Unit Voilation
310 * @remarks When max bit rate is enabled by user,
311 * than it is possible that codec might not be able
312 * honor max bit rate. This bit is set when bits consumed
313 * in one unit ( 1 sec) is more than the allocated as per the
314 * given max bit rate. If the frame rate is N , and if the
315 * max bit rate is voilated in M th frame than this bit will
316 * get set for frame M to N.
317 */
318 IH264ENC_IMPROPER_HDVICP2_STATE = 16,
319 /**< Bit 16 - Device is not proper state to use.
320 */
321
322 IH264ENC_IMPROPER_STREAMFORMAT = 17,
323 /**< Bit 17 - stream format is not proper
324 * @remarks This error is set when streamFormat is set as
325 * IH264_NALU_STREAM but data synch is not enabled for putdata
326 */
327
328 IH264ENC_IMPROPER_POCTYPE = 18,
329 /**< Bit 18 - poc type is not proper
330 * @remarks This error is set when poc type 2 is used in
331 * presense of non reference frames
332 */
333
334 IH264ENC_IMPROPER_DATASYNC_SETTING = 19,
335 /**< Bit 19 - data synch settings are not proper
336 * @remarks This error is set when encoder is asked to operate
337 * at sub frame level but the call back function pointer is NULL
338 */
339
340 IH264ENC_UNSUPPORTED_VIDENC2PARAMS = 20,
341 /**< Bit 20 - Invalid videnc2 parameters
342 * @remarks This error is set when any parameter of struct
343 * IVIDENC2_Params is not in allowed range
344 */
345
346 IH264ENC_UNSUPPORTED_RATECONTROLPARAMS = 21,
347 /**< Bit 21 - Invalid rate control parameters
348 * @remarks This error is set when any parameter of struct
349 * IH264ENC_RateControlParams is not in allowed range
350 */
351
352 IH264ENC_UNSUPPORTED_INTERCODINGPARAMS = 22,
353 /**< Bit 22 - Invalid inter coding parameters
354 * @remarks This error is set when any parameter of struct
355 * IH264ENC_InterCodingParams is not in allowed range
356 */
357
358 IH264ENC_UNSUPPORTED_INTRACODINGPARAMS = 23,
359 /**< Bit 23 - Invalid Intra coding parameters
360 * @remarks This error is set when any parameter of struct
361 * IH264ENC_IntraCodingParams is not in allowed range
362 */
363
364 IH264ENC_UNSUPPORTED_NALUNITCONTROLPARAMS = 24,
365 /**< Bit 24 - Invalid nal unit coding parameters
366 * @remarks This error is set when any parameter of struct
367 * IH264ENC_NALUControlParams is not in allowed range
368 */
369
370 IH264ENC_UNSUPPORTED_SLICECODINGPARAMS = 25,
371 /**< Bit 25 - Invalid slice coding parameters
372 * @remarks This error is set when any parameter of struct
373 * IH264ENC_SliceCodingParams is not in allowed range
374 */
375
376 IH264ENC_UNSUPPORTED_LOOPFILTERPARAMS = 26,
377 /**< Bit 26 - Invalid loop filter related parameters
378 * @remarks This error is set when any parameter of struct
379 * IH264ENC_LoopFilterParams is not in allowed range
380 */
381 IH264ENC_DATASYNCH_RUN_TIME_ERROR = 27,
382 /**< Bit 27 is muxed with incorrect FMO paramters setting.
383 * This will be set when codec inside IVAHD encounters
384 * erroneous situation, like
385 * a) when number of NALs in 1Kb of data is more than 8
386 * b) when the blocks provided through getBuf call is not
387 * sufficient for all the NALs in one oage of SL2 stream.
388 */
389 IH264ENC_UNSUPPORTED_N_FRAME_PROCESSCALL_PARAMS = 27,
390 /**< Bit 27 is also muxed with incorrect paramters setting in
391 * N frame process call scenario
392 */
393 IH264ENC_UNSUPPORTED_FMOCODINGPARAMS = 27,
394 /**< Bit 27 - Invalid fmo parameters
395 * @remarks This error is set when any parameter of struct
396 * IH264ENC_FMOCodingParams is not in allowed range
397 */
398
399 IH264ENC_UNSUPPORTED_VUICODINGPARAMS = 28,
400 /**< Bit 28 - Invalid vui coding parameters
401 * @remarks This error is set when any parameter of struct
402 * IH264ENC_VUICodingParams is not in allowed range
403 */
404
405 IH264ENC_UNSUPPORTED_H264ENCPARAMS = 29,
406 /**< Bit 29 - Invalid Create time extended parameters
407 * @remarks This error is set when any parameter of struct
408 * IH264ENC_Params is not in allowed range
409 */
410
411 IH264ENC_UNSUPPORTED_VIDENC2DYNAMICPARAMS = 30,
412 /**< Bit 30 - Invalid base class dyanmic paaremeters during control
413 * @remarks This error is set when any parameter of struct
414 * IVIDENC2_DynamicParams is not in allowed range
415 */
416
417 IH264ENC_UNSUPPORTED_H264ENCDYNAMICPARAMS = 31
418 /**< Bit 31 - Invalid exteded class dyanmic paaremeters during control
419 * @remarks This error is set when any parameter of struct
420 * IH264ENC_DynamicParams (excluding embedded structures) is not in
421 * allowed range
422 */
423
424} IH264ENC_ErrorBit;
425
426/**
427 * @enum IH264ENC_ExtErrBits
428 * @brief Sub extended error informations of IVAHD H264 encoder
429 * implementation by TI.
430 *
431 * @remarks When an internal error occurs, the algorithm will return
432 * an error return value (e.g. EFAIL, EUNSUPPORTED). Apart from
433 * this information, encoder returns extended error codes which
434 * helps to get refined error. For eg Error
435 * IH264ENC_UNSUPPORTED_VIDENC2DYNAMICPARAMS can be returned by
436 * many sub conditions which is not enough for the user
437 * to trace his parameter settings. But the sub extended error
438 * codecs as mentioned in the below enum gives finer and refined
439 * error information.These error bits are unique for each fail in
440 * param settings. The algorithm can set multiple bits based on
441 * conditions.e.g. it will set bits #
442 * IH264ENC_EXTERROR_CREATE_INTERLACE_TYPE (for wrong interlace
443 * coding type) and #IH264ENC_EXTERROR_CREATE_LTRP (for wrong
444 * LTRP settings) & etc.
445 * These bits are set in structure IH264ENC_Status::extErrorCode[]
446 * and/or structure IH264ENC_OutArgs::extErrorCode[]
447 */
448typedef enum {
449 IH264ENC_EXTERROR_ACTIVEREGION = 0,
450 /** Bit 0 Active frame region dimensions are not matching with the
451 * encoding frame dimensions
452 */
453 IH264ENC_EXTERROR_ANALYTICINFO_BUFFERSIZE = 1,
454 /** Bit 1 Analytic Info buffer size provided is less than that of
455 * requested
456 */
457 IH264ENC_EXTERROR_BITRATE = 2,
458 /* Bit 2 – target bit rate set is more than max bit rate */
459 IH264ENC_EXTERROR_BITSTREAM_BUFFERSIZE = 3,
460 /** Bit 3 Output bitstream buffer size provided is less than that of
461 * requested. And this validation is done only if
462 * IVIDENC2_DynamicParams::ignoreOutbufSizeFlag is 0. Application has a
463 * flexibility of the not honoring this size by setting ignoreOutbufSizeFlag
464 * to 1
465 */
466 IH264ENC_EXTERROR_CAPTUREWIDTH_FORCEFRAME_LTRP_QPEL = 4,
467 /** Bit 4 This bit is set if any of the below conditions is set
468 * a. The size of dynamic params structure set is not of base class and
469 * nor even extended class
470 * b. Encoding dimensions are out of range
471 * c. Target bit rate less than minimum bt rate or frame rate is less than 0
472 * d. Generate header mode other than XDM_ENCODE_AU and XDM_GENERATE_HEADER
473 * e. User forced frame other than IDR/NA frame
474 * f. Wrong settings in interframe or intraFrame intervals
475 * g. Incorrect settings in motion vector accuracy settings
476 * If this bit is set, correspondingly IH264ENC_EXTERROR_RESOLUTION_BITRATE_
477 * FRMINTERVAL_GENHEADER is also set
478 */
479 IH264ENC_EXTERROR_CONTROLCALL_CMD = 5,
480 /** Bit 5 Encoder control call is made with an incorrect command option
481 */
482 IH264ENC_EXTERROR_CREATE_ENTROPY_PROFILE = 6,
483 /** Bit 6 Entropy coding mode set is CABAC for Base line profile which is
484 * not supported
485 */
486 IH264ENC_EXTERROR_CREATE_GOPSTRUCT_LOG2MAX_INTRAINTERVAL = 7,
487 /** Bit 7 This bit is set when
488 * a. Parameters transformBlockSize, entropyCodingMode, log2MaxFNumMinus4,
489 * maxIntraFrameInterval, IDRFrameInterval, gopStructure are out of range.
490 * b. LTRP is enabled for interlaced coding type
491 * If this bit is set, correspondingly IH264ENC_EXTERROR_CREATE_TXBLKSIZE_
492 * ENTROPY_POC_LTRP is also set
493 */
494 IH264ENC_EXTERROR_CREATE_HPLAYERS = 8,
495 /** Bit 8 Hierarchal layers set is out of range i.e., numTemporalLayer
496 * set is less tha 0 or more than 4
497 */
498 IH264ENC_EXTERROR_CREATE_HPLAYERS_BFRAME = 9,
499 /** Bit 9 Hierarchal coding is enabled for 'B Frames which is not supported
500 */
501 IH264ENC_EXTERROR_CREATE_HPLAYERS_POC = 10,
502 /** Bit 10 Picture Order Count(POC) type 1 is enabled for Hierarchal layer
503 * coding which is not supported
504 */
505 IH264ENC_EXTERROR_CREATE_HPLAYERS_REFPICMRKING = 11,
506 /** Bit 11 - Longterm Referencing (MMCO commands) is not enabled for
507 * Hierarchal layer coding i.e., referencePicMarking is other than
508 * IH264_LONG_TERM_PICTURE for Hierarchal layer coding which is
509 * not supported
510 */
511 IH264ENC_EXTERROR_CREATE_INTERLACE_TYPE = 12,
512 /** Bit 12 In interlaced encoding, interlace coding type set is out
513 * of supported values
514 */
515 IH264ENC_EXTERROR_CREATE_LTRP = 13,
516 /** Bit 13 LTRP option (enableLongTermRefFrame) set is out of allowed ranges
517 */
518 IH264ENC_EXTERROR_CREATE_LTRP_HP = 14,
519 /** Bit 14 LTRP option IH264ENC_LTRP_REFERTOP_PROACTIVE is enabled for
520 * Hierarchal layer coding which is not supported
521 */
522 IH264ENC_EXTERROR_CREATE_LTRP_PERIOD = 15,
523 /** Bit 15 - When LTRP is enabled for Hierarchal layer coding (H-P) then
524 * LTRPPeriod set should be multiple of subGop length
525 */
526 IH264ENC_EXTERROR_CREATE_LVL_DPBSIZE = 16,
527 /** Bit 16 Current DPB size set is more than the max DPB size allowed
528 * in this level. Current DPB size is calculated using formaula
529 * (maxWidth * maxHeight * 1.5 * max_num_ref_frames)
530 */
531 IH264ENC_EXTERROR_CREATE_POC_BFRAME = 17,
532 /** Bit 17 Picture Order Count(POC) type 2 is set for B frames which
533 * is not supported
534 */
535 IH264ENC_EXTERROR_CREATE_RCDO_PROFILE = 18,
536 /** Bit 18 RCDO is allowed only for Baseline profile.
537 */
538 IH264ENC_EXTERROR_CREATE_TXBLKSIZE_ENTROPY_POC_LTRP = 19,
539 /** Bit 19 This bit is set when
540 * a. Parameters transformBlockSize, entropyCodingMode, log2MaxFNumMinus4,
541 * maxIntraFrameInterval, IDRFrameInterval, gopStructure are out of range.
542 * b. LTRP is enabled for interlaced coding type
543 * If this bit is set, correspondingly IH264ENC_EXTERROR_CREATE_GOPSTRUCT
544 * _LOG2MAX_INTRAINTERVAL is also set
545 */
546 IH264ENC_EXTERROR_CREATE_TXBLKSIZE_PROFILE = 20,
547 /** Bit 20 Transform Block size IH264_TRANSFORM_8x8 is allowed only in
548 * High profile.
549 */
550 IH264ENC_EXTERROR_DATASYNC_GETFN_PTRNULL = 21,
551 /** Bit 21 getBufferFxn is a function pointer used to get buffer. This
552 * function gets called in Data synch flow. This error bit is set if
553 * this function pointer is NULL
554 */
555 IH264ENC_EXTERROR_DATASYNC_MBUNIT_SLICESIZE = 22,
556 /** Bit 22 This bit is set if
557 * a. User has enabled call back notification at slice level and
558 * b. Encoder slice mode selected is IH264_SLICEMODE_MBUNIT and
559 * c. Slice Unit size(number of MBs per slice) set is less than
560 * minimum MBs per slices. Minimum MBs per slice is (TotalMbsInPic/63)
561 */
562 IH264ENC_EXTERROR_DATASYNC_MODE_BFRAME = 23,
563 /** Bit 23 Data sync, inputDataMode is not set to IVIDEO_ENTIREFRAME in
564 * presence of B frames. In B cases we allow processing entire frames
565 * and not any mode
566 */
567 IH264ENC_EXTERROR_DATASYNC_MODE_FNPTRNULL = 24,
568 /** Bit 24 This bit is set if
569 * a. Data sync, outputDataMode is IVIDEO_FIXEDLENGTH or IVIDEO_SLICEMODE
570 * and putDataFxn is NULL
571 * OR
572 * b. Data sync, inputDataMode is IVIDEO_NUMROWS and getDataFxn is NULL
573 */
574 IH264ENC_EXTERROR_DATASYNC_MODE_H241_FNPTRNULL = 25,
575 /** Bit 25 In H241 flow, if user is interested in call back notification
576 * at slice level then he has to provide function address in getBufferFxn
577 * function pointer else this bit is set
578 */
579 IH264ENC_EXTERROR_DATASYNC_MODE_MINBITRATE = 26,
580 /** Bit 26 minBitRate should be 0 if data sync, outputDataMode is
581 * VIDEO_FIXEDLENGTH or IVIDEO_SLICEMODE
582 */
583 IH264ENC_EXTERROR_DATASYNC_OUTPUTDATAEXCEED = 27,
584 /** Bit 27 Encoded output data size has exceeded the available buffer
585 * size
586 */
587 IH264ENC_EXTERROR_DATASYNC_UNITS = 28,
588 /** Bit 28 Data sync, numOutputDataUnits are out of allowed ranges in
589 * case of outputDataMode not equal to IVIDEO_ENTIREFRAME
590 */
591 IH264ENC_EXTERROR_DYNAMIC_SRCHCENTRE = 29,
592 /** Bit 29 GMV, search centre x/y are out of allowed range
593 */
594 IH264ENC_EXTERROR_DYNAMICPARAMS_PTRNULL = 30,
595 /** Bit 30 In encoder control call with command option XDM_SETPARAMS,
596 * IVIDENC2_DynamicParams structure pointer is NULL
597 */
598 IH264ENC_EXTERROR_EARLYEXIT = 31,
599 /** Bit 31 Early exit called because Frame processing is not completed
600 * at IVAHD side
601 */
602 IH264ENC_EXTERROR_FIFO_EMPTY_NOPROCESS = 32,
603 /** Bit 32 In Flush process calls, no more buffers are locked and
604 * hence process call cannot be made further this point
605 */
606 IH264ENC_EXTERROR_FILLERBYTES_NEGATIVE = 33,
607 /** Bit 33 This bit set indicates that the filler bytes size to be put
608 * in bitstream to meet bit stream constraint is negative. Filler data
609 * negative indiactes that bits consumed in current unit till now has
610 * crossed the maximum limit.So inform to the user by seeting appropirate bit
611 */
612 IH264ENC_EXTERROR_FMO_PRESET = 34,
613 /** Bit 34 FMO coding preset is other than default.
614 * FMO is not supported in this release
615 */
616 IH264ENC_EXTERROR_FRMPACKING_PRESET = 35,
617 /** Bit 35 Frame packing preset is not in allowed range
618 */
619 IH264ENC_EXTERROR_FRMPACKING_TYPE_INPCONTENT = 36,
620 /** Bit 36 This bit is set if
621 * a.Frame packing is enabled for interlaced cases
622 * b.Frame packing preset is user defined and frame packing type is more
623 * than 4 (IH264_FRAMEPACK_TOP_BOTTOM)
624 */
625 IH264ENC_EXTERROR_FRMRATE_NUMUNITSINTICKS = 37,
626 /** Bit 37 Level incompliant MBs per second
627 */
628 IH264ENC_EXTERROR_GENHEADER_BITSTREAM_BUFFERSIZE = 38,
629 /** Bit 38 In process call with XDM_GENERATE_HEADER mode, output
630 * buffer size provided should be minimum of 0x100 bytes
631 * (to hold SPS and PPS)
632 */
633 IH264ENC_EXTERROR_HANDLE_BUFDESCRIPTORS_PTRNULL = 39,
634 /** Bit 39 Pointer of handle or inBufs or outBufs structure may be NULL
635 */
636 IH264ENC_EXTERROR_HIGHSPEED_BFARME = 40,
637 /** Bit 40 High speed encoding feature is not supported for B frames.
638 */
639 IH264ENC_EXTERROR_HIGHSPEED_MEALGO_TXBLKSIZE_PROFILE = 41,
640 /** Bit 41 This bit is set if, in High speed encoding mode
641 * a. Transform block size is 4x4 for High profile case
642 * OR
643 * b. Transform block size is 8x8 and non High profile cases
644 */
645 IH264ENC_EXTERROR_HIGHSPEED_PARTIALSKIP_INTRAREFRESHMETHOD= 42,
646 /** Bit 42 This bit is set if, in High speed encoding mode
647 * a. Transform block size is 4x4 for High profile case
648 * OR
649 * b. Transform block size is 8x8 and non High profile cases
650 * OR
651 * c. Partial Frame skip is enabled
652 * OR
653 * d. Intra refresh method is other than default
654 * If this bit is set, correspondingly IH264ENC_EXTERROR_HIGHSPEED_
655 * TXBLKSIZE_PROFILE is also set
656 */
657 IH264ENC_EXTERROR_HIGHSPEED_TXBLKSIZE_PROFILE = 43,
658 /** Bit 43 This bit is set if, in High speed encoding mode
659 * a. Transform block size is 4x4 for High profile case
660 * OR
661 * b. Transform block size is 8x8 and non High profile cases
662 * OR
663 * c. Partial Frame skip is enabled
664 * OR
665 * d. Intra refresh method is other than default
666 * If this bit is set, correspondingly IH264ENC_EXTERROR_HIGHSPEED_
667 * PARTIALSKIP_INTRAREFRESHMETHOD is also set
668 */
669 IH264ENC_EXTERROR_INARGS_BASECLASS_WATERMARKENABLE = 44,
670 /** Bit 44 Water Marking feature of the encoder is enabled and inArgs
671 * structure is base class. If inArgs structure is base class we cannot
672 * access the input key that has to used in water marking algo.
673 * So please use extended class of inArgs and pass the input key
674 */
675 IH264ENC_EXTERROR_INARGS_CONTROL = 45,
676 /** Bit 45 The control parameter passed as part of inArgs structure is
677 * out of allowed range
678 */
679 IH264ENC_EXTERROR_INARGS_OUTARGS_SIZE = 46,
680 /** Bit 46 The size parameter as part of inArgs or outArgs structure does
681 * not match base class not even extended class
682 */
683 IH264ENC_EXTERROR_INARGS_PTRNULL = 47,
684 /** Bit 47 inArgs structure pointer passed in the process call is NULL
685 */
686 IH264ENC_EXTERROR_INPCONTENT_TYPE = 48,
687 /** Bit 48 Input data content type value is wrong or input data chroma
688 * format is not YUV420
689 */
690 IH264ENC_EXTERROR_INPUT_BUFFERID = 49,
691 /** Bit 49 inputId as part of inArgs structure is 0
692 */
693 IH264ENC_EXTERROR_INPUTBUF_MEMTYPE = 50,
694 /** Bit 50 memType value set in the plane descriptors of inBufs structure
695 * is falling out of allowed values
696 */
697 IH264ENC_EXTERROR_INPUTBUF_PTR_SIZE_NULL = 51,
698 /** Bit 51 - buf value(buffer pointer) or bufSize.bytes set in the plane
699 * descriptors of inBufs structure is NULL
700 */
701 IH264ENC_EXTERROR_INTER_HIGHSPEED_MVPERMB = 52,
702 /** Bit 52 This bit is set if, in High speed encoding mode
703 * a. B frames are enabled
704 * OR
705 * b. Motion vector accuracy is not a Quarter pel (mvAccuracy !=
706 * IVIDENC2_MOTIONVECTOR_QUARTERPEL)
707 * OR
708 * c. Motion vectors per macroblock is not 1
709 * (minBlockSizeP != IH264_BLOCKSIZE_16x16)
710 * If this bit is set, correspondingly IH264ENC_EXTERROR_INTER_HIGHSPEED
711 * _QPEL_FRAMEINTERVAL is also set
712 */
713 IH264ENC_EXTERROR_INTER_HIGHSPEED_QPEL_FRAMEINTERVAL = 53,
714 /** Bit 53 This bit is set if, in High speed encoding mode
715 * a. B frames are enabled
716 * OR
717 * b. Motion vector accuracy is not a Quarter pel (mvAccuracy !=
718 * IVIDENC2_MOTIONVECTOR_QUARTERPEL)
719 * OR
720 * c. Motion vectors per macroblock is not 1
721 * (minBlockSizeP != IH264_BLOCKSIZE_16x16)
722 * If this bit is set, correspondingly IH264ENC_EXTERROR_INTER_HIGHSPEED
723 * _MVPERMB is also set
724 */
725 IH264ENC_EXTERROR_INTER_MVPERMB = 54,
726 /** Bit 54 Motion vectors per MB set is not in allowed range.
727 * minBlockSizeP/B is not equal to IH264_BLOCKSIZE_16x16 and not even
728 * IH264_BLOCKSIZE_8x8
729 */
730 IH264ENC_EXTERROR_INTER_PRESET = 55,
731 /** Bit 55 interCoding preset value is out of allowed range
732 */
733 IH264ENC_EXTERROR_INTER_SRCHRGN_SKIPMVBIAS = 56,
734 /** Bit 56 searchRangeHorP/B or searchRangeVerP/B or skipMVCodingBias
735 * values are out of allowed range
736 */
737 IH264ENC_EXTERROR_INTERLACE_DATALAYOUT = 57,
738 /** Bit 57 In interlaced encoding cases, dataLayout value set as part
739 * of inBufs structure is not IVIDEO_FIELD_INTERLEAVED and not even
740 * IVIDEO_FIELD_SEPARATED
741 */
742 IH264ENC_EXTERROR_INTRA_CBCR8X8 = 58,
743 /** Bit 58 This bit is set if,
744 * a. intraCodingPreset is not a default
745 * AND
746 * b. chromaIntra8x8Enable is enabled
747 * AND
748 * c. chromaComponentEnable value is falling out of allowed range
749 * Please refer IH264ENC_ChormaComponent for more details
750 */
751 IH264ENC_EXTERROR_INTRA_GDR_BFRAME_INPCONTENT_RATE = 59,
752 /** Bit 59 This bit is set if, in GDR enabled cases
753 * a. Interlaced encoding is enabled
754 * b. B frames are enabled
755 * c. GDR overlap rows is less than 0 or more than intraRefresh rate
756 */
757 IH264ENC_EXTERROR_INTRA_GDR_REFRESHRATE = 60,
758 /** Bit 60 gdrOverlapRowsBtwFrames is more than intraRefreshRate
759 */
760 IH264ENC_EXTERROR_INTRA_INTER_FRMINTERVAL = 61,
761 /** Bit 61 intraFrame interval is not a multiple of interFrame interval
762 */
763 IH264ENC_EXTERROR_INTRA_LEVEL_MODE = 62,
764 /** Bit 62 - lumaIntra8x8Enable is enabled for profile other than
765 * IH264_HIGH_PROFILE
766 */
767 IH264ENC_EXTERROR_INTRA_PRESET = 63,
768 /** Bit 63 intraCoding preset is out of allowed range
769 */
770 IH264ENC_EXTERROR_INTRA_REFRESHMETHOD = 64,
771 /** Bit 64 intraRefreshMethod value is out of allowed range
772 */
773 IH264ENC_EXTERROR_INTRA_REFRESHMETHOD_RATE = 65,
774 /** Bit 65 intraRefreshRate is less than or equal to 0 for
775 * intraRefreshMethod value other than default
776 */
777 IH264ENC_EXTERROR_INTRA_REFRESHRATE = 66,
778 /** Bit 66 - intraRefreshRate is less than 0 for GDR enabled cases
779 */
780 IH264ENC_EXTERROR_IVAHD_BADRESET = 67,
781 /** Bit 67 HDVICP reset is not proper
782 */
783 IH264ENC_EXTERROR_IVAHD_BADSTATE = 68,
784 /** Bit 68 HDVICP is not in standby state
785 */
786 IH264ENC_EXTERROR_IVAHD_RELEASE = 69,
787 /** Bit 69 HDVICP release fail. This occurs if HDVICP is not in
788 * standby state during release time
789 */
790 IH264ENC_EXTERROR_LEVEL_INPCONTENT = 70,
791 /** Bit 70 level less than or equal to IH264_LEVEL_20 for interlaced
792 * encoding
793 */
794 IH264ENC_EXTERROR_LEVELLIMIT_RESOLUTION = 71,
795 /** Bit 71 encoding resolutions/frame_dimensions are more than that
796 * of level allowed range
797 */
798 IH264ENC_EXTERROR_LOOPFILTER_OFFST_LFIDC = 72,
799 /** Bit 72 loop filter preset is not a default and loopfilterDisableIDC,
800 * filterOffsetA/B is/are out of allowed range or filterOffsetA/B is odd
801 * value
802 */
803 IH264ENC_EXTERROR_LOOPFILTER_PRESET = 73,
804 /* Bit 73 loop filter preset is out of allowed range
805 */
806 IH264ENC_EXTERROR_LUMA_INPUTBUF_MEMTYPE = 74,
807 /** Bit 74 memType value set in the plane descriptors of inBufs
808 * structure corresponding to Luma data is XDM_MEMTYPE_TILED32 or
809 * XDM_MEMTYPE_TILED16. Allowed value is only XDM_MEMTYPE_TILED8 for
810 * Luma container
811 */
812 IH264ENC_EXTERROR_METADATA_NUMBUFFERS = 75,
813 /** Bit 75 Number of meta data planes (corresponding to
814 * IH264_USER_DEFINED_SCALINGMATRIX and IH264_SEI_USER_DATA_UNREGISTERED)
815 * provided is not equal to inBufs->numMetaPlanes
816 */
817 IH264ENC_EXTERROR_METADATABUF_MEMTYPE = 76,
818 /** Bit 76 - memType value set in the meta data plane descriptors of
819 * inBufs structure is not equal to XDM_MEMTYPE_ROW or XDM_MEMTYPE_TILEDPAGE
820 */
821 IH264ENC_EXTERROR_METADATAPLANE_WGTTABLESIZE = 77,
822 /** Bit 77 In case of user defined scaling matrix, payload_size
823 * (bufSize.bytes) provided as part of meta data plane descriptors of inBufs
824 * structure is less the size of weightTable
825 * (inBufs->metadataPlaneDesc[index].bufSize.bytes) <
826 * (sizeof(sH264WgtTables_t))
827 */
828 IH264ENC_EXTERROR_METADATATYPES = 78,
829 /** Bit 78 metadataType[] are other than the supported values
830 */
831 IH264ENC_EXTERROR_MULITCHNL_BFRAME_NOTSUPPORTED = 79,
832 /** Bit 79 This bit is set if B frames are enabled in multi Frame
833 * process call
834 */
835 IH264ENC_EXTERROR_MULITCHNL_CHNLNUMEXCEEDED = 80,
836 /** Bit 80 This bit is set if number of channels to be processed are
837 * more that of maximum supported in multi Frame process call
838 */
839 IH264ENC_EXTERROR_MULITCHNL_DATASYNC = 81,
840 /** Bit 81 This bit is set if data sync is enabled in multi Frame process
841 * call
842 */
843 IH264ENC_EXTERROR_MULITCHNL_FRMPCK_STEREOIINFO = 82,
844 /** Bit 82 - This bit is set if framePackingPreset or stereoInfoPreset is
845 * enabled in multi Frame process call
846 */
847 IH264ENC_EXTERROR_MULITCHNL_GENHEADER_NOTSUPPORTED = 83,
848 /** Bit 83 - This bit is set if frame process mode is XDM_GENERATE_HEADER
849 * in multi Frame process call
850 */
851 IH264ENC_EXTERROR_MULITCHNL_MINBITRATE_NOTSUPPORTED = 84,
852 /** Bit 84 - This bit is set if minBitRate value is more than 0 in multi
853 * Frame process call
854 */
855 IH264ENC_EXTERROR_MULITCHNL_MVPERMB = 85,
856 /** Bit 85 This bit is set if motion vectors per MB (minBlockSizeP)
857 * is not same for all the channels submitted in multi Frame process call
858 */
859 IH264ENC_EXTERROR_NALU_GOLDENSPS = 86,
860 /** Bit 86 In all NALU preset masks, SPS_WITH_VUI bit is to be set or
861 * has to be reset. Setting of this bit in few masks and resetting in others
862 * is not allowed
863 */
864 IH264ENC_EXTERROR_NALU_PRESET = 87,
865 /** Bit 87 NALU control preset is out of allowed range
866 */
867 IH264ENC_EXTERROR_NALU_SPS_VUI = 88,
868 /** Bit 88 SEI NALU bit is set in a mask and SPS_WITH_VUI is not
869 * set in that particular mask
870 */
871 IH264ENC_EXTERROR_NOCLEANEXIT = 89,
872 /** Bit 89 Early return because M3 has done early abort
873 */
874 IH264ENC_EXTERROR_NUM_INPUT_OUTPUT_BUFS = 90,
875 /** Bit 90 There has to atleast 2 input buffers (inBufs->numPlanes :
876 * 1 Luma and 1 CbCr) and 1 output buffer (outBufs->numBufs : bit stream).
877 * This bit is set if this condition is not satisfied
878 */
879 IH264ENC_EXTERROR_OUTPUTBUF_MEMTYPE = 91,
880 /** Bit 91 This bit is set if
881 * a. output bitstream buffers memory type is not XDM_MEMTYPE_ROW or
882 * not XDM_MEMTYPE_TILEDPAGE
883 * OR
884 * b. output buffers memory type is out of allowed range
885 */
886 IH264ENC_EXTERROR_OUTPUTBUF_PTR_SIZE_NULL = 92,
887 /** Bit 92 This bit is set if output data sync is not enabled and
888 * bitstream buffer pointer is NULL or buffer.bytes is 0
889 */
890 IH264ENC_EXTERROR_OUTPUTDATASIZE_EXCEEDED = 93,
891 /** Bit 93 - Encoded output data size has exceeded the available buffer size
892 */
893 IH264ENC_EXTERROR_PRESET_ENC_RATECTRL_LVL = 94,
894 /** Bit 94 This bit is set if
895 * a. encodingPreset is out of allowed range
896 * b. rateControlPreset is out of allowed range
897 * c. profile and level out of allowed range
898 * d. data sync mode out of allowed range
899 * e. inputChromaFormat, inputContentType,operatingMode,
900 * maxInterFrameInterval, maxHeight, maxWidth and dataEndianness are
901 * out of allowed range
902 * If this bit is set, correspondingly IH264ENC_EXTERROR_PROFILE_DATASYNC
903 * _INPCONTENT_RES is also set
904 */
905 IH264ENC_EXTERROR_PROFILE_BFRAME = 95,
906 /** Bit 95 B frames are enabled for baseline profile
907 */
908 IH264ENC_EXTERROR_PROFILE_DATASYNC_INPCONTENT_RES = 96,
909 /** Bit 96 This bit is set if
910 * a. encodingPreset is out of allowed range
911 * b. rateControlPreset is out of allowed range
912 * c. profile and level out of allowed range
913 * d. data sync mode out of allowed range
914 * e. inputChromaFormat, inputContentType,operatingMode,
915 * maxInterFrameInterval, maxHeight, maxWidth and dataEndianness are
916 * out of allowed range
917 * If this bit is set, correspondingly IH264ENC_EXTERROR_PRESET_ENC_RATECTRL
918 * _LVL is also set
919 */
920 IH264ENC_EXTERROR_PROFILE_INPCONTENT = 97,
921 /** Bit 97 interlaced encoding is enabled for baseline profile
922 */
923 IH264ENC_EXTERROR_RATECTRL_BFRAMEPICSIZE = 98,
924 /** Bit 98 rate control, minPicSizeRatioB value is out of allowed range
925 */
926 IH264ENC_EXTERROR_RATECTRL_CBCRQPINDEX_INITBUFLVL = 99,
927 /** Bit 99 rate control,chromaQPIndexOffset initialBufferLevel are out
928 * of allowed range
929 */
930 IH264ENC_EXTERROR_RATECTRL_HRDBUFFER_LVLEXCEED = 100,
931 /** Bit 100 rate control, HRDBufferSize is falling out of level decided
932 * minimum and maximum limit
933 */
934 IH264ENC_EXTERROR_RATECTRL_IFRAME_QP = 101,
935 /** Bit 101 rate control, qpI is not falling in the range [qpMinI, qpMaxI]
936 */
937 IH264ENC_EXTERROR_RATECTRL_IFRAMEPICSIZE = 102,
938 /** Bit 102 rate control, minPicSizeRatioI value is out of allowed range
939 */
940 IH264ENC_EXTERROR_RATECTRL_IPBFRAME_QP = 103,
941 /** Bit 103 rate control, Qp values set for I, P and B frames are
942 * falling out allowed values
943 */
944 IH264ENC_EXTERROR_SCLMATRIX_METADATA = 104,
945 /** Bit 104 Scaling matrix preset is user defined
946 * (IH264_SCALINGMATRIX_USERDEFINED_SPSLEVEL or IH264_SCALINGMATRIX_
947 * USERDEFINED_PPSLEVEL) and meta data is not enabled for user defined
948 * scaling matrix
949 */
950 IH264ENC_EXTERROR_RATECTRL_PARAMSPRESET = 105,
951 /** Bit 105 rate control, rateControlParamsPreset is out of allowed range
952 */
953 IH264ENC_EXTERROR_RATECTRL_PBFRAME_QP = 106,
954 /** Bit 106 rate control, Qp values for P or B frames are out of
955 * range[minQp, maxQp]
956 */
957 IH264ENC_EXTERROR_RATECTRL_PFRAMEPICSIZE = 107,
958 /** Bit 107 rate control, minPicSizeRatioP value is out of allowed range
959 */
960 IH264ENC_EXTERROR_RATECTRL_PRESET_BFRAME_INPCONTENT = 108,
961 /** Bit 108 - IVIDEO_LOW_DELAY rateControlPreset is not supported for
962 * interlaced encoding and for B frame cases
963 */
964 IH264ENC_EXTERROR_RATECTRL_PROFILE_SCALINGMTRX = 109,
965 /** Bit 109 scaling matrix preset is out of range or scaling matrix preset
966 * is other than user defined for profile not equal to IH264_HIGH_PROFILE
967 */
968 IH264ENC_EXTERROR_RATECTRL_RCALGO = 110,
969 /** Bit 110 rate control, rcAlgo is out of allowed range
970 */
971 IH264ENC_EXTERROR_RATECTRL_RCALGO_INTERLACE_OR_BFRAME = 111,
972 /** Bit 111 - RATECONTROL_PRC_LOW_DELAY rcAlgo is not supported for
973 * interlaced encoding and for B frame cases
974 */
975 IH264ENC_EXTERROR_RATECTRL_SKIPDISTWNDW = 112,
976 /** Bit 112 This bit is set if
977 * a. rcAlgo is RATECONTROL_PRC_LOW_DELAY
978 * AND
979 * b. skip distribution window length (skipDistributionWindowLength) or
980 * number of skip frames in distribution window specified are out of
981 * allowed range
982 */
983 IH264ENC_EXTERROR_RATECTRL_VBR = 113,
984 /** Bit 113 rate control, with CVBR settings, VBR duration (VBRDuration)
985 * or VBR sensitivity (VBRsensitivity) are out of allowed range
986 */
987 IH264ENC_EXTERROR_RESOLUTION_BITRATE_FRMINTERVAL_GENHEADER= 114,
988 /** Bit 114 This bit is set if any of the below conditions is set
989 * a. The size of dynamic params structure set is not of base class and
990 * nor even extended class
991 * b. Encoding dimensions are out of range
992 * c. Target bit rate less than minimum bt rate or frame rate is less than 0
993 * d. Generate header mode other than XDM_ENCODE_AU and XDM_GENERATE_HEADER
994 * e. User forced frame other than IDR/NA frame
995 * f. Wrong settings in interframe or intraFrame intervals
996 * g. Incorrect settings in motion vector accuracy settings
997 * If this bit is set, correspondingly IH264ENC_EXTERROR_CAPTUREWIDTH_
998 * FORCEFRAME_LTRP_QPEL is also set
999 */
1000 IH264ENC_EXTERROR_ROI_COORDINATES = 115,
1001 /** Bit 115 ROI co-ordinates provided are not proper. x/y may be less
1002 * than 0 or more than frame dimensions. Also please see that Top.x
1003 * should be less than Bottom.x and Top.y should be less than bottom.y
1004 * for all co-ordinates
1005 */
1006 IH264ENC_EXTERROR_ROI_NUMBERROIS = 116,
1007 /** Bit 116 Number of ROI regions set are out of allowed range
1008 */
1009 IH264ENC_EXTERROR_ROI_PRIORITY = 117,
1010 /** Bit 117 ROI priority (roiPriority) provided are out of allowed range.
1011 * This check is done with rate control enabled cases
1012 */
1013 IH264ENC_EXTERROR_ROI_QP = 118,
1014 /** Bit 118 - ROI priority (roiPriority) provided are out of allowed range.
1015 * This check is done with rate control disabled cases.
1016 * Here roiPriority holds the Qp values of the ROI regions
1017 */
1018 IH264ENC_EXTERROR_ROI_TYPE = 119,
1019 /** Bit 119 ROI types (roiType) provided are out of allowed range
1020 */
1021 IH264ENC_EXTERROR_SLICE_NONE_DATASYNC = 120,
1022 /** Bit 120 data sync call back notification is enabled for every
1023 * slice (outputDataMode == IVIDEO_SLICEMODE)and slice level encoding
1024 * is disabled (sliceMode == IH264_SLICEMODE_NONE)
1025 */
1026 IH264ENC_EXTERROR_SLICE_H241_ENTROPY_INTERFRAME_INTERLACE = 121,
1027 /** Bit 121 This bit is set if H241 is enabled and
1028 * a. Width provided is less than that being supported in H241 cases
1029 * OR
1030 * b. Interlaced encoding is enabled
1031 * OR
1032 * c. Entropy coding mode is CABAC
1033 * OR
1034 * d. B frames are enabled
1035 * OR
1036 * e. Slice unit size in bytes (sliceUnitSize) provided is loess that being
1037 * supported
1038 * If this bit is set, correspondingly IH264ENC_EXTERROR_SLICE_H241_
1039 * WIDTH_SLICESIZE is also set
1040 */
1041 IH264ENC_EXTERROR_SLICE_STRMFORMAT_DATASYNC = 122,
1042 /** Bit 122 stream format IH264_NALU_STREAM is supported only with default
1043 * slice mode and datasync option as IVIDEO_SLICEMODE
1044 */
1045 IH264ENC_EXTERROR_SLICE_H241_WIDTH_SLICESIZE = 123,
1046 /** Bit 123 This bit is set if H241 is enabled and
1047 * a. Width provided is less than that being supported in H241 cases
1048 * OR
1049 * b. Interlaced encoding is enabled
1050 * OR
1051 * c. Entropy coding mode is CABAC
1052 * OR
1053 * d. B frames are enabled
1054 * OR
1055 * e. Slice unit size in bytes (sliceUnitSize) provided is loess that being
1056 * supported
1057 */
1058 IH264ENC_EXTERROR_SLICE_MODE_SIZE = 124,
1059 /** Bit 124 This bit is set if
1060 * a. Slice mode is SLICEMODE_MBUNIT and slice size provided is more than
1061 * size of the frame or slice size is less than 6
1062 * OR
1063 * b. Slice mode is SLICEMODE_OFFSET and sliceOffset0 is more than
1064 * sliceOffset1 or sliceOffset1 is more than sliceoffset2
1065 */
1066 IH264ENC_EXTERROR_SLICE_PRESET = 125,
1067 /** Bit 125 slice coding preset is out of allowed range
1068 */
1069 IH264ENC_EXTERROR_SLICE_STRMFORMAT = 126,
1070 /** Bit 126 stream format provided is out of allowed range
1071 */
1072 IH264ENC_EXTERROR_STATUS_PTRNULL = 127,
1073 /** Bit 127 status structure pointer passed in the encoder control call is
1074 * NULL
1075 */
1076 IH264ENC_EXTERROR_STATUS_SIZE = 128,
1077 /** Bit 128 - The size of status params structure set is not of base class
1078 * and nor even extended class
1079 */
1080 IH264ENC_EXTERROR_STEREO_INPCONTENT = 129,
1081 /** Bit 129 stereo info preset is enabled for progressive encoding which
1082 * is not supported in this version of encoder
1083 */
1084 IH264ENC_EXTERROR_STEREO_PRESET = 130,
1085 /** Bit 130 stereo info preset set is out of allowed range
1086 */
1087 IH264ENC_EXTERROR_VERSION_BUFFER_NULL_OR_SIZE = 131,
1088 /** Bit 131 data buffer pointer as part of status structure is NULL.
1089 * This buffer is used to place the version number of encoder.
1090 * OR
1091 * The data size as part of status structure is less than the size
1092 * required to place an version number
1093 */
1094 IH264ENC_EXTERROR_VUI_NUMUNITSINTICKS = 132,
1095 /** Bit 132 VUI coding preset is user defined and the parameter
1096 * numUnitsInTicks as part of vuiCodingParams is less than 0
1097 */
1098 IH264ENC_EXTERROR_VUI_PRESET = 133,
1099 /** Bit 133 VUI coding preset set is out of allowed range
1100 */
1101 IH264ENC_NUM_OUTPUT_BUFS_ANALYTICINFO = 134,
1102 /** Bit 134 Analytic info is enabled and the buffer to store analytic
1103 * info is not provided i.e., (outBufs->numBufs < 2 AND enableAnalyticinfo)
1104 */
1105 IH264ENC_EXTERROR_NUM_MAXBITS,
1106 /** Maximum number of sub extended error bits
1107 */
1108 IH264ENC_EXTERROR_NUM_MAXWORDS = ((IH264ENC_EXTERROR_NUM_MAXBITS + 31) / 32)
1109 /** Each word can hold 32 error bits, so max words are calculated as above
1110 */
1111}IH264ENC_ExtErrBits;
1112
1113/**
1114 * @enum IH264ENC_Level
1115 * @brief Level Identifier for H.264 Encoder
1116*/
1117typedef enum {
1118 IH264_LEVEL_10 = 10, /**< Level 1.0 */
1119 IH264_LEVEL_1b = 9, /**< Level 1.b */
1120 IH264_LEVEL_11 = 11, /**< Level 1.1 */
1121 IH264_LEVEL_12 = 12, /**< Level 1.2 */
1122 IH264_LEVEL_13 = 13, /**< Level 1.3 */
1123 IH264_LEVEL_20 = 20, /**< Level 2.0 */
1124 IH264_LEVEL_21 = 21, /**< Level 2.1 */
1125 IH264_LEVEL_22 = 22, /**< Level 2.2 */
1126 IH264_LEVEL_30 = 30, /**< Level 3.0 */
1127 IH264_LEVEL_31 = 31, /**< Level 3.1 */
1128 IH264_LEVEL_32 = 32, /**< Level 3.2 */
1129 IH264_LEVEL_40 = 40, /**< Level 4.0 */
1130 IH264_LEVEL_41 = 41, /**< Level 4.1 */
1131 IH264_LEVEL_42 = 42, /**< Level 4.2 */
1132 IH264_LEVEL_50 = 50, /**< Level 5.0 */
1133 IH264_LEVEL_51 = 51 /**< Level 5.1 */
1134
1135} IH264ENC_Level;
1136
1137
1138/**
1139 * @enum IH264ENC_Profile
1140 * @brief Profile Identifier for H.264 Encoder
1141*/
1142typedef enum {
1143 IH264_BASELINE_PROFILE = 66, /**< BaseLine Profile */
1144 IH264_MAIN_PROFILE = 77, /**< Main Profile */
1145 IH264_EXTENDED_PROFILE = 88, /**< Extended Profile */
1146 IH264_HIGH_PROFILE = 100, /**< High Profile */
1147 IH264_DEFAULT_PROFILE = IH264_HIGH_PROFILE, /**< Default Profile */
1148 IH264_HIGH10_PROFILE = 110, /**< High 10 Profile */
1149 IH264_HIGH422_PROFILE = 122, /**< High 4:2:2 Profile */
1150 IH264SVC_BASELINE_PROFILE = 83, /**< SVC Baseline Profile */
1151 IH264SVC_HIGH_PROFILE = 86 /**< SVC High Profile */
1152} IH264ENC_Profile;
1153
1154/**
1155 * @enum IH264ENC_MetadataType
1156 * @brief Meta Data for H.264 encoder
1157
1158 The way to pass meta data to encode is via inBufs to the encoder during
1159 process call.
1160 The way to get meta data from encode is via outBufs of the encoder during
1161 process call.
1162
1163 When application request the buffer infos via control call with
1164 XDM_GETBUFINFO, encoder should count a buffer to have meta data at
1165 input/output level for this purpose. If for some metadata size is not known
1166 by encoder then it should return size =-1 so that application can
1167 allocate as per its knowledge. Same way for some meta-data application
1168 might not provide the size to codec via XDM2_SingleBufDesc.bufSize.bytes,
1169 in that case application can set it to -1. The meta data which has size
1170 field in its format, uses size of buffer from that field only.
1171 Example: User want to insert SEI_USER_DATA_UNREGISTERED meta data at each
1172 IDR picture, the following steps should be followed
1173
1174 1. Create the encoder object with IVIDENC2_Params::metadataType[0] =
1175 IH264_SEI_USER_DATA_UNREGISTERED and metadataType[1] and metadataType[2]
1176 = IVIDEO_METADATAPLANE_NONE
1177
1178 Also have IH264ENC_SET_NALU(naluPresentMaskIDRPicture, SEI)
1179 2. Call Control function with XDM_GETBUFINFO. Encoder should return one
1180 additional input buffer as required. size of the buffer will be -1 as
1181 encoder doesn't know the size
1182 3. Application should have a memory allocated for this meta data and pass on
1183 to the encoder via IVIDEO2_BufDesc *inBufs->numMetaPlanes = 1
1184 +----------------+
1185 inBufs->metadataPlaneDesc[index].buf = pBuffer ; ---> | size | payLoad |
1186 inBufs->metadataPlaneDesc[index].bufSize.bytes = -1 ; +----------------+
1187 since the meta-data format includes size field, encoder will read size from
1188 there and utilize it.
1189
1190 index of metadataPlaneDesc is the index of metaDataType which is holding
1191 the particular meta data type. In this example metadataType[0] is holding
1192 IH264_SEI_USER_DATA_UNREGISTERED so index = 0 of metadataPlaneDesc points
1193 to IH264_SEI_USER_DATA_UNREGISTERED specific meta data
1194*/
1195
1196typedef enum {
1197 IH264_SEI_USER_DATA_UNREGISTERED = XDM_CUSTOMENUMBASE,
1198 /**< H.264 allows inserting SEI message for any user data. refer section
1199 * D.1.6 of H.264 standard.
1200 * By setting this value to any if IVIDENC2_Params::metadataType[i]
1201 * user can provide its user data SEI to be inserted
1202 * in H.264 bit-stream
1203 * The format of user data is as below
1204 * typedef struct {
1205 * U32 size; only lower 10-bits are considered
1206 * U08 payload[]; number of bytes for payload is indicated by first
1207 * 32 bit field size
1208 * }
1209 * The picture which uses this metadata will be decided by naluPresentMask::SEI
1210 * bit. Example
1211 * if SEI bit of only naluPresentMaskStartOfSequence is set to 1 then this meta
1212 * data will be used only during start of sequence
1213 * Encoder can accept maximum size of this meta data as 1023 bytes < 1K.
1214 * Only lower 10-bits of size field is used by encoder
1215 */
1216
1217 IH264_REGION_OF_INTEREST,
1218 /**< Not defined yet the format but this field is to control the encoder to
1219 * accept ROI data as input
1220 */
1221
1222 IH264_USER_DEFINED_SCALINGMATRIX
1223 /**< H.264 allows inserting user defined scaling matrices.
1224 * By setting this value to any if IVIDENC2_Params::metadataType[i]
1225 * user can provide its user data SEI to be inserted in H.264 bit-stream
1226 * The format of user data is as below
1227 * typedef struct {
1228 * U32 size; only lower 10-bits are considered
1229 * U08 payload[]; number of bytes for payload is indicated by first
1230 * 32 bit field size
1231 * }
1232 * format of payload is for scaling matrix is defined in User GUide
1233 */
1234} IH264ENC_MetadataType;
1235
1236/**
1237 * @enum IH264ENC_Control
1238 * @brief Diffrent types of controls for encoding frame
1239 * Eg: refere long term reference frame
1240 */
1241
1242typedef enum {
1243 IH264ENC_CTRL_REFER_LONG_TERM_FRAME = XDM_CUSTOMENUMBASE,
1244 /**< Refere long term reference frame (I/IDR frames) when
1245 * IH264ENC_LTRPScheme is IH264ENC_LTRP_REFERTOIDR
1246 */
1247 IH264ENC_CTRL_NOWRITE_NOREFUPDATE,
1248 /**< Current frame is a non-referencing P frame and do
1249 * not update the reference frame for this frame. Applicable
1250 * when IH264ENC_LTRPScheme is IH264ENC_LTRP_REFERTOP_PROACTIVE
1251 */
1252 IH264ENC_CTRL_WRITE_NOREFUPDATE,
1253 /**< Current frame is a referencing P frame and do
1254 * not update the reference frame for this frame. Applicable
1255 * when IH264ENC_LTRPScheme is IH264ENC_LTRP_REFERTOP_PROACTIVE
1256 */
1257 IH264ENC_CTRL_NOWRITE_REFUPDATE,
1258 /**< Current frame is a non-referencing P frame and
1259 * update the reference frame for this frame. Applicable
1260 * when IH264ENC_LTRPScheme is IH264ENC_LTRP_REFERTOP_PROACTIVE
1261 */
1262 IH264ENC_CTRL_WRITE_REFUPDATE,
1263 /**< Current frame is a referencing P frame and
1264 * update the reference frame for this frame. Applicable
1265 * when IH264ENC_LTRPScheme is IH264ENC_LTRP_REFERTOP_PROACTIVE
1266 */
1267 IH264ENC_CTRL_START_GDR
1268 /**< Current frame is a choosen to start the GDR activity. Applicable
1269 * when intraRefreshMethod is IH264_INTRAREFRESH_GDR
1270 */
1271} IH264ENC_Control;
1272
1273/**
1274 * @enum IH264ENC_LTRPScheme
1275 * @brief Diffrent types of long term-frame referencing scheme
1276 * Eg: Mark all the I frames as long term-reference frame
1277 */typedef enum {
1278 IH264ENC_LTRP_NONE = 0,
1279 /**< No longterm refernce frame in the sequnce
1280 */
1281 IH264ENC_LTRP_REFERTO_PERIODICLTRP = 1,
1282 /**< Mark frames as long-term reference frame with the period given
1283 * by LTRPPeriod of IH264ENC_Params and
1284 * based on the frame control IH264ENC_Control, refer to
1285 * the long-term reference frame .
1286 */
1287 IH264ENC_LTRP_REFERTOP_PROACTIVE =2,
1288 /**< Two long term frames are supported in this schme and
1289 * long-term index marking and refernce frame update is done based
1290 * the IH264ENC_Control values
1291 */
1292 IH264ENC_LTRP_REFERTOP_REACTIVE = 3
1293 /**< Mark frames as long-term reference frame with the period given
1294 * by LTRPPeriod of IH264ENC_Params.
1295 * At any point of time there will be 2 long-term frames and
1296 * based on the frame control IH264ENC_Control, refer to
1297 * the last long-term reference frame .
1298 */
1299}IH264ENC_LTRPScheme;
1300
1301/**
1302 * @enum IH264ENC_PicOrderCountType
1303 * @brief Picture Order Count Type Identifier for H.264 Encoder
1304*/
1305typedef enum {
1306 IH264_POC_TYPE_0 = 0, /**< POC type 0 */
1307 IH264_POC_TYPE_DEFAULT = IH264_POC_TYPE_0, /**< Default poc type */
1308 IH264_POC_TYPE_1 = 1, /**< POC type 1 */
1309 IH264_POC_TYPE_2 = 2, /**< POC type 2 */
1310 IH264_POC_TYPE_MAX
1311
1312} IH264ENC_PicOrderCountType;
1313
1314
1315/**
1316
1317 @enum IH264ENC_ScalingMatPreset
1318 @brief These enumerations control the type of scaling matrix picked up
1319 by encoder
1320
1321*/
1322typedef enum {
1323 IH264_SCALINGMATRIX_NONE = 0,
1324 /**< Default Scaling matrix (No scaling) */
1325 IH264_SCALINGMATRIX_NORMAL = 1,
1326 /**< Flat Scaling matrix: part of standard (NO Scaling Matrix) */
1327 IH264_SCALINGMATRIX_DEFAULT = IH264_SCALINGMATRIX_NORMAL,
1328 /**< For normal contents */
1329 IH264_SCALINGMATRIX_NOISY = 2,
1330 /**< For noisy contents */
1331 IH264_SCALINGMATRIX_STD_DEFAULT = 3,
1332 /**< Default Scaling Matrix provided by H.264 standard */
1333 IH264_SCALINGMATRIX_USERDEFINED_SPSLEVEL = 4,
1334 /**< User defined SM at SPS level*/
1335 IH264_SCALINGMATRIX_USERDEFINED_PPSLEVEL = 5,
1336 /**< User defined SM at PPS level*/
1337 IH264_SCALINGMATRIX_MAX
1338
1339} IH264ENC_ScalingMatPreset;
1340
1341
1342/**
1343
1344 @enum IH264ENC_RateControlAlgo
1345 @brief These enumerations control the type of rateControl algo to be picked
1346 up by encoder. Only useful if IVIDENC2::rateControlPreset is set as
1347 IVIDEO_USER_DEFINED
1348
1349*/
1350typedef enum {
1351 IH264_RATECONTROL_PRC = 0, /**< Perceptual Rate Control,
1352 * controls the QP @ MB level
1353 */
1354 IH264_RATECONTROL_PRC_LOW_DELAY = 1, /** Low Delay Rate Control */
1355 IH264_RATECONTROL_DEFAULT = IH264_RATECONTROL_PRC /** Default rcAlgo is PRC */
1356
1357} IH264ENC_RateControlAlgo;
1358
1359
1360/**
1361
1362 @enum IH264ENC_FrameQualityFactor
1363 @brief These enumerations control the quality factor b/w two types of frames
1364 For example if user want I frame Quality to be given more importance
1365 than P frame, one can define it to be higher quality factor
1366
1367*/
1368typedef enum {
1369 IH264_QUALITY_FACTOR_1 = 0, /**< Same Quality factor
1370 * b/w two types of frame
1371 */
1372 IH264_QUALITY_FACTOR_DEFAULT = IH264_QUALITY_FACTOR_1,
1373 /**< Default Quality factor
1374 * to be used by encoder
1375 */
1376 IH264_QUALITY_FACTOR_2 = 1, /**< High Quality factor to
1377 * one frame type b/w two types
1378 of frame
1379 */
1380 IH264_QUALITY_FACTOR_3 = 2, /**< Higher Quality factor to
1381 one frame type b/w two types of frame
1382 */
1383 IH264_QUALITY_FACTOR_MAX
1384
1385} IH264ENC_FrameQualityFactor;
1386
1387
1388
1389/**
1390
1391 @enum IH264ENC_RateControlParamsPreset
1392 @brief These enumerations control the RateControl Params
1393
1394*/
1395
1396typedef enum {
1397 IH264_RATECONTROLPARAMS_DEFAULT = 0,
1398 /**< Default Rate Control params */
1399 IH264_RATECONTROLPARAMS_USERDEFINED = 1,
1400 /**< User defined Rate Control params */
1401 IH264_RATECONTROLPARAMS_EXISTING = 2,
1402 /**< Keep the Rate Control params as existing. This is
1403 * useful because during control call if user don't want
1404 * to chnage the Rate Control Params
1405 */
1406 IH264_RATECONTROLPARAMS_MAX
1407
1408} IH264ENC_RateControlParamsPreset;
1409
1410/**
1411
1412 @enum IH264ENC_InterCodingPreset
1413 @brief These enumerations control the type of inter coding
1414
1415*/
1416
1417typedef enum {
1418 IH264_INTERCODING_DEFAULT = 0, /**< Default Inter coding params */
1419 IH264_INTERCODING_USERDEFINED = 1, /**< User defined inter coding params */
1420 IH264_INTERCODING_EXISTING = 2, /**< Keep the inter coding params as
1421 * existing. This is useful because
1422 * during control call if user don't
1423 * want to chnage the inter coding Params
1424 */
1425 IH264_INTERCODING_MED_SPEED_HIGH_QUALITY = 3, /**< Med Speed High Quality*/
1426 IH264_INTERCODING_HIGH_SPEED = 4, /**< High Speed Preset*/
1427 IH264_INTERCODING_MAX
1428
1429} IH264ENC_InterCodingPreset;
1430
1431/**
1432
1433 @enum IH264ENC_MeAlgoMode
1434 @brief These enumerations control the mealgo selected
1435
1436*/
1437
1438typedef enum {
1439 IH264ENC_MOTIONESTMODE_NORMAL = 0, /**< Normal meAlgo */
1440 IH264ENC_MOTIONESTMODE_HIGH_SPEED = 1, /**< meAlgo for HIGH SPEED */
1441 IH264ENC_MOTIONESTMODE_DEFAULT = IH264ENC_MOTIONESTMODE_NORMAL,
1442 /**< Default meAlgo */
1443 IH264ENC_MOTIONESTMODE_MAX
1444
1445} IH264ENC_MeAlgoMode;
1446
1447/**
1448
1449 @enum IH264ENC_IntraCodingBias
1450 @brief These enumerations control the number of intra Mbs to be encoded
1451
1452*/
1453
1454typedef enum {
1455 IH264ENC_INTRACODINGBIAS_NORMAL = 0,
1456 /**< Normal number of intra Mbs */
1457 IH264ENC_INTRACODINGBIAS_HIGH_SPEED = 12,
1458 /**< intra Mbs restricted for HIGH SPEED */
1459 IH264ENC_INTRACODINGBIAS_DEFAULT = IH264ENC_INTRACODINGBIAS_NORMAL,
1460 /**< Default intra codign bias */
1461 IH264ENC_INTRACODINGBIAS_MAX
1462
1463} IH264ENC_IntraCodingBias;
1464
1465/**
1466
1467 @enum IH264ENC_InterBlockSize
1468 @brief These enumerations are defined for minimum Inter block size
1469
1470*/
1471
1472typedef enum {
1473 IH264_BLOCKSIZE_16x16 = 0, /**< 16x16 Block size */
1474 IH264_BLOCKSIZE_DEFAULT = IH264_BLOCKSIZE_16x16, /**< Default block size */
1475 IH264_BLOCKSIZE_8x8 = 1, /**< 8x8 Block size */
1476 IH264_BLOCKSIZE_4x4 = 2, /**< 4x4 Block size */
1477 IH264_BLOCKSIZE_MAX
1478
1479} IH264ENC_InterBlockSize;
1480
1481/**
1482
1483 @enum IH264ENC_BiasFactor
1484 @brief Encoder uses bias b/w two possible chices for lot of decisions.
1485 It is to control the mild/strong ness of the biasing
1486
1487*/
1488typedef enum {
1489 IH264_BIASFACTOR_LOW = 0,
1490 /**< Low biasing */
1491 IH264_BIASFACTOR_MEDIUM = 1,
1492 /**< Normal/Med biasing */
1493 IH264_BIASFACTOR_NORMAL = IH264_BIASFACTOR_MEDIUM,
1494 /**< Normal/Med biasing */
1495 IH264_BIASFACTOR_DEFAULT = IH264_BIASFACTOR_MEDIUM,
1496 /**< Default :Normal/Med biasing*/
1497 IH264_BIASFACTOR_HIGH = 2,
1498 /**< High biasing */
1499 IH264_BIASFACTOR_MILD = 4, /**< Mild biasing */
1500 IH264_BIASFACTOR_ADAPTIVE = 5, /**< Adaptive biasing */
1501 IH264_BIASFACTOR_MAX
1502} IH264ENC_BiasFactor;
1503
1504
1505/**
1506
1507 @enum IH264ENC_IntraRefreshMethods
1508 @brief Refresh method Type Identifier for H.264 Encoder
1509
1510*/
1511
1512typedef enum {
1513 IH264_INTRAREFRESH_NONE = 0, /**< Doesn't insert forcefully intra
1514 macro blocks */
1515 IH264_INTRAREFRESH_DEFAULT = IH264_INTRAREFRESH_NONE,
1516 /**< Default intra refresh is OFF */
1517 IH264_INTRAREFRESH_CYCLIC_MBS, /**< Insters intra macro blocks in a
1518 * cyclic fashion cyclic interval is
1519 * equal to intraRefreshRate
1520 */
1521 IH264_INTRAREFRESH_CYCLIC_SLICES, /**< Insters Intra Slices(Row based) in
1522 * a cyclic fashion:
1523 * cyclic interval is equal to
1524 * intraRefreshRate
1525 */
1526 IH264_INTRAREFRESH_RDOPT_MBS, /**< position of intra macro blocks is
1527 * intelligently chosen by encoder,
1528 * but the number of forcely coded
1529 * intra macro blocks in a frame is
1530 * gaurnteed to be equal to
1531 * totalMbsInFrame/intraRefreshRate
1532 */
1533 IH264_INTRAREFRESH_GDR, /**< Instead of a sudden Intra Refresh
1534 * of entire frame, the frame is refreshed
1535 * Gradualy over a duration (which is con-
1536 * figerable) of frames with refresh
1537 * happening by Intra coded rows scanning
1538 *from top to bottom of the scene/picture.
1539 */
1540 IH264_INTRAREFRESH_MAX
1541
1542} IH264ENC_IntraRefreshMethods;
1543
1544/**
1545
1546 @enum IH264ENC_ChormaComponent
1547 @brief These enumerations control the selction of chroma component to perfom
1548 chroma intra estimation
1549
1550*/
1551typedef enum {
1552 IH264_CHROMA_COMPONENT_CB_CR_BOTH = 0, /**< BOth Cb and Cr component */
1553 IH264_CHROMA_COMPONENT_CR_ONLY = 1, /**< Only Cr Component */
1554 IH264_CHROMA_COMPONENT_DEFAULT = IH264_CHROMA_COMPONENT_CR_ONLY,
1555 /**< Default is Only Cr Component */
1556 IH264_CHROMA_COMPONENT_MAX
1557
1558} IH264ENC_ChormaComponent;
1559
1560
1561/**
1562
1563 @enum IH264ENC_IntraCodingPreset
1564 @brief These enumerations control the type of intra coding
1565
1566*/
1567
1568typedef enum {
1569 IH264_INTRACODING_DEFAULT = 0, /**< Default intra coding params */
1570 IH264_INTRACODING_USERDEFINED = 1, /**< User defined intra coding params */
1571 IH264_INTRACODING_EXISTING = 2,
1572 IH264_INTRACODING_HIGH_SPEED = 3, /**< High Speed intra Coding Preset */
1573 IH264_INTRACODING_MAX
1574
1575} IH264ENC_IntraCodingPreset;
1576
1577/**
1578
1579 @enum IH264ENC_NALUnitType
1580 @brief These enumerations define the NALU type supported by H.264
1581
1582*/
1583typedef enum {
1584 IH264_NALU_TYPE_UNSPECIFIED = 0,
1585 /**< Unspecified Slice Type */
1586 IH264_NALU_TYPE_SLICE = 1,
1587 /**< slice of a non-IDR picture */
1588 IH264_NALU_TYPE_SLICE_DP_A = 2,
1589 /**< Coded slice data partition A */
1590 IH264_NALU_TYPE_SLICE_DP_B = 3,
1591 /**< Coded slice data partition B */
1592 IH264_NALU_TYPE_SLICE_DP_C = 4,
1593 /**< Coded slice data partition C */
1594 IH264_NALU_TYPE_IDR_SLICE = 5,
1595 /**< slice of an IDR picture */
1596 IH264_NALU_TYPE_SEI = 6,
1597 /**< Supplemental enhancement information */
1598 IH264_NALU_TYPE_SPS = 7,
1599 /**< Sequence parameter set */
1600 IH264_NALU_TYPE_PPS = 8,
1601 /**< Picture parameter set */
1602 IH264_NALU_TYPE_AUD = 9,
1603 /**< Access unit delimiter */
1604 IH264_NALU_TYPE_EOSEQ = 10,
1605 /**< End of sequence */
1606 IH264_NALU_TYPE_EOSTREAM = 11,
1607 /**< End of stream */
1608 IH264_NALU_TYPE_FILLER = 12,
1609 /**< Filler data */
1610 IH264_NALU_TYPE_SPS_WITH_VUI = 13,
1611 /**< Sequence parameter set with VUI */
1612 IH264_NALU_TYPE_USER_DATA_UNREGD_SEI = 14,
1613 /**< User Data unregsitered SEI */
1614 IH264_NALU_TYPE_SSPS = 15,
1615 /**< Sub-Sequence Parameter Set for SVC */
1616 IH264_NALU_TYPE_CODED_SLICE_IN_SCALABLE_EXTN = 20
1617 /**< Coded Slice in Scalable Extn for SVC */
1618
1619} IH264ENC_NALUnitType;
1620
1621
1622/**
1623
1624 @enum IH264ENC_NALUControlPreset
1625 @brief These enumerations define the control mechanism for insertion of
1626 different NALU types at different point in video sequence
1627
1628*/
1629
1630typedef enum {
1631 IH264_NALU_CONTROL_DEFAULT = 0, /**< Default NALU insertion */
1632 IH264_NALU_CONTROL_USERDEFINED = 1, /**< User defined NALU insertion */
1633 IH264_NALU_CONTROL_MAX
1634
1635} IH264ENC_NALUControlPreset;
1636
1637/**
1638
1639 @enum IH264ENC_SliceCodingPreset
1640 @brief These enumerations control the type of slice coding
1641
1642*/
1643
1644typedef enum {
1645 IH264_SLICECODING_DEFAULT = 0,
1646 /**< Default slice coding params */
1647 IH264_SLICECODING_USERDEFINED = 1,
1648 /**< User defined slicecoding params */
1649 IH264_SLICECODING_EXISTING = 2,
1650 /**< Keep the slice coding params as existing */
1651 /**< This is useful because during control call */
1652 /**< if user don't want to chnage the sliceCodingParams */
1653 IH264_SLICECODING_MAX
1654
1655} IH264ENC_SliceCodingPreset;
1656
1657/**
1658
1659 @enum IH264ENC_SliceMode
1660 @brief These enumerations control the type of slice coding
1661
1662*/
1663
1664typedef enum {
1665 IH264_SLICEMODE_NONE = 0,
1666 IH264_SLICEMODE_DEFAULT = IH264_SLICEMODE_NONE,
1667 /**< Default slice coding mode is MB based */
1668 IH264_SLICEMODE_MBUNIT = 1,
1669 /**< Slices are controlled based upon number of Macroblocks */
1670 IH264_SLICEMODE_BYTES = 2,
1671 /**< Slices are controlled based upon number of bytes */
1672 IH264_SLICEMODE_OFFSET = 3,
1673 /**< Slices are controlled based upon user defined offset in
1674 * unit of Rows
1675 */
1676 IH264_SLICEMODE_MAX
1677
1678} IH264ENC_SliceMode;
1679
1680/**
1681
1682 @enum IH264ENC_StreamFormat
1683 @brief These enumerations control the type stream format
1684
1685*/
1686typedef enum {
1687 IH264_BYTE_STREAM = 0,
1688 /**< bit-stream contains the start code identifier*/
1689 IH264_STREAM_FORMAT_DEFAULT = IH264_BYTE_STREAM,
1690 /**< Default slice coding mode is byte-stream */
1691 IH264_NALU_STREAM = 1,
1692 /**< bit-stream doesn't contain the start code identifier */
1693 IH264_STREAM_FORMAT_MAX
1694}IH264ENC_StreamFormat;
1695
1696
1697/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
1698/**
1699 * @enum IH264ENC_LoopFilterPreset
1700 * @brief These enumerations control the type of slice coding
1701*/
1702
1703typedef enum {
1704 IH264_LOOPFILTER_DEFAULT = 0, /**< Default loop-filtering params */
1705 IH264_LOOPFILTER_USERDEFINED = 1, /**< User defined loop-filtering params */
1706 IH264_LOOPFILTER_MAX
1707} IH264ENC_LoopFilterPreset;
1708
1709/**
1710
1711 @enum IH264ENC_LoopFilterDisableIDC
1712 @brief Control Parameter to disable loop filter at different places
1713
1714*/
1715typedef enum {
1716 IH264_DISABLE_FILTER_NONE = 0,
1717 /**< Enable filtering of all the edges */
1718 IH264_DISABLE_FILTER_DEFAULT = IH264_DISABLE_FILTER_NONE,
1719 /**< Default is Loop filter enabled */
1720 IH264_DISABLE_FILTER_ALL_EDGES,
1721 /**< Disable filtering of all the edge */
1722 IH264_DISABLE_FILTER_SLICE_EDGES,
1723 /**< Disable filtering of slice edges */
1724 IH264_DISABLE_FILTER_MAX
1725} IH264ENC_LoopFilterDisableIDC;
1726
1727/**
1728
1729 @enum IH264ENC_SliceGroupMapType
1730 @brief Slice group map type defined by H.264 standard
1731
1732*/
1733
1734typedef enum {
1735 IH264_INTERLEAVED_SLICE_GRP = 0,
1736 /**< 0 : Interleaved Slice Group */
1737 IH264_DISPERSED_SLICE_GRP = 1,
1738 /**< 1 : Dispersed Slice Group */
1739 IH264_FOREGRND_WITH_LEFTOVER_SLICE_GRP = 2,
1740 /**< 2 : ForeGround with Left Over */
1741 IH264_BOX_OUT_SLICE_GRP = 3,
1742 /**< 3 : Box Out */
1743 IH264_RASTER_SCAN_SLICE_GRP = 4,
1744 /**< 4 : Raster Scan */
1745 IH264_SLICE_GRP_MAP_DEFAULT = IH264_RASTER_SCAN_SLICE_GRP,
1746 /**< Default*/
1747 IH264_WIPE_SLICE_GRP = 5,
1748 /**< 5 : Wipe slice group */
1749 IH264_EXPLICIT_SLICE_GRP = 6
1750 /**< 6 : Explicit Slice gropup map */
1751} IH264ENC_SliceGroupMapType;
1752
1753/**
1754
1755 @enum IH264ENC_SliceGroupChangeDirection
1756 @brief Different Scan /rotation oreder
1757
1758*/
1759
1760typedef enum {
1761 IH264_RASTER_SCAN = 0,
1762 /**< 0 : Raster scan order */
1763 IH264_CLOCKWISE = 0,
1764 /**< 0 : Clockwise (used for BOX OUT FMO Params)*/
1765 IH264_RIGHT = 0,
1766 /**< 0 : RIGHT (Used for Wipe FMO type) */
1767 IH264ENC_SLICEGROUP_CHANGE_DIRECTION_DEFAULT = IH264_RASTER_SCAN,
1768 /**< Default */
1769 IH264_REVERSE_RASTER_SCAN = 1,
1770 /**< 1 : Reverse Raster Scan Order */
1771 IH264_COUNTER_CLOCKWISE = 1,
1772 /**< 1 : Counter Clockwise (used for BOX OUT
1773 * FMO Params)
1774 */
1775 IH264_LEFT = 1
1776 /**< 1 : LEFT (Used for Wipe FMO type) */
1777} IH264ENC_SliceGroupChangeDirection;
1778
1779/**
1780
1781 @enum IH264ENC_FMOCodingPreset
1782 @brief Preset to define FMO coding type
1783
1784*/
1785
1786typedef enum {
1787 IH264_FMOCODING_NONE = 0, /**< 0 : NO FMO */
1788 IH264_FMOCODING_DEFAULT = IH264_FMOCODING_NONE, /**< 0 : NO FMO */
1789 IH264_FMOCODING_USERDEFINED = 1 /**< 1 : User defined FMO parameters */
1790
1791} IH264ENC_FMOCodingPreset;
1792
1793
1794/**
1795
1796 @enum IH264ENC_VUICodingPreset
1797 @brief Defines the Preset for VUI coding
1798
1799*/
1800
1801typedef enum {
1802 IH264_VUICODING_DEFAULT = 0, /**< Default VUI Parameters. Note that
1803 * Enable/Disable of VUI is via
1804 * nalUnitControlParams
1805 */
1806 IH264_VUICODING_USERDEFINED = 1, /**< 1 : User defined VUI parameters*/
1807 IH264_VUICODING_MAX /**< Max VUI Coding enum */
1808
1809} IH264ENC_VUICodingPreset;
1810
1811
1812/**
1813
1814 @enum IH264ENC_VideoFormat
1815 @brief Defines different video formats
1816
1817*/
1818typedef enum {
1819 IH264ENC_VIDEOFORMAT_COMPONENT, /**< component video format */
1820 IH264ENC_VIDEOFORMAT_PAL, /**< PAL video format */
1821 IH264ENC_VIDEOFORMAT_NTSC, /**< NTSC video format */
1822 IH264ENC_VIDEOFORMAT_SECAM, /**< SECAM video format */
1823 IH264ENC_VIDEOFORMAT_MAC, /**< MAC video format */
1824 IH264ENC_VIDEOFORMAT_UNSPECIFIED /**< Unspecified video format*/
1825} IH264ENC_VideoFormat;
1826
1827/**
1828
1829 @enum IH264ENC_StereoInfoPreset
1830 @brief Defines the Preset for Stereo Video Info coding*/
1831
1832typedef enum {
1833 IH264_STEREOINFO_DISABLE = 0, /* StereoVideoCoding is disable */
1834 IH264_STEREOINFO_ENABLE_DEFAULT = 1, /* Default Stereo Video Info
1835 Parameters enabled. */
1836 IH264_STEREOINFO_ENABLE_USERDEFINED = 2, /* User defined Stereo Video Info
1837 parameters enabled */
1838 IH264_STEREOINFO_MAX /* Max Stereo Video Info enum */
1839
1840} IH264ENC_StereoInfoPreset;
1841
1842/**
1843
1844 @enum IH264ENC_FramePackingPreset
1845 @brief Defines the Preset for Frame packing SEI coding*/
1846
1847typedef enum {
1848 IH264_FRAMEPACK_SEI_DISABLE = 0, /* Frame packing SEI is disable */
1849 IH264_FRAMEPACK_SEI_ENABLE_DEFAULT = 1, /* Default Frame packing SEI
1850 Parameters enabled. */
1851 IH264_FRAMEPACK_SEI_USERDEFINED = 2, /* User defined SFrame packing
1852 SEIparameters enabled */
1853 IH264_FRAMEPACK_SEI_MAX /* Max Stereo Video Info enum */
1854
1855} IH264ENC_FramePackingPreset;
1856
1857/**
1858
1859 @enum IH264ENC_FramePackingType
1860 @brief Defines the type of packing arrangement for
1861 Frame packing SEI coding
1862*/
1863
1864typedef enum {
1865 IH264_FRAMEPACK_CHECKERBOARD = 0,
1866 IH264_FRAMEPACK_COLUMN_INTERLEAVING = 1,
1867 IH264_FRAMEPACK_ROW_INTERLEAVING = 2,
1868 IH264_FRAMEPACK_SIDE_BY_SIDE = 3,
1869 IH264_FRAMEPACK_TOP_BOTTOM = 4,
1870 IH264_FRAMEPACK_TYPE_DEFAULT = IH264_FRAMEPACK_SIDE_BY_SIDE,
1871 IH264_FRAMEPACK_TYPE_MAX
1872
1873} IH264ENC_FramePackingType;
1874
1875/**
1876
1877 @enum IH264ENC_AspectRatioIdc
1878 @brief Defines aspect ratio IDs
1879
1880*/
1881typedef enum {
1882 IH264ENC_ASPECTRATIO_UNSPECIFIED, /**< Unspecified aspect ratio */
1883 IH264ENC_ASPECTRATIO_SQUARE, /**< 1:1 (square) aspect ratio */
1884 IH264ENC_ASPECTRATIO_12_11, /**< 12:11 aspect ratio */
1885 IH264ENC_ASPECTRATIO_10_11, /**< 10:11 aspect ratio */
1886 IH264ENC_ASPECTRATIO_16_11, /**< 16:11 aspect ratio */
1887 IH264ENC_ASPECTRATIO_40_33, /**< 40:33 aspect ratio */
1888 IH264ENC_ASPECTRATIO_24_11, /**< 24:11 aspect ratio */
1889 IH264ENC_ASPECTRATIO_20_11, /**< 20:11 aspect ratio */
1890 IH264ENC_ASPECTRATIO_32_11, /**< 32:11 aspect ratio */
1891 IH264ENC_ASPECTRATIO_80_33, /**< 80:33 aspect ratio */
1892 IH264ENC_ASPECTRATIO_18_11, /**< 18:11 aspect ratio */
1893 IH264ENC_ASPECTRATIO_15_15, /**< 15:15 aspect ratio */
1894 IH264ENC_ASPECTRATIO_64_33, /**< 64:33 aspect ratio */
1895 IH264ENC_ASPECTRATIO_160_99, /**< 160:99 aspect ratio */
1896 IH264ENC_ASPECTRATIO_4_3, /**< 4:3 aspect ratio */
1897 IH264ENC_ASPECTRATIO_3_2, /**< 3:2 aspect ratio */
1898 IH264ENC_ASPECTRATIO_2_1, /**< 2:1 aspect ratio */
1899 IH264ENC_ASPECTRATIO_EXTENDED = 255 /**< Extended aspect ratio */
1900
1901} IH264ENC_AspectRatioIdc;
1902
1903/**
1904
1905 @enum IH264ENC_EntropyCodingMode
1906 @brief Defines the different entropy code mode
1907
1908*/
1909typedef enum {
1910 IH264_ENTROPYCODING_CAVLC = 0, /**< CAVLC coding
1911 type
1912 */
1913 IH264_ENTROPYCODING_DEFAULT = IH264_ENTROPYCODING_CAVLC, /**< Default is
1914 CAVLC coding type
1915 */
1916 IH264_ENTROPYCODING_CABAC = 1, /**< CABAC coding
1917 type
1918 */
1919 IH264_ENTROPYCODING_MAX
1920} IH264ENC_EntropyCodingMode;
1921
1922/**
1923
1924 @enum IH264ENC_TransformBlockSize
1925 In H264 Intra macro block's transform size depends upon the Intra mode,
1926 so this applies to inter macroblocks only
1927
1928*/
1929typedef enum {
1930 IH264_TRANSFORM_4x4 = 0, /**< Transform blocks
1931 size is 4x4 */
1932 IH264_TRANSFORM_8x8 = 1, /**< Transform blocks
1933 * size is 8x8 :
1934 * Valid for only
1935 * High Profile
1936 */
1937 IH264_TRANSFORM_ADAPTIVE = 2, /**< Adaptive transform
1938 * block size :
1939 * encoder decides
1940 * as per content
1941 */
1942 IH264_TRANSFORM_DEFAULT = IH264_TRANSFORM_ADAPTIVE, /**< Default is adaptive
1943 * based upon content
1944 */
1945 IH264_TRANSFORM_MAX
1946
1947} IH264ENC_TransformBlockSize;
1948
1949
1950
1951/**
1952
1953 @enum IH264ENC_GOPStructure
1954 @brief
1955 When B frames are used (InterFrameInterval > 1) then the arrangement of
1956 frames can be different
1957
1958 GOP structure in display order as indicated below
1959 If contentType = Frame
1960 IH264ENC_GOPSTRUCTURE_NONUNIFORM : IBBPBBP. .
1961 IH264ENC_GOPSTRUCTURE_UNIFORM : BBIBBPBB. .
1962 If contentType = Field
1963 IH264ENC_GOPSTRUCTURE_NONUNIFORM : IPBBBBPBBBB
1964 IH264ENC_GOPSTRUCTURE_UNIFORM : BBBBIPBBBBPPBBBB
1965
1966*/
1967
1968typedef enum {
1969 IH264ENC_GOPSTRUCTURE_NONUNIFORM = 0,
1970 /**< Open Gop structure : IBBPBBP */
1971 IH264ENC_GOPSTRUCTURE_DEFAULT = IH264ENC_GOPSTRUCTURE_NONUNIFORM,
1972 /**< Default is open gop structure */
1973 IH264ENC_GOPSTRUCTURE_UNIFORM = 1,
1974 /**< Close Gop structure : BBIBBPBB*/
1975 IH264ENC_GOPSTRUCTURE_MAX
1976
1977} IH264ENC_GOPStructure;
1978
1979
1980/**
1981
1982 @enum IH264ENC_BiasFactor
1983 @brief Encoder uses bias b/w two possible chices for lot of decisions.
1984 It is to control the mild/strong ness of the biasing
1985
1986*/
1987typedef enum {
1988 IH264_INTERLACE_PICAFF = 0,
1989 /**< PicAFF type of interlace coding */
1990 IH264_INTERLACE_MBAFF = 1,
1991 /**< MBAFF type of interlace coding */
1992 IH264_INTERLACE_FIELDONLY = 2,
1993 /**< Field only coding with fixed partiy scheme */
1994 IH264_INTERLACE_FIELDONLY_MRF = IH264_INTERLACE_FIELDONLY,
1995 /**< Use Most recent field for refernece*/
1996 IH264_INTERLACE_FIELDONLY_ARF = 3,
1997 /**< Field only coding where codec decides the partiy of of the field to
1998 * be used based upon content (adaptive) */
1999 IH264_INTERLACE_DEFAULT = IH264_INTERLACE_FIELDONLY_ARF,
2000 /**< Default : adaptive partiy for reference*/
2001 IH264_INTERLACE_FIELDONLY_SPF = 4,
2002 /**< Use same parity field for refernece */
2003
2004 IH264_INTERLACE_MAX
2005} IH264ENC_InterlaceCodingType;
2006/**
2007 @enum IH264ENC_NumTemporalLayer
2008 @brief Define different Temporal Layers
2009*/
2010typedef enum {
2011 /* Only Base Layer */
2012 IH264_TEMPORAL_LAYERS_1 = 1,
2013
2014 /* Base Layer + Temporal Layer */
2015 IH264_TEMPORAL_LAYERS_2 = 2,
2016
2017 /* Base Layer + 2Temporal Layers */
2018 IH264_TEMPORAL_LAYERS_3 = 3,
2019
2020 /* Base Layer + 3Temporal Layers */
2021 IH264_TEMPORAL_LAYERS_4 = 4,
2022
2023 /* Maximum Temporal Layer Supported*/
2024 IH264_TEMPORAL_LAYERS_MAX = IH264_TEMPORAL_LAYERS_4
2025
2026} IH264ENC_NumTemporalLayer;
2027
2028/**
2029 @enum IH264ENC_RoiType
2030 @brief Defines the different ROI types
2031*/
2032typedef enum {
2033 IH264_FACE_OBJECT = 0,
2034 /**< Face type of ROI object */
2035 IH264_BACKGROUND_OBJECT = 1,
2036 /**< Background type of ROI object */
2037 IH264_FOREGROUND_OBJECT = 2,
2038 /**< Foreground type of ROI object */
2039 IH264_DEFAULT_OBJECT = 3,
2040 /**< Default type of ROI object */
2041 IH264_PRIVACY_MASK = 4
2042 /**< Privacy mask type of ROI object */
2043} IH264ENC_RoiType;
2044
2045/**
2046 @enum IH264ENC_SvcExtensionFlag
2047 @brief Define SVC Extension Flag
2048*/
2049typedef enum {
2050 /*Svc Extension Flag Disabled*/
2051 IH264_SVC_EXTENSION_FLAG_DISABLE = 0,
2052 /*Svc Extension Flag Enabled*/
2053 IH264_SVC_EXTENSION_FLAG_ENABLE = 1,
2054 /*Svc Extension Flag Enabled with EC Flexibility*/
2055 IH264_SVC_EXTENSION_FLAG_ENABLE_WITH_EC_FLEXIBILITY = 2
2056
2057} IH264ENC_SvcExtensionFlag;
2058
2059/**
2060 @enum IH264ENC_ReferencePicMarking
2061 @brief Define Reference Picture Marking
2062*/
2063typedef enum {
2064 /* ReferencePicMarking is Short-term picutre(Sliding Window) */
2065 IH264_SHORT_TERM_PICTURE = 0,
2066 /* ReferencePicMarking is Long-term picutre(MMCO Commands) */
2067 IH264_LONG_TERM_PICTURE = 1
2068
2069} IH264ENC_ReferencePicMarking;
2070/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
2071/* Definition of all the structures define by this interafce */
2072/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
2073
2074/**
2075
2076 @struct IH264ENC_RateControlParams
2077 @brief This structure contains all the parameters which controls Rate
2078 Control behavior
2079
2080 @param rateControlParamsPreset :
2081 regarded @ IH264ENC_DynamicParams::rateControlParams
2082 This Preset controls the USER_DEFINED vs DEFAULT mode. if User is
2083 not aware about following fields, it should be set as
2084 IH264_RATECONTROLPARAMS_DEFAULT
2085 @param scalingMatrixPreset :
2086 ignored @ IH264ENC_DynamicParams::rateControlParams
2087 This Preset controls the USER_DEFINED vs DEFAULT mode. if User is
2088 not aware about following fields, it should be set as
2089 IH264_SCALINGMATRIX_DEFAULT
2090
2091 @param rcAlgo : ignored @ IH264ENC_DynamicParams::rateControlParams
2092 This defines the rate control algorithm to be used. Only useful
2093 if IVIDENC2::rateControlPreset is set as IVIDEO_USER_DEFINED
2094
2095 @param qpI : regarded @ IH264ENC_DynamicParams::rateControlParams
2096 Initial Quantization Parameter for I/IDR frames.
2097 Valid Range is [-1, 51]
2098 -1 : Auto Initialization else other wise Initial QP.
2099 when rateControlPreset = IVIDEO_NONE, this quantization parameter is
2100 used by the whole video frame/field
2101
2102 @param qpMaxI : regarded @ IH264ENC_DynamicParams::rateControlParams
2103 Maximum Quantization Parameter for I/IDR frame(s). Range [0 , 51].
2104 Useful to control a minimum quality level
2105
2106 @param qpMinI : regarded @ IH264ENC_DynamicParams::rateControlParams
2107 Minimum Quantization Parameter for I/IDR frame(s). Range [0 , 51].
2108 Useful to control a maximum bit-rate level
2109
2110 @param qpP : regarded @ IH264ENC_DynamicParams::rateControlParams
2111 Initial Quantization Parameter for P frames. Valid Range is [-1, 51]
2112 -1 : Auto Initialization else other wise Initial QP.
2113 when rateControlPreset = IVIDEO_NONE, this quantization parameter is
2114 used by the whole video frame/field
2115
2116 @param qpMaxP : regarded @ IH264ENC_DynamicParams::rateControlParams
2117 Maximum Quantization Parameter for inter frame(s). Range [0 , 51].
2118 Useful to control a minimum quality level
2119
2120 @param qpMinP : regarded @ IH264ENC_DynamicParams::rateControlParams
2121 Minimum Quantization Parameter for inter frame(s). Range [0 , 51].
2122 Useful to control a maximum bit-rate level
2123
2124 @param qpOffsetB : regarded @ IH264ENC_DynamicParams::rateControlParams
2125 Offset of B frames Quantization Parameter from P frames.
2126 Valid Range is [-1, 51]
2127 -1 : Auto Initialization else other wise user provided offset
2128 if after adding the qpOffsetB into qp of P frame it exceeds 51 then
2129 it is clipped to 51
2130 when rateControlPreset = IVIDEO_NONE, this offset parameter is
2131 used by the whole video frame/field
2132
2133 @param qpMaxB : regarded @ IH264ENC_DynamicParams::rateControlParams
2134 Maximum Quantization Parameter for B frame(s). Range [0 , 51].
2135 Useful to control a minimum quality level
2136
2137 @param qpMinB : regarded @ IH264ENC_DynamicParams::rateControlParams
2138 Minimum Quantization Parameter for B frame(s). Range [0 , 51].
2139 Useful to control a maximum bit-rate level
2140
2141 @param allowFrameSkip : regarded @ IH264ENC_DynamicParams::rateControlParams
2142 Controls Frame Skip.
2143 non-zero means frames can be skipped to achieve target bit-rate
2144 zero means frame can never be skipped
2145
2146 @param removeExpensiveCoeff :
2147 regarded @ IH264ENC_DynamicParams::rateControlParams
2148 Flag to Remove high frequency expensive coeffecients
2149
2150 @param chromaQPIndexOffset :
2151 ignored @ IH264ENC_DynamicParams::rateControlParams
2152 Specifies offset to be added to luma QP for addressing QPC values
2153 table for chroma components.
2154 Valid value is between -12 and 12, (inclusive)
2155
2156 @param IPQualityFactor : ignored @ IH264ENC_DynamicParams::rateControlParams
2157 This provides configurality to control I frame Quality wrt to P frame.
2158 Higher Quality factor means I frame quality is given higher
2159 improtance compared to P frame.
2160 Refer IH264ENC_FrameQualityFactor for possible values
2161
2162 @param initialBufferLevel :
2163 ignored @ IH264ENC_DynamicParams::rateControlParams
2164 Initial Buffer level for HRD compliance. It informs that Hypothtical
2165 decoder can start after how much time. The value taken is the
2166 obsolute value of the HRD buffer size For example if user want
2167 Hypothtical decoder to start taking out data from HRD buffer after
2168 half second then it should set initialBufferLevel = half of the
2169 HRD buffer size that is programmed.
2170
2171 @param HRDBufferSize : regarded @ IH264ENC_DynamicParams::rateControlParams
2172 Hypothetical Reference Decoder Buffer Size. This size controls the
2173 frame skip logic of the encoder. for low delay applications this
2174 size should be small. Unit of this variable is bits
2175
2176 @param minPicSizeRatio : regarded @ IH264ENC_DynamicParams::rateControlParams
2177 This ratio is used to compute minimum picture size
2178 in the following manner,
2179 minPicSize = averagePicSize >> minPicSizeRatio
2180 allowed values 1 to 4, Setting this to 0 will enable
2181 encoder chosen ratio.
2182 Note that this is guided value to rate control to
2183 determine min picture size and encoder may not
2184 strictly follow this
2185 @param maxPicSizeRatio : regarded @ IH264ENC_DynamicParams::rateControlParams
2186 To determines ratio for max picture size
2187 This ratio is used to compute maximum picture size
2188 in the following manner,
2189 maxPicSize = averagePicSize * maxPicSizeRatio
2190 allowed values 2 to 30.Setting this to 0 and 1
2191 will enable encoder chosen ratio.
2192 Note that this is guided value to rate control
2193 to determine max picture size and encoder may not
2194 strictly follow this.
2195
2196 @param enablePRC : regarded @ IH264ENC_DynamicParams::rateControlParams
2197 This flag is used to control allowing PRC in the
2198 frame
2199
2200 @param enablePartialFrameSkip : regarded @ IH264ENC_DynamicParams::
2201 rateControlParams
2202 This flag is used to control allowing partial frame
2203 skip in the frame
2204 @param reserved : 16 bit word, kept to not change the foot print
2205 @param VBRDuration : During over which statistics during interval are
2206 collected to switch bit-rate states.Increasing this
2207 value will make VBR wait for longer time before
2208 switching bit-rate state
2209 @param VBRsensitivity : Specifies the target bitrate used by rate control in
2210 high complexity state.
2211 @param skipDistributionWindowLength : Number of frames over which the skip
2212 frames can be distributed
2213 @param numSkipInDistributionWindow : Number of skips allowed within the
2214 distribution window
2215 @param reservedRC
2216 Some part is kept reserved to add parameters later without
2217 changing the foot print of interface memory
2218
2219 @todo More parameters to be added : delay (VBV), PRC related etc..
2220
2221
2222*/
2223
2224typedef struct IH264ENC_RateControlParams {
2225 XDAS_Int8 rateControlParamsPreset;
2226 XDAS_Int8 scalingMatrixPreset;
2227 XDAS_Int8 rcAlgo;
2228 XDAS_Int8 qpI;
2229 XDAS_Int8 qpMaxI;
2230 XDAS_Int8 qpMinI;
2231 XDAS_Int8 qpP;
2232 XDAS_Int8 qpMaxP;
2233 XDAS_Int8 qpMinP;
2234 XDAS_Int8 qpOffsetB;
2235 XDAS_Int8 qpMaxB;
2236 XDAS_Int8 qpMinB;
2237 XDAS_Int8 allowFrameSkip;
2238 XDAS_Int8 removeExpensiveCoeff;
2239 XDAS_Int8 chromaQPIndexOffset;
2240 XDAS_Int8 IPQualityFactor;
2241 XDAS_Int32 initialBufferLevel;
2242 XDAS_Int32 HRDBufferSize;
2243 XDAS_Int16 minPicSizeRatioI;
2244 XDAS_Int16 maxPicSizeRatioI;
2245 XDAS_Int16 minPicSizeRatioP;
2246 XDAS_Int16 maxPicSizeRatioP;
2247 XDAS_Int16 minPicSizeRatioB;
2248 XDAS_Int16 maxPicSizeRatioB;
2249 XDAS_Int8 enablePRC;
2250 XDAS_Int8 enablePartialFrameSkip;
2251 XDAS_Int8 discardSavedBits;
2252 XDAS_Int8 reserved;
2253 XDAS_Int32 VBRDuration;
2254 XDAS_Int8 VBRsensitivity;
2255 XDAS_Int16 skipDistributionWindowLength;
2256 XDAS_Int16 numSkipInDistributionWindow;
2257 XDAS_Int8 enableHRDComplianceMode;
2258 XDAS_Int32 frameSkipThMulQ5;
2259 XDAS_Int32 vbvUseLevelThQ5;
2260 XDAS_Int32 reservedRC[3];
2261
2262} IH264ENC_RateControlParams;
2263
2264/**
2265 @struct ROI_Interface
2266 @brief This structure defines the ROI input parameters required by Encoder.
2267 @param listROI:
2268 List of ROIs with their x and y co-ordinates
2269 @param roiType:
2270 Type of each ROI
2271 @param numOfROI:
2272 Number of ROIs passed to codec
2273 @param roiPriority:
2274 Priority of each ROI
2275*/
2276typedef struct IH264ENC_RoiInput {
2277 XDM_Rect listROI[IH264ENC_MAX_ROI];
2278 XDAS_Int8 roiType[IH264ENC_MAX_ROI];
2279 XDAS_Int8 numOfROI;
2280 XDAS_Int32 roiPriority[IH264ENC_MAX_ROI];
2281}IH264ENC_RoiInput;
2282
2283/**
2284
2285 @struct IH264ENC_InterCodingParams
2286 @brief This structure contains all the parameters which controls Inter MBs
2287 coding behavior
2288 @param interCodingPreset
2289 This Preset controls the USER_DEFINED vs DEFAULT mode. if User is
2290 not aware about following fields, it should be set as
2291 IH264_INTERCODING_DEFAULT
2292 @param searchRangeHorP :regarded @ IH264ENC_DynamicParams::interCodingParams
2293 Horizontal Search Range for P frames
2294 @param searchRangeVerP :regarded @ IH264ENC_DynamicParams::interCodingParams
2295 Vertical Search Range for P frames
2296 @param searchRangeHorB :regarded @ IH264ENC_DynamicParams::interCodingParams
2297 Horizontal Search Range for B frames
2298 @param searchRangeVerB :regarded @ IH264ENC_DynamicParams::interCodingParams
2299 Vertical Search Range for B frames
2300 @param interCodingBias :regarded @ IH264ENC_DynamicParams::interCodingParams
2301 Bias Control for having a macro block coded as inter vs Intra
2302 Refer IH264ENC_BiasFactor for possible values
2303 @param skipMVCodingBias :regarded @ IH264ENC_DynamicParams::interCodingParams
2304 Bias Control for having a macro block use skip MV vs regular MV
2305 refer IH264ENC_BiasFactor for possible values
2306 @param minBlockSizeP : regarded @ IH264ENC_DynamicParams::interCodingParams
2307 minimum block size for P frames. Refer IH264ENC_InterBlockSize
2308 enumeration to see the valid values
2309 @param minBlockSizeB : regarded @ IH264ENC_DynamicParams::interCodingParams
2310 minimum block size for B frames. Refer IH264ENC_InterBlockSize
2311 enumeration to see the valid values
2312
2313*/
2314
2315typedef struct IH264ENC_InterCodingParams {
2316 XDAS_Int8 interCodingPreset;
2317 XDAS_Int16 searchRangeHorP;
2318 XDAS_Int16 searchRangeVerP;
2319 XDAS_Int16 searchRangeHorB;
2320 XDAS_Int16 searchRangeVerB;
2321 XDAS_Int8 interCodingBias;
2322 XDAS_Int8 skipMVCodingBias;
2323 XDAS_Int8 minBlockSizeP;
2324 XDAS_Int8 minBlockSizeB;
2325 XDAS_Int8 meAlgoMode;
2326
2327} IH264ENC_InterCodingParams;
2328
2329/**
2330
2331 @struct IH264ENC_IntraCodingParams
2332 @brief This structure contains all the parameters which controls Intra
2333 encoding
2334
2335 @param intraCodingPreset
2336 This Preset controls the USER_DEFINED vs DEFAULT mode. if User is
2337 not aware about following fields, it should be set as
2338 INTRA_CODING_DEFAULT other wise INTRA_CODING_USER_DEFINED
2339 @param lumaIntra4x4Enable
2340 This parameter controls the Luma Intra4x4 encoding in video encoder. A
2341 bit-field is given for each Luma intra4x4 mode as shown below. This
2342 field is H.264 specific HOR_UP|VERT_LEFT|HOR_DOWN|
2343 VERT_RIGHT|DIAG_DOWN_RIGHT|DIAG_DOWN_LEFT|DC|HOR|VER
2344 Set/ reset particular bit to enable/disable that mode
2345 (0=disable, 1=enable). DC (bit-2)is don't care
2346 @param lumaIntra8x8Enable
2347 This parameter controls the Luma Intra8x8 encoding in video encoder. A
2348 bit-field is given for each Luma intra8x8 mode as shown below.
2349 HOR_UP|VERT_LEFT|HOR_DOWN|VERT_RIGHT|DIAG_DOWN_RIGHT|DIAG_DOWN_LEFT|
2350 DC|HOR|VER Set/ reset particular bit to enable/disable that
2351 mode (0=disable, 1=enable) DC (bit-2)is don't care
2352 Example : 139(decimal) ==> 0x8B =>> 010001011 (bits) ==>
2353 HOR, VER, VERT_LEFT
2354 are enabled and DC is always enabled
2355 @param lumaIntra16x16Enable
2356 This parameter controls the Luma Intra16x16 encoding in video encoder.
2357 A bit-field is given for each Luma intra16x16 mode as shown below.
2358 PLANE|DC|HOR|VER
2359 Set/ reset particular bit to enable/disable that
2360 mode (0=disable, 1=enable). DC (bit-2)is don't care
2361 @param chromaIntra8x8Enable
2362 This parameter controls the chroma Intra8x8 encoding in video encoder.
2363 A bit-field is given for each chroma intra8x8 mode as shown below.
2364 PLANE|VER|HOR|DC
2365 Set/ reset particular bit to enable/disable
2366 that mode (0=disable, 1=enable) DC (bit-0)is don't care
2367 @param chromaComponentEnable
2368 This parameter controls the chroma Intra prediction search. User
2369 can choose to perfom chroma intra estimation for both Cb and Cr
2370 samples or only on Cr samples. For more details
2371 refer IH264ENC_ChormaComponent
2372 @param intraRefreshMethod
2373 Mechanism to do intra Refresh, see IH264ENC_IntraRefreshMethods
2374 for valid values
2375 @param intraRefreshRate
2376 Rate at which intra Refresh is done, This rate is specified as
2377 One IntraMB per # MBs. For example if rate is 20 it means that
2378 there has to be one intra MB(s) per 20 Mbs.
2379 When intraRefreshMethod == IH264_INTRAREFRESH_GDR, this parameter
2380 is treated/interpreted number of rows to be intra refreshed per
2381 frame.
2382
2383 @param gdrOverlapRowsBtwFrames
2384 Defines the Overlap of the Intra Refresh Region between successive
2385 frame in case the intraRefreshMethod == IH264_INTRAREFRESH_GDR or
2386 else treated to be don't care.
2387 Again gdrOverlapRowsBtwFrames should be less than intraRefreshRate.
2388
2389 @param constrainedIntraPredEnable
2390 Controls the intra macroblock coding in P slices.
2391 Valid values are [0,non-zero]
2392
2393*/
2394
2395typedef struct IH264ENC_IntraCodingParams {
2396 XDAS_Int8 intraCodingPreset;
2397 XDAS_Int16 lumaIntra4x4Enable;
2398 XDAS_Int16 lumaIntra8x8Enable;
2399 XDAS_Int8 lumaIntra16x16Enable;
2400 XDAS_Int8 chromaIntra8x8Enable;
2401 XDAS_Int8 chromaComponentEnable;
2402 XDAS_Int8 intraRefreshMethod;
2403 XDAS_Int16 intraRefreshRate;
2404 XDAS_Int16 gdrOverlapRowsBtwFrames;
2405 XDAS_Int16 constrainedIntraPredEnable;
2406 XDAS_Int8 intraCodingBias;
2407} IH264ENC_IntraCodingParams;
2408
2409
2410/**
2411
2412 @struct IH264ENC_NALUControlParams
2413 @brief This structure contains all the parameters which define the
2414 control mechanism for insertion of different NALU types at
2415 different point in video sequence
2416
2417 @param naluControlPreset
2418 This Preset controls the USER_DEFINED vs DEFAULT mode. if User is
2419 not aware about following fields, it should be set as
2420 IH264_NALU_CONTROL_DEFAULT other wise IH264_NALU_CONTROL_USERDEFINED
2421 @param naluPresentMaskStartOfSequence
2422 This parameter controls the insertion of different NALU at Start of
2423 Sequence
2424 A bit-field is given for each NALU type as shown below. This field is
2425\n ---------------------------------------------------------------------\n
2426\n 7| 6| 5| 4| 3| 2| 1| 0 \n
2427\n SPS|SEI|IDR_SLICE|SLICE_DP_C|SLICE_DP_B|SLICE_DP_A|SLICE|UNSPECIFIED \n
2428\n ---------------------------------------------------------------------\n
2429\n----------------------------------------------
2430\n 14| 13| 12| 11| 10| 9| 8|
2431\n UD_SEI|SPS_VUI|FILLER|EOSTREAM|EOSEQ|AUD|PPS|
2432\n----------------------------------------------
2433 Set/ reset particular bit to enable/disable that insertion of that
2434 NALU (0=disable, 1=enable)
2435 UNSPECIFIED (bit-0), SLICE_DP_A(bit-2), SLICE_DP_B(bit-3),
2436 SLICE_DP_C(bit-4), IDR_SLICE(bit-5), EOSEQ (bit-10) and
2437 EOSTREAM (bit-11) are don't care and assumed to be <b> zero </b>.
2438 SPS (bit-7), PPS(bit-8) are don't care and assumed to be <b> one </b>.
2439 @param naluPresentMaskIDRPicture
2440 This parameter controls the insertion of different NALU at IDR picture
2441 A bit-field is given for each NALU type as shown below. This field is
2442\n ---------------------------------------------------------------------\n
2443\n 7| 6| 5| 4| 3| 2| 1| 0 \n
2444\n SPS|SEI|IDR_SLICE|SLICE_DP_C|SLICE_DP_B|SLICE_DP_A|SLICE|UNSPECIFIED \n
2445\n ---------------------------------------------------------------------\n
2446\n----------------------------------------------
2447\n 14| 13| 12| 11| 10| 9| 8|
2448\n UD_SEI|SPS_VUI|FILLER|EOSTREAM|EOSEQ|AUD|PPS|
2449\n----------------------------------------------
2450 Set/ reset particular bit to enable/disable that insertion of that
2451 NALU (0=disable, 1=enable)
2452 UNSPECIFIED (bit-0), SLICE_DP_A(bit-2), SLICE_DP_B(bit-3),
2453 SLICE_DP_C(bit-4), IDR_SLICE(bit-5), EOSEQ (bit-10) and
2454 EOSTREAM (bit-11) are don't care and assumed to be <b> zero </b>.
2455 @param naluPresentMaskIntraPicture
2456 This parameter controls the insertion of different NALU at I picture
2457 A bit-field is given for each NALU type as shown below. This field is
2458\n ---------------------------------------------------------------------\n
2459\n 7| 6| 5| 4| 3| 2| 1| 0 \n
2460\n SPS|SEI|IDR_SLICE|SLICE_DP_C|SLICE_DP_B|SLICE_DP_A|SLICE|UNSPECIFIED \n
2461\n ---------------------------------------------------------------------\n
2462\n----------------------------------------------
2463\n 14| 13| 12| 11| 10| 9| 8|
2464\n UD_SEI|SPS_VUI|FILLER|EOSTREAM|EOSEQ|AUD|PPS|
2465\n----------------------------------------------
2466 Set/ reset particular bit to enable/disable that insertion of that
2467 NALU (0=disable, 1=enable)
2468 UNSPECIFIED (bit-0), SLICE_DP_A(bit-2), SLICE_DP_B(bit-3),
2469 SLICE_DP_C(bit-4), IDR_SLICE(bit-5), EOSEQ (bit-10) and
2470 EOSTREAM (bit-11) are don't care and assumed to be <b> zero </b>.
2471 @param naluPresentMaskNonIntraPicture
2472 This parameter controls the insertion of different
2473 NALU at NON intra picture
2474 A bit-field is given for each NALU type as shown below. This field is
2475\n ---------------------------------------------------------------------\n
2476\n 7| 6| 5| 4| 3| 2| 1| 0 \n
2477\n SPS|SEI|IDR_SLICE|SLICE_DP_C|SLICE_DP_B|SLICE_DP_A|SLICE|UNSPECIFIED \n
2478\n ---------------------------------------------------------------------\n
2479\n----------------------------------------------
2480\n 14| 13| 12| 11| 10| 9| 8|
2481\n UD_SEI|SPS_VUI|FILLER|EOSTREAM|EOSEQ|AUD|PPS|
2482\n----------------------------------------------
2483 Set/ reset particular bit to enable/disable that insertion of that
2484 NALU (0=disable, 1=enable)
2485 UNSPECIFIED (bit-0), SLICE_DP_A(bit-2), SLICE_DP_B(bit-3),
2486 SLICE_DP_C(bit-4), IDR_SLICE(bit-5), EOSEQ (bit-10) and
2487 EOSTREAM (bit-11) are don't care and assumed to be <b> zero </b>.
2488 @param naluPresentMaskEndOfSequence
2489 This parameter controls the insertion of different NALU at End of Seq
2490 A bit-field is given for each NALU type as shown below. This field is
2491\n ---------------------------------------------------------------------\n
2492\n 7| 6| 5| 4| 3| 2| 1| 0 \n
2493\n SPS|SEI|IDR_SLICE|SLICE_DP_C|SLICE_DP_B|SLICE_DP_A|SLICE|UNSPECIFIED \n
2494\n ---------------------------------------------------------------------\n
2495\n----------------------------------------------
2496\n 14| 13| 12| 11| 10| 9| 8|
2497\n UD_SEI|SPS_VUI|FILLER|EOSTREAM|EOSEQ|AUD|PPS|
2498\n----------------------------------------------
2499 Set/ reset particular bit to enable/disable that insertion of that
2500 NALU (0=disable, 1=enable)
2501 UNSPECIFIED (bit-0), SLICE_DP_A(bit-2), SLICE_DP_B(bit-3),
2502 SLICE_DP_C(bit-4), SPS_VUI (bit-13), FILLER (bit-12), AUD(bit-9),
2503 PPS(bit-8), SPS(bit-7), SEI(bit-6), IDR_SLICE(bit-5), SLICE (bit-1)
2504 are don't care and assumed to be <b> zero </b>.
2505
2506*/
2507
2508typedef struct IH264ENC_NALUControlParams {
2509 XDAS_Int16 naluControlPreset;
2510 XDAS_Int16 naluPresentMaskStartOfSequence;
2511 XDAS_Int16 naluPresentMaskIDRPicture;
2512 XDAS_Int16 naluPresentMaskIntraPicture;
2513 XDAS_Int16 naluPresentMaskNonIntraPicture;
2514 XDAS_Int16 naluPresentMaskEndOfSequence;
2515
2516} IH264ENC_NALUControlParams;
2517
2518/**
2519
2520 @struct IH264ENC_SliceCodingParams
2521 @brief This structure contains all the parameters which controls Slice
2522 encoding
2523
2524 @param sliceCodingPreset
2525 This Preset controls the USER_DEFINED vs DEFAULT mode. if User is
2526 not aware about following fields, it should be set as
2527 IH264_SLICECODING_DEFAULT
2528
2529 @param sliceMode : regarded @ IH264ENC_DynamicParams::sliceCodingParams
2530 This defines the control mechanism to split a picture in slices.
2531 It can be either MB based or bytes based
2532
2533 @param sliceUnitSize : regarded @ IH264ENC_DynamicParams::sliceCodingParams
2534 The meaning of this parameter depends upon sliceMode.
2535 sliceMode == IH264_SLICEMODE_MBUNIT then this
2536 parameter informs the number of Macroblocks in one slice
2537 sliceMode == IH264_SLICEMODE_BYTES then this
2538 parameter informs the number of bytes in one slice
2539 sliceMode == IH264_SLICEMODE_OFFSET then this
2540 parameter informs the number of offset information provided by user.
2541 Actual offset are provided with sliceStartOffset
2542
2543 @param sliceStartOffset[IH264ENC_MAX_NUM_SLICE_START_OFFSET] : regarded @
2544 IH264ENC_DynamicParams::sliceCodingParams row numbering is assumed to
2545 start from 0. Enteris in this array must have numbers in ascending
2546 order. first slice of the picture is always starting from 0th row
2547 of the picture so 0th entry is the offset of second slice in picture
2548 Ex 1 : sliceStartRowNum[0] = 25 ,
2549 sliceStartRowNum[1] = 30, sliceStartRowNum[2] = 40
2550 will result into 4 slices starting from row# 0, 25, 30 and 40
2551 Ex 2 : sliceStartRowNum[0] = 25 , sliceStartRowNum[1] = 70,
2552 sliceStartRowNum[2] = 60 is invalid
2553 Ex 3 : sliceStartRowNum[0] = 25 , sliceStartRowNum[1] = 50,
2554 sliceStartRowNum[2] = 100
2555 will result into 3 slices starting from row# 0, 25 and 50
2556 {if number of rows in picture < (100 + 1) }
2557
2558
2559 @param streamFormat : ignored @ IH264ENC_DynamicParams::sliceCodingParams
2560 Controls the type of stream : byte stream format or NALU format
2561 refer IH264ENC_StreamFormat for possible values
2562
2563*/
2564
2565typedef struct IH264ENC_SliceCodingParams {
2566 XDAS_Int8 sliceCodingPreset;
2567 XDAS_Int16 sliceMode;
2568 XDAS_Int32 sliceUnitSize;
2569 XDAS_Int8 sliceStartOffset[IH264ENC_MAX_NUM_SLICE_START_OFFSET];
2570 XDAS_Int8 streamFormat;
2571
2572} IH264ENC_SliceCodingParams;
2573
2574
2575/**
2576
2577 @struct IH264ENC_LoopFilterParams
2578 @brief This structure contains all the parameters which controls loop
2579 filtering operations
2580
2581 @param loopfilterPreset
2582 This Preset controls the USER_DEFINED vs DEFAULT mode. if User is
2583 not aware about following fields, it should be set as
2584 IH264_SLICECODING_DEFAULT
2585 @param loopfilterDisableIDC
2586 Controls H.264 loop filter disabling options
2587 @param filterOffsetA
2588 alpha offset for loop filter [-12, 12] even number
2589 @param filterOffsetB
2590 beta offset for loop filter [-12, 12] even number
2591
2592
2593*/
2594typedef struct IH264ENC_LoopFilterParams {
2595 XDAS_Int8 loopfilterPreset;
2596 XDAS_Int8 loopfilterDisableIDC;
2597 XDAS_Int8 filterOffsetA;
2598 XDAS_Int8 filterOffsetB;
2599
2600} IH264ENC_LoopFilterParams;
2601
2602/**
2603
2604 @struct IH264ENC_FMOCodingParams
2605 @brief This structure contains all the parameters which controls FMO behavior
2606
2607 @param fmoCodingPreset
2608 This Preset controls the USER_DEFINED vs DEFAULT mode. if User is
2609 not aware about following fields, it should be set as
2610 IH264_FMOCODING_DEFAULT
2611 @param numSliceGroups
2612 Total Number of slice groups, valid enteries are [0,8]
2613 @param sliceGroupMapType
2614 For Valid enteries see IH264ENC_SliceGroupMapType
2615 @param sliceGroupChangeDirectionFlag
2616 Only valid when sliceGroupMapType is equal to
2617 IH264_RASTER_SCAN_SLICE_GRP,
2618 IH264_WIPE_SLICE_GRP or IH264_WIPE_SLICE_GRP.
2619 For valid values refer IH264ENC_SliceGroupChangeDirection
2620 @param sliceGroupChangeRate
2621 Only valid when sliceGroupMapType is equal to
2622 IH264_RASTER_SCAN_SLICE_GRP,
2623 IH264_WIPE_SLICE_GRP or IH264_WIPE_SLICE_GRP
2624 valid values are : [0, factor of number of Mbs in a row]
2625 @param sliceGroupChangeCycle
2626 Only valid when sliceGroupMapType is equal to
2627 IH264_RASTER_SCAN_SLICE_GRP,
2628 IH264_WIPE_SLICE_GRP or IH264_WIPE_SLICE_GRP
2629 Valid values can be 0 to numMbsRowsInPicture, also constrained by
2630 sliceGroupChangeRate*sliceGroupChangeCycle < totalMbsInFrameOnly valid
2631 when sliceGroupMapType is equal to IH264_RASTER_SCAN_SLICE_GRP.
2632 valid values are : [0, factor of number of Mbs in a row]
2633 @param sliceGroupParams[IH264ENC_MAXNUMSLCGPS]
2634 This field is useful in case of sliceGroupMapType equal to either
2635 IH264_INTERLEAVED_SLICE_GRP or IH264_FOREGRND_WITH_LEFTOVER_SLICE_GRP
2636 In both cases it has different meaning:
2637 In case of IH264_INTERLEAVED_SLICE_GRP:
2638 The i-th entery in this array is used to specify the number of
2639 consecutive slice group macroblocks to be assigned to the i-th slice
2640 group in raster scan order of slice group macroblock units.
2641 Valid values are 0 to totalMbsInFrame again constrained by sum of
2642 all the elements shouldn't exceed totalMbsInFrame
2643 In case of IH264_FOREGRND_WITH_LEFTOVER_SLICE_GRP:
2644 First entry in the array specify the start position of foreground
2645 region in terms of macroblock number, valid values are
2646 [0, totalMbsInFrame-1]
2647 Second entry in the array specify the end position of foreground
2648 region in terms of macroblock number, valid values are
2649 [0, totalMbsInFrame-1] with following constrains:
2650 endPos > startPos && endPos%mbsInOneRow > startPos%mbsInOneRow
2651
2652 @todo Review this structure and see all the fields are sufficient enough
2653
2654
2655*/
2656
2657typedef struct IH264ENC_FMOCodingParams {
2658 XDAS_Int8 fmoCodingPreset;
2659 XDAS_Int8 numSliceGroups;
2660 XDAS_Int8 sliceGroupMapType;
2661 XDAS_Int8 sliceGroupChangeDirectionFlag;
2662 XDAS_Int8 sliceGroupChangeRate;
2663 XDAS_Int16 sliceGroupChangeCycle;
2664 XDAS_Int16 sliceGroupParams[IH264ENC_MAXNUMSLCGPS];
2665} IH264ENC_FMOCodingParams;
2666
2667
2668/**
2669
2670 @struct IH264ENC_VUICodingParams
2671 @brief This structure contains all the parameters which controls VUI
2672 parameters. Refer Annex E of the H.264 standard for more details
2673 of VUI and parameters
2674 @param vuiCodingPreset
2675 This Preset controls the USER_DEFINED vs DEFAULT mode. if User is
2676 not aware about following fields, it should be set as
2677 IH264_VUICODING_DEFAULT
2678 @param aspectRatioInfoPresentFlag
2679 This controls the insertion of aspect ratio information in VUI part
2680 of bit-stream
2681 zero : No aspect ratio related information is transmitted
2682 non-zero : aspect ratio related information is transmitted
2683 @param aspectRatioIdc
2684 Encoder inserts aspectRatioIdc as it is in the bit-stream. It is
2685 user's responsibility to feed appropriate value of this.
2686 Refer Table E-1 of H264 standard (or enum IH264ENC_AspectRatioIdc)
2687 for valid values of this.
2688 when aspectRatioIdc == IH264ENC_ASPECTRATIO_EXTENDED(255), encoder
2689 will look at IVIDENC2_DynamicParams::sampleAspectRatioHeightand
2690 IVIDENC2_DynamicParams::sampleAspectRatioWidth and use them as
2691 sar_height and sar_width respectively. aspectRatioIdc is left to
2692 user to provide correct value.
2693 <b> if aspectRatioInfoPresentFlag ==0 then encoder ignores
2694 this parameter </b>
2695 @param videoSignalTypePresentFlag
2696 This controls the insertion of video signal type in VUI part of
2697 bit-stream
2698 zero : No video signal related information is transmitted
2699 non-zero : video signal related information is transmitted
2700 @param videoFormat
2701 Encoder inserts videoFormat(lower 3 bits) as it is in the bit-stream.
2702 It is user's responsibility to feed appropriate value of this.
2703 Refer Table E-2 H264 standard (or enum IH264ENC_VideoFormat)
2704 for valid values of this.
2705 @param videoFullRangeFlag
2706 zero: video range is not full{0, 255} ; non-zero: video range is full
2707 @param timingInfoPresentFlag
2708 This controls the insertion of timing info related parameters in
2709 VUI part of bit-stream
2710 @param hrdParamsPresentFlag
2711 This controls the insertion of HRD parameters in
2712 VUI part of bit-stream
2713 @param numUnitsInTicks
2714 This controls the insertion of numUnitsInTicks parameter in
2715 VUI part of bit-stream.
2716 Valid values are [1, targetFrameRate]
2717 If this parameter is set by user then the targetFrameRate
2718 has multiplication factor of numUnitInTicks instead of 1000
2719*/
2720
2721typedef struct IH264ENC_VUICodingParams {
2722 XDAS_Int8 vuiCodingPreset;
2723 XDAS_UInt8 aspectRatioInfoPresentFlag;
2724 XDAS_UInt8 aspectRatioIdc;
2725 XDAS_UInt8 videoSignalTypePresentFlag;
2726 XDAS_UInt8 videoFormat;
2727 XDAS_UInt8 videoFullRangeFlag;
2728 XDAS_UInt8 timingInfoPresentFlag;
2729 XDAS_UInt8 hrdParamsPresentFlag;
2730 XDAS_UInt32 numUnitsInTicks;
2731
2732
2733} IH264ENC_VUICodingParams;
2734
2735/**
2736
2737 @struct IH264ENC_StereoInfoParams
2738 @brief This structure contains all the parameters which have Stereo
2739 Video info for SEI message.
2740 @param stereoInfoPreset
2741 This Preset controls the Enable/Disable of stereo video coding &
2742 if its enable then controls the USER_DEFINED vs DEFAULT mode.
2743 If User is not aware about following fields, it should be set
2744 as IH264_STEREOINFO_ENABLE_DEFAULT.
2745 0 :Stereo Video Coding is Disabled.
2746 1 :Default stereo video information parameters .
2747 2 :User defined steroe video information pamameters.
2748 @remarks - When stereo video coding is enabled then input content type
2749 (coding type) should be Interlaced coding.
2750 @param topFieldIsLeftViewFlag
2751 This indicates the top & bottom field in video coded sequence
2752 as a left view or right view
2753 non-zero :top fields in the coded video sequence represent a left view & the
2754 bottom fields in the coded video sequence represent a right view.
2755 zero :vice-versa.
2756 @param viewSelfContainedFlag
2757 This controls the Left/Right view should Refer/NotRefer to
2758 Left/Right view.
2759 zero :Leftview can refer to Rightview or Leftview & Rightview can refer to
2760 Leftview or Rightview.
2761 i.e.Possible values for left_view_self_contained_flag = 0 &&
2762 right_view_self_contained_flag = 0 in bit-stream.
2763 non-zero:Leftview cannot refer to Rightview & Rightview cannot refer to
2764 Leftview.
2765 i.e Possible values for left_view_self_contained_flag = 1 &&
2766 right_view_self_contained_flag = 1 in bit-stream.
2767 @remarks - This viewSelfContainedFlag overrides the interlaceCodingType.
2768 viewSelfContainedFlag == 0 forces interlaceCodingType = ARF
2769 viewSelfContainedFlag == 1 forces interlaceCodingType = SPF
2770*/
2771typedef struct IH264ENC_StereoInfoParams {
2772 XDAS_UInt8 stereoInfoPreset;
2773 XDAS_UInt8 topFieldIsLeftViewFlag;
2774 XDAS_UInt8 viewSelfContainedFlag;
2775}IH264ENC_StereoInfoParams;
2776
2777/**
2778
2779 @struct IH264ENC_FramePackingSEIParams
2780 @brief This structure contains all the parameters for Frame packing
2781 SEI message.
2782 @param framePackingPreset
2783 This Preset controls the Enable/Disable of Frame packing
2784 SEI message encoding.If its enable then controls
2785 the USER_DEFINED vs DEFAULT mode.
2786 If User is not aware about following fields, it should be set
2787 as IH264_FRAMEPACK_SEI_ENABLE_DEFAULT.
2788 0 :Frame packing SEI is Disabled.
2789 1 :Default Frame packing SEI parameters .
2790 2 :User defined Frame packing SEI information pamameters.
2791 @remarks - When Frame packing SEI coding is enabled then input content
2792 type (coding type) should be Progressive coding.
2793 @param framePackingType
2794 indicates the type of packing arrangement of the frames as
2795 specified standard. Refer IH264ENC_FramePackingType
2796 @param frame0PositionX
2797 location of the upper left sample of frame 0 (Left view) in
2798 horizontal direction. Allowed values are [0,15]. Only lower
2799 4 bits of this parameter are significant.
2800 @param frame0PositionY
2801 location of the upper left sample of frame 0 (Left view) in
2802 vertical direction. Allowed values are [0,15]. Only lower
2803 4 bits of this parameter are significant.
2804 @param frame1PositionX
2805 location of the upper left sample of frame 1 (Right view) in
2806 horizontal direction. Allowed values are [0,15]. Only lower
2807 4 bits of this parameter are significant.
2808 @param frame1PositionY
2809 location of the upper left sample of frame 1 (Right view) in
2810 vertical direction. Allowed values are [0,15]. Only lower
2811 4 bits of this parameter are significant.
2812 @param reservedByte
2813 reserved byte that needs to be encoded as part of SEI message
2814 "frame_packing_arrangement_reserved_byte"
2815 User should set it to 0 as current standard (March 2010) allows
2816 only 0 of this value. This is kept for future provisions.
2817
2818*/
2819typedef struct IH264ENC_FramePackingSEIParams {
2820 XDAS_UInt8 framePackingPreset;
2821 XDAS_UInt8 framePackingType;
2822 XDAS_UInt8 frame0PositionX;
2823 XDAS_UInt8 frame0PositionY;
2824 XDAS_UInt8 frame1PositionX;
2825 XDAS_UInt8 frame1PositionY;
2826 XDAS_UInt8 reservedByte;
2827}IH264ENC_FramePackingSEIParams;
2828
2829/**
2830
2831 @struct IH264ENC_SVCCodingParams
2832 @brief This structure contains all the parameters which controls SVC
2833 parameters. Refer Annex G of the H.264 standard for more details
2834 of SVC and parameters
2835
2836 @param svcExtensionFlag
2837 This parameter configures the codec put SVC extensions in the
2838 bit-stream. For normal H.264 operation this Flag needs to be ZERO
2839 (default value). For Encoder instance to encode SSPS, Prefix-NALU,
2840 Coded Slice in the bit-stream, this flag needs to be set.
2841
2842 Allowed Values are [0,1,2]
2843
2844 0 - Disables all SVC features/syntaxes and rest of the structure
2845 is not read/respected.
2846 1 - Encodes the required SVC related syntaxes of the layer for
2847 which H.264 Codec has been instantiated.
2848 2 - Encoder the required SVC related syntaxes of the layer for
2849 which H.264 Codec has been instantiated
2850 Only in this mode, the JSVM error concealment will work on
2851 encoded bitstreams as in this mode even Spatial/CGS is also
2852 coded the MGS way (i.e. by setting
2853 adaptive_xxx_prediction_flag and
2854 default_xxxx_prediction_flag to zero).
2855
2856 @param dependencyID
2857 This parameter tell whether the current instance is for Base layer
2858 or for enhancement layer and also conveys Layer ID Info. This field
2859 is respected only when svcExtensionFlag is set. For configuring the
2860 encoder instance for BL then this parameter should be ZERO. For
2861 configuring the encoder instance for EL, this parameter should hold
2862 the value of the layer ID.
2863
2864 @param qualityID
2865 This parameter tells Quality ID of the layer that the current instance
2866 of encoder is going to encode.
2867 This field is respected only when svcExtensionFlag is set. For
2868 configuring the encoder instance for BL then this parameter should be
2869 ZERO.
2870
2871 @param enhancementProfileID
2872 This parameter conveys the enhancement encoder instance like what
2873 should be the profile ID to be encoded in the Sub-Sequence Parameter
2874 Set (SSPS).This parameter is dont care when, the svcExtensionFlag is
2875 not set.Possible values are IH264SVC_BASELINE_PROFILE (83) or
2876 IH264SVC_HIGH_PROFILE (86)
2877 @param layerIndex
2878 This parameter conveys the enhancement encoder instance like what
2879 should be the pic_parameter_set_id and seq_parameter_set_id to be
2880 encoded in the Picture Parameter Set (PPS) and Sub-Sequence Parameter
2881 Set (SSPS). layerIndex is dont care or treated to be ZERO when
2882 svcExtensionFlag is not enabled.
2883 @param refLayerDQId
2884 This parameter conveys the the DQ Id of the ReferenceLayer.
2885
2886*/
2887
2888typedef struct IH264ENC_SVCCodingParams {
2889 XDAS_UInt8 svcExtensionFlag;
2890 XDAS_UInt8 dependencyID;
2891 XDAS_UInt8 qualityID;
2892 XDAS_UInt8 enhancementProfileID;
2893 XDAS_UInt8 layerIndex;
2894 XDAS_Int8 refLayerDQId;
2895
2896} IH264ENC_SVCCodingParams;
2897
2898/**<
2899
2900 @struct IH264ENC_Params
2901 @brief This structure defines the Create time parameters for all
2902 H264ENC objects
2903
2904 @param videnc2Params must be followed for all video encoders.
2905 Base class create params
2906 @param rateControlParams Controls all Rate Control related parameters
2907 @param interCodingParams Controls all Inter coding related parameters
2908 @param intraCodingParams Controls all Intra coding related parameters
2909
2910 @param nalUnitControlParams Controls the insertion of different NALUs at
2911 different access points in video sequence
2912 @param sliceCodingParams Controls all Slice coding related parameters
2913 @param loopFilterParams Controls the in-loop filtering process
2914 @param fmoCodingParams Controls the FMO behavior
2915 @param vuiCodingParams Controls the VUI (Video Usability Information)
2916 parameters. Refer Annex E for more details of
2917 @param stereoInfoParams Controls the Stereo Video Information for SEI
2918 NAL Unit.
2919 @param framePackingSEIParams This structure contains all the parameters
2920 for Frame packing SEI message.
2921 @param svcCodingParams Controls the SVC coding parameters
2922
2923 @param interlaceCodingType Controls the type of interlaced coding, refer
2924 IH264ENC_InterlaceCodingType for more details
2925 @param bottomFieldIntra This field is valid only for interlaced sequences
2926 0 = Bottom field of the first I frame in the GOP encoded as
2927 P field.
2928 non-zero = Bottom field of the first I frame in the GOP encoded as I
2929 field.
2930
2931 @param IDRFrameInterval Interval b/w two IDR frames, unit of this
2932 parameter is intraFrameInterval
2933 Ex: 0 : Only first I frame as IDR
2934 1 : All I frames are IDR.
2935 2 : 1 out of 2 I frames are IDR starting from first I frame
2936 -ve values are not allowed.
2937
2938 @param gopStructure Defines the gop structure type:
2939 uniform/non-uniform. For more information refer
2940 IH264ENC_GOPStructure
2941 @param entropyCodingMode Controls the entropy coding type, see
2942 IH264ENC_EntropyCodingMode for allowed values
2943 @param transformBlockSize Tranform Block size. Refer
2944 IH264ENC_TransformBlockSize
2945
2946 @param log2MaxFNumMinus4 Limits the maximum frame number in the bit-stream
2947 to (1<< (log2MaxFNumMinus4 + 4)) Range[0,12]
2948 @param picOrderCountType Picture Order count type Valid values refer
2949 IH264ENC_PicOrderCountType
2950 @param enableWatermark This Parameter Enables or disables Water Mark
2951 SEI message in the bit stream
2952 0 Disable, Non-Zero - Enable
2953 @param pConstantMemory
2954 This pointer points to the the memory area where constants are
2955 located. It has to be in DDR addressable space by vDMA. This is
2956 use ful to allow relocatable constants for the applications which
2957 doesn't use M3 as host. Actual memory controller/allocator
2958 is on another master processor. If this is set to NULL then
2959 encoder assumes that all constants are pointed by symbol
2960 H264ENC_TI_ConstData
2961
2962
2963 @param maxIntraFrameInterval
2964 This parameter contains the maximum Intra Frame interval. It is used
2965 to reduce the memory requirement of refernce Buffers. Because for all
2966 I frame/field configuration the reference frame buffers are not
2967 required
2968 @remarks For example, this field will be:
2969 - 0 - Only first frame to be intra
2970 coded. e.g. IPPPPPP...
2971 - 1 - No inter frames (all intra
2972 frames).
2973 - 2 - Consecutive IPIPIP... sequence (if
2974 no B frames).
2975 - 3 - IPPIPP... or IPBIPBI... and so on.
2976
2977 @param debugTraceLevel
2978 This parameter configures the codec to dump a debug trace log
2979
2980 @param lastNFramesToLog
2981 This parameter configures the codec to maintain a history of last
2982 N frames/pictures
2983
2984 @param enableAnalyticinfo
2985 This parameter configures the codec to expose analytic info like
2986 MVs and SAD parameters
2987 @param enableGMVSei
2988 This Parameter Enable or disable the TI specific GMV SEI message
2989 in the bit stream
2990 0 Disable, Non-Zero - Enable
2991
2992 @param constraintSetFlags
2993 Used to modify the values of constraint set flags that
2994 are coded in te bit stream. The syntax of of this
2995 flag is as follows
2996 RESVD|RESVD|RESVD|PRESET|CST_0|CST_1|CST_2|CST_3
2997 if preset is set to zero then, CST flags are set by the
2998 encoder internally. if preset is 1 then encoder takes the
2999 preset values given by the user and encodes themin the
3000 bit stream. Note that there are no error checks are placed
3001 on the user defined values.
3002 @param enableRCDO
3003 This paramter is used to enable encoding a bit stream compliant to
3004 Reduced Complexity Decoding Operations (RCDO) profile
3005
3006 @param enableLongTermRefFrame
3007 This paramter is used to enable support of long term reference frame.
3008 Enabling this bit will instruct encoder to keep the recently marked
3009 long-term frame in its refernce buffer list. So it increases the DDR
3010 foot print by one or two frame buffers depends on the LTRPScheme used.
3011
3012 @param LTRPPeriod
3013 This parameter is used to specify the long-term reference frame
3014 marking interval. This parameter is in use when
3015 enableLongTermRefFrame = IH264ENC_LTRP_REFERTOP_REACTIVE or
3016 IH264ENC_LTRP_REFERTO_PERIODICLTRP.
3017
3018 @param numTemporalLayer
3019 This parameter controls the temporal Levels in bit-stream.
3020 1 - Only Base Layer available in bit-stream.
3021 2 - Maximum Temporal Level 1 in bit-stream
3022 3 - Maximum Temporal Level 2 in bit-stream
3023 4 - Maximum Temporal Level 3 in bit-stream
3024 @remarks - numTemporalLayer = 0 is not supported & its erroneous case.
3025
3026 @param referencePicMarking
3027 This parameter used to control the Reference Picture Marking
3028 For any non-zero value means Long-term Picture (MMCO Commands)
3029 0 - Short-term Picture (Sliding Window)
3030 1 - Long-term Picture ( MMCO Commands)
3031 @param reservedParams
3032 Some part is kept reserved to add parameters later without
3033 changing the foot print of interface object memory
3034
3035 @todo
3036 More parameters need to be added for Hieririchal frames,
3037 error resilience options, SEI/VUI parameter options, Analytic exposure
3038 from encoder like MVs and SAD parameters
3039
3040
3041*/
3042
3043typedef struct {
3044 IVIDENC2_Params videnc2Params;
3045 IH264ENC_RateControlParams rateControlParams;
3046 IH264ENC_InterCodingParams interCodingParams;
3047 IH264ENC_IntraCodingParams intraCodingParams;
3048 IH264ENC_NALUControlParams nalUnitControlParams;
3049 IH264ENC_SliceCodingParams sliceCodingParams;
3050 IH264ENC_LoopFilterParams loopFilterParams;
3051 IH264ENC_FMOCodingParams fmoCodingParams;
3052 IH264ENC_VUICodingParams vuiCodingParams;
3053 IH264ENC_StereoInfoParams stereoInfoParams;
3054 IH264ENC_FramePackingSEIParams framePackingSEIParams;
3055 IH264ENC_SVCCodingParams svcCodingParams;
3056 XDAS_Int8 interlaceCodingType;
3057 XDAS_Int8 bottomFieldIntra;
3058 XDAS_Int8 gopStructure;
3059 XDAS_Int8 entropyCodingMode;
3060 XDAS_Int8 transformBlockSize;
3061 XDAS_Int8 log2MaxFNumMinus4;
3062 XDAS_Int8 picOrderCountType;
3063 /* XDAS_Int8 mbMetaDataEnable ; */
3064 XDAS_Int8 enableWatermark;
3065 XDAS_Int32 IDRFrameInterval;
3066 XDAS_Int32 pConstantMemory;
3067 XDAS_Int32 maxIntraFrameInterval;
3068 XDAS_UInt32 debugTraceLevel;
3069 XDAS_UInt32 lastNFramesToLog;
3070 XDAS_Int8 enableAnalyticinfo;
3071 XDAS_Int8 enableGMVSei;
3072 XDAS_Int8 constraintSetFlags;
3073 XDAS_Int8 enableRCDO;
3074 XDAS_Int32 enableLongTermRefFrame;
3075 XDAS_Int32 LTRPPeriod;
3076 XDAS_Int8 numTemporalLayer;
3077 XDAS_Int8 referencePicMarking;
3078 XDAS_Int32 reservedParams[3];
3079} IH264ENC_Params;
3080
3081
3082/**<
3083
3084 @struct IH264ENC_Status
3085 @brief This structure informs back the status of H264 encoder and tells the
3086 value of each control parameter
3087
3088 @param videnc2Status must be followed for all video encoders.
3089 Base class status
3090
3091 @param rateControlParams Controls all Rate Control related parameters
3092 @param interCodingParams Controls all Inter coding related parameters
3093 @param intraCodingParams Controls all Intra coding related parameters
3094
3095 @param nalUnitControlParams Controls the insertion of different NALUs at
3096 different access points in video sequence
3097 @param sliceCodingParams Controls all Slice coding related parameters
3098 @param loopFilterParams Controls the in-loop filtering process
3099 @param fmoCodingParams Controls the FMO behavior
3100 @param vuiCodingParams Controls the VUI (Video Usability Information)
3101 parameters. Refer Annex E for more details
3102 of VUI and parameters
3103 @param stereoInfoParams Controls the Stereo Video Information for SEI
3104 NAL Unit.
3105 @param framePackingSEIParams This structure contains all the parameters
3106 for Frame packing SEI message.
3107 @param svcCodingParams Controls the SVC behavior
3108 @param interlaceCodingType Controls the type of interlaced coding, refer
3109 IH264ENC_InterlaceCodingType for more details
3110 @param bottomFieldIntra This field is valid only for interlaced sequences
3111 0 = Bottom field of the first I frame in the GOP
3112 encoded as P field.
3113 non-zero = Bottom field of the first I frame in
3114 the GOP encoded as I field.
3115 @param gopStructure Defines the gop structure type: Open/Close.
3116 For more information refer IH264ENC_GOPStructure
3117 @param entropyCodingMode Controls the entropy coding type, see
3118 IH264ENC_EntropyCodingMode for allowed values
3119 @param transformBlockSize Tranform Block size. Refer
3120 IH264ENC_TransformBlockSize
3121
3122 @param log2MaxFNumMinus4 Limits the maximum frame number in the bit-stream
3123 to (1<< (log2MaxFNumMinus4 + 4)) Range[0,12]
3124 @param picOrderCountType Picture Order count type Valid values refer
3125 IH264ENC_PicOrderCountType
3126 @param enableWatermark This Parameter Enables or disables Water Mark
3127 SEI message in the bit stream
3128 0 Disable, Non-Zero - Enable
3129 @param IDRFrameInterval Interval b/w two IDR frames, it should be and
3130 integer multiple of intraFrameInterval
3131
3132 @param maxIntraFrameInterval
3133 This parameter contains the maximum Intra Frame interval. It is used
3134 to reduce the memory requirement of refernce Buffers. Because for all
3135 I frame/field configuration the reference frame buffers are not
3136 required
3137 @remarks For example, this field will be:
3138 - 0 - Only first frame to be intra
3139 coded. e.g. IPPPPPP...
3140 - 1 - No inter frames (all intra
3141 frames).
3142 - 2 - Consecutive IPIPIP... sequence (if
3143 no B frames).
3144 - 3 - IPPIPP... or IPBIPBI... and so on.
3145
3146 @param debugTraceLevel
3147 This parameter configures the codec to dump a debug trace log
3148
3149 @param lastNFramesToLog
3150 This parameter configures the codec to maintain a history of last
3151 N frames/pictures
3152
3153 @param enableAnalyticinfo
3154 This parameter configures the codec to expose analytic info like
3155 MVs and SAD parameters
3156
3157 @param enableGMVSei
3158 This Parameter Enable or disable the TI specific GMV SEI message
3159 in the bit stream
3160 0 Disable, Non-Zero - Enable
3161
3162 @param constraintSetFlags
3163 Used to modify the values of constraint set flags that
3164 are coded in te bit stream. The syntax of of this
3165 flag is as follows
3166 RESVD|RESVD|RESVD|PRESET|CST_0|CST_1|CST_2|CST_3
3167 if preset is set to zero then, CST flags are set by the
3168 encoder internally. if preset is 1 then encoder takes the
3169 preset values given by the user and encodes themin the
3170 bit stream. Note that there are no error checks are placed
3171 on the user defined values.
3172
3173 @param enableRCDO
3174 This paramter is used to enable encoding a bit stream compliant to
3175 Reduced Complexity Decoding Operations (RCDO) profile
3176
3177 @param enableLongTermRefFrame
3178 This paramter is used to enable support of long term reference frame.
3179 Enabling this bit will instruct encoder to keep the recently marked
3180 long-term frame in its refernce buffer list. So it increases the DDR
3181 foot print by one or two frame buffers depends on the LTRPScheme used.
3182
3183 @param LTRPPeriod
3184 This parameter is used to specify the long-term reference frame
3185 marking interval. This parameter is in use when
3186 enableLongTermRefFrame = IH264ENC_LTRP_REFERTOP_REACTIVE or
3187 IH264ENC_LTRP_REFERTO_PERIODICLTRP.
3188
3189 @param searchCenter seacrh Center for motion estimation
3190 @param enableStaticMBCount Flag to indicate enable/disable Static MB count
3191 support
3192 @param extMemoryDebugTraceAddr This parameter reports the external
3193 memory address (as seen by M3) where debug trace
3194 information is being dumped
3195 @param extMemoryDebugTraceSize This parameter reports the external
3196 memory buffer size (in bytes) where debug trace
3197 information is being dumped
3198 @param numTemporalLayer This parameter controls the temporal Levels in
3199 bit-stream.
3200 @param referencePicMarking This parameter used to control the Reference
3201 Picture Marking.
3202 @param extErrorCode This parameter carries the sub extended error bits
3203 set by encoder. Application/user can look into
3204 these bits to correct his configuration.
3205*/
3206
3207typedef struct {
3208 IVIDENC2_Status videnc2Status;
3209
3210 IH264ENC_RateControlParams rateControlParams;
3211 IH264ENC_InterCodingParams interCodingParams;
3212 IH264ENC_IntraCodingParams intraCodingParams;
3213 IH264ENC_NALUControlParams nalUnitControlParams;
3214 IH264ENC_SliceCodingParams sliceCodingParams;
3215 IH264ENC_LoopFilterParams loopFilterParams;
3216 IH264ENC_FMOCodingParams fmoCodingParams;
3217 IH264ENC_VUICodingParams vuiCodingParams;
3218 IH264ENC_StereoInfoParams stereoInfoParams;
3219 IH264ENC_FramePackingSEIParams framePackingSEIParams;
3220 IH264ENC_SVCCodingParams svcCodingParams;
3221
3222 XDAS_Int8 interlaceCodingType;
3223 XDAS_Int8 bottomFieldIntra;
3224 XDAS_Int8 gopStructure;
3225 XDAS_Int8 entropyCodingMode;
3226 XDAS_Int8 transformBlockSize;
3227 XDAS_Int8 log2MaxFNumMinus4;
3228 XDAS_Int8 picOrderCountType;
3229 XDAS_Int8 enableWatermark;
3230 XDAS_Int32 IDRFrameInterval;
3231 XDAS_Int32 maxIntraFrameInterval;
3232 XDAS_UInt32 debugTraceLevel;
3233 XDAS_UInt32 lastNFramesToLog;
3234 XDAS_Int8 enableAnalyticinfo;
3235 XDAS_Int8 enableGMVSei;
3236 XDAS_Int8 constraintSetFlags;
3237 XDAS_Int8 enableRCDO;
3238 XDAS_Int32 enableLongTermRefFrame;
3239 XDAS_Int32 LTRPPeriod;
3240 XDM_Point searchCenter;
3241 XDAS_Int8 enableStaticMBCount;
3242 XDAS_UInt32 *extMemoryDebugTraceAddr;
3243 XDAS_Int8 numTemporalLayer;
3244 XDAS_Int8 referencePicMarking;
3245 XDAS_UInt32 extMemoryDebugTraceSize;
3246 XDAS_Int8 enableROI;
3247 XDAS_UInt32 extErrorCode[IH264ENC_EXTERROR_NUM_MAXWORDS];
3248} IH264ENC_Status;
3249
3250/**< This structure must be the first field of all H264ENC instance objects */
3251typedef struct IH264ENC_Obj {
3252 struct IH264ENC_Fxns *fxns;
3253} IH264ENC_Obj;
3254
3255/**< This handle is used to reference all H264ENC instance objects */
3256typedef struct IH264ENC_Obj *IH264ENC_Handle;
3257
3258/**<Default parameter values for H264ENC instance objects */
3259extern const IH264ENC_Params H264ENC_TI_PARAMS;
3260
3261
3262/**<
3263
3264 @struct IH264ENC_DynamicParams
3265 @brief This structure defines the run time parameters for all H264ENC objects
3266
3267 @param videnc2DynamicParams must be followed for all video encoders
3268 @param rateControlParams Controls all Rate Control related parameters.
3269 only few are supported to be changed as
3270 part @ Control call. Refer
3271 IH264ENC_RateControlParams to find out
3272 @param interCodingParams Controls all iner MB coding related parameters.
3273 only few are supported to be changed as
3274 part @ Control call. Refer interCodingParams to
3275 find out
3276 @param sliceCodingParams Controls all Slice coding related parameters.
3277 only few are supported to be changed as
3278 part @ Control call.
3279 Refer sliceCodingParams to find out
3280 @param sliceGroupChangeCycle
3281 Only valid when sliceGroupMapType is equal to
3282 IH264_RASTER_SCAN_SLICE_GRP,
3283 IH264_WIPE_SLICE_GRP or IH264_WIPE_SLICE_GRP
3284 Valid values can be 0 to numMbsRowsInPicture, also constrained by
3285 sliceGroupChangeRate*sliceGroupChangeCycle < totalMbsInFrameOnly valid
3286 when sliceGroupMapType is equal to IH264_RASTER_SCAN_SLICE_GRP.
3287 valid values are : [0, factor of number of Mbs in a row]
3288 @param searchCenter seacrh Center for motion estimation.
3289 XDM_Point.x == 0xFFFF means ignore searchCenter
3290
3291 @param enableStaticMBCount Flag to indicate enable/disable Static MB count
3292 support
3293
3294 @param enableROI
3295 Enable/Disable the ROI algorithm
3296
3297 @param reservedDynParams
3298 Some part is kept reserved to add parameters later without changing
3299 the foot print of interface memory
3300
3301*/
3302
3303typedef struct IH264ENC_DynamicParams {
3304 IVIDENC2_DynamicParams videnc2DynamicParams;
3305 IH264ENC_RateControlParams rateControlParams;
3306 IH264ENC_InterCodingParams interCodingParams;
3307 IH264ENC_IntraCodingParams intraCodingParams;
3308 IH264ENC_SliceCodingParams sliceCodingParams;
3309 XDAS_Int32 sliceGroupChangeCycle;
3310 XDM_Point searchCenter;
3311 XDAS_Int8 enableStaticMBCount;
3312 XDAS_Int32 enableROI;
3313 XDAS_Int32 reservedDynParams[3];
3314} IH264ENC_DynamicParams;
3315
3316extern const IH264ENC_DynamicParams H264ENC_TI_DYNAMICPARAMS;
3317
3318/**<
3319
3320 @struct IH264ENC_InArgs
3321 @brief This structure defines the input argument being passed to
3322 H.264 encoder
3323
3324 @params videnc2InArgs : It is instance of base class. It cntains all
3325 the necessary info required run time parameters for all H264ENC
3326 objects
3327 @param processId : processId in InArgs was kept to ease the
3328 implementation of acquire time optimization
3329 in application code. In N channel case,
3330 acquire is happening for last channel and
3331 this (processId ) as argument is passed into
3332 acquire call.This will make application to
3333 understand that for which process call, acquire
3334 has been made. With this information application
3335 can optimize the time spent in acquire. Like, it
3336 might have happened that from last call of acquire,
3337 IVAHd became unavailable to any further process
3338 call(s). In this scenario application will get to
3339 know that IVAHD was not given to somebody else from
3340 last process call, and hence it can do some
3341 optimization in acquire routine
3342 @params roiInputParams : Input parameters related to ROI algorithm
3343 @params inputKey : This parameter along with the few important
3344 properties of a frame are used to generate the
3345 Encrypted key. If watermarking is enabled then this
3346 Encrypted key would be inserted in the form of user
3347 data unregistered SEI message in the encoded stream.
3348 */
3349typedef struct IH264ENC_InArgs {
3350
3351 IVIDENC2_InArgs videnc2InArgs;
3352 XDAS_Int32 processId;
3353 IH264ENC_RoiInput roiInputParams;
3354 XDAS_UInt32 inputKey;
3355} IH264ENC_InArgs;
3356
3357
3358/**<
3359
3360 @struct IH264ENC_MetaDataFormatUserDefinedSEI
3361 @brief This structure defines the format of meta data used to provide
3362 information about user defined SEI
3363
3364 @param size size of the payload
3365 @param payload buffer
3366
3367*/
3368typedef struct IH264ENC_MetaDataFormatUserDefinedSEI {
3369 XDAS_Int32 size;
3370 XDAS_Int8 payload[IH264ENC_MAX_SEI_METADTA_BUFSIZE];
3371}IH264ENC_MetaDataFormatUserDefinedSEI;
3372
3373/**<
3374
3375 @struct IH264ENC_MetaDataFormatNaluInfo
3376 @brief This structure defines the format of meta data used to provide
3377 information about slice
3378
3379 @param naluSize size of each NAL Unit
3380
3381*/
3382typedef struct IH264ENC_MetaDataFormatNaluInfo {
3383 XDAS_Int32 naluSize;
3384}IH264ENC_MetaDataFormatNaluInfo;
3385
3386/**<
3387
3388 @struct IH264ENC_OutArgs
3389 @brief This structure defines the output argument being generated from H.264
3390 encoder
3391
3392 @params videnc2OutArgs : It is instance of base class. It cntains all
3393 the necessary info encoder should produce
3394 @params bytesGeneratedBotField: Number of bytes generated for bottom field
3395 during the IVIDENC2_Fxns::process() call. This field is updated only
3396 in case of contentType = Interlaced and both the fields are provided
3397 to codec in single process call
3398 @param vbvBufferLevel: This varible tells the buffer level at the end of
3399 every picture from decoder perspective.the value populated
3400 in this variable is latest for every process call
3401 @param numStaticMBs: Number of static MBs (defined by H241) in the encoded
3402 picture. This field is updated only in case of
3403 dynamicParams.enableStaticMBCount is set.
3404 @param temporalId:Temporal ID for temporal scalability.Temporal layer Id
3405 of current frame in H-P encoding(for base layer value is 0).
3406 @param control: Encoder control operations. Most of the times it is
3407 IVIDENC2_InArgs::control. But there are certain cases when it is
3408 not same as IVIDENC2_InArgs::control, hence it is advisable to look
3409 at this output information
3410 @sa IVIDENC2_Control
3411 @sa IH264ENC_Control
3412 @param extErrorCode : This parameter carries the sub extended error bits
3413 set by encoder. Application/user can look into these
3414 bits to understand encoder's run time failure.
3415*/
3416typedef struct IH264ENC_OutArgs {
3417
3418 IVIDENC2_OutArgs videnc2OutArgs;
3419 XDAS_Int32 bytesGeneratedBotField;
3420 XDAS_Int32 vbvBufferLevel;
3421 XDAS_Int32 numStaticMBs;
3422 XDAS_Int32 temporalId;
3423 XDAS_Int32 control;
3424 XDAS_UInt32 extErrorCode[IH264ENC_EXTERROR_NUM_MAXWORDS];
3425} IH264ENC_OutArgs;
3426
3427#define IH264ENC_MAX_LENGTH_PROCESS_LIST (24)
3428
3429/**<
3430 @struct IH264ENC_ProcessParams
3431 @brief This structure defines the channel specific parameters passed in
3432 a process call
3433 @params handle : Handle to an algorithm instance
3434 @params inBufs : pointer to detailed buffer descriptor for video buffers
3435 @params outBufs : pointer to the Buffer descriptors
3436 @params inArgs : pointer to the input argument being passed to H.264
3437 encoder
3438 @params outArgs : pointer to the output argument being generated from H.264
3439 encoder
3440 */
3441typedef struct {
3442 IVIDENC2_Handle handle;
3443 IVIDEO2_BufDesc *inBufs;
3444 XDM2_BufDesc *outBufs;
3445 IVIDENC2_InArgs *inArgs;
3446 IVIDENC2_OutArgs *outArgs;
3447
3448} IH264ENC_ProcessParams;
3449
3450/**<
3451
3452 @struct IH264ENC_ProcessParamsList
3453 @brief This structure carries the information of all the channels to be
3454 processed .
3455 @params numEntries : Number of channels to be encoded in the process
3456 call.
3457 @params enableErrorCheck : This parameter controls(enable/disable)
3458 the check of the non supported features in N channel scenario.
3459 Note:
3460 1.Effect of flag is as of now only if (processList->numEntries > 1).
3461 2.Suggested value for this flag is 0 to have better performance
3462 @params processParams : An array holding the process parameters viz.,
3463 handle,InArgs,outArgs etc of the channel(s) to be processed.
3464
3465 */
3466
3467typedef struct {
3468 XDAS_Int32 numEntries;
3469 XDAS_Int32 enableErrorCheck;
3470 IH264ENC_ProcessParams processParams[IH264ENC_MAX_LENGTH_PROCESS_LIST];
3471} IH264ENC_ProcessParamsList;
3472
3473/**<
3474
3475 @struct IH264ENC_Fxns
3476 @brief This structure defines of the operations on H264ENC objects
3477
3478 @params IVIDENC2_Fxns : It is instance of base class. It contains all
3479 function table
3480 @params processMulti : pointer to the Function H264ENC_TI_encodemulti
3481
3482*/
3483typedef struct IH264ENC_Fxns {
3484 IVIDENC2_Fxns ividenc;
3485 XDAS_Int32 (*processMulti)(IH264ENC_ProcessParamsList *processList);
3486
3487} IH264ENC_Fxns;
3488
3489#ifdef __cplusplus
3490}
3491#endif
3492
3493/*@}*/ /* ingroup HDVICP2H264 */
3494
3495#endif /* _IH264ENC_H_ --} */
3496
3497/* ========================================================================*/
3498/* End of file : ih264enc.h */
3499/*-------------------------------------------------------------------------*/
3500/* Copyright (c) 2009 Texas Instruments, Incorporated. */
3501/* All Rights Reserved. */
3502/* ========================================================================*/
3503
diff --git a/packages/ivahd_codecs/ti/sdo/codecs/h264svcenc/ih264svcenc.h b/packages/ivahd_codecs/ti/sdo/codecs/h264svcenc/ih264svcenc.h
new file mode 100644
index 0000000..ac4702a
--- /dev/null
+++ b/packages/ivahd_codecs/ti/sdo/codecs/h264svcenc/ih264svcenc.h
@@ -0,0 +1,295 @@
1/*
2********************************************************************************
3 * HDVICP2.0 Based SVC Baseline Encoder
4 *
5 * "HDVICP2.0 Based SVC Baseline Encoder" is software module developed on TI's
6 * HDVICP2 based SOCs. This module is capable of compressing a 4:2:0 Raw
7 * video into a SVC baseline profile bit-stream. Based on ISO/IEC
8 * 14496-10."
9 * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
10 * ALL RIGHTS RESERVED
11********************************************************************************
12*/
13/**
14 ******************************************************************************
15 * @file ih264svcenc.h
16 *
17 * @brief IH264SVCENC Interface Header
18 *
19 * @author: Venugopala Krishna (venugopala@ti.com)
20 *
21 * @version 0.0 (Apr 2010) : Initial version created
22 *****************************************************************************
23*/
24
25/**
26 * @defgroup HDVICP2SVC IH264SVCENC_TI (V7M)
27 * @ingroup m3
28 *
29 * The ISVCENC_TI interface enables encoding in SVC format
30 *
31 */
32
33#ifndef _IH264SVCENC_H_ //--{
34
35#define _IH264SVCENC_H_
36
37#include <ti/xdais/ialg.h>
38#include <ti/xdais/dm/ividenc2.h>
39
40#include "ih264enc.h"
41
42/** @ingroup HDVICP2SVC */
43/*@{*/
44
45
46#ifdef __cplusplus
47extern "C" {
48#endif
49
50
51/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
52/* Definition of all the macros define by this interafce */
53/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
54
55/**
56 * Maximum number of instances of H.264 embedded inside SVC
57*/
58#define IH264SVCENC_MAX_NUM_MULTI_INSTANCE (9)
59
60/**
61 Length of the version string. The memory to get version
62 number is owned by application
63*/
64#define IH264SVCENC_VERSION_LENGTH (64)
65
66
67/**
68 control method commands
69*/
70#define IH264SVCENC_GETSTATUS XDM_GETSTATUS
71#define IH264SVCENC_SETPARAMS XDM_SETPARAMS
72#define IH264SVCENC_RESET XDM_RESET
73#define IH264SVCENC_FLUSH XDM_FLUSH
74#define IH264SVCENC_SETDEFAULT XDM_SETDEFAULT
75#define IH264SVCENC_GETBUFINFO XDM_GETBUFINFO
76
77typedef IVIDENC2_Cmd IH264SVCENC_Cmd;
78
79
80/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
81/* Definition of all the Enumeration define by this interafce */
82/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
83
84/**
85 * @enum IH264SVCENC_ErrorBit
86 * @brief error informations of IVAHD SVC encoder implementation by TI.
87 *
88 * @remarks When an internal error occurs, the algorithm will return
89 * an error return value (e.g. EFAIL, EUNSUPPORTED)
90 *
91 * @remarks The value of each enum is the bit which is set.
92 *
93 * @remarks Bits 8-15 are defined by XDM and hence not used by codec
94 * implementation.
95 * rest all bits are used. XDM defined error bits are also active.
96 *
97 * @remarks The algorithm can set multiple bits to 1 based on conditions.
98 * e.g. it will set bits #XDM_FATALERROR (fatal) and
99 * #XDM_UNSUPPORTEDPARAM (unsupported params) in case
100 * of unsupported run time parameters.
101 *
102 */
103
104typedef enum {
105 IH264SVCENC_LEVEL_INCOMPLAINT_PARAMETER = 0
106 /**< Bit 0 - level incomplaint parameters.
107 * @remarks This error is applicable when some parameters are set
108 * which are not meeting the limit defined by H.264 standard
109 * Table A-1 Level limits. It can be categorized under
110 * following category :
111 * IH264ENC_LEVEL_INCOMPLAINT_RESOLUTION : Invalid width/height
112 * IH264ENC_LEVEL_INCOMPLAINT_HRDBUFSZIE : Invalid HrdBufferSize
113 * IH264ENC_LEVEL_INCOMPLAINT_BITRATE : Invalid Bit Rate
114 * IH264ENC_LEVEL_INCOMPLAINT_MBSPERSECOND : Invalid FrameRate/
115 * resolution
116 * IH264ENC_LEVEL_INCOMPLAINT_DPBSIZE : Invalid DPB size
117 * For above 5 situations, only a signle bit (bit-0) is set as true
118 */
119
120} IH264SVCENC_ErrorBit;
121
122/**
123 * @enum ISVCENC_Level
124 * @brief Level Identifier for H.264 Encoder
125*/
126typedef enum {
127 IH264SVC_LEVEL_10 = 10 /**< Level 1.0 */
128
129} IH264SVCENC_Level;
130
131
132
133/**<
134 * @struct IH264SVCENC_Params
135 * @brief This structure defines the Create time parameters for all
136 * H264SVCENC objects
137 * @param h264Params Create Parameters (Extended Class) of the H264 Encoder.
138 * As defined in the interface file (ih264enc.h) of H264 Encoder.
139 *
140 * @param inBufIndex Conveys how inBufs passed in the process is mapped to
141 * different layers/instances of Encoder.
142 *
143 * @param numberOfLayers Conveys number of layers to be encoded. This field is used
144 * in reading the number of entries of h264Params, inBufIndex etc.
145 *
146 * @param avcMode If numberOfLayers is set to be ONE, this flag determines whether
147 * generated Bitstream be SVC or AVC. Non-Zero means AVC or if ZERO its
148 * SVC. NOTE: This field is don't care if numberOfLayers is greater than ONE.
149 *
150*/
151
152typedef struct {
153 IH264ENC_Params h264Params[IH264SVCENC_MAX_NUM_MULTI_INSTANCE];
154 XDAS_Int8 inBufIndex[IH264SVCENC_MAX_NUM_MULTI_INSTANCE];
155 XDAS_UInt8 numberOfLayers;
156 XDAS_UInt8 avcMode;
157
158} IH264SVCENC_Params;
159
160
161/**<
162 *
163 * @struct IH264SVCENC_Status
164 * @brief This structure informs back the status of SVC encoder and tells the
165 * value of each control parameter
166 * @param h264Status Status Parameters (Extended Class) of the H264 Encoder.
167 * As defined in the interface file (ih264enc.h) of H264 Encoder.
168 *
169 * @param videnc2Status IVIDENC2 Class Status Parameter given out by SVC Encoder after collating,
170 * information from different encoding layers/instances.
171 *
172 * @param numberOfLayers Conveys the information for how many number of layers encoding the SVC
173 * Encoder is configured. This field is used in reading the number of
174 * entries of h264Status etc.
175 *
176 * @param avcMode If numberOfLayers is set to be ONE, this flag determines whether
177 * generated Bitstream be SVC or AVC. Non-Zero means AVC or if ZERO its
178 * SVC. NOTE: This field is don't care if numberOfLayers is greater than ONE.
179 *
180*/
181
182typedef struct {
183 IVIDENC2_Status videnc2Status;
184 IH264ENC_Status h264Status[IH264SVCENC_MAX_NUM_MULTI_INSTANCE];
185
186 XDAS_UInt8 numberOfLayers;
187 XDAS_UInt8 avcMode;
188
189} IH264SVCENC_Status;
190
191/**< This structure must be the first field of all SVCENC instance objects */
192typedef struct IH264SVCENC_Obj {
193 struct IH264SVCENC_Fxns *fxns;
194} IH264SVCENC_Obj;
195
196/**< This handle is used to reference all SVCENC instance objects */
197typedef struct IH264SVCENC_Obj *IH264SVCENC_Handle;
198
199/**<Default parameter values for SVCENC instance objects */
200extern const IH264SVCENC_Params H264SVCENC_TI_PARAMS;
201
202
203/**<
204 *
205 * @struct IH264SVCENC_DynamicParams
206 * @brief This structure defines the run time parameters for all SVCENC objects
207 * @param h264DynamicParams Dynamic Parameters (Extended Class) of the H264 Encoder.
208 * As defined in the interface file (ih264enc.h) of H264 Encoder.
209 * @param numberOfLayers Conveys the information for how many number of layers encoding the SVC
210 * Encoder is configured. This field is used in reading the number of
211 * entries of h264DynamicParams etc.
212 *
213 *
214
215*/
216
217typedef struct IH264SVCENC_DynamicParams {
218 IH264ENC_DynamicParams h264DynamicParams[IH264SVCENC_MAX_NUM_MULTI_INSTANCE];
219 XDAS_UInt8 numberOfLayers;
220} IH264SVCENC_DynamicParams;
221
222extern const IH264SVCENC_DynamicParams IH264SVCENC_DYNAMICPARAMS;
223
224/**<
225
226 @struct ISVCENC_InArgs
227 @brief This structure defines the input argument being passed to
228 SVC encoder
229
230 @params videnc2InArgs : It is instance of base class. It cntains all
231 the necessary info required run time parameters for all H264ENC
232 objects
233
234*/
235typedef struct IH264SVCENC_InArgs {
236
237 IVIDENC2_InArgs videnc2InArgs;
238 XDAS_Int32 processId;
239 IH264ENC_RoiInput roiInputParams;
240 XDAS_UInt32 inputKey;
241
242} IH264SVCENC_InArgs;
243
244
245
246/**<
247
248 @struct IH264SVCENC_OutArgs
249 @brief This structure defines the outpur argument being generated from SVC
250 encoder
251
252 @params h264OutArgs : Thsi captures the outArgs of the each of the layer encoded.
253 @params videnc2OutArgs : It is instance of base class which captures the outArgs
254 as a consolidated whole for all the layers.
255 @params numberOfLayers: Number of layers that the encoder has been configured to
256 encode.This field is used in reading the number of entries of h264OutArgs etc.
257
258*/
259typedef struct IH264SVCENC_OutArgs {
260
261 IVIDENC2_OutArgs videnc2OutArgs;
262 IH264ENC_OutArgs h264OutArgs[IH264SVCENC_MAX_NUM_MULTI_INSTANCE];
263 XDAS_UInt8 numberOfLayers;
264
265} IH264SVCENC_OutArgs;
266
267/**<
268
269 @struct IH264SVCENC_Fxns
270 @brief This structure defines of the operations on SVCENC objects
271
272 @params IVIDENC2_Fxns : It is instance of base class. It contains all
273 function table
274
275*/
276typedef struct IH264SVCENC_Fxns {
277 IVIDENC2_Fxns ividenc;
278
279} IH264SVCENC_Fxns;
280
281#ifdef __cplusplus
282}
283#endif
284
285/*@}*/ /* ingroup HDVICP2SVC */
286
287#endif //_IH264SVCENC_H_ //--}
288
289/* ========================================================================*/
290/* End of file : ih264svcenc.h */
291/*-------------------------------------------------------------------------*/
292/* Copyright (c) 2009 Texas Instruments, Incorporated. */
293/* All Rights Reserved. */
294/* ========================================================================*/
295
diff --git a/packages/ivahd_codecs/ti/sdo/codecs/h264svcvdec/ih264svcvdec.h b/packages/ivahd_codecs/ti/sdo/codecs/h264svcvdec/ih264svcvdec.h
new file mode 100644
index 0000000..41d7da0
--- /dev/null
+++ b/packages/ivahd_codecs/ti/sdo/codecs/h264svcvdec/ih264svcvdec.h
@@ -0,0 +1,443 @@
1/*
2*******************************************************************************
3 * HDVICP2.0 Based H.264SVC Decoder
4 *
5 * "HDVICP2.0 Based H.264SVC Decoder" is a software module developed on TI's
6 * HDVICP2 based SOCs. This module is capable of decoding a compressed
7 * baseline profile SVC bit-stream into a YUV 4:2:0 Raw video.
8 * Based on "Annex G ISO/IEC 14496-10".
9 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
10 * ALL RIGHTS RESERVED
11*******************************************************************************
12*/
13/**
14*******************************************************************************
15 * @file <ih264svcvdec.h>
16 *
17 * @brief SVCVDEC Interface Header file.
18 *
19 * This File contains the interface structures and Macro definition
20 * required for integrating the H264VDEC.
21 *
22 * @author: Ashish Singh <ashish.singh@ti.com>
23 *
24 * @version 0.1 (Apr 2010) : Base version borrowed from h264 universal decoder
25 *
26 * @version 0.2 (Apr 2010) : Implemented the interface structure for svc dec
27 *
28 * @version 0.3 (Sep 2010) : Added review comments and added one new default
29 * dynemic parameter [Ashish Singh ]
30 *
31 * @version 0.4 (Jan 2011) : Added error concealment mode exteded parameter
32 * in create time parameter and defined the enum
33 * for concealment modes [Ashish Singh]
34 *
35 * @version 0.5 (March 2011): Added spatial error concealment mode in enum
36 * define for concealment modes[Ashish Singh]
37 *
38 * @version 0.6 (April 2011): Added some more extended parametrs and also
39 * added some reserve parametrs in status/create
40 * dynemic structures [Ashish Singh]
41 * @version 0.7 (April 2011): Added one unregistred SSEI message for TI
42 * SVC encoder encoded stream[Ashish Singh]
43 *
44 ******************************************************************************
45*/
46
47#ifndef IH264SVCVDEC_
48#define IH264SVCVDEC_
49
50#include <ti/xdais/ialg.h>
51#include <ti/xdais/dm/ividdec3.h>
52#include <ih264vdec.h>
53#include <h264vdec_ti.h>
54
55
56/**
57 * Macro defined for maximum scalable layer in access unit supported by codec
58 */
59#define IH264SVCVDEC_MAX_NUM_LAYER 0x9
60/**
61 * Macro defined for getting out the version of the encoder written
62 * Unregistred User SSEI messages
63 */
64#define VERSION_FIELD 0x4
65/**
66 ******************************************************************************
67 * @struct IH264SVCVDEC_Obj
68 *
69 * @brief Modules object definition. This structure must be the first field
70 * of all H264SVCVDEC instance objects
71 *
72 * @param fxns : Structure type defining all functions necessary to
73 * implement the IH264VDEC interface.
74 ******************************************************************************
75*/
76typedef struct IH264SVCVDEC_Obj {
77 struct IH264SVCVDEC_Fxns *fxns;
78} IH264SVCVDEC_Obj;
79
80/**
81 ******************************************************************************
82 * @struct IH264SVCVDEC_Status
83 *
84 * @brief This structure defines parameters that describe the status of the
85 * SVC Decoder and any other implementation specific parameters.
86 * The status parameters are defined in the XDM data structure,
87 * IVIDDEC3_Status
88 *
89 * @param h264SvcDecStatusParams : array to hold the status of each layer in
90 * scalable stream
91 * @param viddec3Status : XDM Base class status structure
92 *
93 * @param errConcealmentMode : Error Concealment applied by H.264SVC
94 * Decoder
95 * @param numLayersPresent : Number of scalable layers present in AU
96 *
97 * @param layerDID : Array to store the spatial layer ID's
98 * present in AU
99 * @param layerTID : Array to store the Temporal layer ID
100 * present in AU
101 * @param layerQID : Array to store the Quality layer ID's
102 * present in AU
103 * @param reserved : Reserve for future uses
104 *
105 ******************************************************************************
106*/
107typedef struct IH264SVCVDEC_Status {
108 IH264VDEC_Status h264SvcDecStatusParams;
109 IVIDDEC3_Status viddec3Status;
110 XDAS_UInt32 errConcealmentMode;
111 XDAS_UInt32 numLayersPresent;
112 XDAS_Int32 layerDID[IH264SVCVDEC_MAX_NUM_LAYER];
113 XDAS_Int32 layerTID[IH264SVCVDEC_MAX_NUM_LAYER];
114 XDAS_Int32 layerQID[IH264SVCVDEC_MAX_NUM_LAYER];
115 XDAS_UInt32 reserved[3];
116} IH264SVCVDEC_Status;
117
118
119/**
120******************************************************************************
121* @struct IH264SVCVDEC_Params
122*
123* @brief This structure defines the creation parameters for all H264SVCVDEC
124* objects inside H264SVCVDEC object. This structure includes the
125* xdm baseclass creation parameters and any other implementation
126* specific parameters for SVC Decoder instance object.
127*
128* @param svcDecLayerParams : array to hold the init time parameter of
129* each layer in scalable stream
130* @param disablePreParsing : Flag for disable or enable the pre-
131* Parsing of the svc stream
132*
133* @param reserved : Reserve for future uses
134******************************************************************************
135*/
136
137typedef struct IH264SVCVDEC_Params {
138 IH264VDEC_Params h264SvcDecLayerParams;
139 XDAS_UInt32 disablePreParsing;
140 XDAS_UInt32 reserved[3];
141} IH264SVCVDEC_Params;
142
143/**
144 ******************************************************************************
145 * @struct IH264SVCVDEC_DynamicParams
146 *
147 * @brief This structure defines the run-time parameters and any other
148 * implementation specific parameters for an SVC instance object.
149 * The base run-time parameters are defined in the XDM data structure,
150 * IVIDDEC3_DynamicParams.
151 *
152 * @param h264SvcDecDynamicParams : array to store the hold the dynemic para
153 * meter for each layer of scalable stream
154 *
155 * @param reserved : Reserve for future uses
156 *
157 ******************************************************************************
158*/
159
160typedef struct IH264SVCVDEC_DynamicParams {
161 IH264VDEC_DynamicParams h264SvcDecDynamicParams;
162 XDAS_UInt32 reserved[3];
163} IH264SVCVDEC_DynamicParams;
164
165/**
166 ******************************************************************************
167 * @struct IH264SVCVDEC_InArgs
168 *
169 * @brief This structure defines the run-time input arguments for an H264
170 * instance object (ISVCH264VDEC::process)
171 *
172 * @param viddec3InArgs : InArgs structure SVC Object
173 ******************************************************************************
174*/
175typedef struct IH264SVCVDEC_InArgs {
176 IH264VDEC_InArgs h264SvcDecLayerInArgs;
177} IH264SVCVDEC_InArgs;
178
179/**
180 ******************************************************************************
181 * @struct IH264SVCVDEC_OutArgs
182 *
183 * @brief This structure defines the run time output arguments for
184 * ISVCH264VDEC::process function
185 *
186 * @param svcDecLayerOutArgs : OutArgs structure SVC Object
187 ******************************************************************************
188*/
189
190typedef struct IH264SVCVDEC_OutArgs {
191 IH264VDEC_OutArgs h264SvcDecLayerOutArgs;
192} IH264SVCVDEC_OutArgs;
193
194/**
195 ******************************************************************************
196 * @struct IH264SVCVDEC_Fxns
197 *
198 * @brief This structure contains pointers to all the XDAIS and XDM interface
199 * functions
200 *
201 * @param ividdec3 : This structure contains pointers to all the XDAIS and
202 * XDM interface functions
203 ******************************************************************************
204*/
205typedef struct IH264SVCVDEC_Fxns {
206 IVIDDEC3_Fxns ividdec3;
207} IH264SVCVDEC_Fxns;
208
209/*
210 * IH264SVCVDEC_Handle
211 * This handle is used to reference all H264SVCVDEC instance objects
212 */
213typedef struct IH264SVCVDEC_Obj *IH264SVCVDEC_Handle;
214
215/*
216 * IH264SVCVDEC_Cmd
217 * This structure defines the control commands for the IMP4VENC module.
218 */
219typedef IVIDDEC3_Cmd IH264SVCVDEC_Cmd;
220
221/*
222 * IH264SVCVDEC_PARAMS
223 * Default parameter values for H264SVCVDEC instance objects
224 */
225extern IH264SVCVDEC_Params IH264SVCVDEC_PARAMS;
226/*
227 * IH264SVCVDEC_TI_DYNAMICPARAMS
228 * Default dynamic parameter values for H264SVCVDEC instance objects
229 */
230extern IH264SVCVDEC_DynamicParams IH264SVCVDEC_TI_DYNAMICPARAMS;
231
232/**
233 ******************************************************************************
234 * @struct IH264SVCVDEC_Scalability_TI_Info
235 *
236 * @brief This structure contains svc dec supported SEI message syntax
237 * elements
238 *
239 * @param parsed_flag :1 - Indicates that in the current process call, c
240 * contents of the structure is updated
241 * 0 - Indicates contents of the structure is not updated
242 *
243 * @param num_layers_minus1:(num_layers_minus1 + 1)specifies the number of
244 * scalable layers for which information is provided
245 * in the scalability information SEI message
246 * @param layer_id : specifies the layer identifier of the i-th
247 * scalable layer specified in the scalability information
248 * SEI message
249 * @param priority_id : indicates an upper bound for the priority_id values
250 * of the current scalable layer representation
251 * @param dependency_id : is equal to the values of dependency_id,of the VCL
252 * NAL units of the current scalable layer.
253 * @param quality_id :is equal to the values of quality_id,of the VCL
254 * NAL units of the current scalable layer.
255 * @param temporal_id :is equal to the values of temporal_id,of the VCL
256 * NAL units of the current scalable layer.
257 * @param bitrate_info_present_flag: specifies that the bit rate
258 * information for the current scalable
259 * layer representation is present/
260 * not present in the
261 * scalability information SEI message
262 * @param frm_rate_info_present_flag:specifies that the frame rate
263 * information for the current scalable
264 * layer representation is present/not
265 * present in the scalability information
266 * SEI message
267 * @param frm_size_info_present_flag: specifies that the frame size
268 * information for the current scalable
269 * layer representation is present/not
270 * present in the scalability information
271 * SEI message
272 * @param avg_bitrate: indicates the average bit rate of the representation of
273 * the current scalable layer
274 * @param max_bitrate_layer:indicates an upper bound for the bit rate of the
275 * current scalable layer in any fixed size time
276 * window
277 * @param max_bitrate_layer_representation: indicates an upper bound for the
278 * bit rate of the current scalable
279 * layer representation in any fixed
280 * size time window
281 * @param max_bitrate_calc_window: specifies the size of the time window that
282 * is used for calculating the upper bounds
283 * for the bit rate of the current scalable
284 * layer
285 * @param constant_frm_rate_idc: indicates whether the frame rate of the
286 * current scalable layer representation is
287 * constant
288 * @param avg_frm_rate:indicates the average frame rate, in units of frames
289 * per 256 seconds, of the representation of the current scalable
290 * layer
291 * @param frm_width_in_mbs_minus1: indicate the width of the decoded pictures
292 * for the current scalable layer
293 * representation
294 * @param frm_height_in_mbs_minus1:indicate the height of the decoded
295 * pictures for the current scalable
296 * layer representation
297 *
298 ******************************************************************************
299*/
300
301typedef struct IH264SVCVDEC_Scalability_TI_Info {
302 XDAS_UInt32 parsed_flag;
303 XDAS_UInt32 num_layers_minus1;
304 XDAS_UInt32 layer_id[IH264SVCVDEC_MAX_NUM_LAYER];
305 XDAS_UInt8 priority_id[IH264SVCVDEC_MAX_NUM_LAYER];
306 XDAS_UInt8 dependency_id[IH264SVCVDEC_MAX_NUM_LAYER];
307 XDAS_UInt8 quality_id[IH264SVCVDEC_MAX_NUM_LAYER];
308 XDAS_UInt8 temporal_id[IH264SVCVDEC_MAX_NUM_LAYER];
309 XDAS_UInt8 bitrate_info_present_flag[IH264SVCVDEC_MAX_NUM_LAYER];
310 XDAS_UInt8 frm_rate_info_present_flag[IH264SVCVDEC_MAX_NUM_LAYER];
311 XDAS_UInt8 frm_size_info_present_flag[IH264SVCVDEC_MAX_NUM_LAYER];
312 XDAS_UInt16 avg_bitrate[IH264SVCVDEC_MAX_NUM_LAYER];
313 XDAS_UInt16 max_bitrate_layer[IH264SVCVDEC_MAX_NUM_LAYER];
314 XDAS_UInt16 max_bitrate_layer_representation[IH264SVCVDEC_MAX_NUM_LAYER];
315 XDAS_UInt16 max_bitrate_calc_window[IH264SVCVDEC_MAX_NUM_LAYER];
316 XDAS_UInt16 constant_frm_rate_idc[IH264SVCVDEC_MAX_NUM_LAYER];
317 XDAS_UInt16 avg_frm_rate[IH264SVCVDEC_MAX_NUM_LAYER];
318 XDAS_UInt32 frm_width_in_mbs_minus1[IH264SVCVDEC_MAX_NUM_LAYER];
319 XDAS_UInt32 frm_height_in_mbs_minus1[IH264SVCVDEC_MAX_NUM_LAYER];
320}IH264SVCVDEC_Scalability_TI_Info;
321
322/**
323 ******************************************************************************
324 * @struct IH264SVCVDEC_UnRegSeiMessages_TI_Info
325 *
326 * @brief This structure contains Unregistred sei message encoded by the
327 * Texas Instruments svc netra encoder
328 *
329 * @param parsed_flag :1 - Indicates that in the current process call, c
330 * contents of the structure is updated
331 * 0 - Indicates contents of the structure is not updated
332 *
333 * @param layerOffset: array to store offset of the position of the scalable
334 * layer(SPS/SSPS/PPS/SLICE) encoded in
335 * current access unit
336 *
337 * @param layerSize: array to store the encoded each layer size
338 *
339 * @param num_layers: Number of layers encoded in the current access unit
340 *
341 * @param dependency_id: array to store the spatial layer ID
342 *
343 * @param quality_id: array to store the quality layer ID
344 *
345 * @param idr_flag : array to store the idr_flag info for each layer present
346 * in access unit
347 *
348 * @param ti_specific_unregiSeiMessage_version :
349 * version of the unregiustred sei message
350 * write by encoder for improving the decoder
351 * performance
352 *
353 * @param ti_specific_unregiMessagesFlag: Flag to tells that unregistred
354 * sei meesage is present in the stream
355 *
356 ******************************************************************************
357*/
358
359typedef struct IH264SVCVDEC_UnRegSeiMessages_TI_Info {
360 XDAS_UInt32 parsed_flag;
361 XDAS_UInt32 layerOffset[IH264SVCVDEC_MAX_NUM_LAYER];
362 XDAS_UInt32 layerSize[IH264SVCVDEC_MAX_NUM_LAYER];
363 XDAS_UInt16 num_layers;
364 XDAS_UInt8 dependency_id[IH264SVCVDEC_MAX_NUM_LAYER];
365 XDAS_UInt8 quality_id[IH264SVCVDEC_MAX_NUM_LAYER];
366 XDAS_UInt8 idr_flag[IH264SVCVDEC_MAX_NUM_LAYER];
367 XDAS_UInt8 ti_specific_unregiSeiMessage_version;
368 XDAS_UInt8 ti_specific_unregiSeiMessagesFlag;
369}IH264SVCVDEC_UnRegSeiMessages_TI_Info;
370
371/**
372 ******************************************************************************
373 * @struct IH264SVCVDEC_SSeiMessages
374 *
375 * @brief This structure contains all the supported SEI msg by svc decoder
376 *
377 * @param parsed_flag :1 - Indicates that in the current process call, c
378 * contents of the structure is updated
379 * 0 - Indicates contents of the structure is not updated
380 *
381 * @param scalability_info : structure instance for scalabality info SEI
382 * messages
383 *
384 ******************************************************************************
385*/
386
387typedef struct IH264SVCVDEC_SSeiMessages {
388 XDAS_UInt32 parsed_flag;
389 IH264SVCVDEC_Scalability_TI_Info scalability_info;
390 IH264SVCVDEC_UnRegSeiMessages_TI_Info unregistersei_info;
391}IH264SVCVDEC_SSeiMessages;
392
393
394/**
395 ******************************************************************************
396 * @enum IH264VDEC_errConcealmentMode
397 * @brief This enum indicates whether to apply error concealment or not
398 *
399 ******************************************************************************
400*/
401typedef enum {
402 IH264SVCVDEC_NO_CONCEALMENT = 0,
403 /**
404 * do not apply error concealment
405 */
406 IH264SVCVDEC_APPLY_H264_ERRCONCEALMENT,
407 /**
408 * apply error concealment of h264 decoder
409 */
410 IH264SVCVDEC_APPLY_SVC_ERRCONCEALMENT,
411 /**
412 * apply error concealment of svc decoder
413 */
414 IH264SVCVDEC_APPLY_SVC_SPATIAL_ERRCONCEALMENT
415 /**
416 * apply error concealment of svc decoder
417 */
418
419} IH264SVCVDEC_errConcealmentMode;
420
421/**
422 ******************************************************************************
423 * @enum IH264SVCVDEC_preParsingMode
424 * @brief This enum indicates whether to enable or disable preparsing
425 *
426 ******************************************************************************
427*/
428typedef enum {
429
430 IH264SVCVDEC_ENABLE_PREPARSING = 0,
431 /**
432 * Enable the preparsing, mostaly in error prone scenario
433 */
434 IH264SVCVDEC_DISABLE_PREPARSING = 1
435 /**
436 * Disalbe the preparsing, for video survilence scenarion, where
437 * drop of frame/slice don't happens
438 */
439}IH264SVCVDEC_preParsingMode;
440
441
442#endif /* IH264SVCVDEC_ */
443
diff --git a/packages/ivahd_codecs/ti/sdo/codecs/h264vdec/ih264vdec.h b/packages/ivahd_codecs/ti/sdo/codecs/h264vdec/ih264vdec.h
new file mode 100755
index 0000000..187ca72
--- /dev/null
+++ b/packages/ivahd_codecs/ti/sdo/codecs/h264vdec/ih264vdec.h
@@ -0,0 +1,2692 @@
1/*
2*******************************************************************************
3 * HDVICP2.0 Based H.264 HP Decoder
4 *
5 * "HDVICP2.0 Based H.264 HP Decoder" is a software module developed on TI's
6 * HDVICP2 based SOCs. This module is capable of decoding a compressed
7 * high/main/baseline profile H.264 bit-stream into a YUV 4:2:0 Raw video.
8 * Based on "ISO/IEC 14496-10".
9 * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
10 * ALL RIGHTS RESERVED
11*******************************************************************************
12*/
13
14/**
15*******************************************************************************
16 * @file ih264vdec.h
17 *
18 * @brief H264VDEC Interface Header file.
19 *
20 * This File contains the interface structures and Macro definition
21 * required for integrating the H264VDEC.
22 *
23 * @author: Pavan Shastry (pavanvs@ti.com)
24 *
25 * @version 0.1 (Jan 2008) : Base version borrowed from DSP RnD
26 * @version 0.2 (Oct 2009) : Code commenting/cleanup.
27 * [Keshav]
28 * @version 0.3 (Sep 2010) : Added new structure IH264VDEC_SeiFramePacking
29 * and also added the new element frame_packing
30 * to the structure IH264VDEC_SeiMessages
31 * [Ramkumar]
32 * @version 0.4 (Sep 2010) : Added review comments and added one new default
33 * dynemic parameter [Ashish Singh ]
34 * @version 0.5 (Nov 2010) : Added new elements in status and params for
35 * debug trace [Resmi]
36 * @version 0.6 (Nov 2010) : Changes for indicating gaps in frame_num to app
37 * [Resmi]
38 * @version 0.7 (Dec 2010) : Extending the create param structure to accomodate
39 * configurability feature for the detection
40 * of CABAC and IPCM alignment errors.
41 * [Ramakrishna Adireddy]
42 * @version 0.8 (Dec 2010) : Extending the array size for registered and
43 * un-registered SEI and added a flag in each SEI
44 * message to indicate the overflow.
45 * [Ramakrishna Adireddy]
46 * @version 0.9 (Jan 2011) : Added new common str for storing up the Data
47 * elements required by SVC decoder
48 * [Ashish]
49 * @version 1.0(June 2011) : Added enableDualOutput param and enum for dualYuv
50 * support.
51 * [Vijay Kumar Yadav]
52 * @version 1.1(June 2011) : Added parameter required for dualYuv EC.
53 * [Vijay]
54 * @version 1.2 (Oct 2011) : Gaps in frame number enhancements
55 * [Ramakrishna Adireddy]
56 * @version 1.3 (Oct 2011) : Added WaterMark parameters.
57 * [Suresh Reddy]
58 * @version 1.4 (July 2012): Added new create time param to support decoding
59 * of specific frame types as requested by
60 * application [Mahantesh]
61******************************************************************************
62*/
63#ifndef IH264VDEC_
64#define IH264VDEC_
65
66#include <ti/xdais/ialg.h>
67#include <ti/xdais/dm/ividdec3.h>
68
69#define IH264VDEC_MAX_LENGTH_PROCESS_LIST (24)
70
71/**
72 ******************************************************************************
73 * @struct IH264VDEC_Obj
74 *
75 * @brief Module’s object definition. This structure must be the first field
76 * of all H264VDEC instance objects
77 *
78 * @param fxns : Structure type defining all functions necessary to
79 * implement the IH264VDEC interface.
80 ******************************************************************************
81*/
82typedef struct IH264VDEC_Obj
83{
84 struct IH264VDEC_Fxns *fxns;
85} IH264VDEC_Obj;
86
87/**
88 ******************************************************************************
89 * @struct IH264VDEC_Status
90 *
91 * @brief This structure defines parameters that describe the status of the
92 * H264 Decoder and any other implementation specific parameters.
93 * The status parameters are defined in the XDM data structure,
94 * IVIDDEC3_Status
95 *
96 * @param viddec3Status : XDM Base class status structure (see ividdec3.h)
97 *
98 * @param svcTargetLayerDID : SVC Spatial target layer ID,need to set if svc
99 * codec flag is on else default set to 0.
100 *
101 * @param svcTargetLayerQID : SVC Quality target layer ID,need to set if svc
102 * codec flag is on else default set to 0.
103 *
104 *
105 * @param svcTargetLayerTID : SVC Temporal target layer ID,need to set if svc
106 * codec flag is on else default set to 0.
107 *
108 * @param debugTraceLevel: This parameter reports the debug trace level
109 * configured for the codec
110 *
111 * @param lastNFramesToLog: This parameter reports the number of last N
112 * pictures for which history has been maintained
113 *
114 * @param extMemoryDebugTraceAddr: This parameter reports the external
115 * memory address (as seen by M3) where debug trace
116 * information is being dumped
117 *
118 * @param extMemoryDebugTraceSize: This parameter reports the external
119 * memory buffer size(in bytes) where debug trace
120 * information is being dumped
121 *
122 * @param gapInFrameNum: This parameter reports the gap in frame_num
123 * observed in the current frame. It is overloaded
124 * with details of two things.
125 * LSB 1-bit [0:0]: Indicates whether SPS allows frame
126 * num gaps.
127 * Rest 31-bits [31:1]: Indicates the gap observed
128 *
129 * @param spsMaxRefFrames: This parameter reports max reference frames
130 * that get used for decoding of a given stream.
131 * If SPS is not parsed, this gives out the value
132 * based on level & resolution set in create time
133 * params. Otherwise, it gives out the parsed value
134 *
135 * @param enableDualOutput : This Parameter tells whether Dual output is
136 * enable or not. If enable then application needs
137 * to provide two extra buffer (one for DualLuma
138 * and another for DualChroma.
139 *
140 * @param reserved[2] : Left reserve for future purpose
141 *
142 ******************************************************************************
143*/
144typedef struct IH264VDEC_Status
145{
146 IVIDDEC3_Status viddec3Status;
147 XDAS_Int32 svcTargetLayerDID;
148 XDAS_Int32 svcTargetLayerTID;
149 XDAS_Int32 svcTargetLayerQID;
150 XDAS_UInt32 debugTraceLevel;
151 XDAS_UInt32 lastNFramesToLog;
152 XDAS_UInt32 *extMemoryDebugTraceAddr;
153 XDAS_UInt32 extMemoryDebugTraceSize;
154 XDAS_UInt32 gapInFrameNum;
155 XDAS_UInt32 spsMaxRefFrames;
156 XDAS_UInt32 enableDualOutput;
157 XDAS_UInt32 reserved[2];
158} IH264VDEC_Status;
159
160 /**
161 ******************************************************************************
162 * @struct IH264VDEC_Params
163 *
164 * @brief This structure defines the creation parameters for all H264VDEC
165 * objects. This structure includes the xdm baseclass creation
166 * parameters and any other implementation specific parameters for
167 * H264 Decoder instance object.
168 *
169 * @param viddec3Params : XDM Baselass create time parameters.
170 * (see ividdec3.h)
171 * @param dpbSizeInFrames: Number of frames required by the DPB
172 * (Decoded Picture Buffer). This is the DPB size
173 * in number of frames. Also, See the enum
174 * IH264VDEC_dpbNumFrames.
175 * @param pConstantMemory : This pointer points to the the memory area where
176 * constants are located. Default value is NULL in
177 * which case, codec puts the constants in a
178 * default section.
179 * It has to be in DDR addressable space by
180 * vDMA. This is useful to allow relocatable
181 * constants for the applications which doesn't use
182 * M3 as host. Actual memory controller/allocator
183 * is on another master processor.
184 * If this is set to NULL then decoder assumes
185 * that all constants are pointed by symbol
186 * H264VDEC_TI_ConstData
187 *
188 * @param bitStreamFormat : Input bit stream format. Input bits stream can
189 * be IH264VDEC_NAL_UNIT_FORMAT or
190 * IH264VDEC_BYTE_STREAM_FORMAT. See the enum
191 * IH264VDEC_bitStreamFormat for details.
192 * The decoder supports IH264VDEC_BYTE_STREAM_FORMAT
193 * in both datasync mode and non datasync mode
194 * (i.e inputDataMode = IVIDEO_ENTIREFRAME).
195 * But the IH264VDEC_NAL_UNIT_FORMAT is supported
196 * only in datasync mode, i.e only when
197 * inputDataMode = IH264VDEC_NALUNIT_SLICEMODE.
198 *
199 * @param errConcealmentMode : If this is set to 1, it means that the YUV
200 * buffer passed in current process call needs
201 * concealment. If this is set to 0, it means that
202 * the YUV buffer passed in current process call
203 * does not concealment. Note that whether decoder
204 * actually performed the concealment or not is
205 * indicated by XDM_APPLIEDCONCEALMENT bit in
206 * extended error field
207 *
208 * @param temporalDirModePred: Parameter to enable/disable temporal direct
209 * Prediction mode. 0: Disable, 1:Enable
210 * If this Parameter is disabled set to 0), and
211 * if the B slice uses temporal direct mode,
212 * then the codec returns error for that slice.
213 *
214 * @param svcExtensionFlag : If required to decode SVC streams , set flag
215 * ON else default set to IH264SVCVDEC_EXT_FLAG
216 *
217 * @param svcTargetLayerDID : SVC Spatial target layer ID,need to read if svc
218 * codec flag (svcExtensionFlag)is on else default
219 * set to IH264SVCVDEC_TARGET_DEFAULT_DID.
220 *
221 * @param svcTargetLayerQID : SVC Quality target layer ID,need to read if svc
222 * codec flag (svcExtensionFlag) is on else default
223 * set to IH264SVCVDEC_TARGET_DEFAULT_QID.
224 *
225 *
226 * @param svcTargetLayerTID : SVC Temporal target layer ID,need to read if svc
227 * codec flag (svcExtensionFlag)is on else default
228 * set to IH264SVCVDEC_TARGET_DEFAULT_TID.
229 *
230 * @param presetLevelIdc : Level to which decoder has to be configured by the
231 * application
232 *
233 * @param presetProfileIdc : Profile to which decoder has to be configured by
234 * the application. Currently unused inside codec.
235 *
236 * @param detectCabacAlignErr: This parameter configures the cabac alignment
237 * error detection
238 *
239 * @param detectIPCMAlignErr: This parameter configures the IPCM alignment
240 * error detection
241 *
242 * @param debugTraceLevel: This parameter configures the debug trace level
243 * for the codec
244 *
245 * @param lastNFramesToLog: This parameter configures the codec to maintain
246 * a history of last N frames/pictures
247 *
248 * @param enableDualOutput : This Parameter tells whether Dual output is
249 * enable or not. If enable then application needs
250 * to provide two extra buffer (one for DualLuma
251 * and another for DualChroma.
252 *
253 * @param processCallLevel : Flag to select field/frame level process call
254 *
255 * @param enableWatermark : This Parameter tells whether watermark is
256 * enabled or not.
257 *
258 * @param decodeFrameType : Flag to decoder from application to request
259 * decoding of only I & IDR or IP or all frame types.
260 * Setting of IVIDDEC3_DynamicParams::frameSkipMode =
261 * IVIDEO_SKIP_PB or IVIDEO_SKIP_B could have been
262 * used for this purpose but it is defined at dynamic
263 * level, whereas the intention of this parameter is
264 * to have create time indication to codec for lesser
265 * memory foot print request. Hence this new parameter
266 * is defined.
267 ******************************************************************************
268*/
269typedef struct IH264VDEC_Params
270{
271 IVIDDEC3_Params viddec3Params;
272 XDAS_Int32 dpbSizeInFrames;
273 XDAS_Int32 pConstantMemory;
274 XDAS_Int32 bitStreamFormat;
275 XDAS_UInt32 errConcealmentMode;
276 XDAS_Int32 temporalDirModePred;
277 XDAS_UInt32 svcExtensionFlag;
278 XDAS_Int32 svcTargetLayerDID;
279 XDAS_Int32 svcTargetLayerTID;
280 XDAS_Int32 svcTargetLayerQID;
281 XDAS_Int32 presetLevelIdc;
282 XDAS_Int32 presetProfileIdc;
283 XDAS_UInt32 detectCabacAlignErr;
284 XDAS_UInt32 detectIPCMAlignErr;
285 XDAS_UInt32 debugTraceLevel;
286 XDAS_UInt32 lastNFramesToLog;
287 XDAS_UInt32 enableDualOutput;
288 XDAS_Int32 processCallLevel;
289 XDAS_UInt32 enableWatermark;
290 XDAS_UInt32 decodeFrameType;
291} IH264VDEC_Params;
292/**
293 ******************************************************************************
294 * @struct IH264VDEC_DynamicParams
295 *
296 * @brief This structure defines the run-time parameters and any other
297 * implementation specific parameters for an H.264 instance object.
298 * The base run-time parameters are defined in the XDM data structure,
299 * IVIDDEC3_DynamicParams.
300 *
301 * @param viddec3DynamicParams : XDM Base class dynamic structure
302 * (see ividdec3.h)
303 *
304 * @param deblockFilterMode : indicates the mode of deblocking filter
305 * (see enum IH264VDEC_deblockFilterMode)
306 *
307 * @param svcTargetLayerDID : SVC Spatial target layer ID,need to read if svc
308 * codec flag is on else default set to
309 * IH264SVCVDEC_TARGET_DEFAULT_DID.
310 *
311 * @param svcTargetLayerQID : SVC Quality target layer ID,need to read if svc
312 * codec flag is on else default set to
313 * IH264SVCVDEC_TARGET_DEFAULT_QID.
314 *
315 *
316 * @param svcTargetLayerTID : SVC Temporal target layer ID,need to read if svc
317 * codec flag is on else default set to
318 * IH264SVCVDEC_TARGET_DEFAULT_TID.
319 *
320 * @param svcELayerDecode : Flag to set for enhancement layer decode,
321 * defaultvalue is IH264VDEC_DISABLE_ELAYERDECODE
322 *
323 * @param reserved[3] : Left reserve for future purpose
324 *
325 ******************************************************************************
326*/
327typedef struct IH264VDEC_DynamicParams
328{
329 IVIDDEC3_DynamicParams viddec3DynamicParams;
330 XDAS_Int32 deblockFilterMode;
331 XDAS_Int32 svcTargetLayerDID;
332 XDAS_Int32 svcTargetLayerTID;
333 XDAS_Int32 svcTargetLayerQID;
334 XDAS_Int32 svcELayerDecode;
335 XDAS_Int32 reserved[3];
336} IH264VDEC_DynamicParams;
337
338/**
339 ******************************************************************************
340 * @struct IH264VDEC_InArgs
341 *
342 * @brief This structure defines the run-time input arguments for an H264
343 * instance object (IH264VDEC::process)
344 *
345 * @param viddec3InArgs : XDM Base class InArgs structure (see ividdec3.h)
346 *
347 * @param lateAcquireArg : XDM Base class InArgs structure (see ividdec3.h)
348 ******************************************************************************
349*/
350typedef struct IH264VDEC_InArgs
351{
352 IVIDDEC3_InArgs viddec3InArgs;
353 XDAS_Int32 lateAcquireArg;
354} IH264VDEC_InArgs;
355/**
356 ******************************************************************************
357 * @struct IH264VDEC_OutArgs
358 *
359 * @brief This structure defines the run time output arguments for
360 * IH264VDEC::process function
361 *
362 * @param viddec3OutArgs : XDM Base class OutArgs structure (see ividdec3.h)
363 *
364 * @param decryptedKey : This variable contains watermark decrypted key.
365 ******************************************************************************
366*/
367typedef struct IH264VDEC_OutArgs
368{
369 IVIDDEC3_OutArgs viddec3OutArgs;
370 XDAS_UInt32 decryptedKey;
371} IH264VDEC_OutArgs;
372
373/*
374 * ======== IH264VDEC_Handle ========
375 * This handle is used to reference all H264VDEC instance objects
376 */
377typedef struct IH264VDEC_Obj *IH264VDEC_Handle;
378
379/**
380 ******************************************************************************
381 * @struct IH264VDEC_ProcessParams
382 *
383 * @brief This structure defines the container for holding the channel
384 * information.
385 *
386 * @param handle : Handle for the channel.
387 * @param inBufs : Input Buffers for the Channel.
388 * @param outBufs : Output Buffers for the Channel.
389 * @param inArgs : Input Arguments for the Channel.
390 * @param outArgs : Output Arguments for the Channel.
391 ******************************************************************************
392*/
393typedef struct IH264VDEC_ProcessParams
394{
395 IH264VDEC_Handle handle;
396 XDM2_BufDesc *inBufs;
397 XDM2_BufDesc *outBufs;
398 IVIDDEC3_InArgs *inArgs;
399 IVIDDEC3_OutArgs *outArgs;
400} IH264VDEC_ProcessParams;
401
402/**
403 ******************************************************************************
404 * @struct IH264VDEC_ProcessParamsList
405 *
406 * @brief This structure defines the container for holding the N channel
407 * information.
408 *
409 * @param numEntries : Number of channels in the given container.
410 * @param processParams : Array holding the Process Parameters.
411 ******************************************************************************
412*/
413typedef struct IH264VDEC_ProcessParamsList
414{
415 XDAS_Int32 numEntries ;
416 IH264VDEC_ProcessParams processParams[IH264VDEC_MAX_LENGTH_PROCESS_LIST];
417} IH264VDEC_ProcessParamsList ;
418
419/**
420 ******************************************************************************
421 * @struct IH264VDEC_Fxns
422 *
423 * @brief This structure contains pointers to all the XDAIS and XDM interface
424 * functions
425 *
426 * @param ividdec3 : This structure contains pointers to all the XDAIS and
427 * XDM interface functions
428 ******************************************************************************
429*/
430typedef struct IH264VDEC_Fxns
431{
432 IVIDDEC3_Fxns ividdec3;
433 XDAS_Int32 (*processMulti) (IH264VDEC_ProcessParamsList *processList);
434} IH264VDEC_Fxns;
435
436
437
438/*
439 * ======== IH264VDEC_Cmd ========
440 * This structure defines the control commands for the IMP4VENC module.
441 */
442typedef IVIDDEC3_Cmd IH264VDEC_Cmd;
443
444/*
445 * ======== IH264VDEC_PARAMS ========
446 * Default parameter values for H264VDEC instance objects
447 */
448extern const IH264VDEC_Params IH264VDEC_PARAMS;
449/*
450 * ======== IH264VDEC_DYNAMICPARAMS ========
451 * Default dynamic parameter values for H264VDEC instance objects
452 */
453extern const IH264VDEC_DynamicParams IH264VDEC_TI_DYNAMICPARAMS;
454
455
456/**
457 ******************************************************************************
458 * @enum IH264VDEC_deblockFilterMode
459 * @brief This enum indicates the mode of deblocking filter
460 *
461 ******************************************************************************
462*/
463typedef enum
464{
465 IH264VDEC_DEBLOCK_DISABLE_NONE = 0,
466 /**
467 * Perform deblocking across all edges
468 */
469 IH264VDEC_DEBLOCK_DISABLE_ALL,
470 /**
471 * Disable deblocking across all edges
472 */
473 IH264VDEC_DEBLOCK_DISABLE_SLICE_EDGE,
474 /**
475 * Disable deblocking only at slice edges. Internal to slice,
476 * edges are deblocked.
477 */
478 IH264VDEC_DEBLOCK_DEFAULT
479 /**
480 * Perform deblocking as controlled by disable_deblocking_filter_idc of
481 * the bitstream
482 */
483} IH264VDEC_deblockFilterMode;
484
485/**
486 ******************************************************************************
487 * @enum IH264VDEC_temporalDirModePred
488 * @brief This enum indicates whether or not to decode slices with
489 * temporal direct prediction
490 *
491 ******************************************************************************
492*/
493typedef enum
494{
495 IH264VDEC_DISABLE_TEMPORALDIRECT = 0,
496 /**
497 * Do not decode slice with temporal direct
498 */
499 IH264VDEC_ENABLE_TEMPORALDIRECT
500 /**
501 * Decode slice with temporal direct
502 */
503} IH264VDEC_temporalDirModePred;
504
505/**
506 ******************************************************************************
507 * @enum IH264VDEC_detectCabacAlignErr
508 * @brief This enum indicates whether or not to detect the cabac
509 * alignment errors in MB-decoding
510 *
511 ******************************************************************************
512*/
513typedef enum
514{
515 IH264VDEC_DISABLE_CABACALIGNERR_DETECTION = 0,
516 /**
517 * Do not detect the CABAC alignment errors
518 */
519 IH264VDEC_ENABLE_CABACALIGNERR_DETECTION
520 /**
521 * Detect the CABAC alignment errors
522 */
523} IH264VDEC_detectCabacAlignErr;
524
525/**
526 ******************************************************************************
527 * @enum IH264VDEC_detectIPCMAlignErr
528 * @brief This enum indicates whether or not to detect the IPCM
529 * alignment errors in MB-decoding
530 *
531 ******************************************************************************
532*/
533typedef enum
534{
535 IH264VDEC_DISABLE_IPCMALIGNERR_DETECTION = 0,
536 /**
537 * Do not detect the IPCM alignment errors
538 */
539 IH264VDEC_ENABLE_IPCMALIGNERR_DETECTION
540 /**
541 * Detect the IPCM alignment errors
542 */
543} IH264VDEC_detectIPCMAlignErr;
544
545/**
546 ******************************************************************************
547 * @enum IH264VDEC_errConcealmentMode
548 * @brief This enum indicates whether to apply error concealment or not
549 *
550 ******************************************************************************
551*/
552typedef enum
553{
554 IH264VDEC_NO_CONCEALMENT = 0,
555 /**
556 * do not apply error concealment
557 */
558 IH264VDEC_APPLY_CONCEALMENT
559 /**
560 * apply error concealment
561 */
562} IH264VDEC_errConcealmentMode;
563
564/**
565 ******************************************************************************
566 * @enum IH264VDEC_LevelId
567 *
568 * @brief This enum indicates preset level numbers for H.264 Decoder
569 *
570 * The application should set the level in the create time parameters.
571 ******************************************************************************
572*/
573typedef enum {
574 IH264VDEC_LEVEL1 = 0,
575 /** 0: Level 1
576 */
577 IH264VDEC_LEVEL1B,
578 /** 1: Level 1.b
579 */
580 IH264VDEC_LEVEL11,
581 /** 2: Level 1.1
582 */
583 IH264VDEC_LEVEL12,
584 /** 3: Level 1.2
585 */
586 IH264VDEC_LEVEL13,
587 /** 4: Level 1.3
588 */
589 IH264VDEC_LEVEL2,
590 /** 5: Level 2
591 */
592 IH264VDEC_LEVEL21,
593 /** 6: Level 2.1
594 */
595 IH264VDEC_LEVEL22,
596 /** 7: Level 2.2
597 */
598 IH264VDEC_LEVEL3,
599 /** 8: Level 3
600 */
601 IH264VDEC_LEVEL31,
602 /** 9: Level 3.1
603 */
604 IH264VDEC_LEVEL32,
605 /** 10: Level 3.2
606 */
607 IH264VDEC_LEVEL4,
608 /** 11: Level 4
609 */
610 IH264VDEC_LEVEL41,
611 /** 12: Level 4.1
612 */
613 IH264VDEC_LEVEL42,
614 /** 13: Level 4.2
615 */
616 IH264VDEC_LEVEL5,
617 /** 14: Level 5
618 */
619 IH264VDEC_LEVEL51,
620 /** 15: Level 5.1
621 */
622IH264VDEC_MAXLEVELID = IH264VDEC_LEVEL51
623 /** 15: Maximum Level ID that can be configured
624 */
625} IH264VDEC_LevelId;
626
627/**
628 ******************************************************************************
629 * @enum IH264VDEC_ProfileId
630 *
631 * @brief This enum indicates preset profiles for H.264 Decoder
632 *
633 * The application should set the profile in the create time parameters.
634 * In the current implementation, the codec ignores this value.
635 ******************************************************************************
636*/
637typedef enum {
638 IH264VDEC_PROFILE_BASELINE = 0,
639 /** 0: Baseline profile
640 */
641 IH264VDEC_PROFILE_MAIN,
642 /** 1: Main profile
643 */
644 IH264VDEC_PROFILE_HIGH,
645 /** 2: High profile
646 */
647 IH264VDEC_PROFILE_ANY
648 /** 3: As decoded from the bitstream. This is needed to pass compliance.
649 */
650} IH264VDEC_ProfileId;
651
652/**
653 ******************************************************************************
654 * @enum IH264VDEC_debugTraceLevel
655 *
656 * @brief This enum indicates the debug trace levels for H.264 Decoder
657 *
658 * The application should set this in the create time parameters.
659 ******************************************************************************
660*/
661typedef enum {
662 IH264VDEC_DEBUGTRACE_LEVEL0 = 0,
663 /** 0: Debug Trace Level 0
664 */
665 IH264VDEC_DEBUGTRACE_LEVEL1,
666 /** 1: Debug Trace Level 1
667 */
668 IH264VDEC_DEBUGTRACE_LEVEL2,
669 /** 2: Debug Trace Level 2
670 */
671 IH264VDEC_DEBUGTRACE_LEVEL3
672 /** 2: Debug Trace Level 3
673 */
674} IH264VDEC_debugTraceLevel;
675
676/**
677 ******************************************************************************
678 * @enum IH264VDEC_MetadataType
679 * @brief This enum indicates Meta Data types for H.264 Decoder
680 *
681 * The way to get meta data from decoder is via outBufs of the decoder during
682 * process call.
683 ******************************************************************************
684*/
685typedef enum
686{
687 IH264VDEC_PARSED_SEI_DATA = XDM_CUSTOMENUMBASE,
688 /** Write out Parsed SEI data
689 * By setting to this value(for IVIDDEC3_Params::metadataType[i])
690 * the codec can can provide the parsed SEI metadata
691 */
692
693 IH264VDEC_ENCODED_SEI_DATA,
694 /** Write out Encoded (compressed) SEI data
695 *
696 */
697
698 IH264VDEC_PARSED_VUI_DATA,
699 /** Write out Parsed VUI data
700 * By setting to this value(for IVIDDEC3_Params::metadataType[i])
701 * the codec can can provide the parsed VUI metadata
702 */
703 IH264VDEC_ENCODED_VUI_DATA
704 /** Write out Encoded (compressed) VUI data
705 *
706 */
707
708} IH264VDEC_MetadataType;
709
710/**
711 ******************************************************************************
712 * @enum IH264VDEC_DataMode
713 * @brief Describes the input slice format provided to decoder.
714 * This enumeration type is used by App to specify codec
715 * input slice format (NAL/Bytestream) type
716 *
717 ******************************************************************************
718*/
719
720typedef enum
721{
722 IH264VDEC_NALUNIT_MODE = XDM_CUSTOMENUMBASE
723 /** data in NAL stream format
724 *
725 */
726} IH264VDEC_DataMode;
727
728/**
729 ******************************************************************************
730 * @enum IH264VDEC_bitStreamFormat
731 * @brief Input bit stream format provided to decoder.
732 * This enumeration type is used by App to specify codec
733 * input bit stream format (NAL/Bytestream) type
734 *
735 ******************************************************************************
736*/
737typedef enum
738{
739 IH264VDEC_BYTE_STREAM_FORMAT = 0,
740 /** Input data is in Byte stream format (stream with start code).
741 *
742 */
743 IH264VDEC_NAL_UNIT_FORMAT
744 /** Input data is in NAL stream format (No start code)
745 *
746 */
747} IH264VDEC_bitStreamFormat;
748
749/**
750 ******************************************************************************
751 * @enum IH264VDEC_mbErrStatus
752 * @brief This enum indicates if a MB was in error or not
753 *
754 ******************************************************************************
755*/
756typedef enum
757{
758 IH264VDEC_MB_NOERROR = 0,
759 /**
760 * MB was non-erroneous
761 */
762 IH264VDEC_MB_ERROR = 1
763 /**
764 * MB was erroneous
765 */
766} IH264VDEC_mbErrStatus;
767
768/**
769 ******************************************************************************
770 * @enum IH264VDEC_ErrorBit
771 * @brief H.264 Error Codes: Delaration of h264 decoder specific Error
772 * Codes.
773 * @details Error status is communicated trough a 32 bit word. In this,
774 * Error Bits 8 to 15 are used to indicate the XDM error bits. See
775 * XDM_ErrorBit definition in xdm.h. Other bits in a 32 bit word
776 * can be used to signal any codec specific errors. The staructure
777 * below enumerates the H264 decoder specific error bits used.
778 * The algorithm can set multiple bits to 1 depending on the error
779 * condition
780 ******************************************************************************
781*/
782typedef enum
783{
784 IH264VDEC_ERR_NOSLICE = 0,
785 /**<
786 * Bit 0
787 * 1 - No error-free slice header detected in the frame
788 * 0 - Ignore
789 */
790 IH264VDEC_ERR_SPS,
791 /**<
792 * Bit 1
793 * 1 - Error in SPS parsing
794 * 0 - Ignore
795 */
796 IH264VDEC_ERR_PPS,
797 /**<
798 * Bit 2
799 * 1 - Error during PPS parsing
800 * 0 - Ignore
801 */
802 IH264VDEC_ERR_SLICEHDR,
803 /**<
804 * Bit 3
805 * 1 - Error in slice header parsing
806 * 0 - Ignore
807 */
808 IH264VDEC_ERR_MBDATA,
809 /**<
810 * Bit 4
811 * 1 - Error in MB data parsing
812 * 0 - Ignore
813 */
814 IH264VDEC_ERR_UNAVAILABLESPS,
815 /**<
816 * Bit 5
817 * 1 - SPS rferred in the header is not available.
818 * 0 - Ignore
819 */
820 IH264VDEC_ERR_UNAVAILABLEPPS,
821 /**<
822 * Bit 6
823 * 1 - PPS rferred in the header is not available
824 * 0 - Ignore
825 */
826 IH264VDEC_ERR_INVALIDPARAM_IGNORE,
827 /**<
828 * Bit 7
829 * 1 - Invalid Parameter
830 * 0 - Ignore
831 */
832 IH264VDEC_ERR_UNSUPPFEATURE = 16,
833 /**<
834 * Bit 16
835 * 1 - Unsupported feature
836 * 0 - Ignore
837 */
838 IH264VDEC_ERR_METADATA_BUFOVERFLOW,
839 /**<
840 * Bit 17
841 * 1 - SEI Buffer overflow detected
842 * 0 - Ignore
843 */
844 IH264VDEC_ERR_STREAM_END,
845 /**<
846 * Bit 18
847 * 1 - End of stream reached
848 * 0 - Ignore
849 */
850 IH264VDEC_ERR_NO_FREEBUF,
851 /**<
852 * Bit 19
853 * 1 - No free buffers available for reference storing reference frame
854 * 0 - Ignore
855 */
856 IH264VDEC_ERR_PICSIZECHANGE,
857 /**<
858 * Bit 20
859 * 1 - Change in resolution detected
860 * 0 - Ignore
861 */
862 IH264VDEC_ERR_UNSUPPRESOLUTION,
863 /**<
864 * Bit 21
865 * 1 - Unsupported resolution by the decoder
866 * 0 - Ignore
867 */
868 IH264VDEC_ERR_NUMREF_FRAMES,
869 /**<
870 * Bit 22
871 * 1 - maxNumRefFrames parameter is not compliant to stream properties
872 * (does not comply to stream requirements).
873 * 0 - Ignore
874 */
875 IH264VDEC_ERR_INVALID_MBOX_MESSAGE,
876 /**<
877 * Bit 23
878 * 1 - Invalid (unexpected) mail box message received by M3 or IVAHD
879 * 0 - Ignore
880 */
881 IH264VDEC_ERR_DATA_SYNC,
882 /**<
883 * Bit 24
884 * 1 - In datasync enable mode, the input supplied is wrong
885 * 0 - Ignore
886 */
887 IH264VDEC_ERR_MISSINGSLICE,
888 /**<
889 * Bit 25
890 * 1 - Missing slice in a frame
891 * 0 - Ignore
892 */
893 IH264VDEC_ERR_INPUT_DATASYNC_PARAMS,
894 /**<
895 * Bit 26
896 * 1 - Input datasync enable mode, the input parameter is wrong
897 * 0 - Ignore
898 */
899 IH264VDEC_ERR_HDVICP2_IMPROPER_STATE,
900 /**<
901 * Bit 27
902 * 1 - IVAHD standby failed or couldn't turn-on/off the IP's clock
903 * or HDVICP reset failed.
904 * 0 - Ignore
905 */
906 IH264VDEC_ERR_TEMPORAL_DIRECT_MODE,
907 /**<
908 * Bit 28
909 * 1 - Temporal direct mode is present in the bits stream
910 * when disableTemporalDirect parameter (create time) is set.
911 * 0 - Ignore
912 */
913 IH264VDEC_ERR_DISPLAYWIDTH,
914 /**<
915 * Bit 29
916 * 1 - DisplayWidth is less than the Image width + Padded width.
917 * 0 - Ignore
918 */
919 IH264VDEC_ERR_NOHEADER,
920 /**<
921 * Bit 30
922 * 1 - Indicates that no SPS/PPS header is decoded in the current
923 * process call.
924 * (or) It indicates that watermark SEI data is unavailable even though
925 * watermark parameter is enabled.
926 * 0 - Ignore
927 */
928 IH264VDEC_ERR_GAPSINFRAMENUM
929 /**<
930 * Bit 31
931 * 1 - Indicates that a gap is detected in frame_num for a stream with
932 * gaps_in_frame_num_value_allowed_flag 1 in SPS.
933 * 0 - Ignore
934 */
935} IH264VDEC_ErrorBit;
936/**
937 ******************************************************************************
938 * @enum IH264VDEC_svcExtension
939 * @brief This enum indicates whether or not to support SVC extension
940 *
941 ******************************************************************************
942*/
943typedef enum
944{
945 IH264VDEC_DISABLE_SVCEXTENSION = 0,
946 /**
947 * Do not support SVC extension
948 */
949 IH264VDEC_ENABLE_SVCEXTENSION
950 /**
951 * Support SVC extension
952 */
953} IH264VDEC_svcExtension;
954
955/**
956 ******************************************************************************
957 * @enum IH264VDEC_eLayerDecodeMode
958 * @brief This enum indicates whether or not to support decoding of
959 * enhancement layer
960 *
961 ******************************************************************************
962*/
963typedef enum
964{
965 IH264VDEC_DISABLE_ELAYERDECODE = 0,
966 /**
967 * Decode base layer only. Do not decode enhancement layer
968 */
969 IH264VDEC_ENABLE_ELAYERDECODE
970 /**
971 * Support decoding of enhancement layer
972 */
973} IH264VDEC_ELAYERDECODEMODE;
974
975
976/**
977 ******************************************************************************
978 * @enum IH264VDEC_dependancyLayerIds
979 * @brief This enum indicates the dependancy layer IDs.
980 *
981 ******************************************************************************
982*/
983typedef enum
984{
985 IH264VDEC_TARGET_DID_DEFAULT = -1,
986 /**
987 * Default dependancy layer ID.
988 */
989 IH264VDEC_TARGET_DID_ZERO = 0,
990 /**
991 * Dependancy layer ID = 0
992 */
993 IH264VDEC_TARGET_DID_ONE,
994 /**
995 * Dependancy layer ID = 1
996 */
997 IH264VDEC_TARGET_DID_TWO,
998 /**
999 * Dependancy layer ID = 2
1000 */
1001 IH264VDEC_TARGET_DID_THREE,
1002 /**
1003 * Dependancy layer ID = 3
1004 */
1005 IH264VDEC_TARGET_DID_FOUR,
1006 /**
1007 * Dependancy layer ID = 4
1008 */
1009 IH264VDEC_TARGET_DID_FIVE,
1010 /**
1011 * Dependancy layer ID = 5
1012 */
1013 IH264VDEC_TARGET_DID_SIX,
1014 /**
1015 * Dependancy layer ID = 6
1016 */
1017 IH264VDEC_TARGET_DID_SEVEN,
1018 /**
1019 * Dependancy layer ID = 7
1020 */
1021 IH264VDEC_TARGET_DID_MAX =
1022 IH264VDEC_TARGET_DID_SEVEN
1023 /**
1024 * Dependancy layer max ID = 7
1025 */
1026 } IH264VDEC_dependancyLayerIds;
1027
1028/**
1029 ******************************************************************************
1030 * @enum IH264VDEC_temporalLayerIds
1031 * @brief This enum indicates the temporal layer IDs for svc.
1032 *
1033 ******************************************************************************
1034*/
1035typedef enum
1036{
1037 IH264VDEC_TARGET_TID_DEFAULT = -1,
1038 /**
1039 * Default Temporal layer ID.
1040 */
1041 IH264VDEC_TARGET_TID_ZERO = 0,
1042 /**
1043 * Temporal layer ID = 0
1044 */
1045 IH264VDEC_TARGET_TID_ONE,
1046 /**
1047 * Temporal layer ID = 1
1048 */
1049 IH264VDEC_TARGET_TID_TWO,
1050 /**
1051 * Temporal layer ID = 2
1052 */
1053 IH264VDEC_TARGET_TID_THREE,
1054 /**
1055 * Temporal layer ID = 3
1056 */
1057 IH264VDEC_TARGET_TID_FOUR,
1058 /**
1059 * Temporal layer ID = 4
1060 */
1061 IH264VDEC_TARGET_TID_FIVE,
1062 /**
1063 * Temporal layer ID = 5
1064 */
1065 IH264VDEC_TARGET_TID_SIX,
1066 /**
1067 * Temporal layer ID = 6
1068 */
1069 IH264VDEC_TARGET_TID_SEVEN,
1070 /**
1071 * Temporal layer ID = 7
1072 */
1073 IH264VDEC_TARGET_TID_MAX =
1074 IH264VDEC_TARGET_TID_SEVEN
1075 /**
1076 * Temporal layer max ID = 7
1077 */
1078 } IH264VDEC_temporalLayerIds;
1079
1080/**
1081 ******************************************************************************
1082 * @enum IH264VDEC_qualityLayerIds
1083 * @brief This enum indicates the quality layer IDs for svc.
1084 *
1085 ******************************************************************************
1086*/
1087typedef enum
1088{
1089 IH264VDEC_TARGET_QID_DEFAULT = -1,
1090 /**
1091 * Default Quality layer ID.
1092 */
1093 IH264VDEC_TARGET_QID_ZERO = 0,
1094 /**
1095 * Quality layer ID = 0
1096 */
1097 IH264VDEC_TARGET_QID_ONE,
1098 /**
1099 * Quality layer ID = 1
1100 */
1101 IH264VDEC_TARGET_QID_TWO,
1102 /**
1103 * Quality layer ID = 2
1104 */
1105 IH264VDEC_TARGET_QID_THREE,
1106 /**
1107 * Quality layer ID = 3
1108 */
1109 IH264VDEC_TARGET_QID_FOUR,
1110 /**
1111 * Quality layer ID = 4
1112 */
1113 IH264VDEC_TARGET_QID_FIVE,
1114 /**
1115 * Quality layer ID = 5
1116 */
1117 IH264VDEC_TARGET_QID_SIX,
1118 /**
1119 * Quality layer ID = 6
1120 */
1121 IH264VDEC_TARGET_QID_SEVEN,
1122 /**
1123 * Quality layer ID = 7
1124 */
1125 IH264VDEC_TARGET_QID_EIGHT,
1126 /**
1127 * Quality layer max ID = 8
1128 */
1129 IH264VDEC_TARGET_QID_NINE,
1130 /**
1131 * Quality layer max ID = 9
1132 */
1133 IH264VDEC_TARGET_QID_TEN,
1134 /**
1135 * Quality layer max ID = 10
1136 */
1137 IH264VDEC_TARGET_QID_ELEVEN,
1138 /**
1139 * Quality layer max ID = 11
1140 */
1141 IH264VDEC_TARGET_QID_TWELVE,
1142 /**
1143 * Quality layer max ID = 12
1144 */
1145 IH264VDEC_TARGET_QID_THIRTEEN,
1146 /**
1147 * Quality layer max ID = 13
1148 */
1149 IH264VDEC_TARGET_QID_FOURTEEN,
1150 /**
1151 * Quality layer max ID = 14
1152 */
1153 IH264VDEC_TARGET_QID_FIFTEEN,
1154 /**
1155 * Quality layer max ID = 15
1156 */
1157 IH264VDEC_TARGET_QID_MAX =
1158 IH264VDEC_TARGET_QID_FIFTEEN
1159 /**
1160 * Quality layer max ID = 15
1161 */
1162} IH264VDEC_qualityLayerIds;
1163
1164/**
1165 ******************************************************************************
1166 * @enum IH264VDEC_seiOverFlowFlag
1167 * @brief This enum indicates user data reg/unreg SEI overFlowFlag values
1168 *
1169 ******************************************************************************
1170*/
1171typedef enum
1172{
1173 IH264VDEC_PAYLOAD_NO_OVERFLOW = 0,
1174 /**
1175 * Indicates there is no overflow occured in user data reg or unreg sei
1176 */
1177 IH264VDEC_PAYLOAD_OVERFLOW
1178 /**
1179 * Indicates there is a overflow in user data reg or unreg sei
1180 */
1181} IH264VDEC_seiOverFlowFlag;
1182
1183/**
1184 ******************************************************************************
1185 * @enum IH264VDEC_enableDualOutput
1186 * @brief This enum is used to enable/disable dual output feature
1187 *
1188 ******************************************************************************
1189*/
1190typedef enum
1191{
1192 IH264VDEC_DUALOUTPUT_DISABLE = 0,
1193 /**
1194 * Indicates that dual output is disabled
1195 */
1196 IH264VDEC_DUALOUTPUT_ENABLE,
1197 /**
1198 * Indicates that dual output is enabled
1199 */
1200 IH264VDEC_DUALOUTPUTALIGN_ENABLE
1201 /**
1202 * Indicates that dual output is enabled and has 16-byte alignment
1203 */
1204} IH264VDEC_enableDualOutput;
1205
1206/**
1207 ******************************************************************************
1208 * @enum IH264VDEC_processCallLevel
1209 * @brief This enum indicates whether process call is done at a field
1210 * level or frame level
1211 *
1212 ******************************************************************************
1213*/
1214typedef enum
1215{
1216 IH264VDEC_FIELDLEVELPROCESSCALL = 0,
1217 /**
1218 * Indicates that process call should be at field level
1219 */
1220 IH264VDEC_FRAMELEVELPROCESSCALL
1221 /**
1222 * Indicates that process call should be at frame level
1223 */
1224} IH264VDEC_processCallLevel;
1225
1226/**
1227 ******************************************************************************
1228 * @enum IH264VDEC_enableWaterMark
1229 * @brief This enum is used to enable/disable Watermark feature
1230 *
1231 ******************************************************************************
1232*/
1233typedef enum
1234{
1235 IH264VDEC_WATERMARK_DISABLE = 0,
1236 /**
1237 * Indicates that Watermark is disabled
1238 */
1239 IH264VDEC_WATERMARK_ENABLE
1240 /**
1241 * Indicates that Watermark is enabled
1242 */
1243} IH264VDEC_enableWaterMark;
1244
1245/**
1246 ******************************************************************************
1247 * @enum IH264VDEC_decodeFrameType
1248 * @brief This enum is used to request decoder to decode only I, IP or ALL
1249 * frame types
1250 ******************************************************************************
1251*/
1252typedef enum
1253{
1254 IH264VDEC_DECODE_ALL = 0,
1255 /**
1256 * Indicates that all type of frames decoding is enabled
1257 */
1258 IH264VDEC_DECODE_IP_ONLY = 1,
1259 /**
1260 * Indicates that only I/IDR and P frames decoding is enabled
1261 */
1262 IH264VDEC_DECODE_I_ONLY = 2
1263 /**
1264 * Indicates that only I/IDR frames decoding is enabled
1265 */
1266} IH264VDEC_decodeFrameType;
1267
1268/**
1269 * Macro definitions required for SEI support: HRD sequence parameter set
1270 */
1271#define IH264VDEC_MAXCPBCNT 32
1272
1273/**
1274 * Macro definitions required for SEI support: HRD sequence parameter set
1275 */
1276#define IH264VDEC_MAXUSERDATA_PAYLOAD 300
1277
1278/**
1279 ******************************************************************************
1280 * @struct IH264VDEC_HrdParams
1281 *
1282 * @brief This structure contains the HRD parameter elements.
1283 *
1284 * @param cpb_cnt_minus1 : Number of alternative CPB specifications in the
1285 * bit-stream
1286 * @param bit_rate_scale : Together with bit_rate_value[i], it specifies the
1287 * maximum input bit-rate for the ith CPB.
1288 * @param cpb_size_scale : Together with cpb_size_value[i], specifies the
1289 * maximum CPB size for the ith CPB.
1290 * @param bit_rate_value_minus1[IH264VDEC_MAXCPBCNT] :Maximum input bitrate
1291 * for the ith CPB
1292 * @param cpb_size_value_minus1[IH264VDEC_MAXCPBCNT] :Maximum CPB size for the
1293 * ith CPB
1294 * @param vbr_cbr_flag[IH264VDEC_MAXCPBCNT] :Specifies the ith CPB is operated
1295 * in Constant Bit-rate mode or variable bit-rate mode
1296 * @param initial_cpb_removal_delay_length_minus1 :Length in bits of
1297 * initial_cpb_removal_length syntax element
1298 * @param cpb_removal_delay_length_minus1 :Length in bits of
1299 * cpb_removal_delay_length syntax element
1300 * @param dpb_output_delay_length_minus1 :Length in bits of
1301 * dpb_output_delay_length syntax element
1302 * @param time_offset_length : Length in bits of time_offset syntax element
1303 ******************************************************************************
1304*/
1305typedef struct IH264VDEC_HrdParams
1306{
1307 XDAS_UInt32 cpb_cnt_minus1;
1308 XDAS_UInt8 bit_rate_scale;
1309 XDAS_UInt8 cpb_size_scale;
1310 XDAS_UInt32 bit_rate_value_minus1[IH264VDEC_MAXCPBCNT];
1311 XDAS_UInt32 cpb_size_value_minus1[IH264VDEC_MAXCPBCNT];
1312 XDAS_UInt8 vbr_cbr_flag[IH264VDEC_MAXCPBCNT];
1313 XDAS_UInt8 initial_cpb_removal_delay_length_minus1;
1314 XDAS_UInt8 cpb_removal_delay_length_minus1;
1315 XDAS_UInt8 dpb_output_delay_length_minus1;
1316 XDAS_UInt8 time_offset_length;
1317} IH264VDEC_HrdParams;
1318
1319/**
1320 ******************************************************************************
1321 * @struct IH264VDEC_SVCVuiParams
1322 *
1323 * @brief This structure contains VUI message syntax elements for scalable
1324 * video stream
1325 *
1326 * @param parsed_flag :1 - Indicates that in the current process call, c
1327 * contents of the structure is updated
1328 * 0 - Indicates contents of the structure is not updated
1329 *
1330 * @param svc_vui_ext_num_entries_minus1:(svc_vui_ext_num_entries_minus1 + 1)
1331 * specifies the number of information
1332 * entries that are present in the SVC
1333 * VUI parameters extension syntax
1334 * structure
1335 * @param svc_vui_ext_dependency_id:indicate the max value of DId for the
1336 * i-th subset of coded video sequences
1337 * @param svc_vui_ext_quality_id:indicate the max value of QId for the
1338 * i-th subset of coded video sequences
1339 * @param svc_vui_ext_temporal_id: indicate the max value of TId for the
1340 * i-th subset of coded video sequences
1341 * @param svc_vui_ext_timing_info_present_flag: Flag to tells that
1342 * svc_vui_ext_num_units_in_tick,
1343 * svc_vui_ext_time_scale,
1344 * svc_vui_ext_fixed_frame_rate_flag
1345 * are present for current coded
1346 * sequence or not.
1347 * @param svc_vui_ext_num_units_in_tick: specifies the value of
1348 * num_units_in_tick
1349 * @param svc_vui_ext_time_scale: specifies the value of time_scale
1350 * @param svc_vui_ext_fixed_frame_rate_flag: specifies the value of
1351 * fixed_frame_rate_flag
1352 * @param svc_vui_ext_nal_hrd_parameters_present_flag:specifies the
1353 * value of nal_hrd_parameters_present_flag
1354 * @param svc_vui_ext_vcl_hrd_parameters_present_flag: ] specifies the
1355 * value of vcl_hrd_parameters_present_flag
1356 * @param svc_vui_ext_low_delay_hrd_flag: specifies the value
1357 * of low_delay_hrd_flag
1358 * @param svc_vui_ext_pic_struct_present_flag: specifies the value
1359 * of pic_struct_present_flag
1360 *
1361 ******************************************************************************
1362*/
1363
1364typedef struct sIH264VDEC_SVCVuiParams
1365{
1366 XDAS_UInt32 parsed_flag;
1367 XDAS_UInt16 svc_vui_ext_num_entries_minus1;
1368 XDAS_UInt16 svc_vui_ext_dependency_id;
1369 XDAS_UInt16 svc_vui_ext_quality_id;
1370 XDAS_UInt16 svc_vui_ext_temporal_id;
1371 XDAS_UInt16 svc_vui_ext_timing_info_present_flag;
1372 XDAS_UInt32 svc_vui_ext_num_units_in_tick;
1373 XDAS_UInt32 svc_vui_ext_time_scale;
1374 XDAS_UInt16 svc_vui_ext_fixed_frame_rate_flag;
1375 XDAS_UInt16 svc_vui_ext_nal_hrd_parameters_present_flag;
1376 XDAS_UInt16 svc_vui_ext_vcl_hrd_parameters_present_flag;
1377 XDAS_UInt16 svc_vui_ext_low_delay_hrd_flag;
1378 XDAS_UInt16 svc_vui_ext_pic_struct_present_flag;
1379} IH264VDEC_SVCVuiParams;
1380
1381/**
1382 ******************************************************************************
1383 * @struct IH264VDEC_VuiParams
1384 *
1385 * @brief This structure contains the VUI Sequence Parameter elements.
1386 *
1387 * @param parsed_flag :1 - Indicates that in the current process call, c
1388 * contents of the structure is updated
1389 * 0 - Indicates contents of the structure is not updated
1390 * @param aspect_ratio_info_present_flag :Indicates whether aspect ratio idc
1391 * is present or not.
1392 * @param aspect_ratio_idc : Aspect ratio of Luma samples
1393 * @param sar_width : Horizontal size of sample aspect ratio
1394 * @param sar_height : Vertical size of sample aspect ratio
1395 * @param overscan_info_present_flag : Cropped decoded pictures are suitable
1396 * for display or not.
1397 * @param overscan_appropriate_flag : Overscan_appropriate_flag
1398 * @param video_signal_type_present_flag : Flag indicates whether
1399 * video_format, video_full_range_flag and colour_description_present_
1400 * flag are present or not
1401 * @param video_format :Video format indexed by a table. For example,PAL/NTSC
1402 * @param video_full_range_flag : Black level, luma and chroma ranges. It
1403 * should be used for BT.601 compliance
1404 * @param colour_description_present_flag:Indicates whether colour_primaries,
1405 * transfer_characteristics and matrix_coefficients are present.
1406 * @param colour_primaries :Chromaticity co-ordinates of source primaries
1407 * @param transfer_characteristics :Opto-electronic transfer characteristics
1408 * of the source picture
1409 * @param matrix_coefficients :Matrix coefficients for deriving Luma and
1410 * chroma data from RGB components.
1411 * @param chroma_location_info_present_flag : Flag indicates whether
1412 * chroma_sample_loc_type_top field and chroma_sample_loctype
1413 * bottom_field are present.
1414 * @param chroma_sample_loc_type_top_field : Location of chroma_sample top
1415 * field
1416 * @param chroma_sample_loc_type_bottom_field :Location of chroma_sample
1417 * bottom field
1418 * @param timing_info_present_flag :Indicates whether num_units_in_tick,
1419 * time_scale, and fixed_frame_rate_flag are present.
1420 * @param num_units_in_tick :Number of units of a clock that corresponds to 1
1421 * increment of a clock tick counter
1422 * @param time_scale :Indicates actual increase in time for 1 increment of a
1423 * clock tick counter
1424 * @param fixed_frame_rate_flag :Indicates how the temporal distance between
1425 * HRD output times of any two output pictures is constrained
1426 * @param nal_hrd_parameters_present_flag :Indicates whether
1427 * nal_hrd_parameters are present
1428 * @param nal_hrd_pars : NAL HRD Parameters
1429 * @param vcl_hrd_parameters_present_flag :Indicates whether
1430 * vcl_hrd_parameters are present
1431 * @param vcl_hrd_pars : VCL HRD Parameters
1432 * @param low_delay_hrd_flag :HRD operational mode as in Annex C of the
1433 * standard
1434 * @param pic_struct_present_flag :Indicates whether picture timing SEI
1435 * messages are present
1436 * @param bitstream_restriction_flag :Indicates if the bit-stream restriction
1437 * parameters are present
1438 * @param motion_vectors_over_pic_boundaries_flag :Specifies whether motion
1439 * vectors can point to regions outside the picture boundaries
1440 * @param max_bytes_per_pic_denom :Maximum number of bytes not exceeded by
1441 * the sum of sizes of all VCL NAL units of a single coded picture
1442 * @param max_bits_per_mb_denom :Maximum number of bits taken by any coded MB
1443 * @param log2_max_mv_length_vertical :Maximum value of any motion vector’s
1444 * vertical component
1445 * @param log2_max_mv_length_horizontal :Maximum value of any motion vector’s
1446 * horizontal component
1447 * @param max_dec_frame_reordering :
1448 * @param num_reorder_frames :Maximum number of frames that need to be
1449 * re-ordered
1450 * @param max_dec_frame_buffering :Size of HRD decoded buffer (DPB) in terms
1451 * of frame buffers
1452 * @param svcVuiParams : struct instance of vui parameters for svc
1453 *
1454 ******************************************************************************
1455*/
1456typedef struct IH264VDEC_VuiParams
1457{
1458 XDAS_UInt32 parsed_flag;
1459 XDAS_UInt8 aspect_ratio_info_present_flag;
1460 XDAS_UInt32 aspect_ratio_idc;
1461 XDAS_UInt32 sar_width;
1462 XDAS_UInt32 sar_height;
1463 XDAS_UInt8 overscan_info_present_flag;
1464 XDAS_UInt8 overscan_appropriate_flag;
1465 XDAS_UInt8 video_signal_type_present_flag;
1466 XDAS_UInt8 video_format;
1467 XDAS_UInt8 video_full_range_flag;
1468 XDAS_UInt8 colour_description_present_flag;
1469 XDAS_UInt8 colour_primaries;
1470 XDAS_UInt8 transfer_characteristics;
1471 XDAS_UInt8 matrix_coefficients;
1472 XDAS_UInt8 chroma_location_info_present_flag;
1473 XDAS_UInt32 chroma_sample_loc_type_top_field;
1474 XDAS_UInt32 chroma_sample_loc_type_bottom_field;
1475 XDAS_UInt8 timing_info_present_flag;
1476 XDAS_UInt32 num_units_in_tick;
1477 XDAS_UInt32 time_scale;
1478 XDAS_UInt8 fixed_frame_rate_flag;
1479 XDAS_UInt8 nal_hrd_parameters_present_flag;
1480 IH264VDEC_HrdParams nal_hrd_pars;
1481 XDAS_UInt8 vcl_hrd_parameters_present_flag;
1482 IH264VDEC_HrdParams vcl_hrd_pars;
1483 XDAS_UInt8 low_delay_hrd_flag;
1484 XDAS_UInt8 pic_struct_present_flag;
1485 XDAS_UInt8 bitstream_restriction_flag;
1486 XDAS_UInt8 motion_vectors_over_pic_boundaries_flag;
1487 XDAS_UInt32 max_bytes_per_pic_denom;
1488 XDAS_UInt32 max_bits_per_mb_denom;
1489 XDAS_UInt32 log2_max_mv_length_vertical;
1490 XDAS_UInt32 log2_max_mv_length_horizontal;
1491 XDAS_UInt32 max_dec_frame_reordering;
1492 XDAS_UInt32 num_reorder_frames;
1493 XDAS_UInt32 max_dec_frame_buffering;
1494 IH264VDEC_SVCVuiParams svcVuiParams;
1495} IH264VDEC_VuiParams;
1496
1497/**
1498 ******************************************************************************
1499 * @struct IH264VDEC_SeiUserDataRegITUT
1500 *
1501 * @brief This structure contains the user data SEI msg elements
1502 *
1503 * @param parsed_flag :1 - Indicates that in the current process call,
1504 * contents of the structure is updated
1505 * 0 - Indicates contents of the structure is not updated
1506 * @param num_payload_bytes :Specifies the size of the payload
1507 * @param itu_t_t35_country_code : A byte having a value specified as a
1508 * country code by ITU-T Recommendation T.35 Annex A
1509 * @param itu_t_t35_country_code_extension_byte :A byte having a value
1510 * specified as a country code by ITU-T Recommendation T.35 Annex B
1511 * @param itu_t_t35_payload_byte[] : A byte containing data registered as
1512 * specified by ITU-T Recommendation T.35.
1513 * @param dataOverflowFlag: This indicates if pay load data is more than the
1514 * array size i.e., IH264VDEC_MAXUSERDATA_PAYLOAD.
1515 ******************************************************************************
1516*/
1517typedef struct IH264VDEC_SeiUserDataRegITUT
1518{
1519 XDAS_UInt32 parsed_flag;
1520 XDAS_UInt32 num_payload_bytes;
1521 XDAS_UInt8 itu_t_t35_country_code;
1522 XDAS_UInt8 itu_t_t35_country_code_extension_byte;
1523 XDAS_UInt8 itu_t_t35_payload_byte[IH264VDEC_MAXUSERDATA_PAYLOAD];
1524 XDAS_UInt8 dataOverflowFlag;
1525} IH264VDEC_SeiUserDataRegITUT;
1526
1527/**
1528 ******************************************************************************
1529 * @struct IH264VDEC_SeiUserDataUnReg
1530 *
1531 * @brief This structure contains the user data SEI msg elements
1532 *
1533 * @param parsed_flag :1 - Indicates that in the current process call,
1534 * contents of the structure is updated
1535 * 0 - Indicates contents of the structure is not updated
1536 * @param num_payload_bytes :Specifies the size of the payload
1537 * @param uuid_iso_iec_11578 :Value specified as a UUID according to the
1538 * procedures of ISO/IEC 11578:1996 Annex A.
1539 * @param user_data_payload_byte :Byte containing data having syntax and
1540 * semantics as specified by the UUID generator.
1541 * @param dataOverflowFlag: This indicates if pay load data is more than the
1542 * array size i.e., IH264VDEC_MAXUSERDATA_PAYLOAD.
1543 ******************************************************************************
1544*/
1545typedef struct IH264VDEC_SeiUserDataUnReg
1546{
1547 XDAS_UInt32 parsed_flag;
1548 XDAS_UInt32 num_payload_bytes;
1549 XDAS_UInt8 uuid_iso_iec_11578[16];
1550 XDAS_UInt8 user_data_payload_byte[IH264VDEC_MAXUSERDATA_PAYLOAD];
1551 XDAS_UInt8 dataOverflowFlag;
1552} IH264VDEC_SeiUserDataUnReg;
1553
1554
1555/**
1556 ******************************************************************************
1557 * @struct IH264VDEC_SeiBufferingPeriod
1558 *
1559 * @brief This structure contains the buffering period SEI msg elements
1560 *
1561 * @param parsed_flag :1 - Indicates that in the current process call,
1562 * contents of the structure is updated
1563 * 0 - Indicates contents of the structure is not updated
1564 * @param seq_parameter_set_id :Specifies the sequence parameter set that
1565 * contains the sequence HRD attributes
1566 * @param nal_cpb_removal_delay :Specifies the delay for the indexed NAL CPB
1567 * between the time of arrival in the CPB of the first bit of the
1568 * coded data associated with the access unit associated with the
1569 * buffering period SEI message and the time of removal from the CPB
1570 * of the coded data associated with the same access unit, for the
1571 * first buffering period after HRD initialization.
1572 * @param nal_cpb_removal_delay_offset :Used for the indexed NAL CPB in
1573 * combination with the cpb_removal_delay to specify the initial
1574 * delivery time of coded access units to the CPB
1575 * @param vcl_cpb_removal_delay :Specifies the delay for the indexed VCL CPB
1576 * between the time of arrival in the CPB of the first bit of the
1577 * coded data associated with the access unit associated with the
1578 * buffering period SEI message and the time of removal from the CPB
1579 * of the coded data associated with the same access unit, for the
1580 * first buffering period after HRD initialization.
1581 * @param vcl_cpb_removal_delay_offset :Used for the indexed VCL CPB in
1582 * combination with the cpb_removal_delay to specify the initial
1583 * delivery time of coded access units to the CPB
1584 ******************************************************************************
1585*/
1586typedef struct IH264VDEC_SeiBufferingPeriod
1587{
1588 XDAS_UInt32 parsed_flag;
1589 XDAS_UInt32 seq_parameter_set_id;
1590 XDAS_UInt32 nal_cpb_removal_delay[IH264VDEC_MAXCPBCNT];
1591 XDAS_UInt32 nal_cpb_removal_delay_offset[IH264VDEC_MAXCPBCNT];
1592 XDAS_UInt32 vcl_cpb_removal_delay[IH264VDEC_MAXCPBCNT];
1593 XDAS_UInt32 vcl_cpb_removal_delay_offset[IH264VDEC_MAXCPBCNT];
1594}IH264VDEC_SeiBufferingPeriod;
1595/**
1596 ******************************************************************************
1597 * @struct IH264VDEC_SeiPanScanRect
1598 *
1599 * @brief This structure contains the pan scan rectangle SEI msg elements
1600 *
1601 * @param parsed_flag :1 - Indicates that in the current process call,
1602 * contents of the structure is updated
1603 * 0 - Indicates contents of the structure is not updated
1604 * @param pan_scan_rect_id :Specifies an identifying number that may be used
1605 * to identify the purpose of the pan-scan rectangle
1606 * @param pan_scan_rect_cancel_flag :Equal to 1 indicates that the SEI
1607 * message cancels the persistence of any previous pan-scan
1608 * rectangle SEI message in output order.
1609 * pan_scan_rect_cancel_flag equal to 0 indicates that
1610 * pan-scan rectangle information follows.
1611 * @param pan_scan_cnt_minus1 :Specifies the number of pan-scan rectangles
1612 * that are present in the SEI message
1613 * @param pan_scan_rect_left_offset :Specifies as signed integer quantities
1614 * in units of one-sixteenth sample spacing relative to the luma
1615 * sampling grid, the location of the pan-scan rectangle
1616 * @param pan_scan_rect_right_offset :Specifies as signed integer quantities
1617 * in units of one-sixteenth sample spacing relative to the luma
1618 * sampling grid, the location of the pan-scan rectangle
1619 * @param pan_scan_rect_top_offset : Top offset
1620 * @param pan_scan_rect_bottom_offset : Bottom offset
1621 * @param pan_scan_rect_repetition_period :Specifies the persistence of the
1622 * pan-scan rectangle SEI message and may specify a picture order
1623 * count interval within which another pan-scan rectangle SEI message
1624 * with the same value of pan_scan_rect_id or the end of the coded
1625 * video sequence shall be present in the bit-stream
1626 ******************************************************************************
1627*/
1628typedef struct IH264VDEC_SeiPanScanRect
1629{
1630 XDAS_UInt32 parsed_flag;
1631 XDAS_UInt32 pan_scan_rect_id;
1632 XDAS_UInt32 pan_scan_rect_cancel_flag;
1633 XDAS_UInt32 pan_scan_cnt_minus1;
1634 XDAS_Int32 pan_scan_rect_left_offset[3];
1635 XDAS_Int32 pan_scan_rect_right_offset[3];
1636 XDAS_Int32 pan_scan_rect_top_offset[3];
1637 XDAS_Int32 pan_scan_rect_bottom_offset[3];
1638 XDAS_UInt32 pan_scan_rect_repetition_period;
1639} IH264VDEC_SeiPanScanRect;
1640
1641/**
1642 ******************************************************************************
1643 * @struct IH264VDEC_SeiProgRefineStart
1644 *
1645 * @brief This structure contains the progressive refinement start SEI msg
1646 * elements
1647 *
1648 * @param parsed_flag :1 - Indicates that in the current process call,
1649 * contents of the structure is updated
1650 * 0 - Indicates contents of the structure is not updated
1651 * @param progressive_refinement_id :Specifies an identification number for
1652 * the progressive refinement operation.
1653 * @param num_refinement_steps_minus1 :Specifies the number of reference
1654 * frames in the tagged set of consecutive coded pictures
1655 ******************************************************************************
1656*/
1657typedef struct IH264VDEC_SeiProgRefineStart
1658{
1659 XDAS_UInt32 parsed_flag;
1660 XDAS_UInt32 progressive_refinement_id;
1661 XDAS_UInt32 num_refinement_steps_minus1;
1662} IH264VDEC_SeiProgRefineStart;
1663/**
1664 ******************************************************************************
1665 * @struct IH264VDEC_SeiProgRefineEnd
1666 *
1667 * @brief TThis structure contains the progressive refinement end SEI msg
1668 * elements
1669 *
1670 * @param parsed_flag :1 - Indicates that in the current process call,
1671 * contents of the structure is updated
1672 * 0 - Indicates contents of the structure is not updated
1673 * @param progressive_refinement_id :Specifies an identification number for
1674 * the progressive refinement operation.
1675 ******************************************************************************
1676*/
1677typedef struct IH264VDEC_SeiProgRefineEnd
1678{
1679 XDAS_UInt32 parsed_flag;
1680 XDAS_UInt32 progressive_refinement_id;
1681} IH264VDEC_SeiProgRefineEnd;
1682/**
1683 ******************************************************************************
1684 * @struct IH264VDEC_SeiRecoveryPointInfo
1685 *
1686 * @brief This structure contains the sRecovery Point Info SEI msg elements
1687 *
1688 * @param parsed_flag :1 - Indicates that in the current process call,
1689 * contents of the structure is updated
1690 * 0 - Indicates contents of the structure is not updated
1691 * @param exact_match_flag :Indicates whether decoded pictures at and
1692 * subsequent to the specified recovery point in output order derived
1693 * by starting the decoding process at the access unit associated with
1694 * the recovery point SEI message, will be an exact match to the
1695 * pictures that would be produced by starting the decoding process
1696 * at the location of a previous IDR access unit in the NAL unit stream.
1697 * @param recovery_frame_cnt :Specifies the recovery point of output pictures
1698 * in output order
1699 * @param broken_link_flag :Indicates the presence or absence of a broken
1700 * link in the NAL unit stream
1701 * @param changing_slice_group_idc :Indicates whether decoded pictures are
1702 * correct or approximately correct in content at and subsequent to
1703 * the recovery point in output order when all macro-blocks of the
1704 * primary coded pictures are decoded within the changing slice group
1705 * period.
1706 ******************************************************************************
1707*/
1708typedef struct IH264VDEC_SeiRecoveryPointInfo
1709{
1710 XDAS_UInt32 parsed_flag;
1711 XDAS_UInt32 recovery_frame_cnt;
1712 XDAS_UInt32 exact_match_flag;
1713 XDAS_UInt32 broken_link_flag;
1714 XDAS_UInt32 changing_slice_group_idc;
1715} IH264VDEC_SeiRecoveryPointInfo;
1716
1717/**
1718 ******************************************************************************
1719 * @struct IH264VDEC_SeiPictureTiming
1720 *
1721 * @brief This structure contains the picture timing SEI msg elements
1722 *
1723 * @param parsed_flag :1 - Indicates that in the current process call,
1724 * contents of the structure is updated
1725 * 0 - Indicates contents of the structure is not updated
1726 * @param NumClockTs :
1727 * @param cpb_removal_delay :Specifies how many clock ticks to wait after
1728 * removal from the CPB of the access unit associated with the
1729 * most recent buffering period SEI message before removing from
1730 * the buffer the access unit data associated with the picture
1731 * timing SEI message.
1732 * @param dpb_output_delay : Used to compute the DPB output time of the
1733 * picture.
1734 * @param pic_struct : Indicates whether a picture should be displayed as
1735 * a frame or field
1736 * @param clock_time_stamp_flag[4]:1 - Indicates number of clock timestamp
1737 * syntax elements present and follow immediately
1738 * 0 – Indicates associated clock timestamp syntax
1739 * elements not present
1740 * @param ct_type[4] : Indicates the scan type(interlaced or progressive)
1741 * of the source material
1742 * @param nuit_field_based_flag[4] : Used to calculate the clockTimestamp
1743 * @param counting_type[4] : Specifies the method of dropping values of
1744 * n_frames
1745 * @param full_timestamp_flag[4] : 1 - Specifies that the n_frames syntax
1746 * element is followed by seconds_value,
1747 * minutes_value, and hours_value.
1748 * 0 - Specifies that the n_frames syntax
1749 * element is followed by seconds_flag
1750 * @param discontinuity_flag[4] : Indicates whether the difference between
1751 * the current value of clockTimestamp and the value of
1752 * clockTimestamp computed from the previous clockTimestamp in
1753 * output order can be interpreted as the time difference between
1754 * the times of origin or capture of the associated frames or
1755 * fields.
1756 * @param cnt_dropped_flag[4] : Specifies the skipping of one or more
1757 * values of n_frames using the counting method
1758 * @param n_frames[4] : Specifies the value of nFrames used to compute
1759 * clockTimestamp.
1760 * @param seconds_flag[4] : equal to 1 specifies that seconds_value and
1761 * minutes_flag are present when
1762 * full_timestamp_flag is equal to 0.
1763 * @param minutes_flag[4] : equal to 1 specifies that minutes_value and
1764 * hours_flag are present when full_timestamp_flag
1765 * is equal to 0 and seconds_flag is equal to 1.
1766 * @param hours_flag[4] : equal to 1 specifies that hours_value is
1767 * present when full_timestamp_flag is equal to 0
1768 * and seconds_flag is equal to 1 and minutes_flag
1769 * is equal to 1.
1770 * @param seconds_value[4] : Specifies the value of sS used to compute
1771 * clockTimestamp.
1772 * @param minutes_value[4] : Specifies the value of mM used to compute
1773 * clockTimestamp.
1774 * @param hours_value[4] : Specifies the value of tOffset used to compute
1775 * clockTimestamp
1776 * @param time_offset[4] : Specifies the value of tOffset used to compute
1777 * clockTimestamp
1778 ******************************************************************************
1779*/
1780typedef struct IH264VDEC_SeiPictureTiming
1781{
1782 XDAS_UInt32 parsed_flag;
1783 XDAS_UInt32 NumClockTs;
1784 XDAS_UInt32 cpb_removal_delay;
1785 XDAS_UInt32 dpb_output_delay;
1786 XDAS_UInt32 pic_struct;
1787 XDAS_UInt32 clock_time_stamp_flag[4];
1788 XDAS_UInt32 ct_type[4];
1789 XDAS_UInt32 nuit_field_based_flag[4];
1790 XDAS_UInt32 counting_type[4];
1791 XDAS_UInt32 full_timestamp_flag[4];
1792 XDAS_UInt32 discontinuity_flag[4];
1793 XDAS_UInt32 cnt_dropped_flag[4];
1794 XDAS_UInt32 n_frames[4];
1795 XDAS_UInt32 seconds_flag[4];
1796 XDAS_UInt32 minutes_flag[4];
1797 XDAS_UInt32 hours_flag[4];
1798 XDAS_UInt32 seconds_value[4];
1799 XDAS_UInt32 minutes_value[4];
1800 XDAS_UInt32 hours_value[4];
1801 XDAS_Int32 time_offset[4];
1802}IH264VDEC_SeiPictureTiming;
1803/**
1804 ******************************************************************************
1805 * @struct IH264VDEC_SeiFullFrameFreezeRep
1806 *
1807 * @brief This structure contains the full frmae freeze repetition SEI msg
1808 * elements
1809 *
1810 * @param parsed_flag :1 - Indicates that in the current process call,
1811 * contents of the structure is updated
1812 * 0 - Indicates contents of the structure is not updated
1813 * @param full_frame_freeze_repetition_period :Specifies the persistence of
1814 * the full-frame freeze SEI message
1815 ******************************************************************************
1816*/
1817typedef struct IH264VDEC_SeiFullFrameFreezeRep
1818{
1819 XDAS_UInt32 parsed_flag;
1820 XDAS_UInt32 full_frame_freeze_repetition_period;
1821} IH264VDEC_SeiFullFrameFreezeRep;
1822
1823/**
1824 ******************************************************************************
1825 * @struct IH264VDEC_SeiFullFrameFreezeRel
1826 *
1827 * @brief This structure contains frame freeze release SEI msg elements
1828 *
1829 * @param parsed_flag :1 - Indicates that in the current process call,
1830 * contents of the structure is updated
1831 * 0 - Indicates contents of the structure is not updated
1832 * @param payloadSize : Size of the frame_freeze_release payload
1833 ******************************************************************************
1834*/
1835typedef struct IH264VDEC_SeiFullFrameFreezeRel
1836{
1837 XDAS_UInt32 parsed_flag;
1838 XDAS_UInt32 payloadSize;
1839} IH264VDEC_SeiFullFrameFreezeRel;
1840
1841/**
1842 ******************************************************************************
1843 * @struct IH264VDEC_SeiStereoVideoInfo
1844 *
1845 * @brief This structure contains stereo video information SEI msg elements
1846 *
1847 * @param parsed_flag :1 - Indicates that in the current process call,
1848 * contents of the structure is updated
1849 * 0 - Indicates contents of the structure is not updated
1850 * @param field_views_flag : 1 - indicates that all pictures in the current
1851 * coded video sequence are fields
1852 * 0 - indicates that all pictures in the current
1853 * coded video sequence are frames.
1854 * @param top_field_is_left_view_flag :
1855 * 1 - top field is a left view.
1856 * 0 - topfield is right view.
1857 * @param current_frame_is_left_view_flag :
1858 * 1 - current frame is left view.
1859 * 0 - current frame is right view.
1860 * @param next_frame_is_second_view_flag :
1861 * 1 - current picture and a next picture in
1862 * output order form a stereo video pair.
1863 * 0 - current picture and a previous picture in
1864 * output order form a stereo video pair.
1865 * @param left_view_self_contained_flag :
1866 * 1 - it will not use right view as a reference
1867 * picture for inter prediction
1868 * 0 - it may use right view as a reference
1869 * picture for inter prediction.
1870 * @param right_view_self_contained_flag :
1871 * 1 - it will not use left view as a reference
1872 * picture for inter prediction
1873 * 0 - it may use left view as a reference
1874 * picture for inter prediction.
1875 ******************************************************************************
1876*/
1877typedef struct IH264VDEC_SeiStereoVideoInfo
1878{
1879 XDAS_UInt32 parsed_flag;
1880 XDAS_UInt32 field_views_flag;
1881 XDAS_UInt32 top_field_is_left_view_flag;
1882 XDAS_UInt32 current_frame_is_left_view_flag;
1883 XDAS_UInt32 next_frame_is_second_view_flag;
1884 XDAS_UInt32 left_view_self_contained_flag;
1885 XDAS_UInt32 right_view_self_contained_flag;
1886} IH264VDEC_SeiStereoVideoInfo;
1887
1888/**
1889 ******************************************************************************
1890 * @struct IH264VDEC_SeiFramePacking
1891 *
1892 * @brief This structure contains frame packing arrangement SEI msg elements
1893 *
1894 * @param frame_packing_arrangement_id :
1895 * contains an identifying number that may be used to identify
1896 * the usage of the frame packing arrangement SEI message.
1897 * @param frame_packing_arrangement_cancel_flag :
1898 * 1 - equal to 1 indicates that the frame packing arrangement
1899 * SEI message cancels the persistence of any previous frame
1900 * packing arrangement SEI message in output order.
1901 * 0 - indicates that frame packing arrangement info follows
1902 * @param frame_packing_arrangement_type :
1903 * indicates the type of packing arrangement of the frames
1904 * @param quincunx_sampling_flag :
1905 * 1 - indicates that each color component plane of each
1906 * constituent frame is quincunx sampled
1907 * 0 - indicates that each color component plane of each
1908 * constituent frame is not quincunx sampled
1909 * @param content_interpretation_type :
1910 * 1 - frame 0 being associated with the left view and frame 1
1911 * being associated with the right view
1912 * 2 - frame 0 being associated with the right view and frame 1
1913 * being associated with the left view
1914 * @param spatial_flipping_flag :
1915 * 1 - spatial flipping is enabled for any one of the frame
1916 * constituent, if frame_packing_arrangement_type is 3 or 4.
1917 * 0 - spatial flipping is disabled for any one of the frame
1918 * constituent, if frame_packing_arrangement_type is 3 or 4.
1919 * @param frame0_flipped_flag :
1920 * 1 - frame 0 is spatially flipped
1921 * 0 - frame 1 is spatially flipped
1922 * @param field_views_flag :
1923 * 1 - indicates that all pictures in the current coded video
1924 * sequence are coded as complementary field pairs.
1925 * 0 - indicates that all pictures in the current coded video
1926 * sequence are coded as frame.
1927 * @param current_frame_is_frame0_flag :
1928 * 1 - indicates that the current decoded frame is constituent
1929 * frame 0 and the next decoded frame in output order
1930 * is constituent frame 1.
1931 * 0 - indicates that the current decoded frame is constituent
1932 * frame 1 and the next decoded frame in output order
1933 * is constituent frame 0.
1934 * @param frame0_self_contained_flag :
1935 * 1 - indicates that the constituent frame 0 is dependent on
1936 * constituent frame 1 in decoding process
1937 * 0 - indicates that the constituent frame 0 may dependent on
1938 * constituent frame 1 in decoding process
1939 * @param frame1_self_contained_flag :
1940 * 1 - indicates that the constituent frame 1 is dependent on
1941 * constituent frame 0 in decoding process
1942 * 0 - indicates that the constituent frame 1 may dependent on
1943 * constituent frame 0 in decoding process
1944 * @param frame0_grid_position_x :
1945 * specifies the horizontal location of the upper left
1946 * sample of constituent frame 0 in the units of one
1947 * sixteenth of the luma samples
1948 * @param frame0_grid_position_y :
1949 * specifies the vertical location of the upper left
1950 * sample of constituent frame 0 in the units of one
1951 * sixteenth of the luma samples
1952 * @param frame1_grid_position_x :
1953 * specifies the horizontal location of the upper left
1954 * sample of constituent frame 1 in the units of one
1955 * sixteenth of the luma samples
1956 * @param frame1_grid_position_y :
1957 * specifies the vertical location of the upper left
1958 * sample of constituent frame 1 in the units of one
1959 * sixteenth of the luma samples
1960 * @param frame_packing_arrangement_reserved_byte :
1961 * reserved for the future use.
1962 * @param frame_packing_arrangement_repetition_period :
1963 * specifies the persistence of the frame packing arrangement
1964 * SEI message and may specify a frame order count interval
1965 * within which another frame packing arrangement SEI message
1966 * with the same value of frame_packing_arrangement_id or the
1967 * end of the coded video sequence shall be present in the
1968 * bitstream.
1969 * @param frame_packing_arrangement_extension_flag :
1970 * 0 - indicates that no additional data follows within the
1971 * frame packing arrangement SEI message.
1972 * 1 - Reserved for the future use.
1973 ******************************************************************************
1974*/
1975typedef struct IH264VDEC_SeiFramePacking
1976{
1977 XDAS_UInt32 parsed_flag;
1978 XDAS_UInt32 frame_packing_arrangement_id;
1979 XDAS_UInt32 frame_packing_arrangement_repetition_period;
1980 XDAS_UInt8 frame_packing_arrangement_cancel_flag;
1981 XDAS_UInt8 frame_packing_arrangement_type;
1982 XDAS_UInt8 quincunx_sampling_flag;
1983 XDAS_UInt8 content_interpretation_type;
1984 XDAS_UInt8 spatial_flipping_flag;
1985 XDAS_UInt8 frame0_flipped_flag;
1986 XDAS_UInt8 field_views_flag;
1987 XDAS_UInt8 current_frame_is_frame0_flag;
1988 XDAS_UInt8 frame0_self_contained_flag;
1989 XDAS_UInt8 frame1_self_contained_flag;
1990 XDAS_UInt8 frame0_grid_position_x;
1991 XDAS_UInt8 frame0_grid_position_y;
1992 XDAS_UInt8 frame1_grid_position_x;
1993 XDAS_UInt8 frame1_grid_position_y;
1994 XDAS_UInt8 frame_packing_arrangement_reserved_byte;
1995 XDAS_UInt8 frame_packing_arrangement_extension_flag;
1996} IH264VDEC_SeiFramePacking;
1997
1998
1999/**
2000 ******************************************************************************
2001 * @struct IH264VDEC_SeiMessages
2002 *
2003 * @brief This structure contains all the supported SEI msg objects
2004 *
2005 * @param parsed_flag :1 - Indicates that in the current process call,
2006 * contents of the structure is updated
2007 * 0 - Indicates contents of the structure is not updated
2008 * @param full_frame_freeze : Full-frame freeze SEI message
2009 * @param full_frame_freeze_release :Cancels the effect of any full-frame
2010 * freeze SEI message sent with pictures that precede the current
2011 * picture in the output order.
2012 * @param prog_refine_start :Specifies the beginning of a set of consecutive
2013 * coded pictures that is labeled as the current picture followed
2014 * by a sequence of one or more pictures of refinement of the
2015 * quality of the current picture, rather than as a representation
2016 * of a continually moving scene.
2017 * @param prog_refine_end : Specifies end of progressive refinement.
2018 * @param user_data_registered :Message contains user data registered as
2019 * specified by ITU-T Recommendation T.35
2020 * @param user_data_unregistered :Message contains unregistered user data
2021 * identified by a UUID
2022 * @param buffering_period_info :Message specifies the buffering period
2023 * @param pan_scan_rect :Message specifies the coordinates of a rectangle
2024 * relative to the cropping rectangle of the sequence parameter set
2025 * @param recovery_pt_info :The recovery point SEI message assists a decoder
2026 * in determining when the decoding process will produce acceptable
2027 * pictures for display after the decoder initiates random access or
2028 * after the encoder indicates a broken link in the sequence.
2029 * @param pic_timing :Specifies timing information regarding cpb delays, dpb
2030* output delay, and so on.
2031 * @param stereo_video_info :stereo video information SEI message consist of
2032 * pair of picture forming stereo view content.
2033 ******************************************************************************
2034*/
2035typedef struct IH264VDEC_SeiMessages
2036{
2037 XDAS_UInt32 parsed_flag;
2038 IH264VDEC_SeiFullFrameFreezeRep full_frame_freeze;
2039 IH264VDEC_SeiFullFrameFreezeRel full_frame_freeze_release;
2040 IH264VDEC_SeiProgRefineStart prog_refine_start;
2041 IH264VDEC_SeiProgRefineEnd prog_refine_end;
2042 IH264VDEC_SeiUserDataRegITUT user_data_registered;
2043 IH264VDEC_SeiUserDataUnReg user_data_unregistered;
2044 IH264VDEC_SeiBufferingPeriod buffering_period_info;
2045 IH264VDEC_SeiPanScanRect pan_scan_rect;
2046 IH264VDEC_SeiRecoveryPointInfo recovery_pt_info;
2047 IH264VDEC_SeiPictureTiming pic_timing;
2048 IH264VDEC_SeiStereoVideoInfo stereo_video_info;
2049 IH264VDEC_SeiFramePacking frame_packing;
2050} IH264VDEC_SeiMessages;
2051
2052/**
2053 ******************************************************************************
2054 * @struct IH264VDEC_MbxTraceData
2055 *
2056 * @brief This structure holds the elements that describe the attributes of
2057 * traced data.
2058 *
2059 * @param userId : Indicates whose data getting logged.
2060 * @param message : Indicates the message type that's been used at given
2061 * user ID.
2062 * @param rwMode : Indicates mode in which the MBx is accessed.
2063 * @param rsvd : Reserved byte to add any new attribute in future.
2064 *
2065 ******************************************************************************
2066*/
2067typedef struct IH264VDEC_MbxTraceData
2068{
2069 XDAS_UInt8 userId;
2070 XDAS_UInt8 message;
2071 XDAS_UInt8 rwMode;
2072 XDAS_UInt8 rsvd;
2073}IH264VDEC_MbxTraceData;
2074
2075/**
2076 * Macro to indicate the max number of samples
2077 * that we capture in the log.
2078*/
2079#define NUM_MBX_TRACE_ELEMENTS 300
2080
2081/**
2082 ******************************************************************************
2083 * @struct IH264VDEC_ProfileInfo
2084 *
2085 * @brief This structure contains elements related to profiling information
2086 * This Structure is used to get some codec internal cycles and not
2087 * to be used for any system level profiling.
2088 *
2089 * @param hostPreIva : Cycles spent by M3 before giving control to IVAHD.
2090 * This gives M3 cycles alone that are spent before IVAHD
2091 * starts doing any thing for a given process call.
2092 * @param preMbLoop : Cycles spent before entering MB Loop
2093 * @param inMbLoop : Cycles in the MB Loop
2094 * @param postMbLoop : Cycles spent after the MB Loop execution
2095 * @param hostPostIva : Cycles spent after getting control back to Host from
2096 * IVAHD. This gives M3 cycles alone that are spent
2097 * after IVAHD gives control back to M3
2098 * @param ivahdTotalCycles : Total cycles on IVAHD
2099 * @param sliceTask : per slice cycles spent; Array size set to the stream
2100 * "Combined_CABAC_07_HD_10.1.26l"
2101 * @param noOfSlices : Number of lices in the picture
2102 ******************************************************************************
2103*/
2104typedef struct IH264VDEC_ProfileInfo
2105{
2106 XDAS_UInt32 hostPreIva;
2107 XDAS_UInt32 preMbLoop;
2108 XDAS_UInt32 inMbLoop;
2109 XDAS_UInt32 postMbLoop;
2110 XDAS_UInt32 hostPostIva;
2111 XDAS_UInt32 ivahdTotalCycles;
2112 XDAS_UInt32 sliceTask[136];
2113 XDAS_UInt32 noOfSlices;
2114 IH264VDEC_MbxTraceData mbxTraceArray[NUM_MBX_TRACE_ELEMENTS];
2115 XDAS_UInt16 mbxtraceIdx;
2116} IH264VDEC_ProfileInfo;
2117
2118/**
2119 ******************************************************************************
2120 * @struct _sErrConcealStr
2121 * @brief This str holds up the required Info for implementing the SCV EC,
2122 * this will get updated by H.264 decoder while decoding the SVC
2123 * Base/Target Layers
2124 *
2125 * @param CurrMbInfoBufPointer :Base Address of the current decoded frame
2126 * MB Info buffer
2127 *
2128 * @param CurrMbStatusBufPointer: Base Address of the current decoded frame
2129 * MB staus buffer pointer
2130 *
2131 * @param currFrameY : Base Address of the current decoded Luma
2132 * frame buffer pointer (physical pointer)
2133 *
2134 * @param currFrameUV : Base Address of the current decoded Chroma
2135 * frame buffer pointer (physical pointer)
2136 *
2137 * @param refConclY : Base Address of the ref decoded Luma
2138 * frame buffer pointer (virtual pointer)
2139 *
2140 * @param refConclUV : Base Address of the ref decoded Chroma
2141 * frame buffer pointer (virtual pointer)
2142 *
2143 * @param TilerBaseAddress : TBA vaule for the VDMA
2144 *
2145 * @param pSliceInfoFlags : Flag to enable slice info
2146 *
2147 * @param ref_width : Resultant Horizontal LUMA picture size
2148 * after Pad size addition on both Left
2149 * & Right sides. This gets used as
2150 * stride during vDMA programming.
2151 * In case of TILER,the stride is fixed,
2152 * independant of Picture width, and
2153 * only changes with TILER mode.
2154 *
2155 * @param ref_width_c : Resultant Horizontal CHROMA picture size
2156 * after Pad size addition on both Left &
2157 * Right sides.
2158 *
2159 *
2160 * @param ref_frame_height : In case of Interlaced streams,the picure
2161 * store is different i.e., store each field
2162 * by applying PAD on top & bottom lines.
2163 * Hence the picture height will be Height
2164 * plus four times the Pad size. This
2165 * variable holds this resultant value.
2166 *
2167 * @param mb_width : Picture width in terms of Macroblocks
2168 *
2169 * @param mb_height : Picture height in terms of Macroblocks.
2170 *
2171 * @param image_width : Image width of the decoded frame
2172 *
2173 * @param image_width : Image height of the decoded frame
2174 *
2175 * @param frameType : Frame type of the current frame.
2176 *
2177 * @param picaff_frame : Flag to indicate whether current picture
2178 * is of Frame type & referring to Field
2179 * picture as reference.
2180 *
2181 * @param mb_aff_frame_flag : Flag to indicate whether the current
2182 * decoding picture is MBAFF type.
2183 *
2184 * @param field_pic_flag : Flag to indicate whether the current
2185 * decoding picture is field type.
2186 *
2187 * @param bottom_field_flag : This parameter equal to 1 specifies that
2188 * the slice is part of a coded bottom field.
2189 * bottom_field_flag equalto 0 specifies
2190 * that the picture is a coded top field.
2191 *
2192 * @param nonPairedFieldPic : Flag to indicate Non paired field picture.
2193 *
2194 * @param prev_pic_bottom_field : this variable Indicates if the previous
2195 * picture was a bottom field or not (a Flag)
2196 *
2197 * @param currFrameYDual : Base Address of the current decoded Luma
2198 * frame buffer pointer (physical pointer)
2199 * for dual yuv output.
2200 *
2201 * @param currFrameUVDual : Base Address of the current decoded Chroma
2202 * frame buffer pointer (physical pointer)
2203 * for dual yuv output.
2204 *
2205 * @param ref_widthDual : Resultant Horizontal LUMA picture size
2206 * after Pad size addition on both Left
2207 * & Right sides. This gets used as
2208 * stride during vDMA programming.
2209 * In case of TILER,the stride is fixed,
2210 * independant of Picture width, and
2211 * only changes with TILER mode.
2212 *
2213 * @param ref_width_cDual : Resultant Horizontal CHROMA picture size
2214 * after Pad size addition on both Left &
2215 * Right sides.
2216 *
2217 ******************************************************************************
2218*/
2219
2220typedef struct _sErrConcealStr
2221{
2222 XDAS_Int32 ErrConcealmentEnable;
2223 XDAS_Int32 CurrMbInfoBufPointer;
2224 XDAS_Int32 CurrMbStatusBufPointer;
2225 XDAS_Int32 CurrMbInfoIresBufPointer;
2226 XDAS_Int32 currFrameY;
2227 XDAS_Int32 currFrameUV;
2228 XDAS_Int32 refConclY;
2229 XDAS_Int32 refConclUV;
2230 XDAS_UInt32 TilerBaseAddress;
2231 XDAS_UInt16 ref_width;
2232 XDAS_UInt16 ref_width_c;
2233 XDAS_UInt16 ref_frame_height;
2234 XDAS_UInt16 mb_width;
2235 XDAS_UInt16 mb_height;
2236 XDAS_UInt16 image_width;
2237 XDAS_UInt16 image_height;
2238 XDAS_UInt8 frameType;
2239 XDAS_UInt8 picaff_frame;
2240 XDAS_UInt8 mb_aff_frame_flag;
2241 XDAS_UInt8 field_pic_flag;
2242 XDAS_UInt8 bottom_field_flag;
2243 XDAS_UInt8 nonPairedFieldPic;
2244 XDAS_UInt8 prev_pic_bottom_field;
2245 XDAS_Int32 currFrameYDual;
2246 XDAS_Int32 currFrameUVDual;
2247 XDAS_UInt16 ref_widthDual;
2248 XDAS_UInt16 ref_width_cDual;
2249 XDAS_UInt16 rsvd[2];
2250}sErrConcealStr;
2251
2252/**
2253 * Size of sliceinfo flags - We have two slice info flag arrays in SL2, one
2254 * for ECD3 and the other for MC3. ECD3 flag is one bit per MB. Since Maximum
2255 * supported number of MBs in a frame for Low resolution is 128 x 128 = 16384,
2256 * and for High resolution 270*256 = 69120. So we need 16384/8 = 2048 bytes
2257 * for Low resolution and 69120/8 = 8640 for High resolution to store slice
2258 * info flag array for ECD3. But for the MC3 array, we always make the next
2259 * bit also as 1 to enable loading into ping and pong memories of MCBUF.
2260 * So we need an extra bit for the MC3 array, to avoid buffer overflow when
2261 * the last MB is a new slice. To keep the next SL2 buffer in 16-byte aligned
2262 * position (some buffers need it) we round the size to next multiple of 16,
2263 * i.e., 2064 and 8656 for Low and High resolutions respectively.
2264 * As we are maintaining only one decoder image in M3, we define
2265 * SLICEINFO_FLAGSIZE as 8656 (maximum among 2064 and 8656).
2266*/
2267#define SLICEINFO_FLAGSIZE_HIGHRES 8656
2268#define SLICEINFO_FLAGSIZE_LOWRES 2064
2269
2270/**
2271 ******************************************************************************
2272 * @struct _sErrConcealLayerStr
2273 * @brief This str holds up the required Info for implementing the SCV EC,
2274 * this will get updated by H.264 decoder while decoding the SVC
2275 * Base/Target Layers
2276 *
2277 * @param svcEcStr : structure instance of sSVCErrConcealStr
2278 *
2279 * @param pSliceInfoFlags : Array to store the sliceInfo flag
2280 *
2281 *
2282 ******************************************************************************
2283*/
2284typedef struct _sErrConcealLayerStr
2285{
2286 sErrConcealStr sECStr;
2287 XDAS_UInt8 pSliceInfoFlags[SLICEINFO_FLAGSIZE_HIGHRES];
2288}sErrConcealLayerStr;
2289
2290/**
2291 ******************************************************************************
2292 * @enum IH264VDEC_dpbNumFrames
2293 * @brief This enum can be used to choose the DPB Size in number
2294 * number of frames.
2295 * @details
2296 ******************************************************************************
2297*/
2298typedef enum
2299{
2300 IH264VDEC_DPB_NUMFRAMES_AUTO = -1,
2301 /**<
2302 * Allow the decoder to choose the number of reference frames based on the
2303 * stream information.
2304 */
2305 IH264VDEC_DPB_NUMFRAMES_0 = 0,
2306 /**<
2307 * Number of frames required is 0
2308 */
2309 IH264VDEC_DPB_NUMFRAMES_1 = 1,
2310 /**<
2311 * Number of frames required is 1
2312 */
2313 IH264VDEC_DPB_NUMFRAMES_2 = 2,
2314 /**<
2315 * Number of frames required is 2
2316 */
2317 IH264VDEC_DPB_NUMFRAMES_3 = 3,
2318 /**<
2319 * Number of frames required is 3
2320 */
2321 IH264VDEC_DPB_NUMFRAMES_4 = 4,
2322 /**<
2323 * Number of frames required is 4
2324 */
2325 IH264VDEC_DPB_NUMFRAMES_5 = 5,
2326 /**<
2327 * Number of frames required is 5
2328 */
2329 IH264VDEC_DPB_NUMFRAMES_6 = 6,
2330 /**<
2331 * Number of frames required is 6
2332 */
2333 IH264VDEC_DPB_NUMFRAMES_7 = 7,
2334 /**<
2335 * Number of frames required is 7
2336 */
2337 IH264VDEC_DPB_NUMFRAMES_8 = 8,
2338 /**<
2339 * Number of frames required is 8
2340 */
2341 IH264VDEC_DPB_NUMFRAMES_9 = 9,
2342 /**<
2343 * Number of frames required is 9
2344 */
2345 IH264VDEC_DPB_NUMFRAMES_10 = 10,
2346 /**<
2347 * Number of frames required is 10
2348 */
2349 IH264VDEC_DPB_NUMFRAMES_11 = 11,
2350 /**<
2351 * Number of frames required is 11
2352 */
2353 IH264VDEC_DPB_NUMFRAMES_12 = 12,
2354 /**<
2355 * Number of frames required is 12
2356 */
2357 IH264VDEC_DPB_NUMFRAMES_13 = 13,
2358 /**<
2359 * Number of frames required is 13
2360 */
2361 IH264VDEC_DPB_NUMFRAMES_14 = 14,
2362 /**<
2363 * Number of frames required is 14
2364 */
2365 IH264VDEC_DPB_NUMFRAMES_15 = 15,
2366 /**<
2367 * Number of frames required is 15
2368 */
2369 IH264VDEC_DPB_NUMFRAMES_16 = 16,
2370 /**<
2371 * Number of frames required is 16
2372 */
2373 IH264VDEC_DPB_NUMFRAMES_DEFAULT = IH264VDEC_DPB_NUMFRAMES_AUTO
2374 /**<
2375 * Allow the decoder to choose the number of reference frames based on the
2376 * stream information.
2377 */
2378} IH264VDEC_dpbNumFrames;
2379
2380/**
2381 ******************************************************************************
2382 * @enum IH264VDEC_SVCErrConcealMode
2383 * @brief Describes the error concealment mode ID for SVC codec
2384 * This enumeration type is used by svc app to specify codec
2385 * to concealment mode
2386 *
2387 ******************************************************************************
2388*/
2389
2390typedef enum
2391{
2392 IH264VDEC_SETERRCONCEALMODE = 15
2393 /** SVC error concealment mode ID
2394 *
2395 */
2396} IH264VDEC_SVCErrConcealMode;
2397
2398/**
2399 ******************************************************************************
2400 * @struct IH264VDEC_TI_CommonInfo
2401 *
2402 * @brief
2403 *
2404 ******************************************************************************
2405*/
2406typedef struct _IH264VDEC_TI_CommonInfo
2407{
2408 XDAS_UInt32 codec_type:8;
2409 XDAS_UInt32 fmt_type:8;
2410 XDAS_UInt32 mb_ll_avail:1;
2411 XDAS_UInt32 mb_ul_avail:1;
2412 XDAS_UInt32 mb_uu_avail:1;
2413 XDAS_UInt32 mb_ur_avail:1;
2414 XDAS_UInt32 pic_bound_l:1;
2415 XDAS_UInt32 pic_bound_u:1;
2416 XDAS_UInt32 pic_bound_r:1;
2417 XDAS_UInt32 pic_bound_b:1;
2418 XDAS_UInt32 first_mb_flag:1;
2419 XDAS_UInt32 error_flag:1;
2420 XDAS_UInt32 zero:6;
2421 XDAS_UInt32 zeroes:16;
2422 XDAS_UInt32 mb_addr:16;
2423
2424} IH264VDEC_TI_CommonInfo;
2425
2426/**
2427 ******************************************************************************
2428 * @struct IH264VDEC_TI_MotionVector
2429 *
2430 * @brief
2431 *
2432 ******************************************************************************
2433*/
2434typedef struct _IH264VDEC_TI_MotionVector
2435{
2436 XDAS_Int16 x;
2437 XDAS_Int16 y;
2438} IH264VDEC_TI_MotionVector;
2439
2440/**
2441 ******************************************************************************
2442 * @struct IH264VDEC_TI_CabacContext
2443 *
2444 * @brief
2445 *
2446 ******************************************************************************
2447*/
2448typedef struct _IH264VDEC_TI_CabacContext
2449{
2450 IH264VDEC_TI_MotionVector mvd_l0[4];
2451 IH264VDEC_TI_MotionVector mvd_l1[4];
2452
2453} IH264VDEC_TI_CabacContext;
2454
2455/**
2456 ******************************************************************************
2457 * @struct IH264VDEC_TI_TotalCoefLuma
2458 *
2459 * @brief
2460 *
2461 ******************************************************************************
2462*/
2463typedef struct _IH264VDEC_TI_TotalCoefLuma
2464{
2465 XDAS_UInt8 right[3];
2466 XDAS_UInt8 bottom_right;
2467 XDAS_UInt8 bottom[3];
2468 XDAS_UInt8 zero;
2469} IH264VDEC_TI_TotalCoefLuma;
2470
2471/**
2472 ******************************************************************************
2473 * @struct IH264VDEC_TI_TotalCoefChroma
2474 *
2475 * @brief
2476 *
2477 ******************************************************************************
2478*/
2479typedef struct _IH264VDEC_TI_TotalCoefChroma
2480{
2481 XDAS_UInt8 right_cb;
2482 XDAS_UInt8 bottom_right_cb;
2483 XDAS_UInt8 bottom_cb;
2484 XDAS_UInt8 zero;
2485 XDAS_UInt8 right_cr;
2486 XDAS_UInt8 bottom_right_cr;
2487 XDAS_UInt8 bottom_cr;
2488 XDAS_UInt8 zero1;
2489} IH264VDEC_TI_TotalCoefChroma;
2490
2491/**
2492 ******************************************************************************
2493 * @struct IH264VDEC_TI_CavlcContext
2494 *
2495 * @brief
2496 *
2497 ******************************************************************************
2498*/
2499typedef struct _IH264VDEC_TI_CavlcContext
2500{
2501 unsigned long long zeroes[2];
2502 IH264VDEC_TI_TotalCoefLuma total_coef_luma;
2503 IH264VDEC_TI_TotalCoefChroma total_coef_chroma;
2504
2505} IH264VDEC_TI_CavlcContext;
2506
2507/**
2508 ******************************************************************************
2509 * @struct IH264VDEC_TI_IntraPredMode
2510 *
2511 * @brief
2512 *
2513 ******************************************************************************
2514*/
2515typedef struct _IH264VDEC_TI_IntraPredMode
2516{
2517 XDAS_UInt32 ipred_mode0:4;
2518 XDAS_UInt32 ipred_mode1:4;
2519 XDAS_UInt32 ipred_mode2:4;
2520 XDAS_UInt32 ipred_mode3:4;
2521 XDAS_UInt32 ipred_mode4:4;
2522 XDAS_UInt32 ipred_mode5:4;
2523 XDAS_UInt32 ipred_mode6:4;
2524 XDAS_UInt32 ipred_mode7:4;
2525 XDAS_UInt32 ipred_mode8:4;
2526 XDAS_UInt32 ipred_mode9:4;
2527 XDAS_UInt32 ipred_mode10:4;
2528 XDAS_UInt32 ipred_mode11:4;
2529 XDAS_UInt32 ipred_mode12:4;
2530 XDAS_UInt32 ipred_mode13:4;
2531 XDAS_UInt32 ipred_mode14:4;
2532 XDAS_UInt32 ipred_mode15:4;
2533
2534} IH264VDEC_TI_IntraPredMode;
2535
2536
2537/**
2538 ******************************************************************************
2539 * @struct IH264VDEC_TI_MbPredType
2540 *
2541 * @brief
2542 *
2543 ******************************************************************************
2544*/
2545typedef struct _IH264VDEC_TI_MbPredType
2546{
2547 XDAS_UInt32 mbskip:1;
2548 XDAS_UInt32 tr8x8:1;
2549 XDAS_UInt32 mb_field:1;
2550 XDAS_UInt32 cond_mbskip:1;
2551 XDAS_UInt32 c_ipred_mode:2;
2552 XDAS_UInt32 zero:1;
2553 XDAS_UInt32 end_of_slice:1;
2554 XDAS_UInt32 mb_y_mod2:1;
2555 XDAS_UInt32 zero1:7;
2556 XDAS_UInt32 refidx_equal_flag_l0:1;
2557 XDAS_UInt32 refidx_equal_flag_l1:1;
2558 XDAS_UInt32 mv_equal_flag_l0:1;
2559 XDAS_UInt32 mv_equal_flag_l1:1;
2560 XDAS_UInt32 zeroes:4;
2561 XDAS_UInt32 mb_type:8;
2562 XDAS_UInt8 sub_mb_type[4];
2563
2564} IH264VDEC_TI_MbPredType;
2565
2566/**
2567 ******************************************************************************
2568 * @struct IH264VDEC_TI_QpCbp
2569 *
2570 * @brief
2571 *
2572 ******************************************************************************
2573*/
2574typedef struct _IH264VDEC_TI_QpCbp
2575{
2576 XDAS_UInt32 cbp;
2577 XDAS_UInt8 qp_y;
2578 XDAS_UInt8 qp_cb;
2579 XDAS_UInt8 qp_cr;
2580 XDAS_UInt8 zero;
2581} IH264VDEC_TI_QpCbp;
2582
2583/**
2584 ******************************************************************************
2585 * @struct IH264VDEC_TI_RefPicControl
2586 *
2587 * @brief
2588 *
2589 ******************************************************************************
2590*/
2591typedef struct _IH264VDEC_TI_RefPicControl
2592{
2593 XDAS_UInt8 refidx[4];
2594 XDAS_UInt8 refpicid[4];
2595
2596} IH264VDEC_TI_RefPicControl;
2597
2598/**
2599 ******************************************************************************
2600 * @struct IH264VDEC_TI_MvBidirectional16
2601 *
2602 * @brief
2603 *
2604 ******************************************************************************
2605*/
2606typedef struct _IH264VDEC_TI_MvBidirectional16
2607{
2608 IH264VDEC_TI_MotionVector mv_forward[16];
2609 IH264VDEC_TI_MotionVector mv_backward[16];
2610} IH264VDEC_TI_MvBidirectional16;
2611
2612
2613/**
2614 ******************************************************************************
2615 * @struct IH264VDEC_TI_MvBidirectional4
2616 *
2617 * @brief
2618 *
2619 ******************************************************************************
2620*/
2621typedef struct _IH264VDEC_TI_MvBidirectional4
2622{
2623 IH264VDEC_TI_MotionVector mv_forward[4];
2624 IH264VDEC_TI_MotionVector mv_backward[4];
2625
2626} IH264VDEC_TI_MvBidirectional4;
2627
2628/**
2629 ******************************************************************************
2630 * @struct IH264VDEC_TI_MbInfo
2631 *
2632 * @brief This structure details the data format for MB information shared to
2633 * application. This helps application to understand all fields
2634 * the way codec uses MB info internally. This structure is of size
2635 * 208 Bytes.
2636 *
2637 * @param info : This elements gives details about the MB placement in the
2638 * frame.
2639 *
2640 * @param cabac: This field holds the context data for a CABAC coded MB
2641 *
2642 * @param cavlc: This field holds the context data for a CAVLC coded MB
2643 *
2644 * @param ipred_mode: This field holds information of intra prediction modes
2645 * at 4x4 level, for intra coded MB.
2646 *
2647 * @param mb_pred_type: This indicates prediction specific details for inter
2648 * coded MB
2649 *
2650 * @param qp_cbp: This gives coded & QP informations for both LUMA & CHROMA
2651 * components of a Macro Block.
2652 *
2653 * @param l0_ref_pic_control: Informs all details about reference indices
2654 * at 8x8 block level in L0 direction
2655 *
2656 * @param l1_ref_pic_control: Informs all details about reference indices
2657 * at 8x8 block level in L1 direction
2658 *
2659 * @param mv_forward: Lists all Motion vectors at 4x4 level in L0 direction
2660 *
2661 * @param bidirectional16: Lists all Motion vectors at 4x4 level in both
2662 * directions
2663 *
2664 * @param bidirectional4: Lists all Motion vectors at 8x8 level in both
2665 * directions
2666 *
2667 ******************************************************************************
2668*/
2669typedef struct _IH264VDEC_TI_MbInfo
2670{
2671 IH264VDEC_TI_CommonInfo info;
2672
2673 union {
2674 IH264VDEC_TI_CabacContext cabac;
2675 IH264VDEC_TI_CavlcContext cavlc;
2676 } IH264VDEC_TI_context;
2677
2678 IH264VDEC_TI_IntraPredMode ipred_mode;
2679 IH264VDEC_TI_MbPredType mb_pred_type;
2680 IH264VDEC_TI_QpCbp qp_cbp;
2681 IH264VDEC_TI_RefPicControl l0_ref_pic_control;
2682 IH264VDEC_TI_RefPicControl l1_ref_pic_control;
2683
2684 union {
2685 IH264VDEC_TI_MotionVector mv_forward[16];
2686 IH264VDEC_TI_MvBidirectional16 bidirectional16;
2687 IH264VDEC_TI_MvBidirectional4 bidirectional4;
2688 } IH264VDEC_TI_motion_vecs;
2689
2690} IH264VDEC_TI_MbInfo;
2691
2692#endif /* IH264VDEC_ */
diff --git a/packages/ivahd_codecs/ti/sdo/codecs/jpegvdec/ijpegvdec.h b/packages/ivahd_codecs/ti/sdo/codecs/jpegvdec/ijpegvdec.h
new file mode 100644
index 0000000..bea0d1c
--- /dev/null
+++ b/packages/ivahd_codecs/ti/sdo/codecs/jpegvdec/ijpegvdec.h
@@ -0,0 +1,587 @@
1/*
2********************************************************************************
3* HDVICP2.0 Based JPEG Decoder
4*
5* "HDVICP2.0 Based JPEG Decoder" is software module developed on
6* TI's HDVICP2 based SOCs. This module is capable of generating a raw image
7* by de-compressing/decoding a jpeg bit-stream based on ISO/IEC IS 10918-1.
8* Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
9* ALL RIGHTS RESERVED
10********************************************************************************
11*/
12
13/**
14********************************************************************************
15* @file ijpegvdec.h
16*
17* @brief This file provides definisions for the interface handles.
18*
19* @author Odanaka
20*
21* @version 0.0 (Dec 2008) : Created the initial version.
22*
23* @version 0.1 (Dec 2009) : Added extended dynamic paramters[Chetan]
24*
25* @version 0.2 (Feb 2010) : Coding Guidelines[Chetan]
26*
27* @version 0.3 (July 2010) : Added Error Robustness Error Codes[Chetan]
28*
29* @version 0.4 (Sept 2010) : Added Error Robustness Error Codes for Data Sync
30* [Chetan]
31*
32* @version 0.5 (Nov 2010) : Added support for Slice level decoding[Chetan]
33*
34* @version 0.6 (Feb 2011) : Added error codes for unsupported features [Chetan]
35*
36* @version 0.7 (Sep 2011) : Exposed default static/dynamic params [Naidu]
37*
38* @version 0.8 (Sep 2011) : Added error codes for un-supported resolutions
39* [Naidu]
40*
41* @version 0.9 (Oct 2012) : Added parameter rangeReduction in extended Dynamic
42* parameters to support Limited Pixel range feature.
43* [Santoshkumar S K]
44*
45* @version 1.0 (Mar 2013) : Added support for slice switch + input datasync
46* [Veeranna/Chetan]
47*******************************************************************************
48*/
49
50/*----------------------compilation control switches -------------------------*/
51#ifndef _IJPEGVDEC_
52#define _IJPEGVDEC_
53
54/*******************************************************************************
55* INCLUDE FILES
56*******************************************************************************/
57/* -------------------- system and platform files ----------------------------*/
58#include <ti/xdais/xdas.h>
59#include <ti/xdais/ialg.h>
60#include <ti/xdais/dm/ividdec3.h>
61#include <ti/xdais/ires.h>
62#include <ti/sdo/fc/ires/hdvicp/ires_hdvicp2.h>
63
64/*----------------------program files ----------------------------------------*/
65
66/*******************************************************************************
67* PUBLIC DECLARATIONS Defined here, used elsewhere
68*******************************************************************************/
69/*-----------------------data declarations -----------------------------------*/
70
71
72/**
73*******************************************************************************
74* @enum ethumbnailMode
75*
76* @brief Enumerator which defines all the different types of thumbnail
77* supported.
78*
79* @remarks IJPEGVDEC_THUMBNAIL_JFIF : Decode and output thumbnail
80* available with JFIF marker
81*
82* @remarks IJPEGVDEC_THUMBNAIL_EXIF : Decode and output thumbnail
83* available with EXIF marker
84*
85* @remarks IJPEGVDEC_THUMBNAIL_DOWNSAMPLE : Decode the image and
86* downsample it toprovide it as thumbnail output
87*
88*******************************************************************************
89*/
90typedef enum {
91 IJPEGVDEC_THUMBNAIL_JFIF = 1,
92 IJPEGVDEC_THUMBNAIL_EXIF = 2,
93 IJPEGVDEC_THUMBNAIL_DOWNSAMPLE = 3
94}ethumbnailMode;
95
96/**
97*******************************************************************************
98* @enum edownSamplingFactor
99*
100* @brief Enumerator which defines the factor with which the downsampling
101* needs to be carried out. This applies to both Horizontal
102* and vertical dimentions
103*
104* @remarks IJPEGVDEC_NODOWNSAMPLE : No Down Sample.
105*
106* @remarks IJPEGVDEC_DOWNSAMPLEBY2 : Downscale by 2
107*
108* @remarks IJPEGVDEC_DOWNSAMPLEBY4 : Downscale by 4
109*
110*
111*******************************************************************************
112*/
113typedef enum {
114 IJPEGVDEC_NODOWNSAMPLE = 1,
115 IJPEGVDEC_DOWNSAMPLEBY2 = 2,
116 IJPEGVDEC_DOWNSAMPLEBY4 = 4
117} edownSamplingFactor;
118
119/**
120*******************************************************************************
121* @enum eFrameErrorConcealment
122*
123* @brief Enumerator which defines values to ENABLE or DISABLE
124* Error Concealment
125*
126* @remarks IJPEGVDEC_EC_DISABLE : Disable Error concealment
127*
128* @remarks IJPEGVDEC_EC_ENABLE : Enable Error Concealment
129*
130*
131*******************************************************************************
132*/
133typedef enum {
134 IJPEGVDEC_EC_DISABLE = 0,
135 IJPEGVDEC_EC_ENABLE
136}eFrameErrorConcealment;
137
138/**
139*******************************************************************************
140* @struct IJPEGVDEC_Fxns
141*
142* @brief This structure defines all of the operations on jpgVDEC objects.
143*
144* @param ividdec : handle to the all function of the operations
145* on IVIDDEC3 objects
146*
147*******************************************************************************
148*/
149typedef struct {
150 IVIDDEC3_Fxns ividdec;
151} IJPEGVDEC_Fxns;
152
153/**
154*******************************************************************************
155* @struct IJPEGVDEC_Obj
156*
157* @brief This structure must be the first field of all jpgVDEC instance
158* objects
159*
160* @param fxns : Handle to extented jpeg video decoder library interface
161* functions
162*
163*******************************************************************************
164*/
165typedef struct {
166 IJPEGVDEC_Fxns *fxns;
167} IJPEGVDEC_Obj;
168
169/**
170*******************************************************************************
171* @struct IJPEGVDEC_Handle
172*
173* @brief This handle is used to reference all jpgVDEC instance objects
174*
175*******************************************************************************
176*/
177typedef IJPEGVDEC_Obj *IJPEGVDEC_Handle;
178
179/**
180*******************************************************************************
181* @struct IJPEGVDEC_Status
182*
183* @brief Status structure defines the parameters that can be changed or
184* read during real-time operation of the alogrithm.
185*
186* @param viddecStatus : Handle to base class status struture which defines
187* the all run time parameters.
188*
189* @param extendedErrorCode0 : Extended Error Code0 returned by decoder
190*
191* @param extendedErrorCode1 : Extended Error Code1 returned by decoder
192*
193* @param extendedErrorCode2 : Extended Error Code2 returned by decoder
194*
195* @param extendedErrorCode3 : Extended Error Code3 returned by decoder
196*
197* @param debugTraceLevel : DebugTrace level being used by decoder
198*
199* @param lastNFramesToLog : Number of frames of debug data decoder is
200* dumping trace buffer
201*
202* @param extMemoryDebugTraceAddr : Trace buffer base address in external memory
203*
204* @param extMemoryDebugTraceSize : Size of Trace buffer in external memory
205*
206*******************************************************************************
207*/
208typedef struct {
209 /*--------------------------------------------------------------------------*/
210 /*Base Class */
211 /*--------------------------------------------------------------------------*/
212 IVIDDEC3_Status viddecStatus;
213
214 /*--------------------------------------------------------------------------*/
215 /*Extended Error Code0 returned by decoder */
216 /*--------------------------------------------------------------------------*/
217 XDAS_UInt32 extendedErrorCode0;
218
219 /*--------------------------------------------------------------------------*/
220 /*Extended Error Code1 returned by decoder */
221 /*--------------------------------------------------------------------------*/
222 XDAS_UInt32 extendedErrorCode1;
223
224 /*--------------------------------------------------------------------------*/
225 /*Extended Error Code2 returned by decoder */
226 /*--------------------------------------------------------------------------*/
227 XDAS_UInt32 extendedErrorCode2;
228
229 /*--------------------------------------------------------------------------*/
230 /*Extended Error Code3 returned by decoder */
231 /*--------------------------------------------------------------------------*/
232 XDAS_UInt32 extendedErrorCode3;
233
234 /*--------------------------------------------------------------------------*/
235 /*DebugTrace level being used by decoder */
236 /*--------------------------------------------------------------------------*/
237 XDAS_UInt32 debugTraceLevel;
238
239 /*--------------------------------------------------------------------------*/
240 /*Number of frames of debug data decoder is dumping trace buffer */
241 /*--------------------------------------------------------------------------*/
242 XDAS_UInt32 lastNFramesToLog;
243
244 /*--------------------------------------------------------------------------*/
245 /* Trace buffer base address in external memory */
246 /*--------------------------------------------------------------------------*/
247 XDAS_UInt32 *extMemoryDebugTraceAddr;
248
249 /*--------------------------------------------------------------------------*/
250 /* Size of Trace buffer in external memory */
251 /*--------------------------------------------------------------------------*/
252 XDAS_UInt32 extMemoryDebugTraceSize;
253
254} IJPEGVDEC_Status;
255
256/**
257*******************************************************************************
258* @struct IJPEGVDEC_Cmd
259*
260* @brief The Cmd enumeration defines the control commands for the JPEG
261* video decoder control method.
262*
263*******************************************************************************
264*/
265typedef IVIDDEC3_Cmd IJPEGVDEC_Cmd;
266
267/**
268*******************************************************************************
269* @struct IJPEGVDEC_Params
270*
271* @brief This structure defines the creation parameters for all
272* jpgVDEC objects
273*
274* @param viddecParams : Defines the creation time parameters for
275* all IVIDDEC3 instance objects.
276*
277* @param ErrorConcealmentON : Enable/Disable Error Concealment
278*
279* @param debugTraceLevel : Enable/Disable Error Concealment
280*
281* @param lastNFramesToLog : Number of frames to log history for debugTrace
282*
283* @param sliceSwitchON : ENABLE/DISABLE Slice Switching feature.
284*
285* @param numSwitchPerFrame : Number of Switches in a Frame.
286*
287* @param numRestartMarkerPerSwitch : Number of Restart Marker(slices) to
288* decode in one process call or in one switch.
289*
290*******************************************************************************
291*/
292typedef struct {
293 /*--------------------------------------------------------------------------*/
294 /*Base Class */
295 /*--------------------------------------------------------------------------*/
296 IVIDDEC3_Params viddecParams;
297
298 /*--------------------------------------------------------------------------*/
299 /*Enable/Disable Error Concealment */
300 /* enumeration 'eFrameErrorConcealment' can be used to set this value */
301 /*--------------------------------------------------------------------------*/
302 XDAS_Int32 ErrorConcealmentON;
303
304 /*--------------------------------------------------------------------------*/
305 /*Debug trace Level */
306 /*--------------------------------------------------------------------------*/
307 XDAS_UInt32 debugTraceLevel;
308
309 /*--------------------------------------------------------------------------*/
310 /*Number of frames to log history for debugTrace */
311 /*--------------------------------------------------------------------------*/
312 XDAS_UInt32 lastNFramesToLog;
313
314 /*--------------------------------------------------------------------------*/
315 /* ENABLE/DISABLE Slice Switching feature. */
316 /* enumeration 'eSliceSwitch' can be used to set this value */
317 /*--------------------------------------------------------------------------*/
318 XDAS_UInt32 sliceSwitchON;
319
320 /*--------------------------------------------------------------------------*/
321 /* Number of Switches in a Frame. This is valid only when sliceSwitchON is */
322 /* enabled , when disabled , its dont care. */
323 /* Application tells how many switches should happen in a frame , codec has */
324 /* to decide how to handle each process call ( how many slices) and it has */
325 /* process "numSwitchInFrame " process calls only */
326 /*--------------------------------------------------------------------------*/
327 XDAS_UInt32 numSwitchPerFrame;
328
329 /*--------------------------------------------------------------------------*/
330 /* Application tells a number meaning codec has to decode this much slices */
331 /* or restart markers and come out of process call. Here each switch can */
332 /*have N number of restart marker ( N should be greater than or equal to 1).*/
333 /* Once codec process call is done , application will give again the next */
334 /* number and application will handle till all the slices in the frame have */
335 /* been decoded. */
336 /* This paramter is valid only when "sliceSwitchON" is enabled */
337 /*--------------------------------------------------------------------------*/
338 XDAS_UInt32 numRestartMarkerPerSwitch;
339
340} IJPEGVDEC_Params;
341
342/**
343*******************************************************************************
344* @struct IJPEGVDEC_DynamicParams
345*
346* @brief This structure defines the run time parameters for all
347* jpgVDEC objects
348*
349* @param viddecDynamicParams : Defines the run time parameters for
350* all IVIDDEC3 instance objects.
351*
352* @param decodeThumbnail : Decode the ThumNail and provide the output for
353* display.
354*
355* @param thumbnailMode : Specifies which thumbnail to decode. If none of
356* the markers (JFIF and EXIF) have thumbnail image,
357* use IJPEGVDEC_THUMBNAIL_DOWNSAMPLE. Refer to
358* thumbnailMode enumeration
359*
360* @param downsamplingFactor : If decodeThumbnail is enabled and
361* thumbnailMode is set to
362* IJPEGVDEC_THUMBNAIL_DOWNSAMPLE,
363* downsamplingFactor is used as scaling factor
364* for ThumNail output
365* If decodeThumbnail is disabled, this parameter
366* is used as scaling factor for display buffer
367* output. Refer to edownSamplingFactor
368*
369* @param streamingCompliant : If an Input Image is Non-Interleaved ,
370* Application has to set this params to "0"
371* (DISABLE) , if it is Interleaved , value will
372* be "1" (ENABLE). This Paramater along with
373* ForceChromaFormat determines whether we
374* have to give Planar Buffers from GetBufinfo.
375*
376* @param rangeReduction : Parameter is used to enable/disable
377* limited Pixel Range feature.
378*
379*******************************************************************************
380*/
381typedef struct {
382 IVIDDEC3_DynamicParams viddecDynamicParams;
383
384
385 XDAS_Int32 decodeThumbnail;
386
387 XDAS_Int32 thumbnailMode;
388
389 XDAS_Int32 downsamplingFactor;
390
391 XDAS_Int32 streamingCompliant;
392
393 XDAS_Int32 rangeReduction;
394
395} IJPEGVDEC_DynamicParams;
396
397/**
398*******************************************************************************
399* @struct IJPEGVDEC_InArgs
400*
401* @brief This structure defines the run time input arguments for all VIDDEC
402* objects.
403*
404* @param viddecInArgs : Defines the input arguments for all
405* IVIDDEC3 instance process function.
406*
407*******************************************************************************
408*/
409typedef struct {
410 IVIDDEC3_InArgs viddecInArgs;
411}IJPEGVDEC_InArgs;
412
413/**
414*******************************************************************************
415* @struct IJPEGVDEC_OutArgs
416*
417* @brief This structure defines the run time output arguments for VIDDEC
418* objects.This structure may be extended by individual codec
419* implementation allowing customization with vendor specific
420* parameters.
421*
422* @param viddecOutArgs : Defines the output arguments for all
423* IVIDDEC3 instance process function.
424*
425* @param IsGrayFlag : This is set if the input to the decoder is a grayscale
426* image. For 420 and Gray scale images, the output chroma
427* format is 420SP. This flag will differentiate the MCU
428* size required in output data sync usage. If IsGrayFlag
429* is set to 1, the row size is 8xWidth otherwise rowsize
430* is 16xWidth
431*
432* @param bytesConsumedForPartialBuffer : In case of SliceSwitch & only input
433* data sync are enabled, whenever the
434* switch happens, this parameter
435* represents the number of bytes consumed
436* by codec in last consumed buffer as it
437* may be partially consumed
438*
439*******************************************************************************
440*/
441typedef struct {
442 IVIDDEC3_OutArgs viddecOutArgs;
443 XDAS_UInt32 IsGrayFlag;
444 XDAS_UInt32 bytesConsumedForPartialBuffer;
445}IJPEGVDEC_OutArgs;
446
447
448typedef enum {
449 IJPEGDEC_ERR_UNSUPPORTED_VIDDEC3PARAMS = 0,
450 IJPEGDEC_ERR_UNSUPPORTED_VIDDEC3DYNAMICPARAMS = 1,
451 IJPEGDEC_ERR_UNSUPPORTED_JPEGDECDYNAMICPARAMS = 2,
452 IJPEGDEC_ERR_NOSLICE = 3,
453 IJPEGDEC_ERR_MBDATA = 4,
454 IJPEGDEC_ERR_STANDBY = 5,
455 IJPEGDEC_ERR_INVALID_MBOX_MESSAGE = 6,
456 IJPEGDEC_ERR_HDVICP_RESET = 7,
457 IJPEGDEC_ERR_HDVICP_WAIT_NOT_CLEAN_EXIT = 16,
458 IJPEGDEC_ERR_FRAME_HDR = 17,
459 IJPEGDEC_ERR_SCAN_HDR = 18,
460 IJPEGDEC_ERR_HUFF_TBL_HDR = 19,
461 IJPEGDEC_ERR_QUANT_TBL_HDR = 20,
462 IJPEGDEC_ERR_OUTCHROMAFORMAT = 21,
463 IJPEGDEC_ERR_UNSUPPORTED_MARKER = 22,
464 IJPEGDEC_ERR_THUMBNAIL = 23,
465 IJPEGDEC_ERR_IRES_HANDLE = 24,
466 IJPEGDEC_ERR_DYNAMIC_PARAMS_HANDLE = 25,
467
468 /* Error Codes of Data Sync */
469 IJPEGDEC_ERR_DATASYNC = 26,
470 IJPEGDEC_ERR_DOWNSAMPLE_INPUT_FORMAT = 27,
471 IJPEGDEC_ERR_NOT_SUPPORTED_FEATURE = 28,
472 IJPEGDEC_ERR_NOT_SUPPORTED_RESOLUTION = 29
473
474}IJPEGDEC_ExtendedErrorCodes;
475
476typedef enum {
477 JPEG_DECODE_THUMBNAIL_ERROR = 0,
478 JPEG_DYNAMIC_PARAMS_HANDLE_ERROR,
479 JPEG_THUMBNAIL_MODE_ERROR,
480 JPEG_DOWNSAMPLING_FACTOR_ERROR,
481 JPEG_STREAMING_COMPLIANT_ERROR,
482 JPEG_NON_INTERLEAVED_STREAMING_COMPLIANT_ERROR,
483 JPEG_DECODE_HEADER_ERROR,
484 JPEG_DISPLAY_WIDTH_ERROR,
485 JPEG_DYNAMIC_PARAMS_SIZE_ERROR,
486 JPEG_NULL_INSTANCE_HANDLE_ERROR,
487 JPEG_NULL_INARGS_POINTER_ERROR,
488 JPEG_NULL_OUTARGS_POINTER_ERROR,
489 JPEG_NULL_INPUT_BUF_DESC_ERROR,
490 JPEG_NULL_OUTPUT_BUF_DESC_ERROR,
491 JPEG_INVALID_INARGS_SIZE,
492 JPEG_INVALID_OUTARGS_SIZE,
493 JPEG_NULL_INPUT_BUFFER_POINTER_ERROR,
494 JPEG_NULL_OUTPUT_BUF_DESC_POINTER_ERROR,
495 JPEG_INVALID_NUM_OF_INPUT_BUFFERS_ERROR,
496 JPEG_INVALID_INPUT_BYTES_ERROR,
497 JPEG_INVALID_INPUT_BUFFER_MEMORY_TYPE_ERROR,
498 JPEG_INVALID_NUM_OF_OUTPUT_BUFFERS_ERROR,
499 JPEG_NULL_OUTPUT_BUFFER_POINTER0_ERROR,
500 JPEG_INVALID_OUTPUT_BUFFER0_SIZE_ERROR,
501 JPEG_INVALID_OUTPUT_BUFFER0_MEMTYPE_ERROR,
502 JPEG_NULL_OUTPUT_BUFFER_POINTER1_ERROR,
503 JPEG_INVALID_OUTPUT_BUFFER1_SIZE_ERROR,
504 JPEG_INVALID_OUTPUT_BUFFER1_MEMTYPE_ERROR,
505 JPEG_NULL_OUTPUT_BUFFER_POINTER2_ERROR,
506 JPEG_INVALID_OUTPUT_BUFFER2_SIZE_ERROR,
507 JPEG_INVALID_OUTPUT_BUFFER2_MEMTYPE_ERROR,
508 JPEG_INVALID_INPUT_ID_ERROR,
509 JPEG_NUM_VDMA_DESC_EXCEEDS_ERROR,
510 JPEG_INVALID_SOI_MARKER_ERROR,
511 JPEG_INVALID_MARKER_SEG_LENGTH_ERROR,
512 JPEG_NON_STANDARD_MARKER_CODE_ERROR,
513 JPEG_INVALID_QUANT_TABLE_TYPE_ERROR,
514 JPEG_QUANT_TABLE_BYTES_READ_ERROR,
515 JPEG_INVALID_HUFFMAN_TABLE_TYPE_ERROR,
516 JPEG_HUFFMAN_CODE_LENGTH_SIZE_EXCEED_ERROR,
517 JPEG_HUFFMAN_TABLE_MARKER_SEG_SIZE_ERROR,
518 JPEG_HUFFMAN_TABLE_BYTES_READ_ERROR,
519 JPEG_INVALID_SAMPLE_PRECISION_ERROR,
520 JPEG_INVALID_NUM_COMPONENTS_ERROR,
521 JPEG_FRAME_HDR_BYTES_READ_ERROR,
522 JPEG_NOT_SUPPORTED_FORMAT_ERROR,
523 JPEG_ARITHMETIC_DECODING_NOT_SUPPORTED_MARKER_ERROR,
524 JPEG_PROG_DECODING_NOT_SUPPORTED_MARKER_ERROR,
525 JPEG_LOSSLESS_DECODING_NOT_SUPPORTED_MARKER_ERROR,
526 JPEG_DIFFERENTIAL_DECODING_NOT_SUPPORTED_MARKER_ERROR,
527 JPEG_JFIF_THUMBNAIL_IDENTIFIER_ERROR,
528 JPEG_JFIF_THUMBNAIL_BYTES_READ_ERROR,
529 JPEG_JFIF_EXTN_NO_SOI_ERROR,
530 JPEG_JFIF_NOT_SUPPORTED_FEATURE_ERROR,
531 JPEG_FORCECHROMA_OUTPUTCHROMA_FORMAT_MISMATCH_ERROR,
532 JPEG_INVALID_VERT_SCAN_FREQ_ERROR,
533 JPEG_INVALID_HORI_SCAN_FREQ_ERROR,
534 JPEG_INVALID_QUANT_DEST_SELECTOR_ERROR,
535 JPEG_DC_ENTROPY_CODING_DEST_ERROR,
536 JPEG_AC_ENTROPY_CODING_DEST_ERROR,
537 JPEG_ECD_VLD_OUT_OF_TABLE_ERROR,
538 JPEG_ECD_RESTART_INTERVAL_ERROR,
539 JPEG_ECD_BLOCK_COEFF_NUM_ERROR,
540 JPEG_GET_DATA_SYNC_NULL_FUNC_POINTER_ERROR,
541 JPEG_PUT_DATA_SYNC_NULL_FUNC_POINTER_ERROR,
542 JPEG_HDVICP_ACQUIRE_AND_CONFIGURE_ERROR,
543 JPEG_NULL_ALGORITHM_HANDLE_ERROR,
544 JPEG_GETVERSION_NULL_BUF_POINTER_ERROR,
545 JPEG_IRES_RESOURCE_DESC_ERROR,
546 JPEG_IRES_RESOURCE_DESC_HANDLE_ERROR,
547 JPEG_NULL_STATUS_DATA_BUF,
548 JPEG_EXCEED_BYTES_CONSUMED_ERROR,
549
550 /* Extended Error Codes for Data Sync */
551 JPEG_INPUT_DATASYNC_NUMBLOCKS_ERROR,
552 JPEG_INPUT_DATASYNC_BUFF_POINTER_ERROR,
553 JPEG_INPUT_DATASYNC_BLOCKSIZE_ERROR,
554 JPEG_INPUT_DATASYNC_NOT_VALID,
555
556 JPEG_OUTPUT_DATASYNC_NUMBLOCKS_ERROR,
557
558 JPEG_SLICE_LEVEL_INPUT_NO_RST_MARKER_ERROR,
559 JPEG_DOWNSAMPLING_IN_NON_TILED_ERROR,
560 JPEG_DOWNSAMPLING_NOT_SUPPORTED_FORMAT_ERROR,
561 JPEG_DOWNSAMPLING_NOT_SUPPORTED_FEATURE_ERROR,
562 JPEG_THUMBNAIL_NOT_SUPPORTED_FEATURE_ERROR,
563
564 /* Extended Error Codes for Unsupported Resolution */
565 JPEG_NOT_SUPPORTED_WIDTH_ERROR,
566 JPEG_NOT_SUPPORTED_HEIGHT_ERROR,
567 JPEG_DECODE_LIMITED_PIXEL_RANGE_ERROR
568}IjpegVDEC_ErrorStatus;
569/*
570 * ======== IJPEGVDEC_Params ========
571 * Default parameter values for JPEGVDEC instance objects
572 */
573extern const IJPEGVDEC_Params JPEGVDEC_TI_Static_Params;
574/*
575 * ======== IJPEGVDEC_DynamicParams ========
576 * Default dynamic parameter values for JPEGVDEC instance objects
577 */
578extern const IJPEGVDEC_DynamicParams JPEGVDEC_TI_DynamicParams;
579/* ------------------------------ macros ------------------------------------ */
580
581/****************************************************************
582* PRIVATE DECLARATIONS Defined here, used only here
583****************************************************************/
584/*--------data declarations -----------------------------------*/
585
586#endif /* _IJPEGVDEC_ */
587
diff --git a/packages/ivahd_codecs/ti/sdo/codecs/mpeg2vdec/impeg2vdec.h b/packages/ivahd_codecs/ti/sdo/codecs/mpeg2vdec/impeg2vdec.h
new file mode 100644
index 0000000..246fc98
--- /dev/null
+++ b/packages/ivahd_codecs/ti/sdo/codecs/mpeg2vdec/impeg2vdec.h
@@ -0,0 +1,509 @@
1/*
2********************************************************************************
3* HDVICP2.0 Based MPEG-2 MP Decoder
4*
5* "HDVICP2.0 Based MPEG-2 MP Decoder" is software module developed on TI's
6* HDVICP2 based SOCs. This module is capable of generating a raw 4:2:0 video
7* data by de-compressing/decoding a main/simple profile bit-stream based on
8* ISO/IEC 13818-2.
9* Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
10* ALL RIGHTS RESERVED
11********************************************************************************
12*/
13
14/**
15********************************************************************************
16* @file impeg2vdec.h
17*
18* @brief This file provides definisions for the interface(API) parameters.
19*
20* @author Prashanth
21*
22* @version 0.0 (July 2008) : Created [Prashanth]
23* @version 0.1 (Dec 2009) : Added extended dynamic paramters[Deepa]
24* @version 0.2 (Feb 2010) : Coding Guidelines[Deepa]
25* @version 0.3 (July 2010) : Error robustness added.
26* [Deepa Nagendra].
27* @version 0.4 (Aug 2010) : Debug trace implementation.
28* [Deepa Nagendra].
29* @version 0.5 (Aug 2010) : Error Concealment support.
30* [Deepa Nagendra].
31* @version 0.6 (Dec 2011) : Default structures are exposed in interface file
32* and macros are differenciated with codec name.
33* [Naidu].
34* @version 0.6 (July 2012) : Added extended error codes for errors incase
35* referenceframe is not available while decoding
36* after flush and SEEK [Naidu].
37* @version 0.7 (May 2013) : eFrameErrorConcealment structure is differenciated
38* with codec name [Naidu]
39********************************************************************************
40*/
41/* ---------------------- compilation control switches ---------------------- */
42
43#ifndef _IMPEG2VDEC_
44#define _IMPEG2VDEC_
45
46
47/*******************************************************************************
48* INCLUDE FILES
49*******************************************************************************/
50/* ---------------------- system and platform files ------------------------- */
51#include <ti/xdais/xdas.h>
52#include <ti/xdais/ialg.h>
53#include <ti/xdais/dm/ividdec3.h>
54#include <ti/xdais/ires.h>
55#include <ti/sdo/fc/ires/hdvicp/ires_hdvicp2.h>
56/* --------------------------- program files -------------------------------- */
57
58/*******************************************************************************
59* PUBLIC DECLARATIONS Defined here, used elsewhere
60*******************************************************************************/
61/*-----------------------data declarations -----------------------------------*/
62
63
64/*******************************************************************************
65* PRIVATE DECLARATIONS Defined here, used only here
66*******************************************************************************/
67/*-----------------------data declarations -----------------------------------*/
68
69/*-----------------------function prototypes ---------------------------------*/
70
71/**
72********************************************************************************
73* @struct IMPEG2VDEC_Obj
74*
75* @brief This structure must be the first field of all Mpeg2vdec instance
76* objects
77*
78* @param fxns : Handle to extented mpeg2 video decoder library
79* interface functions
80*
81********************************************************************************
82*/
83typedef struct IMPEG2VDEC_Obj {
84 struct IMPEG2VDEC_Fxns *fxns;
85} IMPEG2VDEC_Obj;
86
87/**
88********************************************************************************
89* @struct IMPEG2VDEC_Handle
90*
91* @brief This handle is used to reference all Mpeg2vdec instance objects
92*
93********************************************************************************
94*/
95typedef struct IMPEG2VDEC_Obj *IMPEG2VDEC_Handle;
96
97/**
98********************************************************************************
99* @struct IMPEG2VDEC_Status
100*
101* @brief Status structure defines the parameters that can be changed or
102* read during real-time operation of the alogrithm.
103*
104* @param viddecStatus : Handle to base class status struture which
105* defines the all run time parameters.
106********************************************************************************
107*/
108typedef struct IMPEG2VDEC_Status {
109 IVIDDEC3_Status viddecStatus;
110 /* Extended Error Code0 returned by decoder */
111 XDAS_UInt32 extendedErrorCode0;
112 /* Extended Error Code1 returned by decoder */
113 XDAS_UInt32 extendedErrorCode1;
114 /* Extended Error Code2 returned by decoder */
115 XDAS_UInt32 extendedErrorCode2;
116 /* Extended Error Code3 returned by decoder */
117 XDAS_UInt32 extendedErrorCode3;
118
119 XDAS_UInt32 debugTraceLevel;
120
121 XDAS_UInt32 lastNFramesToLog;
122
123 XDAS_UInt32 *extMemoryDebugTraceAddr;
124
125 XDAS_UInt32 extMemoryDebugTraceSize;
126
127} IMPEG2VDEC_Status;
128
129/**
130* @brief The Cmd enumeration defines the control commands for the MPEG2
131* video decoder control method.
132*/
133typedef IVIDDEC3_Cmd IMPEG2VDEC_Cmd;
134
135/**
136********************************************************************************
137* @struct IMPEG2VDEC_Params
138*
139* @brief This structure defines the creation parameters for all
140* mpeg2VDEC objects
141*
142* @param viddecParams : Defines the creation time parameters for
143* all IVIDDEC1 instance objects.
144*
145********************************************************************************
146*/
147typedef struct IMPEG2VDEC_Params {
148
149 IVIDDEC3_Params viddecParams;
150 XDAS_Int32 ErrorConcealmentON;
151 XDAS_Int32 outloopDeBlocking;
152
153 /*--------------------------------------------------------------------------*/
154 /*Debug trace Level */
155 /*--------------------------------------------------------------------------*/
156 XDAS_UInt32 debugTraceLevel;
157
158 /*--------------------------------------------------------------------------*/
159 /*History of last N frames */
160 /*--------------------------------------------------------------------------*/
161 XDAS_UInt32 lastNFramesToLog;
162
163} IMPEG2VDEC_Params;
164
165/**
166********************************************************************************
167* @struct IMPEG2VDEC_DynamicParams
168*
169* @brief This structure defines the run time parameters for all
170* Mpeg2vdec objects
171*
172* @param viddecDynamicParams : Defines the run time parameters for
173* all IVIDDEC3 instance objects.
174*
175********************************************************************************
176*/
177typedef struct IMPEG2VDEC_DynamicParams {
178 /*Base class Parameters*/
179 IVIDDEC3_DynamicParams viddecDynamicParams;
180
181 /*--------------------------------------------------------------------------*/
182 /* gotoNextIFrame : If enabled, during process call skips decoding of all */
183 /* non I frames. Enable seekFrameEnd to get the bytes */
184 /* consumed for each non I frame */
185 /*--------------------------------------------------------------------------*/
186 XDAS_Int32 gotoNextIFrame;
187 /*--------------------------------------------------------------------------*/
188 /* skipBFrame : If enabled, skips decoding of all B frames. */
189 /* Enable seekFrameEnd to get the bytes consumed for the */
190 /* B-frames */
191 /*--------------------------------------------------------------------------*/
192 XDAS_Int32 skipBFrame;
193 /*--------------------------------------------------------------------------*/
194 /* skipCurrFrame : If enabled, skips decoding of current frame */
195 /* Enable seekFrameEnd to get the bytes consumed for the */
196 /* Current frame */
197 /*--------------------------------------------------------------------------*/
198 XDAS_Int32 skipCurrFrame;
199 /*--------------------------------------------------------------------------*/
200 /* seekFrameEnd : If enabled along with any SkipFrame option, prcoess call */
201 /* returns the bytesconsumed for the frame w/o decoding the */
202 /* frame */
203 /*--------------------------------------------------------------------------*/
204 XDAS_Int32 seekFrameEnd;
205
206} IMPEG2VDEC_DynamicParams;
207
208/**
209********************************************************************************
210* @struct IMPEG2VDEC_InArgs
211*
212* @brief This structure defines the runtime input arguments for all VIDDEC
213* objects.
214*
215* @param viddecInArgs : Defines the input arguments for all IVIDDEC3
216* instance process function.
217*
218********************************************************************************
219*/
220typedef struct IMPEG2VDEC_InArgs {
221
222 IVIDDEC3_InArgs viddecInArgs;
223
224}IMPEG2VDEC_InArgs;
225
226/**
227********************************************************************************
228* @struct IMPEG2VDEC_OutArgs
229*
230* @brief This structure defines the run time output arguments for VIDDEC
231* objects.
232*
233* @param viddecOutArgs : Defines the output arguments for all IVIDDEC3
234* instance process function.
235*
236********************************************************************************
237*/
238typedef struct IMPEG2VDEC_OutArgs {
239 IVIDDEC3_OutArgs viddecOutArgs;
240}IMPEG2VDEC_OutArgs;
241
242/**
243********************************************************************************
244* @struct IMPEG2VDEC_Fxns
245*
246* @brief This structure defines all of the operations on Mpeg2vdec objects.
247*
248* @param ividdec : handle to the all function of the operations on
249* IVIDDEC3 objects
250*
251********************************************************************************
252*/
253typedef struct IMPEG2VDEC_Fxns {
254 IVIDDEC3_Fxns ividdec;
255} IMPEG2VDEC_Fxns;
256
257/**
258 * Error concealment can be enabled or disabled through create time parameter.
259*/
260typedef enum {
261 IMPEG2VDEC_EC_DISABLE = 0,
262 IMPEG2VDEC_EC_ENABLE
263} IMPEG2VDEC_FrameErrorConcealment;
264
265
266/**
267 * Flag to deblock enable
268 */
269#define IMPEG2VDEC_DEBLOCK_ENABLE (1)
270
271/**
272 * Flag to deblock disable
273 */
274#define IMPEG2VDEC_DEBLOCK_DISABLE (0)
275
276/**
277* Number of MemTab required if Deblock is Off
278*/
279#define IMPEG2VDEC_NUM_MEMTABS_DEBLOCK_OFF (0)
280
281/**
282* Number of memtab required if deblock is on and it will be maximum
283* resource required by codec
284*/
285#define IMPEG2VDEC_NUM_MEMTABS_DEBLOCK_ON (6)
286
287/**
288 * The error codes correspond to the 32-bit extended error parameter passed
289 * through outargs and get sttus. The error have been categorised to the below
290 * 32 groups and the respective bit is set on error occurrence.
291 */
292typedef enum {
293 IMPEG2VDEC_ERR_UNSUPPORTED_VIDDEC3PARAMS = 0,
294 IMPEG2VDEC_ERR_UNSUPPORTED_VIDDEC3DYNAMICPARAMS,
295 IMPEG2VDEC_ERR_UNSUPPORTED_MPEG2DECDYNAMICPARAMS,
296 IMPEG2VDEC_ERR_IMPROPER_DATASYNC_SETTING,
297
298 IMPEG2VDEC_ERR_NOSLICE,
299 IMPEG2VDEC_ERR_SLICEHDR,
300 IMPEG2VDEC_ERR_MBDATA,
301 IMPEG2VDEC_ERR_UNSUPPFEATURE,
302
303 IMPEG2VDEC_ERR_STREAM_END = 16,
304 IMPEG2VDEC_ERR_UNSUPPRESOLUTION,
305 IMPEG2VDEC_ERR_STANDBY,
306 IMPEG2VDEC_ERR_INVALID_MBOX_MESSAGE,
307
308 IMPEG2VDEC_ERR_HDVICP_RESET,
309 IMPEG2VDEC_ERR_HDVICP_WAIT_NOT_CLEAN_EXIT,
310 IMPEG2VDEC_ERR_SEQHDR,
311 IMPEG2VDEC_ERR_GOP_PICHDR,
312
313 IMPEG2VDEC_ERR_SEQLVL_EXTN,
314 IMPEG2VDEC_ERR_PICLVL_EXTN,
315 IMPEG2VDEC_ERR_TRICK_MODE,
316 IMPEG2VDEC_ERR_PICSIZECHANGE,
317
318 IMPEG2VDEC_ERR_SEMANTIC,
319 IMPEG2VDEC_ERR_DECODE_EXIT,
320 IMPEG2VDEC_ERR_IRES_RESHANDLE,
321 IMPEG2VDEC_ERR_IRES_RESDESC
322
323}IMPEG2VDEC_ExtendedErrorCodes;
324
325/**
326 * The enum corresponds to the 4 32-bit words used to pass the error codes to
327 * the application in the extended parameters of status stucture through the
328 * getstatus command. Each bit is set for an error which falls under one of
329 * the groups in the outargs 32 bvits.
330 */
331typedef enum {
332 MPEG2_ECD_ILLEGAL_EOM=0,
333 MPEG2_ECD_ILLEGAL_EOB,
334 MPEG2_ECD_ILLEGAL_MP1_ESCAPE_LVL,
335 MPEG2_ECD_ILLEGAL_MP2_ESCAPE_LVL,
336
337 MPEG2_ECD_ILLEGAL_MARKER_CONCEAL,
338 MPEG2_ECD_ILLEGAL_MBTYPE_D_PIC,
339 MPEG2_ECD_ILLEGAL_DCT_COEFF,
340 MPEG2_ECD_ILLEGAL_CBP,
341
342 MPEG2_ECD_ILLEGAL_MOTION_CODE,
343 MPEG2_ECD_ILLEGAL_MB_TYPE,
344 MPEG2_ECD_ILLEGAL_MB_ADDR_INCR,
345 MPEG2_ECD_ILLEGAL_EOS,
346
347 MPEG2_ECD_ILLEGAL_QUANT_SCALE_CODE,
348 MPEG2_ECD_ILLEGAL_SLICE_START_POS,
349 MPEG2_ECD_ILLEGAL_START_CODE_SEARCH,
350 MPEG2_ECD_ILLEGAL_DC_COEFF_OVFL,
351
352 MPEG2_DYNAMIC_PARAMS_HANDLE_ERROR,
353 MPEG2_STATUS_HANDLE_ERROR,
354 MPEG2_DYNAMIC_PARAMS_SIZE_ERROR,
355 MPEG2_STATUS_SIZE_ERROR,
356
357 MPEG2_DECODE_HEADER_ERROR,
358 MPEG2_DISPLAY_WIDTH_ERROR,
359 MPEG2_FRAME_SKIP_MODE_ERROR,
360 MPEG2_NEW_FRAME_FLAG_ERROR,
361
362 MPEG2_GOTO_IFRAME_ERROR,
363 MPEG2_SKIP_BFRAME_ERROR,
364 MPEG2_SKIP_CURRENTFRAME_ERROR,
365 MPEG2_SEEK_FRAMEEND_ERROR,
366
367 MPEG2_NULL_STATUS_DATA_BUF,
368 MPEG2_INSUFFICIENT_STATUS_DATA_BUF,
369 MPEG2_NULL_INARGS_POINTER_ERROR,
370 MPEG2_INARGS_SIZE_ERROR,
371
372 MPEG2_INVALID_INPUT_BYTES_ERROR,
373 MPEG2_INVALID_INPUT_ID_ERROR,
374 MPEG2_DECODER_NOT_INITIALIZED_ERROR,
375 MPEG2_NULL_INPUT_BUF_DESC_ERROR,
376
377 MPEG2_NULL_INPUT_BUFFER_POINTER_ERROR,
378 MPEG2_INVALID_INPUT_BUFFER_SIZE_ERROR,
379 MPEG2_INVALID_NUM_OF_INPUT_BUFFERS_ERROR,
380 MPEG2_EXCESS_NUM_OF_INPUT_BUFFERS_ERROR,
381
382 MPEG2_INVALID_INPUT_BUFFER_MEMTYPE_ERROR,
383 MPEG2_NULL_OUTARGS_POINTER_ERROR,
384 MPEG2_INVALID_OUTARGS_SIZE,
385 MPEG2_NULL_OUTPUT_BUF_DESC_POINTER_ERROR,
386
387 MPEG2_NULL_OUTPUT_BUF_DESC_ERROR,
388 MPEG2_INVALID_OUTPUT_BUFFER0_POINTER_ERROR,
389 MPEG2_INVALID_OUTPUT_BUFFER0_SIZE_ERROR,
390 MPEG2_INVALID_NUM_OF_OUTPUT_BUFFERS_ERROR,
391
392 MPEG2_INVALID_OUTPUT_BUFFER0_MEMTYPE_ERROR,
393 MPEG2_INVALID_OUTPUT_BUFFER0_ALIGNMENT_ERROR,
394 MPEG2_INVALID_OUTPUT_BUFFER1_POINTER_ERROR,
395 MPEG2_INVALID_OUTPUT_BUFFER1_SIZE_ERROR,
396
397 MPEG2_INVALID_OUTPUT_BUFFER1_MEMTYPE_ERROR,
398 MPEG2_INVALID_OUTPUT_BUFFER1_ALIGNMENT_ERROR,
399 MPEG2_INVALID_OUTPUT_BUFFER2_POINTER_ERROR,
400 MPEG2_INVALID_OUTPUT_BUFFER2_SIZE_ERROR,
401
402 MPEG2_INVALID_OUTPUT_BUFFER2_MEMTYPE_ERROR,
403 MPEG2_INVALID_BUFFER_USAGE_MODE,
404 MPEG2_SEQ_HDR_INVALID_FRAME_WIDTH,
405 MPEG2_SEQ_HDR_INVALID_FRAME_HEIGHT,
406
407 MPEG2_SEQ_HDR_INVALID_ASPECT_RATIO,
408 MPEG2_SEQ_HDR_INVALID_FRAME_RATE_CODE,
409 MPEG2_INVALID_INTRA_QUANT_MAT,
410 MPEG2_INVALID_NON_INTRA_QUANT_MAT,
411
412 MPEG2_SEQ_HDR_INVALID_INTRA_ESCAPE_BIT,
413 MPEG2_SEQ_HDR_INVALID_PROFILE,
414 MPEG2_SEQ_HDR_INVALID_LEVEL,
415 MPEG2_SEQ_HDR_INVALID_RESOLUTION_FORLVL,
416
417 MPEG2_SEQ_HDR_INVALID_CHROMA_FORMAT,
418 MPEG2_SEQ_HDR_INVALID_LOW_DELAY,
419 MPEG2_SEQ_DSP_INVALID_VIDEO_FORMAT,
420 MPEG2_SEQ_DSP_INVALID_COLOUR_PRIM,
421
422 MPEG2_SEQ_DSP_INVALID_TRF_CHARS,
423 MPEG2_SEQ_DSP_INVALID_MAT_COEFFS,
424 MPEG2_GOP_HDR_INVALID_DROP_FLAG,
425 MPEG2_GOP_HDR_INVALID_HOUR,
426
427 MPEG2_GOP_HDR_INVALID_MIN,
428 MPEG2_GOP_HDR_INVALID_SEC,
429 MPEG2_GOP_HDR_INVALID_TIME_CODE_PICTURES,
430 MPEG2_GOP_HDR_INVALID_BROKEN_LINK,
431
432 MPEG2_PIC_HDR_INVALID_TEMP_REF,
433 MPEG2_PIC_HDR_INVALID_PIC_TYPE,
434 MPEG2_PIC_HDR_INVALID_VBV_DELAY,
435 MPEG1_PIC_HDR_INVALID_FWD_FCODE,
436
437 MPEG1_PIC_HDR_INVALID_BWD_FCODE,
438 MPEG2_PIC_HDR_INVALID_FCODE,
439 MPEG2_PIC_HDR_INVALID_PIC_STRUCTURE,
440 MPEG2_PIC_HDR_INVALID_FIELD_COMB,
441
442 MPEG2_PIC_HDR_INVALID_TFF,
443 MPEG2_PIC_HDR_INVALID_FPFD,
444 MPEG2_PIC_HDR_INVALID_RFF,
445 MPEG2_PIC_HDR_INVALID_PROG_FLAG,
446
447 MPEG2_QUANT_EXT_INVALID_LOAD_CHROMA_INTRA_FLAG,
448 MPEG2_QUANT_EXT_INVALID_LOAD_CHROMA_NON_INTRA_FLAG,
449 MPEG2_INVALID_EXTN_CODE,
450 MPEG2_SEQ_HDR_MISSING,
451
452 MPEG2_NO_PICTURE_ENCODED_ERROR,
453 MPEG2_SEQ_EXT_MISSING,
454 MPEG2_PIC_CODING_EXT_MISSING,
455 MPEG2_SEQ_DISP_EXT_MISSING,
456
457 MPEG2_GOP_FIRST_FRAME_NOT_I,
458 MPEG2_SCALABILITY_NOT_SUPPORTED,
459 MPEG2_END_OF_SEQ_DETECTED,
460 MPEG2_PIC_HDR_RFF_FRAME_RATE_MISMATCH,
461
462 MPEG2_PIC_HDR_INVALID_DC_PRECISION,
463 MPEG2_INVALID_FRAME_RATE,
464 MPEG2_INVALID_BIT_RATE,
465 MPEG2_FRAME_SKIPPED,
466
467 MPEG2_REF_FRAME_SKIPPED,
468 MPEG2_NO_REF_TO_FLUSH,
469 MPEG2_EXCESS_INPUT_BYTES,
470 MPEG2_ALL_MBS_NOT_DECODED,
471
472 MPEG2_NO_REF_PFRAME,
473 MPEG2_NO_REF_BFRAME
474
475}Impeg2VDEC_ErrorStatus;
476
477/*
478 * ======== IMPEG2VDEC_PARAMS ========
479 * Default parameter values for MPEG2VDEC instance objects
480 */
481extern const IMPEG2VDEC_Params MPEG2VDEC_TI_Static_Params;
482/*
483 * ======== IMPEG2VDEC_IVDEC_DYNAMICPARAMS ========
484 * Default dynamic parameter values for MPEG2VDEC instance objects
485 */
486extern const IMPEG2VDEC_DynamicParams MPEG2VDEC_TI_DynamicParams;
487/* ------------------------ function prototypes ----------------------------- */
488/*******************************************************************************
489* PRIVATE DECLARATIONS Defined here, used only here
490*******************************************************************************/
491/* ------------------------ data declarations ------------------------------- */
492/* ----------------------- function prototypes ------------------------------ */
493
494/* ------------------------------ macros ------------------------------------ */
495/*----------------------------------------------------------------------------*/
496/* Extending control method commands */
497/*----------------------------------------------------------------------------*/
498#define IMPEG2VDEC_GETSTATUS XDM_GETSTATUS
499#define IMPEG2VDEC_SETPARAMS XDM_SETPARAMS
500#define IMPEG2VDEC_RESET XDM_RESET
501#define IMPEG2VDEC_FLUSH XDM_FLUSH
502#define IMPEG2VDEC_SETDEFAULT XDM_SETDEFAULT
503#define IMPEG2VDEC_GETBUFINFO XDM_GETBUFINFO
504#define IMPEG2VDEC_GETVERSION XDM_GETVERSION
505#define IMPEG2VDEC_GETCONTEXTINFO XDM_GETCONTEXTINFO
506#define IMPEG2VDEC_GETDYNPARAMSDEFAULT XDM_GETDYNPARAMSDEFAULT
507
508#endif /* __IMPEG2VDEC__ */
509
diff --git a/packages/ivahd_codecs/ti/sdo/codecs/mpeg4enc/impeg4enc.h b/packages/ivahd_codecs/ti/sdo/codecs/mpeg4enc/impeg4enc.h
new file mode 100644
index 0000000..b53daad
--- /dev/null
+++ b/packages/ivahd_codecs/ti/sdo/codecs/mpeg4enc/impeg4enc.h
@@ -0,0 +1,1275 @@
1/*
2********************************************************************************
3 * HDVICP2.0 Based MPEG4 SP Encoder
4 *
5 * "HDVICP2.0 Based MPEG4 SP Encoder" is software module developed on TI's
6 * HDVICP2 based SOCs. This module is capable of compressing a 4:2:0 Raw
7 * video into a simple profile bit-stream. Based on ISO/IEC 14496-2."
8 *
9 * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
10 * ALL RIGHTS RESERVED
11********************************************************************************
12*/
13/**
14********************************************************************************
15 * @file <impeg4enc.h>
16 *
17 * @brief Interface header file for MPEG4 SP Encoder
18 *
19 * @author: Venugopala Krishna
20 *
21 * @version 0.0 (Feb 2009) : Initial version.
22 * [Venugopala Krishna]
23 * @version 0.1 (Apr 2009) : Updated version.
24 * [Radhesh Bhat]
25 * @version 0.2 (April 2013) : Enum added for create time param -
26 * insertGOVHdrBeforeIframe - to support VOL
27 * encoding for every I-frame [Mahantesh]
28 *******************************************************************************
29*/
30
31/* -------------------- compilation control switches -------------------------*/
32#ifndef IMPEG4ENC_
33#define IMPEG4ENC_
34
35/**
36 * @defgroup HDVICP2MPEG4 IMPEG4ENC_TI (V7M)
37 * @ingroup m3
38 *
39 * The IMPEG4ENC_TI interface enables encoding in MPEG-4 format
40 *
41 */
42
43/** @ingroup HDVICP2MPEG4 */
44/*@{*/
45
46/*-------------------------------------------*/
47/* typecasting of control method commands */
48/*-------------------------------------------*/
49#define IMPEG4ENC_GETSTATUS XDM_GETSTATUS
50#define IMPEG4ENC_SETPARAMS XDM_SETPARAMS
51#define IMPEG4ENC_RESET XDM_RESET
52#define IMPEG4ENC_FLUSH XDM_FLUSH
53#define IMPEG4ENC_SETDEFAULT XDM_SETDEFAULT
54#define IMPEG4ENC_GETBUFINFO XDM_GETBUFINFO
55
56/**
57* MPEG4 Simple profile IDC
58*/
59#define MPEG4_SIMPLE_PROFILE_IDC 3
60
61/*******************************************************************************
62* INCLUDE FILES
63*******************************************************************************/
64/* -------------------- system and platform files ----------------------------*/
65
66/*--------------------- program files ----------------------------------------*/
67#include <ti/xdais/ialg.h>
68#include <ti/xdais/dm/ividenc2.h>
69
70#ifdef __cplusplus
71extern "C" {
72#endif
73
74/*******************************************************************************
75* PUBLIC DECLARATIONS Defined here, used elsewhere
76*******************************************************************************/
77/*---------------------- data declarations -----------------------------------*/
78
79/*******************************************************************************
80* PRIVATE DECLARATIONS Defined here, used only here
81*******************************************************************************/
82/*---------------------- data declarations -----------------------------------*/
83/*---------------------- function prototypes ---------------------------------*/
84
85
86/**
87 *******************************************************************************
88 * @enum IMPEG4ENC_ErrorBit
89 * @brief error informations of IVAHD MPEG4 encoder implementation by TI.
90 *
91 * @remarks When an internal error occurs, the algorithm will return
92 * an error return value (e.g. EFAIL, EUNSUPPORTED)
93 *
94 * @remarks The value of each enum is the bit which is set.
95 *
96 * @remarks Bits 8-15 are defined by XDM and hence not used by codec
97 * implementation. rest all bits are used.
98 * XDM defined error bits are also active.
99 *
100 * @remarks The algorithm can set multiple bits to 1 based on conditions.
101 * e.g. it will set bits #XDM_FATALERROR (fatal) and
102 * #XDM_UNSUPPORTEDPARAM (unsupported params) in case
103 * of unsupported run time parameters.
104 *
105 *******************************************************************************
106*/
107typedef enum {
108 IMPEG4ENC_LEVEL_INCOMPLAINT_PARAMETER = 0,
109 /**< Bit 0 - level incomplaint parameters.
110 * @remarks This error is applicable when some parameters are set
111 * which are not meeting the limits set by MPEG4 standard
112 */
113
114 IMPEG4ENC_PROFILE_INCOMPLAINT_CONTENTTYPE = 1,
115 /**< Bit 1 - Profile incomplaint content type.
116 * @remarks This error is applicable when
117 * IVIDENC2_Params::inputContentType is not set as
118 * IVIDEO_PROGRESSIVE but IVIDENC2_Params::profile is set
119 * as IMPEG4_SIPPLE_PROFILE
120 */
121
122 IMPEG4ENC_IMPROPER_HDVICP2_STATE = 16,
123 /**< Bit 16 - Device is not proper state to use.
124 */
125
126 IMPEG4ENC_WARNING_H263_PLUS_CUSTOM_SOURCE_FORMAT = 17,
127 /**< Bit 17 - Indication that the input resolution given to codec
128 * is custom source format supported in H.263+ not the
129 * standard resolutions supported with H263 baseline or
130 * MPEG4 with short video header.
131 */
132
133 IMPEG4ENC_ERROR_BITSTREAM_MEMORY_INSUFFICIENT = 18,
134 /**< Bit 18 - Indication that the buffer given to codec from
135 * getBuffer function is insufficient so that codec
136 * cannot continue encoding. It means that if return value
137 * from getBuffer function is -1, then this bit gets set
138 * by the codec. This is the situation where application
139 * might not be able to provide memory to codec.
140 */
141
142 IMPEG4ENC_IMPROPER_DATASYNC_SETTING = 19,
143 /**< Bit 19 - data synch settings are not proper
144 * @remarks This error is set when encoder is asked to operate
145 * at sub frame level but the call back function pointer
146 * is NULL
147 */
148
149 IMPEG4ENC_UNSUPPORTED_VIDENC2PARAMS = 20,
150 /**< Bit 20 - Invalid videnc2 parameters
151 * @remarks This error is set when any parameter of struct
152 * IVIDENC2_Params is not in allowed range
153 */
154
155 IMPEG4ENC_UNSUPPORTED_RATECONTROLPARAMS = 21,
156 /**< Bit 21 - Invalid rate control parameters
157 * @remarks This error is set when any parameter of struct
158 * IMPEG4ENC_RateControlParams is not in allowed range
159 */
160
161 IMPEG4ENC_UNSUPPORTED_INTERCODINGPARAMS = 22,
162 /**< Bit 22 - Invalid inter coding parameters
163 * @remarks This error is set when any parameter of struct
164 * IMPEG4ENC_InterCodingParams is not in allowed range
165 */
166
167 IMPEG4ENC_UNSUPPORTED_INTRACODINGPARAMS = 23,
168 /**< Bit 23 - Invalid Intra coding parameters
169 * @remarks This error is set when any parameter of struct
170 * IMPEG4ENC_IntraCodingParams is not in allowed range
171 */
172
173 IMPEG4ENC_UNSUPPORTED_SLICECODINGPARAMS = 25,
174 /**< Bit 25 - Invalid slice coding parameters
175 * @remarks This error is set when any parameter of struct
176 * IMPEG4ENC_SliceControlParams is not in allowed range
177 */
178
179 IMPEG4ENC_UNSUPPORTED_MPEG4ENCPARAMS = 29,
180 /**< Bit 29 - Invalid Create time extended parameters
181 * @remarks This error is set when any parameter of struct
182 * IMPEG4ENC_CreateParams is not in allowed range
183 */
184
185 IMPEG4ENC_UNSUPPORTED_VIDENC2DYNAMICPARAMS = 30,
186 /**< Bit 30 - Invalid base class dyanmic parameters during control
187 * @remarks This error is set when any parameter of struct
188 * IVIDENC2_DynamicParams is not in allowed range
189 */
190
191 IMPEG4ENC_UNSUPPORTED_MPEG4ENCDYNAMICPARAMS = 31
192 /**< Bit 31 -Invalid extended class dyanmic parameters during control
193 * @remarks This error is set when any parameter of struct
194 * IMPEG4ENC_DynamicParams (excluding embedded structures)
195 * is not in allowed range
196 */
197
198} IMPEG4ENC_ErrorBit;
199
200
201/**
202 *******************************************************************************
203 * @enum IMPEG4ENC_Level
204 * @brief Enum for MPEG-4 Simple profile levels
205 *
206 * @remarks allowed levels are 0, 0b, 1, 2, 3, 4a & 5
207 *
208 *******************************************************************************
209*/
210typedef enum {
211 IMPEG4ENC_SP_LEVEL_0 = 0, /**< MPEG4 Simple Profile Level 0 */
212
213 IMPEG4ENC_SP_LEVEL_0B = 9, /**< MPEG4 Simple Profile Level 0b*/
214
215 IMPEG4ENC_SP_LEVEL_1 = 1, /**< MPEG4 Simple Profile Level 1 */
216
217 IMPEG4ENC_SP_LEVEL_2 = 2, /**< MPEG4 Simple Profile Level 2 */
218
219 IMPEG4ENC_SP_LEVEL_3 = 3, /**< MPEG4 Simple Profile Level 3 */
220
221 IMPEG4ENC_SP_LEVEL_4A = 4, /**< MPEG4 Simple Profile Level 4a*/
222
223 IMPEG4ENC_SP_LEVEL_5 = 5, /**< MPEG4 Simple Profile Level 5 */
224
225 IMPEG4ENC_SP_LEVEL_6 = 6 /**< MPEG4 Simple Profile Level 6 */
226
227} IMPEG4ENC_Level;
228
229
230/**
231 *******************************************************************************
232 * @enum IMPEG4ENC_H263Level
233 * @brief Enum for H.263 base profile levels
234 *
235 * @remarks allowed levels are 10,20,30,40, 45, 50, 60 and 70
236 *
237 *******************************************************************************
238*/
239typedef enum {
240 IMPEG4ENC_H263_LEVEL_10 = 10, /**< H263 Baseline Profile Level 10 */
241
242 IMPEG4ENC_H263_LEVEL_20 = 20, /**< H263 Baseline Profile Level 20 */
243
244 IMPEG4ENC_H263_LEVEL_30 = 30, /**< H263 Baseline Profile Level 30 */
245
246 IMPEG4ENC_H263_LEVEL_40 = 40, /**< H263 Baseline Profile Level 40 */
247
248 IMPEG4ENC_H263_LEVEL_45 = 45, /**< H263 Baseline Profile Level 45 */
249
250 IMPEG4ENC_H263_LEVEL_50 = 50, /**< H263 Baseline Profile Level 50 */
251
252 IMPEG4ENC_H263_LEVEL_60 = 60, /**< H263 Baseline Profile Level 60 */
253
254 IMPEG4ENC_H263_LEVEL_70 = 70 /**< H263 Baseline Profile Level 70 */
255} IMPEG4ENC_H263Level;
256
257/**
258 *******************************************************************************
259 * @enum IMPEG4ENC_PixelRange
260 * @brief pixel/video range enum
261 *
262 * @remarks
263 *
264 *******************************************************************************
265*/
266
267typedef enum {
268 /**
269 * Y varies from 16 to 235 and Cb/Cr varies from 16 to 240
270 */
271 IMPEG4ENC_PR_16_235 = 0,
272
273 /**
274 * Y/Cb/Cr varies from 0 to 255
275 */
276 IMPEG4ENC_PR_0_255 = 1,
277
278 IMPEG4ENC_PR_DEFAULT = IMPEG4ENC_PR_0_255
279
280} IMPEG4ENC_PixelRange;
281
282
283/**
284 *******************************************************************************
285 * @enum IMPEG4ENC_SceneChangeAlgo
286 * @brief Enum for enabling or disabling scene change detection algo
287 *
288 * @remarks
289 *
290 *******************************************************************************
291*/
292
293typedef enum {
294 /**
295 * Disables the scene change detection algorithm
296 */
297 IMPEG4ENC_SCDA_DISABLE = 0,
298
299 /**
300 * Enables the scene change detection algorithm
301 */
302 IMPEG4ENC_SCDA_ENABLE = 1,
303
304 IMPEG4ENC_SCDA_DEFAULT = IMPEG4ENC_SCDA_ENABLE
305
306} IMPEG4ENC_SceneChangeAlgo;
307
308
309/**
310 *******************************************************************************
311 * @enum IMPEG4ENC_RateControlParamsPreset
312 * @brief These enumerations control the RateControl Params
313 *
314 * @remarks
315 *
316 *******************************************************************************
317*/
318typedef enum {
319 IMPEG4_RATECONTROLPARAMS_DEFAULT = 0, /**< Default RC params */
320
321 IMPEG4_RATECONTROLPARAMS_USERDEFINED = 1, /**< User defined RC params*/
322
323 /**
324 * Keep the Rate Control params as existing.
325 * This is useful because during control call if user don't want to chnage
326 * the Rate Control Params
327 */
328 IMPEG4_RATECONTROLPARAMS_EXISTING = 2,
329
330
331 IMPEG4_RATECONTROLPARAMS_MAX
332
333} IMPEG4ENC_RateControlParamsPreset;
334
335
336/**
337 *******************************************************************************
338 * @enum IMPEG4ENC_RateControlAlgoPreset
339 * @brief These enumerations control the RateControl Algorithm
340 *
341 * @remarks
342 *
343 *******************************************************************************
344*/
345typedef enum {
346 /**
347 * Fixed QP
348 */
349 IMPEG4_RATECONTROLALGO_NONE = 0,
350
351 /**
352 * VBR Rate Control Algorithm
353 */
354 IMPEG4_RATECONTROLALGO_VBR = 1,
355
356 /**
357 * CBR Rate Control Algorithm -- Low Delay
358 */
359 IMPEG4_RATECONTROLALGO_CBR = 2,
360
361 IMPEG4_RATECONTROLALGO_MAX
362
363} IMPEG4ENC_RateControlAlgoPreset;
364
365
366/**
367 *******************************************************************************
368 * @enum IMPEG4ENC_InterCodingPreset
369 * @brief These enumerations control the type of inter coding
370 *
371 * @remarks
372 *
373 *******************************************************************************
374*/
375typedef enum {
376
377 /**
378 * Default Inter coding params
379 */
380
381 IMPEG4_INTERCODING_DEFAULT = 0,
382
383 /**
384 * User defined inter coding params
385 */
386 IMPEG4_INTERCODING_USERDEFINED = 1,
387
388
389 /**
390 * Keep the inter coding params as existing
391 */
392 IMPEG4_INTERCODING_EXISTING = 2,
393
394 IMPEG4_INTERCODING_MAX
395
396} IMPEG4ENC_InterCodingPreset;
397
398
399/**
400 *******************************************************************************
401 * @enum IMPEG4ENC_InterBlockSize
402 * @brief These enumerations control the block size of each MB in encoding
403 *
404 * @remarks
405 *
406 *******************************************************************************
407*/
408typedef enum {
409 /**
410 * 16x16 Block size
411 */
412 IMPEG4_BLOCKSIZE_16x16 = 0,
413
414 /**
415 * 8x8 Block size
416 */
417 IMPEG4_BLOCKSIZE_8x8 = 1,
418
419 /**
420 * Default block size
421 */
422 IMPEG4_BLOCKSIZE_DEFAULT = IMPEG4_BLOCKSIZE_8x8,
423
424 IMPEG4_BLOCKSIZE_MAX = 2
425
426} IMPEG4ENC_InterBlockSize;
427
428
429/**
430 *******************************************************************************
431 * @enum IMPEG4ENC_IntraRefreshMethods
432 * @brief Refresh method Type Identifier for MPEG4 Encoder
433 *
434 * @remarks
435 *
436 *******************************************************************************
437*/
438typedef enum {
439
440 /**
441 * Doesn't insert forcefully any intra macro blocks
442 */
443 IMPEG4_INTRAREFRESH_NONE = 0,
444 /**
445 * Inserts intra macro blocks in a cyclic fashion
446 * cyclic interval is equal to intraRefreshRate
447 */
448 IMPEG4_INTRAREFRESH_CYCLIC_MBS,
449
450 /**
451 * Inserts Intra Rows in a cyclic fashion
452 * Number of Rows equal to intraRefreshRate
453 */
454 IMPEG4_INTRAREFRESH_CYCLIC_ROWS,
455
456 /**
457 * Mandatory Intra Refresh -- evenly distributes number of INTRA MBs over
458 * frames.
459 */
460 IMPEG4_INTRAREFRESH_MANDATORY,
461
462 /**
463 * position of intra macro blocks is intelligently chosen by encoder, but the
464 * number of forcely coded intra macro blocks in a frame is gaurnteed to be
465 * equal to totalMbsInFrame/intraRefreshRate.
466 * This method is not implemented currently.
467 */
468 IMPEG4_INTRAREFRESH_RDOPT_MBS
469
470} IMPEG4ENC_IntraRefreshMethods;
471
472
473/**
474 *******************************************************************************
475 * @enum IMPEG4ENC_IntraCodingPreset
476 * @brief These enumerations control the type of intra coding
477 *
478 * @remarks
479 *
480 *******************************************************************************
481*/
482typedef enum {
483 /**
484 * Default intra coding params
485 */
486 IMPEG4_INTRACODING_DEFAULT = 0,
487
488 /**
489 * User defined intra coding params
490 */
491 IMPEG4_INTRACODING_USERDEFINED = 1,
492 IMPEG4_INTRACODING_MAX
493
494} IMPEG4ENC_IntraCodingPreset;
495
496
497/**
498 *******************************************************************************
499 * @enum IMPEG4ENC_SliceCodingPreset
500 * @brief These enumerations control the type of slice coding
501 *
502 * @remarks
503 *
504 *******************************************************************************
505*/
506typedef enum {
507 /**
508 * Default slice coding params
509 */
510 IMPEG4_SLICECODING_DEFAULT = 0,
511
512 /**
513 * User defined slicecoding params
514 */
515 IMPEG4_SLICECODING_USERDEFINED = 1,
516
517 /**
518 * Keep the slice coding params as existing
519 * This is useful because during control call if user don't want to chnage
520 * the sliceCodingParams
521 */
522 IMPEG4_SLICECODING_EXISTING = 2,
523 IMPEG4_SLICECODING_MAX
524
525} IMPEG4ENC_SliceCodingPreset;
526
527
528/**
529 *******************************************************************************
530 * @enum IMPEG4ENC_SliceMode
531 * @brief These enumerations control the mode of slice coding
532 *
533 * @remarks
534 *
535 *******************************************************************************
536*/
537typedef enum {
538 IMPEG4_SLICEMODE_NONE = 0,
539
540 /**
541 * Default slice coding mode is MB based
542 */
543 IMPEG4_SLICEMODE_DEFAULT = IMPEG4_SLICEMODE_NONE,
544
545 /**
546 * Slices are controlled based upon number of Macroblocks
547 */
548 IMPEG4_SLICEMODE_MBUNIT = 1,
549
550 /**
551 * Slices are controlled based upon number of bits consumed
552 */
553 IMPEG4_SLICEMODE_BITS = 2,
554 IMPEG4_SLICEMODE_MAX
555
556} IMPEG4ENC_SliceMode;
557
558/**
559 *******************************************************************************
560 * @enum IMPEG4ENC_nonMultiple16RefPadMethod
561 * @brief These enumerations captures different methods of padding the Ref
562 * frame when dimension is non multiple of 16.
563 *
564 * @remarks
565 *
566 *******************************************************************************
567*/
568typedef enum {
569 /**
570 * Method as suggested by DivX spec.
571 */
572 IMPEG4_PAD_METHOD_DIVX = 0,
573
574 /**
575 * Method as suggested by MPEG4 spec.
576 */
577 IMPEG4_PAD_METHOD_MPEG4 = 1,
578
579 /**
580 * Default mode is MPEG4 suggested way.
581 */
582 IMPEG4_PAD_METHOD_DEFAULT = IMPEG4_PAD_METHOD_MPEG4,
583 IMPEG4_PAD_METHOD_MAX
584
585} IMPEG4ENC_nonMultiple16RefPadMethod;
586
587
588/**
589
590 @enum IMPEG4ENC_AspectRatioIdc
591 @brief Defines aspect ratio IDs
592
593*/
594typedef enum {
595 IMPEG4ENC_ASPECTRATIO_SQUARE = 1, /**< 1:1 (square) aspect ratio */
596 IMPEG4ENC_ASPECTRATIO_12_11, /**< 12:11 aspect ratio */
597 IMPEG4ENC_ASPECTRATIO_10_11, /**< 10:11 aspect ratio */
598 IMPEG4ENC_ASPECTRATIO_16_11, /**< 16:11 aspect ratio */
599 IMPEG4ENC_ASPECTRATIO_40_33, /**< 40:33 aspect ratio */
600 IMPEG4ENC_ASPECTRATIO_EXTENDED = 15 /**< Extended aspect ratio */
601
602} IMPEG4ENC_AspectRatioIdc;
603
604/**
605 *******************************************************************************
606 * @enum IMPEG4ENC_InsertGOVHdrBeforeIframe
607 * @brief These enumerations capture encoding of GOV and VOL for every I-frame
608 *
609 * @remarks
610 *
611 *******************************************************************************
612*/
613typedef enum {
614 /**
615 * GOV and VOL are not encoded for every I-frame. Default
616 */
617 IMPEG4_NO_GOV_NO_VOL = 0,
618
619 /**
620 * Only GOV is encoded for every I-frame
621 */
622 IMPEG4_ENCODE_GOV_ONLY = 1,
623
624 /**
625 * Only VOL is encoded for every I-frame
626 */
627 IMPEG4_ENCODE_VOL_ONLY = 2,
628
629 /**
630 * Both GOV and VOL are encoded for every I-frame
631 */
632 IMPEG4_ENCODE_VOL_AND_GOV = 3
633
634} IMPEG4ENC_InsertGOVHdrBeforeIframe;
635/**
636 *******************************************************************************
637 * @struct IMPEG4ENC_Cmd
638 * @brief This structure defines the control commands for the IMP4VENC module
639 *
640 *******************************************************************************
641*/
642typedef IVIDENC2_Cmd IMPEG4ENC_Cmd;
643
644
645/**
646 *******************************************************************************
647 * @struct IMPEG4ENC_Obj
648 * @brief This structure must be the first field of all MPEG4ENC instance
649 * objects
650 *
651 * @param fxns - is a pointer to IMPEG4ENC_Fxns structure which includes the
652 * below function pointers
653 * IALG_Fxns
654 * Void algActivate(IALG_Handle handle)
655 * Int algAlloc(const IALG_Params *params,
656 * struct IALG_Fxns **parentFxns, IALG_MemRec *memTab)
657 * Void algControl(IALG_Handle handle, IALG_Cmd cmd,
658 * IALG_Status *status)
659 * Void algDeactivate(IALG_Handle handle)
660 * Int algFree(IALG_Handle handle, IALG_MemRec *memTab)
661 * Int algInit(IALG_Handle handle, const IALG_MemRec *memTab,
662 * IALG_Handle parent, const IALG_Params *params)
663 * Void algMoved(IALG_Handle handle, const IALG_MemRec *memTab,
664 * IALG_Handle parent, const IALG_Params *params)
665 * Int algNumAlloc(Void)
666 *
667 * XDAS_Int32 process(IVIDENC2_Handle handle, IVIDEO2_BufDesc *inBufs,
668 * XDM2_BufDesc *outBufs, IVIDENC2_InArgs *inArgs,
669 * IVIDENC2_OutArgs *outArgs)
670 *
671 * XDAS_Int32 control(IVIDENC2_Handle handle, IVIDENC2_Cmd id,
672 * IVIDENC2_DynamicParams *params, IVIDENC2_Status *status)
673 *
674 *******************************************************************************
675*/
676typedef struct IMPEG4ENC_Obj {
677 struct IMPEG4ENC_Fxns *fxns;
678} IMPEG4ENC_Obj;
679
680
681/**
682 *******************************************************************************
683 * @struct IMPEG4ENC_Handle
684 * @brief This handle is used to reference all MPEG4ENC instance objects
685 *
686 *******************************************************************************
687*/
688typedef struct IMPEG4ENC_Obj *IMPEG4ENC_Handle;
689
690/**
691 *******************************************************************************
692 * @struct IMPEG4ENC_RateControlParams
693 * @brief This structure contains all the parameters which controls Rate
694 * Control behavior
695 *
696 * @param rateControlParamsPreset :
697 * if this is IMPEG4_RATECONTROLPARAMS_DEFAULT the algorithm loads the
698 * default rate control parameters.
699 * if this is IMPEG4_RATECONTROLPARAMS_USERDEFINED the algorithm loads
700 * the user defined rate control parameters. if user is not aware of
701 * the floowing parameters it should be set to this enumeration.
702 * if this is IMPEG4_RATECONTROLPARAMS_EXISTING the algorithm loads
703 * the default rate control parameters.
704 *
705 * @param rcAlgo :
706 * if this is IMPEG4_RATECONTROLALGO_NONE the algorithm uses the fixed
707 * qpI/qpP depending on the Frame
708 * if this is IMPEG4_RATECONTROLALGO_PLR the algorithm uses the
709 * PLR algorithm for QP Selection and bitrate achievement
710 *
711 * @param qpI :
712 * Initial Quantization Parameter for I frames. Valid Range is [1, 31].
713 * when rateControlPreset = IVIDEO_NONE, this quantization parameter is
714 * used by the I frame encoding
715 *
716 * @param qpP :
717 * Initial Quantization Parameter for P frames. Valid Range is [1, 31]
718 * when rateControlPreset = IVIDEO_NONE, this quantization parameter is
719 * used by the P frame encoding
720 *
721 * @param seIntialQP :
722 * when rcAlgo is anything other than IMPEG4_RATECONTROLALGO_NONE,
723 * frame encoding start with seIntialQP value.
724 * When the user does not have understanding of what to set, set to 0,
725 * so the Codec internally decides intelligently the initial QP to be
726 * used.
727 *
728 * @param qpMax :
729 * Maximum Quantization Parameter. Range [1, 31]. Useful to control
730 * a minimum quality level
731 *
732 * @param qpMin :
733 * Minimum Quantization Parameter. Range [1, 31]. Useful to control
734 * a maximum bit-rate level
735 *
736 * @param enablePerceptualQuantMode :
737 * perceptual quantization is enabled or diasabled. It varies the Qp at
738 * MB level instead of row level to improve the perceptual quality of
739 * video.
740 * 1 for enable
741 * 0 for disable
742 *
743 * @param allowFrameSkip :
744 * This enables the Frame Skip Feature looking at the VBV Fullness.
745 * This should be enabled when Low Delay Mode is enabled.
746 * 2 for enabling early frame skip
747 * 1 for enabling late frame skip
748 * 0 for disabling frame skip
749 * @param initialBufferLevel :
750 * Initial buffer level for VBV compliance. It informs that
751 * hypothetical decoder can start depending on the fullness of the
752 * VBV buffer. Default value is 0, where codec will internally
753 * calculate the value based on the RC algo type
754 * @param vbvBufferSize :
755 * Virtual Buffer Verifier buffer size. This size controls the frame
756 * skip logic of the encoder. For low delay applications this size
757 * should be small. This size is in bits.
758 * Default value is 0, where codec will internally calculate the
759 * value based on the RC algo type.
760 *
761 *******************************************************************************
762*/
763typedef struct IMPEG4ENC_RateControlParams {
764 XDAS_Int32 rateControlParamsPreset;
765 XDAS_Int32 rcAlgo;
766 XDAS_Int32 qpI;
767 XDAS_Int32 qpP;
768 XDAS_Int32 seIntialQP;
769 XDAS_Int32 qpMax;
770 XDAS_Int32 qpMin;
771 XDAS_Int32 enablePerceptualQuantMode;
772 XDAS_Int32 allowFrameSkip;
773 XDAS_Int32 initialBufferLevel;
774 XDAS_Int32 vbvBufferSize;
775 XDAS_Int32 qpMinIntra;
776} IMPEG4ENC_RateControlParams;
777
778
779/**
780 *******************************************************************************
781 * @struct IMPEG4ENC_InterCodingParams
782 * @brief This structure contains all the parameters which controls Inter MBs
783 * coding behavior
784 *
785 * @param interCodingPreset :
786 * This Preset controls the USER_DEFINED vs DEFAULT mode. if User is
787 * not aware about following fields, it should be set as
788 * IMPEG4_INTERCODING_DEFAULT
789 *
790 * @param searchRangeHorP :
791 * Horizontal Search Range for ME algo, range is [16, 144]
792 *
793 * @param searchRangeVerP :
794 * Vertical Search Range for ME algo, range is [16, 32]
795 *
796 * @param globalOffsetME :
797 * This variable is used to control ME search algorithm to improve
798 * video quality by doing ME around Temporal average MV.
799 * 1 for Enable
800 * 0 for Disable
801 *
802 * @param earlySkipThreshold :
803 * Threshold to use for early skip determination
804 * The Inter SAD is compared against this Threshold for early skip
805 * selection
806 *
807 * @param enableThresholdingMethod :
808 * Thresholding cost Method is used by CALC3 suppress expensive
809 * coefficients.Thresholding cost Method is used to set a block to be
810 * not_coded if the block has very few small amplitude coeffs.
811 *
812 * @param minBlockSizeP : minimum block size for P frames.
813 * Refer IMPEG4ENC_InterBlockSize enumeration to see the valid values
814 * if this variable takes value of IMPEG4_BLOCKSIZE_8x8 a MB in P Frame
815 * can have 4 Motion Vectors one for each 8x8 MB to
816 * improve video quality (not necessarily). This mode is used only for
817 * MPEG-4. This Field is neglected or read as Disable for H263 encoding.
818 * Set
819 * IMPEG4_BLOCKSIZE_8x8 for 4MV
820 * else only 1MV
821 *
822 * @param enableRoundingControl :
823 * When enabled reduces the IDCT drift
824 * 1 for Enable
825 * 0 for Disable
826 *******************************************************************************
827*/
828typedef struct IMPEG4ENC_InterCodingParams {
829 XDAS_Int32 interCodingPreset;
830 XDAS_Int32 searchRangeHorP;
831 XDAS_Int32 searchRangeVerP;
832 XDAS_UInt32 globalOffsetME;
833 XDAS_Int32 earlySkipThreshold;
834 XDAS_Int32 enableThresholdingMethod;
835 XDAS_UInt32 minBlockSizeP;
836 XDAS_UInt32 enableRoundingControl;
837
838} IMPEG4ENC_InterCodingParams;
839
840
841/**
842 *******************************************************************************
843 * @struct IMPEG4ENC_IntraCodingParams
844 * @brief This structure contains all the parameters which controls Intra
845 * encoding
846 *
847 * @param intraCodingPreset :
848 * This Preset controls the USER_DEFINED vs DEFAULT mode. if User is
849 * not aware about following fields, it should be set as
850 * IMPEG4_INTERCODING_DEFAULT
851 *
852 * @param intraRefreshMethod :
853 * Intra Refresh methods, this can be any one of the
854 * IMPEG4ENC_IntraRefreshMethods enumeration.
855 * refer IMPEG4ENC_IntraRefreshMethods enumeration above.
856 *
857 * @param intraRefreshRate :
858 * if intraRefreshMethod is IMPEG4_INTRAREFRESH_CYCLIC_MBS, this value
859 * represents madulo cyclic MBs value. MPEG4 Encoder encodes a
860 * macro block as Intra after every intraRefreshRate number of macro
861 * blocks.if intraRefreshMethod is IMPEG4_INTRAREFRESH_CYCLIC_ROWS,
862 * this value represents number if rows which are intra. MPEG4 Encoder
863 * encodes those many rows as intra every frame and the location of
864 * intra rows moves in cyclic fashion.
865 * This variable is ignored if intraRefreshMethod is
866 * IMPEG4_INTRAREFRESH_NONE.
867 *
868 * @param acpredEnable :
869 * AC prediction
870 * 0 for Disable
871 * 1 for Enable
872 *
873 * @param insertGOVHdrBeforeIframe :
874 * inserts GOV Header before I Frame if enabled
875 * 0 for Disable
876 * 1 for Enable
877 *
878 *******************************************************************************
879*/
880typedef struct IMPEG4ENC_IntraCodingParams {
881 XDAS_Int32 intraCodingPreset;
882 XDAS_UInt32 intraRefreshMethod;
883 XDAS_UInt32 intraRefreshRate;
884 XDAS_UInt32 acpredEnable;
885 XDAS_UInt32 insertGOVHdrBeforeIframe;
886 XDAS_UInt32 enableDriftControl;
887
888} IMPEG4ENC_IntraCodingParams;
889
890
891/**
892 *******************************************************************************
893 * @struct IMPEG4ENC_sliceCodingParams
894 * @brief This structure contains all the parameters which controls Intra
895 * encoding
896 *
897 * @param sliceCodingPreset :
898 * This Preset controls the USER_DEFINED vs DEFAULT mode. if User is
899 * not aware about following fields, it should be set as
900 * IMPEG4_INTERCODING_DEFAULT
901 *
902 * @param sliceMode :
903 * This defines the control mechanism to split a picture in slices.
904 * It can be either MB based or bits based and takes the enum
905 * IMPEG4ENC_SliceMode
906 *
907 * @param sliceUnitSize :
908 * The meaning of this parameter depends upon sliceMode.
909 * sliceMode == IMPEG4_SLICEMODE_MBUNIT then this
910 * parameter informs the number of Macroblocks in one slice
911 * sliceMode == IMPEG4_SLICEMODE_BITS then this
912 * parameter informs the number of bits in one slice in MPEG4
913 * jargon resyncIntervalInBits
914 * sliceMode == IMPEG4_SLICEMODE_NONE then this
915 * parameter is not respected
916 *
917 * @param gobInterval :
918 * insert GOB header after every n GOBs
919 * This field is only used for H263
920 * gobInterval range is [0, Max GOB Number-1]
921 *
922 * @param useHec :
923 * Use Header extension code [0-2]
924 * 0 for Disable
925 * 1 Include HEC for only First GobHeader
926 * 2 Include HEC for for all GobHeader
927 *
928 *
929 *******************************************************************************
930*/
931typedef struct IMPEG4ENC_sliceCodingParams {
932 XDAS_Int32 sliceCodingPreset;
933 XDAS_Int32 sliceMode;
934 XDAS_Int32 sliceUnitSize;
935 XDAS_UInt32 gobInterval;
936 XDAS_UInt32 useHec;
937
938} IMPEG4ENC_sliceCodingParams;
939
940
941/**
942 *******************************************************************************
943 * @struct IMPEG4ENC_DynamicParams
944 * @brief This structure defines the dynamic parameters for MPEG4ENC objects
945 *
946 * @param videnc2DynamicParams :
947 * refer IVIDENC2_DynamicParams in ividenc2.h file
948 *
949 * @param rateControlParams :
950 * refer IMPEG4ENC_RateControlParams structure above
951 *
952 * @param interCodingParams :
953 * refer IMPEG4ENC_InterCodingParams structure above
954 *
955 * @param sliceCodingParams :
956 * refer IMPEG4ENC_sliceCodingParams structure above
957 *
958 * @param aspectRatioIdc :
959 * defines the value of pixel aspect ratio
960 * See Table 6-12 of standard spec for aspect ratio details
961 *
962 *******************************************************************************
963*/
964typedef struct IMPEG4ENC_DynamicParams {
965 IVIDENC2_DynamicParams videnc2DynamicParams;
966 IMPEG4ENC_RateControlParams rateControlParams;
967 IMPEG4ENC_InterCodingParams interCodingParams;
968 IMPEG4ENC_sliceCodingParams sliceCodingParams;
969 XDAS_UInt32 aspectRatioIdc;
970}IMPEG4ENC_DynamicParams;
971
972
973/**
974 *******************************************************************************
975 * @struct IMPEG4ENC_DynamicParams
976 * @brief Default dynamic parameter values for MPEG4ENC instance objects
977 * if user defined dynamic parameters are not given to the encoder then
978 * encoder uses this default dynamic parameters (which can be found in
979 * impeg4enc.c file) for encoding.
980 *
981 *******************************************************************************
982*/
983extern IMPEG4ENC_DynamicParams MPEG4ENC_TI_DYNAMICPARAMS;
984
985
986/**
987 *******************************************************************************
988 * @struct IMPEG4ENC_Params
989 * @brief This structure defines the creation parameters for MPEG4ENC objects
990 *
991 * @param videnc2Params :
992 * Defines creation time parameters for all IVIDENC2 instance objects.
993 * refer IVIDENC2_Params structure in ividenc2.h file
994 *
995 * @param rateControlParams :
996 * refer IMPEG4ENC_RateControlParams structure above
997 *
998 * @param interCodingParams :
999 * refer IMPEG4ENC_InterCodingParams structure above
1000 *
1001 * @param intraCodingParams :
1002 * refer IMPEG4ENC_IntraCodingParams structure above
1003 *
1004 * @param sliceCodingParams :
1005 * refer IMPEG4ENC_sliceCodingParams structure above
1006 *
1007 * @param useDataPartitioning :
1008 * Controls data partitioning for MPEG4 Encoder.
1009 * This mode is automatically disabled when short video header is
1010 * enabled
1011 * 0 for Disable
1012 * 1 for Enable
1013 *
1014 * @param useRvlc :
1015 * Use Reversible Variable Length Coding.
1016 * MPEG4 Encoder expects Data Partitioning to be enabled when RVLC is
1017 * enabled or else it returns error.
1018 * This mode is automatically disabled when short video header is
1019 * enabled
1020 * 0 for Disable
1021 * 1 for Enable
1022 *
1023 * @param useShortVideoHeader :
1024 * short video header / h263 base line profile
1025 * MPEG4 Encoder automatically disable the 4 MV, Data Partitioning,
1026 * RVLC modes and reset resync interval in bits (disable H.241 flow)
1027 * 0 for Disable
1028 * 1 for Enable
1029 *
1030 * @param vopTimeIncrementResolution :
1031 * resolution of vop_time_increment bit-stream syntax element,
1032 * number of ticks/sec
1033 *
1034 * @param nonMultiple16RefPadMethod :
1035 * Controls the way the padding is done for Ref Frame when Height is
1036 * non-multiple of 16.
1037 * Follows the enum IMPEG4ENC_nonMultiple16RefPadMethod
1038 * IMPEG4_PAD_METHOD_DIVX - VLC, DIVx way of padding
1039 * IMPEG4_PAD_METHOD_MPEG4 - MPEG4 Standard specific way of padding
1040 * default value is IMPEG4_PAD_METHOD_MPEG4.
1041 *
1042 * @param pixelRange :video_range=0 :Y from 16 to 235, Cb and Cr from 16 to 240;
1043 * video_range=1 : Y from 0 to 255,Cb and Cr from 0 to 255.
1044 *
1045 * @param enableSceneChangeAlgo : Parameter to enable or disable scene change
1046 * algorithm.
1047 * @param useVOS : VOS header insertion, 0 = off, 1 = on
1048 * @param enableMONA : enable MONA settings 0 = off, 1 = on
1049 * @param enableAnalyticinfo : enable MV and SAD access to user
1050 * 0 = off, 1 = on
1051 *
1052 * @param debugTraceLevel : Indicates level of debug trace info to be
1053 * dumped.
1054 * Disabled if this value is zero.
1055 *
1056 * @param lastNFramesToLog : Indicates no. of frames for which debug trace
1057 * info to be dumped. Valid only if debugTraceLevel
1058 * is non zero.
1059 *******************************************************************************
1060*/
1061typedef struct IMPEG4ENC_Params {
1062 IVIDENC2_Params videnc2Params;
1063 IMPEG4ENC_RateControlParams rateControlParams;
1064 IMPEG4ENC_InterCodingParams interCodingParams;
1065 IMPEG4ENC_IntraCodingParams intraCodingParams;
1066 IMPEG4ENC_sliceCodingParams sliceCodingParams;
1067
1068 XDAS_UInt32 useDataPartitioning;
1069 XDAS_UInt32 useRvlc;
1070 XDAS_UInt32 useShortVideoHeader;
1071 XDAS_UInt32 vopTimeIncrementResolution;
1072 XDAS_UInt32 nonMultiple16RefPadMethod;
1073 XDAS_UInt32 pixelRange;
1074 XDAS_UInt32 enableSceneChangeAlgo;
1075 XDAS_UInt32 useVOS;
1076 XDAS_UInt32 enableMONA;
1077 XDAS_Int32 enableAnalyticinfo;
1078
1079 XDAS_UInt32 debugTraceLevel;
1080 XDAS_UInt32 lastNFramesToLog;
1081
1082} IMPEG4ENC_Params;
1083
1084
1085/**
1086 *******************************************************************************
1087 * @struct IMPEG4ENC_Params
1088 * @brief Default parameter values for MPEG4ENC instance objects
1089 * if user defined parameters are not given to the encoder then
1090 * encoder uses this default parameters (which can be found in
1091 * impeg4enc.c file) for encoding.
1092 *
1093 *******************************************************************************
1094*/
1095extern IMPEG4ENC_Params MPEG4ENC_TI_PARAMS;
1096
1097
1098/**
1099 *******************************************************************************
1100 * @struct IMPEG4ENC_Status
1101 * @brief Status structure defines the parameters that can be changed or read
1102 * during real-time operation of the alogrithm.
1103 *
1104 * @param videnc2Status :
1105 * Status of the MPEG4 encoder along with error information, if any.
1106 * refer IVIDENC2_Status structure in ividenc2.h file
1107 *
1108 * @param rateControlParams :
1109 * refer IMPEG4ENC_RateControlParams structure above
1110 *
1111 * @param interCodingParams :
1112 * refer IMPEG4ENC_InterCodingParams structure above
1113 *
1114 * @param intraCodingParams :
1115 * refer IMPEG4ENC_IntraCodingParams structure above
1116 *
1117 * @param sliceCodingParams :
1118 * refer IMPEG4ENC_sliceCodingParams structure above
1119 *
1120 * @param useDataPartitioning :
1121 * Use data partitioning
1122 * 0 for Disable
1123 * 1 for Enable
1124 *
1125 * @param useRvlc :
1126 * Use Reversible Variable Length Coding
1127 * 0 for Disable
1128 * 1 for Enable
1129 *
1130 * @param useShortVideoHeader :
1131 * short video header / h263 base line profile
1132 * 0 for Disable
1133 * 1 for Enable
1134 * @param vopTimeIncrementResolution :Resolution of vop_time_increment
1135 * bit-stream syntax element,
1136 * number of ticks/sec.
1137 *
1138 * @param nonMultiple16RefPadMethod : Controls the way the padding is done
1139 * for Ref Frame when Height is
1140 * Non-multiple of 16.
1141 * @param pixelRange : Pixel range to be put in header
1142 * See IMPEG4VENC_PixelRange enumeration for details.
1143 *
1144 * @param enableSceneChangeAlgo :
1145 * Scene change detection algorithm.
1146 * 0 for Disable
1147 * 1 for Enable
1148 * @param useVOS : VOS header insertion, 0 = off, 1 = on
1149 * @param enableMONA : enable MONA settings 0 = off, 1 = on
1150 * @param enableAnalyticinfo : enable MV and SAD access to user
1151 * 0 = off, 1 = on
1152 *
1153 * @param debugTraceLevel :
1154 * 0 Disable dumping debug data
1155 * 1-4 enable dumping debug data
1156 *
1157 * @param lastNFramesToLog : No. of frame for which debug trace info to be
1158 * dumped.
1159 *
1160 * @param extMemoryDebugTraceAddr : External memory address where debug trace
1161 * info is dunped
1162 *
1163 * @param extMemoryDebugTraceSize : Size of the debug trace info in the
1164 * external memory.
1165 *
1166 *******************************************************************************
1167*/
1168typedef struct {
1169 IVIDENC2_Status videnc2Status;
1170 IMPEG4ENC_RateControlParams rateControlParams;
1171 IMPEG4ENC_InterCodingParams interCodingParams;
1172 IMPEG4ENC_IntraCodingParams intraCodingParams;
1173 IMPEG4ENC_sliceCodingParams sliceCodingParams;
1174
1175 XDAS_UInt32 useDataPartitioning;
1176 XDAS_UInt32 useRvlc;
1177 XDAS_UInt32 useShortVideoHeader;
1178 XDAS_UInt32 vopTimeIncrementResolution;
1179 XDAS_UInt32 nonMultiple16RefPadMethod;
1180 XDAS_UInt32 pixelRange;
1181 XDAS_UInt32 enableSceneChangeAlgo;
1182 XDAS_UInt32 useVOS;
1183 XDAS_UInt32 enableMONA;
1184 XDAS_Int32 enableAnalyticinfo;
1185
1186 XDAS_UInt32 debugTraceLevel;
1187 XDAS_UInt32 lastNFramesToLog;
1188 XDAS_UInt32 *extMemoryDebugTraceAddr;
1189 XDAS_UInt32 extMemoryDebugTraceSize;
1190
1191} IMPEG4ENC_Status;
1192
1193
1194/**
1195 *******************************************************************************
1196 * @struct IMPEG4ENC_InArgs
1197 * @brief This structure defines the runtime input arguments for
1198 * IMPEG4ENC::process function
1199 *
1200 * @param videnc2InArgs :
1201 * Parameters common to video encoders
1202 * refer IVIDENC2_InArgs structure in ividenc2.h file
1203 *
1204 *******************************************************************************
1205*/
1206typedef struct IMPEG4ENC_InArgs {
1207 IVIDENC2_InArgs videnc2InArgs;
1208} IMPEG4ENC_InArgs;
1209
1210
1211/**
1212 *******************************************************************************
1213 * @struct IMPEG4ENC_OutArgs
1214 * @brief This structure defines the run time output arguments for
1215 * IMPEG4ENC::process function
1216 *
1217 * @param videnc2OutArgs :
1218 * output parameters from the IMPEG4ENC::process call
1219 * refer IVIDENC2_OutArgs structure in ividenc2.h file
1220 *
1221 *******************************************************************************
1222*/
1223typedef struct IMPEG4ENC_OutArgs {
1224 IVIDENC2_OutArgs videnc2OutArgs;
1225} IMPEG4ENC_OutArgs;
1226
1227
1228/**
1229 *******************************************************************************
1230 * @struct IMPEG4ENC_Fxns
1231 * @brief This structure defines all of the operations on MPEG4ENC objects
1232 *
1233 * @param ividenc :
1234 * refer IVIDENC2_Fxns structure in ividenc2.h file
1235 *
1236 *******************************************************************************
1237*/
1238typedef struct IMPEG4ENC_Fxns {
1239 IVIDENC2_Fxns ividenc; /* IMPEG4ENC extends IVIDENC */
1240} IMPEG4ENC_Fxns;
1241
1242/**
1243 ******************************************************************************
1244 * @struct IMPEG4ENC_DataSyncDesc
1245 * @brief This structure is an extension of XDM_DataSyncDesc to provide add-
1246 * itional information required for Mode B Packetization according to
1247 * RFC2190.
1248 *
1249 * @param mbAddr: this is a pointer to an array of FIrst MB Addresses in diff
1250 * packets.
1251 * @param gobNumber: this is a pointer to an array of GOB Number of first Mb
1252 * in different packets
1253 * @param quantScale: this is a pointer to an array of Quant values of first
1254 * Mb in different packets
1255 * @param mv: this is a pointer to an array of MV of first MB in different
1256 * packets. Note: the MV is in half-pel reolution as required in
1257 * RFC2190.
1258 ******************************************************************************
1259*/
1260typedef struct IMPEG4ENC_DataSyncDesc {
1261 XDM_DataSyncDesc dataSyncDesc;
1262 XDAS_UInt16 *mbAddr;
1263 XDAS_UInt16 *gobNumber;
1264 XDAS_UInt16 *quantScale;
1265 XDAS_UInt32 *mv;
1266} IMPEG4ENC_DataSyncDesc;
1267
1268#ifdef __cplusplus
1269}
1270#endif /* extern "C" */
1271
1272/*@}*/ /* ingroup HDVICP2MPEG4 */
1273
1274#endif /* IMPEG4ENC_ */
1275
diff --git a/packages/ivahd_codecs/ti/sdo/codecs/mpeg4vdec/impeg4vdec.h b/packages/ivahd_codecs/ti/sdo/codecs/mpeg4vdec/impeg4vdec.h
new file mode 100755
index 0000000..0147bac
--- /dev/null
+++ b/packages/ivahd_codecs/ti/sdo/codecs/mpeg4vdec/impeg4vdec.h
@@ -0,0 +1,1064 @@
1/*
2********************************************************************************
3* HDVICP2.0 Based MPEG4 ASP Decoder
4*
5* "HDVICP2.0 Based MPEG4 ASP Decoder" is software module developed on TI's
6* HDVICP2 based SOCs. This module is capable of decode a 4:2:0 Raw
7* video stream of Advanced/Simple profile and also H.263 bit-stream.
8* Based on ISO/IEC 14496-2:2003."
9* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
10* ALL RIGHTS RESERVED
11********************************************************************************
12*/
13
14/**
15********************************************************************************
16* @file <impeg4vdec.h>
17*
18* @brief This file provides definisions for the interface handles.
19*
20* @author: Ashish Singh (ashish.singh@ti.com)
21*
22* @version 0.0 (June 2009) : Base version created [Ashish]
23*
24* @version 0.1 (Apr 2010) : Review Comments Added [Ananya]
25*
26* @version 0.2 (oct 2010) : cleared doxygen warning and fixed VOP non coded
27* related bugs.
28*
29* @version 0.3 (Nov 2010) : Modified the error bit 20.
30*
31* @version 0.4 (Dec 2010) : Removed the sorenson support and compile time
32* parameter _DEBUGTRACE. [Nitesh]
33*
34* @version 0.5 (May 2011) : Added one more create time parameter paddingMode
35* to support the padding of non multiple of
36* 16 resolution clips, along with this removed some
37* un-neccesary code from interface file [Ashish]
38
39* @version 0.6 (July 2011): rename the error code to have alignment of the error
40* codes related mpeg4 [Ashish]
41*
42* @version 0.7 (Sep 2011): rename the error codes and also introduced more
43* error code as IMPEG4D_ERR_FRAME_DROPPED etc.
44* allocated some reserve space in all interface str
45* for future uses. [Ashish]
46*
47* @version 0.8 (Oct 2011): renamed the enum macros to appropriate uses cases.
48* removed unwanted enum from the inetrface file.
49* added debug trace level enum to interface file
50* [Ashish]
51*
52* @version 0.9 (Mar 2012) : Added create time params & enums to support Enhanced
53* deblocking feature [Mahantesh]
54*
55* @version 1.0 (May 2012) : MB Info format structure added [Mahantesh]
56*
57* @version 0.9 (July 2012): Added create time params, enums & Macros to support
58* only I frame decoding [Mahantesh]
59*******************************************************************************
60*/
61
62/* -------------------- compilation control switches ---------------------- */
63
64#ifndef _IMPEG4VDEC_H_
65#define _IMPEG4VDEC_H_
66
67/****************************************************************************
68* INCLUDE FILES
69*****************************************************************************/
70/* -------------------- system and platform files ------------------------- */
71/* ------------------------- program files -------------------------------- */
72
73#include <ti/xdais/xdas.h>
74#include <ti/xdais/dm/ividdec3.h>
75#include <ti/sdo/fc/ires/hdvicp/ires_hdvicp2.h>
76#include <ti/xdais/ialg.h>
77
78
79/****************************************************************************
80* EXTERNAL REFERENCES NOTE : only use if not found in header file
81*****************************************************************************/
82/* ------------------------ data declarations ----------------------------- */
83/* ----------------------- function prototypes ---------------------------- */
84
85/****************************************************************************
86* PUBLIC DECLARATIONS Defined here, used elsewhere
87*****************************************************************************/
88/* ----------------------- data declarations ------------------------------ */
89/**
90* Macro defined for Offset version length
91*/
92#define IMPEG4DEC_VERSION_LENGTH 53
93/**
94*******************************************************************************
95* @struct IMPEG4VDEC_Obj
96*
97* @brief This structure must be the first field of all mp4VDEC instance
98* objects
99*
100* @param fxns
101* Handle to extented mpeg4 video decoder library interface functions
102*
103* @note None
104********************************************************************************
105*/
106typedef struct IMPEG4VDEC_Obj
107{
108 struct IMPEG4VDEC_Fxns *fxns;
109} IMPEG4VDEC_Obj;
110
111/**
112*******************************************************************************
113* @struct IMPEG4VDEC_Handle
114*
115* @brief This handle is used to reference all mp4VDEC instance objects
116*
117* @note None
118********************************************************************************
119*/
120typedef struct IMPEG4VDEC_Obj *IMPEG4VDEC_Handle;
121
122/**
123*******************************************************************************
124* @struct IMPEG4VDEC_Status
125*
126* @brief Status structure defines the parameters that can be changed or
127* read during real-time operation of the alogrithm.
128*
129* @param viddec3Status
130* Handle to base class status struture which defines the all
131* run time parameters.
132*
133* @param lastNFramesToLog
134* element to set the number of frame traces required before the
135* current frame decoded
136*
137* @param extMemoryDebugTraceAddr
138* External memory address where codec dumps the debug trace logs
139*
140* @param extMemoryDebugTraceSize
141* size of the debug trace logs dump by codec in external memory
142*
143* @param reserved[3]
144* allocted reserve space for future uses
145*
146* @note None
147********************************************************************************
148*/
149typedef struct IMPEG4VDEC_Status
150{
151 IVIDDEC3_Status viddec3Status;
152
153 XDAS_UInt32 debugTraceLevel;
154 XDAS_UInt32 lastNFramesToLog;
155 XDAS_UInt32 *extMemoryDebugTraceAddr;
156 XDAS_UInt32 extMemoryDebugTraceSize;
157 XDAS_UInt32 reserved[3];
158} IMPEG4VDEC_Status;
159
160/**
161*******************************************************************************
162* @struct IMPEG4VDEC_Cmd
163*
164* @brief The Cmd enumeration defines the control commands for the MPEG4
165* video decoder control method.
166*
167* @note None
168********************************************************************************
169*/
170typedef IVIDDEC3_Cmd IMPEG4VDEC_Cmd;
171
172/**
173*******************************************************************************
174* @struct IMPEG4VDEC_Params
175*
176* @brief This structure defines the creation parameters for all
177* mp4VDEC objects
178*
179* @param viddecParams
180* Defines the creation time parameters for
181* all IVIDDEC3 instance objects.
182*
183* @param outloopDeBlocking
184* Flag for Optional deBlock filter ON or Enhanced filtering ON
185*
186* @param errorConcealmentEnable
187* flag to set error concealment feature-set on or off
188*
189* @param sorensonSparkStream
190* Flag reserved for future usage for sorenson spark stream
191*
192* @param debugTraceLevel
193* element to set the debug trace level, codec will give trace
194* info base on tarce level
195*
196* @param lastNFramesToLog
197* element to set the number of frame traces required before the
198* current frame decoded
199*
200* @param paddingMode
201* Flag to set the padding type used by codec for non multiple
202* for 16 resolution clips
203*
204* @param enhancedDeBlockingQp
205* QP value to be used for filtering all edges
206*
207* @param decodeOnlyIntraFrames
208* Flag to indicate codec to decode only I frames from bitstream
209*
210* @param reserved
211* allocted reserve space for future uses
212*
213* @note None
214********************************************************************************
215*/
216typedef struct IMPEG4VDEC_Params
217{
218 IVIDDEC3_Params viddec3Params;
219 XDAS_Int32 outloopDeBlocking;
220 XDAS_Int32 errorConcealmentEnable;
221 XDAS_Int32 sorensonSparkStream;
222 XDAS_UInt32 debugTraceLevel;
223 XDAS_UInt32 lastNFramesToLog;
224 XDAS_UInt32 paddingMode;
225 XDAS_UInt32 enhancedDeBlockingQp;
226 XDAS_UInt32 decodeOnlyIntraFrames;
227 XDAS_UInt32 reserved;
228} IMPEG4VDEC_Params;
229
230extern IMPEG4VDEC_Params IMPEG4VDEC_PARAMS;
231
232/**
233*******************************************************************************
234* @struct IMPEG4VDEC_DynamicParams
235*
236* @brief This structure defines the run time parameters for all
237* mp4VDEC objects
238*
239* @param viddecDynamicParams
240* Defines the run time parameters for
241* all IVIDDEC3 instance objects.
242*
243* @param reserved[3]
244* allocted reserve space for future uses
245
246* @see None
247********************************************************************************
248*/
249typedef struct IMPEG4VDEC_DynamicParams
250{
251 IVIDDEC3_DynamicParams viddec3DynamicParams;
252 XDAS_UInt32 reserved[3];
253} IMPEG4VDEC_DynamicParams;
254
255extern IMPEG4VDEC_DynamicParams IMPEG4VDEC_TI_DYNAMICPARAMS;
256/**
257*******************************************************************************
258* @struct IMPEG4VDEC_InArgs
259*
260* @brief This structure defines the run time input arguments for all VIDDEC
261* objects.This structure may be extended by individual codec
262* implementation allowing customization with vendor specific
263* parameters.
264*
265* @param viddec3InArgs
266* Defines the input arguments for all IVIDDEC3 instance
267* process function.
268*
269* @see None
270********************************************************************************
271*/
272typedef struct IMPEG4VDEC_InArgs
273{
274 IVIDDEC3_InArgs viddec3InArgs;
275}IMPEG4VDEC_InArgs;
276
277/**
278*******************************************************************************
279* @struct IMPEG4VDEC_OutArgs
280*
281* @brief This structure defines the run time output arguments for VIDDEC
282* objects.This structure may be extended by individual codec
283* implementation allowing customization with vendor specific
284* parameters.
285*
286* @param viddec3OutArgs
287* Defines the output arguments for all IVIDDEC3 instance
288* process function.
289
290* @param vopTimeIncrementResolution
291* VOP Time increamnet resolution info present in mpeg4 stream
292
293* @param vopTimeIncrement
294* VOP Time increment info present in mpeg4 stream
295*
296* @param mp4ClosedGov
297* Flag to get to know info about closed_gov
298*
299* @param mp4BrokenLink
300* Flag to get to know info about mpeg4 broken link
301*
302* @note None
303********************************************************************************
304*/
305typedef struct IMPEG4VDEC_OutArgs
306{
307 IVIDDEC3_OutArgs viddec3OutArgs;
308 XDAS_Int32 vopTimeIncrementResolution;
309 XDAS_Int32 vopTimeIncrement;
310 XDAS_Int32 mp4ClosedGov;
311 XDAS_Int32 mp4BrokenLink;
312}IMPEG4VDEC_OutArgs;
313
314/**
315*******************************************************************************
316* @enum IMPEG4VDEC_ErrorBit
317*
318* @brief Mpeg4 Error Codes: Delaration of mpeg4 decoder specific Error
319* Codes.
320* @details Error status is communicated through a 32 bit word. In this,
321* Error Bits 8 to 15 are used to indicate the XDM error bits. See
322* XDM_ErrorBit definition in xdm.h. Other bits in a 32 bit word
323* can be used to signal any codec specific errors. The staructure
324* below enumerates the mpeg4 decoder specific error bits used.
325* The algorithm can set multiple bits to 1 depending on the error
326* condition
327*
328********************************************************************************
329*/
330typedef enum
331{
332 IMPEG4D_ERR_VOS = 0,
333 /**<
334* Bit 0
335* 1 - No Video Object Sequence detected in the frame
336* 0 - Ignore
337*/
338
339 IMPEG4D_ERR_VO,
340 /**<
341* Bit 1
342* 1 - Incorrect Video Object type
343* 0 - Ignore
344*/
345
346 IMPEG4D_ERR_VOL,
347 /**<
348* Bit 2
349* 1 - Error in Video Object Layer detected
350* 0 - Ignore
351*/
352
353 IMPEG4D_ERR_GOV,
354 /**<
355* Bit 3
356* 1 - Error in Group of Video parsing
357* 0 - Ignore
358*/
359
360 IMPEG4D_ERR_VOP,
361 /**<
362* Bit 4
363* 1 - Error in Video Object Plane parsing
364* 0 - Ignore
365*/
366
367 IMPEG4D_ERR_SHORTHEADER,
368 /**<
369* Bit 5
370* 1 - Error in short header parsing
371* 0 - Ignore
372*/
373
374 IMPEG4D_ERR_GOB,
375 /**<
376* Bit 6
377* 1 - Error in GOB parsing
378* 0 - Ignore
379*/
380
381 IMPEG4D_ERR_VIDEOPACKET,
382 /**<
383* Bit 7
384* 1 - Error in Video Packet parsing
385* 0 - Ignore
386*/
387
388 IMPEG4D_ERR_MBDATA = 16 ,
389 /**<
390* Bit 16
391* 1 - Error in MB data parsing
392* 0 - Ignore
393*/
394
395 IMPEG4D_ERR_INVALIDPARAM_IGNORE,
396 /**<
397* Bit 17
398* 1 - Invalid Parameter
399* 0 - Ignore
400*/
401
402 IMPEG4D_ERR_UNSUPPFEATURE,
403 /**<
404* Bit 18
405* 1 - Unsupported feature
406* 0 - Ignore
407*/
408
409 IMPEG4D_ERR_STREAM_END,
410 /**<
411* Bit 19
412* 1 - End of stream reached
413* 0 - Ignore
414*/
415
416 IMPEG4D_ERR_VALID_HEADER_NOT_FOUND,
417 /**<
418* Bit 20
419* 1 - Vaild header not found.i.e (VOL/VOP not found)
420* 0 - Ignore
421*/
422
423 IMPEG4D_ERR_UNSUPPRESOLUTION,
424 /**<
425* Bit 21
426* 1 - Unsupported resolution by the decoder
427* 0 - Ignore
428*/
429
430 IMPEG4D_ERR_BITSBUF_UNDERFLOW,
431 /**<
432* Bit 22
433* 1 - The stream buffer has underflowed
434* 0 - Ignore
435*/
436
437 IMPEG4D_ERR_INVALID_MBOX_MESSAGE,
438 /**<
439* Bit 23
440* 1 - Invalid (unexpected) mail boX message recieved by IVAHD
441* 0 - Ignore
442*/
443 IMPEG4D_ERR_NO_FRAME_FOR_FLUSH,
444 /**<
445* Bit 24
446* 1 - Codec does not have any frame for flushing out to application
447* 0 - Ignore
448*/
449 IMPEG4D_ERR_VOP_NOT_CODED,
450 /**<
451* Bit 25
452* 1 - Given vop is not codec
453* 0 - Ignore
454*/
455 IMPEG4D_ERR_START_CODE_NOT_PRESENT,
456 /**<
457* Bit 26
458* 1 - Start code for given stream is not present in case of Parse Header
459* Mode
460* 0 - Ignore
461*/
462 IMPEG4D_ERR_VOP_TIME_INCREMENT_RES_ZERO,
463 /**<
464* Bit 27
465* 1 - Unsupported time increment resolution by the decoder
466* 0 - Ignore
467*/
468 IMPEG4D_ERR_PICSIZECHANGE,
469 /**<
470* Bit 28
471* 1 - resolution gets change in between process call
472* 0 - Ignore
473*/
474 IMPEG4D_ERR_UNSUPPORTED_H263_ANNEXS,
475 /**<
476* Bit 29
477* 1 - Unsupported annexs of the H263
478* 0 - Ignore
479*/
480 IMPEG4D_ERR_HDVICP2_IMPROPER_STATE,
481 /**<
482* Bit 30
483* 1 - HDVCIP is not in correct state
484* 0 - Ignore
485*/
486 IMPEG4D_ERR_IFRAME_DROPPED
487 /**<
488* Bit 31
489* 1 - Current frame is lost,no frame is present for decode
490* 0 - Ignore
491*/
492
493} IMPEG4VDEC_ErrorBit;
494
495/**
496******************************************************************************
497* @enum IMPEGVDEC_MetadataType
498* @brief This enum indicates Meta Data types for MPEG4 ASP Decoder
499*
500* @remarks The way to get meta data from decoder is via outBufs of the
501* decoder during process call.
502******************************************************************************
503*/
504
505typedef enum
506{
507 IMPEGVDEC_PARSED_MB_INFO_DATA = XDM_CUSTOMENUMBASE,
508 IMPEGVDEC_PARSED_MB_ERROR_INFO_DATA,
509 IMPEGVDEC_PARSED_ALFA_DATA
510} IMPEGVDEC_MetadataType;
511
512/**
513*******************************************************************************
514* @enum _IMPEG4MemDescription
515* @brief MemDescription of IVAHD MPEG4 ASP Decoder implementation by TI.
516*
517* @remarks this enum explain the type of memory required by mpeg4 ASP decoder
518*
519*******************************************************************************
520*/
521
522typedef enum _IMPEG4MemDescription
523{
524 IMPEG4VDEC_OBJECT,
525 /**
526* this memory type is allocated by alg_alloc call & this is allocated
527* for handle of decoder
528*/
529 IMPEG4VDEC_DEBUG_TRACE_BUF,
530 /**<
531* Memtab for debug trace parameter storage
532*/
533 IMPEG4VDEC_COLOC_PMBDATA,
534
535 /**
536* Number of MemTab required if no-Deblock and no-B colocated MB info
537* required
538*/
539 IMPEG4VDEC_COLOC_BMBDATA ,
540 /**
541* this memory type is allocated by IRES & this is for storing the colocated
542* MB data for B Frame
543*/
544 IMPEG4VDEC_DEBLOCK_OFF_TOTAL_MEMTABS,
545 /**
546* Number of MemTab required if Deblock is Off required
547*/
548 IMPEG4VDEC_LUMARECON_DATA_BUF0 = IMPEG4VDEC_DEBLOCK_OFF_TOTAL_MEMTABS,
549 /**
550* this memory type is allocated by IRES & this is for storing the decoded
551* Luma data for Recon Frame used in case of Deblock Enable
552*/
553 IMPEG4VDEC_LUMARECON_DATA_BUF1,
554 /**
555* this memory type is allocated by IRES & this is for storing the decoded
556* Luma data for Recon Frame used in case of Deblock Enable
557*/
558 IMPEG4VDEC_LUMARECON_DATA_BUF2,
559 /**
560* this memory type is allocated by IRES & this is for storing the decoded
561* Luma data for Recon Frame used in case of Deblock Enable
562*/
563 IMPEG4VDEC_CHROMARECON_DATA_BUF0,
564 /**
565* this memory type is allocated by IRES & this is for storing the decoded
566* Chroma data for Recon Frame used in case of Deblock Enable
567*/
568 IMPEG4VDEC_CHROMARECON_DATA_BUF1,
569 /**
570* this memory type is allocated by IRES & this is for storing the decoded
571* Chroma data for Recon Frame used in case of Deblock Enable
572*/
573 IMPEG4VDEC_CHROMARECON_DATA_BUF2,
574 /**
575* this memory type is allocated by IRES & this is for storing the decoded
576* Chroma data for Recon Frame used in case of Deblock Enable
577*/
578
579 IMPEG4VDEC_DEBLOCK_ON_TOTAL_MEMTABS,
580 /**
581* Number of memtab required if deblock is on and it will be maximum
582* resource required by codec
583*/
584 IMPEG4VDEC_MAX_MEMTABS = IMPEG4VDEC_DEBLOCK_ON_TOTAL_MEMTABS
585 /**
586* Maximum number of memtab required
587*/
588}IMEPG4VDEC_MemDescription;
589
590/*
591* Number of 1D resource required by codec from IRES
592*/
593#define IMEPG4VDEC_TOTAL_1D_OBJECTS 0x4
594/*
595* Number of 2D resource required by codec from IRES when filtering is off
596*/
597#define IMEPG4VDEC_MIN_2D_OBJECTS 0x0
598/*
599* Number of 2D resource required by codec from IRES when filtering is on
600*/
601#define IMEPG4VDEC_MAX_2D_OBJECTS 0x6
602/*
603* Number of 1D resource required by codec from IRES
604*/
605#define IMEPG4VDEC_TOTAL_1D_OBJECTS_DECODE_ONLY_I_FRAMES 0x3
606/*
607* Number of 1D resource required by codec from IRES when
608* decodeOnlyIntraframes = 1
609*/
610#define IMPEG4VDEC_DEBLOCK_OFF_TOTAL_MEMTABS_DECODE_ONLY_I_FRAMES 0x3
611/*
612* Number of memtab required if deblock is on and decodeOnlyIntraframes = 1,
613* and it will be maximum resource required by codec
614*/
615#define IMPEG4VDEC_DEBLOCK_ON_TOTAL_MEMTABS_DECODE_ONLY_I_FRAMES 0x5
616/*
617* Number of 2D resource required by codec from IRES when filtering is on and
618* decodeOnlyIntraframes = 1
619*/
620#define IMEPG4VDEC_MAX_2D_OBJECTS_DECODE_ONLY_I_FRAMES 0x2
621/*
622* Luma recon buffer index in memory resource handle array
623*/
624#define IMPEG4VDEC_LUMARECON_DATA_BUF0_DECODE_ONLY_I_FRAMES 0x3
625/*
626* Chroma recon buffer index in memory resource handle array
627*/
628#define IMPEG4VDEC_CHROMARECON_DATA_BUF0_DECODE_ONLY_I_FRAMES 0x4
629/**
630*******************************************************************************
631* @struct IMPEG4VDEC_Fxns
632*
633* @brief This structure defines all of the operations on mp4VDEC objects.
634*
635* @param ividdec3
636* handle to the all function of the operations on IVIDDEC3 objects
637*
638* @see None
639********************************************************************************
640*/
641typedef struct IMPEG4VDEC_Fxns
642{
643 IVIDDEC3_Fxns ividdec3;
644} IMPEG4VDEC_Fxns;
645
646/**
647 ******************************************************************************
648 * @enum IMPEG4VDEC_FrameFlushState
649 * @brief This enum indicates whether to frame needs to flush or not
650 *
651 ******************************************************************************
652*/
653typedef enum
654{
655 IMPEG4VDEC_FLUSH_DISABLE = 0,
656 /**
657 * Flag to set the frame flush is disable
658 */
659 IMPEG4VDEC_FLUSH_ENABLE
660 /**
661 * Flag to set the frame flush is Enable
662 */
663}IMPEG4VDEC_FrameFlushState;
664
665/**
666 ******************************************************************************
667 * @enum IMPEG4VDEC_ColocatedBFrameMBinfoStoreMode
668 * @brief This enum indicates whether to Application needs co-located
669 * MB data or not
670 *
671 ******************************************************************************
672*/
673typedef enum
674{
675 IMPEG4VDEC_STORE_COLOCATED_BMBINFO_DISABLE = 0,
676 /**
677 * Flag to set the co-located MB info disable
678 */
679 IMPEG4VDEC_STORE_COLOCATED_BMBINFO_ENABLE
680 /**
681 * Flag to set the co-located MB info enable
682 */
683}IMPEG4VDEC_ColocatedBFrameMBinfoStoreMode;
684
685/**
686 ******************************************************************************
687 * @enum IMPEG4VDEC_OptionalDeBlkMode
688 * @brief This enum indicates whether deblock need to be done or not
689 *
690 ******************************************************************************
691*/
692typedef enum
693{
694 IMPEG4VDEC_DEBLOCK_DISABLE = 0,
695 /**
696 * Flag to set the de-block disable
697 */
698 IMPEG4VDEC_DEBLOCK_ENABLE,
699 /**
700 * Flag to set the de-block enable
701 */
702 IMPEG4VDEC_ENHANCED_DEBLOCK_ENABLE
703 /**
704 * Flag to set the de-block enable for 8x8 edges of all Macroblocks
705 * including its top & left edges.
706 */
707}IMPEG4VDEC_OptionalDeBlkMode;
708
709/**
710 ******************************************************************************
711 * @enum IMPEG4VDEC_EnhancedDeblockQp
712 * @brief This enum the MIN & MAX values that QP can take while filering
713 * for all edges is enabled
714 *
715 ******************************************************************************
716*/
717typedef enum
718{
719 IMPEG4VDEC_DEBLOCK_QP_MIN = 1,
720 /**
721 * Indicates min QP value when fitering all edges is enabled
722 */
723 IMPEG4VDEC_DEBLOCK_QP_MAX = 31
724 /**
725 * Indicates max QP value when fitering all edges is enabled
726 */
727}IMPEG4VDEC_EnhancedDeblockQp;
728/**
729 ******************************************************************************
730 * @enum IMPEG4VDEC_ErrorConcealmentMode
731 * @brief This enum indicates whether to apply error concealment or not
732 *
733 ******************************************************************************
734*/
735typedef enum
736{
737 IMPEG4VDEC_EC_DISABLE = 0,
738 /**
739 * Flag to set error concealement disable
740 */
741 IMPEG4VDEC_EC_ENABLE
742 /**
743 * Flag to error concealment enable
744 */
745}IMPEG4VDEC_ErrorConcealmentMode;
746
747/**
748 ******************************************************************************
749 * @enum IMPEG4VDEC_PaddingModeForNonMultipleOf16Res
750 * @brief These enumerations captures different methods of padding the Ref
751 * frame when dimension is non multiple of 16.
752 *
753 ******************************************************************************
754*/
755typedef enum
756{
757 /**
758 * Method as suggested by DivX spec.
759 */
760 IMPEG4VDEC_DIVX_MODE_PADDING = 0,
761 /**
762 * Method as suggested by MPEG4 spec.
763 */
764 IMPEG4VDEC_MPEG4_MODE_PADDING = 1 ,
765 /**
766 * Default mode is DIVX suggested way.
767 */
768 IMPEG4VDEC_DEFAULT_MODE_PADDING = IMPEG4VDEC_DIVX_MODE_PADDING
769} IMPEG4VDEC_PaddingModeForNonMultipleOf16Res;
770
771/**
772 ******************************************************************************
773 * @enum IMPEG4VDEC_debugTraceLevel
774 * @brief These enumerations captures different debug trace level supported by
775 * codec.
776 *
777 ******************************************************************************
778*/
779typedef enum
780{
781 IMPEG4VDEC_DEBUGTRACE_LEVEL0 = 0,
782 /** 0: Debug Trace Level 0
783 */
784 IMPEG4VDEC_DEBUGTRACE_LEVEL1,
785 /** 1: Debug Trace Level 1
786 */
787 IMPEG4VDEC_DEBUGTRACE_LEVEL2,
788 /** 2: Debug Trace Level 2
789 */
790 IMPEG4VDEC_DEBUGTRACE_MAXLEVEL = IMPEG4VDEC_DEBUGTRACE_LEVEL2
791 /** 2: Max level of debug trace
792 */
793}IMPEG4VDEC_DebugTraceLevel;
794
795/**
796 ******************************************************************************
797 * @enum IMPEG4VDEC_DecodeOnlyIntraFrames
798 * @brief This enum indicates whether codec should decode only I frames
799 * or all frames
800 *
801 ******************************************************************************
802*/
803typedef enum
804{
805 IMPEG4VDEC_DECODE_ONLY_I_FRAMES_DISABLE = 0,
806 /**
807 * Flag to set error concealement disable
808 */
809 IMPEG4VDEC_DECODE_ONLY_I_FRAMES_ENABLE
810 /**
811 * Flag to error concealment enable
812 */
813}IMPEG4VDEC_DecodeOnlyIntraFrames;
814
815/**
816 ******************************************************************************
817 * @enum IMPEG4VDEC_FrameToLog
818 * @brief These enumerations captures the max number of frame for which codec
819 * will dump debug trace.
820 *
821 ******************************************************************************
822*/
823typedef enum
824{
825 IMPEG4VDEC_MINNUM_OF_FRAME_LOGS = 0,
826 /** 0: minimum number of frames for which debug trace would be
827 * dump.
828 */
829 IMPEG4VDEC_MAXNUM_OF_FRAME_LOGS = 10
830 /** 10:max number of frames for which debug trace would be
831 * dump.
832 */
833}IMPEG4VDEC_FrameToLog;
834
835/**
836 ******************************************************************************
837 * @struct IMPEG4VDEC_TI_CommonInfo
838 *
839 * @brief This structure defines the common fields in MB info
840 *
841 ******************************************************************************
842*/
843typedef struct _IMPEG4VDEC_TI_CommonInfo
844{
845 XDAS_UInt32 codec_type:8;
846 XDAS_UInt32 fmt_type:8;
847 XDAS_UInt32 mb_ll_avail:1;
848 XDAS_UInt32 mb_ul_avail:1;
849 XDAS_UInt32 mb_uu_avail:1;
850 XDAS_UInt32 mb_ur_avail:1;
851 XDAS_UInt32 pic_bound_l:1;
852 XDAS_UInt32 pic_bound_u:1;
853 XDAS_UInt32 pic_bound_r:1;
854 XDAS_UInt32 pic_bound_b:1;
855 XDAS_UInt32 first_mb_flag:1;
856 XDAS_UInt32 error_flag:1;
857 XDAS_UInt32 zero:6;
858 XDAS_UInt32 zeroes:16;
859 XDAS_UInt32 mb_addr:16;
860
861} IMPEG4VDEC_TI_CommonInfo;
862
863/**
864 ******************************************************************************
865 * @struct IMPEG4VDEC_TI_CodecSpecificWordSix
866 *
867 * @brief This structure defines codec specific fields in MB info
868 *
869 ******************************************************************************
870*/
871typedef struct _IMPEG4VDEC_TI_CodecSpecificWordSix
872{
873 XDAS_UInt32 pred_mode:3;
874 XDAS_UInt32 zero7:9;
875 XDAS_UInt32 pred_type:2;
876 XDAS_UInt32 gob_frame_id:2;
877 XDAS_UInt32 gob_number:5;
878 XDAS_UInt32 gob_header_empty:1;
879 XDAS_UInt32 forward_top_field_reference:1;
880 XDAS_UInt32 forward_bottom_field_reference:1;
881 XDAS_UInt32 backward_top_field_reference:1;
882 XDAS_UInt32 backward_bottom_field_reference:1;
883 XDAS_UInt32 header_extension_code:1;
884 XDAS_UInt32 zero6:5;
885 XDAS_UInt32 pattern_code:6;
886 XDAS_UInt32 zero5:2;
887 XDAS_UInt32 intra_dc_vlc_thr:3;
888 XDAS_UInt32 zero4:5;
889 XDAS_UInt32 not_coded:1;
890 XDAS_UInt32 dct_type:1;
891 XDAS_UInt32 ac_pred_flag:1;
892 XDAS_UInt32 cond_skip_flag:1;
893 XDAS_UInt32 use_intra_dc_vlc:1;
894 XDAS_UInt32 end_of_texture:1;
895 XDAS_UInt32 zero3:2;
896 XDAS_UInt32 vop_fcode_forward:3;
897 XDAS_UInt32 zero2:1;
898 XDAS_UInt32 vop_fcode_backward:3;
899 XDAS_UInt32 zero1:1;
900
901} IMPEG4VDEC_TI_CodecSpecificWordSix;
902
903/**
904 ******************************************************************************
905 * @struct IMPEG4VDEC_TI_CodecSpecificWordSix
906 *
907 * @brief This structure defines codec specific fields in MB info
908 *
909 ******************************************************************************
910*/
911typedef struct _IMPEG4VDEC_TI_CodecSpecificWordSeven
912{
913 XDAS_UInt32 dc_scaler_luma:6;
914 XDAS_UInt32 zero4:10;
915 XDAS_UInt32 dc_scaler_chroma:5;
916 XDAS_UInt32 zero3:11;
917 XDAS_UInt32 quant_c:5;
918 XDAS_UInt32 zero2:19;
919 XDAS_UInt32 quantiser_scale:5;
920 XDAS_UInt32 zero1:3;
921
922} IMPEG4VDEC_TI_CodecSpecificWordSeven;
923
924/**
925 ******************************************************************************
926 * @struct IMPEG4VDEC_TI_MotionVector
927 *
928 * @brief This structure defines format of Motion Vectors as present in MBinfo
929 *
930 ******************************************************************************
931*/
932typedef struct _IMPEG4VDEC_TI_MotionVector
933{
934 XDAS_Int16 x;
935 XDAS_Int16 y;
936} IMPEG4VDEC_TI_MotionVector;
937
938/**
939 ******************************************************************************
940 * @struct IMPEG4VDEC_TI_MvBidirectional4
941 *
942 * @brief This structure defines Motion Vectors at 8x8 level in both
943 * directions
944 *
945 ******************************************************************************
946*/
947typedef struct _IMPEG4VDEC_TI_MvBidirectional4
948{
949 IMPEG4VDEC_TI_MotionVector mv_forward[4];
950 IMPEG4VDEC_TI_MotionVector mv_backward[4];
951
952} IMPEG4VDEC_TI_MvBidirectional4;
953
954/**
955 ******************************************************************************
956 * @struct IMPEG4VDEC_TI_MbInfo
957 *
958 * @brief This structure details the data format for MB information shared to
959 * application. This helps application to understand all fields
960 * the way codec uses MB info internally. This structure is of size
961 * 112 Bytes.
962 *
963 * @param info : This elements gives details about the MB placement in the
964 * frame.
965 *
966 * @param IQedDCY2: This field holds the Inverse Quantized DC for Y2 MB
967 *
968 * @param IQedDCY3: This field holds the Inverse Quantized DC for Y3 MB
969 *
970 * @param IQedDCY2: This field holds the Inverse Quantized DC for Cb MB
971 *
972 * @param IQedDCY3: This field holds the Inverse Quantized DC for Cr MB
973 *
974 * @param IQedDCY1: This field holds the Inverse Quantized DC for Y1 MB
975 *
976 * @param zeroes1[3]: This field is set to 0
977 *
978 * @param DP_DC_Y0: If data partition = 1, this field contains DC coefficient
979 * values for Y0 MB
980 *
981 * @param DP_DC_Y1: If data partition = 1, this field contains DC coefficient
982 * values for Y1 MB
983 *
984 * @param DP_DC_Y2: If data partition = 1, this field contains DC coefficient
985 * values for Y2 MB
986 *
987 * @param DP_DC_Y3: If data partition = 1, this field contains DC coefficient
988 * values for Y3 MB
989 *
990 * @param DP_DC_Cb: If data partition = 1, this field contains DC coefficient
991 * values for Cb MB
992 *
993 * @param DP_DC_Cr: If data partition = 1, this field contains DC coefficient
994 * values for Cr MB
995 *
996 * @param Reserved: Reserved field
997 *
998 * @param zeroes2[2]: This field is set to 0
999 *
1000 * @param codecSpecificinfoWordSix: Codec specific fields
1001 *
1002 * @param codecSpecificinfoWordSeven: Codec specific fields
1003 *
1004 * @param zeroes3[4]: This field is set to 0
1005 *
1006 * @param mv_forward_backward: Lists all Motion vectors at 4x4 level in L0 &
1007 * L1 direction. First 4 MVs in L0 next 4 MVs in
1008 * L1 direction.
1009 *
1010 * @param bidirectional4: Lists all Motion vectors at 8x8 level in both
1011 * directions
1012 ******************************************************************************
1013*/
1014typedef struct _IMPEG4VDEC_TI_MbInfo
1015{
1016 IMPEG4VDEC_TI_CommonInfo info;
1017
1018 XDAS_Int16 IQedDCY2;
1019 XDAS_Int16 IQedDCY3;
1020 XDAS_Int16 IQedDCCb;
1021 XDAS_Int16 IQedDCCr;
1022
1023 XDAS_Int16 IQedDCY1;
1024 XDAS_Int16 zeroes1[3];
1025
1026 XDAS_Int16 DP_DC_Y0;
1027 XDAS_Int16 DP_DC_Y1;
1028 XDAS_Int16 DP_DC_Y2;
1029 XDAS_Int16 DP_DC_Y3;
1030
1031 XDAS_Int16 DP_DC_Cb;
1032 XDAS_Int16 DP_DC_Cr;
1033 XDAS_Int32 Reserved;
1034
1035 XDAS_Int32 zeroes2[2];
1036
1037 IMPEG4VDEC_TI_CodecSpecificWordSix codecSpecificinfoWordSix;
1038
1039 IMPEG4VDEC_TI_CodecSpecificWordSeven codecSpecificinfoWordSeven;
1040
1041 XDAS_Int32 zeroes3[4];
1042
1043 union {
1044 IMPEG4VDEC_TI_MotionVector mv_forward_backward[8];
1045 IMPEG4VDEC_TI_MvBidirectional4 bidirectional4;
1046 } IMPEG4VDEC_TI_motion_vecs;
1047
1048
1049} IMPEG4VDEC_TI_MbInfo;
1050
1051#endif /*_IMPEG4VDEC_H_*/
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
diff --git a/packages/ivahd_codecs/ti/sdo/codecs/vc1enc/ivc1enc.h b/packages/ivahd_codecs/ti/sdo/codecs/vc1enc/ivc1enc.h
new file mode 100644
index 0000000..83e61b9
--- /dev/null
+++ b/packages/ivahd_codecs/ti/sdo/codecs/vc1enc/ivc1enc.h
@@ -0,0 +1,996 @@
1/*
2 *******************************************************************************
3 *
4 * HDVICP2.0 Based VC1 Encoder
5 *
6 * "HDVICP2.0 Based VC1 Encoder" is software module developed on TI's
7 * HDVICP2 based SOCs. This module is capable of compressing a 4:2:0 Raw
8 * video into a simple/main/advanced profile bit-stream. Based on SMPTE 421M."
9 * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
10 * ALL RIGHTS RESERVED
11 *******************************************************************************
12*/
13
14/*!
15 *****************************************************************************
16 * @file ivc1enc.h
17 *
18 * @brief Interface header file
19 *
20 * @version 0.1 (Nov 2011) : Initial version [Prasad]
21 *
22 *****************************************************************************
23 */
24
25#ifndef _IVC1ENC_H_
26#define _IVC1ENC_H_
27
28#include <ti/xdais/ialg.h>
29#include <ti/xdais/dm/ividenc2.h>
30
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
36/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
37/* Definition of all the macros define by this interafce */
38/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
39/**
40 Maximum Number of slice start points
41*/
42#define IVC1ENC_MAX_NUM_SLICE_START_OFFSET (3)
43/**
44 Length of the version string. The memory to get version
45 number is owned by application
46*/
47#define IVC1ENC_VERSION_LENGTH (64)
48
49/**
50 control method commands
51*/
52#define IVC1ENC_GETSTATUS XDM_GETSTATUS
53#define IVC1ENC_SETPARAMS XDM_SETPARAMS
54#define IVC1ENC_RESET XDM_RESET
55#define IVC1ENC_FLUSH XDM_FLUSH
56#define IVC1ENC_SETDEFAULT XDM_SETDEFAULT
57#define IVC1ENC_GETBUFINFO XDM_GETBUFINFO
58
59/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
60/* Definition of all the Enumeration define by this interafce */
61/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
62
63/**
64 * @enum IVC1ENC_ErrorBit
65 * @brief error informations of IVAHD VC1 encoder implementation by TI.
66*/
67typedef enum {
68 IVC1ENC_LEVEL_INCOMPLIANT_PARAMETER = 0,
69 /**< Bit 0 - level incomplaint parameters.
70 * @remarks This error is applicable when some parameters are set
71 * which are not meeting the limit defined by the VC1 standard.
72 * Level limits can be categorized under
73 * following category :
74 * IVC1ENC_LEVEL_INCOMPLIANT_RESOLUTION : Invalid width/height
75 * IVC1ENC_LEVEL_INCOMPLIANT_HRDBUFSZIE : Invalid HrdBufferSize
76 * IVC1ENC_LEVEL_INCOMPLIANT_BITRATE : Invalid Bit Rate
77 * For above 3 situations, only a signle bit (bit-0) is set as true
78 */
79 IVC1ENC_PROFILE_INCOMPLIANT_CONTENTTYPE = 1,
80 /**< Bit 1 - Profile incomplaint content type.
81 * @remarks This error is applicable when
82 * IVIDENC2_Params::inputContentType is set as
83 * IVIDEO_INTERLACED but IVIDENC2_Params::profile is not set
84 * as IVC1_ADVANCED_PROFILE
85 */
86 IVC1ENC_PROFILE_INCOMPLIANT_INTERFRAMEINTERVAL = 4,
87 /**< Bit 4 - Profile incomplaint interframeInterval.
88 * @remarks This error is set when B frames are used with
89 * IVC1_SIMPLE_PROFILE
90 */
91 IVC1ENC_MAX_BIT_RATE_VIOLATION = 7,
92 /**< Bit 7 - Max bits for one Unit Voilation
93 * @remarks When max bit rate is enabled by user,
94 * than it is possible that codec might not be able
95 * honor max bit rate. This bit is set when bits consumed
96 * in one unit ( 1 sec) is more than the allocated as per the
97 * given max bit rate. If the frame rate is N , and if the
98 * max bit rate is voilated in M th frame than this bit will
99 * get set for frame M to N.
100 */
101 IVC1ENC_IMPROPER_HDVICP2_STATE = 16,
102 /**< Bit 16 - HDVICP2 is not in proper state.
103 */
104 /*IVC1ENC_IMPROPER_STREAMFORMAT = 17, */
105 /**< Bit 17 - stream format is not proper
106 * @remarks This error is set when streamFormat is set
107 * other than or
108 */
109 IVC1ENC_UNSUPPORTED_VIDENC2PARAMS = 20,
110 /**< Bit 20 - Invalid videnc2 parameters
111 * @remarks This error is set when any parameter of struct
112 * IVIDENC2_Params is not in allowed range
113 */
114 IVC1ENC_UNSUPPORTED_RATECONTROLPARAMS = 21,
115 /**< Bit 21 - Invalid rate control parameters
116 * @remarks This error is set when any parameter of struct
117 * IVC1ENC_RateControlParams is not in allowed range
118 */
119 IVC1ENC_UNSUPPORTED_INTERCODINGPARAMS = 22,
120 /**< Bit 22 - Invalid inter coding parameters
121 * @remarks This error is set when any parameter of struct
122 * IVC1ENC_InterCodingParams is not in allowed range
123 */
124 IVC1ENC_UNSUPPORTED_INTRACODINGPARAMS = 23,
125 /**< Bit 23 - Invalid Intra coding parameters
126 * @remarks This error is set when any parameter of struct
127 * IVC1ENC_IntraCodingParams is not in allowed range
128 */
129 IVC1ENC_UNSUPPORTED_SLICECODINGPARAMS = 25,
130 /**< Bit 25 - Invalid slice coding parameters
131 * @remarks This error is set when any parameter of struct
132 * IVC1ENC_SliceCodingParams is not in allowed range
133 */
134 IVC1ENC_UNSUPPORTED_LOOPFILTERPARAMS = 26,
135 /**< Bit 26 - Invalid loop filter related parameters
136 * @remarks This error is set when any parameter of struct
137 * IVC1ENC_LoopFilterParams is not in allowed range
138 */
139 IVC1ENC_UNSUPPORTED_VC1ENCPARAMS = 29,
140 /**< Bit 29 - Invalid Create time extended parameters
141 * @remarks This error is set when any parameter of struct
142 * IVC1ENC_Params is not in allowed range
143 */
144 IVC1ENC_UNSUPPORTED_VIDENC2DYNAMICPARAMS = 30,
145 /**< Bit 30 - Invalid base class dyanmic paaremeters during control
146 * @remarks This error is set when any parameter of struct
147 * IVIDENC2_DynamicParams is not in allowed range
148 */
149 IVC1ENC_UNSUPPORTED_VC1ENCDYNAMICPARAMS = 31
150 /**< Bit 31 - Invalid exteded class dynamic parameters during control
151 * @remarks This error is set when any parameter of struct
152 * IVC1ENC_DynamicParams (excluding embedded structures) is not in
153 * allowed range
154 */
155} IVC1ENC_ErrorBit;
156
157/**
158 * @enum IVC1ENC_Level
159 * @brief Level Identifier for VC1 Encoder
160*/
161typedef enum {
162 IVC1_SP_LOW = 0, /**< Simple Profile Level Low */
163 IVC1_SP_MED = 2, /**< Simple Profile Level Medium */
164 IVC1_MP_LOW = 0, /**< Main Profile Level Low */
165 IVC1_MP_MED = 2, /**< Main Profile Level Medium */
166 IVC1_MP_HIGH = 4, /**< Main Profile Level High */
167 IVC1_AP_L0 = 0, /**< Advanced Profile Level L0 */
168 IVC1_AP_L1 = 1, /**< Advanced Profile Level L1 */
169 IVC1_AP_L2 = 2, /**< Advanced Profile Level L2 */
170 IVC1_AP_L3 = 3, /**< Advanced Profile Level L3 */
171 IVC1_AP_L4 = 4 /**< Advanced Profile Level L4 */
172
173} IVC1ENC_Level;
174
175
176/**
177 * @enum IVC1ENC_Profile
178 * @brief Profile Identifier for VC1 Encoder
179*/
180typedef enum {
181 IVC1_SIMPLE_PROFILE = 0, /**< Simple Profile */
182 IVC1_MAIN_PROFILE = 1, /**< Main Profile */
183 IVC1_ADVANCED_PROFILE = 3 /**< Advanced Profile */
184
185} IVC1ENC_Profile;
186
187/**
188
189 @enum IVC1ENC_RateControlParamsPreset
190 @brief These enumerations control the RateControl Params
191
192*/
193
194typedef enum {
195 IVC1_RATECONTROLPARAMS_DEFAULT = 0,
196 /**< Default Rate Control params */
197 IVC1_RATECONTROLPARAMS_USERDEFINED = 1,
198 /**< User defined Rate Control params */
199 IVC1_RATECONTROLPARAMS_EXISTING = 2,
200 /**< Keep the Rate Control params as existing. This is
201 * useful because during control call if user doesn't want
202 * to change the Rate Control Params
203 */
204 IVC1_RATECONTROLPARAMS_MAX
205
206} IVC1ENC_RateControlParamsPreset;
207
208/**
209
210 @enum IVC1ENC_RateControlAlgo
211 @brief These enumerations control the type of rateControl algo to be picked
212 up by encoder. Only useful if IVIDENC2::rateControlPreset is set as
213 IVIDEO_USER_DEFINED
214
215*/
216typedef enum {
217 IVC1_RATECONTROL_PRC = 0, /**< Perceptual Rate Control,
218 * controls the QP @ MB level
219 */
220 IVC1_RATECONTROL_PRC_LOW_DELAY = 1, /** Low Delay Rate Control */
221 IVC1_RATECONTROL_DEFAULT = IVC1_RATECONTROL_PRC /** Default rcAlgo is PRC */
222
223} IVC1ENC_RateControlAlgo;
224
225/**
226
227 @enum IVC1ENC_InterCodingPreset
228 @brief These enumerations control the type of inter coding
229
230*/
231
232typedef enum {
233 IVC1_INTERCODING_DEFAULT = 0, /**< Default Inter coding params */
234 IVC1_INTERCODING_USERDEFINED = 1, /**< User defined inter coding params */
235 IVC1_INTERCODING_EXISTING = 2, /**< Keep the inter coding params as
236 * existing. This is useful because
237 * during control call if user don't
238 * want to change the inter coding Params
239 */
240 IVC1_INTERCODING_MAX
241
242} IVC1ENC_InterCodingPreset;
243
244/**
245
246 @enum IVC1ENC_InterBlockSize
247 @brief These enumerations are defined for minimum Inter block size
248
249*/
250
251typedef enum {
252 IVC1_BLOCKSIZE_16x16 = 0, /**< 16x16 Block size */
253 IVC1_BLOCKSIZE_DEFAULT = IVC1_BLOCKSIZE_16x16, /**< Default block size */
254 IVC1_BLOCKSIZE_8x8 = 1, /**< 8x8 Block size */
255 IVC1_BLOCKSIZE_4x4 = 2, /**< 4x4 Block size */
256 IVC1_BLOCKSIZE_MAX
257
258} IVC1ENC_InterBlockSize;
259
260/**
261
262 @enum IVC1ENC_IntraRefreshMethods
263 @brief Refresh method Type Identifier for VC1 Encoder
264
265*/
266
267typedef enum {
268 IVC1_INTRAREFRESH_NONE = 0, /**< Doesn't insert forcefully intra
269 macro blocks */
270 IVC1_INTRAREFRESH_DEFAULT = IVC1_INTRAREFRESH_NONE,
271 /**< Default intra refresh is OFF */
272 IVC1_INTRAREFRESH_CYCLIC_MBS, /**< Insters intra macro blocks in a
273 * cyclic fashion cyclic interval is
274 * equal to intraRefreshRate
275 */
276 IVC1_INTRAREFRESH_CYCLIC_SLICES, /**< Insters Intra Slices(Row based) in
277 * a cyclic fashion:
278 * cyclic interval is equal to
279 * intraRefreshRate
280 */
281 IVC1_INTRAREFRESH_RDOPT_MBS, /**< position of intra macro blocks is
282 * intelligently chosen by encoder,
283 * but the number of forcely coded
284 * intra macro blocks in a frame is
285 * guaranteed to be equal to
286 * totalMbsInFrame/intraRefreshRate
287 */
288 IVC1_INTRAREFRESH_MAX
289
290} IVC1ENC_IntraRefreshMethods;
291
292/**
293
294 @enum IVC1ENC_IntraCodingPreset
295 @brief These enumerations control the type of intra coding
296
297*/
298
299typedef enum {
300 IVC1_INTRACODING_DEFAULT = 0, /**< Default intra coding params */
301 IVC1_INTRACODING_USERDEFINED = 1, /**< User defined intra coding params */
302 IVC1_INTRACODING_MAX
303
304} IVC1ENC_IntraCodingPreset;
305
306/**
307 @enum IVC1ENC_SliceCodingPreset
308 @brief These enumerations control the type of slice coding
309 Slice coding is allowed only in Advanced profile.
310*/
311
312typedef enum {
313 IVC1_SLICECODING_DEFAULT = 0,
314 /**< Default slice coding params */
315 IVC1_SLICECODING_USERDEFINED = 1,
316 /**< User defined slicecoding params */
317 IVC1_SLICECODING_EXISTING = 2,
318 /**< Keep the slice coding params as existing */
319 /**< This is useful because during control call */
320 /**< if user don't want to change the sliceCodingParams */
321 IVC1_SLICECODING_MAX
322
323} IVC1ENC_SliceCodingPreset;
324
325/**
326 @enum IVC1ENC_SliceMode
327 @brief These enumerations control the type of slice coding
328 Slice coding is allowed only in Advanced profile.
329*/
330
331typedef enum {
332 IVC1_SLICEMODE_NONE = 0,
333 IVC1_SLICEMODE_DEFAULT = IVC1_SLICEMODE_NONE,
334 /**< Default slice coding mode is disabled */
335 IVC1_SLICEMODE_ROWS = 1,
336 /**< Slices are controlled based upon number of Rows */
337 IVC1_SLICEMODE_OFFSET = 2,
338 /**< Slices are controlled based upon user defined offset in
339 * unit of Rows
340 */
341 IVC1_SLICEMODE_MAX
342
343} IVC1ENC_SliceMode;
344
345/**
346
347 @enum IVC1ENC_StreamFormat
348 @brief These enumerations control the type of stream format
349 Only applicable for simple and main profile streams.
350*/
351typedef enum {
352 IVC1_RAW_FORMAT = 0,
353 /**< bit-stream does not contain the RCV headers */
354 IVC1_RCV1_FORMAT = 1,
355 /**< bit-stream contain the RCV headers in Version 1 format */
356 IVC1_RCV2_FORMAT = 2,
357 /**< bit-stream contain the RCV headers in Version 2 format */
358 IVC1_STREAM_FORMAT_DEFAULT = IVC1_RCV2_FORMAT,
359 /**< Default stream format is RCV2 format */
360 IVC1_STREAM_FORMAT_MAX
361} IVC1ENC_StreamFormat;
362
363/**
364 * @enum IVC1ENC_LoopFilterPreset
365 * @brief These enumerations control the loop filter params
366*/
367
368typedef enum {
369 IVC1_LOOPFILTER_DEFAULT = 0, /**< Default loop-filtering params */
370 IVC1_LOOPFILTER_USERDEFINED = 1, /**< User defined loop-filtering params */
371 IVC1_LOOPFILTER_MAX
372} IVC1ENC_LoopFilterPreset;
373
374/**
375
376 @enum IVC1ENC_LoopFilterDisableIDC
377 @brief Control Parameter to enable or disable loop filter
378
379*/
380typedef enum {
381 IVC1_DISABLE_FILTER_NONE = 0,
382 /**< Enable filtering of all the edges */
383 IVC1_DISABLE_FILTER_DEFAULT = IVC1_DISABLE_FILTER_NONE,
384 /**< Default is Loop filter enabled */
385 IVC1_DISABLE_FILTER_ALL_EDGES,
386 /**< Disable filtering of all the edges */
387 IVC1_DISABLE_FILTER_MAX
388} IVC1ENC_LoopFilterDisableIDC;
389
390/**
391
392 @enum IVC1ENC_GOPStructure
393 @brief
394 When B frames are used (InterFrameInterval > 1) then the arrangement of
395 frames can be different
396
397 GOP structure in display order as indicated below
398 If contentType = Frame
399 IVC1ENC_GOPSTRUCTURE_NONUNIFORM : IBBPBBP. .
400 IVC1ENC_GOPSTRUCTURE_UNIFORM : BBIBBPBB. .
401 If contentType = Field
402 IVC1ENC_GOPSTRUCTURE_NONUNIFORM : IPBBBBPBBBB
403 IVC1ENC_GOPSTRUCTURE_UNIFORM : BBBBIPBBBBPPBBBB
404
405*/
406
407typedef enum {
408 IVC1ENC_GOPSTRUCTURE_NONUNIFORM = 0,
409 /**< Open Gop structure : IBBPBBP */
410 IVC1ENC_GOPSTRUCTURE_DEFAULT = IVC1ENC_GOPSTRUCTURE_NONUNIFORM,
411 /**< Default is open gop structure */
412 IVC1ENC_GOPSTRUCTURE_UNIFORM = 1,
413 /**< Close Gop structure : BBIBBPBB*/
414 IVC1ENC_GOPSTRUCTURE_MAX
415
416} IVC1ENC_GOPStructure;
417
418/**
419
420 @enum IVC1ENC_BiasFactor
421 @brief Encoder uses bias b/w two possible choices for lot of decisions.
422 It is to control the mild/strongness of the biasing
423
424*/
425typedef enum {
426 IVC1_BIASFACTOR_LOW = 0,
427 /**< Low biasing */
428 IVC1_BIASFACTOR_MEDIUM = 1,
429 /**< Normal/Med biasing */
430 IVC1_BIASFACTOR_NORMAL = IVC1_BIASFACTOR_MEDIUM,
431 /**< Normal/Med biasing */
432 IVC1_BIASFACTOR_DEFAULT = IVC1_BIASFACTOR_MEDIUM,
433 /**< Default :Normal/Med biasing*/
434 IVC1_BIASFACTOR_HIGH = 2,
435 /**< High biasing */
436 IVC1_BIASFACTOR_MILD = 4, /**< Mild biasing */
437 IVC1_BIASFACTOR_ADAPTIVE = 5, /**< Adaptive biasing */
438 IVC1_BIASFACTOR_MAX
439} IVC1ENC_BiasFactor;
440
441
442/**
443 * @enum IVC1ENC_InterlaceCodingType
444 * @brief Profile Identifier for VC1 Encoder
445*/
446typedef enum {
447 IVC1_INTERLACE_PICAFF = 0,
448 /**< PicAFF type of interlace coding */
449 IVC1_INTERLACE_FIELDONLY = 2,
450 /**< Field only coding with fixed partiy scheme */
451 IVC1_INTERLACE_FIELDONLY_MRF = IVC1_INTERLACE_FIELDONLY,
452 /**< Use Most recent field for refernece */
453 IVC1_INTERLACE_FIELDONLY_ARF = 3,
454 /**< codec decides the partiy of of the field to
455 * be used based upon content (adaptive) */
456 IVC1_INTERLACE_DEFAULT = IVC1_INTERLACE_FIELDONLY_ARF,
457 /**< Default : adaptive partiy for reference */
458 IVC1_INTERLACE_FIELDONLY_SPF = 4,
459 /**< Use same parity field for refernece */
460 IVC1_INTERLACE_MAX
461
462} IVC1ENC_InterlaceCodingType;
463
464/**
465
466 @enum IVC1ENC_FrameQualityFactor
467 @brief These enumerations control the quality factor b/w two types of frames
468 For example if user want I frame Quality to be given more importance
469 than P frame, one can define it to be higher quality factor
470
471*/
472typedef enum {
473 IVC1_QUALITY_FACTOR_1 = 0, /**< Same Quality factor
474 * b/w two types of frame
475 */
476 IVC1_QUALITY_FACTOR_DEFAULT = IVC1_QUALITY_FACTOR_1,
477 /**< Default Quality factor
478 * to be used by encoder
479 */
480 IVC1_QUALITY_FACTOR_2 = 1, /**< High Quality factor to
481 * one frame type b/w two types
482 of frame
483 */
484 IVC1_QUALITY_FACTOR_3 = 2, /**< Higher Quality factor to
485 one frame type b/w two types of frame
486 */
487 IVC1_QUALITY_FACTOR_MAX
488
489} IVC1ENC_FrameQualityFactor;
490
491/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
492/* Definition of all the structures define by this interafce */
493/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
494
495/**
496
497 @struct IVC1ENC_RateControlParams
498 @brief This structure contains all the parameters which controls Rate
499 Control behavior
500
501 @param rateControlParamsPreset :
502 regarded @ IVC1ENC_DynamicParams::rateControlParams
503 This Preset controls the USER_DEFINED vs DEFAULT mode. if User is
504 not aware about following fields, it should be set as
505 IVC1_RATECONTROLPARAMS_DEFAULT
506
507 @param rcAlgo : ignored @ IVC1ENC_DynamicParams::rateControlParams
508 This defines the rate control algorithm to be used. Only useful
509 if IVIDENC2::rateControlPreset is set as IVIDEO_USER_DEFINED
510
511 @param qpI : regarded @ IVC1ENC_DynamicParams::rateControlParams
512 Initial Quantization Parameter for I frames.
513 Valid Range is [-1,31]
514 1 : Auto Initialization else other wise Initial QP.
515 when rateControlPreset = IVIDEO_NONE, this quantization parameter is
516 used by the whole video frame/field
517
518 @param qpMaxI : regarded @ IVC1ENC_DynamicParams::rateControlParams
519 Maximum Quantization Parameter for I frame(s). Range [-1,31]
520 Useful to control a minimum quality level
521
522 @param qpMinI : regarded @ IVC1ENC_DynamicParams::rateControlParams
523 Minimum Quantization Parameter for I frame(s). Range [-1,31]
524 Useful to control a maximum bit-rate level
525
526 @param qpP : regarded @ IVC1ENC_DynamicParams::rateControlParams
527 Initial Quantization Parameter for P frames. Valid Range is [-1,31]
528 1 : Auto Initialization else other wise Initial QP.
529 when rateControlPreset = IVIDEO_NONE, this quantization parameter is
530 used by the whole video frame/field
531
532 @param qpMaxP : regarded @ IVC1ENC_DynamicParams::rateControlParams
533 Maximum Quantization Parameter for inter frame(s). Range [-1,31]
534 Useful to control a minimum quality level
535
536 @param qpMinP : regarded @ IVC1ENC_DynamicParams::rateControlParams
537 Minimum Quantization Parameter for inter frame(s). Range [-1,31]
538 Useful to control a maximum bit-rate level
539
540 @param qpOffsetB : regarded @ IVC1ENC_DynamicParams::rateControlParams
541 Offset of B frames Quantization Parameter from P frames.
542 Valid Range is [-1,31]
543 1 : Auto Initialization else other wise user provided offset
544 if after adding the qpOffsetB into qp of P frame it exceeds 31 then
545 it is clipped to 31
546 when rateControlPreset = IVIDEO_NONE, this offset parameter is
547 used by the whole video frame/field
548
549 @param qpMaxB : regarded @ IVC1ENC_DynamicParams::rateControlParams
550 Maximum Quantization Parameter for B frame(s). Range [-1,31]
551 Useful to control a minimum quality level
552
553 @param qpMinB : regarded @ IVC1ENC_DynamicParams::rateControlParams
554 Minimum Quantization Parameter for B frame(s). Range [-1,31]
555 Useful to control a maximum bit-rate level
556
557 @param IPQualityFactor : ignored @ IVC1ENC_DynamicParams::rateControlParams
558 This provides configurality to control I frame Quality wrt to P frame.
559 Higher Quality factor means I frame quality is given higher
560 improtance compared to P frame.
561 Refer IVC1ENC_FrameQualityFactor for possible values
562
563 @param initialBufferLevel :
564 ignored @ IVC1ENC_DynamicParams::rateControlParams
565 Initial Buffer level for HRD compliance. It informs that Hypothtical
566 decoder can start after how much time. The value taken is the
567 obsolute value of the HRD buffer size For example if user want
568 Hypothtical decoder to start taking out data from HRD buffer after
569 half second then it should set initialBufferLevel = half of the
570 HRD buffer size that is programmed.
571
572 @param HRDBufferSize : regarded @ IVC1ENC_DynamicParams::rateControlParams
573 Hypothetical Reference Decoder Buffer Size. This size controls the
574 frame skip logic of the encoder. for low delay applications this
575 size should be small. Unit of this variable is bits
576
577 @param minPicSizeRatio : regarded @ IVC1ENC_DynamicParams::rateControlParams
578 This ratio is used to compute minimum picture size
579 in the following manner,
580 minPicSize = averagePicSize >> minPicSizeRatio
581 allowed values 1 to 4, Setting this to 0 will enable
582 encoder chosen ratio.
583 Note that this is guided value to rate control to
584 determine min picture size and encoder may not
585 strictly follow this
586 @param maxPicSizeRatio : regarded @ IVC1ENC_DynamicParams::rateControlParams
587 To determines ratio for max picture size
588 This ratio is used to compute maximum picture size
589 in the following manner,
590 maxPicSize = averagePicSize * maxPicSizeRatio
591 allowed values 2 to 30.Setting this to 0 and 1
592 will enable encoder chosen ratio.
593 Note that this is guided value to rate control
594 to determine max picture size and encoder may not
595 strictly follow this.
596
597 @param enablePRC : regarded @ IVC1ENC_DynamicParams::rateControlParams
598 This flag is used to control allowing PRC in the frame
599
600 @param enablePartialFrameSkip : regarded @
601 IVC1ENC_DynamicParams::rateControlParams
602 This flag is used to control allowing partial frame
603 skip in the frame
604 @param reserved : 16 bit word, kept to not change the foot print
605
606 @param reservedRC
607 Some part is kept reserved to add parameters later without
608 changing the foot print of interface memory
609
610 @todo More parameters to be added : delay (VBV), PRC related etc..
611
612*/
613
614typedef struct IVC1ENC_RateControlParams {
615 XDAS_Int8 rateControlParamsPreset;
616 XDAS_Int8 rcAlgo;
617 XDAS_Int8 qpI;
618 XDAS_Int8 qpMaxI;
619 XDAS_Int8 qpMinI;
620 XDAS_Int8 qpP;
621 XDAS_Int8 qpMaxP;
622 XDAS_Int8 qpMinP;
623 XDAS_Int8 qpOffsetB;
624 XDAS_Int8 qpMaxB;
625 XDAS_Int8 qpMinB;
626 XDAS_Int8 IPQualityFactor;
627 XDAS_Int32 initialBufferLevel;
628 XDAS_Int32 HRDBufferSize;
629 XDAS_Int16 minPicSizeRatio;
630 XDAS_Int16 maxPicSizeRatio;
631 XDAS_Int8 enablePRC;
632 XDAS_Int8 enablePartialFrameSkip;
633 XDAS_Int8 discardSavedBits;
634 XDAS_Int16 reserved;
635 XDAS_Int32 reservedRC[3];
636} IVC1ENC_RateControlParams;
637
638/**
639
640 @struct IVC1ENC_InterCodingParams
641 @brief This structure contains all the parameters which controls Inter MBs
642 coding behavior
643 @param interCodingPreset
644 This Preset controls the USER_DEFINED vs DEFAULT mode. if User is
645 not aware about following fields, it should be set as
646 IVC1_INTERCODING_DEFAULT
647 @param searchRangeHorP :regarded @ IVC1ENC_DynamicParams::interCodingParams
648 Horizontal Search Range for P frames
649 @param searchRangeVerP :regarded @ IVC1ENC_DynamicParams::interCodingParams
650 Vertical Search Range for P frames
651 @param searchRangeHorB :regarded @ IVC1ENC_DynamicParams::interCodingParams
652 Horizontal Search Range for B frames
653 @param searchRangeVerB :regarded @ IVC1ENC_DynamicParams::interCodingParams
654 Vertical Search Range for B frames
655 @param minBlockSize :regarded @ IVC1ENC_DynamicParams::interCodingParams
656 minimum block size for P and B frames. Refer IVC1ENC_InterBlockSize
657 enumeration to see the valid values
658 @param skipMVCodingBias:regarded @ IVC1ENC_DynamicParams::interCodingParams
659 Bias Control for having a macro block use skip MV vs regular MV
660 refer IVC1ENC_BiasFactor for possible values
661*/
662
663typedef struct IVC1ENC_InterCodingParams {
664 XDAS_Int8 interCodingPreset;
665 XDAS_Int16 searchRangeHorP;
666 XDAS_Int16 searchRangeVerP;
667 XDAS_Int16 searchRangeHorB;
668 XDAS_Int16 searchRangeVerB;
669 XDAS_Int8 minBlockSize;
670 XDAS_Int8 skipMVCodingBias;
671
672} IVC1ENC_InterCodingParams;
673
674/**
675 @struct IVC1ENC_IntraCodingParams
676 @brief This structure contains all the parameters which controls Intra
677 encoding
678
679 @param intraCodingPreset
680 This Preset controls the USER_DEFINED vs DEFAULT mode. if User is
681 not aware about following fields, it should be set as
682 INTRA_CODING_DEFAULT other wise INTRA_CODING_USER_DEFINED
683 @param intraRefreshMethod
684 Mechanism to do intra Refresh, see IVC1ENC_IntraRefreshMethods
685 for valid values
686 @param disableACPrediction
687 Flag to disable AC prediction
688 @param intraRefreshRate
689 Rate at which intra Refresh is done, This rate is specified as
690 One IntraMB per # MBs. For example if rate is 20 it means that
691 there has to be one intra MB(s) per 20 Mbs
692*/
693
694typedef struct IVC1ENC_IntraCodingParams {
695 XDAS_Int8 intraCodingPreset;
696 XDAS_Int8 intraRefreshMethod;
697 XDAS_Int8 disableACPrediction;
698 XDAS_Int16 intraRefreshRate;
699
700} IVC1ENC_IntraCodingParams;
701
702/**
703
704 @struct IVC1ENC_SliceCodingParams
705 @brief This structure contains all the parameters which controls Slice
706 encoding
707
708 @param sliceCodingPreset
709 This Preset controls the USER_DEFINED vs DEFAULT mode. if User is
710 not aware about following fields, it should be set as
711 IVC1_SLICECODING_DEFAULT
712
713 @param sliceMode : regarded @ IVC1ENC_DynamicParams::sliceCodingParams
714 This defines the control mechanism to split a picture in slices.
715 It can be either MB based or bytes based
716
717 @param sliceUnitSize : regarded @ IVC1ENC_DynamicParams::sliceCodingParams
718 parameter informs the number of offset information provided by user.
719 Actual offset are provided with sliceStartOffset
720
721 @param insertPicParamsinSlice: Whether to insert picture header at the start
722 of each slice.
723
724 @param sliceStartOffset[IVC1ENC_MAX_NUM_SLICE_START_OFFSET] : regarded @
725 IVC1ENC_DynamicParams::sliceCodingParams row numbering is assumed to
726 start from 0. Entries in this array must have numbers in ascending
727 order. First slice of the picture is always starting from 0th row
728 of the picture so 0th entry is the offset of second slice in picture
729 Ex 1 : sliceStartRowNum[0] = 25 ,
730 sliceStartRowNum[1] = 30, sliceStartRowNum[2] = 40
731 will result into 4 slices starting from row# 0, 25, 30 and 40
732 Ex 2 : sliceStartRowNum[0] = 25 , sliceStartRowNum[1] = 70,
733 sliceStartRowNum[2] = 60 is invalid
734 Ex 3 : sliceStartRowNum[0] = 25 , sliceStartRowNum[1] = 50,
735 sliceStartRowNum[2] = 100
736 will result into 3 slices starting from row# 0, 25 and 50
737 {if number of rows in picture < (100 + 1) }
738*/
739
740typedef struct IVC1ENC_SliceCodingParams {
741 XDAS_Int8 sliceCodingPreset;
742 XDAS_Int16 sliceMode;
743 XDAS_Int16 sliceUnitSize;
744 XDAS_Int8 insertPicParamsinSlice;
745 XDAS_Int8 sliceStartOffset[IVC1ENC_MAX_NUM_SLICE_START_OFFSET];
746
747} IVC1ENC_SliceCodingParams;
748
749/**
750
751 @struct IVC1ENC_LoopFilterParams
752 @brief This structure contains all the parameters which controls loop
753 filtering operations
754
755 @param loopfilterPreset
756 This Preset controls the USER_DEFINED vs DEFAULT mode. if User is
757 not aware about following fields, it should be set as
758 IVC1_LOOPFILTER_DEFAULT
759 @param loopfilterDisableIDC
760 Controls VC-1 loop filter disabling options
761
762*/
763typedef struct IVC1ENC_LoopFilterParams {
764 XDAS_Int8 loopfilterPreset;
765 XDAS_Int8 loopfilterDisableIDC;
766
767} IVC1ENC_LoopFilterParams;
768
769
770/**< This structure must be the first field of all VC1ENC instance objects */
771typedef struct IVC1ENC_Obj {
772 struct IVC1ENC_Fxns *fxns;
773} IVC1ENC_Obj;
774
775/**<
776
777 @struct IVC1ENC_Params
778 @brief This structure defines the Create time parameters for all
779 VC1ENC objects
780
781 @param videnc2Params must be followed for all video encoders.
782 Base class create params
783 @param rateControlParams Controls all Rate Control related parameters
784 @param interCodingParams Controls all Inter coding related parameters
785 @param intraCodingParams Controls all Intra coding related parameters
786 @param sliceCodingParams Controls all Slice coding related parameters
787 @param loopFilterParams Controls the in-loop filtering process
788
789 @param interlaceCodingType Controls the type of interlaced coding, refer
790 IVC1ENC_InterlaceCodingType for more details
791 @param bottomFieldIntra This field is valid only for interlaced sequences
792 0 = Bottom field of the first I frame in the GOP encoded as
793 P field.
794 non-zero = Bottom field of the first I frame in the GOP encoded as I
795 field.
796
797 @param gopStructure Defines the gop structure type:
798 uniform/non-uniform. For more information refer
799 IVC1ENC_GOPStructure
800 @param streamFormat Controls the stream format to enable/disable
801 headers.
802 @param pConstantMemory This pointer points to the the memory area where
803 constants are located. If this is set to NULL
804 then encoder assumes that all constants are
805 pointed by symbol VC1ENC_TI_ConstData
806
807 @param maxIntraFrameInterval
808 This parameter contains the maximum Intra Frame
809 interval. It is used to reduce the memory
810 requirement of refernce Buffers. Because for all
811 I frame/field configuration the reference frame
812 buffers are not required
813 @param reservedParams Some part is kept reserved to add parameters
814 later without changing the foot print of
815 interface object memory
816*/
817
818typedef struct IVC1ENC_Params {
819 IVIDENC2_Params videnc2Params;
820 IVC1ENC_RateControlParams rateControlParams;
821 IVC1ENC_InterCodingParams interCodingParams;
822 IVC1ENC_IntraCodingParams intraCodingParams;
823 IVC1ENC_SliceCodingParams sliceCodingParams;
824 IVC1ENC_LoopFilterParams loopFilterParams;
825
826 XDAS_Int8 interlaceCodingType;
827 XDAS_Int8 bottomFieldIntra;
828 XDAS_Int8 gopStructure;
829 XDAS_Int8 streamFormat;
830 XDAS_Int32 pConstantMemory;
831 XDAS_Int32 maxIntraFrameInterval;
832 XDAS_Int32 reservedParams[4];
833
834} IVC1ENC_Params;
835
836
837/**<
838
839 @struct IVC1ENC_Status
840 @brief This structure informs back the status of VC1 encoder and tells the
841 value of each control parameter
842
843 @param videnc2Status : must be followed for all video encoders.
844 : Base class status
845 @param rateControlParams : Controls all Rate Control related parameters
846 @param interCodingParams : Controls all Inter coding related parameters
847 @param intraCodingParams : Controls all Intra coding related parameters
848 @param sliceCodingParams : Controls all Slice coding related parameters
849 @param loopFilterParams : Controls the in-loop filtering process
850
851 @param interlaceCodingType : Controls the type of interlaced coding
852 @param bottomFieldIntra : This field valid only for interlaced sequences
853 0 = Bottom field of the first I frame in the
854 GOP encoded as P field.
855 non-zero = Bottom field of the first I frame in
856 the GOP encoded as I field.
857 @param gopStructure : Defines the gop structure type: Open/Close.
858 @param maxIntraFrameInterval: This parameter contains the maximum Intra Frame
859 interval. It is used to reduce the memory
860 requirement of refernce Buffers. Because for
861 all I frame/field configuration the reference
862 frame buffers are not required
863 @param searchCenter : seacrh Center for motion estimation
864 @param reservedStatus : Some part is kept reserved to add parameters
865 later without changing the foot print of
866 interface memory
867*/
868
869typedef struct IVC1ENC_Status {
870 IVIDENC2_Status videnc2Status;
871 IVC1ENC_RateControlParams rateControlParams;
872 IVC1ENC_InterCodingParams interCodingParams;
873 IVC1ENC_IntraCodingParams intraCodingParams;
874 IVC1ENC_SliceCodingParams sliceCodingParams;
875 IVC1ENC_LoopFilterParams loopFilterParams;
876
877 XDAS_Int8 interlaceCodingType;
878 XDAS_Int8 bottomFieldIntra;
879 XDAS_Int8 gopStructure;
880 XDAS_Int32 maxIntraFrameInterval;
881 XDM_Point searchCenter;
882 XDAS_Int32 reservedStatus[4];
883
884} IVC1ENC_Status;
885
886/**<
887
888 @struct IVC1ENC_DynamicParams
889 @brief This structure defines the run time parameters for all VC1ENC objects
890
891 @param videnc2DynamicParams must be followed for all video encoders
892 @param rateControlParams Controls all Rate Control related parameters.
893 only few are supported to be changed as
894 part @ Control call. Refer
895 IVC1ENC_RateControlParams to find out
896 @param interCodingParams Controls all inter MB coding related parameters.
897 only few are supported to be changed as
898 part @ Control call. Refer interCodingParams to
899 find out
900 @param sliceCodingParams Controls all Slice coding related parameters.
901 only few are supported to be changed as
902 part @ Control call.
903 Refer sliceCodingParams to find out
904 @param searchCenter seacrh Center for motion estimation.
905 XDM_Point.x == 0xFFFF means ignore searchCenter
906 @param reservedDynParams Some part is kept reserved to add parameters
907 later without changing the foot print of
908 interface memory
909*/
910
911typedef struct IVC1ENC_DynamicParams {
912
913 IVIDENC2_DynamicParams videnc2DynamicParams;
914 IVC1ENC_RateControlParams rateControlParams;
915 IVC1ENC_InterCodingParams interCodingParams;
916 IVC1ENC_SliceCodingParams sliceCodingParams;
917 XDM_Point searchCenter;
918 XDAS_Int32 reservedDynParams[4];
919
920} IVC1ENC_DynamicParams;
921
922/**<
923
924 @struct IVC1ENC_InArgs
925 @brief This structure defines the input argument being passed to
926 VC1 encoder
927
928 @param videnc2InArgs : It is instance of base class. It contains all
929 the necessary info required run time parameters for
930 all VC1ENC objects
931
932*/
933typedef struct IVC1ENC_InArgs {
934
935 IVIDENC2_InArgs videnc2InArgs;
936
937} IVC1ENC_InArgs;
938
939/**<
940
941 @struct IVC1ENC_OutArgs
942 @brief This structure defines the outpur argument being generated from VC1
943 encoder
944
945 @param videnc2OutArgs : It is instance of base class. It contains all
946 the necessary info encoder should produce
947 @param vbvBufferLevel: This variable tells the buffer level at the end of
948 every picture from decoder perspective.the value
949 populated in this variable is latest for every
950 process call
951*/
952typedef struct IVC1ENC_OutArgs {
953
954 IVIDENC2_OutArgs videnc2OutArgs;
955 XDAS_Int32 vbvBufferLevel;
956} IVC1ENC_OutArgs;
957
958/**<
959
960 IVC1ENC_Cmd:This structure defines of the control commands for VC1ENC objects
961*/
962
963typedef IVIDENC2_Cmd IVC1ENC_Cmd;
964
965/**<
966
967 @struct IVC1ENC_Fxns
968 @brief This structure defines of the operations on VC1ENC objects
969
970 @param IVIDENC2_Fxns : It is instance of base class. It contains all
971 function table
972
973*/
974typedef struct IVC1ENC_Fxns {
975 IVIDENC2_Fxns ividenc;
976
977} IVC1ENC_Fxns;
978
979
980/**<Default parameter values for VC1ENC instance objects */
981extern const IVC1ENC_Params VC1ENC_TI_PARAMS;
982
983
984#ifdef __cplusplus
985extern "C" {
986#endif
987
988#endif /*_IVC1ENC_H_*/
989
990/* ========================================================================== */
991/* End of file: ivc1enc.h */
992/* -------------------------------------------------------------------------- */
993/* Copyright (c) 2010 Texas Instruments, Incorporated. */
994/* All Rights Reserved. */
995/* ========================================================================== */
996
diff --git a/packages/ivahd_codecs/ti/sdo/codecs/vc1vdec/ivc1vdec.h b/packages/ivahd_codecs/ti/sdo/codecs/vc1vdec/ivc1vdec.h
new file mode 100644
index 0000000..7765101
--- /dev/null
+++ b/packages/ivahd_codecs/ti/sdo/codecs/vc1vdec/ivc1vdec.h
@@ -0,0 +1,734 @@
1/*
2*******************************************************************************
3* HDVICP2.0 Based VC-1 Decoder
4*
5* "HDVICP2.0 Based VC-1 Decoder" is a software module developed on TI's
6* HDVICP2 based SOCs. This module is capable of decoding a compressed
7* advanced/main/simple profile VC-1 bit-stream into a YUV 4:2:0 Raw video.
8* Based on SMPTE-421M standard.
9* Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/
10* ALL RIGHTS RESERVED
11*******************************************************************************
12*/
13/**
14*******************************************************************************
15* @file ivc1vdec.h
16*
17* @brief This file contains the various defines for the implementation of
18* ividec3 interface for VC-1 decoder.
19*
20* @author: Krishnakanth Rapaka
21*
22* @version 0.0 (Feb 2008) : Base version created [Krishnakanth Rapaka]
23*
24* @version 0.1 (May 2010) : Modified according to latest interface standard.
25* [Dinesh Anand]
26*
27* @version 0.2 (Jun 2010) : Added review comments. [Dinesh Anand]
28*
29* @version 0.6 (Dec 2011) : Default structures are exposed in interface file.
30* Added error codes for Ref picture Buffer. [Naidu].
31*
32*******************************************************************************
33*/
34#ifndef IVC1VDEC_H
35#define IVC1VDEC_H
36
37
38
39/*******************************************************************************
40* INCLUDE FILES
41*******************************************************************************/
42#include <ti/xdais/xdas.h>
43#include <ti/xdais/dm/ividdec3.h>
44#include <ti/sdo/fc/ires/hdvicp/ires_hdvicp2.h>
45
46/*******************************************************************************
47* MACROS
48*******************************************************************************/
49
50/*
51 * Some of the operations performed by the control call
52 */
53#define IVC1VDEC_GETSTATUS XDM_GETSTATUS
54#define IVC1VDEC_SETPARAMS XDM_SETPARAMS
55#define IVC1VDEC_RESET XDM_RESET
56#define IVC1VDEC_FLUSH XDM_FLUSH
57#define IVC1VDEC_SETDEFAULT XDM_SETDEFAULT
58#define IVC1VDEC_GETBUFINFO XDM_GETBUFINFO
59
60/*
61 * Macro defining the minimum version length of VC-1 decoder
62 */
63#define IVC1DEC_VERSION_LENGTH (200)
64
65
66/*******************************************************************************
67* PUBLIC DECLARATIONS Note: Defined here, used elsewhere
68*******************************************************************************/
69
70typedef enum
71{
72 /* Error bit for unsupported VIDDEC3PARAMS */
73 IVC1DEC_ERR_UNSUPPORTED_VIDDEC3PARAMS = 0,
74 /* Error bit for unsupported VIDDEC3 Dynamic PARAMS */
75 IVC1DEC_ERR_UNSUPPORTED_VIDDEC3DYNAMICPARAMS,
76 /* Error bit for unsupported VC1 VIDDEC3 Dynamic PARAMS */
77 IVC1DEC_ERR_UNSUPPORTED_VC1DECDYNAMICPARAMS,
78 /* Error bit for improper data sync setting */
79 IVC1DEC_ERR_IMPROPER_DATASYNC_SETTING,
80 /* Error bit for no slice */
81 IVC1DEC_ERR_NOSLICE,
82 /* Error bit for slice header corruption */
83 IVC1DEC_ERR_SLICEHDR,
84 /* Error bit for MB data corruption */
85 IVC1DEC_ERR_MBDATA,
86 /* Error bit for unsupported VC1 feature */
87 IVC1DEC_ERR_UNSUPPFEATURE,
88 /* Error bit for end of steam */
89 IVC1DEC_ERR_STREAM_END = 16,
90 /* Error bit for unsupported resolution */
91 IVC1DEC_ERR_UNSUPPRESOLUTION,
92 /* Error bit for IVAHD standby */
93 IVC1DEC_ERR_STANDBY,
94 /* Error bit for invalid mailbox message */
95 IVC1DEC_ERR_INVALID_MBOX_MESSAGE,
96 /* Error bit for sequence header corruption */
97 IVC1DEC_ERR_SEQHDR,
98 /* Error bit for entry point header corruption */
99 IVC1DEC_ERR_ENTRYHDR,
100 /* Error bit for picture header corruption */
101 IVC1DEC_ERR_PICHDR,
102 /* Error bit for Ref picture Buffer */
103 IVC1DEC_ERR_REF_PICTURE_BUFFER,
104 /* Error bit if there is no sequence header start code */
105 IVC1DEC_ERR_NOSEQUENCEHEADER,
106 /* Error bit for invalid values of input/output buffer descriptors */
107 IVC1DEC_ERR_BUFDESC = 30,
108 /* Error bit for picture size change. It will be set for a multiresolution */
109 /* Stream */
110 IVC1DEC_ERR_PICSIZECHANGE = 31
111
112}Ivc1VDEC_ExtendedCommonErrorCodes;
113
114/**
115********************************************************************************
116 * @enum IVC1VDEC_ERROR_STATUS
117 *
118 * @brief This enum defines the 128 codec specific error status bits
119 * in VC-1 decoder.
120 *
121 * @note None:
122 *
123********************************************************************************
124*/
125typedef enum
126{
127 /* Error bit for invalid dynamic params structure size */
128 VC1_DYNAMIC_PARAMS_SIZE_ERROR = 0,
129 /* Error bit for decode header only mode */
130 VC1_DECODE_HEADER_ERROR,
131 /* Error bit for invalid display width */
132 VC1_DISPLAY_WIDTH_ERROR,
133 /* Error bit for invalid frame skip mode */
134 VC1_FRAME_SKIP_MODE_ERROR,
135 /*Error bit for new frame flag */
136 VC1_NEW_FRAME_FLAG_ERROR,
137 /* Error bit for datasync mode */
138 VC1_PUT_DATA_FXN_ERROR,
139 /* Error bit for datasync mode */
140 VC1_PUT_DATA_HANDLE_ERROR,
141 /* Error bit for datasync mode */
142 VC1_GET_DATA_FXN_ERROR,
143 /* Error bit for datasync mode */
144 VC1_GET_DATA_HANDLE_ERROR,
145 /* Error bit for datasync mode */
146 VC1_PUT_BUFFER_FXN_ERROR,
147 /* Error bit for datasync mode */
148 VC1_PUT_BUFFER_HANDLE_ERROR,
149 /* Error bit for late acquire argument */
150 VC1_LATE_ACQUIRE_ARG_ERROR,
151 /* Error bit for inargs pointers */
152 VC1_NULL_INARGS_POINTER_ERROR,
153 /* Error bit for inargs size */
154 VC1_INARGS_SIZE_ERROR,
155 /* Error bit for invalid input bytes */
156 VC1_INVALID_INPUT_BYTES_ERROR,
157 /* Error bit for invalid input bytes in flush mode */
158 VC1_INVALID_INPUT_BYTES_IN_FLUSH_MODE_ERROR,
159 /* Error bit for invalid input ID */
160 VC1_INVALID_INPUT_ID_ERROR,
161 /* Error bit for NULL instance handle */
162 VC1_NULL_INSTANCE_HANDLE_ERROR,
163 /* Error bit if decoder is not initialized */
164 VC1_DECODER_NOT_INITIALIZED_ERROR,
165 /* Error bit for invalid input buffer descriptor */
166 VC1_INVALID_INPUT_BUF_DESC_ERROR,
167 /* Error bit for invalid input buffer pointer */
168 VC1_INVALID_INPUT_BUFFER_POINTER_ERROR,
169 /* Error bit for invalid input buffer size */
170 VC1_INVALID_INPUT_BUFFER_SIZE_ERROR,
171 /* Error bit for invalid number of input buffer */
172 VC1_INVALID_NUM_OF_INPUT_BUFFERS_ERROR,
173 /* Error bit for excess number of input buffers */
174 VC1_EXCESS_NUM_OF_INPUT_BUFFERS_ERROR,
175 /* Error bit for invalid memory type of input buffer */
176 VC1_INVALID_INPUT_BUFFER_MEMTYPE_ERROR,
177 /* Error bit for invalid outargs pointer */
178 VC1_INVALID_OUTARGS_POINTER_ERROR,
179 /* Error bit for invalid outargs size */
180 VC1_INVALID_OUTARGS_SIZE,
181 /* Error bit for invalid output buffer descriptor pointer */
182 VC1_INVALID_OUTPUT_BUF_DESC_POINTER_ERROR,
183 /* Error bit for invalid output buffer descriptor */
184 VC1_INVALID_OUTPUT_BUF_DESC_ERROR,
185 /* Error bit for invalid output buffer */
186 VC1_INVALID_NUM_OF_OUTPUT_BUFFERS_ERROR,
187 /* Error bit for invalid luma output buffer pointer */
188 VC1_INVALID_OUTPUT_BUFFER0_POINTER_ERROR,
189 /* Error bit for invalid luma output buffer size */
190 VC1_INVALID_OUTPUT_BUFFER0_SIZE_ERROR,
191 /* Error bit for invalid luma output buffer memory type */
192 VC1_INVALID_OUTPUT_BUFFER0_MEMTYPE_ERROR,
193 /* Error bit for invalid chroma output buffer pointer */
194 VC1_INVALID_OUTPUT_BUFFER1_POINTER_ERROR,
195 /* Error bit for invalid chroma output buffer size */
196 VC1_INVALID_OUTPUT_BUFFER1_SIZE_ERROR,
197 /* Error bit for invalid chroma output buffer memory type */
198 VC1_INVALID_OUTPUT_BUFFER1_MEMTYPE_ERROR,
199 /* Error bit for invalid output buffer2 pointer */
200 VC1_INVALID_OUTPUT_BUFFER2_POINTER_ERROR,
201 /* Error bit for invalid output buffer2 size */
202 VC1_INVALID_OUTPUT_BUFFER2_SIZE_ERROR,
203 /* Error bit for invalid output buffer2 memory type */
204 VC1_INVALID_OUTPUT_BUFFER2_MEMTYPE_ERROR,
205 /* Error bit for invalid buffre usage mode */
206 VC1_INVALID_BUFFER_USAGE_MODE,
207 /* Error bit for invalid tiled width for output buffer0 */
208 VC1_INVALID_OUTPUT_BUFFER0_TILED_WIDTH_ERROR,
209 /* Error bit for invalid tiled height for output buffer0 */
210 VC1_INVALID_OUTPUT_BUFFER0_TILED_HEIGHT_ERROR,
211 /* Error bit for invalid tiled width for output buffer1 */
212 VC1_INVALID_OUTPUT_BUFFER1_TILED_WIDTH_ERROR,
213 /* Error bit for invalid tiled height for output buffer1 */
214 VC1_INVALID_OUTPUT_BUFFER1_TILED_HEIGHT_ERROR,
215 /* Error bit for invalid tiled width for output buffer2 */
216 VC1_INVALID_OUTPUT_BUFFER2_TILED_WIDTH_ERROR,
217 /* Error bit for invalid tiled height for output buffer2 */
218 VC1_INVALID_OUTPUT_BUFFER2_TILED_HEIGHT_ERROR,
219 /* Error bit for invalid ref picture buffer */
220 VC1_INVALID_REF_PICTURE_BUFFER,
221 /* Error bit for invalid profile */
222 VC1_SEQ_HDR_INVALID_PROFILE = 64,
223 /* Error bit for invalid invalid level bits */
224 VC1_SEQ_HDR_INVALID_LEVEL,
225 /* Error bit for invalid color diff format */
226 VC1_SEQ_HDR_INVALID_COLORDIFF_FORMAT,
227 /* Error bit for invalid max coded width */
228 VC1_SEQ_HDR_INVALID_MAX_CODED_WIDTH,
229 /* Error bit for invalid max code height */
230 VC1_SEQ_HDR_INVALID_MAX_CODED_HEIGHT,
231 /* Error bit for invalid reserved bits */
232 VC1_SEQ_HDR_INVALID_RESERVED,
233 /* Error bit for invalid aspect ratio */
234 VC1_SEQ_HDR_INVALID_ASPECT_RATIO,
235 /* Error bit for invalid frame rate numerator bits */
236 VC1_SEQ_HDR_INVALID_FRAMERATENR,
237 /* Error bit for invalid frame rate denominator bits */
238 VC1_SEQ_HDR_INVALID_FRAMERATEDR,
239 /* Error bit for invalid color prim bits */
240 VC1_SEQ_HDR_INVALID_COLOR_PRIM,
241 /* Error bit for invalid transfer character bits */
242 VC1_SEQ_HDR_INVALID_TRANSFER_CHAR,
243 /* Error bit for invalid matrix coefficient bits */
244 VC1_SEQ_HDR_INVALID_MATRIX_COEF,
245 /* Error bit for invalid loop filter bits */
246 VC1_SEQ_HDR_INVALID_LOOPFILTER,
247 /* Error bit for invalid FASTUVMC bits */
248 VC1_SEQ_HDR_INVALID_FASTUVMC,
249 /* Error bit for invalid Extended MV bits */
250 VC1_SEQ_HDR_INVALID_EXTENDED_MV,
251 /* Error bit for invalid DQUANT bits */
252 VC1_SEQ_HDR_INVALID_DQUANT,
253 /* Error bit for invalid sync marker bits */
254 VC1_SEQ_HDR_INVALID_SYNCMARKER,
255 /* Error bit for invalid rang reduction bits */
256 VC1_SEQ_HDR_INVALID_RANGERED,
257 /* Error bit for invalid max number of B frame bits */
258 VC1_SEQ_HDR_INVALID_MAXBFRAMES,
259 /* Error bit for invalid DQUANT in entry point header */
260 VC1_ENTRY_PNT_HDR_INVALID_DQUANT,
261 /* Error bit for invalid coded width */
262 VC1_ENTRY_PNT_HDR_INVALID_CODED_WIDTH,
263 /* Error bit for invalid coded height */
264 VC1_ENTRY_PNT_HDR_INVALID_CODED_HEIGHT,
265 /* Error bit for invalid PTYPE */
266 VC1_PIC_HDR_INVALID_PTYPE,
267 /* Error bit for invalid PQINDEX */
268 VC1_PIC_HDR_INVALID_PQINDEX,
269 /* Error bit for invalid MVRANGE */
270 VC1_PIC_HDR_INVALID_MVRANGE,
271 /* Error bit for invalid RESPIC */
272 VC1_PIC_HDR_INVALID_RESPIC,
273 /* Error bit for invalid FCM bits */
274 VC1_PIC_HDR_INVALID_FCM,
275 /* Error bit for invalid RNDCTRL bits */
276 VC1_PIC_HDR_INVALID_RNDCTRL,
277 /* Error bit for invalid MVMODE bits */
278 VC1_PIC_HDR_INVALID_MVMODE,
279 /* Error bit for invalid DMVRANGE bits */
280 VC1_PIC_HDR_INVALID_DMVRANGE,
281 /* Error bit for invalid BFRACTION bits */
282 VC1_PIC_HDR_INVALID_BFRACTION,
283 /* Error bit for invalid REFDIST bits */
284 VC1_PIC_HDR_INVALID_REFDIST,
285 /* Error bit for invalid number of MBs in a picture */
286 VC1_ERR_MBNUMB,
287 /* Error bit for invalid SCALERES bits */
288 VC1_ERR_SCALERES,
289 /* Error bit for invalid ALTPQUANT bits */
290 VC1_ERR_ALTPQUANT,
291 /* Error bit for invalid ABSPQ bits */
292 VC1_VOPDQUANT_INVALID_ABSPQ,
293 /* Error bit for invalid slice address bits */
294 VC1_SLC_HDR_INVALID_SLICE_ADDR,
295 /* Error bit for improper IVAHD reset */
296 VC1_IMPROPER_RESET,
297 /* Error bit for improper standby */
298 VC1_IMPROPER_STANDBY,
299 /* Error bit MB error */
300 VC1_ECD_MB_ERROR,
301 /* No Sequence header start code */
302 VC1_NO_SEQUENCE_STARTCODE
303
304}IVC1VDEC_ERROR_STATUS;
305
306
307
308/**
309********************************************************************************
310*
311* @enum IVC1VDEC_mbErrStatus
312*
313* @brief This enum indicates if a MB was in error or not
314*
315********************************************************************************
316**/
317typedef enum
318
319{
320 /* MB was non-erroneous */
321 IVC1VDEC_MB_NOERROR = 0,
322 /* MB was erroneous */
323 IVC1VDEC_MB_ERROR = 1
324
325} IVC1VDEC_mbErrStatus;
326
327/**
328********************************************************************************
329* @struct IVC1VDEC_TI_MbInfo
330*
331* @brief MB information structure that is written out by the IVA-HD hardware.
332*
333* @note None:
334*
335********************************************************************************
336*/
337typedef struct IVC1VDEC_TI_MbInfo
338{
339 /* MB address */
340 XDAS_UInt8 mb_addr;
341 /* Error flag */
342 XDAS_UInt8 error_flag;
343 /* First MB flag */
344 XDAS_UInt8 first_mb_flag;
345 /* Picture bound */
346 XDAS_UInt8 pic_bound_b;
347 /* Upper picture bound */
348 XDAS_UInt8 pic_bound_u;
349 /* Right picture bound */
350 XDAS_UInt8 pic_bound_r;
351 /* Left picture bound */
352 XDAS_UInt8 pic_bound_l;
353 /* Availability of upper right MB */
354 XDAS_UInt8 mb_ur_avail;
355 /* Availability of upper MB */
356 XDAS_UInt8 mb_uu_avail;
357 /* Availability of upper left MB */
358 XDAS_UInt8 mb_ul_avail;
359 /* Availability of left MB */
360 XDAS_UInt8 mb_ll_avail;
361 /* Macroblock header format type */
362 XDAS_UInt8 fmt_type;
363 /* Codec type */
364 XDAS_UInt8 codec_type;
365 /* Indicates DC values of each Y block in current MB */
366 XDAS_UInt8 dc_coef_q_y[4];
367 /* Indicates DC values of Cr block in current MB */
368 XDAS_UInt8 dc_coef_q_cr;
369 /* Indicates DC values of Cb block in current MB */
370 XDAS_UInt8 dc_coef_q_cb;
371 /* Block type of cr block */
372 XDAS_UInt8 block_type_cr;
373 /* Block type of cb block */
374 XDAS_UInt8 block_type_cb ;
375 /* Block types of luma */
376 XDAS_UInt8 block_type_y[4];
377 /* In decoding, if the current macroblock is the last macroblock in a slice,*/
378 /* ECD sets 1 to this field during executing the macroblock. Otherwise, ECD */
379 /* sets 0 to this field */
380 XDAS_UInt8 end_of_slice;
381 /* 1 : allow skipping current MB if CBP = 0 */
382 XDAS_UInt8 cond_skip_flag;
383 /* Skipped / non skipped MB */
384 XDAS_UInt8 skip;
385 /* 1 indicates that overlap filtering is in use for the macroblock. */
386 XDAS_UInt8 overlap;
387 /* 1 indicates that AC prediction is in use for the macroblock */
388 XDAS_UInt8 acpred;
389 /* Denotes inter-prediction direction for the macroblock in B-picture */
390 XDAS_UInt8 b_picture_direction;
391 /* Denotes the number of motion vectors. */
392 XDAS_UInt8 mv_mode;
393 /* 1 indicates that the field transform is in use for the macroblock. */
394 XDAS_UInt8 fieldtx ;
395 /* 1 indicates that field inter-prediction is in use */
396 XDAS_UInt8 mv_type;
397 /* Equals the reference frame distance */
398 XDAS_UInt8 refdist;
399 /* 1 indicates that macroblock quantizer-scale (MQUANT) overflows */
400 XDAS_UInt8 mquant_overflow;
401 /* Equals the quantizer-scale for the macroblock */
402 XDAS_UInt8 quant;
403 /* 1 indicates that 0.5 shall be added to PQUANT in calculation of */
404 /* quantizer-scale. This field is valid for decoding only. */
405 XDAS_UInt8 halfqp;
406 /* Equals the DC coefficient step size which is derived from MQUANT in the */
407 /* bit-stream */
408 XDAS_UInt8 dc_step_size;
409 /* Denotes the coded sub-block pattern for cr block */
410 XDAS_UInt8 cbp_cr ;
411 /* Denotes the coded sub-block pattern for cb block */
412 XDAS_UInt8 cbp_cb;
413 /* Denotes the coded sub-block pattern for luma blocks */
414 XDAS_UInt8 cbp_y[3];
415 /* Denotes the backward reference field picture */
416 XDAS_UInt8 mv_bw_ref_y[4];
417 /* Denotes the forward reference field picture */
418 XDAS_UInt8 mv_fw_ref_y[3] ;
419 /* Unclipped forward motion vector for luma */
420 XDAS_UInt8 mv_fw_y[4][4] ;
421 /* Unclipped backward motion vector for luma */
422 XDAS_UInt8 mv_bw_y[1][1];
423 /* Unclipped backward motion vector for chroma */
424 XDAS_UInt8 mv_bw_c[2] ;
425 /* Unclipped forward motion vector for chroma */
426 XDAS_UInt8 mv_fw_c[2] ;
427 /* Clipped forward motion vector for luma */
428 XDAS_UInt8 cmv_fw_y[4][4] ;
429 /* Clipped backward motion vector for luma */
430 XDAS_UInt8 cmv_bw_y[4][4] ;
431 /* Clipped forward motion vector for chroma */
432 XDAS_UInt8 cmv_fw_c[4][4] ;
433 /* Clipped backward motion vector for chroma */
434 XDAS_UInt8 cmv_bw_c[4][4];
435
436}IVC1VDEC_TI_MbInfo;
437
438/**
439********************************************************************************
440* @struct IVC1VDEC_Obj
441*
442* @brief Object defnition of the VC-1 decoder algorithm.This structure
443* must be the first field of all VC1VDEC instance objects.
444*
445* @param fxns: Pointer to the structure defining all the ividdec3
446* interface operations to be performed on the VC-1 decoder
447* object.
448********************************************************************************
449*/
450typedef struct IVC1VDEC_Obj {
451
452 struct IVC1VDEC_Fxns *fxns;
453
454} IVC1VDEC_Obj;
455
456/**
457********************************************************************************
458* @struct IVC1VDEC_Handle
459*
460* @brief Handle to the VC-1 decoder instance object.
461*
462********************************************************************************
463*/
464typedef struct IVC1VDEC_Obj *IVC1VDEC_Handle;
465
466/**
467********************************************************************************
468* @struct IVC1VDEC_Status
469*
470* @brief This structure defines parameters that describe the status of the
471* VC-1 Decoder and any other implementation specific parameters.
472* The status parameters are defined in the XDM data structure,
473* IVIDDEC3_Status
474*
475* @param viddecStatus : XDM Base class status structure (see ividdec3.h)
476*
477********************************************************************************
478*/
479typedef struct IVC1VDEC_Status
480{
481 IVIDDEC3_Status viddecStatus;
482 /*--------------------------------------------------------------------------*/
483 /* Extended Error Code0 returned by decoder */
484 /*--------------------------------------------------------------------------*/
485 XDAS_UInt32 extendedErrorCode0;
486 /*--------------------------------------------------------------------------*/
487 /* Extended Error Code1 returned by decoder */
488 /*--------------------------------------------------------------------------*/
489 XDAS_UInt32 extendedErrorCode1;
490 /*--------------------------------------------------------------------------*/
491 /* Extended Error Code2 returned by decoder */
492 /*--------------------------------------------------------------------------*/
493 XDAS_UInt32 extendedErrorCode2;
494 /*--------------------------------------------------------------------------*/
495 /* Extended Error Code3 returned by decoder */
496 /*--------------------------------------------------------------------------*/
497 XDAS_UInt32 extendedErrorCode3;
498 /*--------------------------------------------------------------------------*/
499 /* Debug trace level configured for the codec */
500 /*--------------------------------------------------------------------------*/
501 XDAS_UInt32 debugTraceLevel;
502 /*--------------------------------------------------------------------------*/
503 /* Number of frames for which history information is maintained by the */
504 /* codec */
505 /*--------------------------------------------------------------------------*/
506 XDAS_UInt32 lastNFramesToLog;
507 /*--------------------------------------------------------------------------*/
508 /* External memory address (as seen by M3) where debug trace information is */
509 /* being dumped */
510 /*--------------------------------------------------------------------------*/
511 XDAS_UInt32 * extMemoryDebugTraceAddr;
512 /*--------------------------------------------------------------------------*/
513 /* External memory buffer size (in bytes) where debug trace information is */
514 /* being dumped */
515 /*--------------------------------------------------------------------------*/
516 XDAS_UInt32 extMemoryDebugTraceSize;
517} IVC1VDEC_Status;
518
519
520/**
521********************************************************************************
522* @struct IVC1VDEC_Params
523*
524* @brief This structure defines the creation parameters for all VC-1 decoder
525* objects. This structure includes the xdm baseclass creation
526* parameters and any other implementation specific parameters for
527* VC-1 Decoder instance object.
528*
529* @param viddec3Params: XDM Baselass create time parameters.
530* (see ividdec3.h)
531*
532********************************************************************************
533*/
534typedef struct IVC1VDEC_Params
535{
536 IVIDDEC3_Params viddecParams;
537 /*--------------------------------------------------------------------------*/
538 /*Enable/Disable Error Concealment */
539 /* enumeration 'eFrameErrorConcealment' can be used to set this value */
540 /*--------------------------------------------------------------------------*/
541 XDAS_Int32 errorConcealmentON;
542 /*--------------------------------------------------------------------------*/
543 /* Flag to indicate that whether the application is providing the frame */
544 /* layer data structure in case of simple & main profile */
545 /*--------------------------------------------------------------------------*/
546 XDAS_Int32 frameLayerDataPresentFlag;
547 /*--------------------------------------------------------------------------*/
548 /* This parameter configures the codec to dump a debug trace log */
549 /*--------------------------------------------------------------------------*/
550 XDAS_UInt32 debugTraceLevel;
551 /*--------------------------------------------------------------------------*/
552 /* This parameters configures the codec to maintain history of debug trace */
553 /* parameters for last N frames. */
554 /*--------------------------------------------------------------------------*/
555 XDAS_UInt32 lastNFramesToLog;
556
557} IVC1VDEC_Params;
558
559/**
560********************************************************************************
561* @struct IH264VDEC_DynamicParams
562*
563* @brief This structure defines the run-time parameters and any other
564* implementation specific parameters for an H.264 instance object.
565* The base run-time parameters are defined in the XDM data structure,
566* IVIDDEC3_DynamicParams.
567*
568* @param viddecDynamicParams : XDM Base class dynamic structure
569* (see ividdec3.h)
570*
571* @param outloopDeblocking : Out loop deblocking flag to be enabled
572* for simple profile dynamically at frame level
573*
574* @param calc_sw_workaround: Flag used for switching the CALC software
575* work around ON or OFF.
576*
577********************************************************************************
578*/
579typedef struct IVC1VDEC_DynamicParams
580{
581 IVIDDEC3_DynamicParams viddecDynamicParams;
582} IVC1VDEC_DynamicParams;
583
584
585/**
586********************************************************************************
587* @struct IVC1VDEC_InArgs
588*
589* @brief This structure defines the run-time input arguments for an VC-1
590* decoder process function.
591*
592* @param viddec3InArgs : XDM Base class InArgs structure (see ividdec3.h)
593*
594********************************************************************************
595*/
596typedef struct IVC1VDEC_InArgs
597{
598 IVIDDEC3_InArgs viddecInArgs;
599}IVC1VDEC_InArgs;
600
601
602/**
603********************************************************************************
604* @struct IVC1VDEC_OutArgs
605*
606* @brief This structure defines the run time output arguments for VC-1
607* decoder process function.
608*
609* @param viddecOutArgs : XDM Base class OutArgs structure (see ividdec3.h)
610*
611********************************************************************************
612*/
613typedef struct IVC1VDEC_OutArgs
614{
615 IVIDDEC3_OutArgs viddecOutArgs;
616
617} IVC1VDEC_OutArgs;
618
619/**
620********************************************************************************
621* @struct IVC1VDEC_Fxns
622*
623* @brief This structure contains pointers to all the XDAIS and XDM interface
624* functions
625*
626* @param ividdec : This structure contains pointers to all the XDAIS and
627* XDM interface functions
628********************************************************************************
629*/
630typedef struct IVC1VDEC_Fxns
631{
632 IVIDDEC3_Fxns ividdec;
633} IVC1VDEC_Fxns;
634
635
636
637/**
638********************************************************************************
639 * @fn VC1VDEC_TI_decode(IVIDDEC3_Handle handle,
640 * XDM2_BufDesc *inptr,
641 * XDM2_BufDesc *outptr,
642 * IVIDDEC3_InArgs *inargs,
643 * IVIDDEC3_OutArgs *outargs)
644 *
645 * @brief TI's(Texas Instrument) implementation of the process API defined
646 * by XDM for the VC-1 Decoder.This process function is responsible
647 * for the decode of a given frame.
648 *
649 * @param handle
650 * Handle to an algorithm instance object
651 *
652 * @param *inptr
653 * Pointer to input buffer structure.
654 *
655 * @param *outptr
656 * Pointer to output buffer structure.
657 *
658 * @param *inargs
659 * Pointer to input arguments structure.
660 *
661 * @param *outargs
662 * Pointer to output arguments structure.
663 *
664 * @return XDM_EOK/XDM_EFAIL
665********************************************************************************
666*/
667XDAS_Int32 VC1VDEC_TI_decode(IVIDDEC3_Handle handle,
668 XDM2_BufDesc *inptr,
669 XDM2_BufDesc *outptr,
670 IVIDDEC3_InArgs *inargs,
671 IVIDDEC3_OutArgs *outargs);
672
673
674 /**
675 *******************************************************************************
676 * @fn VC1VDEC_TI_control (IVIDDEC3_Handle handle,
677 * IVIDDEC3_Cmd cmd,
678 * IVIDDEC3_DynamicParams * params,
679 * IVIDDEC3_Status * status)
680 *
681 * @brief Control API for the VC-1 decoder, to control various object
682 * parameters.Some of the operations which can be performed by control
683 * call are,
684 * i)Get status of various elements defined in the IVC1dec_Status.
685 * ii)Set the parameters in the structure IVC1dec_DyanmicParams
686 * iii)Reset the algorithm.
687 * iV)Set predefined defaults.
688 * V)Flush buffers held by the system.
689 *
690 * @param[in] handle: Pointer to algorithm instance object.
691 *
692 * @param[in] cmd: Command specifying the operations to be performed.
693 *
694 * @param[in] params: Pointer to the IVIDDEC3_DynamicParams struct.
695 *
696 * @param[in] status: Pointer to the IVIDDEC1_Status struct.
697 *
698 * @return Pass or Fail (IALG_EOK / IALG_EFAIL)
699 *
700 *******************************************************************************
701*/
702XDAS_Int32 VC1VDEC_TI_control (IVIDDEC3_Handle handle,
703 IVIDDEC3_Cmd cmd,
704 IVIDDEC3_DynamicParams * params,
705 IVIDDEC3_Status * status);
706
707
708/**
709******************************************************************************
710 * ======== IVC1VDEC_Params ========
711 * Default Create parameter values for VC1VDEC instance objects
712********************************************************************************
713*/
714extern const IVC1VDEC_Params VC1VDEC_TI_PARAMS;
715/**
716******************************************************************************
717 * ======== IVC1VDEC_DynamicParams ========
718 * Default DynamicParams values for VC1VDEC instance objects
719********************************************************************************
720*/
721extern const IVC1VDEC_DynamicParams VC1VDEC_TI_DYNAMICPARAMS;
722
723/*******************************************************************************
724* EXTERNAL REFERENCE Note: use only if not found in header file
725*******************************************************************************/
726
727
728extern IVC1VDEC_Fxns VC1VDEC_TI_IVC1VDEC;
729
730extern IVIDDEC3_Fxns VC1VDEC_TI_IVIDDECFUNCTIONS;
731
732
733
734#endif /* IVC1VDEC_ */
diff --git a/packages/xdais/ti/xdais/dm/ividdec3.h b/packages/xdais/ti/xdais/dm/ividdec3.h
new file mode 100755
index 0000000..938a14c
--- /dev/null
+++ b/packages/xdais/ti/xdais/dm/ividdec3.h
@@ -0,0 +1,1011 @@
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/ividdec3.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_IVIDDEC3 IVIDDEC3 - XDM Video Decoder Interface
43 *
44 * This is the XDM IVIDDEC3 Video Decoder Interface.
45 */
46
47#ifndef ti_xdais_dm_IVIDDEC3_
48#define ti_xdais_dm_IVIDDEC3_
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_IVIDDEC3 */
60/*@{*/
61
62#define IVIDDEC3_EOK XDM_EOK /**< @copydoc XDM_EOK */
63#define IVIDDEC3_EFAIL XDM_EFAIL /**< @copydoc XDM_EFAIL */
64#define IVIDDEC3_EUNSUPPORTED XDM_EUNSUPPORTED /**< @copydoc XDM_EUNSUPPORTED */
65
66/**
67 * @brief This must be the first field of all IVIDDEC3
68 * instance objects
69 */
70typedef struct IVIDDEC3_Obj {
71 struct IVIDDEC3_Fxns *fxns;
72} IVIDDEC3_Obj;
73
74
75/**
76 * @brief Opaque handle to an IVIDDEC3 objects
77 */
78typedef struct IVIDDEC3_Obj *IVIDDEC3_Handle;
79
80
81/**
82 * @brief Video decoder output frame order
83 *
84 * @enumWarning
85 *
86 * @sa IVIDDEC3_Params.displayDelay
87 *
88 */
89typedef enum {
90 IVIDDEC3_DISPLAY_DELAY_AUTO = -1, /**< Decoder decides the display delay */
91 IVIDDEC3_DECODE_ORDER = 0, /**< Display frames are in decoded order without delay */
92 IVIDDEC3_DISPLAY_DELAY_1 = 1, /**< Display the frames with 1 frame delay */
93 IVIDDEC3_DISPLAY_DELAY_2 = 2, /**< Display the frames with 2 frames delay */
94 IVIDDEC3_DISPLAY_DELAY_3 = 3, /**< Display the frames with 3 frames delay */
95 IVIDDEC3_DISPLAY_DELAY_4 = 4, /**< Display the frames with 4 frames delay */
96 IVIDDEC3_DISPLAY_DELAY_5 = 5, /**< Display the frames with 5 frames delay */
97 IVIDDEC3_DISPLAY_DELAY_6 = 6, /**< Display the frames with 6 frames delay */
98 IVIDDEC3_DISPLAY_DELAY_7 = 7, /**< Display the frames with 7 frames delay */
99 IVIDDEC3_DISPLAY_DELAY_8 = 8, /**< Display the frames with 8 frames delay */
100 IVIDDEC3_DISPLAY_DELAY_9 = 9, /**< Display the frames with 9 frames delay */
101 IVIDDEC3_DISPLAY_DELAY_10 = 10, /**< Display the frames with 10 frames delay */
102 IVIDDEC3_DISPLAY_DELAY_11 = 11, /**< Display the frames with 11 frames delay */
103 IVIDDEC3_DISPLAY_DELAY_12 = 12, /**< Display the frames with 12 frames delay */
104 IVIDDEC3_DISPLAY_DELAY_13 = 13, /**< Display the frames with 13 frames delay */
105 IVIDDEC3_DISPLAY_DELAY_14 = 14, /**< Display the frames with 14 frames delay */
106 IVIDDEC3_DISPLAY_DELAY_15 = 15, /**< Display the frames with 15 frames delay */
107 IVIDDEC3_DISPLAY_DELAY_16 = 16, /**< Display the frames with 16 frames delay */
108 IVIDDEC3_DISPLAYDELAY_DEFAULT = IVIDDEC3_DISPLAY_DELAY_AUTO
109} IVIDDEC3_displayDelay;
110
111/**
112 * @brief Defines the creation time parameters for
113 * all IVIDDEC3 instance objects
114 *
115 * @extensibleStruct
116 */
117typedef struct IVIDDEC3_Params {
118 XDAS_Int32 size; /**< @sizeField */
119 XDAS_Int32 maxHeight; /**< Maximum video height in pixels. */
120 XDAS_Int32 maxWidth; /**< Maximum video width in pixels. */
121 XDAS_Int32 maxFrameRate; /**< Maximum frame rate in fps * 1000.
122 * For example, if max frame rate is 30
123 * frames per second, set this field
124 * to 30000.
125 */
126 XDAS_Int32 maxBitRate; /**< Maximum bit rate, bits per second.
127 * For example, if bit rate is 10 Mbps, set
128 * this field to 10000000
129 */
130 XDAS_Int32 dataEndianness; /**< Endianness of output data.
131 *
132 * @sa XDM_DataFormat
133 */
134 XDAS_Int32 forceChromaFormat;/**< @copydoc XDM_ChromaFormat
135 *
136 * @sa XDM_ChromaFormat
137 */
138 XDAS_Int32 operatingMode; /**< Video coding mode of operation.
139 *
140 * @sa IVIDEO_OperatingMode
141 */
142 XDAS_Int32 displayDelay; /**< @copydoc IVIDDEC3_displayDelay
143 *
144 * @sa IVIDDEC3_displayDelay
145 */
146 XDAS_Int32 inputDataMode; /**< Input data mode.
147 *
148 * @remarks If a subframe mode is provided,
149 * the application must call
150 * IVIDDEC3_Fxns.control() with
151 * #XDM_SETPARAMS id prior to
152 * IVIDDEC3_Fxns.process() to
153 * set
154 * IVIDDEC3_DynamicParams.getDataFxn()
155 * and
156 * IVIDDEC3_DynamicParams.getDataHandle
157 * (and optionally
158 * IVIDDEC3_DynamicParams.putBufferFxn(),
159 * and
160 * IVIDDEC3_DynamicParams.putBufferHandle).
161 * Else, the alg can return error.
162 *
163 * @sa IVIDEO_DataMode
164 */
165 XDAS_Int32 outputDataMode; /**< Output data mode.
166 *
167 * @remarks If a subframe mode is provided,
168 * the application must call
169 * IVIDDEC3_Fxns.control() with
170 * #XDM_SETPARAMS id prior to
171 * #IVIDDEC3_Fxns.process() to
172 * set
173 * IVIDDEC3_DynamicParams.putDataFxn(),
174 * and
175 * IVIDDEC3_DynamicParams.putDataHandle.
176 * Else, the alg can return error.
177 *
178 * @sa IVIDEO_DataMode
179 */
180 XDAS_Int32 numInputDataUnits;/**< Number of input slices/rows.
181 *
182 * @remarks Units depend on the
183 * IVIDDEC3_Params.inputDataMode,
184 * like number of
185 * slices/rows/blocks etc.
186 *
187 * @remarks Ignored if
188 * IVIDDEC3_Params.inputDataMode
189 * is set to full frame mode.
190 */
191 XDAS_Int32 numOutputDataUnits;/**< Number of output slices/rows.
192 *
193 * @remarks Units depend on the
194 * IVIDDEC3_Params.outputDataMode,
195 * like number of
196 * slices/rows/blocks etc.
197 *
198 * @remarks Ignored if
199 * IVIDDEC3_Params.outputDataMode
200 * is set to full frame mode.
201 */
202 XDAS_Int32 errorInfoMode; /**< Enable/disable packet error information
203 * for input and/or output.
204 *
205 * @sa IVIDEO_ErrorInfoMode
206 */
207 XDAS_Int32 displayBufsMode; /**< Indicates which mode the displayBufs are
208 * presented in.
209 *
210 * @remarks See the
211 * IVIDDEC3_DisplayBufsMode enum
212 * for the values this field may
213 * contain.
214 *
215 * @sa IVIDDEC3_OutArgs.displayBufsMode
216 * @sa IVIDDEC3_DisplayBufsMode
217 */
218 XDAS_Int32 metadataType[IVIDEO_MAX_NUM_METADATA_PLANES];/**< Type of
219 * each metadata plane.
220 *
221 * @sa IVIDEO_MetadataType
222 */
223 } IVIDDEC3_Params;
224
225
226/**
227 * @brief This structure defines the algorithm parameters that can be
228 * modified after creation via IVIDDEC3_Fxns.control() calls
229 *
230 * @remarks It is not necessary that a given implementation support all
231 * dynamic parameters to be configurable at run time. If a
232 * particular algorithm does not support run-time updates to
233 * a parameter that the application is attempting to change
234 * at runtime, it may indicate this as an error.
235 *
236 * @extensibleStruct
237 *
238 * @sa IVIDDEC3_Fxns::control()
239 */
240typedef struct IVIDDEC3_DynamicParams {
241 XDAS_Int32 size; /**< @sizeField */
242 XDAS_Int32 decodeHeader; /**< @copydoc XDM_DecMode
243 *
244 * @sa XDM_DecMode
245 */
246 XDAS_Int32 displayWidth; /**< Pitch. If set to zero, use the decoded
247 * image width. Else, use given display
248 * width in pixels. Display width has to be
249 * greater than or equal to image width.
250 */
251 XDAS_Int32 frameSkipMode; /**< @copydoc IVIDEO_FrameSkip
252 *
253 * @sa IVIDEO_FrameSkip
254 */
255 XDAS_Int32 newFrameFlag; /**< Flag to indicate that the algorithm should
256 * start a new frame.
257 *
258 * @remarks Valid values are XDAS_TRUE
259 * and XDAS_FALSE.
260 *
261 * @remarks This is useful for error
262 * recovery, for example when the
263 * end of frame cannot be detected
264 * by the codec but is known to the
265 * application.
266 */
267 XDM_DataSyncPutFxn putDataFxn; /**< Optional datasync "put data" function.
268 *
269 * @remarks Apps/frameworks that don't
270 * support datasync should set
271 * this to NULL.
272 *
273 * @remarks This function is provided
274 * by the app/framework to the
275 * video decoder. The decoder
276 * calls this function when
277 * sub-frame data has been put
278 * into an output buffer and is
279 * available.
280 */
281 XDM_DataSyncHandle putDataHandle;/**< Datasync "put data" handle
282 *
283 * @remarks This is a handle which the
284 * codec must provide when
285 * calling the app-registered
286 * IVIDDEC3_DynamicParams.putDataFxn().
287 *
288 * @remarks Apps/frameworks that don't
289 * support datasync should set
290 * this to NULL.
291 *
292 * @remarks For an algorithm, this handle
293 * is read-only; it must not be
294 * modified when calling
295 * the app-registered
296 * IVIDDEC3_DynamicParams.putDataFxn().
297 *
298 * @remarks The app/framework can use
299 * this handle to differentiate
300 * callbacks from different
301 * algorithms.
302 */
303 XDM_DataSyncGetFxn getDataFxn;/**< Datasync "get data" function.
304 *
305 * @remarks This function is provided
306 * by the app/framework to the
307 * video decoder. The decoder
308 * calls this function to get
309 * partial compressed bit-stream
310 * data from the app/framework.
311 *
312 * @remarks Apps/frameworks that don't
313 * support datasync should set
314 * this to NULL.
315 */
316 XDM_DataSyncHandle getDataHandle;/**< Datasync "get data" handle
317 *
318 * @remarks This is a handle which the
319 * codec must provide when
320 * calling @c getDataFxn.
321 *
322 * @remarks Apps/frameworks that don't
323 * support datasync should set
324 * this to NULL.
325 *
326 * @remarks For an algorithm, this handle
327 * is read-only; it must not be
328 * modified when calling
329 * the app-registered
330 * IVIDDEC3_DynamicParams.getDataFxn().
331 *
332 * @remarks The app/framework can use
333 * this handle to differentiate
334 * callbacks from different
335 * algorithms.
336 */
337 XDM_DataSyncPutBufferFxn putBufferFxn;/**< Datasync "put buffer" function.
338 *
339 * @remarks This function is provided
340 * by the app/framework to the
341 * video decoder. The decoder
342 * calls this function to release
343 * consumed, partial compressed
344 * bit-stream data buffers to the
345 * app/framework.
346 *
347 * @remarks Apps/frameworks that don't
348 * support datasync should set
349 * this to NULL.
350 */
351 XDM_DataSyncHandle putBufferHandle;/**< Datasync "put buffer" handle
352 *
353 * @remarks This is a handle which the
354 * codec must provide when
355 * calling the app-registered
356 * IVIDDEC3_DynamicParam.putBufferFxn().
357 *
358 * @remarks Apps/frameworks that don't
359 * support datasync should set
360 * this to NULL.
361 *
362 * @remarks For an algorithm, this handle
363 * is read-only; it must not be
364 * modified when calling
365 * the app-registered
366 * IVIDDEC3_DynamicParams.putBufferFxn().
367 *
368 * @remarks The app/framework can use
369 * this handle to differentiate
370 * callbacks from different
371 * algorithms.
372 */
373 XDAS_Int32 lateAcquireArg; /**< Argument used during late acquire.
374 *
375 * @remarks For all control() commands
376 * other than
377 * #XDM_SETLATEACQUIREARG, this
378 * field is ignored and can
379 * therefore be set by the
380 * caller to any value.
381 *
382 * @remarks This field is used to
383 * provide the
384 * 'late acquire' arg required by
385 * #XDM_SETLATEACQUIREARG.
386 *
387 * @remarks Late acquire support is
388 * an optional feature for
389 * video decoders. If the
390 * codec supports late
391 * acquisition of resources,
392 * and the application has supplied
393 * a lateAcquireArg value (via
394 * #XDM_SETLATEACQUIREARG), then the
395 * codec must also provide this
396 * @c lateAcquireArg value when
397 * requesting resources (i.e.
398 * during their call to
399 * acquire() when requesting
400 * the resource).
401 */
402} IVIDDEC3_DynamicParams;
403
404
405/**
406 * @brief Defines the input arguments for all IVIDDEC3 instance
407 * process function
408 *
409 * @extensibleStruct
410 *
411 * @sa IVIDDEC3_Fxns::process()
412 */
413typedef struct IVIDDEC3_InArgs {
414 XDAS_Int32 size; /**< @sizeField */
415 XDAS_Int32 numBytes; /**< Size of input data in bytes, provided
416 * to the algorithm for decoding.
417 */
418 XDAS_Int32 inputID; /**< The decoder will attach
419 * this ID with the corresponding output
420 * frames.
421 *
422 * @remarks This is useful when frames
423 * require re-ordering (e.g. B frames).
424 *
425 * @remarks When there is no re-ordering,
426 * IVIDDEC3_OutArgs#outputID will be same
427 * as this inputID field.
428 *
429 * @remarks Zero (0) is not a supported
430 * inputID. This value is
431 * reserved for cases when there
432 * is no output buffer provided in
433 * IVIDDEC3_OutArgs::displayBufs.
434 *
435 * @sa IVIDDEC3_OutArgs::outputID.
436 */
437} IVIDDEC3_InArgs;
438
439
440/**
441 * @brief Defines instance status parameters
442 *
443 * @extensibleStruct
444 *
445 * @sa IVIDDEC3_Fxns::control()
446 */
447typedef struct IVIDDEC3_Status {
448 XDAS_Int32 size; /**< @sizeField */
449 XDAS_Int32 extendedError; /**< @extendedErrorField */
450 XDM1_SingleBufDesc data; /**< Buffer descriptor for data passing.
451 *
452 * @remarks If this field is not used,
453 * the application <b>must</b>
454 * set @c data.buf to NULL.
455 *
456 * @remarks This buffer can be used as
457 * either input or output,
458 * depending on the command.
459 *
460 * @remarks The buffer will be provided
461 * by the application, and
462 * returned to the application
463 * upon return of the
464 * IVIDDEC3_Fxns.control()
465 * call. The algorithm must
466 * not retain a pointer to this
467 * data.
468 *
469 * @sa #XDM_GETVERSION
470 */
471 XDAS_Int32 maxNumDisplayBufs;/**< The maximum number of buffers that will
472 * be required by the codec.
473 *
474 * @remarks The maximum number of buffers
475 * can be IVIDEO2_MAX_IO_BUFFERS.
476 */
477 XDAS_Int32 maxOutArgsDisplayBufs;/**< The maximum number of display
478 * buffers that can be returned via
479 * IVIDDEC3_OutArgs.displayBufs.
480 *
481 * @remarks If returning display buffers
482 * embedded into the OutArgs
483 * struct, this field provides
484 * the size of the
485 * OutArgs.displayBufs.bufDesc[]
486 * array.
487 */
488 XDAS_Int32 outputHeight; /**< Output height in pixels. */
489 XDAS_Int32 outputWidth; /**< Output width in pixels. */
490 XDAS_Int32 frameRate; /**< Average frame rate in fps * 1000.
491 * For example, if average frame rate is 30
492 * frames per second, this field should be
493 * 30000.
494 */
495 XDAS_Int32 bitRate; /**< Average bit rate, in bits per second. */
496 XDAS_Int32 contentType; /**< @copydoc IVIDEO_ContentType
497 *
498 * @sa IVIDEO_ContentType
499 */
500 XDAS_Int32 sampleAspectRatioHeight;/**< Sample aspect ratio height. */
501 XDAS_Int32 sampleAspectRatioWidth;/**< Sample aspect ratio width. */
502 XDAS_Int32 bitRange; /**< Full 8 bit, CCIR 601 */
503 XDAS_Int32 forceChromaFormat;/**< Output chroma format.
504 *
505 * @sa XDM_ChromaFormat
506 */
507 XDAS_Int32 operatingMode; /**< Video decoding mode of operation.
508 *
509 * @sa IVIDEO_OperatingMode
510 */
511 XDAS_Int32 frameOrder; /**< Frame Order
512 *
513 * @remarks This field reflects the value
514 * provided during creation in
515 * IVIDDEC3_Params.displayDelay
516 */
517 XDAS_Int32 inputDataMode; /**< Input data mode.
518 *
519 * @sa IVIDDEC3_Params.inputDataMode
520 * @sa IVIDEO_DataMode
521 */
522 XDAS_Int32 outputDataMode; /**< Output data mode.
523 *
524 * @sa IVIDDEC3_Params.outputDataMode
525 * @sa IVIDEO_DataMode
526 */
527 XDM1_AlgBufInfo bufInfo; /**< Input and output buffer information.
528 *
529 * @remarks This field provides the
530 * application with the algorithm's
531 * buffer requirements. The
532 * requirements may vary depending
533 * on the current configuration
534 * of the algorithm instance.
535 *
536 * @sa XDM1_AlgBufInfo
537 */
538 XDAS_Int32 numInputDataUnits;/**< Number of input slices/rows.
539 *
540 * @remarks Units depend on the
541 * IVIDDEC3_Params.inputDataMode,
542 * like number of
543 * slices/rows/blocks etc.
544 *
545 * @remarks Ignored if
546 * IVIDDEC3_Params.inputDataMode
547 * is set to full frame mode.
548 *
549 * @sa IVIDDEC3_Params.inputDataMode
550 */
551 XDAS_Int32 numOutputDataUnits;/**< Number of output slices/rows.
552 *
553 * @remarks Units depend on the
554 * @c outputDataMode, like number of
555 * slices/rows/blocks etc.
556 *
557 * @remarks Ignored if
558 * IVIDDEC3_Params.outputDataMode
559 * is set to full frame mode.
560 *
561 * @sa IVIDDEC3_Params.outputDataMode
562 */
563 XDAS_Int32 configurationID; /**< Configuration ID of given codec.
564 *
565 * @remarks This is based on the input
566 * stream & can be used by the
567 * framework to optimize the
568 * save/restore overhead of any
569 * resources used.
570 *
571 * @remarks This can be useful in
572 * multichannel use case
573 * scenarios.
574 */
575 XDAS_Int32 metadataType[IVIDEO_MAX_NUM_METADATA_PLANES];/**< Type of
576 * each metadata plane.
577 *
578 * @sa IVIDEO_MetadataType
579 */
580 IVIDDEC3_DynamicParams decDynamicParams;/**< Current values of the
581 * decoder's dynamic parameters.
582 *
583 * @remarks This is the last field in
584 * the base struct as it can
585 * be extended.
586 */
587} IVIDDEC3_Status;
588
589
590/**
591 * @brief Mode in which display buffers will be returned in
592 * IVIDDEC3_OutArgs
593 *
594 * @remarks Note that we start this enum at '1' to help catch inadvertently
595 * uninitialized fields.
596 *
597 * @enumWarning
598 */
599typedef enum {
600 IVIDDEC3_DISPLAYBUFS_EMBEDDED = 1, /**< @c displayBufs details are embedded
601 * into the struct.
602 *
603 * @remarks This mode causes the
604 * size of the
605 * IVIDDEC3_OutArgs
606 * struct to be larger,
607 * but typically easier to
608 * manage by both the app
609 * and the codec.
610 */
611 IVIDDEC3_DISPLAYBUFS_PTRS = 2 /**< @c displayBufs details are returned
612 * via the provided pointers.
613 *
614 * @remarks This mode causes the
615 * size of the
616 * IVIDDEC3_OutArgs
617 * struct to be smaller
618 * and predictable,
619 * but makes the usage of
620 * the struct more
621 * difficult as the
622 * app/framework has to
623 * manage (sometimes many)
624 * small buffers. On
625 * multiprocessor systems,
626 * these extra buffers can
627 * introduce extra
628 * overhead related to
629 * address translation and
630 * cache maintenance.
631 */
632} IVIDDEC3_DisplayBufsMode;
633
634
635/**
636 * @brief Defines the run time output arguments for
637 * all IVIDDEC3 instance objects
638 *
639 * @extensibleStruct
640 *
641 * @remarks The size of this struct may vary when
642 * IVIDDEC3_OutArgs.displayBufsMode is set to
643 * #IVIDDEC3_DISPLAYBUFS_EMBEDDED (see details in
644 * IVIDDEC3_OutArgs.displayBufs.bufDesc).
645 *
646 * @remarks When IVIDDEC3_OutArgs.displayBufsMode is set to
647 * #IVIDDEC3_DISPLAYBUFS_EMBEDDED, the number of elements in the
648 * IVIDDEC3_OutArgs.displayBufs.bufDesc array is a constant (and
649 * can be acquired by calling IVIDDEC3_Fxns.control() and looking
650 * in the IVIDDEC3_Status.maxOutArgsDisplayBufs field. Note that
651 * any extended fields follow the
652 * IVIDDEC3_OutArgs.displayBufs.bufDesc array.
653 *
654 * @sa IVIDDEC3_Fxns.process()
655 */
656typedef struct IVIDDEC3_OutArgs {
657 XDAS_Int32 size; /**< @sizeField
658 *
659 * @remarks Extra care must be taken when
660 * setting this field as the
661 * size of even the base data
662 * can vary because of the
663 * #IVIDDEC3_OutArgs.displayBufs
664 * field.
665 *
666 * @sa IVIDDEC3_OutArgs.displayBufs
667 */
668 XDAS_Int32 extendedError; /**< @extendedErrorField */
669 XDAS_Int32 bytesConsumed; /**< Number of bytes consumed. */
670 XDAS_Int32 outputID[IVIDEO2_MAX_IO_BUFFERS]; /**< Output ID corresponding
671 * to @c displayBufs[].
672 *
673 * @remarks A value of zero (0) indicates
674 * an invalid ID. The first zero
675 * entry in array will indicate
676 * end of valid outputIDs within
677 * the array. Hence the
678 * application can stop reading the
679 * array when it encounters the
680 * first zero entry.
681 *
682 * @sa IVIDDEC3_OutArgs.displayBufs
683 * @sa IVIDDEC3_InArgs.inputID
684 */
685 IVIDEO2_BufDesc decodedBufs; /**< The decoder fills this structure with
686 * buffer pointers to the decoded frame.
687 * Related information fields for the
688 * decoded frame are also populated.
689 *
690 * When frame decoding is not complete, as
691 * indicated by
692 * IVIDDEC3_OutArgs.outBufsInUseFlag,
693 * the frame data in this structure will be
694 * incomplete. However, the algorithm will
695 * provide incomplete decoded frame data
696 * in case application wants to use
697 * it for error recovery purposes.
698 *
699 * @sa IVIDDEC3_OutArgs.outBufsInUseFlag
700 */
701 XDAS_Int32 freeBufID[IVIDEO2_MAX_IO_BUFFERS]; /**< This is an
702 * array of inputID's corresponding to the
703 * buffers that have been unlocked in the
704 * current process call.
705 *
706 * @remarks Buffers returned to the
707 * application for display (via
708 * IVIDDEC3_OutArgs.displayBufs)
709 * continue to be owned by the
710 * algorithm until they are
711 * released - indicated by
712 * the ID being returned in this
713 * @c freeBuf array.
714 *
715 * @remarks The buffers released by the
716 * algorithm are indicated by
717 * their non-zero ID (previously
718 * provided via
719 * IVIDDEC3_InArgs.inputID).
720 *
721 * @remarks A value of zero (0) indicates
722 * an invalid ID. The first zero
723 * entry in array will indicate
724 * end of valid freeBufIDs within
725 * the array. Hence the
726 * application can stop searching
727 * the array when it encounters the
728 * first zero entry.
729 *
730 * @remarks If no buffer was unlocked in
731 * the process call,
732 * @c freeBufID[0] will
733 * have a value of zero.
734 *
735 * @sa IVIDDEC3_InArgs.inputID
736 * @sa IVIDDEC3_OutArgs.displayBufs
737 */
738 XDAS_Int32 outBufsInUseFlag; /**< Flag to indicate that the @c outBufs
739 * provided with the IVIDDEC3_Fxns.process()
740 * call are in use. No @c outBufs are
741 * required to be supplied with the next
742 * IVIDDEC3_Fxns.process() call.
743 *
744 * @remarks Valid values are #XDAS_TRUE
745 * and #XDAS_FALSE.
746 */
747 XDAS_Int32 displayBufsMode; /**< Indicates which mode the
748 * #IVIDDEC3_OutArgs.displayBufs are
749 * presented in.
750 *
751 * @remarks See the
752 * IVIDDEC3_DisplayBufsMode enum
753 * for the values this field may
754 * contain.
755 *
756 * @remarks This will be set to the same
757 * value the application provided
758 * at creation time via
759 * #IVIDDEC3_Params.displayBufsMode.
760 *
761 * @sa IVIDDEC3_Params.displayBufsMode
762 * @sa IVIDDEC3_DisplayBufsMode
763 */
764 union {
765 IVIDEO2_BufDesc bufDesc[1];/**< Array containing display frames
766 * corresponding to valid ID entries
767 * in the @c outputID[] array.
768 *
769 * @remarks The number of elements in this
770 * array is not necessarily 1, and
771 * should be acquired by the app
772 * via the
773 * IVIDDEC3_Status.maxNumDisplayBufs
774 * field - acquired by calling
775 * IVIDDEC3_Fxns.control() with
776 * #XDM_GETSTATUS.
777 * The application should acquire
778 * this prior to calling
779 * IVIDDEC3_Fxns.process().
780 *
781 * @remarks Because of the variable size
782 * of this array, care must be
783 * taken when setting the
784 * IVIDDEC3_OutArgs.size field
785 * to include the complete size of
786 * this struct.
787 *
788 * @remarks Entries in the array
789 * corresponding to invalid
790 * ID values (zero) in
791 * IVIDDEC3_OutArgs.outputID[] will
792 * set zero value for the following
793 * fields in the IVIDEO2_BufDesc
794 * structure: @c numPlanes,
795 * @c numMetaPlanes.
796 *
797 * @remarks Implied by the previous remark,
798 * as this array corresponds to
799 * buffer IDs indicated by
800 * @c outputID[], elements of
801 * this array are undefined if
802 * the corresponding @c outputID[]
803 * element is zero (0).
804 *
805 */
806 IVIDEO2_BufDesc *pBufDesc[IVIDEO2_MAX_IO_BUFFERS]; /**< Array containing
807 * pointers to display frames corresponding
808 * to valid ID entries in the @c outputID[]
809 * array.
810 *
811 * @remarks These buffers must be allocated
812 * by the application, and provided
813 * <i>into</i> this "outArgs"
814 * structure by the app.
815 */
816 } displayBufs; /**< Display Buffers union.
817 *
818 * @remarks This field is complex. The
819 * value in
820 * #IVIDDEC3_OutArgs.displayBufsMode
821 * indicates how the user should
822 * interact with this union field.
823 * If #IVIDDEC3_OutArgs.displayBufsMode
824 * is
825 * #IVIDDEC3_DISPLAYBUFS_EMBEDDED,
826 * this field should be referenced
827 * via the
828 * IVIDDEC3_OutArgs.bufDesc[] array
829 * who's number of elements is
830 * determined via the
831 * #IVIDDEC3_OutArgs.outputID[]
832 * array. If this field is
833 * #IVIDDEC3_DISPLAYBUFS_PTRS,
834 * this field should be referenced
835 * via the
836 * IVIDDEC3_OutArgs.pBufDesc[]
837 * array.
838 *
839 * @sa IVIDDEC3_OutArgs.bufDesc
840 * @sa IVIDDEC3_OutArgs.pBufDesc
841 */
842} IVIDDEC3_OutArgs;
843
844
845/**
846 * @brief Defines the control commands for the IVIDDEC3 module
847 *
848 * @remarks This ID can be extended in IMOD interface for
849 * additional controls.
850 *
851 * @sa XDM_CmdId
852 *
853 * @sa IVIDDEC3_Fxns::control()
854 */
855typedef IALG_Cmd IVIDDEC3_Cmd;
856
857
858/**
859 * @brief Defines all of the operations on IVIDDEC3 objects
860 */
861typedef struct IVIDDEC3_Fxns {
862 IALG_Fxns ialg; /**< XDAIS algorithm interface.
863 *
864 * @sa IALG_Fxns
865 */
866
867/**
868 * @brief Basic video decoding call
869 *
870 * @param[in] handle Handle to an algorithm instance.
871 * @param[in,out] inBufs Input buffer descriptors.
872 * @param[in,out] outBufs Output buffer descriptors. The algorithm
873 * may modify the output buffer pointers.
874 * @param[in] inArgs Input arguments. This is a required
875 * parameter.
876 * @param[out] outArgs Ouput results. This is a required parameter.
877 *
878 * @remarks process() is a blocking call. When process() returns, the
879 * algorithm's processing is complete.
880 *
881 * @remarks process() enables codecs to support error resiliency and
882 * error concealment. As a result, even if #IVIDDEC3_EFAIL
883 * is returned from process() because the encoded buffer has
884 * an error, it's possible that decoded buffers
885 * (@c outArgs->decodedBufs) and display buffers
886 * (@c outArgs->displayBufs) could still be returned.
887 * The codec can indicate that buffers are available by
888 * <i>not</i> setting the #XDM_ISFATALERROR bit
889 * in the respective @c displayBufs and @c decodedBufs
890 * @c extendedError field if the buffers contain valid data.
891 *
892 * @remarks By extension then, if the @c outArgs->decodedBufs and
893 * @c outArgs->displayBufs buffers are <i>not</i> valid, even
894 * if the codec's process() call returns IVIDDEC3_EFAIL, it must
895 * also be sure to set the #XDM_ISFATALERROR bit in the
896 * respective @c extendedError fields. Failure to do so may
897 * result in applications accessing these buffers and causing
898 * system instability.
899 *
900 * @pre @c inArgs must not be NULL, and must point to a valid
901 * IVIDDEC3_InArgs structure.
902 *
903 * @pre @c outArgs must not be NULL, and must point to a valid
904 * IVIDDEC3_OutArgs structure.
905 *
906 * @pre @c inBufs must not be NULL, and must point to a valid
907 * XDM2_BufDesc structure.
908 *
909 * @pre When operating in "fullframe mode" (e.g. not in data sync
910 * mode), @c inBufs->descs[0].buf must not be NULL, and must
911 * point to a valid buffer of data that is at least
912 * @c inBufs->descs[0].bufSize bytes in length.
913 *
914 * @pre When created with .inputDataMode (for @c inBufs) or
915 * .outputDataMode (for @c outBufs) set to operate in
916 * "subframe mode" (e.g. data sync mode), the appropriate
917 * .descs[].usageMode field(s)'s XDM_MEMUSAGE_DATASYNC
918 * bit must be set. See #XDM_MemoryUsageMode for more details.
919 *
920 * @pre @c outBufs must not be NULL, and must point to a valid
921 * XDM2_BufDesc structure.
922 *
923 * @pre When operating in "fullframe mode" (e.g. not in data sync
924 * mode), @c outBufs->buf[0] must not be NULL, and must point to
925 * a valid buffer of data that is at least
926 * @c outBufs->bufSizes[0] bytes in length.
927 *
928 * @pre Unless used in data sync mode, the buffers in @c inBufs
929 * and @c outBufs are physically
930 * contiguous and owned by the calling application.
931 *
932 * @post The algorithm <b>must not</b> modify the contents of @c inArgs.
933 *
934 * @post The algorithm <b>must not</b> modify the contents of
935 * @c inBufs, with the exception of @c inBufs.bufDesc[].accessMask.
936 * That is, the data and buffers pointed to by these parameters
937 * must be treated as read-only.
938 *
939 * @post The algorithm <b>must</b> modify the contents of
940 * @c inBufs->descs[].accessMask and appropriately indicate the
941 * mode in which each of the buffers in @c inBufs were read.
942 * For example, if the algorithm only read from
943 * @c inBufs.descs[0].buf using the algorithm processor, it
944 * could utilize #XDM_SETACCESSMODE_READ to update the appropriate
945 * @c accessMask fields.
946 * The application <i>may</i> utilize these
947 * returned values to appropriately manage cache.
948 *
949 * @post The buffers in @c inBufs are
950 * owned by the calling application.
951 *
952 * @retval IVIDDEC3_EOK @copydoc IVIDDEC3_EOK
953 * @retval IVIDDEC3_EFAIL @copydoc IVIDDEC3_EFAIL
954 * See IVIDDEC3_Status#extendedError
955 * for more detailed further error
956 * conditions.
957 * @retval IVIDDEC3_EUNSUPPORTED @copydoc IVIDDEC3_EUNSUPPORTED
958 */
959 XDAS_Int32 (*process)(IVIDDEC3_Handle handle, XDM2_BufDesc *inBufs,
960 XDM2_BufDesc *outBufs, IVIDDEC3_InArgs *inArgs,
961 IVIDDEC3_OutArgs *outArgs);
962
963
964/**
965 * @brief Control behavior of an algorithm
966 *
967 * @param[in] handle Handle to an algorithm instance.
968 * @param[in] id Command id. See #XDM_CmdId.
969 * @param[in] params Dynamic parameters. This is a required
970 * parameter.
971 * @param[out] status Output results. This is a required parameter.
972 *
973 * @pre @c handle must be a valid algorithm instance handle.
974 *
975 * @pre @c params must not be NULL, and must point to a valid
976 * IVIDDEC3_DynamicParams structure.
977 *
978 * @pre @c status must not be NULL, and must point to a valid
979 * IVIDDEC3_Status structure.
980 *
981 * @pre If a buffer is provided in the @c status->data field,
982 * it must be physically contiguous and owned by the calling
983 * application.
984 *
985 * @post The algorithm <b>must not</b> modify the contents of @c params.
986 * That is, the data pointed to by this parameter must be
987 * treated as read-only.
988 *
989 * @post If a buffer was provided in the @c status->data field,
990 * it is owned by the calling application.
991 *
992 * @retval IVIDDEC3_EOK @copydoc IVIDDEC3_EOK
993 * @retval IVIDDEC3_EFAIL @copydoc IVIDDEC3_EFAIL
994 * See IVIDDEC3_Status#extendedError
995 * for more detailed further error
996 * conditions.
997 * @retval IVIDDEC3_EUNSUPPORTED @copydoc IVIDDEC3_EUNSUPPORTED
998 */
999 XDAS_Int32 (*control)(IVIDDEC3_Handle handle, IVIDDEC3_Cmd id,
1000 IVIDDEC3_DynamicParams *params, IVIDDEC3_Status *status);
1001
1002} IVIDDEC3_Fxns;
1003
1004
1005/*@}*/
1006
1007#ifdef __cplusplus
1008}
1009#endif
1010
1011#endif
diff --git a/packages/xdais/ti/xdais/dm/ividenc2.h b/packages/xdais/ti/xdais/dm/ividenc2.h
new file mode 100755
index 0000000..48314e0
--- /dev/null
+++ b/packages/xdais/ti/xdais/dm/ividenc2.h
@@ -0,0 +1,937 @@
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/ividenc2.h
36 *
37 * @brief This header defines all types, constants, and functions
38 * shared by all implementations of the video encoder
39 * algorithms.
40 */
41/**
42 * @defgroup ti_xdais_dm_IVIDENC2 IVIDENC2 - XDM Video Encoder Interface
43 *
44 * This is the XDM IVIDENC2 Video Encoder Interface.
45 */
46
47#ifndef ti_xdais_dm_IVIDENC2_
48#define ti_xdais_dm_IVIDENC2_
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_IVIDENC2 */
60/*@{*/
61
62#define IVIDENC2_EOK XDM_EOK /**< @copydoc XDM_EOK */
63#define IVIDENC2_EFAIL XDM_EFAIL /**< @copydoc XDM_EFAIL */
64#define IVIDENC2_EUNSUPPORTED XDM_EUNSUPPORTED /**< @copydoc XDM_EUNSUPPORTED */
65
66
67/**
68 * @brief Enumeration of possible motion vector (MV) accuracy
69 *
70 * @enumWarning
71 */
72typedef enum {
73 IVIDENC2_MOTIONVECTOR_PIXEL = 0, /**< Motion vectors accuracy is only integer pel. */
74 IVIDENC2_MOTIONVECTOR_HALFPEL = 1, /**< Motion vectors accuracy is half pel. */
75 IVIDENC2_MOTIONVECTOR_QUARTERPEL = 2,/**< Motion vectors accuracy is quarter pel. */
76 IVIDENC2_MOTIONVECTOR_EIGHTHPEL = 3, /**< Motion vectors accuracy is one-eighth pel. */
77 IVIDENC2_MOTIONVECTOR_MAX = 4 /**< Motion vectors accuracy is not defined */
78} IVIDENC2_MotionVectorAccuracy;
79
80/**
81 * @brief Video frame control
82 *
83 * @enumWarning
84 *
85 * @extendedEnum
86 *
87 * @remarks This enumeration provides the application with some frame
88 * level control of the video encoder.
89 *
90 * @sa IVIDENC2_InArgs.control
91 */
92typedef enum {
93 IVIDENC2_CTRL_NONE = 0, /**< No control operations. */
94 IVIDENC2_CTRL_FORCESKIP = 1, /**< Skip frame if it is not IDR/I frame. */
95 /** Default settings. */
96 IVIDENC2_CTRL_DEFAULT = IVIDENC2_CTRL_NONE
97} IVIDENC2_Control;
98
99
100/**
101 * @brief This must be the first field of all IVIDENC2
102 * instance objects
103 */
104typedef struct IVIDENC2_Obj {
105 struct IVIDENC2_Fxns *fxns;
106} IVIDENC2_Obj;
107
108
109/**
110 * @brief Opaque handle to an IVIDENC2 objects.
111 */
112typedef struct IVIDENC2_Obj *IVIDENC2_Handle;
113
114/**
115 * @brief Default codec profile
116 *
117 * @remarks This definition is often used when the a particular codec
118 * doesn't have a profile, or the application doesn't
119 * know which profile the codec should use.
120 *
121 * @sa IVIDENC2_Params.profile
122 */
123#define IVIDENC2_DEFAULTPROFILE (-1)
124
125/**
126 * @brief Default codec level
127 *
128 * @remarks This definition is often used when the a particular codec
129 * doesn't have a level, or the application doesn't
130 * know which profile the codec should use.
131 *
132 * @sa IVIDENC2_Params.level
133 */
134#define IVIDENC2_DEFAULTLEVEL (-1)
135
136/**
137 * @brief Defines the creation time parameters for
138 * all IVIDENC2 instance objects
139 *
140 * @extensibleStruct
141 */
142typedef struct IVIDENC2_Params {
143 XDAS_Int32 size; /**< @sizeField */
144 XDAS_Int32 encodingPreset; /**< Encoding preset. */
145 XDAS_Int32 rateControlPreset;/**< @copydoc IVIDEO_RateControlPreset
146 *
147 * @sa IVIDEO_RateControlPreset
148 */
149 XDAS_Int32 maxHeight; /**< Maximum video height in pixels. */
150 XDAS_Int32 maxWidth; /**< Maximum video width in pixels. */
151 XDAS_Int32 dataEndianness; /**< Endianness of output data.
152 *
153 * @sa XDM_DataFormat
154 */
155 XDAS_Int32 maxInterFrameInterval;/**< I to P frame distance. e.g. = 1 if
156 * no B frames, 2 to insert one B frame.
157 *
158 * @remarks This is used for setting the
159 * maximum number of B frames
160 * between two refererence frames.
161 */
162 XDAS_Int32 maxBitRate; /**< Maximum Bit-rate for encoding in bits
163 * per second
164 */
165 XDAS_Int32 minBitRate; /**< Minumum Bit-rate for encoding in bits
166 * per second
167 */
168 XDAS_Int32 inputChromaFormat;/**< Chroma format for the input buffer.
169 *
170 * @sa XDM_ChromaFormat
171 */
172 XDAS_Int32 inputContentType;/**< Video content type of the buffer being
173 * encoded.
174 *
175 * @sa IVIDEO_ContentType
176 */
177 XDAS_Int32 operatingMode; /**< Video coding mode of operation.
178 *
179 * @sa IVIDEO_OperatingMode
180 */
181 XDAS_Int32 profile; /**< Profile indicator of video codec
182 *
183 * @remarks Only one default value
184 * (#IVIDENC2_DEFAULTPROFILE) is
185 * defined by XDM for this field.
186 * The reason for not
187 * defining further values
188 * is to keep profile values as
189 * defined by video codec
190 * standards.
191 *
192 * @sa IVIDENC2_Status.profile
193 */
194 XDAS_Int32 level; /**< Level indicator of video codec
195 *
196 * @remarks Only one default value
197 * (#IVIDENC2_DEFAULTLEVEL) is
198 * defined by XDM for this field.
199 * The reason for not
200 * defining further values
201 * is to keep profile values as
202 * defined by video codec
203 * standards.
204 *
205 * @sa IVIDENC2_Status.level
206 */
207 XDAS_Int32 inputDataMode; /**< Input data mode.
208 *
209 * @remarks If a subframe mode is provided,
210 * the application must call
211 * IVIDENC2_Fxns::control() with
212 * #XDM_SETPARAMS id prior to
213 * #IVIDENC2_Fxns::process() to
214 * set the
215 * IVIDENC2_DynamicParams::getDataFxn
216 * and
217 * IVIDENC2_DynamicParams::getDataHandle.
218 * Else, the alg can return
219 * error.
220 *
221 * @sa IVIDEO_DataMode
222 */
223 XDAS_Int32 outputDataMode; /**< Output data mode.
224 *
225 * @remarks If a subframe mode is provided,
226 * the application must call
227 * IVIDENC2_Fxns::control() with
228 * #XDM_SETPARAMS id prior to
229 * #IVIDENC2_Fxns::process() to
230 * set the
231 * IVIDENC2_DynamicParams::putDataFxn,
232 * IVIDENC2_DynamicParams::putDataHandle
233 * (and optionally
234 * IVIDENC2_DynamicParams::getBufferFxn,
235 * and
236 * IVIDENC2_DynamicParams::getBufferHandle).
237 * Else, the alg can return
238 * error.
239 *
240 * @sa IVIDEO_DataMode
241 */
242 XDAS_Int32 numInputDataUnits; /**< Number of input slices/rows.
243 *
244 * @remarks Units depend on the
245 * @c inputDataMode, like number of
246 * slices/rows/blocks etc.
247 *
248 * @remarks Ignored if @c inputDataMode
249 * is set to full frame mode.
250 */
251 XDAS_Int32 numOutputDataUnits;/**< Number of output slices/rows.
252 *
253 * @remarks Units depend on the
254 * @c outputDataMode, like number of
255 * slices/rows/blocks etc.
256 *
257 * @remarks Ignored if @c outputDataMode
258 * is set to full frame mode.
259 */
260 XDAS_Int32 metadataType[IVIDEO_MAX_NUM_METADATA_PLANES];/**< Type of
261 * each metadata plane.
262 *
263 * @sa IVIDEO_MetadataType
264 */
265} IVIDENC2_Params;
266
267
268/**
269 * @brief This structure defines the algorithm parameters that can be
270 * modified after creation via control() calls
271 *
272 * @remarks It is not necessary that a given implementation support all
273 * dynamic parameters to be configurable at run time. If a
274 * particular algorithm does not support run-time updates to
275 * a parameter that the application is attempting to change
276 * at runtime, it may indicate this as an error.
277 *
278 * @extensibleStruct
279 *
280 * @sa IVIDENC2_Fxns::control()
281 */
282typedef struct IVIDENC2_DynamicParams {
283 XDAS_Int32 size; /**< @sizeField */
284 XDAS_Int32 inputHeight; /**< Input frame height. */
285 XDAS_Int32 inputWidth; /**< Input frame width. */
286 XDAS_Int32 refFrameRate; /**< Reference, or input, frame rate in
287 * fps * 1000.
288 *
289 * @remarks For example, if ref frame
290 * rate is 30 frames per second,
291 * this field will be 30000.
292 */
293 XDAS_Int32 targetFrameRate; /**< Target frame rate in
294 * fps * 1000.
295 *
296 * @remarks For example, if target frame
297 * rate is 30 frames per second,
298 * this field will be 30000.
299 */
300 XDAS_Int32 targetBitRate; /**< Target bit rate in bits per second. */
301 XDAS_Int32 intraFrameInterval;/**< The number of frames between two I
302 * frames. For example, 30.
303 *
304 * @remarks For example, this field will be:
305 * - 0 - Only first frame to be intra
306 * coded. e.g. IPPPPPP...
307 * - 1 - No inter frames (all intra
308 * frames).
309 * - 2 - Consecutive IPIPIP... sequence (if
310 * no B frames).
311 * - 3 - IPPIPP... or IPBIPBI... and so on.
312 */
313 XDAS_Int32 generateHeader; /**< @copydoc XDM_EncMode
314 *
315 * @sa XDM_EncMode
316 */
317 XDAS_Int32 captureWidth; /**< DEFAULT(0): use imagewidth as
318 * pitch else use given capture
319 * width for pitch provided it
320 * is greater than image width.
321 */
322 XDAS_Int32 forceFrame; /**< Force the current (immediate) frame to be
323 * encoded as a specific frame type.
324 *
325 * @remarks For example, this field will be:
326 * - IVIDEO_NA_FRAME - No forcing of any
327 * specific frame type for the frame.
328 * - IVIDEO_I_FRAME - Force the frame to be
329 * encoded as I frame.
330 * - IVIDEO_IDR_FRAME - Force the frame to
331 * be encoded as an IDR frame (specific
332 * to H.264 codecs).
333 * - IVIDEO_P_FRAME - Force the frame to be
334 * encoded as a P frame.
335 * - IVIDEO_B_FRAME - Force the frame to be
336 * encoded as a B frame.
337 *
338 * @sa IVIDEO_FrameType.
339 */
340 XDAS_Int32 interFrameInterval;/**< Number of B frames between two reference
341 * frames; that is, the number of B frames
342 * between two P frames or I/P frames.
343 * DEFAULT(0).
344 *
345 * @remarks For example, this field will be:
346 * - 0 - to use maxInterFrameInterval.
347 * - 1 - 0 B frames between two reference
348 * frames.
349 * - 2 - 1 B frame between two reference
350 * frames.
351 * - 3 - 2 B frames between two reference
352 * frames.
353 * - and so on...
354 *
355 * @sa IVIDENC2_Params.maxInterFrameInterval.
356 */
357 XDAS_Int32 mvAccuracy; /**< Pixel Accuracy of the motion vector
358 *
359 * @remarks This parameter allows the user
360 * to tune performance by
361 * controlling the complexity of
362 * motion estimation and
363 * compensation within the video
364 * encoder.
365 *
366 * @sa IVIDENC2_MotionVectorAccuracy
367 */
368 XDAS_Int32 sampleAspectRatioHeight; /**< Sample aspect ratio: Height
369 *
370 * @remarks This parameter is used to
371 * describe the desired aspect
372 * ratio in the bitstream.
373 */
374 XDAS_Int32 sampleAspectRatioWidth; /**< Sample aspect ratio: Width
375 *
376 * @remarks This parameter is used to
377 * describe the desired aspect
378 * ratio in the bitstream.
379 */
380 XDAS_Int32 ignoreOutbufSizeFlag; /**< Flag to indicate that the application
381 * has ignored the output buffer size
382 * requirement.
383 *
384 * @remarks Typically video encoders
385 * ask for large output buffers
386 * (compressed bit-streams)
387 * assuming theoretical worst
388 * case. But on memory
389 * constrained systems, the
390 * application may want to
391 * allocate less than this
392 * worst-case size, depending
393 * upon the use case.
394 * If the application provides a
395 * buffer that is smaller than
396 * the worst-case size, the
397 * encoder will return an error.
398 * To prevent the encoder from
399 * returning an error, the
400 * application can set this
401 * @c ignoreOutbufSizeFlag field to
402 * #XDAS_TRUE. When this flag
403 * is set to #XDAS_TRUE, the
404 * encoder shouldn't return an
405 * error even if the output
406 * buffer size is less than
407 * requested by the codec.
408 *
409 * @remarks Valid values are #XDAS_TRUE
410 * and #XDAS_FALSE.
411 */
412 XDM_DataSyncPutFxn putDataFxn; /**< Optional datasync "put data" function.
413 *
414 * @remarks Apps/frameworks that don't
415 * support datasync should set
416 * this to NULL.
417 *
418 * @remarks This function is provided
419 * by the app/framework to the
420 * video encoder. The encoder
421 * calls this function when data
422 * has been put into an output
423 * buffer.
424 */
425 XDM_DataSyncHandle putDataHandle;/**< Datasync "put data" handle
426 *
427 * @remarks This is a handle which the
428 * codec must provide when
429 * calling the app-registered
430 * IVIDENC2_DynamicParams.putDataFxn().
431 *
432 * @remarks Apps/frameworks that don't
433 * support datasync should set
434 * this to NULL.
435 *
436 * @remarks For an algorithm, this handle
437 * is read-only; it must not be
438 * modified when calling
439 * the app-registered
440 * IVIDENC2_DynamicParams.putDataFxn().
441 *
442 * @remarks The app/framework can use
443 * this handle to differentiate
444 * callbacks from different
445 * algorithms.
446 */
447 XDM_DataSyncGetFxn getDataFxn;/**< Datasync "get data" function.
448 *
449 * @remarks This function is provided
450 * by the app/framework to the
451 * video encoder. The encoder
452 * calls this function to get
453 * partial video buffer(s)
454 * from the app/framework.
455 *
456 * @remarks Apps/frameworks that don't
457 * support datasync should set
458 * this to NULL.
459 */
460 XDM_DataSyncHandle getDataHandle;/**< Datasync "get data" handle
461 *
462 * @remarks This is a handle which the
463 * codec must provide when
464 * calling @c getDataFxn.
465 *
466 * @remarks Apps/frameworks that don't
467 * support datasync should set
468 * this to NULL.
469 *
470 * @remarks For an algorithm, this handle
471 * is read-only; it must not be
472 * modified when calling
473 * the app-registered
474 * IVIDENC2_DynamicParams.getDataFxn().
475 *
476 * @remarks The app/framework can use
477 * this handle to differentiate
478 * callbacks from different
479 * algorithms.
480 */
481 XDM_DataSyncGetBufferFxn getBufferFxn;/**< Datasync "get buffer" function.
482 *
483 * @remarks This function is provided
484 * by the app/framework to the
485 * video encoder. The encoder
486 * calls this function to obtain
487 * partial compressed bit-stream
488 * data buffers from the
489 * app/framework.
490 *
491 * @remarks Apps/frameworks that don't
492 * support datasync should set
493 * this to NULL.
494 */
495 XDM_DataSyncHandle getBufferHandle;/**< Datasync "get buffer" handle
496 *
497 * @remarks This is a handle which the
498 * codec must provide when
499 * calling the app-registered
500 * IVIDENC2_DynamicParam.getBufferFxn().
501 *
502 * @remarks Apps/frameworks that don't
503 * support datasync should set
504 * this to NULL.
505 *
506 * @remarks For an algorithm, this handle
507 * is read-only; it must not be
508 * modified when calling
509 * the app-registered
510 * IVIDENC2_DynamicParams.getBufferFxn().
511 *
512 * @remarks The app/framework can use
513 * this handle to differentiate
514 * callbacks from different
515 * algorithms.
516 */
517 XDAS_Int32 lateAcquireArg; /**< Argument used during late acquire.
518 *
519 * @remarks For all control() commands
520 * other than
521 * #XDM_SETLATEACQUIREARG, this
522 * field is ignored and can
523 * therefore be set by the
524 * caller to any value.
525 *
526 * @remarks This field is used to
527 * provide the
528 * 'late acquire' arg required by
529 * #XDM_SETLATEACQUIREARG.
530 *
531 * @remarks Late acquire support is
532 * an optional feature for
533 * video encoders. If the
534 * codec supports late
535 * acquisition of resources,
536 * and the application has supplied
537 * a lateAcquireArg value (via
538 * #XDM_SETLATEACQUIREARG), then the
539 * codec must also provide this
540 * @c lateAcquireArg value when
541 * requesting resources (i.e.
542 * during their call to
543 * acquire() when requesting
544 * the resource).
545 */
546} IVIDENC2_DynamicParams;
547
548
549/**
550 * @brief Defines the input arguments for all IVIDENC2 instance
551 * process function
552 *
553 * @extensibleStruct
554 *
555 * @sa IVIDENC2_Fxns::process()
556 */
557typedef struct IVIDENC2_InArgs {
558 XDAS_Int32 size; /**< @sizeField */
559 XDAS_Int32 inputID; /**< Identifier to attach with the corresponding
560 * input frames to be encoded.
561 *
562 * @remarks This is useful when frames
563 * require buffering (e.g.
564 * B frames), and to support
565 * buffer management.
566 *
567 * @remarks When there is no re-ordering,
568 * IVIDENC2_OutArgs::outputID will
569 * be the same as this inputID
570 * field.
571 *
572 * @remarks Zero (0) is <b>not</b> a
573 * supported inputID. This value
574 * is reserved for cases when
575 * there is no input buffer is
576 * provided.
577 *
578 * @sa IVIDENC2_OutArgs::outputID.
579 */
580 XDAS_Int32 control; /**< Encoder control operations
581 *
582 * @sa IVIDENC2_Control
583 */
584} IVIDENC2_InArgs;
585
586
587/**
588 * @brief Defines instance status parameters
589 *
590 * @extensibleStruct
591 *
592 * @sa IVIDENC2_Fxns::control()
593 */
594typedef struct IVIDENC2_Status {
595 XDAS_Int32 size; /**< @sizeField */
596 XDAS_Int32 extendedError; /**< @extendedErrorField */
597 XDM1_SingleBufDesc data; /**< Buffer descriptor for data passing.
598 *
599 * @remarks If this field is not used,
600 * the application <b>must</b>
601 * set @c data.buf to NULL.
602 *
603 * @remarks This buffer can be used as
604 * either input or output,
605 * depending on the command.
606 *
607 * @remarks The buffer will be provided
608 * by the application, and
609 * returned to the application
610 * upon return of the
611 * IVIDENC2_Fxns.control()
612 * call. The algorithm must
613 * not retain a pointer to this
614 * data.
615 *
616 * @sa #XDM_GETVERSION
617 */
618
619 XDAS_Int32 encodingPreset; /**< Encoding preset. */
620 XDAS_Int32 rateControlPreset;/**< @copydoc IVIDEO_RateControlPreset
621 *
622 * @sa IVIDEO_RateControlPreset
623 */
624 XDAS_Int32 maxInterFrameInterval; /**< I to P frame distance. e.g. = 1 if
625 * no B frames, 2 to insert one B frame.
626 *
627 * @remarks This is used for setting the
628 * maximum number of B frames
629 * between two refererence frames.
630 */
631 XDAS_Int32 inputChromaFormat;/**< Chroma format for the input buffer.
632 *
633 * @sa XDM_ChromaFormat
634 */
635 XDAS_Int32 inputContentType; /**< Video content type of the buffer being
636 * encoded.
637 *
638 * @sa IVIDEO_ContentType
639 */
640 XDAS_Int32 operatingMode; /**< Video encoding mode of operation.
641 *
642 * @sa IVIDEO_OperatingMode
643 */
644 XDAS_Int32 profile; /**< Profile indicator of video codec.
645 *
646 * @sa IVIDENC2_DEFAULTPROFILE
647 * @sa IVIDENC2_Params.profile
648 */
649 XDAS_Int32 level; /**< Level indicator of video codec.
650 *
651 * @sa IVIDENC2_DEFAULTLEVEL
652 * @sa IVIDENC2_Params.level
653 */
654 XDAS_Int32 inputDataMode; /**< Input data mode.
655 *
656 * @sa IVIDENC2_Params.inputDataMode
657 * @sa IVIDEO_DataMode
658 */
659 XDAS_Int32 outputDataMode; /**< Output data mode.
660 *
661 * @sa IVIDENC2_Params.outputDataMode
662 * @sa IVIDEO_DataMode
663 */
664 XDAS_Int32 numInputDataUnits; /**< Number of input slices/rows.
665 *
666 * @remarks Units depend on the
667 * IVIDENC2_Params.inputDataMode,
668 * like number of
669 * slices/rows/blocks etc.
670 *
671 * @remarks Ignored if
672 * IVIDENC2_Params.inputDataMode
673 * is set to full frame mode.
674 *
675 * @sa IVIDENC2_Params.inputDataMode
676 */
677 XDAS_Int32 numOutputDataUnits;/**< Number of output slices/rows.
678 *
679 * @remarks Units depend on the
680 * @c outputDataMode, like number of
681 * slices/rows/blocks etc.
682 *
683 * @remarks Ignored if
684 * IVIDENC2_Params.outputDataMode
685 * is set to full frame mode.
686 *
687 * @sa IVIDENC2_Params.outputDataMode
688 */
689 XDAS_Int32 configurationID; /**< Configuration ID of given codec.
690 *
691 * @remarks This is used to differentiate
692 * multiple images of a vendor.
693 * It can be used by the
694 * framework to optimize the
695 * save/restore overhead of any
696 * resources used.
697 *
698 * @remarks This can be useful in
699 * multichannel use case
700 * scenarios.
701 *
702 */
703 XDM1_AlgBufInfo bufInfo; /**< Input and output buffer information.
704 *
705 * @remarks This field provides the
706 * application with the algorithm's
707 * buffer requirements. The
708 * requirements may vary depending
709 * on the current configuration
710 * of the algorithm instance.
711 *
712 * @sa IVIDENC2_Params
713 * @sa XDM1_AlgBufInfo
714 * @sa IVIDENC2_Fxns.process()
715 */
716 XDAS_Int32 metadataType[IVIDEO_MAX_NUM_METADATA_PLANES];/**< Type of
717 * each metadata plane.
718 *
719 * @sa IVIDEO_MetadataType
720 */
721 IVIDENC2_DynamicParams encDynamicParams; /**< Video encoder dynamic
722 * parameters.
723 *
724 * @todo Need to better wordsmith this
725 * section.
726 *
727 * @remarks In case of extened dynamic
728 * Params, alg can check the
729 * size of status or
730 * DynamicParams and return
731 * the parameters accordingly.
732 */
733} IVIDENC2_Status;
734
735
736/**
737 * @brief Defines the run time output arguments for all IVIDENC2
738 * instance objects
739 *
740 * @extensibleStruct
741 *
742 * @sa IVIDENC2_Fxns::process()
743 */
744typedef struct IVIDENC2_OutArgs {
745 XDAS_Int32 size; /**< @sizeField */
746 XDAS_Int32 extendedError; /**< @extendedErrorField */
747 XDAS_Int32 bytesGenerated; /**< Number of bytes generated during the
748 * IVIDENC2_Fxns::process() call.
749 */
750 XDAS_Int32 encodedFrameType;/**< @copydoc IVIDEO_FrameType
751 *
752 * @sa IVIDEO_FrameType
753 */
754 XDAS_Int32 inputFrameSkip; /**< @copydoc IVIDEO_SkipMode
755 *
756 * @sa IVIDEO_SkipMode
757 */
758 XDAS_Int32 freeBufID[IVIDEO2_MAX_IO_BUFFERS]; /**< This is an
759 * array of inputID's corresponding to the
760 * buffers that have been unlocked in the
761 * current process call.
762 *
763 * @remarks The buffers released by the
764 * algorithm are indicated by
765 * their non-zero ID (previously
766 * provided via
767 * IVIDENC2_InArgs#inputID).
768 *
769 * @remarks A value of zero (0) indicates
770 * an invalid ID. The first zero
771 * entry in array will indicate
772 * end of valid freeBufIDs within
773 * the array. Hence the
774 * application can stop searching
775 * the array when it encounters the
776 * first zero entry.
777 *
778 * @remarks If no buffer was unlocked in
779 * the process call,
780 * @c freeBufID[0] will
781 * have a value of zero.
782 *
783 * @sa IVIDENC2_InArgs#inputID
784 */
785
786 IVIDEO2_BufDesc reconBufs; /**< Reconstruction frames. */
787} IVIDENC2_OutArgs;
788
789
790/**
791 * @brief Defines the control commands for the IVIDENC2 module
792 *
793 * @remarks This ID can be extended in IMOD interface for
794 * additional controls.
795 *
796 * @sa XDM_CmdId
797 *
798 * @sa IVIDENC2_Fxns::control()
799 */
800typedef IALG_Cmd IVIDENC2_Cmd;
801
802
803/**
804 * @brief Defines all of the operations on IVIDENC2 objects
805 */
806typedef struct IVIDENC2_Fxns {
807 IALG_Fxns ialg; /**< XDAIS algorithm interface.
808 *
809 * @sa IALG_Fxns
810 */
811
812/**
813 * @brief Basic video encoding call
814 *
815 * @param[in] handle Handle to an algorithm instance.
816 * @param[in,out] inBufs Input video buffer descriptors.
817 * @param[in,out] outBufs Output buffer descriptors. The algorithm
818 * may modify the output buffer pointers.
819 * @param[in] inArgs Input arguments. This is a required
820 * parameter.
821 * @param[out] outArgs Ouput results. This is a required parameter.
822 *
823 * @remarks process() is a blocking call. When process() returns, the
824 * algorithm's processing is complete.
825 *
826 * @pre @c inBufs must not be NULL, and must point to a valid
827 * IVIDEO2_BufDesc structure.
828 *
829 * @pre @c inBufs->numPlanes will indicate the total number of input
830 * buffers supplied for input frame in the @c inBufs->planeDesc[]
831 * array.
832 *
833 * @pre @c inBufs->numMetaPlanes will indicate the total number of input
834 * buffers supplied for meta data planes in the
835 * @c inBufs->metadataPlaneDesc[] array.
836 *
837 * @pre @c outBufs must not be NULL, and must point to a valid
838 * XDM2_BufDesc structure.
839 *
840 * @pre @c outBufs->buf[0] must not be NULL, and must point to
841 * a valid buffer of data that is at least
842 * @c outBufs->bufSizes[0] bytes in length.
843 *
844 * @pre @c inArgs must not be NULL, and must point to a valid
845 * IVIDENC2_InArgs structure.
846 *
847 * @pre @c outArgs must not be NULL, and must point to a valid
848 * IVIDENC2_OutArgs structure.
849 *
850 * @pre The buffers in @c inBuf and @c outBuf are physically
851 * contiguous and owned by the calling application.
852 *
853 * @post The algorithm <b>must not</b> modify the contents of @c inArgs.
854 *
855 * @post The algorithm <b>must not</b> modify the contents of
856 * @c inBufs, with the exception of @c inBufs.bufDesc[].accessMask.
857 * That is, the data and buffers pointed to by these parameters
858 * must be treated as read-only.
859 *
860 * @post The algorithm <b>must</b> appropriately set/clear the
861 * IVIDEO2_BufDesc.planeDesc[].accessMask and
862 * IVIDEO2_BufDesc.metadataPlaneDesc[].accessMask fields in
863 * @c inBufs to indicate the mode in which each of the respective
864 * buffers were read.
865 * For example, if the algorithm only read from
866 * @c inBufs.planeDesc[0].buf using the algorithm processor, it
867 * could utilize #XDM_SETACCESSMODE_READ to update the appropriate
868 * @c accessMask fields.
869 * The application <i>may</i> utilize these
870 * returned values to appropriately manage cache.
871 *
872 * @post The buffers in @c inBufs are
873 * owned by the calling application.
874 *
875 * @retval #IVIDENC2_EOK @copydoc IVIDENC2_EOK
876 * @retval #IVIDENC2_EFAIL @copydoc IVIDENC2_EFAIL
877 * See IVIDENC2_Status.extendedError
878 * for more detailed further error
879 * conditions.
880 * @retval #IVIDENC2_EUNSUPPORTED @copydoc IVIDENC2_EUNSUPPORTED
881 *
882 * @todo Need to review these comments. Not sure @c inBufs and
883 * @c outBufs are correctly described.
884 */
885 XDAS_Int32 (*process)(IVIDENC2_Handle handle, IVIDEO2_BufDesc *inBufs,
886 XDM2_BufDesc *outBufs, IVIDENC2_InArgs *inArgs,
887 IVIDENC2_OutArgs *outArgs);
888
889
890/**
891 * @brief Control behavior of an algorithm
892 *
893 * @param[in] handle Handle to an algorithm instance.
894 * @param[in] id Command id. See #XDM_CmdId.
895 * @param[in] params Dynamic parameters. This is a required
896 * parameter.
897 * @param[out] status Output results. This is a required parameter.
898 *
899 * @pre @c handle must be a valid algorithm instance handle.
900 *
901 * @pre @c params must not be NULL, and must point to a valid
902 * IVIDENC2_DynamicParams structure.
903 *
904 * @pre @c status must not be NULL, and must point to a valid
905 * IVIDENC2_Status structure.
906 *
907 * @pre If a buffer is provided in the @c status->data field,
908 * it must be physically contiguous and owned by the calling
909 * application.
910 *
911 * @post The algorithm <b>must not</b> modify the contents of @c params.
912 * That is, the data pointed to by this parameter must be
913 * treated as read-only.
914 *
915 * @post If a buffer was provided in the @c status->data field,
916 * it is owned by the calling application.
917 *
918 * @retval #IVIDENC2_EOK @copydoc IVIDENC2_EOK
919 * @retval #IVIDENC2_EFAIL @copydoc IVIDENC2_EFAIL
920 * See IVIDENC2_Status.extendedError
921 * for more detailed further error
922 * conditions.
923 * @retval #IVIDENC2_EUNSUPPORTED @copydoc IVIDENC2_EUNSUPPORTED
924 */
925 XDAS_Int32 (*control)(IVIDENC2_Handle handle, IVIDENC2_Cmd id,
926 IVIDENC2_DynamicParams *params, IVIDENC2_Status *status);
927
928} IVIDENC2_Fxns;
929
930
931/*@}*/
932
933#ifdef __cplusplus
934}
935#endif
936
937#endif
diff --git a/packages/xdais/ti/xdais/dm/ivideo.h b/packages/xdais/ti/xdais/dm/ivideo.h
new file mode 100755
index 0000000..5711a39
--- /dev/null
+++ b/packages/xdais/ti/xdais/dm/ivideo.h
@@ -0,0 +1,829 @@
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/ivideo.h
36 *
37 * @brief This header defines all types, constants, enums, and functions
38 * that are common across the various video codecs.
39 */
40/**
41 * @addtogroup ti_xdais_dm_IVIDEO IVIDEO - XDM Video Interface
42 *
43 * This is the XDM video interface shared between the various codecs.
44 */
45
46#ifndef ti_xdais_dm_IVIDEO_
47#define ti_xdais_dm_IVIDEO_
48
49#ifdef __cplusplus
50extern "C" {
51#endif
52
53/** @ingroup ti_xdais_dm_IVIDEO */
54/*@{*/
55
56/**
57 * @brief Maximum I/O Buffers.
58 *
59 * @sa IVIDDEC2_OutArgs
60 * @sa IVIDDEC3_OutArgs
61 * @sa IVIDENC2_OutArgs
62 */
63#define IVIDEO2_MAX_IO_BUFFERS 20
64
65/**
66 * @brief Video frame skip features for video decoder.
67 *
68 * @enumWarning
69 *
70 * @extendedEnum
71 */
72typedef enum {
73 IVIDEO_NO_SKIP = 0, /**< Do not skip any frame types. */
74 IVIDEO_SKIP_P = 1, /**< Decode the P frame/skip frames internally,
75 * but do not copy the decoded output to the
76 * output buffers. This should be indicated
77 * by setting the output buffers to NULL.
78 *
79 * @remarks For example, if a B frame is
80 * dependant on the
81 * previously decoded P
82 * frame, the B frame
83 * shall be decoded and
84 * displayed
85 * successfully. For
86 * this, the P frame
87 * needs to be decoded,
88 * but not copied to the
89 * output buffer.
90 */
91 IVIDEO_SKIP_B = 2, /**< Skip B, BI frames. For B frames, the
92 * decoder will decode the frame
93 * bitstream, and return as soon as the
94 * frame type is decisively decoded.
95 * Internally, the algorithm will modify
96 * its state, so that subsequent
97 * decoding of other frames is possible.
98 */
99 IVIDEO_SKIP_I = 3, /**< Skip intra coded frame. */
100 IVIDEO_SKIP_IP = 4, /**< Skip I and P frame/field(s). */
101 IVIDEO_SKIP_IB = 5, /**< Skip I and B frame/field(s). */
102 IVIDEO_SKIP_PB = 6, /**< Skip P and B frame/field(s). */
103 IVIDEO_SKIP_IPB = 7, /**< Skip I/P/B/BI frames. */
104 IVIDEO_SKIP_IDR = 8, /**< Skip IDR Frame. */
105 IVIDEO_SKIP_NONREFERENCE = 9, /**< @todo add documentation */
106
107 /** Default settings. */
108 IVIDEO_SKIP_DEFAULT = IVIDEO_NO_SKIP
109} IVIDEO_FrameSkip;
110
111/**
112 * @brief Video frame types.
113 *
114 * @remarks For the various @c IVIDEO_xy_FRAME values, this frame type is
115 * interlaced where both top and bottom fields are
116 * provided in a single frame. The first field is an "x"
117 * frame, the second field is "y" field.
118 *
119 * @enumWarning
120 *
121 * @extendedEnum
122 */
123typedef enum {
124 IVIDEO_NA_FRAME = -1, /**< Frame type not available. */
125 IVIDEO_I_FRAME = 0, /**< Intra coded frame. */
126 IVIDEO_P_FRAME = 1, /**< Forward inter coded frame. */
127 IVIDEO_B_FRAME = 2, /**< Bi-directional inter coded frame. */
128 IVIDEO_IDR_FRAME = 3, /**< Intra coded frame that can be used for
129 * refreshing video content.
130 */
131 IVIDEO_II_FRAME = 4, /**< Interlaced Frame, both fields are I frames */
132 IVIDEO_IP_FRAME = 5, /**< Interlaced Frame, first field is an I frame,
133 * second field is a P frame.
134 */
135 IVIDEO_IB_FRAME = 6, /**< Interlaced Frame, first field is an I frame,
136 * second field is a B frame.
137 */
138 IVIDEO_PI_FRAME = 7, /**< Interlaced Frame, first field is a P frame,
139 * second field is a I frame.
140 */
141 IVIDEO_PP_FRAME = 8, /**< Interlaced Frame, both fields are P frames. */
142 IVIDEO_PB_FRAME = 9, /**< Interlaced Frame, first field is a P frame,
143 * second field is a B frame.
144 */
145 IVIDEO_BI_FRAME = 10, /**< Interlaced Frame, first field is a B frame,
146 * second field is an I frame.
147 */
148 IVIDEO_BP_FRAME = 11, /**< Interlaced Frame, first field is a B frame,
149 * second field is a P frame.
150 */
151 IVIDEO_BB_FRAME = 12, /**< Interlaced Frame, both fields are B frames. */
152 IVIDEO_MBAFF_I_FRAME = 13, /**< Intra coded MBAFF frame. */
153 IVIDEO_MBAFF_P_FRAME = 14, /**< Forward inter coded MBAFF frame. */
154 IVIDEO_MBAFF_B_FRAME = 15, /**< Bi-directional inter coded MBAFF frame.*/
155 IVIDEO_MBAFF_IDR_FRAME = 16, /**< Intra coded MBAFF frame that can be used
156 * for refreshing video content.
157 */
158 /** Default setting. */
159 IVIDEO_FRAMETYPE_DEFAULT = IVIDEO_I_FRAME
160} IVIDEO_FrameType;
161
162/**
163 * @brief Video content types.
164 *
165 * @enumWarning
166 *
167 * @extendedEnum
168 */
169typedef enum {
170 IVIDEO_CONTENTTYPE_NA = -1,/**< Frame type is not available. */
171 IVIDEO_PROGRESSIVE = 0, /**< Progressive frame. */
172 IVIDEO_PROGRESSIVE_FRAME = IVIDEO_PROGRESSIVE, /**< Progressive Frame. */
173 IVIDEO_INTERLACED = 1, /**< Interlaced frame. */
174 IVIDEO_INTERLACED_FRAME = IVIDEO_INTERLACED, /**< Interlaced frame. */
175 IVIDEO_INTERLACED_TOPFIELD = 2, /**< Interlaced picture, top field. */
176 IVIDEO_INTERLACED_BOTTOMFIELD = 3, /**< Interlaced picture, bottom field. */
177
178 /**Default setting. */
179 IVIDEO_CONTENTTYPE_DEFAULT = IVIDEO_PROGRESSIVE
180} IVIDEO_ContentType;
181
182
183/**
184 * @brief Video rate control presets.
185 *
186 * @enumWarning
187 *
188 * @extendedEnum
189 */
190typedef enum {
191 IVIDEO_LOW_DELAY = 1, /**< CBR rate control for video conferencing. */
192 IVIDEO_STORAGE = 2, /**< VBR rate control for local storage (DVD)
193 * recording.
194 */
195 IVIDEO_TWOPASS = 3, /**< Two pass rate control for non real time
196 * applications.
197 */
198 IVIDEO_NONE = 4, /**< No configurable video rate control
199 * mechanism.
200 */
201 IVIDEO_USER_DEFINED = 5,/**< User defined configuration using extended
202 * parameters.
203 */
204
205 /** Default setting. */
206 IVIDEO_RATECONTROLPRESET_DEFAULT = IVIDEO_LOW_DELAY
207} IVIDEO_RateControlPreset;
208
209
210/**
211 * @brief Video frame skipping modes.
212 *
213 * @enumWarning
214 *
215 * @extendedEnum
216 */
217typedef enum {
218 IVIDEO_FRAME_ENCODED = 0, /**< Input video frame successfully encoded. */
219 IVIDEO_FRAME_SKIPPED = 1, /**< Input video frame dropped. There is no
220 * encoded bitstream corresponding to the
221 * input frame.
222 */
223
224 /** Default setting. */
225 IVIDEO_SKIPMODE_DEFAULT = IVIDEO_FRAME_ENCODED
226} IVIDEO_SkipMode;
227
228
229/**
230 * @brief Video output buffer status.
231 *
232 * @remarks Ownership of the buffers, either by application or algorithm,
233 * is conveyed via these values.
234 *
235 * @remarks This reflects the status of ALL output buffers. For example,
236 * if video decoded output is in 4:2:0 format, all the 3
237 * output buffers' status is described by this value.
238 * Similarly, for 4:2:2 formatted buffers, this value
239 * describes the single buffer's status.
240 *
241 * @enumWarning
242 *
243 * @extendedEnum
244 */
245typedef enum {
246 IVIDEO_FRAME_NOERROR = 0, /**< The output buffer is available.
247 */
248 IVIDEO_FRAME_NOTAVAILABLE = 1, /**< The codec doesn't have any output
249 * buffers.
250 */
251 IVIDEO_FRAME_ERROR = 2, /**< The output buffer is available and
252 * corrupted.
253 *
254 * @remarks For example, if a bitstream
255 * is erroneous and
256 * partially decoded, a
257 * portion of the decoded
258 * image may be available
259 * for display. Another
260 * example is if the
261 * bitstream for a given
262 * frame decode may be
263 * decoded without error,
264 * but the previously
265 * decoded dependant
266 * frames weren't
267 * successfully decoded.
268 * This would result in
269 * an incorrectly decoded
270 * frame.
271 */
272 IVIDEO_FRAME_OUTPUTSKIP = 3,/**< The video frame was skipped (i.e. not
273 * decoded).
274 */
275
276 /** Default setting. */
277 IVIDEO_OUTPUTFRAMESTATUS_DEFAULT = IVIDEO_FRAME_NOERROR
278} IVIDEO_OutputFrameStatus;
279
280/**
281 * @brief Video Picture types.
282 *
283 * @enumWarning
284 *
285 * @extendedEnum
286 */
287typedef enum {
288 IVIDEO_NA_PICTURE = -1, /**< Frame type not available. */
289 IVIDEO_I_PICTURE = 0, /**< Intra coded picture. */
290 IVIDEO_P_PICTURE = 1, /**< Forward inter coded picture. */
291 IVIDEO_B_PICTURE = 2, /**< Bi-directional inter coded picture. */
292 /** Default setting. */
293 IVIDEO_PICTURE_TYPE_DEFAULT = IVIDEO_I_PICTURE
294} IVIDEO_PictureType;
295
296
297/**
298 * @brief Video Format types.
299 *
300 * @enumWarning
301 *
302 * @extendedEnum
303 */
304typedef enum {
305 IVIDEO_MPEG1 = 1, /**< Video format is Mpeg1 stream */
306 IVIDEO_MPEG2SP = 2, /**< Video format is Mpeg2/H.262 stream, Simple Profile */
307 IVIDEO_MPEG2MP = 3, /**< Video format is Mpeg2/H.262 stream, Main Profile */
308 IVIDEO_MPEG2HP = 4, /**< Video format is Mpeg2/H.262 stream, High Profile */
309 IVIDEO_MPEG4SP = 5, /**< Video format is Mpeg4 stream, Simple Profile */
310 IVIDEO_MPEG4ASP = 6, /**< Video format is Mpeg4 stream, Advanced Simple Profile */
311 IVIDEO_H264BP = 7, /**< Video format is H.264 stream, Base Profile */
312 IVIDEO_H264MP = 8, /**< Video format is H.264 stream, Main Profile */
313 IVIDEO_H264HP = 9, /**< Video format is H.264 stream, High Profile */
314 IVIDEO_VC1SP = 10, /**< Video format is VC1/WMV9 stream, Simple Profile */
315 IVIDEO_VC1MP = 11, /**< Video format is VC1/WMV9 stream, Main Profile */
316 IVIDEO_VC1AP = 12, /**< Video format is VC1 stream, Advanced Profile */
317 IVIDEO_H264RCDO = 13, /**< Video format is H.264 stream, Fast profile/RCDO */
318 IVIDEO_RV8 = 14, /**< Video format is Real Video 8 stream */
319 IVIDEO_RV9 = 15, /**< Video format is Real Video 9 stream */
320 IVIDEO_RV10 = IVIDEO_RV9, /**< Video format is Real Video 10 stream, same as RV9 */
321 IVIDEO_ON2VP6 = 16, /**< Video format is ON2, VP6.x */
322 IVIDEO_ON2VP7 = 17, /**< Video format is ON2, VP7.x */
323 IVIDEO_AVS10 = 18, /**< Video format is AVS 1.0 */
324 IVIDEO_SORENSONSPARK = 19, /**< Video format is SorensonSpark V0/V1 */
325 IVIDEO_H263_PROFILE0 = 20, /**< Video format is H263 Base line profile */
326 IVIDEO_H263_PROFILE3 = 21, /**< Video format is H263 and Annex IJKT */
327 IVIDEO_H264SVC = 22, /**< Video format is SVC */
328 IVIDEO_MULTIVIEW = 23, /**< Video format is Multiview coding */
329 IVIDEO_MJPEG = 24 /**< Video format is motion JPEG */
330} IVIDEO_Format;
331
332
333/**
334 * @brief Buffer descriptor for video buffers.
335 */
336typedef struct IVIDEO_BufDesc {
337 XDAS_Int32 numBufs; /**< Number of buffers. */
338 XDAS_Int32 width; /**< Added width of a video frame. */
339 XDAS_Int8 *bufs[XDM_MAX_IO_BUFFERS]; /**< Pointer to vector
340 * containing buffer addresses.
341 */
342 XDAS_Int32 bufSizes[XDM_MAX_IO_BUFFERS]; /**< Size of each buffer
343 * in 8-bit bytes.
344 */
345} IVIDEO_BufDesc;
346
347/**
348 * @brief Buffer descriptor for input video buffers.
349 */
350typedef struct IVIDEO1_BufDescIn {
351 XDAS_Int32 numBufs; /**< Number of buffers in bufDesc[]. */
352 XDAS_Int32 frameWidth; /**< Width of the video frame. */
353 XDAS_Int32 frameHeight; /**< Height of the video frame. */
354 XDAS_Int32 framePitch; /**< Frame pitch used to store the frame.
355 *
356 * @remarks This field can also be used to
357 * indicate the padded width.
358 */
359 XDM1_SingleBufDesc bufDesc[XDM_MAX_IO_BUFFERS]; /**< Picture buffers. */
360} IVIDEO1_BufDescIn;
361
362
363/**
364 * @brief Max YUV buffers - one each for 'Y', 'U', and 'V'.
365 */
366#define IVIDEO_MAX_YUV_BUFFERS 3
367
368/**
369 * @brief Detailed buffer descriptor for video buffers.
370 */
371typedef struct IVIDEO1_BufDesc {
372 XDAS_Int32 numBufs; /**< Number of buffers in bufDesc[]. */
373 XDAS_Int32 frameWidth; /**< Width of the video frame. */
374 XDAS_Int32 frameHeight; /**< Height of the video frame. */
375 XDAS_Int32 framePitch; /**< Frame pitch used to store the frame.
376 *
377 * @remarks This field can also be used to
378 * indicate the padded width.
379 */
380 XDM1_SingleBufDesc bufDesc[IVIDEO_MAX_YUV_BUFFERS]; /**< Picture buffers. */
381 XDAS_Int32 extendedError; /**< @extendedErrorField */
382 XDAS_Int32 frameType; /**< @copydoc IVIDEO_FrameType
383 *
384 * @sa IVIDEO_FrameType
385 */
386 XDAS_Int32 topFieldFirstFlag;/**< Flag to indicate when the application
387 * should display the top field first.
388 *
389 * @remarks Valid values are XDAS_TRUE
390 * and XDAS_FALSE.
391 *
392 * @remarks This field is only applicable
393 * for interlaced content, not
394 * progressive.
395 *
396 * @remarks This field does not apply to
397 * encoder recon bufs.
398 */
399 XDAS_Int32 repeatFirstFieldFlag;/**< Flag to indicate when the first field
400 * should be repeated.
401 *
402 * @remarks Valid values are XDAS_TRUE
403 * and XDAS_FALSE.
404 *
405 * @remarks This field is only applicable
406 * for interlaced content, not
407 * progressive.
408 *
409 * @remarks This field does not apply to
410 * encoder recon bufs.
411 */
412 XDAS_Int32 frameStatus; /**< @copydoc IVIDEO_OutputFrameStatus
413 *
414 * @sa IVIDEO_OutputFrameStatus
415 *
416 * @remarks This field does not apply to
417 * encoder recon bufs.
418 */
419 XDAS_Int32 repeatFrame; /**< Number of times the display process
420 * needs to repeat the displayed progressive
421 * frame.
422 *
423 * @remarks This information is useful
424 * for progressive
425 * content when the
426 * decoder expects the
427 * display process to
428 * repeat the displayed
429 * frame for a certain
430 * number of times. This
431 * is useful for pulldown
432 * (frame/field
433 * repetition by display
434 * system) support
435 * where the display
436 * frame rate is
437 * increased without
438 * increasing the decode
439 * frame rate.
440 *
441 * @remarks The default value is 0.
442 *
443 * @remarks This field does not apply to
444 * encoder recon bufs.
445 */
446 XDAS_Int32 contentType; /**< Content type of the buffer.
447 *
448 * @remarks This is useful when the
449 * content is both
450 * interlaced and
451 * progressive. The
452 * display process can
453 * use this field to
454 * determine how to
455 * render the display
456 * buffer.
457 *
458 * @sa IVIDEO_ContentType
459 */
460 XDAS_Int32 chromaFormat; /**< @copydoc XDM_ChromaFormat
461 *
462 * @sa XDM_ChromaFormat
463 */
464} IVIDEO1_BufDesc;
465
466/**
467 * @brief Video buffer layout.
468 *
469 * @todo Do we need a default value for this enum?
470 *
471 * @enumWarning
472 *
473 * @extendedEnum
474 */
475typedef enum {
476 IVIDEO_FIELD_INTERLEAVED = 0, /**< Buffer layout is interleaved. */
477 IVIDEO_FIELD_SEPARATED = 1, /**< Buffer layout is field separated. */
478 IVIDEO_TOP_ONLY = 2, /**< Buffer contains only top field. */
479 IVIDEO_BOTTOM_ONLY = 3 /**< Buffer contains only bottom field. */
480} IVIDEO_VideoLayout;
481
482/**
483 * @brief Video coding mode of operation.
484 *
485 * @todo Do we need a default value for this enum?
486 *
487 * @todo Should "decode" and "encode" modes change to "process full frame"?
488 * For example, setting DECODE_ONLY for an encoder is wrong - can we
489 * make it impossible for codecs/apps to make this error?
490 *
491 * @enumWarning
492 *
493 * @extendedEnum
494 */
495typedef enum {
496 IVIDEO_DECODE_ONLY = 0, /**< Decoding mode. */
497 IVIDEO_ENCODE_ONLY = 1, /**< Encoding mode. */
498 IVIDEO_TRANSCODE_FRAMELEVEL = 2,/**< Transcode mode of operation
499 * (encode/decode) which consumes/generates
500 * transcode information at the frame level.
501 */
502 IVIDEO_TRANSCODE_MBLEVEL = 3, /**< Transcode mode of operation
503 * (encode/decode) which consumes/generates
504 * transcode information at the MB level.
505 */
506 IVIDEO_TRANSRATE_FRAMELEVEL = 4,/**< Transrate mode of operation for
507 * encoder which consumes transrate
508 * information at the frame level.
509 */
510 IVIDEO_TRANSRATE_MBLEVEL = 5 /**< Transrate mode of operation for
511 * encoder which consumes transrate
512 * information at the MB level.
513 */
514} IVIDEO_OperatingMode;
515
516/**
517 * @brief Video bit range
518 *
519 * @enumWarning
520 *
521 * @extendedEnum
522 *
523 * @todo Do we need a default value for this enum?
524 */
525typedef enum {
526 IVIDEO_YUVRANGE_FULL = 0, /**< Pixel range for YUV is 0-255. */
527 IVIDEO_YUVRANGE_ITU = 1 /**< Pixel range for YUV is as per ITU-T. */
528} IVIDEO_BitRange;
529
530/**
531 * @brief input/output data mode
532 *
533 * @enumWarning
534 *
535 * @extendedEnum
536 *
537 * @todo Do we need a default value for this enum?
538 *
539 * @todo Request from DM365 team to split IVIDEO_SLICEMODE into
540 * IVIDEO_SLICEMODE_BYTE and IVIDEO_SLICEMODE_NAL.
541 */
542typedef enum {
543 IVIDEO_FIXEDLENGTH = 0, /**< In terms of multiples of 2K */
544 IVIDEO_SLICEMODE = 1, /**< Slice mode */
545 IVIDEO_NUMROWS = 2, /**< Number of rows, each row is 16 lines of video */
546 IVIDEO_ENTIREFRAME = 3 /**< Processing of entire frame data */
547} IVIDEO_DataMode;
548
549
550/**
551 * @brief Configuration for providing/receiving packet error information
552 *
553 * @enumWarning
554 */
555typedef enum {
556 IVIDEO_ERRORINFO_OFF = 0, /**< Packet error information is
557 * unsupported.
558 */
559 IVIDEO_ERRORINFO_ON_INPUT = 1, /**< Packet error information is
560 * supported for input data.
561 */
562 IVIDEO_ERRORINFO_ON_OUTPUT = 2, /**< Packet error information is
563 * supported for output data.
564 */
565 IVIDEO_ERRORINFO_ON_BOTH = 3, /**< Packet error information is
566 * supported for both input and
567 * output data.
568 */
569 /** Default setting. */
570 IVIDEO_ERRORINFO_MODE_DEFAULT = IVIDEO_ERRORINFO_OFF
571
572} IVIDEO_ErrorInfoMode;
573
574/**
575 * @brief Max YUV buffers - one each for 'Y', 'U', and 'V'.
576 */
577#define IVIDEO_MAX_NUM_PLANES 3 /**< Luma followed by chroma. */
578#define IVIDEO_MAX_NUM_METADATA_PLANES 3 /**< MBINFO , packet error info and
579 * alpha planes.
580 *
581 * @sa IVIDEO_METADATAPLANE_MBINFO
582 * @sa IVIDEO_METADATAPLANE_EINFO
583 * @sa IVIDEO_METADATAPLANE_ALPHA
584 */
585
586/*
587 * @brief Metadata types
588 *
589 * @enumWarning
590 *
591 * @extendedEnum
592 */
593typedef enum {
594 IVIDEO_METADATAPLANE_NONE = -1, /**< Used to indicate no metadata
595 * is requested or available.
596 */
597 IVIDEO_METADATAPLANE_MBINFO = 0, /**< Offset into
598 * IVIDEO_MAX_NUM_METADATA_PLANES
599 * array for MB Info.
600 *
601 * @sa IVIDEO_MAX_NUM_METADATA_PLANES
602 */
603 IVIDEO_METADATAPLANE_EINFO = 1, /**< Offset into
604 * IVIDEO_MAX_NUM_METADATA_PLANES
605 * array for Error Info.
606 *
607 * @sa IVIDEO_MAX_NUM_METADATA_PLANES
608 */
609 IVIDEO_METADATAPLANE_ALPHA = 2 /**< Offset into
610 * IVIDEO_MAX_NUM_METADATA_PLANES
611 * array for Alpha Data.
612 *
613 * @sa IVIDEO_MAX_NUM_METADATA_PLANES
614 */
615
616} IVIDEO_MetadataType;
617
618/**
619 * @brief Detailed buffer descriptor for video buffers.
620 */
621typedef struct IVIDEO2_BufDesc {
622 XDAS_Int32 numPlanes; /**< Number of video planes.
623 *
624 * @remarks This must be in the range
625 * 0 - #IVIDEO_MAX_NUM_PLANES.
626 *
627 * @todo Need further description.
628 */
629 XDAS_Int32 numMetaPlanes; /**< Number of meta data planes.
630 *
631 * @remarks This must be in the range
632 * 0 - #IVIDEO_MAX_NUM_METADATA_PLANES.
633 *
634 * @todo Need further description.
635 */
636 XDAS_Int32 dataLayout; /**< Field interleaved, field separated.
637 *
638 * @todo Need further description.
639 * Is there an enum we should
640 * reference for valid values?
641 * Perhaps IVIDEO_VideoLayout?
642 */
643 XDM2_SingleBufDesc planeDesc[IVIDEO_MAX_NUM_PLANES]; /**< Picture buffers. */
644 XDM2_SingleBufDesc metadataPlaneDesc[IVIDEO_MAX_NUM_METADATA_PLANES]; /**< Meta planes.
645 *
646 * @remarks For MB Info & alpha blending
647 *
648 * @todo Need further description.
649 */
650 XDAS_Int32 secondFieldOffsetWidth[IVIDEO_MAX_NUM_PLANES]; /**< Offset
651 * for second field (width in pixels).
652 *
653 * @remarks Valid only if above pointer
654 * is not NULL.
655 *
656 * @todo Need further description.
657 * Which "above pointer"? Is
658 * this relavent to planeDesc
659 * or metadataPlaneDesc... or
660 * both? Is the "width in pixels"
661 * comment correct?
662 */
663 XDAS_Int32 secondFieldOffsetHeight[IVIDEO_MAX_NUM_PLANES]; /**< Offset
664 * for second field (height in lines).
665 *
666 * @remarks Valid only if above pointer
667 * is not NULL.
668 *
669 * @todo Need further description.
670 * Which "above pointer"? Is
671 * this relavent to planeDesc
672 * or metadataPlaneDesc... or
673 * both?
674 */
675 XDAS_Int32 imagePitch[IVIDEO_MAX_NUM_PLANES]; /**< Image pitch for
676 * each plane.
677 */
678 XDM_Rect imageRegion; /**< Image region (top left and bottom
679 * right).
680 */
681 XDM_Rect activeFrameRegion; /**< Active frame region (top left and
682 * bottom right).
683 */
684 XDAS_Int32 extendedError; /**< @extendedErrorField
685 *
686 * @remarks This field is not required
687 * for encoders.
688 */
689 XDAS_Int32 frameType; /**< @copydoc IVIDEO_FrameType
690 *
691 * @remarks This field is not required
692 * for encoder input buffer.
693 *
694 * @sa IVIDEO_FrameType
695 */
696 XDAS_Int32 topFieldFirstFlag;/**< Flag to indicate when the application
697 * should display the top field first.
698 *
699 * @remarks Valid values are XDAS_TRUE
700 * and XDAS_FALSE.
701 *
702 * @remarks This field is only app licable
703 * for interlaced content, not
704 * progressive.
705 *
706 * @remarks This field does not apply to
707 * encoder recon bufs.
708 */
709 XDAS_Int32 repeatFirstFieldFlag;/**< Flag to indicate when the first field
710 * should be repeated.
711 *
712 * @remarks Valid values are XDAS_TRUE
713 * and XDAS_FALSE.
714 *
715 * @remarks This field is only applicable
716 * for interlaced content, not
717 * progressive.
718 *
719 * @remarks This field does not apply to
720 * encoder recon bufs.
721 */ /* not required for encoder input buffer */
722 XDAS_Int32 frameStatus; /**< @copydoc IVIDEO_OutputFrameStatus
723 *
724 * @sa IVIDEO_OutputFrameStatus
725 *
726 * @remarks This field does not apply to
727 * encoder recon bufs.
728 */ /* not required for encoder input buffer */
729 XDAS_Int32 repeatFrame; /**< Number of times the display process
730 * needs to repeat the displayed progressive
731 * frame.
732 *
733 * @remarks This information is useful
734 * for progressive
735 * content when the
736 * decoder expects the
737 * display process to
738 * repeat the displayed
739 * frame for a certain
740 * number of times. This
741 * is useful for pulldown
742 * (frame/field
743 * repetition by display
744 * system) support
745 * where the display
746 * frame rate is
747 * increased without
748 * increasing the decode
749 * frame rate.
750 *
751 * @remarks The default value is 0.
752 *
753 * @remarks This field does not apply to
754 * encoder recon bufs.
755 */ /* not required for encoder input buffer */
756 XDAS_Int32 contentType; /**< Content type of the buffer.
757 *
758 * @remarks This is useful when the
759 * content is both
760 * interlaced and
761 * progressive. The
762 * display process can
763 * use this field to
764 * determine how to
765 * render the display
766 * buffer.
767 *
768 * @sa IVIDEO_ContentType
769 */
770 XDAS_Int32 chromaFormat; /**< @copydoc XDM_ChromaFormat
771 *
772 * @sa XDM_ColorFormat
773 */
774 XDAS_Int32 scalingWidth; /**< Scaled image width for post processing.
775 * @remarks This field is not required
776 * for encoders.
777 *
778 * @todo Is this in pixels?
779 *
780 * @todo Should this field and
781 * scalingHeight use a XDM_Rect
782 * data type?
783 */
784 XDAS_Int32 scalingHeight; /**< Scaled image width for post processing.
785 *
786 * @remarks This field is not required
787 * for encoders.
788 *
789 * @todo Is this in pixels?
790 */
791 XDAS_Int32 rangeMappingLuma;/**< Range Mapping Luma
792 *
793 * @todo Need further description.
794 *
795 * @todo We should explore what we did
796 * in the speech interfaces and
797 * perhaps create an ivideo_vc1.h
798 * with VC1-specific definitions.
799 */
800 XDAS_Int32 rangeMappingChroma;/**< Range Mapping Chroma
801 *
802 * @todo Need further description.
803 *
804 * @todo We should explore what we did
805 * in the speech interfaces and
806 * perhaps create an ivideo_vc1.h
807 * with VC1-specific definitions.
808 */
809 XDAS_Int32 enableRangeReductionFlag;/**< Flag indicating whether or not
810 * to enable range reduction.
811 *
812 * @remarks Valid values are XDAS_TRUE
813 * and XDAS_FALSE.
814 *
815 * @todo We should explore what we did
816 * in the speech interfaces and
817 * perhaps create an ivideo_vc1.h
818 * with VC1-specific definitions.
819 */
820} IVIDEO2_BufDesc;
821
822
823/*@}*/
824
825#ifdef __cplusplus
826}
827#endif
828
829#endif
diff --git a/packages/xdais/ti/xdais/dm/xdm.h b/packages/xdais/ti/xdais/dm/xdm.h
new file mode 100755
index 0000000..4466d3d
--- /dev/null
+++ b/packages/xdais/ti/xdais/dm/xdm.h
@@ -0,0 +1,1367 @@
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/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 */
45
46#ifndef ti_xdais_dm_XDM_
47#define ti_xdais_dm_XDM_
48
49#include <ti/xdais/ialg.h>
50#include <ti/xdais/xdas.h>
51
52#ifdef __cplusplus
53extern "C" {
54#endif
55
56/** @ingroup ti_xdais_dm_XDM */
57/*@{*/
58
59#define XDM_EOK IALG_EOK /**< Success. */
60#define XDM_EFAIL IALG_EFAIL /**< General failure. */
61#define XDM_EUNSUPPORTED -3 /**< Request is unsupported. */
62
63
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
75
76#define XDM_MAX_IO_BUFFERS 16 /**< Max I/O Buffers */
77
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 */
160typedef 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;
167
168
169/**
170 * @brief Single buffer descriptor.
171 */
172typedef 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;
176
177
178
179/**
180 * @brief Single buffer descriptor.
181 */
182typedef 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;
212
213
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 */
221typedef 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;
228
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 */
237typedef 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;
281
282
283/**
284 * @brief Buffer descriptor.
285 */
286typedef 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;
296
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 */
305typedef 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;
315
316
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 */
336typedef 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;
350
351
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)
363
364
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)
376
377
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)))
389
390
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)))
402
403
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))
414
415
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))
426
427
428/**
429 * @brief Buffer information descriptor for input and output buffers.
430 */
431typedef 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;
456
457
458/**
459 * @brief Buffer information descriptor for input and output buffers.
460 */
461typedef 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;
471
472
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
488
489
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
507
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 */
527typedef 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;
703
704
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 */
723typedef 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.
829
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;
854
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)
869
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))
884
885
886/**
887 * @brief Endianness of data
888 *
889 * @enumWarning
890 *
891 * @extendedEnum
892 */
893typedef 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;
902
903
904/**
905 * @brief Descriptor for a buffer to move.
906 */
907typedef struct XDM2_MoveBufDesc {
908 XDAS_Int32 id; /**< Id of the buffer to move */
909 XDM2_BufDesc bufDesc; /**< New buffer descriptor */
910} XDM2_MoveBufDesc;
911
912
913/**
914 * @brief Date and time
915 */
916typedef 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;
923
924
925/**
926 * @brief 2-dimensional point
927 */
928typedef struct XDM_Point {
929 XDAS_Int32 x;
930 XDAS_Int32 y;
931} XDM_Point;
932
933
934/**
935 * @brief Rectangle
936 */
937typedef struct XDM_Rect {
938 XDM_Point topLeft;
939 XDM_Point bottomRight;
940} XDM_Rect;
941
942/**
943 * @brief Maximum number of context buffers.
944 */
945#define XDM_MAX_CONTEXT_BUFFERS 32
946
947
948/**
949 * @brief Buffer information descriptor for input and output buffers.
950 */
951typedef 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;
965
966
967/**
968 * @brief Context used by split codecs.
969 */
970typedef 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 */
977
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 */
996
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;
1023
1024
1025/**
1026 * @brief Encoding presets.
1027 *
1028 * @enumWarning
1029 *
1030 * @extendedEnum
1031 */
1032typedef 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 */
1051
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;
1059
1060
1061/**
1062 * @brief Decode entire access unit or only header.
1063 *
1064 * @enumWarning
1065 *
1066 * @extendedEnum
1067 */
1068typedef 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;
1074
1075
1076/**
1077 * @brief Encode entire access unit or only header.
1078 *
1079 * @enumWarning
1080 *
1081 * @extendedEnum
1082 */
1083typedef 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;
1089
1090
1091/**
1092 * @brief Chroma formats.
1093 *
1094 * @enumWarning
1095 *
1096 * @extendedEnum
1097 */
1098typedef 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;
1118
1119
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;
1151
1152
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;
1179
1180
1181/**
1182 * @brief Descriptor for the chunk of data being
1183 * transferred in one call to putData or getData
1184 */
1185typedef 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;
1248
1249
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 */
1258typedef Void * XDM_DataSyncHandle;
1259
1260
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 */
1277typedef Void (*XDM_DataSyncPutFxn)(XDM_DataSyncHandle dataSyncHandle,
1278 XDM_DataSyncDesc *dataSyncDesc);
1279
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 */
1302typedef XDAS_Int32 (*XDM_DataSyncGetFxn)(XDM_DataSyncHandle dataSyncHandle,
1303 XDM_DataSyncDesc *dataSyncDesc);
1304
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 */
1338typedef XDAS_Int32 (*XDM_DataSyncGetBufferFxn)(XDM_DataSyncHandle dataSyncHandle,
1339 XDM_DataSyncDesc *dataSyncDesc);
1340
1341
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 */
1357typedef XDAS_Int32 (*XDM_DataSyncPutBufferFxn)(XDM_DataSyncHandle dataSyncHandle,
1358 XDM_DataSyncDesc *dataSyncDesc);
1359
1360/*@}*/
1361
1362
1363#ifdef __cplusplus
1364}
1365#endif
1366
1367#endif /* ti_xdais_dm_XDM_ */
diff --git a/packages/xdais/ti/xdais/ialg.h b/packages/xdais/ti/xdais/ialg.h
new file mode 100755
index 0000000..05aa26f
--- /dev/null
+++ b/packages/xdais/ti/xdais/ialg.h
@@ -0,0 +1,762 @@
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/ialg.h
36 *
37 * @brief This header defines all types, constants, and functions
38 * defined by XDAIS for algorithms.
39 */
40/**
41 * @defgroup ti_xdais_IALG IALG - XDAIS Algorithm Interface
42 *
43 * This is the XDAIS IALG interface.
44 */
45
46#ifndef ti_xdais_IALG_
47#define ti_xdais_IALG_
48
49#ifdef __cplusplus
50extern "C" {
51#endif
52
53/** @ingroup ti_xdais_IALG */
54/*@{*/
55
56/*---------------------------*/
57/* TYPES AND CONSTANTS */
58/*---------------------------*/
59
60#define IALG_DEFMEMRECS 4 /**< Default number of memory records. */
61#define IALG_OBJMEMREC 0 /**< Memory record index of instance object. */
62#define IALG_SYSCMD 256 /**< Minimum "system" IALG_Cmd value. */
63
64#define IALG_EOK 0 /**< Successful return status code. */
65#define IALG_EFAIL (-1) /**< Unspecified error return status code. */
66
67#define IALG_CUSTOMFAILBASE (-2048)/**< Algorithm-specific failure code end.
68 *
69 * @remarks This is 0xfffff800.
70 */
71#define IALG_CUSTOMFAILEND (-256) /**< Algorithm-specific failure code base.
72 *
73 * @remarks This is 0xffffff00.
74 */
75
76/**
77 * @brief Memory attributes.
78 */
79typedef enum IALG_MemAttrs {
80 IALG_SCRATCH, /**< Scratch memory. */
81 IALG_PERSIST, /**< Persistent memory. */
82 IALG_WRITEONCE /**< Write-once persistent memory. */
83} IALG_MemAttrs;
84
85#define IALG_MPROG 0x0008 /**< Program memory space bit. */
86#define IALG_MXTRN 0x0010 /**< External memory space bit. */
87
88/**
89 * @brief Defined memory spaces.
90 */
91/*
92 * ======== IALG_MemSpace ========
93 */
94typedef enum IALG_MemSpace {
95 IALG_EPROG = /**< External program memory */
96 IALG_MPROG | IALG_MXTRN,
97
98 IALG_IPROG = /**< Internal program memory */
99 IALG_MPROG,
100
101 IALG_ESDATA = /**< Off-chip data memory (accessed sequentially) */
102 IALG_MXTRN + 0,
103
104 IALG_EXTERNAL = /**< Off-chip data memory (accessed randomly) */
105 IALG_MXTRN + 1,
106
107 IALG_DARAM0 = 0, /**< Dual access on-chip data memory */
108 IALG_DARAM1 = 1, /**< Block 1, if independant blocks required */
109
110 IALG_SARAM = 2, /**< Single access on-chip data memory */
111 IALG_SARAM0 = 2, /**< Block 0, equivalent to IALG_SARAM */
112 IALG_SARAM1 = 3, /**< Block 1, if independant blocks required */
113
114 IALG_DARAM2 = 4, /**< Block 2, if a 3rd independent block required */
115 IALG_SARAM2 = 5 /**< Block 2, if a 3rd independent block required */
116} IALG_MemSpace;
117
118/*
119 * ======== IALG_isProg ========
120 */
121#define IALG_isProg(s) ( \
122 (((int)(s)) & IALG_MPROG) \
123)
124
125/*
126 * ======== IALG_isOffChip ========
127 */
128#define IALG_isOffChip(s) ( \
129 (((int)(s)) & IALG_MXTRN) \
130)
131
132
133/**
134 * @brief Memory records.
135 */
136typedef struct IALG_MemRec {
137 Uns size; /**< Size in MAU of allocation */
138 Int alignment; /**< Alignment requirement (MAU) */
139 IALG_MemSpace space; /**< Allocation space */
140 IALG_MemAttrs attrs; /**< Memory attributes */
141 Void *base; /**< Base address of allocated buf */
142} IALG_MemRec;
143
144
145/**
146 * @brief Algorithm instance object definition.
147 *
148 * @remarks All XDAIS algorithm instance objects <b>must</b> have this
149 * structure as their first element. However, they do not
150 * need to initialize it; initialization of this sub-structure
151 * is done by the "framework".
152 */
153typedef struct IALG_Obj {
154 struct IALG_Fxns *fxns; /**< Pointer to IALG function table. */
155} IALG_Obj;
156
157
158/**
159 * @brief Handle to an algorithm instance object.
160 */
161typedef struct IALG_Obj *IALG_Handle;
162
163
164/**
165 * @brief Algorithm instance creation parameters.
166 *
167 * @remarks All XDAS algorithm parameter structures <b>must</b> have this
168 * as their first element.
169 */
170typedef struct IALG_Params {
171 Int size; /**< Number of MAU in the structure */
172} IALG_Params;
173
174
175/**
176 * @brief Pointer to algorithm specific status structure.
177 *
178 * @remarks All XDAIS algorithm parameter structures <b>must</b> have this
179 * as their first element.
180 */
181typedef struct IALG_Status {
182 Int size; /**< Number of MAU in the structure */
183} IALG_Status;
184
185
186/**
187 * @brief Algorithm specific command.
188 *
189 * @remarks This command is used in conjunction with IALG_Status to get
190 * and set algorithm specific attributes via the algControl()
191 * method.
192 */
193typedef unsigned int IALG_Cmd;
194
195
196/**
197 * @brief Defines the fields and methods that must be supplied by all
198 * XDAIS algorithms.
199 */
200/*
201 * algAlloc() - apps call this to query the algorithm about
202 * its memory requirements. Must be non-NULL.
203 * algControl() - algorithm specific control operations. May be
204 * NULL; NULL => no operations supported.
205 * algDeactivate() - notification that current instance is about to
206 * be "deactivated". May be NULL; NULL => do nothing.
207 * algFree() - query algorithm for memory to free when removing
208 * an instance. Must be non-NULL.
209 * algInit() - apps call this to allow the algorithm to
210 * initialize memory requested via algAlloc(). Must
211 * be non-NULL.
212 * algMoved() - apps call this whenever an algorithms object or
213 * any pointer parameters are moved in real-time.
214 * May be NULL; NULL => object can not be moved.
215 * algNumAlloc() - query algorithm for number of memory requests.
216 * May be NULL; NULL => number of mem recs is less
217 * then #IALG_DEFMEMRECS.
218 */
219typedef struct IALG_Fxns {
220/**
221 * @brief Unique pointer that identifies the module
222 * implementing this interface.
223 */
224 Void *implementationId;
225
226/**
227 * @brief Notification to the algorithm that its memory
228 * is "active" and algorithm processing methods
229 * may be called.
230 *
231 * @param[in] handle Handle to an algorithm instance.
232 *
233 * @remarks algActivate() initializes any of the instance's scratch
234 * buffers using the persistent memory that is part of the
235 * algorithm's instance object.
236 *
237 * @remarks The implementation of algActivate() (and algDeactivate())
238 * is <b>required</b> if the algorithm requests memory of
239 * type #IALG_SCRATCH.
240 *
241 * @remarks The algActivate() method should only be implemented if
242 * a module wants to factor out initialization code that
243 * can be executed once prior to processing multiple
244 * consecutive frames of data.
245 *
246 * @remarks If a module does not implement this method, the algActivate()
247 * field in the module's static function table (of type
248 * IALG_Fxns) must be set to @c NULL. This is equivalent to
249 * the following implementation:
250 * @code
251 * Void algActivate(IALG_Handle handle)
252 * {
253 * }
254 * @endcode
255 *
256 * @pre algActivate() can only be called after a successful return
257 * from algInit().
258 *
259 * @pre @c handle must be a valid handle for the algorithm's
260 * instance object.
261 *
262 * @pre No other algorithm method is currently being run on this
263 * instance. This method never preempts any other method on
264 * the same instance.
265 *
266 * @pre If the algorithm has implemented the IDMA2 interface,
267 * algActivate() can only be called after a successful return
268 * from dmaInit().
269 *
270 * @post All methods related to the algorithm may now be executed
271 * by client (subject to algorithm specific restrictions).
272 *
273 * @sa algDeactivate().
274 */
275 Void (*algActivate)(IALG_Handle handle);
276
277/**
278 * @brief Apps call this to query the algorithm about
279 * its memory requirements. Must be non-NULL.
280 *
281 * @param[in] params Algorithm specific attributes.
282 * @param[out] parentFxns Parent algorithm functions.
283 * @param[out] memTab array of memory records.
284 *
285 * @remarks algAlloc() returns a table of memory records that
286 * describe the size, alignment, type and memory space of
287 * all buffers required by an algorithm (including the
288 * algorithm's instance object itself). If successful,
289 * this function returns a positive non-zero value
290 * indicating the number of records initialized. This
291 * function can never initialize more memory records than
292 * the number returned by algNumAlloc().
293 *
294 * @remarks If algNumAlloc() is not implemented, the maximum number
295 * of initialized memory records is #IALG_DEFMEMRECS.
296 *
297 * @remarks The first argument to algAlloc() is a pointer to the creation
298 * parameters for the instance of the algorithm object to be
299 * created. This pointer is algorithm-specific; i.e., it points
300 * to a structure that is defined by each particular algorithm.
301 * This pointer may be @c NULL; however, in this case, algAlloc()
302 * must assume default creation parameters and must not fail.
303 *
304 * @remarks The second argument to algAlloc() is an optional parameter.
305 * algAlloc() may return a pointer to its parent's IALG functions.
306 * If this output value is assigned a non-NULL value, the client
307 * must create the parent instance object using the designated
308 * IALG functions pointer. The parent instance object must then
309 * be passed to algInit().
310 *
311 * @remarks algAlloc() may be called at any time and it must be idempotent;
312 * i.e., it can be called repeatedly without any side effects,
313 * and always returns the same result.
314 *
315 * @remarks Algorithms are encouraged to return (and document!) clear,
316 * algorithm-specific error codes from algAlloc(). Create-time
317 * failures are a common integration issue, and the clearer a
318 * return value, the sooner the algorithm integrator can identify
319 * and resolve the issue.
320 *
321 * @pre The number of memory records in the array @c memTab[] is no
322 * less than the number returned by algNumAlloc().
323 *
324 * @pre @c *parentFxns is a valid pointer to an IALG_Fxns pointer
325 * variable.
326 *
327 * @post If the algorithm needs a parent object to be created, the
328 * pointer @c *parentFxns is set to a non-NULL value that points
329 * to a valid IALG_Fxns structure, the parent's IALG
330 * implementation. Otherwise, this pointer is not set. algAlloc()
331 * may elect to ignore the @c parentFxns pointer altogether.
332 *
333 * @post For each memory descriptor in memTab with an #IALG_WRITEONCE
334 * attribute, the algorithm has either set the base field to a
335 * non-NULL value, which is the address of a statically
336 * allocated and initialized memory buffer of the indicated
337 * 'size', or has set the base field to @c NULL, thereby
338 * requiring the memory for the buffer to be provided by the
339 * client.
340 *
341 * @post Exactly @c n elements of the @c memTab[] array are initialized,
342 * where @c n is the return value from this operation.
343 *
344 * @post For each memory descriptor in @c memTab with an #IALG_PERSIST or
345 * #IALG_SCRATCH attribute, the algorithm does not set its base
346 * field.
347 *
348 * @post @c memTab[0] defines the memory required for the instance's
349 * object and this object's first field is an IALG_Obj structure.
350 *
351 * @post @c memTab[0] is requested as persistent memory.
352 *
353 * @sa algFree()
354 */
355 Int (*algAlloc)(const IALG_Params *params,
356 struct IALG_Fxns **parentFxns, IALG_MemRec *memTab);
357
358/**
359 * @brief Algorithm specific control and status.
360 *
361 * @param[in] handle Algorithm instance handle.
362 * @param[in] cmd Algorithm specific command.
363 * @param[out] status Algorithm specific status.
364 *
365 * @remarks algControl() sends an algorithm specific command, @c cmd, and
366 * an input/output status buffer pointer to an algorithm's
367 * instance object.
368 *
369 * @remarks In preemptive execution environments, algControl() may preempt
370 * a module's other metods (for example, its processing methods).
371 *
372 * @remarks The implementation of algControl() is optional. If a module
373 * does not implement this method, the algControl() field in
374 * the module's static function table (of type IALG_Fxns) must
375 * be set to @c NULL. This is equivalent to the following
376 * implementation:
377 * @code
378 * Void algControl(IALG_Handle handle, IALG_Cmd cmd, IALG_Status *status)
379 * {
380 * return (IALG_EFAIL);
381 * }
382 * @endcode
383 *
384 * @pre algControl() can only be called after a successful return
385 * from algInit().
386 *
387 * @pre @c handle must be a valid handle for the algorithm's instance
388 * object.
389 *
390 * @pre Algorithm specific @c cmd values are always less than
391 * #IALG_SYSCMD.
392 *
393 * @post If the @c cmd value is not recognized by the algorithm, the
394 * return value is not equal to IALG_EOK.
395 *
396 * @sa algInit()
397 */
398 Int (*algControl)(IALG_Handle handle, IALG_Cmd cmd,
399 IALG_Status *status);
400
401/**
402 * @brief Save all persistent data to non-scratch memory.
403 *
404 * @param[in] handle Algorithm instance handle.
405 *
406 * @remarks algDeactivate() saves any persistent information to non-scratch
407 * buffers using the persistent memory that is part of the
408 * algorithm's instance object.
409 *
410 * @remarks @c handle is used by the algorithm to identify the various
411 * buffers that must be saved prior to the next cycle of
412 * algActivate() and processing.
413 *
414 * @remarks The implementation of algDeactivate() (and algActivate())
415 * is <b>required</b> if the algorithm requests memory of
416 * type #IALG_SCRATCH.
417 *
418 * @remarks The algDeactivate() method is only implemented if a
419 * module wants to factor out initialization code that
420 * can be executed once prior to processing multiple
421 * consecutive frames of data.
422 *
423 * @remarks If a module does not implement this method, the
424 * algDeactivate() field in the module's static function table
425 * (of type IALG_Fxns) must be set to @c NULL. This is
426 * equivalent to the following implementation:
427 * @code
428 * Void algDeactivate(IALG_Handle handle)
429 * {
430 * }
431 * @endcode
432 *
433 * @pre algDeactivate() can only be called after a successful return
434 * from algInit().
435 *
436 * @pre The instance object is currently "active"; i.e., all instance
437 * memory is active and if an algActivate() method is defined,
438 * it has been called.
439 *
440 * @pre @c handle must be a valid handle for the algorithm's instance
441 * object.
442 *
443 * @pre No other algorithm method is currently being run on this
444 * instance. This method never preempts any other method on the
445 * same instance.
446 *
447 * @post No methods related to the algorithm may now be executed by
448 * the client; only algActivate() or algFree() may be called.
449 *
450 * @post All instance scratch memory may be safely overwritten.
451 *
452 * @sa algActivate()
453 */
454 Void (*algDeactivate)(IALG_Handle handle);
455
456/**
457 * @brief Apps call this to allow the algorithm to initialize memory
458 * requested via algAlloc(). Must be non-NULL.
459 *
460 * @param[in] handle Algorithm instance handle.
461 * @param[out] memTab Output array of memory records.
462 *
463 * @remarks algFree() returns a table of memory records that describe
464 * the base address, size, alignment, type and memory space
465 * of all buffers previously allocated for the algorithm's
466 * instance (including the algorithm's instance object itself)
467 * specified by @c handle. This function always returns a
468 * positive non-zero value indicating the number of records
469 * initialized. This function can never initialize more memory
470 * records than the value returned by algNumAlloc().
471 *
472 * @pre The @c memTab[] array contains at least algNumAlloc() records.
473 *
474 * @pre @c handle must be a valid handle for the algorithm's instance
475 * object.
476 *
477 * @pre If the prior call to algAlloc() returned a non-NULL parent
478 * functions pointer, then the parent instance must be an active
479 * instance object created via that function pointer.
480 *
481 * @pre No other agorithm method is currently being run on this
482 * instance. This method never preempts any other method on the
483 * same instance.
484 *
485 * @post @c memTab[] contains pointers to all of the memory passed to
486 * the algorithm via algInit().
487 *
488 * @post The size and alignment fields contain the same values passed
489 * to the client via algAlloc(); i.e., if the client makes changes
490 * to the values returned via algAlloc() and passes these new
491 * values to algInit(), the algorithm is not responsible for
492 * retaining any such changes.
493 *
494 * @sa algAlloc()
495 */
496 Int (*algFree)(IALG_Handle handle, IALG_MemRec *memTab);
497
498/**
499 * @brief Initialize an algorithm's instance object. Must be non-NULL.
500 *
501 * @param[in] handle Algorithm instance handle. This is a pointer
502 * to an initialized IALG_Obj structure. Its
503 * value is identical to the
504 * <tt>memTab[0].base</tt>.
505 * @param[in] memTab Array of allocated buffers.
506 * @param[in] parent Handle of algorithm's parent instance.
507 * @param[in] params Pointer to algorithm's instance parameters.
508 *
509 * @remarks algInit() performs all initialization necessary to complete the
510 * run-time creation of an algorithm's instance object. After a
511 * successful return from algInit(), the algorithm's instance
512 * object is ready to be used to process data.
513 *
514 * @remarks @c handle is a pointer to an initialized IALG_Obj structure.
515 * Its value is identical to the <tt>memTab[0].base</tt>.
516 *
517 * @remarks @c memTab is a table of memory records that describe the
518 * base address, size, alignment, type, and memory space
519 * of all buffers allocated for an algorithm instance
520 * (including the algorithm's instance object itself). The
521 * number of initialized records is identical to the
522 * number returned by a prior call to algAlloc().
523 *
524 * @remarks @c parent is a handle to another algorithm instance object.
525 * This parameter is often NULL; indicating that no
526 * parent object exists. This parameter allows clients
527 * to create a shared algorithm instance object and pass
528 * it to other algorithm instances. For example, a
529 * parent instance object might contain global read-only
530 * tables that are used by several instances of a
531 * vocoder.
532 *
533 * @remarks @c params is a pointer to algorithm-specific parameters that
534 * are necessary for the creation and initialization of
535 * the instance object. This pointer points to the same
536 * parameters passed to the algAlloc() operation.
537 * However, this pointer may be NULL. In this case,
538 * algInit(), must assume default creation parameters.
539 *
540 * @remarks Algorithms are encouraged to return (and document!) clear,
541 * algorithm-specific error codes from algInit(). Create-time
542 * failures are a common integration issue, and the clearer a
543 * return value, the sooner the algorithm integrator can identify
544 * and resolve the issue.
545 *
546 * @remarks The algorithm <b>must not</b> access any scratch resources,
547 * memory or otherwise, until it has been activated (see
548 * algActivate()). A common error is to initialize
549 * scratch resources during algInit(). This is an error
550 * as <i>another</i> algorithm, or instance of the same
551 * algorithm, may be active when this instance's
552 * algInit() is called. This algorithm must not access
553 * scratch resources until it is active.
554 *
555 * @remarks The client is not required to satisfy the IALG_MemSpace
556 * attribute of the requested memory. Note however that
557 * C6000 algorithms that use DMA may strictly require the
558 * client to satisfy its on-chip memory requirements and
559 * may not function correctly otherwise.
560 *
561 * @remarks The client may allocate the requested #IALG_WRITEONCE
562 * buffers once (or never, if the algorithm has assigned
563 * a base address in the prior call to algAlloc) and use
564 * the same buffers to initialize multiple instances of
565 * the same algorithm that are created with identical
566 * parameters.
567 *
568 * @par Example:
569 *
570 * @code
571 * typedef struct EncoderObj {
572 * IALG_Obj ialgObj;
573 * int workBuf;
574 * Int workBufLen;
575 * ... ;
576 * } EncoderObj;
577 *
578 * Int algInit(IALG_Handle handle, IALG_MemRec memTab[],
579 * IALG_Handle parent, IALG_Params *params)
580 * {
581 * EncoderObj *inst = (EncoderObj *)handle;
582 * EncoderParams *encParams = (EncoderParams *)params;
583 *
584 * if (encParams == NULL) {
585 * encParams = MYDEFAULTPARAMS;
586 * }
587 *
588 * if (IALG_isOffChip(memTab[1].space)) {
589 * // unsupported off-chip memory, return documented error code
590 * return (MYMOD_MYVENDOR_EUNSUPPORTEDOFFCHIPWORKBUF);
591 * }
592 *
593 * inst->workBuf = memTab[1].base;
594 * inst->workBufLen = encParams->frameDuration * 8;
595 * ...
596 *
597 * return (IALG_EOK);
598 * }
599 * @endcode
600 *
601 * @pre @c memTab contains pointers to non-overlapping buffers with
602 * the size and alignment requested via a prior call to
603 * algAlloc(). In addition, the algorithm parameters,
604 * params, passed to algAlloc() are identical to those
605 * passed to this operation.
606 *
607 * @pre @c handle must be a valid handle for the algorithm's
608 * instance object; i.e., <tt>handle == memTab[0].base</tt> and
609 * @c handle->fxns is initialized to point to the
610 * appropriate IALG_Fxns structure.
611 *
612 * @pre The prior call to algAlloc() using same creation params must
613 * have returned value > 1. This pre-condition ensures that any
614 * create-time parameter validation can be done once (in
615 * algAlloc()), and is not required to be done in algInit().
616 * Note that algInit() can, and should, validate any algorithm-
617 * specific requirements on resources received (e.g. internal
618 * memory, etc).
619 *
620 * @pre If the prior call to algAlloc() has not assigned a non-NULL
621 * base address to an #IALG_WRITEONCE @c memTab entry,
622 * the client must provide the memory resource with the
623 * requested size and alignment.
624 *
625 * @pre If the prior call to algAlloc() returned a non-NULL parent
626 * functions pointer, then the parent handle, @c parent,
627 * must be a valid handle to an instance object created
628 * via that function pointer.
629 *
630 * @pre No other algorithm method is currently being run on this
631 * instance. This method never preempts any other method
632 * on the same instance.
633 *
634 * @pre If @c parent is non-NULL, no other method is currently being
635 * run on the parent instance; i.e., this method never
636 * preempts any other method on the parent instance.
637 *
638 * @pre If the prior call to algAlloc() assigned a non-NULL base
639 * address to an #IALG_WRITEONCE @c memTab[] entry, the
640 * client may pass back the same address in the base
641 * field without allocating additional memory for that
642 * persistent write-once buffer. Alternatively, the
643 * client may treat #IALG_WRITEONCE buffers in the same
644 * way as #IALG_PERSIST buffers; by allocating new memory
645 * and granting it to the algorithm using the base field.
646 *
647 * @pre The buffer pointed to in @c memTab[0] is initialized
648 * with a pointer to the appropriate IALG_Fxns structure
649 * followed by all 0s.
650 *
651 * @post With the exception of any initialization performed
652 * by algActivate() and any optional auxilary interface
653 * initialization functions (such as IRES and IDMA3),
654 * all of the instance's persistent and write-once memory is
655 * initialized and the object is ready to be used.
656 *
657 * @post All subsequent memory accesses to the #IALG_WRITEONCE
658 * buffers by this algorithm instance will be read-only.
659 *
660 * @post If the algorithm has implemented the IDMA2 interface,
661 * the dmaGetChannels() operation can be called.
662 *
663 * @retval #IALG_EOK @copydoc IALG_EOK
664 * @retval #IALG_EFAIL @copydoc IALG_EFAIL
665 * @retval "Custom error" Algorithm-specific error - see
666 * algorithm's documentation.
667 *
668 * @sa algAlloc()
669 * @sa algMoved()
670 */
671 Int (*algInit)(IALG_Handle handle, const IALG_MemRec *memTab,
672 IALG_Handle parent, const IALG_Params *params);
673
674/**
675 * @brief Notify algorithm instance that instance memory has been
676 * relocated.
677 *
678 * @param[in] handle Algorithm instance handle.
679 * @param[in] memTab Array of allocated buffers.
680 * @param[in] parent Handle of algorithm's parent instance.
681 * @param[in] params Pointer to algorithm's instance parameters.
682 *
683 * @remarks algMoved() performs any reinitialization necessary to insure
684 * that, if an algorithm's instance object has been moved by the
685 * client, all internal data references are recomputed.
686 *
687 * @remarks The implementation of algMoved() is optional. However, it is
688 * highly recommended that this method be implemented. If a
689 * module does not implement this method, the algMoved() field
690 * in the module's static function table (of type IALG_Fxns) must
691 * be set to @c NULL. This is equivalent to asserting that the
692 * algorithm's instance objects cannot be moved.
693 */
694 Void (*algMoved)(IALG_Handle handle, const IALG_MemRec *memTab,
695 IALG_Handle parent, const IALG_Params *params);
696
697/**
698 * @brief Number of memory allocation requests required.
699 *
700 * @remarks algNumAlloc() returns the maximum number of memory allocation
701 * requests that the algAlloc() method requires. This operation
702 * allows clients to allocate sufficient space to call the
703 * algAlloc() method or fail because insufficient space exists
704 * to support the creation of the algorithm's instance object.
705 * algNumAlloc() may be called at any time, and it must be
706 * idempotent; i.e., it can be called repeatedly without any
707 * side effects, and always returns the same result.
708 *
709 * @remarks algNumAlloc() is optional; if it is not implemented, the
710 * maximum number of memory records for algAlloc() is assumed
711 * to be #IALG_DEFMEMRECS. This is equivalent to the following
712 * implementation:
713 * @code
714 * Void algNumAlloc(Void)
715 * {
716 * return (IALG_DEFNUMRECS);
717 * }
718 * @endcode
719 *
720 * @remarks If a module does not implement this method, the algNumAlloc()
721 * field in the module's static function table (of type IALG_Fxns)
722 * must be set to @c NULL.
723 *
724 * @post The return value from algNumAlloc() is always greater than
725 * or equal to one and always equals or exceeds the value
726 * returned by algAlloc().
727 *
728 * @par Example:
729 *
730 * @code
731 * #define NUMBUF 3
732 * extern IALG_Fxns *subAlg;
733 *
734 * Int algNumAlloc(Void)
735 * {
736 * return (NUMBUF + subAlg->algNumAlloc());
737 * }
738 *
739 * Int algAlloc(const IALG_Params *p, struct IALG_Fxns **pFxns,
740 * IALG_MemRec memTab)
741 * {
742 * Int n;
743 *
744 * ...
745 *
746 * n = subAlg->algAlloc(0, memTab);
747 * return (n + NUMBUF);
748 * }
749 * @endcode
750 *
751 * @sa algAlloc()
752 */
753 Int (*algNumAlloc)(Void);
754} IALG_Fxns;
755
756/*@}*/
757
758#ifdef __cplusplus
759}
760#endif
761
762#endif /* ti_xdais_IALG_ */
diff --git a/packages/xdais/ti/xdais/xdas.h b/packages/xdais/ti/xdais/xdas.h
new file mode 100755
index 0000000..caa8583
--- /dev/null
+++ b/packages/xdais/ti/xdais/xdas.h
@@ -0,0 +1,79 @@
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 * @file ti/xdais/xdas.h
35 *
36 * @brief This header defines all types and constants used in the
37 * XDAS interfaces.
38 *
39 * @remarks The types are mapped to the types defined in std.h.
40 */
41/**
42 * @addtogroup ti_xdais_XDAS XDAIS Types and Constants
43 */
44
45#ifndef ti_xdais_XDAS_
46#define ti_xdais_XDAS_
47
48#ifdef __cplusplus
49extern "C" {
50#endif
51
52/** @ingroup ti_xdais_XDAS_ */
53/*@{*/
54
55
56#define XDAS_TRUE 1
57#define XDAS_FALSE 0
58
59
60typedef Void XDAS_Void;
61typedef Uint8 XDAS_Bool;
62
63
64typedef Int8 XDAS_Int8; /**< Actual size chip dependent. */
65typedef Uint8 XDAS_UInt8; /**< Actual size chip dependent. */
66typedef Int16 XDAS_Int16; /**< Actual size of type is 16 bits. */
67typedef Uint16 XDAS_UInt16; /**< Actual size of type is 16 bits. */
68typedef Int32 XDAS_Int32; /**< Actual size of type is 32 bits. */
69typedef Uint32 XDAS_UInt32; /**< Actual size of type is 32 bits. */
70
71
72/*@}*/
73
74
75#ifdef __cplusplus
76}
77#endif
78
79#endif /* ti_xdais_XDAS_ */
diff --git a/packages/xdctools/google/targets/arm/std.h b/packages/xdctools/google/targets/arm/std.h
new file mode 100644
index 0000000..aa1b5c1
--- /dev/null
+++ b/packages/xdctools/google/targets/arm/std.h
@@ -0,0 +1,42 @@
1/*
2 * Copyright (c) 2011 Texas Instruments and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Texas Instruments - initial implementation
10 *
11 *
12 */
13
14/*
15 * ======== google/targets/arm/std.h ========
16 * Standard types for supported Google Bionic Arm compilers
17 */
18
19#ifndef google_targets_arm_STD_
20#define google_targets_arm_STD_
21
22/* Define target-specific "portable" macros
23 *
24 * The build command-line define xdc_target_name__ to be the value
25 * of the target's name config parameter. We use this to include the
26 * target-specific definitions for the required target-independent
27 * xdc_target* macros.
28 */
29#ifdef xdc_target_name__
30#include xdc__local_include(xdc_target_name__)
31#endif
32
33/* "inherit" (i.e., include) all google.targets standard types */
34#include <google/targets/std.h>
35
36#endif /* google_targets_arm_STD_ */
37
38/*
39 * @(#) google.targets.arm; 1, 0, 0,111; 6-24-2013 15:21:49; /db/ztree/library/trees/xdctargets/xdctargets-g31x/src/ xlibrary
40
41 */
42
diff --git a/packages/xdctools/google/targets/std.h b/packages/xdctools/google/targets/std.h
new file mode 100644
index 0000000..5312e79
--- /dev/null
+++ b/packages/xdctools/google/targets/std.h
@@ -0,0 +1,78 @@
1/*
2 * Copyright (c) 2011 Texas Instruments and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Texas Instruments - initial implementation
10 *
11 *
12 */
13/*
14 * ======== google/targets/std.h ========
15 *
16 */
17
18#ifndef google_targets_STD_
19#define google_targets_STD_
20
21/* include target-specific "portable" macros */
22#if defined(xdc_target_name__) & !defined(xdc_target_macros_include__)
23#include xdc__local_include(xdc_target_name__)
24#endif
25
26/*
27 * xdc__LONGLONG__ indicates if compiler supports 'long long' type
28 * xdc__BITS<n> __ indicates if compiler supports 'uint<n>_t' type
29 */
30#define xdc__LONGLONG__
31#define xdc__BITS8__
32#define xdc__BITS16__
33#define xdc__BITS32__
34#define xdc__BITS64__
35#define xdc__INT64__
36
37/*
38 * ======== [U]Int<n> ========
39 */
40typedef signed char xdc_Int8;
41typedef unsigned char xdc_UInt8;
42typedef short xdc_Int16;
43typedef unsigned short xdc_UInt16;
44typedef long xdc_Int32;
45typedef unsigned long xdc_UInt32;
46
47__extension__ typedef long long xdc_Int64;
48__extension__ typedef unsigned long long xdc_UInt64;
49
50/*
51 * ======== Bits<n> ========
52 */
53typedef unsigned char xdc_Bits8;
54typedef unsigned short xdc_Bits16;
55typedef unsigned long xdc_Bits32;
56__extension__ typedef unsigned long long xdc_Bits64;
57
58/*
59 * ======== [IU]Arg ========
60 */
61typedef long xdc_IArg;
62typedef unsigned long xdc_UArg;
63
64#define xdc__ARG__
65typedef xdc_IArg xdc_Arg; /* deprecated, but compatible with BIOS 5.x */
66
67/*
68 * ======== xdc__META ========
69 */
70#define xdc__META(n,s) __attribute__ ((section ("xdc.meta"))) const char (n)[] = {s}
71
72#endif /* google_targets_STD_ */
73
74/*
75 * @(#) google.targets; 1, 0, 0,112; 6-24-2013 15:21:46; /db/ztree/library/trees/xdctargets/xdctargets-g31x/src/ xlibrary
76
77 */
78
diff --git a/packages/xdctools/qnx/targets/arm/std.h b/packages/xdctools/qnx/targets/arm/std.h
new file mode 100644
index 0000000..4837b15
--- /dev/null
+++ b/packages/xdctools/qnx/targets/arm/std.h
@@ -0,0 +1,42 @@
1/*
2 * Copyright (c) 2011 Texas Instruments and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Texas Instruments - initial implementation
10 *
11 *
12 */
13
14/*
15 * ======== qnx/targets/arm/std.h ========
16 * Standard types for supported QNX Arm compilers
17 */
18
19#ifndef qnx_targets_arm_STD_
20#define qnx_targets_arm_STD_
21
22/* Define target-specific "portable" macros
23 *
24 * The build command-line define xdc_target_name__ to be the value
25 * of the target's name config parameter. We use this to include the
26 * target-specific definitions for the required target-independent
27 * xdc_target* macros.
28 */
29#ifdef xdc_target_name__
30#include xdc__local_include(xdc_target_name__)
31#endif
32
33/* "inherit" (i.e., include) all gnu.targets standard types */
34#include <gnu/targets/std.h>
35
36#endif /* qnx_targets_arm_STD_ */
37
38/*
39 * @(#) qnx.targets.arm; 1, 0, 0,101; 6-24-2013 15:21:54; /db/ztree/library/trees/xdctargets/xdctargets-g31x/src/ xlibrary
40
41 */
42
diff --git a/packages/xdctools/xdc/std.h b/packages/xdctools/xdc/std.h
new file mode 100644
index 0000000..1f751e5
--- /dev/null
+++ b/packages/xdctools/xdc/std.h
@@ -0,0 +1,354 @@
1/*
2 * Copyright (c) 2008 Texas Instruments. All rights reserved.
3 * This program and the accompanying materials are made available under the
4 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License
5 * v. 1.0 which accompanies this distribution. The Eclipse Public License is
6 * available at http://www.eclipse.org/legal/epl-v10.html and the Eclipse
7 * Distribution License is available at
8 * http://www.eclipse.org/org/documents/edl-v10.php.
9 *
10 * Contributors:
11 * Texas Instruments - initial implementation
12 * */
13
14#ifndef xdc_std__include
15#define xdc_std__include
16
17#include <stdarg.h>
18#include <stddef.h>
19
20/* macros to simplify "stringification" and computed includes */
21#define xdc__stringify(a) #a
22#define xdc__local_include(a) xdc__stringify(a.h)
23#define xdc__system_include(m) <m.h>
24
25/* TitleCase standard types */
26
27#define xdc_Void void
28
29typedef char xdc_Char;
30typedef unsigned char xdc_UChar;
31typedef short xdc_Short;
32typedef unsigned short xdc_UShort;
33typedef int xdc_Int;
34typedef unsigned int xdc_UInt;
35typedef long xdc_Long;
36typedef unsigned long xdc_ULong;
37typedef float xdc_Float;
38typedef double xdc_Double;
39typedef long double xdc_LDouble;
40typedef size_t xdc_SizeT;
41typedef va_list xdc_VaList;
42
43/* Generic Extended Types */
44
45typedef unsigned short xdc_Bool; /* boolean flag */
46typedef void *xdc_Ptr; /* data pointer */
47typedef const void *xdc_CPtr; /* data pointer */
48typedef char *xdc_String; /* null terminated string */
49typedef const char *xdc_CString; /* null terminated immutable string */
50
51#define xdc__CSTRING__ 1 /* flag that CString is declared */
52
53/* we intentionally omit arguments from Fxn to indicate that it can have
54 * any (or none). Unfortunately this causes gcc to emit warnings when
55 * -Wstrict-prototypes is used. Newer gcc's (4.6 or later) support a pragma
56 * that works around this:
57 *
58 * #pragma GCC diagnostic ignored "-Wstrict-prototypes"
59 */
60#ifdef __GNUC__
61 #if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 6))
62 #pragma GCC diagnostic push
63 #pragma GCC diagnostic ignored "-Wstrict-prototypes"
64 typedef int (*xdc_Fxn)(); /* function pointer */
65 #pragma GCC diagnostic pop
66 #else
67 typedef int (*xdc_Fxn)(); /* function pointer */
68 #endif
69#else
70 typedef int (*xdc_Fxn)(); /* function pointer */
71#endif
72
73/*
74 * Import the target-specific std.h
75 */
76#ifdef xdc_target_types__
77#define xdc_target__ <xdc_target_types__>
78#endif
79#ifdef xdc_target__
80#include xdc_target__
81#else
82/* if the user did not supply the required xdc_target* definitions, ask well
83 * known compiler tool chains to select based on their pre-defined macros
84 */
85#ifdef __TI_COMPILER_VERSION__
86#include <ti/targets/select.h>
87#else
88/*
89 * 'xdc_target_types__' must be defined to name a target-specific header
90 * file (e.g., ti/targets/std.h) that has definitions for the basic types:
91 * xdc_Int8, xdc_Int16, ...
92 *
93 * For example, to build for a target in the ti.targets package you should
94 * add the following option to your compiler's command line:
95 * -Dxdc_target_types__=ti/targets/std.h
96 */
97#error xdc_target_types__ must be defined to name a target-specific header containing definitions of xdc_Int8, xdc_Int16, ...
98
99/* the following definitions are required to keep the compiler from
100 * complaining about references to these types in the rest of this header;
101 * some compilers do not stop parsing this file after the #error above.
102 */
103typedef int xdc_IArg;
104typedef unsigned int xdc_UArg;
105typedef signed char xdc_Int8;
106typedef unsigned char xdc_UInt8;
107typedef short xdc_Int16;
108typedef unsigned short xdc_UInt16;
109typedef int xdc_Int32;
110typedef unsigned int xdc_UInt32;
111#endif
112#endif
113
114/* Each modules' internal header file defines 'module' as
115 * xdc__MODOBJADDR__(Module__state__V), where Module__state__V is the actual
116 * object where the module state is kept. For most targets, the default macro
117 * given here results in the construct '(&Module__state__V)->field', when the
118 * expression 'module->field' is used. Compilers then generate the code that
119 * doesn't dereference a pointer, but puts the address of the field in the
120 * code.
121 * The targets that need to do something different can define
122 * xdc__MODOBJADDR__ in std.h for their target package.
123 */
124#ifndef xdc__MODOBJADDR__
125#define xdc__MODOBJADDR__(symbol) (&(symbol))
126#endif
127
128/* Long Long Types */
129
130#ifdef xdc__LONGLONG__
131typedef long long xdc_LLong;
132typedef unsigned long long xdc_ULLong;
133
134#else
135
136#ifndef xdc__INT64__
137/* If the target doesn't support "long long" or a 64-bit integral type, we
138 * simply use "long". This is done to ensure that the type LLong always
139 * exists, it's at least as long as a "long", and it's 64-bits wide whenever
140 * possible.
141 */
142typedef long xdc_LLong;
143typedef unsigned long xdc_ULLong;
144#endif
145
146#endif
147
148/* Arg to Ptr and Fxn conversion operators
149 *
150 * Individual targets may override these definitions in the event
151 * that compilers issue warnings about shortening of an Arg to a pointer,
152 * for example.
153 */
154#ifndef xdc__ARGTOPTR
155static inline xdc_Ptr xdc_iargToPtr(xdc_IArg a) { return ((xdc_Ptr)a); }
156static inline xdc_Ptr xdc_uargToPtr(xdc_UArg a) { return ((xdc_Ptr)a); }
157#endif
158
159#ifndef xdc__ARGTOFXN
160static inline xdc_Fxn xdc_iargToFxn(xdc_IArg a) { return ((xdc_Fxn)a); }
161static inline xdc_Fxn xdc_uargToFxn(xdc_UArg a) { return ((xdc_Fxn)a); }
162#endif
163
164#ifndef xdc__ARGTOFLOAT
165/*
166 * functions to efficiently convert a single precision float to an IArg
167 * and vice-versa while maintaining client type safety
168 *
169 * Here the assumption is that sizeof(Float) <= sizeof(IArg);
170 */
171typedef union {
172 xdc_Float f;
173 xdc_IArg a;
174} xdc_FloatData;
175
176static inline xdc_IArg xdc_floatToArg(xdc_Float f)
177{
178 xdc_FloatData u;
179 u.f = f;
180
181 return (u.a);
182}
183
184static inline xdc_Float xdc_argToFloat(xdc_IArg a)
185{
186 xdc_FloatData u;
187 u.a = a;
188
189 return (u.f);
190}
191#endif
192
193/* restrict keyword */
194#ifndef xdc__RESTRICT__
195#define restrict
196#endif
197
198/* Unprefixed Aliases */
199
200#ifndef xdc__nolocalnames
201
202#define iargToPtr(a) xdc_iargToPtr(a)
203#define uargToPtr(a) xdc_uargToPtr(a)
204#define iargToFxn(a) xdc_iargToFxn(a)
205#define uargToFxn(a) xdc_uargToFxn(a)
206#define floatToArg(a) xdc_floatToArg(a)
207#define argToFloat(a) xdc_argToFloat(a)
208
209#define Void xdc_Void
210
211typedef xdc_Char Char;
212typedef xdc_UChar UChar;
213typedef xdc_Short Short;
214typedef xdc_UShort UShort;
215typedef xdc_Int Int;
216typedef xdc_UInt UInt;
217typedef xdc_Long Long;
218typedef xdc_ULong ULong;
219typedef xdc_LLong LLong;
220typedef xdc_ULLong ULLong;
221typedef xdc_Float Float;
222typedef xdc_Double Double;
223typedef xdc_LDouble LDouble;
224typedef xdc_SizeT SizeT;
225typedef xdc_VaList VaList;
226
227typedef xdc_IArg IArg;
228typedef xdc_UArg UArg;
229typedef xdc_Bool Bool;
230typedef xdc_Int8 Int8;
231typedef xdc_Int16 Int16;
232typedef xdc_Int32 Int32;
233typedef xdc_Fxn Fxn;
234typedef xdc_Ptr Ptr;
235typedef xdc_String String;
236typedef xdc_CString CString;
237
238typedef xdc_UInt8 UInt8;
239typedef xdc_UInt16 UInt16;
240typedef xdc_UInt32 UInt32;
241
242/* DEPRECATED Aliases */
243#ifndef xdc__strict
244#define _TI_STD_TYPES
245
246/* xdc_Arg is defined only in ti/targets/std.h; use IArg and UArg instead */
247#ifdef xdc__ARG__
248typedef xdc_Arg Arg;
249#endif
250
251typedef xdc_UInt8 Uint8;
252typedef xdc_UInt16 Uint16;
253typedef xdc_UInt32 Uint32;
254typedef xdc_UInt Uns;
255#endif
256
257/*
258 * ======== optional types ========
259 * The following types are not always defined for all targets
260 */
261#ifdef xdc__INT64__
262typedef xdc_Int64 Int64;
263typedef xdc_UInt64 UInt64;
264#endif
265
266/* The following exact size types are not required by C99 and may not be
267 * supported by some compiler/processor environments. For greater
268 * portability, use the IntN or UIntN types above.
269 */
270#ifdef xdc__BITS8__
271typedef xdc_Bits8 Bits8;
272#endif
273
274#ifdef xdc__BITS16__
275typedef xdc_Bits16 Bits16;
276#endif
277
278#ifdef xdc__BITS32__
279typedef xdc_Bits32 Bits32;
280#endif
281
282#ifdef xdc__BITS64__
283typedef xdc_Bits64 Bits64;
284#endif
285
286#endif /* xdc__nolocalnames */
287
288/* Standard Constants */
289
290/* NULL must be 0 for C++ and is set to 0 in C to allow legacy code to
291 * compile without warnings.
292 *
293 * If xdc__strict is defined, NULL is defined to be a pointer to allow
294 * maximal type checking in "modern" C sources
295 */
296#undef NULL
297#if defined(__cplusplus) || !defined(xdc__strict)
298#define NULL 0
299#else
300#define NULL ((void *)0)
301#endif
302
303#undef FALSE
304#define FALSE 0
305
306#undef TRUE
307#define TRUE 1
308
309/* Declaration Qualifiers */
310
311#ifndef __FAR__
312#define __FAR__
313#endif
314
315/*
316 * ======== xdc__CODESECT ========
317 * Code-Section Directive
318 *
319 * Targets can optionally #define xdc__CODESECT in their specific
320 * std.h files. This directive is placed in front of all
321 * "extern" function declarations, and specifies a section-name in
322 * which to place this function. This approach
323 * provides more control on combining/organizing groups of
324 * related functions into a single named sub-section (e.g.,
325 * "init-code") If this macro is not defined by the target, an
326 * empty definition is used instead.
327 */
328#ifndef xdc__CODESECT
329#define xdc__CODESECT(fn, sn)
330#endif
331
332/*
333 * ======== xdc__META ========
334 * Embed unreferenced string in the current file
335 *
336 * Strings emebdded via xdc__META can be placed in a section that is
337 * _not_ loaded on the target but are, nevertheless, part of the
338 * executable and available to loaders.
339 *
340 * Different targets may define this macro in a way that places these
341 * strings in an output section that is not loaded (and therefore does
342 * not takeup space on the target). Unless the target provides a
343 * definition of xdc__META, the definition below simply defines
344 * as string constant in the current file.
345 */
346#ifndef xdc__META
347#define xdc__META(n,s) __FAR__ const char (n)[] = {s}
348#endif
349
350#endif /* xdc_std__include */
351/*
352 * @(#) xdc; 1, 1, 1,426; 6-24-2013 18:59:27; /db/ztree/library/trees/xdc/xdc-z52x/src/packages/
353 */
354