diff -Nru dce-1.6.5.4/.gitignore dce-1.6.7.3/.gitignore --- dce-1.6.5.4/.gitignore 2012-09-24 15:13:39.000000000 +0000 +++ dce-1.6.7.3/.gitignore 2012-11-28 09:54:14.000000000 +0000 @@ -22,7 +22,3 @@ .interfaces .libraries* *.mak -*.xem3 -ducati/ti/dce/package -/ducati/ti/dce/baseimage/package/ -/ducati/ti/dce/lib/ diff -Nru dce-1.6.5.4/Makefile.am dce-1.6.7.3/Makefile.am --- dce-1.6.5.4/Makefile.am 2012-09-24 15:13:39.000000000 +0000 +++ dce-1.6.7.3/Makefile.am 2012-11-28 09:54:14.000000000 +0000 @@ -2,22 +2,26 @@ SUBDIRS = \ packages/codec_engine \ + packages/framework_components \ packages/ivahd_codecs \ - packages/xdctools \ - packages/xdais + packages/xdais \ + packages/xdctools lib_LTLIBRARIES = libdce.la CE_CFLAGS = \ -I$(top_srcdir)/ducati \ + -I$(top_srcdir)/packages/ \ -I$(top_srcdir)/packages/codec_engine \ + -I$(top_srcdir)/packages/framework_components \ -I$(top_srcdir)/packages/ivahd_codecs \ + -I$(top_srcdir)/packages/xdais \ -I$(top_srcdir)/packages/xdctools \ - -I$(top_srcdir)/packages/xdais + -Wno-pointer-to-int-cast libdce_la_SOURCES = libdce.c libdce_la_CFLAGS = $(WARN_CFLAGS) $(CE_CFLAGS) $(DRM_CFLAGS) $(X11_CFLAGS) $(WAYLAND_CFLAGS) -libdce_la_LDFLAGS = -no-undefined +libdce_la_LDFLAGS = -no-undefined -version-info 1:0:0 libdce_la_LIBADD = $(DRM_LIBS) $(X11_LIBS) $(WAYLAND_LIBS) if ENABLE_X11 diff -Nru dce-1.6.5.4/configure.ac dce-1.6.7.3/configure.ac --- dce-1.6.5.4/configure.ac 2012-09-24 15:13:39.000000000 +0000 +++ dce-1.6.7.3/configure.ac 2012-11-28 09:54:14.000000000 +0000 @@ -88,6 +88,7 @@ libdce.pc Makefile packages/codec_engine/Makefile +packages/framework_components/Makefile packages/ivahd_codecs/Makefile packages/xdais/Makefile packages/xdctools/Makefile diff -Nru dce-1.6.5.4/debian/changelog dce-1.6.7.3/debian/changelog --- dce-1.6.5.4/debian/changelog 2012-12-13 09:25:00.000000000 +0000 +++ dce-1.6.7.3/debian/changelog 2012-12-13 09:25:00.000000000 +0000 @@ -1,3 +1,21 @@ +dce (1.6.7.3-2) precise; urgency=low + + * Update control run-time depends + + -- Xavier Boudet Fri, 07 Dec 2012 12:03:11 +0100 + +dce (1.6.7.3-1) precise; urgency=low + + * New upstream release, commit ee4f5fd + + -- Olivier Naudan Wed, 28 Nov 2012 09:55:49 +0000 + +dce (1.6.6.2-1) precise; urgency=low + + * New upstream release, commit 9e5170d + + -- Olivier Naudan Thu, 11 Oct 2012 06:21:38 -0400 + dce (1.6.5.4-1) precise; urgency=low * New upstream release, commit 0c0ed32 diff -Nru dce-1.6.5.4/debian/control dce-1.6.7.3/debian/control --- dce-1.6.5.4/debian/control 2012-12-13 09:25:00.000000000 +0000 +++ dce-1.6.7.3/debian/control 2012-12-13 09:25:00.000000000 +0000 @@ -15,11 +15,13 @@ Homepage: https://gitorious.org/gstreamer-omap/libdce Vcs-Git: git://gitorious.org/ubuntu-omap/dce.git -Package: libdce0 +Package: libdce1 Section: libs Architecture: armhf Depends: ${shlibs:Depends}, ${misc:Depends} +Replaces: libdce0 +Conflicts: libdce0 Description: OMAP4 DCE library A library to remotely invoke the HW accellerated codecs on IVA-HD via a syslink/rcm shim layer. @@ -30,6 +32,6 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, pkg-config, - libdce0 (= ${binary:Version}) + libdce1 (= ${binary:Version}) Description: OMAP4 DCE development files. Contains all the necessary header files and libs. diff -Nru dce-1.6.5.4/debian/libdce0.debhelper.log dce-1.6.7.3/debian/libdce0.debhelper.log --- dce-1.6.5.4/debian/libdce0.debhelper.log 2012-12-13 09:25:00.000000000 +0000 +++ dce-1.6.7.3/debian/libdce0.debhelper.log 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -dh_autoreconf_clean diff -Nru dce-1.6.5.4/debian/libdce0.install dce-1.6.7.3/debian/libdce0.install --- dce-1.6.5.4/debian/libdce0.install 2012-12-13 09:25:00.000000000 +0000 +++ dce-1.6.7.3/debian/libdce0.install 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -debian/tmp/usr/lib/lib*.so.* diff -Nru dce-1.6.5.4/debian/libdce1.debhelper.log dce-1.6.7.3/debian/libdce1.debhelper.log --- dce-1.6.5.4/debian/libdce1.debhelper.log 1970-01-01 00:00:00.000000000 +0000 +++ dce-1.6.7.3/debian/libdce1.debhelper.log 2012-12-13 09:25:00.000000000 +0000 @@ -0,0 +1 @@ +dh_autoreconf_clean diff -Nru dce-1.6.5.4/debian/libdce1.install dce-1.6.7.3/debian/libdce1.install --- dce-1.6.5.4/debian/libdce1.install 1970-01-01 00:00:00.000000000 +0000 +++ dce-1.6.7.3/debian/libdce1.install 2012-12-13 09:25:00.000000000 +0000 @@ -0,0 +1 @@ +debian/tmp/usr/lib/lib*.so.* diff -Nru dce-1.6.5.4/ducati/ti/dce/baseimage/dce_core0.cfg dce-1.6.7.3/ducati/ti/dce/baseimage/dce_core0.cfg --- dce-1.6.5.4/ducati/ti/dce/baseimage/dce_core0.cfg 2012-09-24 15:13:39.000000000 +0000 +++ dce-1.6.7.3/ducati/ti/dce/baseimage/dce_core0.cfg 1970-01-01 00:00:00.000000000 +0000 @@ -1,152 +0,0 @@ -/* - * Copyright (c) 2011, Texas Instruments Incorporated - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of Texas Instruments Incorporated nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -xdc.loadCapsule("ti/configs/omap4430/IpcCommon.cfg.xs"); -xdc.includeFile("ti/configs/omap4430/DucatiCore0.cfg"); -xdc.includeFile("ti/configs/omap4430/DucatiAmmu.cfg"); - -var Program = xdc.useModule('xdc.cfg.Program'); -var Memory = xdc.useModule('xdc.runtime.Memory'); -var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem'); -var GateHwi = xdc.useModule('ti.sysbios.gates.GateHwi'); - -HeapMem.common$.gate = GateHwi.create(); - -var heapMemParams = new HeapMem.Params; -heapMemParams.size = 0x19FFFF0; // TODO check this size, maybe we can go up? -heapMemParams.sectionName = ".systemHeap"; -var heap0 = HeapMem.create(heapMemParams); -Memory.defaultHeapInstance = heap0; -Program.global.heap0 = heap0; - -/* - * Setup memory map. - */ - -/* Mark heaps as NOINIT for optimizing boot-time */ -Program.sectMap[".systemHeap"] = new Program.SectionSpec(); -Program.sectMap[".systemHeap"].loadSegment = "EXT_HEAP"; -Program.sectMap[".systemHeap"].type = "NOINIT"; - -/* Work-around for .const loading issues with MPEG4/VC1 codecs.. move AMMU - * tables out of .const into .txt so that they have valid data when AMMU - * is programmed (which happens before cinit initializes rw sections.. - * which is what .const becomes due to rw var mistakenly placed on .const - */ -Program.sectMap[".const:ti_sysbios_hal_ammu_AMMU_mmuInitConfig__C"] = "EXT_CODE"; -Program.sectMap[".const:ti_sysbios_hal_ammu_AMMU_numLargePages__C"] = "EXT_CODE"; -Program.sectMap[".const:ti_sysbios_hal_ammu_AMMU_numLinePages__C"] = "EXT_CODE"; -Program.sectMap[".const:ti_sysbios_hal_ammu_AMMU_numMediumPages__C"] = "EXT_CODE"; -Program.sectMap[".const:ti_sysbios_hal_ammu_AMMU_numSmallPages__C"] = "EXT_CODE"; - -/* - * ======== CODEC ENGINE configurations ======== - */ - -var Global = xdc.useModule('ti.sdo.ce.osal.Global'); -Global.runtimeEnv = Global.DSPBIOS; - -xdc.useModule('ti.sdo.ce.global.Settings').profile = "debug"; -xdc.loadPackage('ti.sdo.ce.video').profile = "debug"; -xdc.loadPackage('ti.sdo.ce.video3').profile = "debug"; -xdc.loadPackage('ti.sdo.ce.alg').profile = "debug"; -xdc.useModule('ti.sdo.fc.global.Settings').profile = "debug"; -xdc.loadPackage('ti.sdo.fc.rman').profile = "debug"; -xdc.loadPackage('ti.sdo.fc.ires.hdvicp').profile = "debug"; -xdc.loadPackage('ti.sdo.fc.ires.tiledmemory').profile = "debug"; - -var ipcSettings = xdc.useModule('ti.sdo.ce.ipc.Settings'); -ipcSettings.ipc = xdc.useModule('ti.sdo.ce.ipc.bios.Ipc'); -// set to true to enable debugging of codec engine -xdc.useModule('ti.sdo.ce.Settings').checked = true; - -//set All heaps of dskts as the default heap0 -var DSKT2 = xdc.useModule('ti.sdo.fc.dskt2.DSKT2'); -DSKT2.DARAM0 = "heap0"; -DSKT2.DARAM1 = "heap0"; -DSKT2.DARAM2 = "heap0"; -DSKT2.SARAM0 = "heap0"; -DSKT2.SARAM1 = "heap0"; -DSKT2.SARAM2 = "heap0"; -DSKT2.ESDATA = "heap0"; -DSKT2.IPROG = "heap0"; -DSKT2.EPROG = "heap0"; -DSKT2.DSKT2_HEAP = "heap0"; - -var HDVICP2 = xdc.useModule('ti.sdo.fc.ires.hdvicp.HDVICP2'); -HDVICP2.memoryBaseAddress[0] = 0xBB000000; -HDVICP2.registerBaseAddress[0] = 0xBA000000; -HDVICP2.resetControlAddress[0] = 0xAA306F10; /* overriden dynamically */ -HDVICP2.resetFxn = "ivahd_reset"; - -xdc.useModule('ti.sdo.fc.rman.RMAN'); - -// Load HDVICP2 support lib end decoder/encoder APIs: -var HDVICP20API = xdc.useModule('ti.sdo.codecs.hdvicp20api.HDVICP20API'); -var VIDDEC3 = xdc.useModule('ti.sdo.ce.video3.IVIDDEC3'); -var VIDENC2 = xdc.useModule('ti.sdo.ce.video2.IVIDENC2'); - -// load whatever codecs are available in the build -var codecs = []; - -function loadCodec(pkg, name) -{ - try { - var codec = xdc.useModule(pkg); - print('loading: ' + name); - codecs.push({ name: name, mod: codec, local: true }); - } catch(e) { - print('no package: ' + pkg); - } -} - -// Note: we try to load both MPEG4DEC and MPEG4VDEC, which are found -// in ducatimm and the original codec respectively. -loadCodec('ti.sdo.codecs.h264dec.ce.H264DEC', 'ivahd_h264dec'); -loadCodec('ti.sdo.codecs.mpeg4dec.ce.MPEG4DEC', 'ivahd_mpeg4dec'); -loadCodec('ti.sdo.codecs.mpegv4dec.ce.MPEG4VDEC','ivahd_mpeg4dec'); -loadCodec('ti.sdo.codecs.jpegvdec.ce.JPEGVDEC', 'ivahd_jpegvdec'); -loadCodec('ti.sdo.codecs.vc1vdec.ce.VC1VDEC', 'ivahd_vc1vdec'); -loadCodec('ti.sdo.codecs.mpeg2vdec.ce.MPEG2VDEC','ivahd_mpeg2vdec'); -loadCodec('ti.sdo.codecs.h264enc.ce.H264ENC', 'ivahd_h264enc'); -loadCodec('ti.sdo.codecs.mpeg4enc.ce.MPEG4ENC', 'ivahd_mpeg4enc'); -loadCodec('ti.sdo.codecs.jpegvenc.ce.JPEGVENC', 'ivahd_jpegvenc'); - -var engine = xdc.useModule('ti.sdo.ce.Engine'); -var myEngine = engine.create("ivahd_vidsvr", codecs); - -xdc.useModule('ti.sysbios.knl.Task'); - -// Enable load computation. -var Load = xdc.useModule('ti.sysbios.utils.Load'); -Load.updateInIdle = true; -Load.windowInMs = 11; diff -Nru dce-1.6.5.4/ducati/ti/dce/baseimage/dce_ipu.cfg dce-1.6.7.3/ducati/ti/dce/baseimage/dce_ipu.cfg --- dce-1.6.5.4/ducati/ti/dce/baseimage/dce_ipu.cfg 2012-09-24 15:13:39.000000000 +0000 +++ dce-1.6.7.3/ducati/ti/dce/baseimage/dce_ipu.cfg 2012-11-28 09:54:14.000000000 +0000 @@ -117,8 +117,7 @@ xdc.useModule('ti.sdo.fc.rman.RMAN'); -// Load HDVICP2 support lib end decoder/encoder APIs: -var HDVICP20API = xdc.useModule('ti.sdo.codecs.hdvicp20api.HDVICP20API'); +// Load decoder/encoder APIs: var VIDDEC3 = xdc.useModule('ti.sdo.ce.video3.IVIDDEC3'); var VIDENC2 = xdc.useModule('ti.sdo.ce.video2.IVIDENC2'); @@ -136,17 +135,14 @@ } } -// Note: we try to load both MPEG4DEC and MPEG4VDEC, which are found -// in ducatimm and the original codec respectively. -loadCodec('ti.sdo.codecs.h264dec.ce.H264DEC', 'ivahd_h264dec'); -loadCodec('ti.sdo.codecs.mpeg4dec.ce.MPEG4DEC', 'ivahd_mpeg4dec'); -loadCodec('ti.sdo.codecs.mpeg4vdec.ce.MPEG4VDEC','ivahd_mpeg4dec'); +loadCodec('ti.sdo.codecs.mpeg4vdec.ce.MPEG4VDEC', 'ivahd_mpeg4dec'); +loadCodec('ti.sdo.codecs.h264vdec.ce.H264VDEC', 'ivahd_h264dec'); loadCodec('ti.sdo.codecs.jpegvdec.ce.JPEGVDEC', 'ivahd_jpegvdec'); loadCodec('ti.sdo.codecs.vc1vdec.ce.VC1VDEC', 'ivahd_vc1vdec'); loadCodec('ti.sdo.codecs.mpeg2vdec.ce.MPEG2VDEC','ivahd_mpeg2vdec'); + loadCodec('ti.sdo.codecs.h264enc.ce.H264ENC', 'ivahd_h264enc'); loadCodec('ti.sdo.codecs.mpeg4enc.ce.MPEG4ENC', 'ivahd_mpeg4enc'); -loadCodec('ti.sdo.codecs.jpegvenc.ce.JPEGVENC', 'ivahd_jpegvenc'); var engine = xdc.useModule('ti.sdo.ce.Engine'); var myEngine = engine.create("ivahd_vidsvr", codecs); diff -Nru dce-1.6.5.4/ducati/ti/dce/baseimage/ping_tasks.c dce-1.6.7.3/ducati/ti/dce/baseimage/ping_tasks.c --- dce-1.6.5.4/ducati/ti/dce/baseimage/ping_tasks.c 2012-09-24 15:13:39.000000000 +0000 +++ dce-1.6.7.3/ducati/ti/dce/baseimage/ping_tasks.c 2012-11-28 09:54:14.000000000 +0000 @@ -49,7 +49,6 @@ #include #include -#include #define APP_NUM_ITERATIONS 100000 diff -Nru dce-1.6.5.4/ducati/ti/dce/dce.c dce-1.6.7.3/ducati/ti/dce/dce.c --- dce-1.6.5.4/ducati/ti/dce/dce.c 2012-09-24 15:13:39.000000000 +0000 +++ dce-1.6.7.3/ducati/ti/dce/dce.c 2012-11-28 09:54:14.000000000 +0000 @@ -58,7 +58,6 @@ #include #include -#include #include "dce_priv.h" #include "dce_rpc.h" @@ -273,7 +272,6 @@ Engine_Error ec; DEBUG(">> name=%s", req->name); - ivahd_boot(); rsp->engine = (uint32_t)Engine_open(req->name, NULL, &ec); rsp->error_code = ec; DEBUG("<< engine=%08x, ec=%d", rsp->engine, rsp->error_code); @@ -455,6 +453,17 @@ DEBUG(">> codec=%p, inBufs=%p, outBufs=%p, inArgs=%p, outArgs=%p, codec_id=%d", req->codec, in_bufs, out_bufs, in_args, out_args, codec_id); + /* Clear out buffers to free list, in case some codecs do not + initialize it when erroring out (see below). */ + switch(codec_id) { + case OMAP_DCE_VIDENC2: + ((VIDENC2_OutArgs *)out_args)->freeBufID[0] = 0; + break; + case OMAP_DCE_VIDDEC3: + ((VIDDEC3_OutArgs *)out_args)->freeBufID[0] = 0; + break; + } + rsp->result = IALG_EOK; ivahd_acquire(); @@ -474,7 +483,9 @@ rsp->count = 0; - if (rsp->result == IALG_EOK) { + /* We used to transfer the freeBufID array only when no error occured, + but at least the MPEG2 decoder uses it even when erroring out. */ + { int32_t *free_buf_ids; int i; diff -Nru dce-1.6.5.4/ducati/ti/dce/ivahd.c dce-1.6.7.3/ducati/ti/dce/ivahd.c --- dce-1.6.5.4/ducati/ti/dce/ivahd.c 2012-09-24 15:13:39.000000000 +0000 +++ dce-1.6.7.3/ducati/ti/dce/ivahd.c 2012-11-28 09:54:14.000000000 +0000 @@ -119,7 +119,7 @@ Task_sleep(((ms * 1000 + (Clock_tickPeriod - 1)) / Clock_tickPeriod)); } -void ivahd_boot(void) +static void ivahd_boot(void) { int i; volatile unsigned int *icont1_itcm_base_addr = @@ -312,6 +312,8 @@ sleepms(10); + ivahd_boot(); + DEBUG("RMAN_register() for HDVICP is successful"); end: diff -Nru dce-1.6.5.4/ducati/ti/dce/package.xdc dce-1.6.7.3/ducati/ti/dce/package.xdc --- dce-1.6.5.4/ducati/ti/dce/package.xdc 2012-09-24 15:13:39.000000000 +0000 +++ dce-1.6.7.3/ducati/ti/dce/package.xdc 2012-11-28 09:54:14.000000000 +0000 @@ -36,7 +36,6 @@ requires ti.ipc.rpmsg; requires ti.srvmgr; -requires ti.resmgr; requires ti.sdo.ce; requires ti.sdo.ce.video2; requires ti.sdo.ce.video3; diff -Nru dce-1.6.5.4/packages/codec_engine/Makefile.am dce-1.6.7.3/packages/codec_engine/Makefile.am --- dce-1.6.5.4/packages/codec_engine/Makefile.am 2012-09-24 15:13:39.000000000 +0000 +++ dce-1.6.7.3/packages/codec_engine/Makefile.am 2012-11-28 09:54:14.000000000 +0000 @@ -4,10 +4,11 @@ nobase_pkg_include_HEADERS = \ ti/sdo/ce/Engine.h \ - ti/sdo/ce/Server.h \ - ti/sdo/ce/ipc/Comm.h \ - ti/sdo/ce/node/node.h \ - ti/sdo/ce/skel.h \ + ti/sdo/ce/visa.h \ + ti/sdo/ce/ServerDefs.h \ ti/sdo/ce/video3/viddec3.h \ ti/sdo/ce/video2/videnc2.h \ - ti/sdo/ce/visa.h + ti/sdo/ce/Server.h \ + ti/sdo/ce/skel.h \ + ti/sdo/ce/node/node.h \ + ti/sdo/ce/ipc/Comm.h diff -Nru dce-1.6.5.4/packages/codec_engine/ti/sdo/ce/Engine.h dce-1.6.7.3/packages/codec_engine/ti/sdo/ce/Engine.h --- dce-1.6.5.4/packages/codec_engine/ti/sdo/ce/Engine.h 2012-09-24 15:13:39.000000000 +0000 +++ dce-1.6.7.3/packages/codec_engine/ti/sdo/ce/Engine.h 2012-11-28 09:54:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Texas Instruments Incorporated + * Copyright (c) 2012, Texas Instruments Incorporated * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,10 +37,12 @@ /** * @file ti/sdo/ce/Engine.h * - * @brief The Codec Engine Runtime. Provides the user an inteface to - * open and manipulate an engine which can instantiate + * @brief The Codec Engine Runtime. + * + * @remarks Provides the user an interface to + * open and manipulate an Engine which can instantiate * and communicate with XDAIS algorithms that run either - * on the local CPU or on a "remote" DSP Server. + * on the local CPU or on a "remote" Server. */ /** * @addtogroup CODECENGINE Codec Engine Runtime @@ -54,7 +56,7 @@ #endif -#include +#include #include #include #include @@ -67,20 +69,22 @@ /** * @brief Name to pass to Diags_setMask() to enable logging for Engine - * functions. For example, - * Diags_setMask(Engine_MODNAME"+EX1234567"); - * turns on all Log statements in this module. - * Diags_setMask() must be called after initialization to take - * effect. + * functions. + * + * @par Example Usage: + * The following code turns on all Log statements in the Engine + * module. + * @code + * Diags_setMask(Engine_MODNAME "+EX1234567"); + * @endcode + * + * @remarks Using Diags_setMask() to enable Engine Logging must be called + * after CERuntime_init() (which creates and initializes the + * Engine trace mask) to have any effect. */ #define Engine_MODNAME "ti.sdo.ce.Engine" /** - * @brief Trace name for the Engine module - */ -#define Engine_GTNAME "CE" - -/** * @brief Opaque handle to an engine. */ typedef struct Engine_Obj *Engine_Handle; @@ -133,7 +137,8 @@ /** * @brief Attributes of an Engine * - * @sa Engine_open() and Engine_ATTRS. + * @sa Engine_initAttrs(). + * @sa Engine_open(). */ typedef struct Engine_Attrs { String procId; /**< id of the processor that runs the server; only @@ -155,7 +160,31 @@ } Engine_AlgInfo; /** + * @brief Properties of an Engine algorithm. + * + * @remarks This structure is identical to Engine_AlgInfo except that the + * @c typeTab array of strings is replaced by a single string + * called @c types. The string, @c types, represents a ';' + * separated list of inheritance hierarchies of the algorithm, + * for example, + * "ti.sdo.ce.video.IVIDDEC;ti.sdo.ce.test.xvideo.IVIDE". + * + * @sa Engine_getAlgInfo2() + */ +typedef struct Engine_AlgInfo2 { + Int algInfoSize; /**< Size of this structure. */ + String name; /**< Name of algorithm. */ + String types; /**< Inheritance hierarchy. */ + Bool isLocal; /**< If TRUE, run locally. */ +} Engine_AlgInfo2; + +/** * @brief Default engine attributes. + * + * @deprecated Engine_ATTRS is no longer recommended. Please use + * Engine_initAttrs() instead. + * + * @sa Engine_initAttrs() */ extern Engine_Attrs Engine_ATTRS; /**< Default attrs. */ @@ -166,24 +195,137 @@ #define Engine_CEXIT 0 #define Engine_MAXSEGNAMELENGTH 32 +/** @endcond */ + +/** + * @brief Engine Cacheable Memory types. + * + * @enumWarning + */ +typedef enum Engine_CachedMemType { + Engine_USECACHEDMEM_DEFAULT = -1, /**< Use default cache setting */ + Engine_USECACHEDMEM_NONCACHED = 0, /**< Use non-cached memory */ + Engine_USECACHEDMEM_CACHED = 1 /**< Use cached memory */ +} Engine_CachedMemType; + /* * ======== Engine_AlgDesc ======== */ +/** + * @brief Descriptor for an alg. This object can be passed to + * @c Engine_addAlg(), to dynamically add an alg to an engine. + * + * @sa Engine_initAlgDesc() + * @sa Engine_addAlg() + */ typedef struct Engine_AlgDesc { - String name; /**< Name of algorithm. */ - NODE_Uuid uuid; /**< Fixed length perfect hash of name. */ - IALG_Fxns *fxns; /**< If null, served by RMS. */ - Ptr idmaFxns; /**< DMA resource negotiation when not null. */ - String *typeTab; /**< inheritance hierarchy. */ - Bool isLocal; /**< if TRUE, run locally. */ - Int groupId; /**< Resource sharing group Id. */ - Int rpcProtocolVersion; /**< Protocol version. */ - Ptr iresFxns; /**< IRES_Fxns when not null. */ - Void *codecClassConfig; /**< codec class config data, if any */ + /** + * @brief The name of the algorithm. This is used by the application + * when instantiating an instance of the algorithm through one + * of the VISA APIs. + */ + String name; + + NODE_Uuid uuid; /**< Id of alg if running on remote target. No need + * to set this field. + */ + + /** + * @brief The address of the XDAIS alg function table. + * All XDAIS algorithms must define an IALG_Fxns structure that + * contains implementations of the IALG methods. This field + * is simply the address of this structure. + */ + IALG_Fxns *fxns; + + /** + * @brief The address of the IDMA3_Fxns function table, if the algorithm + * uses DMA. If the algorithm does not use DMA, this field should + * set to NULL. + */ + Ptr idmaFxns; + + String *typeTab; /**< inheritance hierarchy - Do not modify. */ + + /** + * @brief If true, the algorithm will be instantiated on the + * "local" CPU. Otherwise the server will create an + * instance of the algorithm. + */ + Bool isLocal; + + /** + * @brief This id specifies which resource sharing group that this + * alg will be placed into. This 'group' concept + * is used by the framework to ensure algorithms in the + * same group don't pre-empt each other and corrupt the + * shared resources. + * This parameter will be ignored if @c isLocal is FALSE. + */ + Int groupId; + + Int rpcProtocolVersion; /**< Protocol version. Do not modify */ + + /** + * @brief Address of the XDAIS alg IRES Interface function table + * All XDAIS algorithms that use an IRES resource must define an + * IRES_Fxns structure containing the pointers to functions + * implementatng the IRES interface. + * If the algorithm does not use an IRES resource this field + * should be set to NULL. + */ + Ptr iresFxns; + + /** + * @brief Codec class configuration data, if any. + */ + Void *codecClassConfig; + + /** + * @brief Indicates the type of memory the alg's memory requests will + * be allocated from. + * The alg's memory will be allocated from cached memory, if + * memType = Engine_USECACHEDMEM_CACHED, + * from non-cached memory, if + * memType = Engine_USECACHEDMEM_NONCACHED, + * Otherwise, if + * memType = Engine_USECACHEDMEM_DEFAULT, + * memory allocations will be determined by the value of + * ti_sdo_ce_alg_Algorithm_useCache (cached, if TRUE, non-cached, + * if FALSE). + * + * @sa Engine_CachedMemType + */ + Engine_CachedMemType memType; /**< Memory type for alg's mem reqs. */ + + /** + * @brief A string idicating the type(s) of algorithm this is. + * This should be a ';' separated string of inherited types. + * In most cases, @c types will just be set to the VISA type + * defined in the Codec Engine algorithm interface header + * file included by the algorithm, depending on the XDM interface + * the algorithm implements. + * + * For example, if the algorithm implements the ISPHDEC1 + * interface as defined by XDM, @c types should be set + * to + * @c SPHDEC1_VISATYPE + * (defined as "ti.sdo.ce.speech1.ISPHDEC1" in the header file + * ti/sdo/ce/speech1/sphdec1.h). + * + * Another example to illustrate multiple typss specified in + * @c typss, if the algorithm implements the (made-up) + * interface, ti.sdo.ce.test.xvideo.IVIDE, which in turn + * implements the IVIDDEC interface, we could then set @c types + * to + * VIDDEC_VISATYPE";ti.sdo.ce.test.xvideo.IVIDE" + * or + * "ti.sdo.ce.test.xvideo.IVIDE;"VIDDEC_VISATYPE + */ + String types; } Engine_AlgDesc; -/** @endcond */ /** * @brief Name of function that a dynamically loaded codec must supply. @@ -195,7 +337,7 @@ * An alg that will be dynamically loaded must have a descriptor of this type. */ /** - * @brief Discriptor for a dynamically loaded codec. A dynamic library + * @brief Descriptor for a dynamically loaded alg. A dynamic library * for a codec must export a function that fills in a structure * of this type. * @@ -203,11 +345,6 @@ */ typedef struct Engine_DllAlgDesc { /** - * @todo Figure out what should be put for uuid. - */ - NODE_Uuid uuid; - - /** * @brief Pointer to codec's IALG_Fxns. This can not be NULL. */ IALG_Fxns *fxns; @@ -219,25 +356,26 @@ Ptr idmaFxns; /** - * @brief Inheritance hierarchy of codec. This is a NULL terminated - * array that lists the interfaces inherited by the code. For - * example: - * - * static String typeTab_SPHDEC1COPY_TI_ISPHDEC1COPY[] = { - * "ti.sdo.ce.speech1.ISPHDEC1", - * NULL - * }; - * - */ - String *typeTab; - - /** * @brief Pointer to codec's IRES_Fxns function table. This should be * NULL if the codec does not implement the IRES_Fxns. */ Ptr iresFxns; /** + * @brief Inheritance hierarchy of codec. This is a ';' separated + * string that lists the interfaces inherited by the code. For + * example: + * + * "ti.sdo.ce.speech1.ISPHDEC1" + * + * or, in the case where a test IVIDE interface inherits IVIDDEC: + * + * "ti.sdo.ce.video.IVIDDEC;ti.sdo.ce.test.xvideo.IVIDE" + * + */ + String types; + + /** * @brief codec class config data, if any. * * @todo Figure out what this is. @@ -262,21 +400,67 @@ */ typedef Int (*Engine_GetAlgDescFxn)(Engine_DllAlgDesc *dllAlgDesc); + /* - * ======== Engine_DllAlgParams ======== - * Dynamically loaded algorithm parameters to pass to Engine_addAlg(). + * ======== Engine_Desc ======== */ /** - * @brief This structure is passed to @c Engine_addAlg(), and contains - * parameters to create a dynamic codec with. + * @brief This structure is passed to @c Engine_add(), and contains + * parameters to specify an engine. * - * @sa Engine_addAlg(). + * @sa Engine_add() + * @sa Engine_open() */ -typedef struct Engine_DllAlgParams { - String name; /**< Name of algorithm. */ - Bool isLocal; /**< if TRUE, run locally. */ - Int groupId; /**< Resource sharing group Id. */ -} Engine_DllAlgParams; +typedef struct Engine_Desc { + String name; /**< Name of the Engine + * + * @remarks This must not be NULL + */ + Engine_AlgDesc *algTab; /**< No longer used, set to NULL */ + String remoteName; /**< Name of Server image, if applicable + * + * @remarks If this Engine has no remote + * algorithms, this can be NULL. + * + * @remarks On SysLink-based systems, this + * is the name of a file, and is + * passed unchanged to + * ProcMgr_load(). + */ + String memMap; /**< Name of a file containing the slave + * memory map + * + * @remarks If this Engine has no remote + * algorithms, this can be NULL. + * + * @remarks If the remote algorithms are + * on a Server whos MMU is not + * enabled, this can be NULL. + * + * @remarks The format of this file matches + * the SysLink format described at + * http://processors.wiki.ti.com/index.php/SysLink_MMU_Support + * + * @remarks If useExtLoader is FALSE, this + * field can be NULL. + */ + Bool useExtLoader; /**< Indicates whether the Server containing + * any remote algorithms will be loaded using + * an external loader (e.g. SysLink's + * slaveloader) + * + * @remarks If @c useExtLoader is TRUE, + * Engine_open() will not load + * the slave. + * + * @remarks If @c useExtLoader is FALSE, + * Engine_open() will load the + * Server with the file specified + * by @c remoteName. + */ + Int numAlgs; /**< No longer used, set to zero */ + Int heapId; /**< No longer used, set to zero */ +} Engine_Desc; /** @cond INTERNAL */ @@ -294,17 +478,6 @@ * configuration). */ } Engine_AlgCreateAttrs; -/* - * ======== Engine_Desc ======== - */ -typedef struct Engine_Desc { - String name; /**< Name of this Engine. */ - Engine_AlgDesc *algTab; /**< Table of algs available in this Engine. */ - String remoteName; /**< Optional name of Server image to load. */ - String linkCfg; /**< Optional Link config (when using LAD). */ - Int numAlgs; /**< Number of algorithms in algTab */ - Int heapId; /**< Heap ID for engine allocs. */ -} Engine_Desc; /* * ======== Engine_Config ======== @@ -338,19 +511,67 @@ /* + * ======== Engine_addStubFxns ======== + */ +/** + * @brief Register stub functions through which a remote algorithm + * can be called + * + * @param[in] fxnsName The name of the stub function table (e.g. + * "UNIVERSAL_STUBS") + * @param[in] fxns Address of stub function table + * (e.g. &UNIVERSAL_STUBS) + * + * @pre As with all Codec Engine API's, CERuntime_init() must have + * previously been called. + * + * @remarks This service is not necessary if you configure your Engine + * at build/config time using Engine.createFromServer(). + * When using Engine.createFromServer(), the appropriate + * alg-specific stubs are added to the system automatically. + * + * @remarks When on an RTOS (e.g. SYS/BIOS), the stubs registered are + * available to all Engines in the system. When on a HLOS + * (e.g. Linux, WinCE), the stubs registered are available to + * all Engines in the calling application's process. + * + * @remarks The symbol passed to the @c fxns argument can often be found + * in the class-specific VISA header file (e.g. UNIVERSAL_STUBS + * is declared in ti/sdo/ce/universal/universal.h). + * + * @remarks For example, to register "UNIVERSAL_STUBS" for use by an + * IUNIVERSAL-compliant algorithm at runtime, you can + * do the following: + * @code + * #include + * #include + * + * Engine_register("UNIVERSAL_STUBS", + * (IALG_Fxns *)&UNIVERSAL_STUBS); + * @endcode + * + * @retval Engine_EOK Success. + * @retval Engine_ENOMEM Memory allocation failed. + * + * @sa Engine_open() + */ +extern Engine_Error Engine_addStubFxns(String fxnsName, IALG_Fxns *fxns); + +/* * ======== Engine_add ======== - * TODO: Engine_Desc has a heapId for engine allocs. Should we add this? */ /** * @brief Add an Engine to the database of engines that can be opened with - * Engine_open(). - * - * @param[in] engineName The name of the engine to create. This must - * not be NULL. - * @param[in] remoteName The name of the remote server to load (if any). + * Engine_open() * - * @retval Engine_EINVAL Bad parameter passed. - * @retval Engine_EINUSE An engine with the given name already exists. + * @param[in] pDesc The handle of an Engine Descriptor object. + * Before setting the fields of pDesc, it must + * first be initialized with @c Engine_initDesc(). + * + * @retval Engine_EINVAL Bad parameter passed, such as @c pDesc = NULL, + * or @c pDesc->name = NULL. + * @retval Engine_EINUSE An engine with the name @c pDesc->name already + * exists. * @retval Engine_ENOMEM A memory allocation failed. * @retval Engine_EOK Success. * @@ -358,63 +579,154 @@ * previously been called. * * @post If the return value is Engine_EOK, Engine_open() can be - * called with @c engineName. + * called with @c pDesc->name. + * + * @par Example Usage: + * @code + * #include + * + * Engine_Desc desc; + * + * Engine_initDesc(&desc); + * + * desc.name = "myEngine"; + * desc.remoteName = "myServer.x64P"; + * Engine_add(&desc); + * @endcode * * @sa Engine_remove() + * @sa Engine_open() */ -extern Engine_Error Engine_add(String engineName, String remoteName); +extern Engine_Error Engine_add(Engine_Desc *pDesc); /* * ======== Engine_addAlg ======== */ /** - * @brief Dynamically add an algorithm to an Engine instance. + * @brief Dynamically add an algorithm to an Engine. * - * @param[in] engine The handle to an engine, previously acquired - * by a call to Engine_open(). + * @remarks If the Engine has not been opened, the name of the Engine is + * used, otherwise, a handle to the opened Engine. If the Engine + * has been opened, the added alg will only be accessible to the + * caller of this function. Either one or the other, but not + * both, of @c name and @c engine should be non-NULL. + * + * @param[in] name The name of the engine. @c name is + * specified in the engine configuration, or + * the name of an engine added with + * @c Engine_add(). This can only be non-NULL if + * the engine is not opened, otherwise, use + * an engine handle and set @c name to NULL. + * @param[in] engine The handle of an engine returned by + * Engine_open(). If @c engine is non-NULL, set + * @c name to NULL. * @param[in] location String identifying the location of the * algorithm. Often this is a file name, but for * systems without a file system, it may be a - * system-specific string identifier. - * @param[in] pAlgParams Parameters describing the algorithm being - * added. + * system-specific string identifier. This may + * be NULL if the algorithm is built into the + * executable. + * @param[in] pAlgDesc Parameters describing the algorithm being + * added. Before setting the fields of this + * structure, it should first be initialized + * with @c Engine_initAlgDesc(), to set all + * fields to default values. + * If location is non-NULL (a dynamic library), + * then the following fields of pAlgDesc must + * be specified: + * pAlgDesc->name + * pAlgDesc->isLocal + * pAlgDesc->groupId + * All other Engine_AlgDesc fields will be + * from the dynamic library. + * If location is NULL (not a dynamic library), + * the user must set the following fields of + * pAlgDesc: + * pAlgDesc->name + * pAlgDesc->fxns + * pAlgDesc->idmaFxns, if applicable + * pAlgDesc->iresFxns, if applicable + * pAlgDesc->isLocal + * pAlgDesc->groupId + * pAlgDesc->types + * + * @pre As with all Codec Engine API's, CERuntime_init() must have + * previously been called. * * @pre @c engine is a valid (non-NULL) engine handle which is * in the open state. * - * @remarks This API is not yet supported. - * * @remarks If there is an existing algorithm in the engine already named * @c name, an error will be returned. * * @retval Engine_EOK Success. - * @retval Engine_EINUSE @c attrs.name is in use. + * @retval Engine_EINUSE The Engine @c name is non-NULL, and the + * Engine is open. + * @retval Engine_EINVAL @c pAlgDesc or @c pAlgDesc->name is NULL. + * @retval Engine_EINVAL Both @c name and @c engine are NULL. Ensure + * one of these is non-NULL. + * @retval Engine_EINVAL Both @c name and @c engine are non-NULL. + * Ensure that one of these is NULL. + * @retval Engine_EEXIST There is no engine with the given name. + * @retval Engine_EINUSE The name of the alg in @c pAlgDesc->name is + * already in use. + * @par Example Usage: + * @code + * #include + * + * Engine_AlgDesc desc; + * + * Engine_initAlgDesc(&desc); * + * desc.groupId = 2; + * desc.isLocal = TRUE; + * desc.fxns = &UNIVERSALCOPY_TI_IUNIVERSALCOPY; + * desc.idmaFxns = NULL; + * desc.iresFxns = NULL; + * desc.memType = Engine_USECACHEDMEM_DEFAULT; + * desc.types = UNIVERSAL_VISATYPE; + * + * status = Engine_addAlg("myEngine", NULL, NULL, &desc); + * + * @endcode + * + * @sa Engine_initAlgDesc() * @sa Engine_open() * @sa Engine_removeAlg() */ -extern Engine_Error Engine_addAlg(Engine_Handle engine, - String location, Engine_DllAlgParams *pAlgParams); +extern Engine_Error Engine_addAlg(String name, Engine_Handle engine, + String location, Engine_AlgDesc *pAlgDesc); /* * ======== Engine_removeAlg ======== */ /** - * @brief Dynamically remove an algorithm from an Engine instance. + * @brief Dynamically remove an algorithm that was added to an Engine + * with Engine_addAlg(). * - * @param[in] engine The handle to an engine, previously acquired - * by a call to Engine_open(). - * @param[in] name Name of the algorithm to remove. + * @remarks The same values of the parameters @c name and @c engine that + * were passed to Engine_addAlg() should be used here. In + * particular, if @c name was used to add the alg, all handles to + * the engine must be closed before calling Engine_removeAlg(). * - * @remarks This API is not yet supported. * - * @retval Engine_EOK Success. - * @retval Engine_ENOTFOUND @c name could not be found in @c engine. + * @param[in] name The name of the engine or NULL, that was + * passed to Engine_addAlg(). + * @param[in] engine The handle to an engine, previously acquired + * by a call to Engine_open(), or NULL, that was + * used in Engine_addAlg(). + * @param[in] algName Name of the algorithm to remove. + * + * @retval Engine_EOK Success. + * @retval Engine_EEXIST The engine @c name does not exist. + * @retval Engine_ENOTFOUND @c algName could not be found in @c engine. + * @retval Engine_EINUSE The Engine @c name is still open. * * @sa Engine_open() * @sa Engine_addAlg() */ -extern Engine_Error Engine_removeAlg(Engine_Handle engine, String name); +extern Engine_Error Engine_removeAlg(String name, Engine_Handle engine, + String algName); /** @cond INTERNAL */ @@ -444,18 +756,19 @@ * ======== Engine_close ======== */ /** - * @brief Close an Engine. + * @brief Close an Engine * * @param[in] engine The handle to an engine, previously acquired * by a call to Engine_open(). * - * @pre @c engine must not be referenced by any codec instance - * object; i.e., you must first delete all codec instances + * @pre @c engine must not be referenced by any algorithm instance + * objects; i.e., you must first delete all algorithm instances * associated with @c engine before closing it. * * @pre @c engine is a valid (non-NULL) engine handle which is * in the open state. * + * @sa Engine_open() */ extern Void Engine_close(Engine_Handle engine); @@ -464,7 +777,7 @@ * ======== Engine_createNode ======== */ /** - * @brief Create a remote algorithm. + * @brief Create a remote algorithm * * @param[in] engine The handle to an engine, previously acquired * by a call to Engine_open(). @@ -496,7 +809,7 @@ * ======== Engine_createNode2 ======== */ /** - * @brief Create a remote algorithm. + * @brief Create a remote algorithm * * @param[in] engine The handle to an engine, previously acquired * by a call to Engine_open(). @@ -511,7 +824,7 @@ * @pre @c engine is a valid (non-NULL) engine handle which is * in the open state. * - * @remark Engine_createNode() is the preferred method to create remote + * @remarks Engine_createNode() is the preferred method to create remote * algorithms. However, some algorithm interfaces incorrectly * fail to provide a size field of type "Int" as the first field * in their creation parameters, which the XDAIS spec defines. @@ -539,7 +852,7 @@ * ======== Engine_getAlgMemRecs ======== */ /** - * @brief Get the IALG_MemRecs used by an algorithm. + * @brief Get the IALG_MemRecs used by an algorithm * * @param[in] node Handle to an algorithm instance. * @param[out] memTab Location to store the IALG_MemRecs. @@ -558,7 +871,7 @@ * ======== Engine_getAlgNumRecs ======== */ /** - * @brief Get the number of IALG_MemRecs used by a remote algorithm. + * @brief Get the number of IALG_MemRecs used by a remote algorithm * * @param[in] node Handle to an algorithm instance. * @param[out] numRecs Location to store the number of IALG_MemRecs used. @@ -579,8 +892,9 @@ /* * ======== Engine_getFxns ======== */ -extern IALG_Fxns *Engine_getFxns(Engine_Handle svr, String name, - String type, Bool *isLocal, Ptr *idmaFxns, Ptr *iresFxns, Int *groupId); +extern IALG_Fxns *Engine_getFxns(Engine_Handle svr, String name, String type, + Bool *isLocal, Ptr *idmaFxns, Ptr *iresFxns, Int *groupId, + Engine_CachedMemType *memType); /* * ======== Engine_getMemId ======== @@ -609,6 +923,16 @@ extern Engine_Error Engine_getNumMemSegs(Server_Handle server, Int *numSegs); /* + * ======== Engine_getNumEngines ======== + */ +extern Int Engine_getNumEngines(); + +/* + * ======== Engine_getProcId ======== + */ +extern String Engine_getProcId(Engine_Handle engine); + +/* * ======== Engine_hasServer ======== */ extern Bool Engine_hasServer(Engine_Handle engine); @@ -618,6 +942,66 @@ */ extern Void Engine_init(Void); + +/** @endcond */ + +/* + * ======== Engine_initAlgDesc ======== + */ +/** + * @brief Initialize an Engine_AlgDesc structure with default values. + * + * @param[in] pAlgDesc Location of Engine_AlgDesc object to initialize. + * The fields of pAlgDesc will be set to the following: + * + * pAlgDesc->name = NULL; + * pAlgDesc->uuid.data = 0; + * pAlgDesc->fxns = NULL; + * pAlgDesc->idmaFxns = NULL; + * pAlgDesc->typeTab = NULL; + * pAlgDesc->isLocal = TRUE; + * pAlgDesc->groupId = 0; + * pAlgDesc->rpcProtocolVersion = 0; + * pAlgDesc->iresFxns = NULL; + * pAlgDesc->codecClassConfig = NULL; + * pAlgDesc->memType = Engine_USECACHEDMEM_DEFAULT; + * pAlgDesc->types = NULL; + * + * @sa Engine_addAlg() + */ +extern Void Engine_initAlgDesc(Engine_AlgDesc *pAlgDesc); + +/* + * ======== Engine_initAttrs ======== + */ +/** + * @brief Initialize an Engine_Attrs structure with default values. + * + * @param[in] pAttrs Location of Engine_Attrs object to initialize. + * + * @sa Engine_open() + */ +extern Void Engine_initAttrs(Engine_Attrs *pAttrs); + +/* + * ======== Engine_initDesc ======== + */ +/** + * @brief Initialize an Engine_Desc structure with default values. + * + * @param[in] pDesc Location of Engine_Desc object to initialize. + * The fields of pDesc will be set to the following: + * + * pDesc->name = NULL; + * pDesc->remoteName = NULL; + * pDesc->heapId = 0; + * + * @sa Engine_add() + */ +extern Void Engine_initDesc(Engine_Desc *pDesc); + +/** @cond INTERNAL */ + /* * ======== Engine_getRemoteVisa ======== */ @@ -634,6 +1018,13 @@ */ extern Void Engine_getNodeQueues(Engine_Node node, Comm_Id *stdIn, Comm_Handle *stdOut); + +/* + * ======== Engine_initFromServer ======== + */ +extern Engine_Error Engine_initFromServer(Engine_Handle engine); + + /* * ======== Engine_redefineHeap ======== */ @@ -661,14 +1052,14 @@ * ======== Engine_open ======== */ /** - * @brief Open an Engine. + * @brief Open an Engine * - * The handle returned may be used to create one or more instances of a codec - * "contained" in the specified engine. + * The handle returned may be used to create one or more instances of an + * algorithm contained in the specified Engine. * - * An engine may be opened more than once; each open returns a unique - * handle that can be used to create codec instances or get status of any - * underlying server. + * An Engine may be opened more than once; each open returns a unique + * handle that can be used to create algorithm instances or get status of the + * Engine. * * Engine handles must not be concurrently accessed by multiple threads; each * thread must either obtain its own handle (via Engine_open()) or explicitly @@ -701,9 +1092,13 @@ * - #Engine_ENOCOMM can't create a comm connection to DSP * - #Engine_ENOSERVER can't locate the server on the DSP * - #Engine_ECOMALLOC can't allocate communication buffer + * + * @sa Engine_close() + * @sa Engine_add() + * @sa Engine_remove() */ extern Engine_Handle Engine_open(String name, Engine_Attrs *attrs, - Engine_Error *ec); + Engine_Error *ec); /* * ======== Engine_fwriteTrace ======== @@ -739,7 +1134,7 @@ * ======== Engine_getAlgInfo ======== */ /** - * @brief Get details of an algorithm configured into an engine. + * @brief Get details of an algorithm configured into an engine * * @param[in] name The name of the engine. @c name is * specified in the engine configuration. @@ -770,12 +1165,68 @@ * @c algInfo will contain the information for the engine's * ith (i = @c index) algorithm. * - * @sa Engine_getNumAlgs(). + * @sa Engine_getNumAlgs() */ extern Engine_Error Engine_getAlgInfo(String name, Engine_AlgInfo *algInfo, Int index); /* + * ======== Engine_getAlgInfo2 ======== + */ +/** + * @brief Get details of an algorithm. + * + * @param[in] name The name of the engine. @c name is + * specified in the engine configuration. This + * may be NULL if @c engine contains a valid + * engine handle. + * @param[in] engine The handle of an engine returned by Engine_open(). + * If this is NULL, only information for a static + * alg can be obtained. + * @param[out] algInfo2 Structure to store algorithm details. The + * @c algInfoSize field of this structure must + * be set to @c sizeof(Engine_AlgInfo2) by the + * application. + * @param[out] index The index of the algorithm to get the information. + * + * @retval Engine_EOK Success. + * @retval Engine_EEXIST There is no engine with the given name. + * @retval Engine_ENOTFOUND @c index is greater than or equal to the + * total number of algorithms configured for + * the engine, or @c index < 0. + * @retval Engine_EINVAL The value of @c algInfoSize passed to this + * function does not match the CE library's + * @c sizeof(Engine_AlgInfo2). + * + * @pre @c name is a non-NULL string or @c engine is non-NULL. + * + * @pre @c algInfo2 is non-NULL. + * + * @pre As with all Codec Engine API's, CERuntime_init() must have + * previously been called. + * + * @post If @c name is a valid engine name and 0 <= @c index < the + * total number of algorithms configured for the engine, then + * @c algInfo2 will contain the information for the engine's + * ith (i = @c index) algorithm. + * + * @remarks This service supports algorithms statically configured into + * an Engine at build/config time, or algorithms that have been + * dynamically added to an opened engine. If the Engine has not + * been opened yet, the name of the Engine is used to get the + * statically configured alg. If the Engine has been opened, the + * Engine handle can be used to get either information for a + * statically configured alg, or a remote alg that was added when + * the server was queried during Engine_open(). + * + * @sa Engine_getNumAlgs2(). + */ +extern Engine_Error Engine_getAlgInfo2(String name, Engine_Handle engine, + Engine_AlgInfo2 *algInfo2, Int index); + + +/** @cond INTERNAL */ +/* * ======== Engine_getCpuLoad ======== */ /** @@ -808,6 +1259,39 @@ */ extern Int Engine_getCpuLoad(Engine_Handle engine); +/** @endcond */ + + +/* + * ======== Engine_getDesc ======== + */ +/** + * @brief Fill in an Engine_Desc structure with the values of the + * Engine descriptor for an Engine. + * + * @param[in] name The name of the Engine. @c name is + * specified in the engine configuration or a + * a name that was passed to @c Engine_add(). + * @param[out] desc The structure where the descriptor of the + * Engine specified by @c name will be copied to. + * + * @retval Engine_EOK Success. + * @retval Engine_EEXIST There is no engine with the given name. + * + * @pre @c name is a non-NULL string. + * + * @pre @c desc is non-NULL. + * + * @pre As with all Codec Engine API's, CERuntime_init() must have + * previously been called. + * + * @post If @c name is a valid engine name, then desc will contain + * the descriptor of the engine @c name. + * + * @sa Engine_setDesc(). + */ +extern Engine_Error Engine_getDesc(String name, Engine_Desc *desc); + /* * ======== Engine_getLastError ======== */ @@ -819,6 +1303,9 @@ * @retval error code (Engine_Error) of the last failed * engine operation. * + * @pre As with all Codec Engine API's, CERuntime_init() must have + * previously been called. + * * @pre @c engine is a valid (non-NULL) engine handle and the engine * is in the open state. */ @@ -828,10 +1315,13 @@ * ======== Engine_getName ======== */ /** - * @brief Get the name of an opened engine. + * @brief Get the name of an opened engine * * @param[in] engine The handle to the opened engine. * + * @pre As with all Codec Engine API's, CERuntime_init() must have + * previously been called. + * * @retval NULL An error has occurred. * @retval non-NULL The name of the opened engine. */ @@ -842,9 +1332,9 @@ * ======== Engine_getNumAlgs ======== */ /** - * @brief Get the number of algorithms configured into an engine. + * @brief Get the number of algorithms configured into an Engine * - * @param[in] name The name of the engine. @c name is + * @param[in] name The name of the Engine. @c name is * specified in the engine configuration. * @param[out] numAlgs The number of algorithms that are configured * in the given engine. @@ -867,10 +1357,56 @@ extern Engine_Error Engine_getNumAlgs(String name, Int *numAlgs); /* + * ======== Engine_getNumAlgs2 ======== + */ +/** + * @brief Get the number of algorithms statically configured into an engine + * or the total number of algorithms both statically configured and + * dynamically added through server information when the engine was + * opened. + * + * @param[in] name The name of the engine. @c name is + * specified in the engine configuration. @c name + * can be NULL, if @c engine is a valid + * Engine_Handle. + * @param[in] engine The handle of an engine returned by + * Engine_open(). If @c engine is NULL, @c name + * must be non-NULL, and only the number of + * statically configured algorithms will be + * returned in @c numAlgs. + * specified in the engine configuration. + * @param[out] numAlgs The number of algorithms that are configured + * in the given engine. + * + * @retval Engine_EOK Success. + * @retval Engine_EEXIST There is no engine with the given name. + * + * @pre @c name is a non-NULL string or @c engine is non-NULL. + * + * @pre @c numAlgs is non-NULL. + * + * @pre As with all Codec Engine API's, CERuntime_init() must have + * previously been called. + * + * @post If @c name is a valid engine name, then numAlgs will contain + * the number of algorithms configured for the given engine. + * + * @remarks If the engine has a server, but was not configured with + * Engine.createFromServer() number of remote algorithms (if any) + * that were statically configured into the engine, will be + * counted twice: once for the static alg table, and once for + * the information queried from the server. + * + * @sa Engine_getAlgs(). + */ +extern Engine_Error Engine_getNumAlgs2(String name, Engine_Handle engine, + Int *numAlgs); + +/* * ======== Engine_getServer ======== */ /** - * @brief Get handle to an Engine's server. + * @brief Get handle to an Engine's Server * * This function returns the handle to an Engines server, that can be used * with Server APIs to obtain information from and control the remote DSP @@ -880,6 +1416,9 @@ * * @retval Handle to engine's server. * + * @pre As with all Codec Engine API's, CERuntime_init() must have + * previously been called. + * * @pre @c engine is a valid (non-NULL) engine handle and the engine * is in the open state. */ @@ -890,7 +1429,7 @@ * ======== Engine_getUsedMem ======== */ /** - * @brief Get Server's total memory usage + * @brief Get Server's total memory usage * * @deprecated This service has been replaced by Server_getMemStat() * to better indicate that this API is not intended for @@ -905,6 +1444,9 @@ * available, 0 is returned and the reason can be retrieved via * Engine_getLastError(). * + * @pre As with all Codec Engine API's, CERuntime_init() must have + * previously been called. + * * @pre @c engine is a valid (non-NULL) engine handle and the engine * is in the open state. * @@ -922,10 +1464,13 @@ * ======== Engine_remove ======== */ /** - * @brief Remove an engine from the list of engines that can be opened. + * @brief Remove an engine from the list of engines that can be opened * * @param[in] engineName The name of the engine to be removed. * + * @pre As with all Codec Engine API's, CERuntime_init() must have + * previously been called. + * * @pre @c engineName is non-NULL. * * @retval Engine_EINUSE The engine cannot be removed because @@ -939,10 +1484,53 @@ /* + * ======== Engine_setDesc ======== + */ +/** + * @brief Set values for an Engine's descriptor. This function should + * only be called when the Engine has not yet been opened. + * + * @param[in] name The name of the Engine. @c name is + * specified in the engine configuration or a + * a name that was passed to @c Engine_add(). + * @param[in] desc The structure where descriptor values for the + * Engine specified by @c name will be copied + * from. + * + * @retval Engine_EOK Success. + * @retval Engine_EEXIST There is no engine with the given name. + * @retval Engine_EINUSE The Engine @c name has already been opened. + * + * @pre @c name is a non-NULL string. + * + * @pre @c desc is non-NULL. + * + * @pre As with all Codec Engine API's, CERuntime_init() must have + * previously been called. + * + * @post If @c name is a valid engine name, then the desscriptor for + * the engine @c name will have been updated with values from + * @c desc. + * + * @remarks Use @c Engine_getDesc() to fill in the descriptor, override + * the fields you want to change, and then pass the descriptor + * to Engine_setDesc(). + * Only the following fields of the Engine_Desc are allowed to + * be modified: + * @c memMap + * @c useExtLoader + * @c heapId + * + * @sa Engine_getDesc(). + */ +extern Engine_Error Engine_setDesc(String name, Engine_Desc *desc); + + +/* * ======== Engine_setTrace ======== */ /** - * @brief Set Server's trace mask + * @brief Set Server's trace mask * * @param[in] engine The handle to the opened engine. * @param[in] mask Trace mask, e.g. "*=01234567" @@ -951,6 +1539,9 @@ * @retval Engine_EINUSE Trace resource is already in use. * @retval Engine_ERUNTIME Internal runtime error has occurred. * + * @pre As with all Codec Engine API's, CERuntime_init() must have + * previously been called. + * * @pre @c engine is a valid (non-NULL) engine handle and the engine * is in the open state. * @@ -958,12 +1549,21 @@ * the trace mask for the application-side of the framework, * use Diags_setMask(), or Diags_setMaskMeta(). * - * @todo What happens to this fxn with the move from GT to Log? - * * @sa xdc.runtime.Diags */ extern Int Engine_setTrace(Engine_Handle engine, String mask); + +/** @cond INTERNAL */ + +/* + * ======== Engine_getDesc ======== + * Internal for testing. + */ +extern Engine_Desc *_Engine_getDesc(Int i); + +/** @endcond */ + /*@}*/ #ifdef __cplusplus @@ -972,6 +1572,7 @@ #endif /* - * @(#) ti.sdo.ce; 1, 0, 6,403; 7-27-2010 22:02:15; /db/atree/library/trees/ce/ce-q08x/src/ + * @(#) ti.sdo.ce; 1, 0, 6,1; 8-14-2012 12:59:44; /db/atree/library/trees/ce/ce-u07/src/ xlibrary + */ diff -Nru dce-1.6.5.4/packages/codec_engine/ti/sdo/ce/Server.h dce-1.6.7.3/packages/codec_engine/ti/sdo/ce/Server.h --- dce-1.6.5.4/packages/codec_engine/ti/sdo/ce/Server.h 2012-09-24 15:13:39.000000000 +0000 +++ dce-1.6.7.3/packages/codec_engine/ti/sdo/ce/Server.h 2012-11-28 09:54:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Texas Instruments Incorporated + * Copyright (c) 2012, Texas Instruments Incorporated * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -54,6 +54,11 @@ extern "C" { #endif + +#include +#include +#include + #include /* def of FILE * */ /** @ingroup ti_sdo_ce_Server */ @@ -74,12 +79,6 @@ */ #define Server_MAXSEGNAMELENGTH 32 - -/** - * @brief Opaque handle to the server for an engine. - */ -typedef struct Server_Obj *Server_Handle; - /** * @brief Server error code */ @@ -91,12 +90,174 @@ Server_EINVAL = 4, /**< Bad value passed to function. */ Server_EWRONGSTATE =5, /**< Server is not in the correct state to * execute the requested function. */ - Server_EINUSE = 6, /**< Server call did not succeed because a + Server_EINUSE = 6, /**< Server call did not succeed because a * because a required resource is in use. */ Server_ENOTFOUND = 7, /**< An entity was not found */ - Server_EFAIL = 8 /**< Unknown failure */ + Server_EFAIL = 8, /**< Unknown failure */ + Server_ENOTSUPPORTED = 9 /**< API not supported for given parameters. */ } Server_Status; +/* + * ======== Server_AlgDesc ======== + */ +typedef struct Server_AlgDesc { + /** + * @brief The name of the algorithm. This is used by the application + * when instantiating an instance of the algorithm through one + * of the VISA APIs. + */ + String name; + + /** + * @brief The address of the XDAIS alg function table. + * + * @remarks + * All XDAIS algorithms must define an IALG_Fxns structure that + * contains implementations of the IALG methods. This field + * is simply the address of this structure. + */ + IALG_Fxns *fxns; + + /** + * @brief The address of the IDMA3_Fxns function table, if the algorithm + * uses DMA. If the algorithm does not use DMA, this field should + * set to NULL. Valid for local algorithm only. + */ + Ptr idmaFxns; + + /** + * @brief If true, the algorithm will be instantiated on the + * "local" CPU. Otherwise the server will create an + * instance of the algorithm. + */ + Bool isLocal; + + /** + * @brief This id specifies which resource sharing group that this + * alg will be placed into. + * + * @remarks + * This 'group' concept is used by the framework for sharing + * resources. Algorithms in the same group share resources, and + * therefore, must not run at the same time. If you assign the + * same groupId to multiple algorithms, these algorithms must + * not pre-empt eachother, or the shared resources may be + * corrupted. + * When server algorithms are configured statically in a .cfg + * file, if the @c groupId parameter for the algorithm has + * not been set, the configuration process assigns the @c groupId + * will be assigned automatically, based on the priority that + * the algorithm will run at. However, when Server_addAlg() is + * used to dynamically add the algorithm to the server, you must + * ensure that the @c groupId is appropriately. If two algorithms + * will run at the same time, you must assign them different + * group Ids. + * + * Algorithms in different groups do not share resources. + * + * @sa http://processors.wiki.ti.com/index.php/Codec_Engine_GroupIds + */ + Int groupId; + + /** + * @brief Address of the XDAIS alg IRES Interface function table. + * + * @remarks + * All XDAIS algorithms that use an IRES resource must define an + * IRES_Fxns structure containing the pointers to functions + * implementatng the IRES interface. + * If the algorithm does not use an IRES resource this field + * should be set to NULL. + */ + Ptr iresFxns; + + /* + * Currently not used. + * Codec class configuration data for stub side, if any. We + * generate this structure for both sides, although it is + * currently only used in the skeletons. + */ + Void *stubsCodecClassConfig; + + /** + * @brief Codec class configuration data, if any. + */ + Void *codecClassConfig; + + /* + * Currently not used. + * Indicates the type of memory the alg's memory requests will + * be allocated from. + * The alg's memory will be allocated from cached memory, if + * memType = Engine_USECACHEDMEM_CACHED, + * from non-cached memory, if + * memType = Engine_USECACHEDMEM_NONCACHED, + * Otherwise, if + * memType = Engine_USECACHEDMEM_DEFAULT, + * memory allocations will be determined by the value of + * ti_sdo_ce_alg_Algorithm_useCache (cached, if TRUE, non-cached, + * if FALSE). + * + * @sa Engine_CachedMemType + */ + Engine_CachedMemType memType; /**< Memory type for alg's mem reqs. */ + + /** + * @brief A string idicating the type(s) of algorithm this is. + * This should be a ';' separated string of inherited types. + * + * @remarks + * In most cases, @c types will just be set to the VISA type + * defined in the Codec Engine algorithm interface header + * file included by the algorithm, depending on the XDM interface + * the algorithm implements. + * + * For example, if the algorithm implements the ISPHDEC1 + * interface as defined by XDM, @c types should be set + * to + * @c SPHDEC1_VISATYPE + * (defined as "ti.sdo.ce.speech1.ISPHDEC1" in the header file + * ti/sdo/ce/speech1/sphdec1.h). + * + * Another example to illustrate multiple typss specified in + * @c typss, if the algorithm implements the (made-up) + * interface, ti.sdo.ce.test.xvideo.IVIDE, which in turn + * implements the IVIDDEC interface, we could then set @c types + * to + * VIDDEC_VISATYPE";ti.sdo.ce.test.xvideo.IVIDE" + * or + * "ti.sdo.ce.test.xvideo.IVIDE;"VIDDEC_VISATYPE + */ + String types; + + /** + * @brief A string idicating the name of the stub functions. This is + * needed by remote apps that call Engine_initFromServer(). + */ + String stubFxnsName; + + /** + * @brief The skel functions needed to invoke the alg remotely + */ + SKEL_Fxns *skelFxns; + + /** + * @brief The priority the alg will run at. + */ + Int priority; + + /** + * @brief Algorithm stack size. + */ + Int stackSize; + + /* + * Currently not used. + * Memory heap for algorithm stack. + */ + Int stackSeg; +} Server_AlgDesc; + /** * @brief Information for a memory heap of a remote DSP server. * @@ -112,6 +273,109 @@ Uint32 maxBlockLen; /**< Length of the largest contiguous free block. */ } Server_MemStat; + +/* + * ======== Server_addAlg ======== + */ +/** + * @brief Dynamically add an algorithm to a Server. + * + * @param[in] server The handle of a server returned by + * Engine_getServer(). Set to NULL when adding + * a local algorithm to the server. In the + * future, this handle will be used to + * dynamically add algorithms to a remote server. + * @param[in] location String identifying the location of the + * algorithm. Often this is a file name, but for + * systems without a file system, it may be a + * system-specific string identifier. This may + * be NULL if the algorithm is built into the + * executable. Currently not supported - set to + * NULL. + * @param[in] pAlgDesc Parameters describing the algorithm being + * added. Before setting the fields of this + * structure, it should first be initialized + * with @c Server_initAlgDesc(), to set all + * fields to default values. + * + * The user must set the following fields of + * pAlgDesc: + * pAlgDesc->name + * pAlgDesc->fxns + * pAlgDesc->idmaFxns, if applicable + * pAlgDesc->iresFxns, if applicable + * + * pAlgDesc->groupId + * pAlgDesc->priority + * pAlgDesc->stackSize + * + * pAlgDesc->types + * pAlgDesc->stubFxnsName + * pAlgDesc->skelFxns + * + * Currently, adding only local algorithms is + * supported, so the default value of TRUE can + * be used for: + * pAlgDesc->isLocal + * + * @pre As with all Codec Server API's, CERuntime_init() must have + * previously been called. + * + * @remarks If adding a local algorithm to a server that is built with + * BIOS, this function must be called after CERuntime_init() + * has been called, but before BIOS_start(). This is necessary + * to ensure that the algorithm will be visible to the remote + * app that loaded the server. + * + * @remarks If adding a remote algorithm to a remote server, the server + * handle for the opened Engine must be used. The server handle + * is obtained by calling Engine_getServer() with the handle of + * the opened engine. + * In this case, the added algorithm will only be accessible to + * the caller of this function. + * Adding a remote algorithm is not yet supported. + * + * @remarks If there is an existing algorithm in the server already named + * @c name, an error will be returned. + * + * @retval Server_EOK Success. + * @retval Server_EINVAL @c pAlgDesc or @c pAlgDesc->name is NULL. + * @retval Server_EINUSE The name of the alg in @c pAlgDesc->name is + * already in use. + * @retval Server_ENOTSUPPORTED @c pAlgDesc->isLocal = FALSE is currently + * not supported. + * + * @par Example Usage: + * @code + * #include + * + * Server_AlgDesc desc; + * + * Server_initAlgDesc(&desc); + * + * desc.groupId = 2; + * desc.isLocal = TRUE; + * desc.fxns = &UNIVERSALCOPY_TI_IUNIVERSALCOPY; + * desc.idmaFxns = NULL; + * desc.iresFxns = NULL; + * desc.priority = 2; + * desc.stackSize = 0x2000; + * desc.types = UNIVERSAL_VISATYPE; + * desc.stubFxnsName = "UNIVERSAL_STUBS"; + * desc.skelFxns = &UNIVERSAL_SKEL; + * + * status = Server_addAlg(NULL, NULL, &desc); + * + * @endcode + * + * @sa Server_AlgDesc + * @sa Server_initAlgDesc() + * @sa Engine_getServer() + */ +extern Server_Status Server_addAlg(Server_Handle server, String location, + Server_AlgDesc *pAlgDesc); + + /* * ======== Server_connectTrace ======== */ @@ -236,6 +500,9 @@ * heap @c segNum on the DSP. * * @sa Server_getNumMemSegs(). + * + * @remarks This API only returns statistics for BIOS HeapMem heaps + * that have been statically configured into the server. */ extern Server_Status Server_getMemStat(Server_Handle server, Int segNum, Server_MemStat *memStat); @@ -249,8 +516,9 @@ * @param[in] server Server handle obtained from Engine_getServer(). * @param[out] numSegs The number of heap segments of the DSP server. * - * @retval Server_EOK Success. - * @retval Server_ERUNTIME Internal runtime error occurred. + * @retval Server_EOK Success. + * @retval Server_ERUNTIME Internal runtime error occurred. + * @retval Server_ENOSERVER Engine has no server. * * @pre @c server is non-NULL. * @pre @c numSegs is non-NULL. @@ -259,6 +527,9 @@ * on the DSP. * * @sa Server_getMemStat(). + * + * @remarks This API returns only the number of BIOS HeapMem heaps that + * have been statically configured into the server. */ extern Server_Status Server_getNumMemSegs(Server_Handle server, Int *numSegs); @@ -270,11 +541,49 @@ /** @endcond */ /* + * ======== Server_initAlgDesc ======== + */ +/** + * @brief Initialize an Server_AlgDesc structure with default values. + * + * @param[in] pAlgDesc Location of Server_AlgDesc object to initialize. + * The fields of pAlgDesc will be set to the following: + * @code + * pAlgDesc->name = NULL; + * pAlgDesc->uuid.data = 0; + * pAlgDesc->fxns = NULL; + * pAlgDesc->idmaFxns = NULL; + * pAlgDesc->typeTab = NULL; + * pAlgDesc->isLocal = TRUE; + * pAlgDesc->groupId = 0; + * pAlgDesc->iresFxns = NULL; + * pAlgDesc->codecClassConfig = NULL; + * pAlgDesc->priority = 1; + * pAlgDesc->stackSize = 1024; + * pAlgDesc->types = NULL; + * pAlgDesc->stubFxnsName = NULL; + * pAlgDesc->skelFxns = NULL; + * + * Unused fields below are initialized to the + * following: + * + * pAlgDesc->rpcProtocolVersion = 0; + * pAlgDesc->memType = Engine_USECACHEDMEM_DEFAULT; + * pAlgDesc->stackSeg = 0; + * + * @endcode + * + * @sa Server_addAlg() + */ +extern Void Server_initAlgDesc(Server_AlgDesc *pAlgDesc); + +/* * ======== Server_redefineHeap ======== */ /** * @brief Set the base address and size of a remote DSP server heap. * + * @remarks * This API is used to move and/or resize a named heap of the remote DSP * server. The address passed to this API is a DSP address and the * memory from @c base to @c base + @c size must be contiguous in physical @@ -321,10 +630,54 @@ * set to @c base, and the size will have been set to @c size. * * @sa Server_restoreHeap(). + * + * @remarks This API is not supported in Codec Engine 3.20. */ extern Server_Status Server_redefineHeap(Server_Handle server, String name, Uint32 base, Uint32 size); +#if 0 +/* + * ======== Server_removeAlg ======== + */ +/* + * Currently not implemented. + * + * @brief Dynamically remove an algorithm that was added to a Server + * with Server_addAlg(). + * + * @remarks The same values of the parameters @c name and @c server that + * were passed to Server_addAlg() should be used here. In + * particular, if @c name was used to add the alg, all handles to + * the engine named @c name must be closed before calling + * Server_removeAlg(). + * + * + * @param[in] name The name of the engine or NULL, that was + * passed to Server_addAlg(). Set to NULL for now. + * Currently, only the default "local" engine is + * supported. + * @param[in] server The handle to a server, previously acquired + * by a call to Engine_getServer(), or NULL. + * Set to NULL for now. In the future, this will + * be used to dynamically remove remote + * algorithms from a server. + * @param[in] algName Name of the algorithm to remove. + * + * @retval Server_EOK Success. + * @retval Server_ENOTFOUND The server's underlying engine, @c name, + * does not exist. + * @retval Server_ENOTFOUND @c algName could not be found in the + * server's underlying engine table. + * @retval Server_EINUSE The server's underlying engine, @c name, + * is still open. + * + * @sa Server_addAlg() + */ +extern Server_Status Server_removeAlg(String name, Server_Handle server, + String algName); +#endif + /* * ======== Server_restoreHeap ======== */ @@ -358,6 +711,8 @@ * have been reset to their original value. * * @sa Server_redefineHeap(). + * + * @remarks This API is not supported in Codec Engine 3.20. */ extern Server_Status Server_restoreHeap(Server_Handle server, String name); @@ -395,6 +750,7 @@ #endif /* - * @(#) ti.sdo.ce; 1, 0, 6,403; 7-27-2010 22:02:16; /db/atree/library/trees/ce/ce-q08x/src/ + * @(#) ti.sdo.ce; 1, 0, 6,1; 8-14-2012 12:59:44; /db/atree/library/trees/ce/ce-u07/src/ xlibrary + */ diff -Nru dce-1.6.5.4/packages/codec_engine/ti/sdo/ce/ServerDefs.h dce-1.6.7.3/packages/codec_engine/ti/sdo/ce/ServerDefs.h --- dce-1.6.5.4/packages/codec_engine/ti/sdo/ce/ServerDefs.h 1970-01-01 00:00:00.000000000 +0000 +++ dce-1.6.7.3/packages/codec_engine/ti/sdo/ce/ServerDefs.h 2012-11-28 09:54:14.000000000 +0000 @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2012, Texas Instruments Incorporated + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of Texas Instruments Incorporated nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +/* + * ======== ServerDefs.h ======== + * Defs for Server module + */ + +/** + * @file ti/sdo/ce/ServerDefs.h + * + * @brief The Codec Engine Server Definitions. + */ +/** + * @addtogroup ti_sdo_ce_Server Codec Engine Server Interface + */ +#ifndef ti_sdo_ce_ServerDefs_ +#define ti_sdo_ce_ServerDefs_ + +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * @brief Opaque handle to the server for an engine. + */ +typedef struct Server_Obj *Server_Handle; + + +/*@}*/ /* ingroup */ + +#ifdef __cplusplus +} +#endif + +#endif +/* + * @(#) ti.sdo.ce; 1, 0, 6,1; 8-14-2012 12:59:44; /db/atree/library/trees/ce/ce-u07/src/ xlibrary + + */ + diff -Nru dce-1.6.5.4/packages/codec_engine/ti/sdo/ce/ipc/Comm.h dce-1.6.7.3/packages/codec_engine/ti/sdo/ce/ipc/Comm.h --- dce-1.6.5.4/packages/codec_engine/ti/sdo/ce/ipc/Comm.h 2012-09-24 15:13:39.000000000 +0000 +++ dce-1.6.7.3/packages/codec_engine/ti/sdo/ce/ipc/Comm.h 2012-11-28 09:54:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Texas Instruments Incorporated + * Copyright (c) 2012, Texas Instruments Incorporated * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -97,7 +97,6 @@ * (which require a header to maintain message control/transport information) */ typedef struct Comm_MsgHeader { -#if MESSAGEQ_ENABLED UInt32 reserved[2]; /* reserved[0] doubles as "next" in the linked list */ UInt32 size; /* UInt32 msgSize; */ UInt16 reserved1; /* UInt16 flags; */ @@ -108,16 +107,8 @@ UInt16 reserved6; /* UInt16 replyProc; */ UInt16 reserved7; /* UInt16 srcProc; */ UInt16 reserved8; /* UInt16 heapId; */ - UInt32 reserved9; /* UInt32 reserved; */ -#else - UInt32 reserved[2]; /* reserved[0] doubles as "next" in the linked list */ - UInt16 reserved1; /* UInt16 srcProcId; */ - UInt16 reserved2; /* UInt16 poolId; */ - UInt16 size; - UInt32 reserved3; /* UInt32 dstId; */ - UInt32 reserved4; /* UInt32 srcId; */ - UInt16 msgId; -#endif + UInt16 reserved9; /* UInt16 seqNum; */ + UInt32 reserved10; /* UInt32 reserved; */ } Comm_MsgHeader, *Comm_Msg; /* @@ -188,6 +179,12 @@ extern Comm_Id Comm_getId(Comm_Handle comm); /* + * ======== Comm_staticMsgInit ======== + * Initialize fields of a static Comm_Msg. + */ +extern Void Comm_staticMsgInit(Comm_Msg msg, UInt32 size); + +/* * ======== Comm_setSrcQueue ======== * Put id of sender queue into message */ @@ -227,6 +224,7 @@ #endif /* - * @(#) ti.sdo.ce.ipc; 2, 0, 1,150; 7-27-2010 21:29:41; /db/atree/library/trees/ce/ce-q08x/src/ + * @(#) ti.sdo.ce.ipc; 2, 0, 1,1; 8-14-2012 13:01:32; /db/atree/library/trees/ce/ce-u07/src/ xlibrary + */ diff -Nru dce-1.6.5.4/packages/codec_engine/ti/sdo/ce/node/node.h dce-1.6.7.3/packages/codec_engine/ti/sdo/ce/node/node.h --- dce-1.6.5.4/packages/codec_engine/ti/sdo/ce/node/node.h 2012-09-24 15:13:39.000000000 +0000 +++ dce-1.6.7.3/packages/codec_engine/ti/sdo/ce/node/node.h 2012-11-28 09:54:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Texas Instruments Incorporated + * Copyright (c) 2012, Texas Instruments Incorporated * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -198,6 +198,7 @@ #endif /* - * @(#) ti.sdo.ce.node; 1, 0, 0,395; 7-27-2010 22:15:26; /db/atree/library/trees/ce/ce-q08x/src/ + * @(#) ti.sdo.ce.node; 1, 0, 0,1; 8-14-2012 13:01:45; /db/atree/library/trees/ce/ce-u07/src/ xlibrary + */ diff -Nru dce-1.6.5.4/packages/codec_engine/ti/sdo/ce/skel.h dce-1.6.7.3/packages/codec_engine/ti/sdo/ce/skel.h --- dce-1.6.5.4/packages/codec_engine/ti/sdo/ce/skel.h 2012-09-24 15:13:39.000000000 +0000 +++ dce-1.6.7.3/packages/codec_engine/ti/sdo/ce/skel.h 2012-11-28 09:54:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Texas Instruments Incorporated + * Copyright (c) 2012, Texas Instruments Incorporated * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -97,6 +97,26 @@ SKEL_DESTROYFXN apiDestroy; /**< A skeleton's "destroy" API. */ } SKEL_Fxns; +/** @cond INTERNAL */ + +/** + * @brief Cache policies for managing i/o buffers. + */ +#define SKEL_LOCALBUFFERINVWB 0 +#define SKEL_WBINVALL 1 +#define SKEL_CACHENONE 2 + +/** + * @brief Cache policy that will be used by all skeletons for managing + * i/o buffers. This is auto-generated by Server.xdt. + */ +extern Int ti_sdo_ce_Server_skelCachingPolicy; + +#define SKEL_cachingPolicy ti_sdo_ce_Server_skelCachingPolicy + + +/** @endcond */ + /*@}*/ @@ -106,6 +126,7 @@ #endif /* _SKEL_ */ /* - * @(#) ti.sdo.ce; 1, 0, 6,403; 7-27-2010 22:02:17; /db/atree/library/trees/ce/ce-q08x/src/ + * @(#) ti.sdo.ce; 1, 0, 6,1; 8-14-2012 12:59:45; /db/atree/library/trees/ce/ce-u07/src/ xlibrary + */ diff -Nru dce-1.6.5.4/packages/codec_engine/ti/sdo/ce/video2/videnc2.h dce-1.6.7.3/packages/codec_engine/ti/sdo/ce/video2/videnc2.h --- dce-1.6.5.4/packages/codec_engine/ti/sdo/ce/video2/videnc2.h 2012-09-24 15:13:39.000000000 +0000 +++ dce-1.6.7.3/packages/codec_engine/ti/sdo/ce/video2/videnc2.h 2012-11-28 09:54:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Texas Instruments Incorporated + * Copyright (c) 2012, Texas Instruments Incorporated * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -77,6 +77,20 @@ /** + * @brief The VISA type + */ +#define VIDENC2_VISATYPE "ti.sdo.ce.video2.IVIDENC2" + +/** + * @brief Name of stub functions. Use this name when registering the + * VIDENC2_STUBS functions with Engine_addStubFxns. + * + * @sa Engine_addStubFxns + */ +#define VIDENC2_STUBSNAME "VIDENC2_STUBS" + + +/** * @brief Opaque handle to a VIDENC2 codec. */ typedef VISA_Handle VIDENC2_Handle; @@ -376,7 +390,7 @@ #endif /* - * @(#) ti.sdo.ce.video2; 1, 0, 3,172; 11-3-2010 22:21:40; /db/atree/library/trees/ce/ce-q16x/src/ xlibrary + * @(#) ti.sdo.ce.video2; 1, 0, 3,1; 8-14-2012 13:02:57; /db/atree/library/trees/ce/ce-u07/src/ xlibrary */ diff -Nru dce-1.6.5.4/packages/codec_engine/ti/sdo/ce/video3/viddec3.h dce-1.6.7.3/packages/codec_engine/ti/sdo/ce/video3/viddec3.h --- dce-1.6.5.4/packages/codec_engine/ti/sdo/ce/video3/viddec3.h 2012-09-24 15:13:39.000000000 +0000 +++ dce-1.6.7.3/packages/codec_engine/ti/sdo/ce/video3/viddec3.h 2012-11-28 09:54:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Texas Instruments Incorporated + * Copyright (c) 2012, Texas Instruments Incorporated * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -75,6 +75,19 @@ #define VIDDEC3_ETIMEOUT VISA_ETIMEOUT /**< @copydoc VISA_ETIMEOUT */ #define VIDDEC3_FOREVER VISA_FOREVER /**< @copydoc VISA_FOREVER */ +/** + * @brief The VISA type + */ +#define VIDDEC3_VISATYPE "ti.sdo.ce.video3.IVIDDEC3" + +/** + * @brief Name of stub functions. Use this name when registering the + * VIDDEC3_STUBS functions with Engine_addStubFxns. + * + * @sa Engine_addStubFxns + */ +#define VIDDEC3_STUBSNAME "VIDDEC3_STUBS" + /** * @brief Opaque handle to a VIDDEC3 codec. @@ -372,6 +385,7 @@ #endif /* - * @(#) ti.sdo.ce.video3; 1, 0, 0,93; 7-27-2010 22:27:25; /db/atree/library/trees/ce/ce-q08x/src/ + * @(#) ti.sdo.ce.video3; 1, 0, 0,1; 8-14-2012 13:03:01; /db/atree/library/trees/ce/ce-u07/src/ xlibrary + */ diff -Nru dce-1.6.5.4/packages/codec_engine/ti/sdo/ce/visa.h dce-1.6.7.3/packages/codec_engine/ti/sdo/ce/visa.h --- dce-1.6.5.4/packages/codec_engine/ti/sdo/ce/visa.h 2012-09-24 15:13:39.000000000 +0000 +++ dce-1.6.7.3/packages/codec_engine/ti/sdo/ce/visa.h 2012-11-28 09:54:14.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, Texas Instruments Incorporated + * Copyright (c) 2012, Texas Instruments Incorporated * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -95,6 +95,12 @@ #define VISA_EFAIL -2 /** + * @brief The API is not suported for the given system configuration. + * @ingroup ti_sdo_ce_VISA_GEN + */ +#define VISA_EUNSUPPORTED -3 + +/** * @brief Timeout occurred. * @ingroup ti_sdo_ce_VISA_GEN */ @@ -274,7 +280,7 @@ * * @remarks @c type must match the package/module name of the * interface which the algorithm implements. For example, the VISA - * interface shipped with CE to support xDM video + * interface shipped with CE to support XDM video * decoders is named "ti.sdo.ce.video.IVIDDEC". That is, * the module IVIDDEC is in the package "ti.sdo.ce.video". * You will, by definition, find a file named IVIDDEC.xdc in the @@ -325,7 +331,7 @@ * * @remarks @c type must match the package/module name of the * interface which the algorithm implements. For example, the VISA - * interface shipped with CE to support xDM video + * interface shipped with CE to support XDM video * decoders is named "ti.sdo.ce.video.IVIDDEC". That is, * the module IVIDDEC is in the package "ti.sdo.ce.video". * You will, by definition, find a file named IVIDDEC.xdc in the @@ -338,7 +344,7 @@ * * @remarks VISA_create() is the preferred method to create algorithms. * VISA_create2() is provided to enable creation of algorithms - * which violate the xDAIS spec and do not have a @c size + * which violate the XDAIS spec and do not have a @c size * field of type "Int" as the first field of @c params. * * @sa VISA_create() @@ -575,6 +581,40 @@ */ extern UInt VISA_getMaxMsgSize(VISA_Handle visa); +/* + * ======== _VISA_init ======== + */ +/** + * @brief Ininitilize VISA module. + * + * @ingroup ti_sdo_ce_VISA_GEN + * + * @remarks This is typically called by CERuntime_init(). + * + * @sa _VISA_exit() + */ +extern Void _VISA_init(Void); + +/* + * ======== _VISA_exit ======== + */ +/** + * @brief Exit VISA module. + * + * @ingroup ti_sdo_ce_VISA_GEN + * + * @remarks This is typically called by CERuntime_exit(). + * + * @sa _VISA_init() + */ +extern Void _VISA_exit(Void); + + +/* + * Semi-internal variable generatd by Settings.xdt - used in the following + * inline + */ +extern Bool VISA_checked; /* * ======== VISA_isChecked ======== @@ -594,8 +634,6 @@ */ static inline Bool VISA_isChecked(Void) { - extern Bool VISA_checked; /* generated by Settings.xdt based 'checked' */ - return (VISA_checked); } @@ -641,6 +679,7 @@ #endif /* - * @(#) ti.sdo.ce; 1, 0, 6,403; 7-27-2010 22:02:17; /db/atree/library/trees/ce/ce-q08x/src/ + * @(#) ti.sdo.ce; 1, 0, 6,1; 8-14-2012 12:59:45; /db/atree/library/trees/ce/ce-u07/src/ xlibrary + */ diff -Nru dce-1.6.5.4/packages/framework_components/Makefile.am dce-1.6.7.3/packages/framework_components/Makefile.am --- dce-1.6.5.4/packages/framework_components/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ dce-1.6.7.3/packages/framework_components/Makefile.am 2012-11-28 09:54:14.000000000 +0000 @@ -0,0 +1,6 @@ +## Process this file with automake to produce Makefile.in + +pkg_includedir = $(includedir)/dce + +nobase_pkg_include_HEADERS = \ + ti/sdo/fc/ires/hdvicp/ires_hdvicp2.h diff -Nru dce-1.6.5.4/packages/framework_components/ti/sdo/fc/ires/hdvicp/ires_hdvicp2.h dce-1.6.7.3/packages/framework_components/ti/sdo/fc/ires/hdvicp/ires_hdvicp2.h --- dce-1.6.5.4/packages/framework_components/ti/sdo/fc/ires/hdvicp/ires_hdvicp2.h 1970-01-01 00:00:00.000000000 +0000 +++ dce-1.6.7.3/packages/framework_components/ti/sdo/fc/ires/hdvicp/ires_hdvicp2.h 2012-11-28 09:54:14.000000000 +0000 @@ -0,0 +1,371 @@ +/* + * Copyright (c) 2012, Texas Instruments Incorporated + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of Texas Instruments Incorporated nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +/** + * @file ti/sdo/fc/ires/hdvicp/ires_hdvicp2.h + * + * @brief IRES PROTOCOL HDVICP2 Interface Definitions - + * Allows algorithms to request and receive handles representing + * the HDVICP2 resource. + */ + +/** + * @addtogroup ti_sdo_fc_ires_hdvicp_IRES_HDVICP2 IRES HDVICP2 Protocol + * + * Allows algorithms to request and receive handles representing + * HDVICP2 resources. + */ + +#ifndef ti_sdo_fc_ires_hdvicp_IRES_HDVICP2_ +#define ti_sdo_fc_ires_hdvicp_IRES_HDVICP2_ + +/** @ingroup ti_sdo_fc_ires_hdvicp_IRES_HDVICP2 */ +/*@{*/ + + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +/** + * @brief Name used to describe this protocol + */ +#define IRES_HDVICP2_PROTOCOLNAME "ti.sdo.fc.ires.hdvicp.hdvicp2" + +/** + * @brief HDVICP2 module name + * + * @remarks This name can be passed to Diags_setMask() to enable/disable + * logging for this module. For example, + * Diags_setMask(HDVICP2_MODNAME"+EX1234567"); + * enables all Log statements in this module. + * + * @remarks Diags_setMask() must be called after initialization to take + * effect. + */ +#define HDVICP2_MODNAME "ti.sdo.fc.ires.hdvicp2" + + +/** + * @brief Used to specify the resource required in the protocol args, + * resource manager will return + * an HDVICP2 resource that is available to the scratch group. + */ +#define IRES_HDVICP2_ID_ANY -2 + +/** + * @brief Used to specify the resource required for protocol args, late acquire + * implies that no resource is to be returned right now, resource will be + * acquired later in the process call, using the acquire fxn returned + * via the IRES_HDVICP2_Handle. + */ +#define IRES_HDVICP2_ID_LATE_ACQUIRE -1 + +/** + * @brief Invalid address + * + * @remarks Indicates the address returned in the IRES_HDVICP2_Handle + * is not yet valid, and should not be used. + */ +#define IRES_HDVICP2_INVALID_ADDR 0xFFFFFFFF + +/** + * @brief Wait forever (never timeout) + * + * @remarks Used to indicate to IRES_HDVICP2_Obj::wait() that the call + * should never timeout. + */ +#define IRES_HDVICP2_TIMEOUTFOREVER ((UInt)(-1)) + +/** + * @brief Unknown late acquire argument. + * + * @remarks This definition should be used when a particular algorithm + * doesn't have an application-provided late acquire argument. + * The codec should supply IRES_HDVICP2_UNKNOWNLATEACQUIREARG + * as the argument to acquire() in this case. + * + * @sa XDM_CmdId::XDM_SETLATEACQUIREARG + */ +#define IRES_HDVICP2_UNKNOWNLATEACQUIREARG (-1) + +/* + * Note, we wrap the PROTOCOLVERSION in an ifdef so the + * resource managers and algs get this version data placed in their object + * files. Apps, which include rman.h, will have this 'NOPROTOCOLREV' defined. + */ +#ifndef ti_sdo_fc_ires_NOPROTOCOLREV + +/** + * @brief Protocol Revision for this resource + */ +static const IRES_ProtocolRevision IRES_HDVICP2_PROTOCOLREVISION = {1, 0, 0}; + +#endif + +/** + * @brief Handle to "logical" resource + */ +typedef struct IRES_HDVICP2_Obj *IRES_HDVICP2_Handle; + + +/** + * @brief Timeout value to be used by implementation of + * IRES_HDVICP2_Handle:wait function + */ +extern unsigned int ti_sdo_fc_ires_hdvicp_HDVICP2_timeoutVal; + +/** + * @brief + */ +typedef IRES_YieldArgs (* ti_sdo_fc_ires_hdvicp_HDVICP2_GetYieldArgsFxn) + (Int scratchId); + +/** + * @brief + */ +typedef Void (* ti_sdo_fc_ires_hdvicp_HDVICP2_YieldFxn) + (IRES_YieldResourceType resource, IRES_YieldContextHandle ctxt, + IRES_YieldArgs args); + + + +/** + * @brief HDVICP2 Protocol Arguments definition. + */ +typedef struct IRES_HDVICP2_ProtocolArgs { + + IRES_ProtocolArgs base; /**< Base protocol Args */ + XDAS_Int32 id; /**< HDVICP2 resource being requested. + * + * @remarks Could be 0, 1, 2, + * IRES_HDVICP2_ID_ANY or + * IRES_HDVICP2_ID_LATE_ACQUIRE. + */ +} IRES_HDVICP2_ProtocolArgs; + +/** + * @brief Callback function signature, used by the IRES_HDVICP2_ + * Handle's configure function + */ +typedef void (*IRES_HDVICP2_CallbackFxn)(IALG_Handle handle, Void * args); + +/** + * @brief Describes the status/history of the HDVICP2 unit that is + * returned by the acquire call. This information can be + * used by the codec to avoid reloading the data memory or + * the program memory in the HDVICP2. + * + * @enumWarning + */ +typedef enum IRES_HDVICP2_Status { + SAMECODEC = 0, /**< Same codec was granted this unit, last time */ + SAMECODECTYPE = 1, /**< Different codec, but of the same codec class + was granted this unit last time */ + DIFFERENTCODEC = 2 /**< Completely different codec ran last time */ +} IRES_HDVICP2_Status; + + +/** + * @brief IRES_HDVICP2_Obj extends the generic IRES_Obj structure + * that is returned back to the algorithm requesting the + * resource. + */ +typedef struct IRES_HDVICP2_Obj { + + IRES_Obj ires; /**< Base IRES_Obj struct */ + Void *info; /**< Reserved for future use */ + XDAS_Int32 id; /**< HDVICP2 id granted + * + * @remark Could be 0, 1, 2, or + * LATE_ACQUIRE + */ + XDAS_Void *registerBaseAddress; /**< Register space base address of the + * HDVICP2 being granted + */ + XDAS_Void *memoryBaseAddress; /**< Memory space base address of the + * HDVICP2 being granted + */ + XDAS_Void *resetControlAddress; /**< HDVICP reset controller address + * + * @remarks bit 0 -> ICONT1 reset, + * bit 1 -> ICONT2 reset + */ + +/** + * @brief Acquire the HDVICP2 resource. + * + * @remarks This call acquires the HDVICP resource which the alg may + * (or may not) have specifically requested. + * + * @remarks The returned @c hdvicp2Status indicates the status of + * the particular HDVICP2 unit that is returned. + * @sa IRES_HDVICP2_Status + * + * @remarks The @c configurationId argument is a codec specified + * parameter that is both an input and output parameter. It + * specifies the mode in which this particular HDVICP2 was + * used last time, and the mode in which it will be + * used this time. + * + * @remarks This API takes a @c yieldContext as argument, as it may + * yield the processor to higher priority codecs in the + * system. + * + * @remarks @c lateAcquireId is an optionally framework supplied + * parameter (sometimes provided via an XDM control() call + * setting the XDM_SETLATEACQUIREARG. If not supplied, the + * codec should pass the value + * #IRES_HDVICP2_UNKNOWNLATEACQUIREARG. + * + * @sa IRES_HDVICP2_UNKNOWNLATEACQUIREARG + */ + XDAS_Void (*acquire)(IALG_Handle algHandle, struct IRES_HDVICP2_Obj * this, + IRES_YieldContext * yieldCtxt, XDAS_UInt32 * hdvicp2Status, + XDAS_UInt32 *configurationId, XDAS_Int32 lateAcquireArg); + +/** + * @brief Release the HDVICP2 resource. + * + * @remarks This makes the resource available for use by other algorithms. + */ + XDAS_Void (*release)(IALG_Handle algHandle, struct IRES_HDVICP2_Obj * this); + +/** + * @brief Reacquire the HDVICP2 resource recent released. + * + * @returns XDAS_TRUE The resource was not yet acquired by another + * algorithm, and the resource handle is still + * valid. + * @returns XDAS_FALSE The resource is no longer available and has been + * deactivated. + */ + XDAS_UInt32 (*reacquireIfOwner)(IALG_Handle algHandle, + struct IRES_HDVICP2_Obj * this); + +/** + * @brief Register a callback function with a HDVICP2 instance. + * + * @remarks The callback is invoked when an interrupt fires after + * processing data. + * + * @remarks It is the algorithm's responsibility to configure the HDVICP2 + * to process data and fire the interrupt when done. + */ + XDAS_Void (*configure)(IALG_Handle algHandle, + struct IRES_HDVICP2_Obj * this, + IRES_HDVICP2_CallbackFxn cbFunctionPtr, XDAS_Void * cbArgs); + +/** + * @brief Wait until the HDVICP2 is done processing and then return. + * + * @remarks This is a blocking call, unless a positive timeout value + * is configured, inwhich case the call returns after timeout. + * + * @remarks This function is passed a yieldContext, and will relinquish + * the processor while it waits for the HDVICP2 to finish the + * processing and return from wait. + * + * @returns XDAS_TRUE Success + * @returns XDAS_FALSE Failure/Timeout + */ + XDAS_UInt32 (*wait)(IALG_Handle algHandle, struct IRES_HDVICP2_Obj *this, + IRES_YieldContext * yieldCtxt); + +/** + * @brief Processing has completed. + * + * @remarks This is called from within the interrupt handler function when + * processing completes, and is used to unblock the wait() API. + * + * @remarks Typically, this is called from within the algortihm's callback + * function (see acquire() call). + */ + XDAS_Void (*done) (IALG_Handle algHandle, struct IRES_HDVICP2_Obj *this); + +/** + * @brief Reset the HDVICP2. + * + * @remarks This can be called by the algorithm to "reset" the HDVICP2, and + * is usually called when an acquired HDVICP2 is "dirty", i.e, it + * requires both program/data reload. + * + * @remarks It works off a configured maximum reset cycle delay. + * + * @returns XDAS_TRUE Success + * @returns XDAS_FALSE Failure + */ + XDAS_UInt32 (*reset)(IALG_Handle algHandle, struct IRES_HDVICP2_Obj *this); + +} IRES_HDVICP2_Obj; + + +/** + * @brief HDVICP2 Register Layout + */ +typedef struct IRES_HDVICP2_RegisterLayer { + + int size; + /* TBD */ +} IRES_HDVICP2_RegisterLayer; + +/** + * @brief Static Resource Properties + */ +typedef struct IRES_HDVICP2_Properties { + + int size; + IRES_HDVICP2_RegisterLayer *globalRegs; /* Register layer of HDVICP2 */ +} IRES_HDVICP2_Properties; + +typedef IRES_Status (*ti_sdo_fc_ires_hdvicp_HDVICP2_GetHdvicp2Fxn) + (XDAS_Int32 *Id, IALG_Handle alg, IRES_HDVICP2_Handle handle); + +typedef IRES_Status (*ti_sdo_fc_ires_hdvicp_HDVICP2_FreeHdvicp2Fxn) + (XDAS_Int32 Id, IALG_Handle alg, IRES_HDVICP2_Handle handle); + +#ifdef __cplusplus +} +#endif /* extern "C" */ + +/*@}*/ + +#endif +/* + * @(#) ti.sdo.fc.ires.hdvicp; 1, 0, 1,3; 8-28-2012 20:35:19; /db/atree/library/trees/fc/fc-r14/src/ xlibrary + + */ + diff -Nru dce-1.6.5.4/packages/ivahd_codecs/Makefile.am dce-1.6.7.3/packages/ivahd_codecs/Makefile.am --- dce-1.6.5.4/packages/ivahd_codecs/Makefile.am 2012-09-24 15:13:39.000000000 +0000 +++ dce-1.6.7.3/packages/ivahd_codecs/Makefile.am 2012-11-28 09:54:14.000000000 +0000 @@ -4,10 +4,9 @@ nobase_pkg_include_HEADERS = \ ti/sdo/codecs/mpeg2vdec/impeg2vdec.h \ - ti/sdo/codecs/realvdec/irealvdec.h \ ti/sdo/codecs/vc1vdec/ivc1vdec.h \ - ti/sdo/codecs/vp6dec/ivp6vdec.h \ - ti/sdo/codecs/vp7dec/ivp7vdec.h \ ti/sdo/codecs/mpeg4dec/impeg4vdec.h \ ti/sdo/codecs/h264dec/ih264vdec.h \ - ti/sdo/codecs/h264enc/ih264enc.h + ti/sdo/codecs/h264enc/ih264enc.h \ + ti/sdo/codecs/mpeg4enc/impeg4enc.h \ + ti/sdo/codecs/jpegvdec/ijpegvdec.h diff -Nru dce-1.6.5.4/packages/ivahd_codecs/ti/sdo/codecs/h264dec/ih264vdec.h dce-1.6.7.3/packages/ivahd_codecs/ti/sdo/codecs/h264dec/ih264vdec.h --- dce-1.6.5.4/packages/ivahd_codecs/ti/sdo/codecs/h264dec/ih264vdec.h 2012-09-24 15:13:39.000000000 +0000 +++ dce-1.6.7.3/packages/ivahd_codecs/ti/sdo/codecs/h264dec/ih264vdec.h 2012-11-28 09:54:14.000000000 +0000 @@ -1,163 +1,2688 @@ /* - * Copyright (c) 2010, Texas Instruments Incorporated - * All rights reserved. +******************************************************************************* + * HDVICP2.0 Based H.264 HP Decoder * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of Texas Instruments Incorporated nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - + * "HDVICP2.0 Based H.264 HP Decoder" is a software module developed on TI's + * HDVICP2 based SOCs. This module is capable of decoding a compressed + * high/main/baseline profile H.264 bit-stream into a YUV 4:2:0 Raw video. + * Based on "ISO/IEC 14496-10". + * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/ + * ALL RIGHTS RESERVED +******************************************************************************* +*/ -#ifndef __IH264VDEC_H__ -#define __IH264VDEC_H__ +/** +******************************************************************************* + * @file ih264vdec.h + * + * @brief H264VDEC Interface Header file. + * + * This File contains the interface structures and Macro definition + * required for integrating the H264VDEC. + * + * @author: Pavan Shastry (pavanvs@ti.com) + * + * @version 0.1 (Jan 2008) : Base version borrowed from DSP RnD + * @version 0.2 (Oct 2009) : Code commenting/cleanup. + * [Keshav] + * @version 0.3 (Sep 2010) : Added new structure IH264VDEC_SeiFramePacking + * and also added the new element frame_packing + * to the structure IH264VDEC_SeiMessages + * [Ramkumar] + * @version 0.4 (Sep 2010) : Added review comments and added one new default + * dynemic parameter [Ashish Singh ] + * @version 0.5 (Nov 2010) : Added new elements in status and params for + * debug trace [Resmi] + * @version 0.6 (Nov 2010) : Changes for indicating gaps in frame_num to app + * [Resmi] + * @version 0.7 (Dec 2010) : Extending the create param structure to accomodate + * configurability feature for the detection + * of CABAC and IPCM alignment errors. + * [Ramakrishna Adireddy] + * @version 0.8 (Dec 2010) : Extending the array size for registered and + * un-registered SEI and added a flag in each SEI + * message to indicate the overflow. + * [Ramakrishna Adireddy] + * @version 0.9 (Jan 2011) : Added new common str for storing up the Data + * elements required by SVC decoder + * [Ashish] + * @version 1.0(June 2011) : Added enableDualOutput param and enum for dualYuv + * support. + * [Vijay Kumar Yadav] + * @version 1.1(June 2011) : Added parameter required for dualYuv EC. + * [Vijay] + * @version 1.2 (Oct 2011) : Gaps in frame number enhancements + * [Ramakrishna Adireddy] + * @version 1.3 (Oct 2011) : Added WaterMark parameters. + * [Suresh Reddy] + * @version 1.4 (July 2012): Added new create time param to support decoding + * of specific frame types as requested by + * application [Mahantesh] +****************************************************************************** +*/ +#ifndef IH264VDEC_ +#define IH264VDEC_ #include #include -typedef struct IH264VDEC_Status { +#define IH264VDEC_MAX_LENGTH_PROCESS_LIST (24) + +/** + ****************************************************************************** + * @struct IH264VDEC_Obj + * + * @brief Module’s object definition. This structure must be the first field + * of all H264VDEC instance objects + * + * @param fxns : Structure type defining all functions necessary to + * implement the IH264VDEC interface. + ****************************************************************************** +*/ +typedef struct IH264VDEC_Obj +{ + struct IH264VDEC_Fxns *fxns; +} IH264VDEC_Obj; + +/** + ****************************************************************************** + * @struct IH264VDEC_Status + * + * @brief This structure defines parameters that describe the status of the + * H264 Decoder and any other implementation specific parameters. + * The status parameters are defined in the XDM data structure, + * IVIDDEC3_Status + * + * @param viddec3Status : XDM Base class status structure (see ividdec3.h) + * + * @param svcTargetLayerDID : SVC Spatial target layer ID,need to set if svc + * codec flag is on else default set to 0. + * + * @param svcTargetLayerQID : SVC Quality target layer ID,need to set if svc + * codec flag is on else default set to 0. + * + * + * @param svcTargetLayerTID : SVC Temporal target layer ID,need to set if svc + * codec flag is on else default set to 0. + * + * @param debugTraceLevel: This parameter reports the debug trace level + * configured for the codec + * + * @param lastNFramesToLog: This parameter reports the number of last N + * pictures for which history has been maintained + * + * @param extMemoryDebugTraceAddr: This parameter reports the external + * memory address (as seen by M3) where debug trace + * information is being dumped + * + * @param extMemoryDebugTraceSize: This parameter reports the external + * memory buffer size(in bytes) where debug trace + * information is being dumped + * + * @param gapInFrameNum: This parameter reports the gap in frame_num + * observed in the current frame. It is overloaded + * with details of two things. + * LSB 1-bit [0:0]: Indicates whether SPS allows frame + * num gaps. + * Rest 31-bits [31:1]: Indicates the gap observed + * + * @param spsMaxRefFrames: This parameter reports max reference frames + * that get used for decoding of a given stream. + * If SPS is not parsed, this gives out the value + * based on level & resolution set in create time + * params. Otherwise, it gives out the parsed value + * + * @param enableDualOutput : This Parameter tells whether Dual output is + * enable or not. If enable then application needs + * to provide two extra buffer (one for DualLuma + * and another for DualChroma. + * + * @param reserved[2] : Left reserve for future purpose + * + ****************************************************************************** +*/ +typedef struct IH264VDEC_Status +{ IVIDDEC3_Status viddec3Status; - XDAS_Int32 reserved[7]; + XDAS_Int32 svcTargetLayerDID; + XDAS_Int32 svcTargetLayerTID; + XDAS_Int32 svcTargetLayerQID; + XDAS_UInt32 debugTraceLevel; + XDAS_UInt32 lastNFramesToLog; + XDAS_UInt32 *extMemoryDebugTraceAddr; + XDAS_UInt32 extMemoryDebugTraceSize; XDAS_UInt32 gapInFrameNum; XDAS_UInt32 spsMaxRefFrames; - XDAS_Int32 reservedSomeMore[3]; + XDAS_UInt32 enableDualOutput; + XDAS_UInt32 reserved[2]; } IH264VDEC_Status; -typedef struct IH264VDEC_Params { + /** + ****************************************************************************** + * @struct IH264VDEC_Params + * + * @brief This structure defines the creation parameters for all H264VDEC + * objects. This structure includes the xdm baseclass creation + * parameters and any other implementation specific parameters for + * H264 Decoder instance object. + * + * @param viddec3Params : XDM Baselass create time parameters. + * (see ividdec3.h) + * @param dpbSizeInFrames: Number of frames required by the DPB + * (Decoded Picture Buffer). This is the DPB size + * in number of frames. Also, See the enum + * IH264VDEC_dpbNumFrames. + * @param pConstantMemory : This pointer points to the the memory area where + * constants are located. Default value is NULL in + * which case, codec puts the constants in a + * default section. + * It has to be in DDR addressable space by + * vDMA. This is useful to allow relocatable + * constants for the applications which doesn't use + * M3 as host. Actual memory controller/allocator + * is on another master processor. + * If this is set to NULL then decoder assumes + * that all constants are pointed by symbol + * H264VDEC_TI_ConstData + * + * @param bitStreamFormat : Input bit stream format. Input bits stream can + * be IH264VDEC_NAL_UNIT_FORMAT or + * IH264VDEC_BYTE_STREAM_FORMAT. See the enum + * IH264VDEC_bitStreamFormat for details. + * The decoder supports IH264VDEC_BYTE_STREAM_FORMAT + * in both datasync mode and non datasync mode + * (i.e inputDataMode = IVIDEO_ENTIREFRAME). + * But the IH264VDEC_NAL_UNIT_FORMAT is supported + * only in datasync mode, i.e only when + * inputDataMode = IH264VDEC_NALUNIT_SLICEMODE. + * + * @param errConcealmentMode : If this is set to 1, it means that the YUV + * buffer passed in current process call needs + * concealment. If this is set to 0, it means that + * the YUV buffer passed in current process call + * does not concealment. Note that whether decoder + * actually performed the concealment or not is + * indicated by XDM_APPLIEDCONCEALMENT bit in + * extended error field + * + * @param temporalDirModePred: Parameter to enable/disable temporal direct + * Prediction mode. 0: Disable, 1:Enable + * If this Parameter is disabled set to 0), and + * if the B slice uses temporal direct mode, + * then the codec returns error for that slice. + * + * @param svcExtensionFlag : If required to decode SVC streams , set flag + * ON else default set to IH264SVCVDEC_EXT_FLAG + * + * @param svcTargetLayerDID : SVC Spatial target layer ID,need to read if svc + * codec flag (svcExtensionFlag)is on else default + * set to IH264SVCVDEC_TARGET_DEFAULT_DID. + * + * @param svcTargetLayerQID : SVC Quality target layer ID,need to read if svc + * codec flag (svcExtensionFlag) is on else default + * set to IH264SVCVDEC_TARGET_DEFAULT_QID. + * + * + * @param svcTargetLayerTID : SVC Temporal target layer ID,need to read if svc + * codec flag (svcExtensionFlag)is on else default + * set to IH264SVCVDEC_TARGET_DEFAULT_TID. + * + * @param presetLevelIdc : Level to which decoder has to be configured by the + * application + * + * @param presetProfileIdc : Profile to which decoder has to be configured by + * the application. Currently unused inside codec. + * + * @param detectCabacAlignErr: This parameter configures the cabac alignment + * error detection + * + * @param detectIPCMAlignErr: This parameter configures the IPCM alignment + * error detection + * + * @param debugTraceLevel: This parameter configures the debug trace level + * for the codec + * + * @param lastNFramesToLog: This parameter configures the codec to maintain + * a history of last N frames/pictures + * + * @param enableDualOutput : This Parameter tells whether Dual output is + * enable or not. If enable then application needs + * to provide two extra buffer (one for DualLuma + * and another for DualChroma. + * + * @param processCallLevel : Flag to select field/frame level process call + * + * @param enableWatermark : This Parameter tells whether watermark is + * enabled or not. + * + * @param decodeFrameType : Flag to decoder from application to request + * decoding of only I & IDR or IP or all frame types. + * Setting of IVIDDEC3_DynamicParams::frameSkipMode = + * IVIDEO_SKIP_PB or IVIDEO_SKIP_B could have been + * used for this purpose but it is defined at dynamic + * level, whereas the intention of this parameter is + * to have create time indication to codec for lesser + * memory foot print request. Hence this new parameter + * is defined. + ****************************************************************************** +*/ +typedef struct IH264VDEC_Params +{ IVIDDEC3_Params viddec3Params; - union { - XDAS_Int32 maxNumRefFrames; - XDAS_Int32 dpbSizeInFrames; /* new name, same meaning */ - }; - XDAS_Int32 pConstantMemory; - XDAS_Int32 bitStreamFormat; - XDAS_UInt32 errConcealmentMode; - XDAS_Int32 temporalDirModePred; - XDAS_Int32 reserved_1[4]; - XDAS_Int32 presetLevelIdc; - XDAS_Int32 presetProfileIdc; - XDAS_UInt32 detectCabacAlignErr; - XDAS_UInt32 detectIPCMAlignErr; - XDAS_Int32 reserved_2[5]; + XDAS_Int32 dpbSizeInFrames; + XDAS_Int32 pConstantMemory; + XDAS_Int32 bitStreamFormat; + XDAS_UInt32 errConcealmentMode; + XDAS_Int32 temporalDirModePred; + XDAS_UInt32 svcExtensionFlag; + XDAS_Int32 svcTargetLayerDID; + XDAS_Int32 svcTargetLayerTID; + XDAS_Int32 svcTargetLayerQID; + XDAS_Int32 presetLevelIdc; + XDAS_Int32 presetProfileIdc; + XDAS_UInt32 detectCabacAlignErr; + XDAS_UInt32 detectIPCMAlignErr; + XDAS_UInt32 debugTraceLevel; + XDAS_UInt32 lastNFramesToLog; + XDAS_UInt32 enableDualOutput; + XDAS_Int32 processCallLevel; + XDAS_UInt32 enableWatermark; + XDAS_UInt32 decodeFrameType; } IH264VDEC_Params; - -typedef struct IH264VDEC_DynamicParams { +/** + ****************************************************************************** + * @struct IH264VDEC_DynamicParams + * + * @brief This structure defines the run-time parameters and any other + * implementation specific parameters for an H.264 instance object. + * The base run-time parameters are defined in the XDM data structure, + * IVIDDEC3_DynamicParams. + * + * @param viddec3DynamicParams : XDM Base class dynamic structure + * (see ividdec3.h) + * + * @param deblockFilterMode : indicates the mode of deblocking filter + * (see enum IH264VDEC_deblockFilterMode) + * + * @param svcTargetLayerDID : SVC Spatial target layer ID,need to read if svc + * codec flag is on else default set to + * IH264SVCVDEC_TARGET_DEFAULT_DID. + * + * @param svcTargetLayerQID : SVC Quality target layer ID,need to read if svc + * codec flag is on else default set to + * IH264SVCVDEC_TARGET_DEFAULT_QID. + * + * + * @param svcTargetLayerTID : SVC Temporal target layer ID,need to read if svc + * codec flag is on else default set to + * IH264SVCVDEC_TARGET_DEFAULT_TID. + * + * @param svcELayerDecode : Flag to set for enhancement layer decode, + * defaultvalue is IH264VDEC_DISABLE_ELAYERDECODE + * + * @param reserved[3] : Left reserve for future purpose + * + ****************************************************************************** +*/ +typedef struct IH264VDEC_DynamicParams +{ IVIDDEC3_DynamicParams viddec3DynamicParams; - XDAS_Int32 deblockFilterMode; - XDAS_Int32 reserved[7]; + XDAS_Int32 deblockFilterMode; + XDAS_Int32 svcTargetLayerDID; + XDAS_Int32 svcTargetLayerTID; + XDAS_Int32 svcTargetLayerQID; + XDAS_Int32 svcELayerDecode; + XDAS_Int32 reserved[3]; } IH264VDEC_DynamicParams; -typedef struct IH264VDEC_InArgs { +/** + ****************************************************************************** + * @struct IH264VDEC_InArgs + * + * @brief This structure defines the run-time input arguments for an H264 + * instance object (IH264VDEC::process) + * + * @param viddec3InArgs : XDM Base class InArgs structure (see ividdec3.h) + * + * @param lateAcquireArg : XDM Base class InArgs structure (see ividdec3.h) + ****************************************************************************** +*/ +typedef struct IH264VDEC_InArgs +{ IVIDDEC3_InArgs viddec3InArgs; + XDAS_Int32 lateAcquireArg; } IH264VDEC_InArgs; - -typedef struct IH264VDEC_OutArgs { +/** + ****************************************************************************** + * @struct IH264VDEC_OutArgs + * + * @brief This structure defines the run time output arguments for + * IH264VDEC::process function + * + * @param viddec3OutArgs : XDM Base class OutArgs structure (see ividdec3.h) + * + * @param decryptedKey : This variable contains watermark decrypted key. + ****************************************************************************** +*/ +typedef struct IH264VDEC_OutArgs +{ IVIDDEC3_OutArgs viddec3OutArgs; + XDAS_UInt32 decryptedKey; } IH264VDEC_OutArgs; -/* old name */ +/* + * ======== IH264VDEC_Handle ======== + * This handle is used to reference all H264VDEC instance objects + */ +typedef struct IH264VDEC_Obj *IH264VDEC_Handle; + +/** + ****************************************************************************** + * @struct IH264VDEC_ProcessParams + * + * @brief This structure defines the container for holding the channel + * information. + * + * @param handle : Handle for the channel. + * @param inBufs : Input Buffers for the Channel. + * @param outBufs : Output Buffers for the Channel. + * @param inArgs : Input Arguments for the Channel. + * @param outArgs : Output Arguments for the Channel. + ****************************************************************************** +*/ +typedef struct IH264VDEC_ProcessParams +{ + IH264VDEC_Handle handle; + XDM2_BufDesc *inBufs; + XDM2_BufDesc *outBufs; + IVIDDEC3_InArgs *inArgs; + IVIDDEC3_OutArgs *outArgs; +} IH264VDEC_ProcessParams; + +/** + ****************************************************************************** + * @struct IH264VDEC_ProcessParamsList + * + * @brief This structure defines the container for holding the N channel + * information. + * + * @param numEntries : Number of channels in the given container. + * @param processParams : Array holding the Process Parameters. + ****************************************************************************** +*/ +typedef struct IH264VDEC_ProcessParamsList +{ + XDAS_Int32 numEntries ; + IH264VDEC_ProcessParams processParams[IH264VDEC_MAX_LENGTH_PROCESS_LIST]; +} IH264VDEC_ProcessParamsList ; + +/** + ****************************************************************************** + * @struct IH264VDEC_Fxns + * + * @brief This structure contains pointers to all the XDAIS and XDM interface + * functions + * + * @param ividdec3 : This structure contains pointers to all the XDAIS and + * XDM interface functions + ****************************************************************************** +*/ +typedef struct IH264VDEC_Fxns +{ + IVIDDEC3_Fxns ividdec3; + XDAS_Int32 (*processMulti) (IH264VDEC_ProcessParamsList *processList); +} IH264VDEC_Fxns; + + + +/* + * ======== IH264VDEC_Cmd ======== + * This structure defines the control commands for the IMP4VENC module. + */ +typedef IVIDDEC3_Cmd IH264VDEC_Cmd; + +/* + * ======== IH264VDEC_PARAMS ======== + * Default parameter values for H264VDEC instance objects + */ +extern const IH264VDEC_Params IH264VDEC_PARAMS; +/* + * ======== IH264VDEC_DYNAMICPARAMS ======== + * Default dynamic parameter values for H264VDEC instance objects + */ +extern const IH264VDEC_DynamicParams IH264VDEC_TI_DYNAMICPARAMS; + + +/** + ****************************************************************************** + * @enum IH264VDEC_deblockFilterMode + * @brief This enum indicates the mode of deblocking filter + * + ****************************************************************************** +*/ +typedef enum +{ + IH264VDEC_DEBLOCK_DISABLE_NONE = 0, + /** + * Perform deblocking across all edges + */ + IH264VDEC_DEBLOCK_DISABLE_ALL, + /** + * Disable deblocking across all edges + */ + IH264VDEC_DEBLOCK_DISABLE_SLICE_EDGE, + /** + * Disable deblocking only at slice edges. Internal to slice, + * edges are deblocked. + */ + IH264VDEC_DEBLOCK_DEFAULT + /** + * Perform deblocking as controlled by disable_deblocking_filter_idc of + * the bitstream + */ +} IH264VDEC_deblockFilterMode; + +/** + ****************************************************************************** + * @enum IH264VDEC_temporalDirModePred + * @brief This enum indicates whether or not to decode slices with + * temporal direct prediction + * + ****************************************************************************** +*/ +typedef enum +{ + IH264VDEC_DISABLE_TEMPORALDIRECT = 0, + /** + * Do not decode slice with temporal direct + */ + IH264VDEC_ENABLE_TEMPORALDIRECT + /** + * Decode slice with temporal direct + */ +} IH264VDEC_temporalDirModePred; + +/** + ****************************************************************************** + * @enum IH264VDEC_detectCabacAlignErr + * @brief This enum indicates whether or not to detect the cabac + * alignment errors in MB-decoding + * + ****************************************************************************** +*/ +typedef enum +{ + IH264VDEC_DISABLE_CABACALIGNERR_DETECTION = 0, + /** + * Do not detect the CABAC alignment errors + */ + IH264VDEC_ENABLE_CABACALIGNERR_DETECTION + /** + * Detect the CABAC alignment errors + */ +} IH264VDEC_detectCabacAlignErr; + +/** + ****************************************************************************** + * @enum IH264VDEC_detectIPCMAlignErr + * @brief This enum indicates whether or not to detect the IPCM + * alignment errors in MB-decoding + * + ****************************************************************************** +*/ +typedef enum +{ + IH264VDEC_DISABLE_IPCMALIGNERR_DETECTION = 0, + /** + * Do not detect the IPCM alignment errors + */ + IH264VDEC_ENABLE_IPCMALIGNERR_DETECTION + /** + * Detect the IPCM alignment errors + */ +} IH264VDEC_detectIPCMAlignErr; + +/** + ****************************************************************************** + * @enum IH264VDEC_errConcealmentMode + * @brief This enum indicates whether to apply error concealment or not + * + ****************************************************************************** +*/ +typedef enum +{ + IH264VDEC_NO_CONCEALMENT = 0, + /** + * do not apply error concealment + */ + IH264VDEC_APPLY_CONCEALMENT + /** + * apply error concealment + */ +} IH264VDEC_errConcealmentMode; + +/** + ****************************************************************************** + * @enum IH264VDEC_LevelId + * + * @brief This enum indicates preset level numbers for H.264 Decoder + * + * The application should set the level in the create time parameters. + ****************************************************************************** +*/ +typedef enum { + IH264VDEC_LEVEL1 = 0, + /** 0: Level 1 + */ + IH264VDEC_LEVEL1B, + /** 1: Level 1.b + */ + IH264VDEC_LEVEL11, + /** 2: Level 1.1 + */ + IH264VDEC_LEVEL12, + /** 3: Level 1.2 + */ + IH264VDEC_LEVEL13, + /** 4: Level 1.3 + */ + IH264VDEC_LEVEL2, + /** 5: Level 2 + */ + IH264VDEC_LEVEL21, + /** 6: Level 2.1 + */ + IH264VDEC_LEVEL22, + /** 7: Level 2.2 + */ + IH264VDEC_LEVEL3, + /** 8: Level 3 + */ + IH264VDEC_LEVEL31, + /** 9: Level 3.1 + */ + IH264VDEC_LEVEL32, + /** 10: Level 3.2 + */ + IH264VDEC_LEVEL4, + /** 11: Level 4 + */ + IH264VDEC_LEVEL41, + /** 12: Level 4.1 + */ + IH264VDEC_LEVEL42, + /** 13: Level 4.2 + */ + IH264VDEC_LEVEL5, + /** 14: Level 5 + */ + IH264VDEC_LEVEL51, + /** 15: Level 5.1 + */ +IH264VDEC_MAXLEVELID = IH264VDEC_LEVEL51 + /** 15: Maximum Level ID that can be configured + */ +} IH264VDEC_LevelId; + +/** + ****************************************************************************** + * @enum IH264VDEC_ProfileId + * + * @brief This enum indicates preset profiles for H.264 Decoder + * + * The application should set the profile in the create time parameters. + * In the current implementation, the codec ignores this value. + ****************************************************************************** +*/ typedef enum { - IH264VDEC_NUM_REFFRAMES_AUTO = -1, - IH264VDEC_NUM_REFFRAMES_0 = 0, - IH264VDEC_NUM_REFFRAMES_1 = 1, - IH264VDEC_NUM_REFFRAMES_2 = 2, - IH264VDEC_NUM_REFFRAMES_3 = 3, - IH264VDEC_NUM_REFFRAMES_4 = 4, - IH264VDEC_NUM_REFFRAMES_5 = 5, - IH264VDEC_NUM_REFFRAMES_6 = 6, - IH264VDEC_NUM_REFFRAMES_7 = 7, - IH264VDEC_NUM_REFFRAMES_8 = 8, - IH264VDEC_NUM_REFFRAMES_9 = 9, - IH264VDEC_NUM_REFFRAMES_10 = 10, - IH264VDEC_NUM_REFFRAMES_11 = 11, - IH264VDEC_NUM_REFFRAMES_12 = 12, - IH264VDEC_NUM_REFFRAMES_13 = 13, - IH264VDEC_NUM_REFFRAMES_14 = 14, - IH264VDEC_NUM_REFFRAMES_15 = 15, - IH264VDEC_NUM_REFFRAMES_16 = 16, - IH264VDEC_NUM_REFFRAMES_DEFAULT = IH264VDEC_NUM_REFFRAMES_AUTO -} IH264VDEC_numRefFrames; + IH264VDEC_PROFILE_BASELINE = 0, + /** 0: Baseline profile + */ + IH264VDEC_PROFILE_MAIN, + /** 1: Main profile + */ + IH264VDEC_PROFILE_HIGH, + /** 2: High profile + */ + IH264VDEC_PROFILE_ANY + /** 3: As decoded from the bitstream. This is needed to pass compliance. + */ +} IH264VDEC_ProfileId; -/* new name */ +/** + ****************************************************************************** + * @enum IH264VDEC_debugTraceLevel + * + * @brief This enum indicates the debug trace levels for H.264 Decoder + * + * The application should set this in the create time parameters. + ****************************************************************************** +*/ typedef enum { + IH264VDEC_DEBUGTRACE_LEVEL0 = 0, + /** 0: Debug Trace Level 0 + */ + IH264VDEC_DEBUGTRACE_LEVEL1, + /** 1: Debug Trace Level 1 + */ + IH264VDEC_DEBUGTRACE_LEVEL2, + /** 2: Debug Trace Level 2 + */ + IH264VDEC_DEBUGTRACE_LEVEL3 + /** 2: Debug Trace Level 3 + */ +} IH264VDEC_debugTraceLevel; + +/** + ****************************************************************************** + * @enum IH264VDEC_MetadataType + * @brief This enum indicates Meta Data types for H.264 Decoder + * + * The way to get meta data from decoder is via outBufs of the decoder during + * process call. + ****************************************************************************** +*/ +typedef enum +{ + IH264VDEC_PARSED_SEI_DATA = XDM_CUSTOMENUMBASE, + /** Write out Parsed SEI data + * By setting to this value(for IVIDDEC3_Params::metadataType[i]) + * the codec can can provide the parsed SEI metadata + */ + + IH264VDEC_ENCODED_SEI_DATA, + /** Write out Encoded (compressed) SEI data + * + */ + + IH264VDEC_PARSED_VUI_DATA, + /** Write out Parsed VUI data + * By setting to this value(for IVIDDEC3_Params::metadataType[i]) + * the codec can can provide the parsed VUI metadata + */ + IH264VDEC_ENCODED_VUI_DATA + /** Write out Encoded (compressed) VUI data + * + */ + +} IH264VDEC_MetadataType; + +/** + ****************************************************************************** + * @enum IH264VDEC_DataMode + * @brief Describes the input slice format provided to decoder. + * This enumeration type is used by App to specify codec + * input slice format (NAL/Bytestream) type + * + ****************************************************************************** +*/ + +typedef enum +{ + IH264VDEC_NALUNIT_MODE = XDM_CUSTOMENUMBASE + /** data in NAL stream format + * + */ +} IH264VDEC_DataMode; + +/** + ****************************************************************************** + * @enum IH264VDEC_bitStreamFormat + * @brief Input bit stream format provided to decoder. + * This enumeration type is used by App to specify codec + * input bit stream format (NAL/Bytestream) type + * + ****************************************************************************** +*/ +typedef enum +{ + IH264VDEC_BYTE_STREAM_FORMAT = 0, + /** Input data is in Byte stream format (stream with start code). + * + */ + IH264VDEC_NAL_UNIT_FORMAT + /** Input data is in NAL stream format (No start code) + * + */ +} IH264VDEC_bitStreamFormat; + +/** + ****************************************************************************** + * @enum IH264VDEC_mbErrStatus + * @brief This enum indicates if a MB was in error or not + * + ****************************************************************************** +*/ +typedef enum +{ + IH264VDEC_MB_NOERROR = 0, + /** + * MB was non-erroneous + */ + IH264VDEC_MB_ERROR = 1 + /** + * MB was erroneous + */ +} IH264VDEC_mbErrStatus; + +/** + ****************************************************************************** + * @enum IH264VDEC_ErrorBit + * @brief H.264 Error Codes: Delaration of h264 decoder specific Error + * Codes. + * @details Error status is communicated trough a 32 bit word. In this, + * Error Bits 8 to 15 are used to indicate the XDM error bits. See + * XDM_ErrorBit definition in xdm.h. Other bits in a 32 bit word + * can be used to signal any codec specific errors. The staructure + * below enumerates the H264 decoder specific error bits used. + * The algorithm can set multiple bits to 1 depending on the error + * condition + ****************************************************************************** +*/ +typedef enum +{ + IH264VDEC_ERR_NOSLICE = 0, + /**< + * Bit 0 + * 1 - No error-free slice header detected in the frame + * 0 - Ignore + */ + IH264VDEC_ERR_SPS, + /**< + * Bit 1 + * 1 - Error in SPS parsing + * 0 - Ignore + */ + IH264VDEC_ERR_PPS, + /**< + * Bit 2 + * 1 - Error during PPS parsing + * 0 - Ignore + */ + IH264VDEC_ERR_SLICEHDR, + /**< + * Bit 3 + * 1 - Error in slice header parsing + * 0 - Ignore + */ + IH264VDEC_ERR_MBDATA, + /**< + * Bit 4 + * 1 - Error in MB data parsing + * 0 - Ignore + */ + IH264VDEC_ERR_UNAVAILABLESPS, + /**< + * Bit 5 + * 1 - SPS rferred in the header is not available. + * 0 - Ignore + */ + IH264VDEC_ERR_UNAVAILABLEPPS, + /**< + * Bit 6 + * 1 - PPS rferred in the header is not available + * 0 - Ignore + */ + IH264VDEC_ERR_INVALIDPARAM_IGNORE, + /**< + * Bit 7 + * 1 - Invalid Parameter + * 0 - Ignore + */ + IH264VDEC_ERR_UNSUPPFEATURE = 16, + /**< + * Bit 16 + * 1 - Unsupported feature + * 0 - Ignore + */ + IH264VDEC_ERR_METADATA_BUFOVERFLOW, + /**< + * Bit 17 + * 1 - SEI Buffer overflow detected + * 0 - Ignore + */ + IH264VDEC_ERR_STREAM_END, + /**< + * Bit 18 + * 1 - End of stream reached + * 0 - Ignore + */ + IH264VDEC_ERR_NO_FREEBUF, + /**< + * Bit 19 + * 1 - No free buffers available for reference storing reference frame + * 0 - Ignore + */ + IH264VDEC_ERR_PICSIZECHANGE, + /**< + * Bit 20 + * 1 - Change in resolution detected + * 0 - Ignore + */ + IH264VDEC_ERR_UNSUPPRESOLUTION, + /**< + * Bit 21 + * 1 - Unsupported resolution by the decoder + * 0 - Ignore + */ + IH264VDEC_ERR_NUMREF_FRAMES, + /**< + * Bit 22 + * 1 - maxNumRefFrames parameter is not compliant to stream properties + * (does not comply to stream requirements). + * 0 - Ignore + */ + IH264VDEC_ERR_INVALID_MBOX_MESSAGE, + /**< + * Bit 23 + * 1 - Invalid (unexpected) mail box message received by M3 or IVAHD + * 0 - Ignore + */ + IH264VDEC_ERR_DATA_SYNC, + /**< + * Bit 24 + * 1 - In datasync enable mode, the input supplied is wrong + * 0 - Ignore + */ + IH264VDEC_ERR_MISSINGSLICE, + /**< + * Bit 25 + * 1 - Missing slice in a frame + * 0 - Ignore + */ + IH264VDEC_ERR_INPUT_DATASYNC_PARAMS, + /**< + * Bit 26 + * 1 - Input datasync enable mode, the input parameter is wrong + * 0 - Ignore + */ + IH264VDEC_ERR_HDVICP2_IMPROPER_STATE, + /**< + * Bit 27 + * 1 - IVAHD standby failed or couldn't turn-on/off the IP's clock + * or HDVICP reset failed. + * 0 - Ignore + */ + IH264VDEC_ERR_TEMPORAL_DIRECT_MODE, + /**< + * Bit 28 + * 1 - Temporal direct mode is present in the bits stream + * when disableTemporalDirect parameter (create time) is set. + * 0 - Ignore + */ + IH264VDEC_ERR_DISPLAYWIDTH, + /**< + * Bit 29 + * 1 - DisplayWidth is less than the Image width + Padded width. + * 0 - Ignore + */ + IH264VDEC_ERR_NOHEADER, + /**< + * Bit 30 + * 1 - Indicates that no SPS/PPS header is decoded in the current + * process call. + * (or) It indicates that watermark SEI data is unavailable even though + * watermark parameter is enabled. + * 0 - Ignore + */ + IH264VDEC_ERR_GAPSINFRAMENUM + /**< + * Bit 31 + * 1 - Indicates that a gap is detected in frame_num for a stream with + * gaps_in_frame_num_value_allowed_flag 1 in SPS. + * 0 - Ignore + */ +} IH264VDEC_ErrorBit; +/** + ****************************************************************************** + * @enum IH264VDEC_svcExtension + * @brief This enum indicates whether or not to support SVC extension + * + ****************************************************************************** +*/ +typedef enum +{ + IH264VDEC_DISABLE_SVCEXTENSION = 0, + /** + * Do not support SVC extension + */ + IH264VDEC_ENABLE_SVCEXTENSION + /** + * Support SVC extension + */ +} IH264VDEC_svcExtension; + +/** + ****************************************************************************** + * @enum IH264VDEC_eLayerDecodeMode + * @brief This enum indicates whether or not to support decoding of + * enhancement layer + * + ****************************************************************************** +*/ +typedef enum +{ + IH264VDEC_DISABLE_ELAYERDECODE = 0, + /** + * Decode base layer only. Do not decode enhancement layer + */ + IH264VDEC_ENABLE_ELAYERDECODE + /** + * Support decoding of enhancement layer + */ +} IH264VDEC_ELAYERDECODEMODE; + + +/** + ****************************************************************************** + * @enum IH264VDEC_dependancyLayerIds + * @brief This enum indicates the dependancy layer IDs. + * + ****************************************************************************** +*/ +typedef enum +{ + IH264VDEC_TARGET_DID_DEFAULT = -1, + /** + * Default dependancy layer ID. + */ + IH264VDEC_TARGET_DID_ZERO = 0, + /** + * Dependancy layer ID = 0 + */ + IH264VDEC_TARGET_DID_ONE, + /** + * Dependancy layer ID = 1 + */ + IH264VDEC_TARGET_DID_TWO, + /** + * Dependancy layer ID = 2 + */ + IH264VDEC_TARGET_DID_THREE, + /** + * Dependancy layer ID = 3 + */ + IH264VDEC_TARGET_DID_FOUR, + /** + * Dependancy layer ID = 4 + */ + IH264VDEC_TARGET_DID_FIVE, + /** + * Dependancy layer ID = 5 + */ + IH264VDEC_TARGET_DID_SIX, + /** + * Dependancy layer ID = 6 + */ + IH264VDEC_TARGET_DID_SEVEN, + /** + * Dependancy layer ID = 7 + */ + IH264VDEC_TARGET_DID_MAX = + IH264VDEC_TARGET_DID_SEVEN + /** + * Dependancy layer max ID = 7 + */ + } IH264VDEC_dependancyLayerIds; + +/** + ****************************************************************************** + * @enum IH264VDEC_temporalLayerIds + * @brief This enum indicates the temporal layer IDs for svc. + * + ****************************************************************************** +*/ +typedef enum +{ + IH264VDEC_TARGET_TID_DEFAULT = -1, + /** + * Default Temporal layer ID. + */ + IH264VDEC_TARGET_TID_ZERO = 0, + /** + * Temporal layer ID = 0 + */ + IH264VDEC_TARGET_TID_ONE, + /** + * Temporal layer ID = 1 + */ + IH264VDEC_TARGET_TID_TWO, + /** + * Temporal layer ID = 2 + */ + IH264VDEC_TARGET_TID_THREE, + /** + * Temporal layer ID = 3 + */ + IH264VDEC_TARGET_TID_FOUR, + /** + * Temporal layer ID = 4 + */ + IH264VDEC_TARGET_TID_FIVE, + /** + * Temporal layer ID = 5 + */ + IH264VDEC_TARGET_TID_SIX, + /** + * Temporal layer ID = 6 + */ + IH264VDEC_TARGET_TID_SEVEN, + /** + * Temporal layer ID = 7 + */ + IH264VDEC_TARGET_TID_MAX = + IH264VDEC_TARGET_TID_SEVEN + /** + * Temporal layer max ID = 7 + */ + } IH264VDEC_temporalLayerIds; + +/** + ****************************************************************************** + * @enum IH264VDEC_qualityLayerIds + * @brief This enum indicates the quality layer IDs for svc. + * + ****************************************************************************** +*/ +typedef enum +{ + IH264VDEC_TARGET_QID_DEFAULT = -1, + /** + * Default Quality layer ID. + */ + IH264VDEC_TARGET_QID_ZERO = 0, + /** + * Quality layer ID = 0 + */ + IH264VDEC_TARGET_QID_ONE, + /** + * Quality layer ID = 1 + */ + IH264VDEC_TARGET_QID_TWO, + /** + * Quality layer ID = 2 + */ + IH264VDEC_TARGET_QID_THREE, + /** + * Quality layer ID = 3 + */ + IH264VDEC_TARGET_QID_FOUR, + /** + * Quality layer ID = 4 + */ + IH264VDEC_TARGET_QID_FIVE, + /** + * Quality layer ID = 5 + */ + IH264VDEC_TARGET_QID_SIX, + /** + * Quality layer ID = 6 + */ + IH264VDEC_TARGET_QID_SEVEN, + /** + * Quality layer ID = 7 + */ + IH264VDEC_TARGET_QID_EIGHT, + /** + * Quality layer max ID = 8 + */ + IH264VDEC_TARGET_QID_NINE, + /** + * Quality layer max ID = 9 + */ + IH264VDEC_TARGET_QID_TEN, + /** + * Quality layer max ID = 10 + */ + IH264VDEC_TARGET_QID_ELEVEN, + /** + * Quality layer max ID = 11 + */ + IH264VDEC_TARGET_QID_TWELVE, + /** + * Quality layer max ID = 12 + */ + IH264VDEC_TARGET_QID_THIRTEEN, + /** + * Quality layer max ID = 13 + */ + IH264VDEC_TARGET_QID_FOURTEEN, + /** + * Quality layer max ID = 14 + */ + IH264VDEC_TARGET_QID_FIFTEEN, + /** + * Quality layer max ID = 15 + */ + IH264VDEC_TARGET_QID_MAX = + IH264VDEC_TARGET_QID_FIFTEEN + /** + * Quality layer max ID = 15 + */ +} IH264VDEC_qualityLayerIds; + +/** + ****************************************************************************** + * @enum IH264VDEC_seiOverFlowFlag + * @brief This enum indicates user data reg/unreg SEI overFlowFlag values + * + ****************************************************************************** +*/ +typedef enum +{ + IH264VDEC_PAYLOAD_NO_OVERFLOW = 0, + /** + * Indicates there is no overflow occured in user data reg or unreg sei + */ + IH264VDEC_PAYLOAD_OVERFLOW + /** + * Indicates there is a overflow in user data reg or unreg sei + */ +} IH264VDEC_seiOverFlowFlag; + +/** + ****************************************************************************** + * @enum IH264VDEC_enableDualOutput + * @brief This enum is used to enable/disable dual output feature + * + ****************************************************************************** +*/ +typedef enum +{ + IH264VDEC_DUALOUTPUT_DISABLE = 0, + /** + * Indicates that dual output is disabled + */ + IH264VDEC_DUALOUTPUT_ENABLE + /** + * Indicates that dual output is enabled + */ +} IH264VDEC_enableDualOutput; + +/** + ****************************************************************************** + * @enum IH264VDEC_processCallLevel + * @brief This enum indicates whether process call is done at a field + * level or frame level + * + ****************************************************************************** +*/ +typedef enum +{ + IH264VDEC_FIELDLEVELPROCESSCALL = 0, + /** + * Indicates that process call should be at field level + */ + IH264VDEC_FRAMELEVELPROCESSCALL + /** + * Indicates that process call should be at frame level + */ +} IH264VDEC_processCallLevel; + +/** + ****************************************************************************** + * @enum IH264VDEC_enableWaterMark + * @brief This enum is used to enable/disable Watermark feature + * + ****************************************************************************** +*/ +typedef enum +{ + IH264VDEC_WATERMARK_DISABLE = 0, + /** + * Indicates that Watermark is disabled + */ + IH264VDEC_WATERMARK_ENABLE + /** + * Indicates that Watermark is enabled + */ +} IH264VDEC_enableWaterMark; + +/** + ****************************************************************************** + * @enum IH264VDEC_decodeFrameType + * @brief This enum is used to request decoder to decode only I, IP or ALL + * frame types + ****************************************************************************** +*/ +typedef enum +{ + IH264VDEC_DECODE_ALL = 0, + /** + * Indicates that all type of frames decoding is enabled + */ + IH264VDEC_DECODE_IP_ONLY = 1, + /** + * Indicates that only I/IDR and P frames decoding is enabled + */ + IH264VDEC_DECODE_I_ONLY = 2 + /** + * Indicates that only I/IDR frames decoding is enabled + */ +} IH264VDEC_decodeFrameType; + +/** + * Macro definitions required for SEI support: HRD sequence parameter set + */ +#define IH264VDEC_MAXCPBCNT 32 + +/** + * Macro definitions required for SEI support: HRD sequence parameter set + */ +#define IH264VDEC_MAXUSERDATA_PAYLOAD 300 + +/** + ****************************************************************************** + * @struct IH264VDEC_HrdParams + * + * @brief This structure contains the HRD parameter elements. + * + * @param cpb_cnt_minus1 : Number of alternative CPB specifications in the + * bit-stream + * @param bit_rate_scale : Together with bit_rate_value[i], it specifies the + * maximum input bit-rate for the ith CPB. + * @param cpb_size_scale : Together with cpb_size_value[i], specifies the + * maximum CPB size for the ith CPB. + * @param bit_rate_value_minus1[IH264VDEC_MAXCPBCNT] :Maximum input bitrate + * for the ith CPB + * @param cpb_size_value_minus1[IH264VDEC_MAXCPBCNT] :Maximum CPB size for the + * ith CPB + * @param vbr_cbr_flag[IH264VDEC_MAXCPBCNT] :Specifies the ith CPB is operated + * in Constant Bit-rate mode or variable bit-rate mode + * @param initial_cpb_removal_delay_length_minus1 :Length in bits of + * initial_cpb_removal_length syntax element + * @param cpb_removal_delay_length_minus1 :Length in bits of + * cpb_removal_delay_length syntax element + * @param dpb_output_delay_length_minus1 :Length in bits of + * dpb_output_delay_length syntax element + * @param time_offset_length : Length in bits of time_offset syntax element + ****************************************************************************** +*/ +typedef struct IH264VDEC_HrdParams +{ + XDAS_UInt32 cpb_cnt_minus1; + XDAS_UInt8 bit_rate_scale; + XDAS_UInt8 cpb_size_scale; + XDAS_UInt32 bit_rate_value_minus1[IH264VDEC_MAXCPBCNT]; + XDAS_UInt32 cpb_size_value_minus1[IH264VDEC_MAXCPBCNT]; + XDAS_UInt8 vbr_cbr_flag[IH264VDEC_MAXCPBCNT]; + XDAS_UInt8 initial_cpb_removal_delay_length_minus1; + XDAS_UInt8 cpb_removal_delay_length_minus1; + XDAS_UInt8 dpb_output_delay_length_minus1; + XDAS_UInt8 time_offset_length; +} IH264VDEC_HrdParams; + +/** + ****************************************************************************** + * @struct IH264VDEC_SVCVuiParams + * + * @brief This structure contains VUI message syntax elements for scalable + * video stream + * + * @param parsed_flag :1 - Indicates that in the current process call, c + * contents of the structure is updated + * 0 - Indicates contents of the structure is not updated + * + * @param svc_vui_ext_num_entries_minus1:(svc_vui_ext_num_entries_minus1 + 1) + * specifies the number of information + * entries that are present in the SVC + * VUI parameters extension syntax + * structure + * @param svc_vui_ext_dependency_id:indicate the max value of DId for the + * i-th subset of coded video sequences + * @param svc_vui_ext_quality_id:indicate the max value of QId for the + * i-th subset of coded video sequences + * @param svc_vui_ext_temporal_id: indicate the max value of TId for the + * i-th subset of coded video sequences + * @param svc_vui_ext_timing_info_present_flag: Flag to tells that + * svc_vui_ext_num_units_in_tick, + * svc_vui_ext_time_scale, + * svc_vui_ext_fixed_frame_rate_flag + * are present for current coded + * sequence or not. + * @param svc_vui_ext_num_units_in_tick: specifies the value of + * num_units_in_tick + * @param svc_vui_ext_time_scale: specifies the value of time_scale + * @param svc_vui_ext_fixed_frame_rate_flag: specifies the value of + * fixed_frame_rate_flag + * @param svc_vui_ext_nal_hrd_parameters_present_flag:specifies the + * value of nal_hrd_parameters_present_flag + * @param svc_vui_ext_vcl_hrd_parameters_present_flag: ] specifies the + * value of vcl_hrd_parameters_present_flag + * @param svc_vui_ext_low_delay_hrd_flag: specifies the value + * of low_delay_hrd_flag + * @param svc_vui_ext_pic_struct_present_flag: specifies the value + * of pic_struct_present_flag + * + ****************************************************************************** +*/ + +typedef struct sIH264VDEC_SVCVuiParams +{ + XDAS_UInt32 parsed_flag; + XDAS_UInt16 svc_vui_ext_num_entries_minus1; + XDAS_UInt16 svc_vui_ext_dependency_id; + XDAS_UInt16 svc_vui_ext_quality_id; + XDAS_UInt16 svc_vui_ext_temporal_id; + XDAS_UInt16 svc_vui_ext_timing_info_present_flag; + XDAS_UInt32 svc_vui_ext_num_units_in_tick; + XDAS_UInt32 svc_vui_ext_time_scale; + XDAS_UInt16 svc_vui_ext_fixed_frame_rate_flag; + XDAS_UInt16 svc_vui_ext_nal_hrd_parameters_present_flag; + XDAS_UInt16 svc_vui_ext_vcl_hrd_parameters_present_flag; + XDAS_UInt16 svc_vui_ext_low_delay_hrd_flag; + XDAS_UInt16 svc_vui_ext_pic_struct_present_flag; +} IH264VDEC_SVCVuiParams; + +/** + ****************************************************************************** + * @struct IH264VDEC_VuiParams + * + * @brief This structure contains the VUI Sequence Parameter elements. + * + * @param parsed_flag :1 - Indicates that in the current process call, c + * contents of the structure is updated + * 0 - Indicates contents of the structure is not updated + * @param aspect_ratio_info_present_flag :Indicates whether aspect ratio idc + * is present or not. + * @param aspect_ratio_idc : Aspect ratio of Luma samples + * @param sar_width : Horizontal size of sample aspect ratio + * @param sar_height : Vertical size of sample aspect ratio + * @param overscan_info_present_flag : Cropped decoded pictures are suitable + * for display or not. + * @param overscan_appropriate_flag : Overscan_appropriate_flag + * @param video_signal_type_present_flag : Flag indicates whether + * video_format, video_full_range_flag and colour_description_present_ + * flag are present or not + * @param video_format :Video format indexed by a table. For example,PAL/NTSC + * @param video_full_range_flag : Black level, luma and chroma ranges. It + * should be used for BT.601 compliance + * @param colour_description_present_flag:Indicates whether colour_primaries, + * transfer_characteristics and matrix_coefficients are present. + * @param colour_primaries :Chromaticity co-ordinates of source primaries + * @param transfer_characteristics :Opto-electronic transfer characteristics + * of the source picture + * @param matrix_coefficients :Matrix coefficients for deriving Luma and + * chroma data from RGB components. + * @param chroma_location_info_present_flag : Flag indicates whether + * chroma_sample_loc_type_top field and chroma_sample_loctype + * bottom_field are present. + * @param chroma_sample_loc_type_top_field : Location of chroma_sample top + * field + * @param chroma_sample_loc_type_bottom_field :Location of chroma_sample + * bottom field + * @param timing_info_present_flag :Indicates whether num_units_in_tick, + * time_scale, and fixed_frame_rate_flag are present. + * @param num_units_in_tick :Number of units of a clock that corresponds to 1 + * increment of a clock tick counter + * @param time_scale :Indicates actual increase in time for 1 increment of a + * clock tick counter + * @param fixed_frame_rate_flag :Indicates how the temporal distance between + * HRD output times of any two output pictures is constrained + * @param nal_hrd_parameters_present_flag :Indicates whether + * nal_hrd_parameters are present + * @param nal_hrd_pars : NAL HRD Parameters + * @param vcl_hrd_parameters_present_flag :Indicates whether + * vcl_hrd_parameters are present + * @param vcl_hrd_pars : VCL HRD Parameters + * @param low_delay_hrd_flag :HRD operational mode as in Annex C of the + * standard + * @param pic_struct_present_flag :Indicates whether picture timing SEI + * messages are present + * @param bitstream_restriction_flag :Indicates if the bit-stream restriction + * parameters are present + * @param motion_vectors_over_pic_boundaries_flag :Specifies whether motion + * vectors can point to regions outside the picture boundaries + * @param max_bytes_per_pic_denom :Maximum number of bytes not exceeded by + * the sum of sizes of all VCL NAL units of a single coded picture + * @param max_bits_per_mb_denom :Maximum number of bits taken by any coded MB + * @param log2_max_mv_length_vertical :Maximum value of any motion vector’s + * vertical component + * @param log2_max_mv_length_horizontal :Maximum value of any motion vector’s + * horizontal component + * @param max_dec_frame_reordering : + * @param num_reorder_frames :Maximum number of frames that need to be + * re-ordered + * @param max_dec_frame_buffering :Size of HRD decoded buffer (DPB) in terms + * of frame buffers + * @param svcVuiParams : struct instance of vui parameters for svc + * + ****************************************************************************** +*/ +typedef struct IH264VDEC_VuiParams +{ + XDAS_UInt32 parsed_flag; + XDAS_UInt8 aspect_ratio_info_present_flag; + XDAS_UInt32 aspect_ratio_idc; + XDAS_UInt32 sar_width; + XDAS_UInt32 sar_height; + XDAS_UInt8 overscan_info_present_flag; + XDAS_UInt8 overscan_appropriate_flag; + XDAS_UInt8 video_signal_type_present_flag; + XDAS_UInt8 video_format; + XDAS_UInt8 video_full_range_flag; + XDAS_UInt8 colour_description_present_flag; + XDAS_UInt8 colour_primaries; + XDAS_UInt8 transfer_characteristics; + XDAS_UInt8 matrix_coefficients; + XDAS_UInt8 chroma_location_info_present_flag; + XDAS_UInt32 chroma_sample_loc_type_top_field; + XDAS_UInt32 chroma_sample_loc_type_bottom_field; + XDAS_UInt8 timing_info_present_flag; + XDAS_UInt32 num_units_in_tick; + XDAS_UInt32 time_scale; + XDAS_UInt8 fixed_frame_rate_flag; + XDAS_UInt8 nal_hrd_parameters_present_flag; + IH264VDEC_HrdParams nal_hrd_pars; + XDAS_UInt8 vcl_hrd_parameters_present_flag; + IH264VDEC_HrdParams vcl_hrd_pars; + XDAS_UInt8 low_delay_hrd_flag; + XDAS_UInt8 pic_struct_present_flag; + XDAS_UInt8 bitstream_restriction_flag; + XDAS_UInt8 motion_vectors_over_pic_boundaries_flag; + XDAS_UInt32 max_bytes_per_pic_denom; + XDAS_UInt32 max_bits_per_mb_denom; + XDAS_UInt32 log2_max_mv_length_vertical; + XDAS_UInt32 log2_max_mv_length_horizontal; + XDAS_UInt32 max_dec_frame_reordering; + XDAS_UInt32 num_reorder_frames; + XDAS_UInt32 max_dec_frame_buffering; + IH264VDEC_SVCVuiParams svcVuiParams; +} IH264VDEC_VuiParams; + +/** + ****************************************************************************** + * @struct IH264VDEC_SeiUserDataRegITUT + * + * @brief This structure contains the user data SEI msg elements + * + * @param parsed_flag :1 - Indicates that in the current process call, + * contents of the structure is updated + * 0 - Indicates contents of the structure is not updated + * @param num_payload_bytes :Specifies the size of the payload + * @param itu_t_t35_country_code : A byte having a value specified as a + * country code by ITU-T Recommendation T.35 Annex A + * @param itu_t_t35_country_code_extension_byte :A byte having a value + * specified as a country code by ITU-T Recommendation T.35 Annex B + * @param itu_t_t35_payload_byte[] : A byte containing data registered as + * specified by ITU-T Recommendation T.35. + * @param dataOverflowFlag: This indicates if pay load data is more than the + * array size i.e., IH264VDEC_MAXUSERDATA_PAYLOAD. + ****************************************************************************** +*/ +typedef struct IH264VDEC_SeiUserDataRegITUT +{ + XDAS_UInt32 parsed_flag; + XDAS_UInt32 num_payload_bytes; + XDAS_UInt8 itu_t_t35_country_code; + XDAS_UInt8 itu_t_t35_country_code_extension_byte; + XDAS_UInt8 itu_t_t35_payload_byte[IH264VDEC_MAXUSERDATA_PAYLOAD]; + XDAS_UInt8 dataOverflowFlag; +} IH264VDEC_SeiUserDataRegITUT; + +/** + ****************************************************************************** + * @struct IH264VDEC_SeiUserDataUnReg + * + * @brief This structure contains the user data SEI msg elements + * + * @param parsed_flag :1 - Indicates that in the current process call, + * contents of the structure is updated + * 0 - Indicates contents of the structure is not updated + * @param num_payload_bytes :Specifies the size of the payload + * @param uuid_iso_iec_11578 :Value specified as a UUID according to the + * procedures of ISO/IEC 11578:1996 Annex A. + * @param user_data_payload_byte :Byte containing data having syntax and + * semantics as specified by the UUID generator. + * @param dataOverflowFlag: This indicates if pay load data is more than the + * array size i.e., IH264VDEC_MAXUSERDATA_PAYLOAD. + ****************************************************************************** +*/ +typedef struct IH264VDEC_SeiUserDataUnReg +{ + XDAS_UInt32 parsed_flag; + XDAS_UInt32 num_payload_bytes; + XDAS_UInt8 uuid_iso_iec_11578[16]; + XDAS_UInt8 user_data_payload_byte[IH264VDEC_MAXUSERDATA_PAYLOAD]; + XDAS_UInt8 dataOverflowFlag; +} IH264VDEC_SeiUserDataUnReg; + + +/** + ****************************************************************************** + * @struct IH264VDEC_SeiBufferingPeriod + * + * @brief This structure contains the buffering period SEI msg elements + * + * @param parsed_flag :1 - Indicates that in the current process call, + * contents of the structure is updated + * 0 - Indicates contents of the structure is not updated + * @param seq_parameter_set_id :Specifies the sequence parameter set that + * contains the sequence HRD attributes + * @param nal_cpb_removal_delay :Specifies the delay for the indexed NAL CPB + * between the time of arrival in the CPB of the first bit of the + * coded data associated with the access unit associated with the + * buffering period SEI message and the time of removal from the CPB + * of the coded data associated with the same access unit, for the + * first buffering period after HRD initialization. + * @param nal_cpb_removal_delay_offset :Used for the indexed NAL CPB in + * combination with the cpb_removal_delay to specify the initial + * delivery time of coded access units to the CPB + * @param vcl_cpb_removal_delay :Specifies the delay for the indexed VCL CPB + * between the time of arrival in the CPB of the first bit of the + * coded data associated with the access unit associated with the + * buffering period SEI message and the time of removal from the CPB + * of the coded data associated with the same access unit, for the + * first buffering period after HRD initialization. + * @param vcl_cpb_removal_delay_offset :Used for the indexed VCL CPB in + * combination with the cpb_removal_delay to specify the initial + * delivery time of coded access units to the CPB + ****************************************************************************** +*/ +typedef struct IH264VDEC_SeiBufferingPeriod +{ + XDAS_UInt32 parsed_flag; + XDAS_UInt32 seq_parameter_set_id; + XDAS_UInt32 nal_cpb_removal_delay[IH264VDEC_MAXCPBCNT]; + XDAS_UInt32 nal_cpb_removal_delay_offset[IH264VDEC_MAXCPBCNT]; + XDAS_UInt32 vcl_cpb_removal_delay[IH264VDEC_MAXCPBCNT]; + XDAS_UInt32 vcl_cpb_removal_delay_offset[IH264VDEC_MAXCPBCNT]; +}IH264VDEC_SeiBufferingPeriod; +/** + ****************************************************************************** + * @struct IH264VDEC_SeiPanScanRect + * + * @brief This structure contains the pan scan rectangle SEI msg elements + * + * @param parsed_flag :1 - Indicates that in the current process call, + * contents of the structure is updated + * 0 - Indicates contents of the structure is not updated + * @param pan_scan_rect_id :Specifies an identifying number that may be used + * to identify the purpose of the pan-scan rectangle + * @param pan_scan_rect_cancel_flag :Equal to 1 indicates that the SEI + * message cancels the persistence of any previous pan-scan + * rectangle SEI message in output order. + * pan_scan_rect_cancel_flag equal to 0 indicates that + * pan-scan rectangle information follows. + * @param pan_scan_cnt_minus1 :Specifies the number of pan-scan rectangles + * that are present in the SEI message + * @param pan_scan_rect_left_offset :Specifies as signed integer quantities + * in units of one-sixteenth sample spacing relative to the luma + * sampling grid, the location of the pan-scan rectangle + * @param pan_scan_rect_right_offset :Specifies as signed integer quantities + * in units of one-sixteenth sample spacing relative to the luma + * sampling grid, the location of the pan-scan rectangle + * @param pan_scan_rect_top_offset : Top offset + * @param pan_scan_rect_bottom_offset : Bottom offset + * @param pan_scan_rect_repetition_period :Specifies the persistence of the + * pan-scan rectangle SEI message and may specify a picture order + * count interval within which another pan-scan rectangle SEI message + * with the same value of pan_scan_rect_id or the end of the coded + * video sequence shall be present in the bit-stream + ****************************************************************************** +*/ +typedef struct IH264VDEC_SeiPanScanRect +{ + XDAS_UInt32 parsed_flag; + XDAS_UInt32 pan_scan_rect_id; + XDAS_UInt32 pan_scan_rect_cancel_flag; + XDAS_UInt32 pan_scan_cnt_minus1; + XDAS_Int32 pan_scan_rect_left_offset[3]; + XDAS_Int32 pan_scan_rect_right_offset[3]; + XDAS_Int32 pan_scan_rect_top_offset[3]; + XDAS_Int32 pan_scan_rect_bottom_offset[3]; + XDAS_UInt32 pan_scan_rect_repetition_period; +} IH264VDEC_SeiPanScanRect; + +/** + ****************************************************************************** + * @struct IH264VDEC_SeiProgRefineStart + * + * @brief This structure contains the progressive refinement start SEI msg + * elements + * + * @param parsed_flag :1 - Indicates that in the current process call, + * contents of the structure is updated + * 0 - Indicates contents of the structure is not updated + * @param progressive_refinement_id :Specifies an identification number for + * the progressive refinement operation. + * @param num_refinement_steps_minus1 :Specifies the number of reference + * frames in the tagged set of consecutive coded pictures + ****************************************************************************** +*/ +typedef struct IH264VDEC_SeiProgRefineStart +{ + XDAS_UInt32 parsed_flag; + XDAS_UInt32 progressive_refinement_id; + XDAS_UInt32 num_refinement_steps_minus1; +} IH264VDEC_SeiProgRefineStart; +/** + ****************************************************************************** + * @struct IH264VDEC_SeiProgRefineEnd + * + * @brief TThis structure contains the progressive refinement end SEI msg + * elements + * + * @param parsed_flag :1 - Indicates that in the current process call, + * contents of the structure is updated + * 0 - Indicates contents of the structure is not updated + * @param progressive_refinement_id :Specifies an identification number for + * the progressive refinement operation. + ****************************************************************************** +*/ +typedef struct IH264VDEC_SeiProgRefineEnd +{ + XDAS_UInt32 parsed_flag; + XDAS_UInt32 progressive_refinement_id; +} IH264VDEC_SeiProgRefineEnd; +/** + ****************************************************************************** + * @struct IH264VDEC_SeiRecoveryPointInfo + * + * @brief This structure contains the sRecovery Point Info SEI msg elements + * + * @param parsed_flag :1 - Indicates that in the current process call, + * contents of the structure is updated + * 0 - Indicates contents of the structure is not updated + * @param exact_match_flag :Indicates whether decoded pictures at and + * subsequent to the specified recovery point in output order derived + * by starting the decoding process at the access unit associated with + * the recovery point SEI message, will be an exact match to the + * pictures that would be produced by starting the decoding process + * at the location of a previous IDR access unit in the NAL unit stream. + * @param recovery_frame_cnt :Specifies the recovery point of output pictures + * in output order + * @param broken_link_flag :Indicates the presence or absence of a broken + * link in the NAL unit stream + * @param changing_slice_group_idc :Indicates whether decoded pictures are + * correct or approximately correct in content at and subsequent to + * the recovery point in output order when all macro-blocks of the + * primary coded pictures are decoded within the changing slice group + * period. + ****************************************************************************** +*/ +typedef struct IH264VDEC_SeiRecoveryPointInfo +{ + XDAS_UInt32 parsed_flag; + XDAS_UInt32 recovery_frame_cnt; + XDAS_UInt32 exact_match_flag; + XDAS_UInt32 broken_link_flag; + XDAS_UInt32 changing_slice_group_idc; +} IH264VDEC_SeiRecoveryPointInfo; + +/** + ****************************************************************************** + * @struct IH264VDEC_SeiPictureTiming + * + * @brief This structure contains the picture timing SEI msg elements + * + * @param parsed_flag :1 - Indicates that in the current process call, + * contents of the structure is updated + * 0 - Indicates contents of the structure is not updated + * @param NumClockTs : + * @param cpb_removal_delay :Specifies how many clock ticks to wait after + * removal from the CPB of the access unit associated with the + * most recent buffering period SEI message before removing from + * the buffer the access unit data associated with the picture + * timing SEI message. + * @param dpb_output_delay : Used to compute the DPB output time of the + * picture. + * @param pic_struct : Indicates whether a picture should be displayed as + * a frame or field + * @param clock_time_stamp_flag[4]:1 - Indicates number of clock timestamp + * syntax elements present and follow immediately + * 0 – Indicates associated clock timestamp syntax + * elements not present + * @param ct_type[4] : Indicates the scan type(interlaced or progressive) + * of the source material + * @param nuit_field_based_flag[4] : Used to calculate the clockTimestamp + * @param counting_type[4] : Specifies the method of dropping values of + * n_frames + * @param full_timestamp_flag[4] : 1 - Specifies that the n_frames syntax + * element is followed by seconds_value, + * minutes_value, and hours_value. + * 0 - Specifies that the n_frames syntax + * element is followed by seconds_flag + * @param discontinuity_flag[4] : Indicates whether the difference between + * the current value of clockTimestamp and the value of + * clockTimestamp computed from the previous clockTimestamp in + * output order can be interpreted as the time difference between + * the times of origin or capture of the associated frames or + * fields. + * @param cnt_dropped_flag[4] : Specifies the skipping of one or more + * values of n_frames using the counting method + * @param n_frames[4] : Specifies the value of nFrames used to compute + * clockTimestamp. + * @param seconds_flag[4] : equal to 1 specifies that seconds_value and + * minutes_flag are present when + * full_timestamp_flag is equal to 0. + * @param minutes_flag[4] : equal to 1 specifies that minutes_value and + * hours_flag are present when full_timestamp_flag + * is equal to 0 and seconds_flag is equal to 1. + * @param hours_flag[4] : equal to 1 specifies that hours_value is + * present when full_timestamp_flag is equal to 0 + * and seconds_flag is equal to 1 and minutes_flag + * is equal to 1. + * @param seconds_value[4] : Specifies the value of sS used to compute + * clockTimestamp. + * @param minutes_value[4] : Specifies the value of mM used to compute + * clockTimestamp. + * @param hours_value[4] : Specifies the value of tOffset used to compute + * clockTimestamp + * @param time_offset[4] : Specifies the value of tOffset used to compute + * clockTimestamp + ****************************************************************************** +*/ +typedef struct IH264VDEC_SeiPictureTiming +{ + XDAS_UInt32 parsed_flag; + XDAS_UInt32 NumClockTs; + XDAS_UInt32 cpb_removal_delay; + XDAS_UInt32 dpb_output_delay; + XDAS_UInt32 pic_struct; + XDAS_UInt32 clock_time_stamp_flag[4]; + XDAS_UInt32 ct_type[4]; + XDAS_UInt32 nuit_field_based_flag[4]; + XDAS_UInt32 counting_type[4]; + XDAS_UInt32 full_timestamp_flag[4]; + XDAS_UInt32 discontinuity_flag[4]; + XDAS_UInt32 cnt_dropped_flag[4]; + XDAS_UInt32 n_frames[4]; + XDAS_UInt32 seconds_flag[4]; + XDAS_UInt32 minutes_flag[4]; + XDAS_UInt32 hours_flag[4]; + XDAS_UInt32 seconds_value[4]; + XDAS_UInt32 minutes_value[4]; + XDAS_UInt32 hours_value[4]; + XDAS_Int32 time_offset[4]; +}IH264VDEC_SeiPictureTiming; +/** + ****************************************************************************** + * @struct IH264VDEC_SeiFullFrameFreezeRep + * + * @brief This structure contains the full frmae freeze repetition SEI msg + * elements + * + * @param parsed_flag :1 - Indicates that in the current process call, + * contents of the structure is updated + * 0 - Indicates contents of the structure is not updated + * @param full_frame_freeze_repetition_period :Specifies the persistence of + * the full-frame freeze SEI message + ****************************************************************************** +*/ +typedef struct IH264VDEC_SeiFullFrameFreezeRep +{ + XDAS_UInt32 parsed_flag; + XDAS_UInt32 full_frame_freeze_repetition_period; +} IH264VDEC_SeiFullFrameFreezeRep; + +/** + ****************************************************************************** + * @struct IH264VDEC_SeiFullFrameFreezeRel + * + * @brief This structure contains frame freeze release SEI msg elements + * + * @param parsed_flag :1 - Indicates that in the current process call, + * contents of the structure is updated + * 0 - Indicates contents of the structure is not updated + * @param payloadSize : Size of the frame_freeze_release payload + ****************************************************************************** +*/ +typedef struct IH264VDEC_SeiFullFrameFreezeRel +{ + XDAS_UInt32 parsed_flag; + XDAS_UInt32 payloadSize; +} IH264VDEC_SeiFullFrameFreezeRel; + +/** + ****************************************************************************** + * @struct IH264VDEC_SeiStereoVideoInfo + * + * @brief This structure contains stereo video information SEI msg elements + * + * @param parsed_flag :1 - Indicates that in the current process call, + * contents of the structure is updated + * 0 - Indicates contents of the structure is not updated + * @param field_views_flag : 1 - indicates that all pictures in the current + * coded video sequence are fields + * 0 - indicates that all pictures in the current + * coded video sequence are frames. + * @param top_field_is_left_view_flag : + * 1 - top field is a left view. + * 0 - topfield is right view. + * @param current_frame_is_left_view_flag : + * 1 - current frame is left view. + * 0 - current frame is right view. + * @param next_frame_is_second_view_flag : + * 1 - current picture and a next picture in + * output order form a stereo video pair. + * 0 - current picture and a previous picture in + * output order form a stereo video pair. + * @param left_view_self_contained_flag : + * 1 - it will not use right view as a reference + * picture for inter prediction + * 0 - it may use right view as a reference + * picture for inter prediction. + * @param right_view_self_contained_flag : + * 1 - it will not use left view as a reference + * picture for inter prediction + * 0 - it may use left view as a reference + * picture for inter prediction. + ****************************************************************************** +*/ +typedef struct IH264VDEC_SeiStereoVideoInfo +{ + XDAS_UInt32 parsed_flag; + XDAS_UInt32 field_views_flag; + XDAS_UInt32 top_field_is_left_view_flag; + XDAS_UInt32 current_frame_is_left_view_flag; + XDAS_UInt32 next_frame_is_second_view_flag; + XDAS_UInt32 left_view_self_contained_flag; + XDAS_UInt32 right_view_self_contained_flag; +} IH264VDEC_SeiStereoVideoInfo; + +/** + ****************************************************************************** + * @struct IH264VDEC_SeiFramePacking + * + * @brief This structure contains frame packing arrangement SEI msg elements + * + * @param frame_packing_arrangement_id : + * contains an identifying number that may be used to identify + * the usage of the frame packing arrangement SEI message. + * @param frame_packing_arrangement_cancel_flag : + * 1 - equal to 1 indicates that the frame packing arrangement + * SEI message cancels the persistence of any previous frame + * packing arrangement SEI message in output order. + * 0 - indicates that frame packing arrangement info follows + * @param frame_packing_arrangement_type : + * indicates the type of packing arrangement of the frames + * @param quincunx_sampling_flag : + * 1 - indicates that each color component plane of each + * constituent frame is quincunx sampled + * 0 - indicates that each color component plane of each + * constituent frame is not quincunx sampled + * @param content_interpretation_type : + * 1 - frame 0 being associated with the left view and frame 1 + * being associated with the right view + * 2 - frame 0 being associated with the right view and frame 1 + * being associated with the left view + * @param spatial_flipping_flag : + * 1 - spatial flipping is enabled for any one of the frame + * constituent, if frame_packing_arrangement_type is 3 or 4. + * 0 - spatial flipping is disabled for any one of the frame + * constituent, if frame_packing_arrangement_type is 3 or 4. + * @param frame0_flipped_flag : + * 1 - frame 0 is spatially flipped + * 0 - frame 1 is spatially flipped + * @param field_views_flag : + * 1 - indicates that all pictures in the current coded video + * sequence are coded as complementary field pairs. + * 0 - indicates that all pictures in the current coded video + * sequence are coded as frame. + * @param current_frame_is_frame0_flag : + * 1 - indicates that the current decoded frame is constituent + * frame 0 and the next decoded frame in output order + * is constituent frame 1. + * 0 - indicates that the current decoded frame is constituent + * frame 1 and the next decoded frame in output order + * is constituent frame 0. + * @param frame0_self_contained_flag : + * 1 - indicates that the constituent frame 0 is dependent on + * constituent frame 1 in decoding process + * 0 - indicates that the constituent frame 0 may dependent on + * constituent frame 1 in decoding process + * @param frame1_self_contained_flag : + * 1 - indicates that the constituent frame 1 is dependent on + * constituent frame 0 in decoding process + * 0 - indicates that the constituent frame 1 may dependent on + * constituent frame 0 in decoding process + * @param frame0_grid_position_x : + * specifies the horizontal location of the upper left + * sample of constituent frame 0 in the units of one + * sixteenth of the luma samples + * @param frame0_grid_position_y : + * specifies the vertical location of the upper left + * sample of constituent frame 0 in the units of one + * sixteenth of the luma samples + * @param frame1_grid_position_x : + * specifies the horizontal location of the upper left + * sample of constituent frame 1 in the units of one + * sixteenth of the luma samples + * @param frame1_grid_position_y : + * specifies the vertical location of the upper left + * sample of constituent frame 1 in the units of one + * sixteenth of the luma samples + * @param frame_packing_arrangement_reserved_byte : + * reserved for the future use. + * @param frame_packing_arrangement_repetition_period : + * specifies the persistence of the frame packing arrangement + * SEI message and may specify a frame order count interval + * within which another frame packing arrangement SEI message + * with the same value of frame_packing_arrangement_id or the + * end of the coded video sequence shall be present in the + * bitstream. + * @param frame_packing_arrangement_extension_flag : + * 0 - indicates that no additional data follows within the + * frame packing arrangement SEI message. + * 1 - Reserved for the future use. + ****************************************************************************** +*/ +typedef struct IH264VDEC_SeiFramePacking +{ + XDAS_UInt32 parsed_flag; + XDAS_UInt32 frame_packing_arrangement_id; + XDAS_UInt32 frame_packing_arrangement_repetition_period; + XDAS_UInt8 frame_packing_arrangement_cancel_flag; + XDAS_UInt8 frame_packing_arrangement_type; + XDAS_UInt8 quincunx_sampling_flag; + XDAS_UInt8 content_interpretation_type; + XDAS_UInt8 spatial_flipping_flag; + XDAS_UInt8 frame0_flipped_flag; + XDAS_UInt8 field_views_flag; + XDAS_UInt8 current_frame_is_frame0_flag; + XDAS_UInt8 frame0_self_contained_flag; + XDAS_UInt8 frame1_self_contained_flag; + XDAS_UInt8 frame0_grid_position_x; + XDAS_UInt8 frame0_grid_position_y; + XDAS_UInt8 frame1_grid_position_x; + XDAS_UInt8 frame1_grid_position_y; + XDAS_UInt8 frame_packing_arrangement_reserved_byte; + XDAS_UInt8 frame_packing_arrangement_extension_flag; +} IH264VDEC_SeiFramePacking; + + +/** + ****************************************************************************** + * @struct IH264VDEC_SeiMessages + * + * @brief This structure contains all the supported SEI msg objects + * + * @param parsed_flag :1 - Indicates that in the current process call, + * contents of the structure is updated + * 0 - Indicates contents of the structure is not updated + * @param full_frame_freeze : Full-frame freeze SEI message + * @param full_frame_freeze_release :Cancels the effect of any full-frame + * freeze SEI message sent with pictures that precede the current + * picture in the output order. + * @param prog_refine_start :Specifies the beginning of a set of consecutive + * coded pictures that is labeled as the current picture followed + * by a sequence of one or more pictures of refinement of the + * quality of the current picture, rather than as a representation + * of a continually moving scene. + * @param prog_refine_end : Specifies end of progressive refinement. + * @param user_data_registered :Message contains user data registered as + * specified by ITU-T Recommendation T.35 + * @param user_data_unregistered :Message contains unregistered user data + * identified by a UUID + * @param buffering_period_info :Message specifies the buffering period + * @param pan_scan_rect :Message specifies the coordinates of a rectangle + * relative to the cropping rectangle of the sequence parameter set + * @param recovery_pt_info :The recovery point SEI message assists a decoder + * in determining when the decoding process will produce acceptable + * pictures for display after the decoder initiates random access or + * after the encoder indicates a broken link in the sequence. + * @param pic_timing :Specifies timing information regarding cpb delays, dpb +* output delay, and so on. + * @param stereo_video_info :stereo video information SEI message consist of + * pair of picture forming stereo view content. + ****************************************************************************** +*/ +typedef struct IH264VDEC_SeiMessages +{ + XDAS_UInt32 parsed_flag; + IH264VDEC_SeiFullFrameFreezeRep full_frame_freeze; + IH264VDEC_SeiFullFrameFreezeRel full_frame_freeze_release; + IH264VDEC_SeiProgRefineStart prog_refine_start; + IH264VDEC_SeiProgRefineEnd prog_refine_end; + IH264VDEC_SeiUserDataRegITUT user_data_registered; + IH264VDEC_SeiUserDataUnReg user_data_unregistered; + IH264VDEC_SeiBufferingPeriod buffering_period_info; + IH264VDEC_SeiPanScanRect pan_scan_rect; + IH264VDEC_SeiRecoveryPointInfo recovery_pt_info; + IH264VDEC_SeiPictureTiming pic_timing; + IH264VDEC_SeiStereoVideoInfo stereo_video_info; + IH264VDEC_SeiFramePacking frame_packing; +} IH264VDEC_SeiMessages; + +/** + ****************************************************************************** + * @struct IH264VDEC_MbxTraceData + * + * @brief This structure holds the elements that describe the attributes of + * traced data. + * + * @param userId : Indicates whose data getting logged. + * @param message : Indicates the message type that's been used at given + * user ID. + * @param rwMode : Indicates mode in which the MBx is accessed. + * @param rsvd : Reserved byte to add any new attribute in future. + * + ****************************************************************************** +*/ +typedef struct IH264VDEC_MbxTraceData +{ + XDAS_UInt8 userId; + XDAS_UInt8 message; + XDAS_UInt8 rwMode; + XDAS_UInt8 rsvd; +}IH264VDEC_MbxTraceData; + +/** + * Macro to indicate the max number of samples + * that we capture in the log. +*/ +#define NUM_MBX_TRACE_ELEMENTS 300 + +/** + ****************************************************************************** + * @struct IH264VDEC_ProfileInfo + * + * @brief This structure contains elements related to profiling information + * This Structure is used to get some codec internal cycles and not + * to be used for any system level profiling. + * + * @param hostPreIva : Cycles spent by M3 before giving control to IVAHD. + * This gives M3 cycles alone that are spent before IVAHD + * starts doing any thing for a given process call. + * @param preMbLoop : Cycles spent before entering MB Loop + * @param inMbLoop : Cycles in the MB Loop + * @param postMbLoop : Cycles spent after the MB Loop execution + * @param hostPostIva : Cycles spent after getting control back to Host from + * IVAHD. This gives M3 cycles alone that are spent + * after IVAHD gives control back to M3 + * @param ivahdTotalCycles : Total cycles on IVAHD + * @param sliceTask : per slice cycles spent; Array size set to the stream + * "Combined_CABAC_07_HD_10.1.26l" + * @param noOfSlices : Number of lices in the picture + ****************************************************************************** +*/ +typedef struct IH264VDEC_ProfileInfo +{ + XDAS_UInt32 hostPreIva; + XDAS_UInt32 preMbLoop; + XDAS_UInt32 inMbLoop; + XDAS_UInt32 postMbLoop; + XDAS_UInt32 hostPostIva; + XDAS_UInt32 ivahdTotalCycles; + XDAS_UInt32 sliceTask[136]; + XDAS_UInt32 noOfSlices; + IH264VDEC_MbxTraceData mbxTraceArray[NUM_MBX_TRACE_ELEMENTS]; + XDAS_UInt16 mbxtraceIdx; +} IH264VDEC_ProfileInfo; + +/** + ****************************************************************************** + * @struct _sErrConcealStr + * @brief This str holds up the required Info for implementing the SCV EC, + * this will get updated by H.264 decoder while decoding the SVC + * Base/Target Layers + * + * @param CurrMbInfoBufPointer :Base Address of the current decoded frame + * MB Info buffer + * + * @param CurrMbStatusBufPointer: Base Address of the current decoded frame + * MB staus buffer pointer + * + * @param currFrameY : Base Address of the current decoded Luma + * frame buffer pointer (physical pointer) + * + * @param currFrameUV : Base Address of the current decoded Chroma + * frame buffer pointer (physical pointer) + * + * @param refConclY : Base Address of the ref decoded Luma + * frame buffer pointer (virtual pointer) + * + * @param refConclUV : Base Address of the ref decoded Chroma + * frame buffer pointer (virtual pointer) + * + * @param TilerBaseAddress : TBA vaule for the VDMA + * + * @param pSliceInfoFlags : Flag to enable slice info + * + * @param ref_width : Resultant Horizontal LUMA picture size + * after Pad size addition on both Left + * & Right sides. This gets used as + * stride during vDMA programming. + * In case of TILER,the stride is fixed, + * independant of Picture width, and + * only changes with TILER mode. + * + * @param ref_width_c : Resultant Horizontal CHROMA picture size + * after Pad size addition on both Left & + * Right sides. + * + * + * @param ref_frame_height : In case of Interlaced streams,the picure + * store is different i.e., store each field + * by applying PAD on top & bottom lines. + * Hence the picture height will be Height + * plus four times the Pad size. This + * variable holds this resultant value. + * + * @param mb_width : Picture width in terms of Macroblocks + * + * @param mb_height : Picture height in terms of Macroblocks. + * + * @param image_width : Image width of the decoded frame + * + * @param image_width : Image height of the decoded frame + * + * @param frameType : Frame type of the current frame. + * + * @param picaff_frame : Flag to indicate whether current picture + * is of Frame type & referring to Field + * picture as reference. + * + * @param mb_aff_frame_flag : Flag to indicate whether the current + * decoding picture is MBAFF type. + * + * @param field_pic_flag : Flag to indicate whether the current + * decoding picture is field type. + * + * @param bottom_field_flag : This parameter equal to 1 specifies that + * the slice is part of a coded bottom field. + * bottom_field_flag equalto 0 specifies + * that the picture is a coded top field. + * + * @param nonPairedFieldPic : Flag to indicate Non paired field picture. + * + * @param prev_pic_bottom_field : this variable Indicates if the previous + * picture was a bottom field or not (a Flag) + * + * @param currFrameYDual : Base Address of the current decoded Luma + * frame buffer pointer (physical pointer) + * for dual yuv output. + * + * @param currFrameUVDual : Base Address of the current decoded Chroma + * frame buffer pointer (physical pointer) + * for dual yuv output. + * + * @param ref_widthDual : Resultant Horizontal LUMA picture size + * after Pad size addition on both Left + * & Right sides. This gets used as + * stride during vDMA programming. + * In case of TILER,the stride is fixed, + * independant of Picture width, and + * only changes with TILER mode. + * + * @param ref_width_cDual : Resultant Horizontal CHROMA picture size + * after Pad size addition on both Left & + * Right sides. + * + ****************************************************************************** +*/ + +typedef struct _sErrConcealStr +{ + XDAS_Int32 ErrConcealmentEnable; + XDAS_Int32 CurrMbInfoBufPointer; + XDAS_Int32 CurrMbStatusBufPointer; + XDAS_Int32 CurrMbInfoIresBufPointer; + XDAS_Int32 currFrameY; + XDAS_Int32 currFrameUV; + XDAS_Int32 refConclY; + XDAS_Int32 refConclUV; + XDAS_UInt32 TilerBaseAddress; + XDAS_UInt16 ref_width; + XDAS_UInt16 ref_width_c; + XDAS_UInt16 ref_frame_height; + XDAS_UInt16 mb_width; + XDAS_UInt16 mb_height; + XDAS_UInt16 image_width; + XDAS_UInt16 image_height; + XDAS_UInt8 frameType; + XDAS_UInt8 picaff_frame; + XDAS_UInt8 mb_aff_frame_flag; + XDAS_UInt8 field_pic_flag; + XDAS_UInt8 bottom_field_flag; + XDAS_UInt8 nonPairedFieldPic; + XDAS_UInt8 prev_pic_bottom_field; + XDAS_Int32 currFrameYDual; + XDAS_Int32 currFrameUVDual; + XDAS_UInt16 ref_widthDual; + XDAS_UInt16 ref_width_cDual; + XDAS_UInt16 rsvd[2]; +}sErrConcealStr; + +/** + * Size of sliceinfo flags - We have two slice info flag arrays in SL2, one + * for ECD3 and the other for MC3. ECD3 flag is one bit per MB. Since Maximum + * supported number of MBs in a frame for Low resolution is 128 x 128 = 16384, + * and for High resolution 256*256 = 65536. So we need 16384/8 = 2048 bytes + * for Low resolution and 65536/8 = 8192 for High resolution to store slice + * info flag array for ECD3. But for the MC3 array, we always make the next + * bit also as 1 to enable loading into ping and pong memories of MCBUF. + * So we need an extra bit for the MC3 array, to avoid buffer overflow when + * the last MB is a new slice. To keep the next SL2 buffer in 16-byte aligned + * position (some buffers need it) we round the size to next multiple of 16, + * i.e., 2064 and 8208 for Low and High resolutions respectively. + * As we are maintaining only one decoder image in M3, we define + * SLICEINFO_FLAGSIZE as 8208 (maximum among 2064 and 8208). +*/ +#define SLICEINFO_FLAGSIZE_HIGHRES 8208 +#define SLICEINFO_FLAGSIZE_LOWRES 2064 + +/** + ****************************************************************************** + * @struct _sErrConcealLayerStr + * @brief This str holds up the required Info for implementing the SCV EC, + * this will get updated by H.264 decoder while decoding the SVC + * Base/Target Layers + * + * @param svcEcStr : structure instance of sSVCErrConcealStr + * + * @param pSliceInfoFlags : Array to store the sliceInfo flag + * + * + ****************************************************************************** +*/ +typedef struct _sErrConcealLayerStr +{ + sErrConcealStr sECStr; + XDAS_UInt8 pSliceInfoFlags[SLICEINFO_FLAGSIZE_HIGHRES]; +}sErrConcealLayerStr; + +/** + ****************************************************************************** + * @enum IH264VDEC_dpbNumFrames + * @brief This enum can be used to choose the DPB Size in number + * number of frames. + * @details + ****************************************************************************** +*/ +typedef enum +{ IH264VDEC_DPB_NUMFRAMES_AUTO = -1, + /**< + * Allow the decoder to choose the number of reference frames based on the + * stream information. + */ IH264VDEC_DPB_NUMFRAMES_0 = 0, + /**< + * Number of frames required is 0 + */ IH264VDEC_DPB_NUMFRAMES_1 = 1, + /**< + * Number of frames required is 1 + */ IH264VDEC_DPB_NUMFRAMES_2 = 2, + /**< + * Number of frames required is 2 + */ IH264VDEC_DPB_NUMFRAMES_3 = 3, + /**< + * Number of frames required is 3 + */ IH264VDEC_DPB_NUMFRAMES_4 = 4, + /**< + * Number of frames required is 4 + */ IH264VDEC_DPB_NUMFRAMES_5 = 5, + /**< + * Number of frames required is 5 + */ IH264VDEC_DPB_NUMFRAMES_6 = 6, + /**< + * Number of frames required is 6 + */ IH264VDEC_DPB_NUMFRAMES_7 = 7, + /**< + * Number of frames required is 7 + */ IH264VDEC_DPB_NUMFRAMES_8 = 8, + /**< + * Number of frames required is 8 + */ IH264VDEC_DPB_NUMFRAMES_9 = 9, + /**< + * Number of frames required is 9 + */ IH264VDEC_DPB_NUMFRAMES_10 = 10, + /**< + * Number of frames required is 10 + */ IH264VDEC_DPB_NUMFRAMES_11 = 11, + /**< + * Number of frames required is 11 + */ IH264VDEC_DPB_NUMFRAMES_12 = 12, + /**< + * Number of frames required is 12 + */ IH264VDEC_DPB_NUMFRAMES_13 = 13, + /**< + * Number of frames required is 13 + */ IH264VDEC_DPB_NUMFRAMES_14 = 14, + /**< + * Number of frames required is 14 + */ IH264VDEC_DPB_NUMFRAMES_15 = 15, + /**< + * Number of frames required is 15 + */ IH264VDEC_DPB_NUMFRAMES_16 = 16, + /**< + * Number of frames required is 16 + */ IH264VDEC_DPB_NUMFRAMES_DEFAULT = IH264VDEC_DPB_NUMFRAMES_AUTO + /**< + * Allow the decoder to choose the number of reference frames based on the + * stream information. + */ } IH264VDEC_dpbNumFrames; -typedef enum { - IH264VDEC_NO_CONCEALMENT = 0, - IH264VDEC_APPLY_CONCEALMENT -} IH264VDEC_errConcealmentMode; +/** + ****************************************************************************** + * @enum IH264VDEC_SVCErrConcealMode + * @brief Describes the error concealment mode ID for SVC codec + * This enumeration type is used by svc app to specify codec + * to concealment mode + * + ****************************************************************************** +*/ -typedef enum { - IH264VDEC_DISABLE_CABACALIGNERR_DETECTION = 0, - IH264VDEC_ENABLE_CABACALIGNERR_DETECTION -} IH264VDEC_detectCabacAlignErr; +typedef enum +{ + IH264VDEC_SETERRCONCEALMODE = 15 + /** SVC error concealment mode ID + * + */ +} IH264VDEC_SVCErrConcealMode; -typedef enum { - IH264VDEC_DISABLE_IPCMALIGNERR_DETECTION = 0, - IH264VDEC_ENABLE_IPCMALIGNERR_DETECTION -} IH264VDEC_detectIPCMAlignErr; +/** + ****************************************************************************** + * @struct IH264VDEC_TI_CommonInfo + * + * @brief + * + ****************************************************************************** +*/ +typedef struct _IH264VDEC_TI_CommonInfo +{ + XDAS_UInt32 codec_type:8; + XDAS_UInt32 fmt_type:8; + XDAS_UInt32 mb_ll_avail:1; + XDAS_UInt32 mb_ul_avail:1; + XDAS_UInt32 mb_uu_avail:1; + XDAS_UInt32 mb_ur_avail:1; + XDAS_UInt32 pic_bound_l:1; + XDAS_UInt32 pic_bound_u:1; + XDAS_UInt32 pic_bound_r:1; + XDAS_UInt32 pic_bound_b:1; + XDAS_UInt32 first_mb_flag:1; + XDAS_UInt32 error_flag:1; + XDAS_UInt32 zero:6; + XDAS_UInt32 zeroes:16; + XDAS_UInt32 mb_addr:16; -typedef enum { - IH264VDEC_LEVEL1 = 0, - IH264VDEC_LEVEL1B, - IH264VDEC_LEVEL11, - IH264VDEC_LEVEL12, - IH264VDEC_LEVEL13, - IH264VDEC_LEVEL2, - IH264VDEC_LEVEL21, - IH264VDEC_LEVEL22, - IH264VDEC_LEVEL3, - IH264VDEC_LEVEL31, - IH264VDEC_LEVEL32, - IH264VDEC_LEVEL4, - IH264VDEC_LEVEL41, - IH264VDEC_LEVEL42, - IH264VDEC_LEVEL5, - IH264VDEC_LEVEL51, - IH264VDEC_MAXLEVELID = IH264VDEC_LEVEL51 -} IH264VDEC_LevelId; +} IH264VDEC_TI_CommonInfo; + +/** + ****************************************************************************** + * @struct IH264VDEC_TI_MotionVector + * + * @brief + * + ****************************************************************************** +*/ +typedef struct _IH264VDEC_TI_MotionVector +{ + XDAS_Int16 x; + XDAS_Int16 y; +} IH264VDEC_TI_MotionVector; + +/** + ****************************************************************************** + * @struct IH264VDEC_TI_CabacContext + * + * @brief + * + ****************************************************************************** +*/ +typedef struct _IH264VDEC_TI_CabacContext +{ + IH264VDEC_TI_MotionVector mvd_l0[4]; + IH264VDEC_TI_MotionVector mvd_l1[4]; + +} IH264VDEC_TI_CabacContext; + +/** + ****************************************************************************** + * @struct IH264VDEC_TI_TotalCoefLuma + * + * @brief + * + ****************************************************************************** +*/ +typedef struct _IH264VDEC_TI_TotalCoefLuma +{ + XDAS_UInt8 right[3]; + XDAS_UInt8 bottom_right; + XDAS_UInt8 bottom[3]; + XDAS_UInt8 zero; +} IH264VDEC_TI_TotalCoefLuma; + +/** + ****************************************************************************** + * @struct IH264VDEC_TI_TotalCoefChroma + * + * @brief + * + ****************************************************************************** +*/ +typedef struct _IH264VDEC_TI_TotalCoefChroma +{ + XDAS_UInt8 right_cb; + XDAS_UInt8 bottom_right_cb; + XDAS_UInt8 bottom_cb; + XDAS_UInt8 zero; + XDAS_UInt8 right_cr; + XDAS_UInt8 bottom_right_cr; + XDAS_UInt8 bottom_cr; + XDAS_UInt8 zero1; +} IH264VDEC_TI_TotalCoefChroma; + +/** + ****************************************************************************** + * @struct IH264VDEC_TI_CavlcContext + * + * @brief + * + ****************************************************************************** +*/ +typedef struct _IH264VDEC_TI_CavlcContext +{ + unsigned long long zeroes[2]; + IH264VDEC_TI_TotalCoefLuma total_coef_luma; + IH264VDEC_TI_TotalCoefChroma total_coef_chroma; + +} IH264VDEC_TI_CavlcContext; + +/** + ****************************************************************************** + * @struct IH264VDEC_TI_IntraPredMode + * + * @brief + * + ****************************************************************************** +*/ +typedef struct _IH264VDEC_TI_IntraPredMode +{ + XDAS_UInt32 ipred_mode0:4; + XDAS_UInt32 ipred_mode1:4; + XDAS_UInt32 ipred_mode2:4; + XDAS_UInt32 ipred_mode3:4; + XDAS_UInt32 ipred_mode4:4; + XDAS_UInt32 ipred_mode5:4; + XDAS_UInt32 ipred_mode6:4; + XDAS_UInt32 ipred_mode7:4; + XDAS_UInt32 ipred_mode8:4; + XDAS_UInt32 ipred_mode9:4; + XDAS_UInt32 ipred_mode10:4; + XDAS_UInt32 ipred_mode11:4; + XDAS_UInt32 ipred_mode12:4; + XDAS_UInt32 ipred_mode13:4; + XDAS_UInt32 ipred_mode14:4; + XDAS_UInt32 ipred_mode15:4; + +} IH264VDEC_TI_IntraPredMode; + + +/** + ****************************************************************************** + * @struct IH264VDEC_TI_MbPredType + * + * @brief + * + ****************************************************************************** +*/ +typedef struct _IH264VDEC_TI_MbPredType +{ + XDAS_UInt32 mbskip:1; + XDAS_UInt32 tr8x8:1; + XDAS_UInt32 mb_field:1; + XDAS_UInt32 cond_mbskip:1; + XDAS_UInt32 c_ipred_mode:2; + XDAS_UInt32 zero:1; + XDAS_UInt32 end_of_slice:1; + XDAS_UInt32 mb_y_mod2:1; + XDAS_UInt32 zero1:7; + XDAS_UInt32 refidx_equal_flag_l0:1; + XDAS_UInt32 refidx_equal_flag_l1:1; + XDAS_UInt32 mv_equal_flag_l0:1; + XDAS_UInt32 mv_equal_flag_l1:1; + XDAS_UInt32 zeroes:4; + XDAS_UInt32 mb_type:8; + XDAS_UInt8 sub_mb_type[4]; + +} IH264VDEC_TI_MbPredType; + +/** + ****************************************************************************** + * @struct IH264VDEC_TI_QpCbp + * + * @brief + * + ****************************************************************************** +*/ +typedef struct _IH264VDEC_TI_QpCbp +{ + XDAS_UInt32 cbp; + XDAS_UInt8 qp_y; + XDAS_UInt8 qp_cb; + XDAS_UInt8 qp_cr; + XDAS_UInt8 zero; +} IH264VDEC_TI_QpCbp; + +/** + ****************************************************************************** + * @struct IH264VDEC_TI_RefPicControl + * + * @brief + * + ****************************************************************************** +*/ +typedef struct _IH264VDEC_TI_RefPicControl +{ + XDAS_UInt8 refidx[4]; + XDAS_UInt8 refpicid[4]; + +} IH264VDEC_TI_RefPicControl; + +/** + ****************************************************************************** + * @struct IH264VDEC_TI_MvBidirectional16 + * + * @brief + * + ****************************************************************************** +*/ +typedef struct _IH264VDEC_TI_MvBidirectional16 +{ + IH264VDEC_TI_MotionVector mv_forward[16]; + IH264VDEC_TI_MotionVector mv_backward[16]; +} IH264VDEC_TI_MvBidirectional16; + + +/** + ****************************************************************************** + * @struct IH264VDEC_TI_MvBidirectional4 + * + * @brief + * + ****************************************************************************** +*/ +typedef struct _IH264VDEC_TI_MvBidirectional4 +{ + IH264VDEC_TI_MotionVector mv_forward[4]; + IH264VDEC_TI_MotionVector mv_backward[4]; + +} IH264VDEC_TI_MvBidirectional4; + +/** + ****************************************************************************** + * @struct IH264VDEC_TI_MbInfo + * + * @brief This structure details the data format for MB information shared to + * application. This helps application to understand all fields + * the way codec uses MB info internally. This structure is of size + * 208 Bytes. + * + * @param info : This elements gives details about the MB placement in the + * frame. + * + * @param cabac: This field holds the context data for a CABAC coded MB + * + * @param cavlc: This field holds the context data for a CAVLC coded MB + * + * @param ipred_mode: This field holds information of intra prediction modes + * at 4x4 level, for intra coded MB. + * + * @param mb_pred_type: This indicates prediction specific details for inter + * coded MB + * + * @param qp_cbp: This gives coded & QP informations for both LUMA & CHROMA + * components of a Macro Block. + * + * @param l0_ref_pic_control: Informs all details about reference indices + * at 8x8 block level in L0 direction + * + * @param l1_ref_pic_control: Informs all details about reference indices + * at 8x8 block level in L1 direction + * + * @param mv_forward: Lists all Motion vectors at 4x4 level in L0 direction + * + * @param bidirectional16: Lists all Motion vectors at 4x4 level in both + * directions + * + * @param bidirectional4: Lists all Motion vectors at 8x8 level in both + * directions + * + ****************************************************************************** +*/ +typedef struct _IH264VDEC_TI_MbInfo +{ + IH264VDEC_TI_CommonInfo info; + + union { + IH264VDEC_TI_CabacContext cabac; + IH264VDEC_TI_CavlcContext cavlc; + } IH264VDEC_TI_context; + IH264VDEC_TI_IntraPredMode ipred_mode; + IH264VDEC_TI_MbPredType mb_pred_type; + IH264VDEC_TI_QpCbp qp_cbp; + IH264VDEC_TI_RefPicControl l0_ref_pic_control; + IH264VDEC_TI_RefPicControl l1_ref_pic_control; + + union { + IH264VDEC_TI_MotionVector mv_forward[16]; + IH264VDEC_TI_MvBidirectional16 bidirectional16; + IH264VDEC_TI_MvBidirectional4 bidirectional4; + } IH264VDEC_TI_motion_vecs; -#endif /* __IH264VDEC_H__ */ +} IH264VDEC_TI_MbInfo; +#endif /* IH264VDEC_ */ diff -Nru dce-1.6.5.4/packages/ivahd_codecs/ti/sdo/codecs/h264enc/ih264enc.h dce-1.6.7.3/packages/ivahd_codecs/ti/sdo/codecs/h264enc/ih264enc.h --- dce-1.6.5.4/packages/ivahd_codecs/ti/sdo/codecs/h264enc/ih264enc.h 2012-09-24 15:13:39.000000000 +0000 +++ dce-1.6.7.3/packages/ivahd_codecs/ti/sdo/codecs/h264enc/ih264enc.h 2012-11-28 09:54:14.000000000 +0000 @@ -1,49 +1,2808 @@ +/* ====================================================================== + * Copyright (C) 2010 Texas Instruments Incorporated + * + * All rights reserved. Property of Texas Instruments Incorporated. + * Restricted rights to use, duplicate or disclose this code are + * granted through contract. + * + * The program may not be used without the written permission + * of Texas Instruments Incorporated or against the terms and conditions + * stipulated in the agreement under which this program has been + * supplied. + * ====================================================================*/ /* - * Copyright (c) 2010, Texas Instruments Incorporated - * All rights reserved. + ******************************************************************************* + * + * HDVICP2.0 Based H.264 HP Encoder + * + * "HDVICP2.0 Based H.264 HP Encoder" is software module developed on TI's + * HDVICP2 based SOCs. This module is capable of compressing a 4:2:0 Raw + * video into a high/main/baseline profile bit-stream. Based on ISO/IEC + * 14496-10." + * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/ + * ALL RIGHTS RESERVED + ******************************************************************************* +*/ +/** + ****************************************************************************** + * @file ih264enc.h + * + * @brief IH264ENC Interface Header + * + * @author Pramod Kumar Swami (pramods@ti.com) + * + * @version 0.1 - Nov 30,2008 : Initial Version [Pramod] + * + * @version 0.2 - March 16,2009 [Pramod] + * A. Name change of interface file ih264venc.h to ih264enc.h + * B.Change the name of macros/enums + * MAXNUMSLCGPS --> IH264ENC_MAXNUMSLCGPS + * MAX_NUM_SLICE_START_OFFSET --> IH264ENC_MAX_NUM_SLICE_START_OFFSET + * IH264ENC_GOPSTRUCTURE_OPEN --> IH264ENC_GOPSTRUCTURE_NONUNIFORM + * IH264ENC_GOPSTRUCTURE_CLOSE --> IH264ENC_GOPSTRUCTURE_UNIFORM + * C. Definition of IH264ENC_BufferLevel changed from buffer to time + * D. mbMetaDataEnable is defined + * E. Following information (fields/definition) is newly added + * IH264ENC_VERSION_LENGTH : For getting the encoder version via Control + * method + * meta data support (IH264ENC_MAX_SEI_METADTA_BUFSIZE) + * Support and definition of Error Codes + * Enum for level 3.0 and 3.1 was missing added + * Poc type 1 enum added + * Support for NALU masks: no change in definition + * Few more enumeration added for IH264ENC_VUICodingPreset, + * IH264ENC_VideoFormat and IH264ENC_AspectRatioIdc + * IH264ENC_VUICodingParams structure parameter added to creation + * time parameters + * New enumeration added to IH264ENC_InterlaceCodingType: MRF, SPF + * + * @version 0.3 - November 2009 [Pramod] + * A. Added interface for force SKIP, it is temporarily here and will be + * used from base class of IVIDENC later + * B. Added user defined scaling matrix bit in input meta data + * @version 0.4 - Feb 2010 [Deepak] + * Addition of error bit(IH264ENC_ErrorBit : bit 7) for max bit rate + * voilation scenario in tighter RC scenario + * @version 0.5 - Mar 2010 [Kumar] : Added more enumerations to have all + * levels supported by H264 standard to make it future proof. + * @version 0.6 - Apr 2010 [Kumar] : Added error bit for checking + * hdvicp state IH264ENC_IMPROPER_HDVICP2_STATE + * @version 0.7 - Jun 2010 : [Nirmal, Pramod] Changed default value of + * BufferLevel since its is not good for + * low delay applications (IR: SDOCM00071692) + * @version 0.8 - Apr 2010 [Uday] : Modified the definition of initial + * buffer level from taking in descrete values to continuas values + * @version 0.9 - May 2010 [Uday] : converted the reserve parameter for + * enabling GMV in SEI to dedicated parameter + * + * @version 0.10 - May 2010 [Uday] : Extended the outArgs to return the + * initial buffer level + * @version 0.11 -Jun 2010 [Uday] : Added interface constraint set flags + * @version 0.12 - Aug 2010 [Nirmal] : Added data elements for static MB + * count support + * @version 0.13 -Aug 2010 [Girish Murthy] : Added interface for + * RCDO profile support + * @ version 0.14 -Sep 2010 [Kumar] : Defined a bit for + * IH264ENC_MAX_BYTES_VOILATION_IN_SLICEMODE_BYTES + * @ version 0.15 -Sep 2010 [Kumar] : Added a new extenetd parameter for + * algorithm creation enableLongTermRefFrame + * @version 0.16- Sept 2010[Girish]: Support for PRC and partial frame + * skip control + * @version 0.17 Sep 2010 : Added flag to control the insertion of + * HRD parameters in VUI part of bit-stream[Nirmal] + * @version 0.18 Sep2010 : Added error bit IH264ENC_DATASYNCH_RUN_TIME_ERROR + * multiplexed with IH264ENC_UNSUPPORTED_FMOCODINGPARAMS + * @version 0.19 Sep2010 : Added IH264ENC_FramePackingParams structure + * required for encoding the frame packing SEI + * @version 0.20 Sep 2010 : [Gajanan] Added IH264ENC_StereoInfoParams + * Structure for Steroe Video Coding + * parameters and StereoInfoPreset enums. + * @version 0.21 Apr 2011 : [Kumar] Added support for new long- + * trem frame referencing scheme + * IH264ENC_LTRP_REFERTOP_PROACTIVE + * @version 0.22 June 2011: Inroduction of new preset + * IH264_INTERCODING_MED_SPEED_HIGH_QUALITY for + * inter coding preset. + * @version 0.23 July 2011: Added discardSavedBits in RateControl structure + * SDOCM00082533 + * @version 0.24 July 2011: Added structures and enum for ROI support.[Gajanan] + * @version 1.0 Dec 2011: Added parameter for HRD compliance control[Girish] + * @version 1.1 Dec 2011: Added frameSkipThMulQ5 & vbvUseLevelThQ5 in + * RateControl structure for CBR quality improvement + * [Karthick] + * @version 1.2 Jan 2012: Renamed MAX_ROI macro as IH264ENC_MAX_ROI + * [Harris] + * @version 1.3 Mar 2012: Added a parameter enableErrorCheck in + * IH264ENC_ProcessParamsList.[Santoshkumar S K] + * @version 1.4 May 2012: Changed parameter name. Replaced + * inArgs->lateAcquireArg by inArgs->processId. + * [Santoshkumar S K] + * @version 1.5 May 2012: SDOCM00091641 : Added temporalId parameter to + * IH264ENC_OutArgs.This holds the Temporal + * layer Id of current frame in H-P encoding. + * (for base layer value is 0)[Santoshkumar S K] + * @version 1.6 Aug 2012: Redundant exposure of GDR configuration + * parameters as a part of Extended Dynamic structure + * are removed(SDOCM00095027)[Santoshkumar S K] + * @version 1.7 Sep 2012: Default value of scalingmatrixPreset is changed + * from NONE(0) to NORMAL(1)[Santoshkumar S K] + ***************************************************************************** +*/ + +/** + * @defgroup HDVICP2H264 IH264ENC_TI (V7M) + * @ingroup m3 + * + * The IH264ENC_TI interface enables encoding in H264 format * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of Texas Instruments Incorporated nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _IH264ENC_H_ +#ifndef _IH264ENC_H_ /* --{ */ + #define _IH264ENC_H_ +#include #include +/** @ingroup HDVICP2H264 */ +/*@{*/ + + +#ifdef __cplusplus +extern "C" { +#endif + + +/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ +/* Definition of all the macros define by this interafce */ +/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + +/** + Maximum number of slice groups supported by H.264 Encoder +*/ +#define IH264ENC_MAXNUMSLCGPS (2) + +/** + Maximum Number of slice start points +*/ +#define IH264ENC_MAX_NUM_SLICE_START_OFFSET (3) + +/** maximum size for SEI_USER_DATA_UNREGISTERED SEI message */ +#define IH264ENC_MAX_SEI_METADTA_BUFSIZE (0x3FF) + +/** + Length of the version string. The memory to get version + number is owned by application +*/ +#define IH264ENC_VERSION_LENGTH (64) + +/** + control method commands +*/ +#define IH264ENC_GETSTATUS XDM_GETSTATUS +#define IH264ENC_SETPARAMS XDM_SETPARAMS +#define IH264ENC_RESET XDM_RESET +#define IH264ENC_FLUSH XDM_FLUSH +#define IH264ENC_SETDEFAULT XDM_SETDEFAULT +#define IH264ENC_GETBUFINFO XDM_GETBUFINFO + +/** + Maximum number of ROIs supported inside the frame. +*/ +#define IH264ENC_MAX_ROI 36 + +typedef IVIDENC2_Cmd IH264ENC_Cmd; + +/** + Macro to set particular NAL bit in the nal unit mask +*/ +#define IH264ENC_SET_NALU(naluPresentMask, NALU) \ + { \ + naluPresentMask = ((naluPresentMask) | (1 << IH264_NALU_TYPE_##NALU));\ + } + +/** + Macro to clear particular NAL bit in the nal unit mask +*/ +#define IH264ENC_CLEAR_NALU(naluPresentMask, NALU) \ + { \ + naluPresentMask = ((naluPresentMask) & (~(1 << IH264_NALU_TYPE_##NALU)));\ + } + +/** + Macro to get particular NAL bit in the nal unit mask +*/ +#define IH264ENC_GET_NALU(naluPresentMask, NALU)\ + ((naluPresentMask) & (1 << IH264_NALU_TYPE_##NALU)) + + + +/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ +/* Definition of all the Enumeration define by this interafce */ +/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + +/** + * @enum IH264ENC_ErrorBit + * @brief error informations of IVAHD H264 encoder implementation by TI. + * + * @remarks When an internal error occurs, the algorithm will return + * an error return value (e.g. EFAIL, EUNSUPPORTED) + * + * @remarks The value of each enum is the bit which is set. + * + * @remarks Bits 8-15 are defined by XDM and hence not used by codec + * implementation. + * rest all bits are used. XDM defined error bits are also active. + * + * @remarks The algorithm can set multiple bits to 1 based on conditions. + * e.g. it will set bits #XDM_FATALERROR (fatal) and + * #XDM_UNSUPPORTEDPARAM (unsupported params) in case + * of unsupported run time parameters. + * + */ + +typedef enum { + IH264ENC_LEVEL_INCOMPLAINT_PARAMETER = 0, + /**< Bit 0 - level incomplaint parameters. + * @remarks This error is applicable when some parameters are set + * which are not meeting the limit defined by H.264 standard + * Table A-1 Level limits. It can be categorized under + * following category : + * IH264ENC_LEVEL_INCOMPLAINT_RESOLUTION : Invalid width/height + * IH264ENC_LEVEL_INCOMPLAINT_HRDBUFSZIE : Invalid HrdBufferSize + * IH264ENC_LEVEL_INCOMPLAINT_BITRATE : Invalid Bit Rate + * IH264ENC_LEVEL_INCOMPLAINT_MBSPERSECOND : Invalid FrameRate/ + * resolution + * IH264ENC_LEVEL_INCOMPLAINT_DPBSIZE : Invalid DPB size + * For above 5 situations, only a signle bit (bit-0) is set as true + */ + + IH264ENC_PROFILE_INCOMPLAINT_CONTENTTYPE = 1, + /**< Bit 1 - Profile incomplaint content type. + * @remarks This error is applicable when + * IVIDENC2_Params::inputContentType is not set as + * IVIDEO_PROGRESSIVE but IVIDENC2_Params::profile is set + * as IH264_BASELINE_PROFILE + */ + + IH264ENC_PROFILE_INCOMPLAINT_FMO_SETTING = 2, + /**< Bit 2 - Profile incomplaint FMO setting. + * @remarks This error is applicable when FMO is enabled but + * IVIDENC2_Params::profile is not set as IH264_BASELINE_PROFILE + */ + + IH264ENC_PROFILE_INCOMPLAINT_TRANSFORMBLOCKSIZE = 3, + /**< Bit 3 - Profile incomplaint transform block size. + * @remarks This error is set when + * IH264ENC_Params::transformBlockSize != IH264_TRANSFORM_4x4 && + * IVIDENC2_Params::profile != IH264_HIGH_PROFILE + */ + + IH264ENC_PROFILE_INCOMPLAINT_INTERFRAMEINTERVAL = 4, + /**< Bit 4 - Profile incomplaint interframeInterval. + * @remarks This error is set when B frames are used with + * IH264_BASELINE_PROFILE + */ + + IH264ENC_PROFILE_INCOMPLAINT_SCALINGMATRIXPRESET = 5, + /**< Bit 5 - Profile incomplaint scaling matrix setting. + * @remarks This error is set when scaling matrix is used + * without IH264_HIGH_PROFILE + */ + + IH264ENC_PROFILE_INCOMPLAINT_ENTROPYCODINGMODE = 6, + /**< Bit 6 - Profile incomplaint entropy coding mode setting. + * @remarks This error is set when cabac is used + * without IH264_HIGH_PROFILE/MAIN profile + */ + + IH264ENC_MAX_BYTES_VOILATION_IN_SLICEMODE_BYTES = 6, + /**< Bit 6 - If number of bytes encoded in any of the + * slice in the currently encoded picture is crossing + * maximum unbit size then this bit will be set + * @remarks This error bit is shared between the + * create time parameter entropy coding mode + * + */ + + IH264ENC_MAX_BIT_RATE_VOILATION = 7, + /**< Bit 7 - Max bits for one Unit Voilation + * @remarks When max bit rate is enabled by user, + * than it is possible that codec might not be able + * honor max bit rate. This bit is set when bits consumed + * in one unit ( 1 sec) is more than the allocated as per the + * given max bit rate. If the frame rate is N , and if the + * max bit rate is voilated in M th frame than this bit will + * get set for frame M to N. + */ + IH264ENC_IMPROPER_HDVICP2_STATE = 16, + /**< Bit 16 - Device is not proper state to use. + */ + + IH264ENC_IMPROPER_STREAMFORMAT = 17, + /**< Bit 17 - stream format is not proper + * @remarks This error is set when streamFormat is set as + * IH264_NALU_STREAM but data synch is not enabled for putdata + */ + + IH264ENC_IMPROPER_POCTYPE = 18, + /**< Bit 18 - poc type is not proper + * @remarks This error is set when poc type 2 is used in + * presense of non reference frames + */ + + IH264ENC_IMPROPER_DATASYNC_SETTING = 19, + /**< Bit 19 - data synch settings are not proper + * @remarks This error is set when encoder is asked to operate + * at sub frame level but the call back function pointer is NULL + */ + + IH264ENC_UNSUPPORTED_VIDENC2PARAMS = 20, + /**< Bit 20 - Invalid videnc2 parameters + * @remarks This error is set when any parameter of struct + * IVIDENC2_Params is not in allowed range + */ + + IH264ENC_UNSUPPORTED_RATECONTROLPARAMS = 21, + /**< Bit 21 - Invalid rate control parameters + * @remarks This error is set when any parameter of struct + * IH264ENC_RateControlParams is not in allowed range + */ + + IH264ENC_UNSUPPORTED_INTERCODINGPARAMS = 22, + /**< Bit 22 - Invalid inter coding parameters + * @remarks This error is set when any parameter of struct + * IH264ENC_InterCodingParams is not in allowed range + */ + + IH264ENC_UNSUPPORTED_INTRACODINGPARAMS = 23, + /**< Bit 23 - Invalid Intra coding parameters + * @remarks This error is set when any parameter of struct + * IH264ENC_IntraCodingParams is not in allowed range + */ + + IH264ENC_UNSUPPORTED_NALUNITCONTROLPARAMS = 24, + /**< Bit 24 - Invalid nal unit coding parameters + * @remarks This error is set when any parameter of struct + * IH264ENC_NALUControlParams is not in allowed range + */ + + IH264ENC_UNSUPPORTED_SLICECODINGPARAMS = 25, + /**< Bit 25 - Invalid slice coding parameters + * @remarks This error is set when any parameter of struct + * IH264ENC_SliceCodingParams is not in allowed range + */ + + IH264ENC_UNSUPPORTED_LOOPFILTERPARAMS = 26, + /**< Bit 26 - Invalid loop filter related parameters + * @remarks This error is set when any parameter of struct + * IH264ENC_LoopFilterParams is not in allowed range + */ + IH264ENC_DATASYNCH_RUN_TIME_ERROR = 27, + /**< Bit 27 is muxed with incorrect FMO paramters setting. + * This will be set when codec inside IVAHD encounters + * erroneous situation, like + * a) when number of NALs in 1Kb of data is more than 8 + * b) when the blocks provided through getBuf call is not + * sufficient for all the NALs in one oage of SL2 stream. + */ + IH264ENC_UNSUPPORTED_N_FRAME_PROCESSCALL_PARAMS = 27, + /**< Bit 27 is also muxed with incorrect paramters setting in + * N frame process call scenario + */ + IH264ENC_UNSUPPORTED_FMOCODINGPARAMS = 27, + /**< Bit 27 - Invalid fmo parameters + * @remarks This error is set when any parameter of struct + * IH264ENC_FMOCodingParams is not in allowed range + */ + + IH264ENC_UNSUPPORTED_VUICODINGPARAMS = 28, + /**< Bit 28 - Invalid vui coding parameters + * @remarks This error is set when any parameter of struct + * IH264ENC_VUICodingParams is not in allowed range + */ + + IH264ENC_UNSUPPORTED_H264ENCPARAMS = 29, + /**< Bit 29 - Invalid Create time extended parameters + * @remarks This error is set when any parameter of struct + * IH264ENC_Params is not in allowed range + */ + + IH264ENC_UNSUPPORTED_VIDENC2DYNAMICPARAMS = 30, + /**< Bit 30 - Invalid base class dyanmic paaremeters during control + * @remarks This error is set when any parameter of struct + * IVIDENC2_DynamicParams is not in allowed range + */ + + IH264ENC_UNSUPPORTED_H264ENCDYNAMICPARAMS = 31 + /**< Bit 31 - Invalid exteded class dyanmic paaremeters during control + * @remarks This error is set when any parameter of struct + * IH264ENC_DynamicParams (excluding embedded structures) is not in + * allowed range + */ + +} IH264ENC_ErrorBit; + +/** + * @enum IH264ENC_Level + * @brief Level Identifier for H.264 Encoder +*/ +typedef enum { + IH264_LEVEL_10 = 10, /**< Level 1.0 */ + IH264_LEVEL_1b = 9, /**< Level 1.b */ + IH264_LEVEL_11 = 11, /**< Level 1.1 */ + IH264_LEVEL_12 = 12, /**< Level 1.2 */ + IH264_LEVEL_13 = 13, /**< Level 1.3 */ + IH264_LEVEL_20 = 20, /**< Level 2.0 */ + IH264_LEVEL_21 = 21, /**< Level 2.1 */ + IH264_LEVEL_22 = 22, /**< Level 2.2 */ + IH264_LEVEL_30 = 30, /**< Level 3.0 */ + IH264_LEVEL_31 = 31, /**< Level 3.1 */ + IH264_LEVEL_32 = 32, /**< Level 3.2 */ + IH264_LEVEL_40 = 40, /**< Level 4.0 */ + IH264_LEVEL_41 = 41, /**< Level 4.1 */ + IH264_LEVEL_42 = 42, /**< Level 4.2 */ + IH264_LEVEL_50 = 50, /**< Level 5.0 */ + IH264_LEVEL_51 = 51 /**< Level 5.1 */ + +} IH264ENC_Level; + + +/** + * @enum IH264ENC_Profile + * @brief Profile Identifier for H.264 Encoder +*/ +typedef enum { + IH264_BASELINE_PROFILE = 66, /**< BaseLine Profile */ + IH264_MAIN_PROFILE = 77, /**< Main Profile */ + IH264_EXTENDED_PROFILE = 88, /**< Extended Profile */ + IH264_HIGH_PROFILE = 100, /**< High Profile */ + IH264_DEFAULT_PROFILE = IH264_HIGH_PROFILE, /**< Default Profile */ + IH264_HIGH10_PROFILE = 110, /**< High 10 Profile */ + IH264_HIGH422_PROFILE = 122, /**< High 4:2:2 Profile */ + IH264SVC_BASELINE_PROFILE = 83, /**< SVC Baseline Profile */ + IH264SVC_HIGH_PROFILE = 86 /**< SVC High Profile */ +} IH264ENC_Profile; + +/** + * @enum IH264ENC_MetadataType + * @brief Meta Data for H.264 encoder + + The way to pass meta data to encode is via inBufs to the encoder during + process call. + The way to get meta data from encode is via outBufs of the encoder during + process call. + + When application request the buffer infos via control call with + XDM_GETBUFINFO, encoder should count a buffer to have meta data at + input/output level for this purpose. If for some metadata size is not known + by encoder then it should return size =-1 so that application can + allocate as per its knowledge. Same way for some meta-data application + might not provide the size to codec via XDM2_SingleBufDesc.bufSize.bytes, + in that case application can set it to -1. The meta data which has size + field in its format, uses size of buffer from that field only. + Example: User want to insert SEI_USER_DATA_UNREGISTERED meta data at each + IDR picture, the following steps should be followed + + 1. Create the encoder object with IVIDENC2_Params::metadataType[0] = + IH264_SEI_USER_DATA_UNREGISTERED and metadataType[1] and metadataType[2] + = IVIDEO_METADATAPLANE_NONE + + Also have IH264ENC_SET_NALU(naluPresentMaskIDRPicture, SEI) + 2. Call Control function with XDM_GETBUFINFO. Encoder should return one + additional input buffer as required. size of the buffer will be -1 as + encoder doesn't know the size + 3. Application should have a memory allocated for this meta data and pass on + to the encoder via IVIDEO2_BufDesc *inBufs->numMetaPlanes = 1 + +----------------+ + inBufs->metadataPlaneDesc[index].buf = pBuffer ; ---> | size | payLoad | + inBufs->metadataPlaneDesc[index].bufSize.bytes = -1 ; +----------------+ + since the meta-data format includes size field, encoder will read size from + there and utilize it. + + index of metadataPlaneDesc is the index of metaDataType which is holding + the particular meta data type. In this example metadataType[0] is holding + IH264_SEI_USER_DATA_UNREGISTERED so index = 0 of metadataPlaneDesc points + to IH264_SEI_USER_DATA_UNREGISTERED specific meta data +*/ + +typedef enum { + IH264_SEI_USER_DATA_UNREGISTERED = XDM_CUSTOMENUMBASE, + /**< H.264 allows inserting SEI message for any user data. refer section + * D.1.6 of H.264 standard. + * By setting this value to any if IVIDENC2_Params::metadataType[i] + * user can provide its user data SEI to be inserted + * in H.264 bit-stream + * The format of user data is as below + * typedef struct { + * U32 size; only lower 10-bits are considered + * U08 payload[]; number of bytes for payload is indicated by first + * 32 bit field size + * } + * The picture which uses this metadata will be decided by naluPresentMask::SEI + * bit. Example + * if SEI bit of only naluPresentMaskStartOfSequence is set to 1 then this meta + * data will be used only during start of sequence + * Encoder can accept maximum size of this meta data as 1023 bytes < 1K. + * Only lower 10-bits of size field is used by encoder + */ + + IH264_REGION_OF_INTEREST, + /**< Not defined yet the format but this field is to control the encoder to + * accept ROI data as input + */ + + IH264_USER_DEFINED_SCALINGMATRIX + /**< H.264 allows inserting user defined scaling matrices. + * By setting this value to any if IVIDENC2_Params::metadataType[i] + * user can provide its user data SEI to be inserted in H.264 bit-stream + * The format of user data is as below + * typedef struct { + * U32 size; only lower 10-bits are considered + * U08 payload[]; number of bytes for payload is indicated by first + * 32 bit field size + * } + * format of payload is for scaling matrix is defined in User GUide + */ +} IH264ENC_MetadataType; + +/** + * @enum IH264ENC_Control + * @brief Diffrent types of controls for encoding frame + * Eg: refere long term reference frame + */ + +typedef enum { + IH264ENC_CTRL_REFER_LONG_TERM_FRAME = XDM_CUSTOMENUMBASE, + /**< Refere long term reference frame (I/IDR frames) when + * IH264ENC_LTRPScheme is IH264ENC_LTRP_REFERTOIDR + */ + IH264ENC_CTRL_NOWRITE_NOREFUPDATE, + /**< Current frame is a non-referencing P frame and do + * not update the reference frame for this frame. Applicable + * when IH264ENC_LTRPScheme is IH264ENC_LTRP_REFERTOP_PROACTIVE + */ + IH264ENC_CTRL_WRITE_NOREFUPDATE, + /**< Current frame is a referencing P frame and do + * not update the reference frame for this frame. Applicable + * when IH264ENC_LTRPScheme is IH264ENC_LTRP_REFERTOP_PROACTIVE + */ + IH264ENC_CTRL_NOWRITE_REFUPDATE, + /**< Current frame is a non-referencing P frame and + * update the reference frame for this frame. Applicable + * when IH264ENC_LTRPScheme is IH264ENC_LTRP_REFERTOP_PROACTIVE + */ + IH264ENC_CTRL_WRITE_REFUPDATE, + /**< Current frame is a referencing P frame and + * update the reference frame for this frame. Applicable + * when IH264ENC_LTRPScheme is IH264ENC_LTRP_REFERTOP_PROACTIVE + */ + IH264ENC_CTRL_START_GDR + /**< Current frame is a choosen to start the GDR activity. Applicable + * when intraRefreshMethod is IH264_INTRAREFRESH_GDR + */ +} IH264ENC_Control; + +/** + * @enum IH264ENC_LTRPScheme + * @brief Diffrent types of long term-frame referencing scheme + * Eg: Mark all the I frames as long term-reference frame + */typedef enum { + IH264ENC_LTRP_NONE = 0, + /**< No longterm refernce frame in the sequnce + */ + IH264ENC_LTRP_REFERTO_PERIODICLTRP = 1, + /**< Mark frames as long-term reference frame with the period given + * by LTRPPeriod of IH264ENC_Params and + * based on the frame control IH264ENC_Control, refer to + * the long-term reference frame . + */ + IH264ENC_LTRP_REFERTOP_PROACTIVE =2, + /**< Two long term frames are supported in this schme and + * long-term index marking and refernce frame update is done based + * the IH264ENC_Control values + */ + IH264ENC_LTRP_REFERTOP_REACTIVE = 3 + /**< Mark frames as long-term reference frame with the period given + * by LTRPPeriod of IH264ENC_Params. + * At any point of time there will be 2 long-term frames and + * based on the frame control IH264ENC_Control, refer to + * the last long-term reference frame . + */ +}IH264ENC_LTRPScheme; + +/** + * @enum IH264ENC_PicOrderCountType + * @brief Picture Order Count Type Identifier for H.264 Encoder +*/ +typedef enum { + IH264_POC_TYPE_0 = 0, /**< POC type 0 */ + IH264_POC_TYPE_DEFAULT = IH264_POC_TYPE_0, /**< Default poc type */ + IH264_POC_TYPE_1 = 1, /**< POC type 1 */ + IH264_POC_TYPE_2 = 2, /**< POC type 2 */ + IH264_POC_TYPE_MAX + +} IH264ENC_PicOrderCountType; + + +/** + + @enum IH264ENC_ScalingMatPreset + @brief These enumerations control the type of scaling matrix picked up + by encoder + +*/ +typedef enum { + IH264_SCALINGMATRIX_NONE = 0, + /**< Default Scaling matrix (No scaling) */ + IH264_SCALINGMATRIX_NORMAL = 1, + /**< Flat Scaling matrix: part of standard (NO Scaling Matrix) */ + IH264_SCALINGMATRIX_DEFAULT = IH264_SCALINGMATRIX_NORMAL, + /**< For normal contents */ + IH264_SCALINGMATRIX_NOISY = 2, + /**< For noisy contents */ + IH264_SCALINGMATRIX_STD_DEFAULT = 3, + /**< Default Scaling Matrix provided by H.264 standard */ + IH264_SCALINGMATRIX_USERDEFINED_SPSLEVEL = 4, + /**< User defined SM at SPS level*/ + IH264_SCALINGMATRIX_USERDEFINED_PPSLEVEL = 5, + /**< User defined SM at PPS level*/ + IH264_SCALINGMATRIX_MAX + +} IH264ENC_ScalingMatPreset; + + +/** + + @enum IH264ENC_RateControlAlgo + @brief These enumerations control the type of rateControl algo to be picked + up by encoder. Only useful if IVIDENC2::rateControlPreset is set as + IVIDEO_USER_DEFINED + +*/ +typedef enum { + IH264_RATECONTROL_PRC = 0, /**< Perceptual Rate Control, + * controls the QP @ MB level + */ + IH264_RATECONTROL_PRC_LOW_DELAY = 1, /** Low Delay Rate Control */ + IH264_RATECONTROL_DEFAULT = IH264_RATECONTROL_PRC /** Default rcAlgo is PRC */ + +} IH264ENC_RateControlAlgo; + + +/** + + @enum IH264ENC_FrameQualityFactor + @brief These enumerations control the quality factor b/w two types of frames + For example if user want I frame Quality to be given more importance + than P frame, one can define it to be higher quality factor + +*/ +typedef enum { + IH264_QUALITY_FACTOR_1 = 0, /**< Same Quality factor + * b/w two types of frame + */ + IH264_QUALITY_FACTOR_DEFAULT = IH264_QUALITY_FACTOR_1, + /**< Default Quality factor + * to be used by encoder + */ + IH264_QUALITY_FACTOR_2 = 1, /**< High Quality factor to + * one frame type b/w two types + of frame + */ + IH264_QUALITY_FACTOR_3 = 2, /**< Higher Quality factor to + one frame type b/w two types of frame + */ + IH264_QUALITY_FACTOR_MAX + +} IH264ENC_FrameQualityFactor; + + + +/** + + @enum IH264ENC_RateControlParamsPreset + @brief These enumerations control the RateControl Params + +*/ + +typedef enum { + IH264_RATECONTROLPARAMS_DEFAULT = 0, + /**< Default Rate Control params */ + IH264_RATECONTROLPARAMS_USERDEFINED = 1, + /**< User defined Rate Control params */ + IH264_RATECONTROLPARAMS_EXISTING = 2, + /**< Keep the Rate Control params as existing. This is + * useful because during control call if user don't want + * to chnage the Rate Control Params + */ + IH264_RATECONTROLPARAMS_MAX + +} IH264ENC_RateControlParamsPreset; + +/** + + @enum IH264ENC_InterCodingPreset + @brief These enumerations control the type of inter coding + +*/ + +typedef enum { + IH264_INTERCODING_DEFAULT = 0, /**< Default Inter coding params */ + IH264_INTERCODING_USERDEFINED = 1, /**< User defined inter coding params */ + IH264_INTERCODING_EXISTING = 2, /**< Keep the inter coding params as + * existing. This is useful because + * during control call if user don't + * want to chnage the inter coding Params + */ + IH264_INTERCODING_MED_SPEED_HIGH_QUALITY = 3, /**< Med Speed High Quality*/ + IH264_INTERCODING_HIGH_SPEED = 4, /**< High Speed Preset*/ + IH264_INTERCODING_MAX + +} IH264ENC_InterCodingPreset; + +/** + + @enum IH264ENC_MeAlgoMode + @brief These enumerations control the mealgo selected + +*/ + +typedef enum { + IH264ENC_MOTIONESTMODE_NORMAL = 0, /**< Normal meAlgo */ + IH264ENC_MOTIONESTMODE_HIGH_SPEED = 1, /**< meAlgo for HIGH SPEED */ + IH264ENC_MOTIONESTMODE_DEFAULT = IH264ENC_MOTIONESTMODE_NORMAL, + /**< Default meAlgo */ + IH264ENC_MOTIONESTMODE_MAX + +} IH264ENC_MeAlgoMode; + +/** + + @enum IH264ENC_IntraCodingBias + @brief These enumerations control the number of intra Mbs to be encoded + +*/ + +typedef enum { + IH264ENC_INTRACODINGBIAS_NORMAL = 0, + /**< Normal number of intra Mbs */ + IH264ENC_INTRACODINGBIAS_HIGH_SPEED = 12, + /**< intra Mbs restricted for HIGH SPEED */ + IH264ENC_INTRACODINGBIAS_DEFAULT = IH264ENC_INTRACODINGBIAS_NORMAL, + /**< Default intra codign bias */ + IH264ENC_INTRACODINGBIAS_MAX + +} IH264ENC_IntraCodingBias; + +/** + + @enum IH264ENC_InterBlockSize + @brief These enumerations are defined for minimum Inter block size + +*/ + +typedef enum { + IH264_BLOCKSIZE_16x16 = 0, /**< 16x16 Block size */ + IH264_BLOCKSIZE_DEFAULT = IH264_BLOCKSIZE_16x16, /**< Default block size */ + IH264_BLOCKSIZE_8x8 = 1, /**< 8x8 Block size */ + IH264_BLOCKSIZE_4x4 = 2, /**< 4x4 Block size */ + IH264_BLOCKSIZE_MAX + +} IH264ENC_InterBlockSize; + +/** + + @enum IH264ENC_BiasFactor + @brief Encoder uses bias b/w two possible chices for lot of decisions. + It is to control the mild/strong ness of the biasing + +*/ +typedef enum { + IH264_BIASFACTOR_LOW = 0, + /**< Low biasing */ + IH264_BIASFACTOR_MEDIUM = 1, + /**< Normal/Med biasing */ + IH264_BIASFACTOR_NORMAL = IH264_BIASFACTOR_MEDIUM, + /**< Normal/Med biasing */ + IH264_BIASFACTOR_DEFAULT = IH264_BIASFACTOR_MEDIUM, + /**< Default :Normal/Med biasing*/ + IH264_BIASFACTOR_HIGH = 2, + /**< High biasing */ + IH264_BIASFACTOR_MILD = 4, /**< Mild biasing */ + IH264_BIASFACTOR_ADAPTIVE = 5, /**< Adaptive biasing */ + IH264_BIASFACTOR_MAX +} IH264ENC_BiasFactor; + + +/** + + @enum IH264ENC_IntraRefreshMethods + @brief Refresh method Type Identifier for H.264 Encoder + +*/ + +typedef enum { + IH264_INTRAREFRESH_NONE = 0, /**< Doesn't insert forcefully intra + macro blocks */ + IH264_INTRAREFRESH_DEFAULT = IH264_INTRAREFRESH_NONE, + /**< Default intra refresh is OFF */ + IH264_INTRAREFRESH_CYCLIC_MBS, /**< Insters intra macro blocks in a + * cyclic fashion cyclic interval is + * equal to intraRefreshRate + */ + IH264_INTRAREFRESH_CYCLIC_SLICES, /**< Insters Intra Slices(Row based) in + * a cyclic fashion: + * cyclic interval is equal to + * intraRefreshRate + */ + IH264_INTRAREFRESH_RDOPT_MBS, /**< position of intra macro blocks is + * intelligently chosen by encoder, + * but the number of forcely coded + * intra macro blocks in a frame is + * gaurnteed to be equal to + * totalMbsInFrame/intraRefreshRate + */ + IH264_INTRAREFRESH_GDR, /**< Instead of a sudden Intra Refresh + * of entire frame, the frame is refreshed + * Gradualy over a duration (which is con- + * figerable) of frames with refresh + * happening by Intra coded rows scanning + * from top to bottom of the scene/picture. + */ + IH264_INTRAREFRESH_MAX + +} IH264ENC_IntraRefreshMethods; + +/** + + @enum IH264ENC_ChormaComponent + @brief These enumerations control the selction of chroma component to perfom + chroma intra estimation + +*/ +typedef enum { + IH264_CHROMA_COMPONENT_CB_CR_BOTH = 0, /**< BOth Cb and Cr component */ + IH264_CHROMA_COMPONENT_CR_ONLY = 1, /**< Only Cr Component */ + IH264_CHROMA_COMPONENT_DEFAULT = IH264_CHROMA_COMPONENT_CR_ONLY, + /**< Default is Only Cr Component */ + IH264_CHROMA_COMPONENT_MAX + +} IH264ENC_ChormaComponent; + + +/** + + @enum IH264ENC_IntraCodingPreset + @brief These enumerations control the type of intra coding + +*/ + +typedef enum { + IH264_INTRACODING_DEFAULT = 0, /**< Default intra coding params */ + IH264_INTRACODING_USERDEFINED = 1, /**< User defined intra coding params */ + IH264_INTRACODING_EXISTING = 2, + IH264_INTRACODING_HIGH_SPEED = 3, /**< High Speed intra Coding Preset */ + IH264_INTRACODING_MAX + +} IH264ENC_IntraCodingPreset; + +/** + + @enum IH264ENC_NALUnitType + @brief These enumerations define the NALU type supported by H.264 + +*/ +typedef enum { + IH264_NALU_TYPE_UNSPECIFIED = 0, + /**< Unspecified Slice Type */ + IH264_NALU_TYPE_SLICE = 1, + /**< slice of a non-IDR picture */ + IH264_NALU_TYPE_SLICE_DP_A = 2, + /**< Coded slice data partition A */ + IH264_NALU_TYPE_SLICE_DP_B = 3, + /**< Coded slice data partition B */ + IH264_NALU_TYPE_SLICE_DP_C = 4, + /**< Coded slice data partition C */ + IH264_NALU_TYPE_IDR_SLICE = 5, + /**< slice of an IDR picture */ + IH264_NALU_TYPE_SEI = 6, + /**< Supplemental enhancement information */ + IH264_NALU_TYPE_SPS = 7, + /**< Sequence parameter set */ + IH264_NALU_TYPE_PPS = 8, + /**< Picture parameter set */ + IH264_NALU_TYPE_AUD = 9, + /**< Access unit delimiter */ + IH264_NALU_TYPE_EOSEQ = 10, + /**< End of sequence */ + IH264_NALU_TYPE_EOSTREAM = 11, + /**< End of stream */ + IH264_NALU_TYPE_FILLER = 12, + /**< Filler data */ + IH264_NALU_TYPE_SPS_WITH_VUI = 13, + /**< Sequence parameter set with VUI */ + IH264_NALU_TYPE_USER_DATA_UNREGD_SEI = 14, + /**< User Data unregsitered SEI */ + IH264_NALU_TYPE_SSPS = 15, + /**< Sub-Sequence Parameter Set for SVC */ + IH264_NALU_TYPE_CODED_SLICE_IN_SCALABLE_EXTN = 20 + /**< Coded Slice in Scalable Extn for SVC */ + +} IH264ENC_NALUnitType; + + +/** + + @enum IH264ENC_NALUControlPreset + @brief These enumerations define the control mechanism for insertion of + different NALU types at different point in video sequence + +*/ + +typedef enum { + IH264_NALU_CONTROL_DEFAULT = 0, /**< Default NALU insertion */ + IH264_NALU_CONTROL_USERDEFINED = 1, /**< User defined NALU insertion */ + IH264_NALU_CONTROL_MAX + +} IH264ENC_NALUControlPreset; + +/** + + @enum IH264ENC_SliceCodingPreset + @brief These enumerations control the type of slice coding + +*/ + +typedef enum { + IH264_SLICECODING_DEFAULT = 0, + /**< Default slice coding params */ + IH264_SLICECODING_USERDEFINED = 1, + /**< User defined slicecoding params */ + IH264_SLICECODING_EXISTING = 2, + /**< Keep the slice coding params as existing */ + /**< This is useful because during control call */ + /**< if user don't want to chnage the sliceCodingParams */ + IH264_SLICECODING_MAX + +} IH264ENC_SliceCodingPreset; + +/** + + @enum IH264ENC_SliceMode + @brief These enumerations control the type of slice coding + +*/ + +typedef enum { + IH264_SLICEMODE_NONE = 0, + IH264_SLICEMODE_DEFAULT = IH264_SLICEMODE_NONE, + /**< Default slice coding mode is MB based */ + IH264_SLICEMODE_MBUNIT = 1, + /**< Slices are controlled based upon number of Macroblocks */ + IH264_SLICEMODE_BYTES = 2, + /**< Slices are controlled based upon number of bytes */ + IH264_SLICEMODE_OFFSET = 3, + /**< Slices are controlled based upon user defined offset in + * unit of Rows + */ + IH264_SLICEMODE_MAX + +} IH264ENC_SliceMode; + +/** + + @enum IH264ENC_StreamFormat + @brief These enumerations control the type stream format + +*/ +typedef enum { + IH264_BYTE_STREAM = 0, + /**< bit-stream contains the start code identifier*/ + IH264_STREAM_FORMAT_DEFAULT = IH264_BYTE_STREAM, + /**< Default slice coding mode is byte-stream */ + IH264_NALU_STREAM = 1, + /**< bit-stream doesn't contain the start code identifier */ + IH264_STREAM_FORMAT_MAX +}IH264ENC_StreamFormat; + + +/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ +/** + * @enum IH264ENC_LoopFilterPreset + * @brief These enumerations control the type of slice coding +*/ + +typedef enum { + IH264_LOOPFILTER_DEFAULT = 0, /**< Default loop-filtering params */ + IH264_LOOPFILTER_USERDEFINED = 1, /**< User defined loop-filtering params */ + IH264_LOOPFILTER_MAX +} IH264ENC_LoopFilterPreset; + +/** + + @enum IH264ENC_LoopFilterDisableIDC + @brief Control Parameter to disable loop filter at different places + +*/ +typedef enum { + IH264_DISABLE_FILTER_NONE = 0, + /**< Enable filtering of all the edges */ + IH264_DISABLE_FILTER_DEFAULT = IH264_DISABLE_FILTER_NONE, + /**< Default is Loop filter enabled */ + IH264_DISABLE_FILTER_ALL_EDGES, + /**< Disable filtering of all the edge */ + IH264_DISABLE_FILTER_SLICE_EDGES, + /**< Disable filtering of slice edges */ + IH264_DISABLE_FILTER_MAX +} IH264ENC_LoopFilterDisableIDC; + +/** + + @enum IH264ENC_SliceGroupMapType + @brief Slice group map type defined by H.264 standard + +*/ + +typedef enum { + IH264_INTERLEAVED_SLICE_GRP = 0, + /**< 0 : Interleaved Slice Group */ + IH264_DISPERSED_SLICE_GRP = 1, + /**< 1 : Dispersed Slice Group */ + IH264_FOREGRND_WITH_LEFTOVER_SLICE_GRP = 2, + /**< 2 : ForeGround with Left Over */ + IH264_BOX_OUT_SLICE_GRP = 3, + /**< 3 : Box Out */ + IH264_RASTER_SCAN_SLICE_GRP = 4, + /**< 4 : Raster Scan */ + IH264_SLICE_GRP_MAP_DEFAULT = IH264_RASTER_SCAN_SLICE_GRP, + /**< Default*/ + IH264_WIPE_SLICE_GRP = 5, + /**< 5 : Wipe slice group */ + IH264_EXPLICIT_SLICE_GRP = 6 + /**< 6 : Explicit Slice gropup map */ +} IH264ENC_SliceGroupMapType; + +/** + + @enum IH264ENC_SliceGroupChangeDirection + @brief Different Scan /rotation oreder + +*/ + +typedef enum { + IH264_RASTER_SCAN = 0, + /**< 0 : Raster scan order */ + IH264_CLOCKWISE = 0, + /**< 0 : Clockwise (used for BOX OUT FMO Params)*/ + IH264_RIGHT = 0, + /**< 0 : RIGHT (Used for Wipe FMO type) */ + IH264ENC_SLICEGROUP_CHANGE_DIRECTION_DEFAULT = IH264_RASTER_SCAN, + /**< Default */ + IH264_REVERSE_RASTER_SCAN = 1, + /**< 1 : Reverse Raster Scan Order */ + IH264_COUNTER_CLOCKWISE = 1, + /**< 1 : Counter Clockwise (used for BOX OUT + * FMO Params) + */ + IH264_LEFT = 1 + /**< 1 : LEFT (Used for Wipe FMO type) */ +} IH264ENC_SliceGroupChangeDirection; + +/** + + @enum IH264ENC_FMOCodingPreset + @brief Preset to define FMO coding type + +*/ + +typedef enum { + IH264_FMOCODING_NONE = 0, /**< 0 : NO FMO */ + IH264_FMOCODING_DEFAULT = IH264_FMOCODING_NONE, /**< 0 : NO FMO */ + IH264_FMOCODING_USERDEFINED = 1 /**< 1 : User defined FMO parameters */ + +} IH264ENC_FMOCodingPreset; + + +/** + + @enum IH264ENC_VUICodingPreset + @brief Defines the Preset for VUI coding + +*/ + +typedef enum { + IH264_VUICODING_DEFAULT = 0, /**< Default VUI Parameters. Note that + * Enable/Disable of VUI is via + * nalUnitControlParams + */ + IH264_VUICODING_USERDEFINED = 1, /**< 1 : User defined VUI parameters*/ + IH264_VUICODING_MAX /**< Max VUI Coding enum */ + +} IH264ENC_VUICodingPreset; + + +/** + + @enum IH264ENC_VideoFormat + @brief Defines different video formats + +*/ +typedef enum { + IH264ENC_VIDEOFORMAT_COMPONENT, /**< component video format */ + IH264ENC_VIDEOFORMAT_PAL, /**< PAL video format */ + IH264ENC_VIDEOFORMAT_NTSC, /**< NTSC video format */ + IH264ENC_VIDEOFORMAT_SECAM, /**< SECAM video format */ + IH264ENC_VIDEOFORMAT_MAC, /**< MAC video format */ + IH264ENC_VIDEOFORMAT_UNSPECIFIED /**< Unspecified video format*/ +} IH264ENC_VideoFormat; + +/** + + @enum IH264ENC_StereoInfoPreset + @brief Defines the Preset for Stereo Video Info coding*/ + +typedef enum { + IH264_STEREOINFO_DISABLE = 0, /* StereoVideoCoding is disable */ + IH264_STEREOINFO_ENABLE_DEFAULT = 1, /* Default Stereo Video Info + Parameters enabled. */ + IH264_STEREOINFO_ENABLE_USERDEFINED = 2, /* User defined Stereo Video Info + parameters enabled */ + IH264_STEREOINFO_MAX /* Max Stereo Video Info enum */ + +} IH264ENC_StereoInfoPreset; + +/** + + @enum IH264ENC_FramePackingPreset + @brief Defines the Preset for Frame packing SEI coding*/ + +typedef enum { + IH264_FRAMEPACK_SEI_DISABLE = 0, /* Frame packing SEI is disable */ + IH264_FRAMEPACK_SEI_ENABLE_DEFAULT = 1, /* Default Frame packing SEI + Parameters enabled. */ + IH264_FRAMEPACK_SEI_USERDEFINED = 2, /* User defined SFrame packing + SEIparameters enabled */ + IH264_FRAMEPACK_SEI_MAX /* Max Stereo Video Info enum */ + +} IH264ENC_FramePackingPreset; + +/** + + @enum IH264ENC_FramePackingType + @brief Defines the type of packing arrangement for + Frame packing SEI coding +*/ + +typedef enum { + IH264_FRAMEPACK_CHECKERBOARD = 0, + IH264_FRAMEPACK_COLUMN_INTERLEAVING = 1, + IH264_FRAMEPACK_ROW_INTERLEAVING = 2, + IH264_FRAMEPACK_SIDE_BY_SIDE = 3, + IH264_FRAMEPACK_TOP_BOTTOM = 4, + IH264_FRAMEPACK_TYPE_DEFAULT = IH264_FRAMEPACK_SIDE_BY_SIDE, + IH264_FRAMEPACK_TYPE_MAX + +} IH264ENC_FramePackingType; + +/** + + @enum IH264ENC_AspectRatioIdc + @brief Defines aspect ratio IDs + +*/ +typedef enum { + IH264ENC_ASPECTRATIO_UNSPECIFIED, /**< Unspecified aspect ratio */ + IH264ENC_ASPECTRATIO_SQUARE, /**< 1:1 (square) aspect ratio */ + IH264ENC_ASPECTRATIO_12_11, /**< 12:11 aspect ratio */ + IH264ENC_ASPECTRATIO_10_11, /**< 10:11 aspect ratio */ + IH264ENC_ASPECTRATIO_16_11, /**< 16:11 aspect ratio */ + IH264ENC_ASPECTRATIO_40_33, /**< 40:33 aspect ratio */ + IH264ENC_ASPECTRATIO_24_11, /**< 24:11 aspect ratio */ + IH264ENC_ASPECTRATIO_20_11, /**< 20:11 aspect ratio */ + IH264ENC_ASPECTRATIO_32_11, /**< 32:11 aspect ratio */ + IH264ENC_ASPECTRATIO_80_33, /**< 80:33 aspect ratio */ + IH264ENC_ASPECTRATIO_18_11, /**< 18:11 aspect ratio */ + IH264ENC_ASPECTRATIO_15_15, /**< 15:15 aspect ratio */ + IH264ENC_ASPECTRATIO_64_33, /**< 64:33 aspect ratio */ + IH264ENC_ASPECTRATIO_160_99, /**< 160:99 aspect ratio */ + IH264ENC_ASPECTRATIO_4_3, /**< 4:3 aspect ratio */ + IH264ENC_ASPECTRATIO_3_2, /**< 3:2 aspect ratio */ + IH264ENC_ASPECTRATIO_2_1, /**< 2:1 aspect ratio */ + IH264ENC_ASPECTRATIO_EXTENDED = 255 /**< Extended aspect ratio */ + +} IH264ENC_AspectRatioIdc; + +/** + + @enum IH264ENC_EntropyCodingMode + @brief Defines the different entropy code mode + +*/ +typedef enum { + IH264_ENTROPYCODING_CAVLC = 0, /**< CAVLC coding + type + */ + IH264_ENTROPYCODING_DEFAULT = IH264_ENTROPYCODING_CAVLC, /**< Default is + CAVLC coding type + */ + IH264_ENTROPYCODING_CABAC = 1, /**< CABAC coding + type + */ + IH264_ENTROPYCODING_MAX +} IH264ENC_EntropyCodingMode; + +/** + + @enum IH264ENC_TransformBlockSize + In H264 Intra macro block's transform size depends upon the Intra mode, + so this applies to inter macroblocks only + +*/ +typedef enum { + IH264_TRANSFORM_4x4 = 0, /**< Transform blocks + size is 4x4 */ + IH264_TRANSFORM_8x8 = 1, /**< Transform blocks + * size is 8x8 : + * Valid for only + * High Profile + */ + IH264_TRANSFORM_ADAPTIVE = 2, /**< Adaptive transform + * block size : + * encoder decides + * as per content + */ + IH264_TRANSFORM_DEFAULT = IH264_TRANSFORM_ADAPTIVE, /**< Default is adaptive + * based upon content + */ + IH264_TRANSFORM_MAX + +} IH264ENC_TransformBlockSize; + + + +/** + + @enum IH264ENC_GOPStructure + @brief + When B frames are used (InterFrameInterval > 1) then the arrangement of + frames can be different + + GOP structure in display order as indicated below + If contentType = Frame + IH264ENC_GOPSTRUCTURE_NONUNIFORM : IBBPBBP. . + IH264ENC_GOPSTRUCTURE_UNIFORM : BBIBBPBB. . + If contentType = Field + IH264ENC_GOPSTRUCTURE_NONUNIFORM : IPBBBBPBBBB + IH264ENC_GOPSTRUCTURE_UNIFORM : BBBBIPBBBBPPBBBB + +*/ + +typedef enum { + IH264ENC_GOPSTRUCTURE_NONUNIFORM = 0, + /**< Open Gop structure : IBBPBBP */ + IH264ENC_GOPSTRUCTURE_DEFAULT = IH264ENC_GOPSTRUCTURE_NONUNIFORM, + /**< Default is open gop structure */ + IH264ENC_GOPSTRUCTURE_UNIFORM = 1, + /**< Close Gop structure : BBIBBPBB*/ + IH264ENC_GOPSTRUCTURE_MAX + +} IH264ENC_GOPStructure; + + +/** + + @enum IH264ENC_BiasFactor + @brief Encoder uses bias b/w two possible chices for lot of decisions. + It is to control the mild/strong ness of the biasing + +*/ +typedef enum { + IH264_INTERLACE_PICAFF = 0, + /**< PicAFF type of interlace coding */ + IH264_INTERLACE_MBAFF = 1, + /**< MBAFF type of interlace coding */ + IH264_INTERLACE_FIELDONLY = 2, + /**< Field only coding with fixed partiy scheme */ + IH264_INTERLACE_FIELDONLY_MRF = IH264_INTERLACE_FIELDONLY, + /**< Use Most recent field for refernece*/ + IH264_INTERLACE_FIELDONLY_ARF = 3, + /**< Field only coding where codec decides the partiy of of the field to + * be used based upon content (adaptive) */ + IH264_INTERLACE_DEFAULT = IH264_INTERLACE_FIELDONLY_ARF, + /**< Default : adaptive partiy for reference*/ + IH264_INTERLACE_FIELDONLY_SPF = 4, + /**< Use same parity field for refernece */ + + IH264_INTERLACE_MAX +} IH264ENC_InterlaceCodingType; +/** + @enum IH264ENC_NumTemporalLayer + @brief Define different Temporal Layers +*/ +typedef enum { + /* Only Base Layer */ + IH264_TEMPORAL_LAYERS_1 = 1, + + /* Base Layer + Temporal Layer */ + IH264_TEMPORAL_LAYERS_2 = 2, + + /* Base Layer + 2Temporal Layers */ + IH264_TEMPORAL_LAYERS_3 = 3, + + /* Base Layer + 3Temporal Layers */ + IH264_TEMPORAL_LAYERS_4 = 4, + + /* Maximum Temporal Layer Supported*/ + IH264_TEMPORAL_LAYERS_MAX = IH264_TEMPORAL_LAYERS_4 + +} IH264ENC_NumTemporalLayer; + +/** + @enum IH264ENC_RoiType + @brief Defines the different ROI types +*/ +typedef enum { + IH264_FACE_OBJECT = 0, + /**< Face type of ROI object */ + IH264_BACKGROUND_OBJECT = 1, + /**< Background type of ROI object */ + IH264_FOREGROUND_OBJECT = 2, + /**< Foreground type of ROI object */ + IH264_DEFAULT_OBJECT = 3, + /**< Default type of ROI object */ + IH264_PRIVACY_MASK = 4 + /**< Privacy mask type of ROI object */ +} IH264ENC_RoiType; + +/** + @enum IH264ENC_SvcExtensionFlag + @brief Define SVC Extension Flag +*/ +typedef enum { + /*Svc Extension Flag Disabled*/ + IH264_SVC_EXTENSION_FLAG_DISABLE = 0, + /*Svc Extension Flag Enabled*/ + IH264_SVC_EXTENSION_FLAG_ENABLE = 1, + /*Svc Extension Flag Enabled with EC Flexibility*/ + IH264_SVC_EXTENSION_FLAG_ENABLE_WITH_EC_FLEXIBILITY = 2 + +} IH264ENC_SvcExtensionFlag; + +/** + @enum IH264ENC_ReferencePicMarking + @brief Define Reference Picture Marking +*/ +typedef enum { + /* ReferencePicMarking is Short-term picutre(Sliding Window) */ + IH264_SHORT_TERM_PICTURE = 0, + /* ReferencePicMarking is Long-term picutre(MMCO Commands) */ + IH264_LONG_TERM_PICTURE = 1 + +} IH264ENC_ReferencePicMarking; +/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ +/* Definition of all the structures define by this interafce */ +/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + +/** + + @struct IH264ENC_RateControlParams + @brief This structure contains all the parameters which controls Rate + Control behavior + + @param rateControlParamsPreset : + regarded @ IH264ENC_DynamicParams::rateControlParams + This Preset controls the USER_DEFINED vs DEFAULT mode. if User is + not aware about following fields, it should be set as + IH264_RATECONTROLPARAMS_DEFAULT + @param scalingMatrixPreset : + ignored @ IH264ENC_DynamicParams::rateControlParams + This Preset controls the USER_DEFINED vs DEFAULT mode. if User is + not aware about following fields, it should be set as + IH264_SCALINGMATRIX_DEFAULT + + @param rcAlgo : ignored @ IH264ENC_DynamicParams::rateControlParams + This defines the rate control algorithm to be used. Only useful + if IVIDENC2::rateControlPreset is set as IVIDEO_USER_DEFINED + + @param qpI : regarded @ IH264ENC_DynamicParams::rateControlParams + Initial Quantization Parameter for I/IDR frames. + Valid Range is [-1, 51] + -1 : Auto Initialization else other wise Initial QP. + when rateControlPreset = IVIDEO_NONE, this quantization parameter is + used by the whole video frame/field + + @param qpMaxI : regarded @ IH264ENC_DynamicParams::rateControlParams + Maximum Quantization Parameter for I/IDR frame(s). Range [0 , 51]. + Useful to control a minimum quality level + + @param qpMinI : regarded @ IH264ENC_DynamicParams::rateControlParams + Minimum Quantization Parameter for I/IDR frame(s). Range [0 , 51]. + Useful to control a maximum bit-rate level + + @param qpP : regarded @ IH264ENC_DynamicParams::rateControlParams + Initial Quantization Parameter for P frames. Valid Range is [-1, 51] + -1 : Auto Initialization else other wise Initial QP. + when rateControlPreset = IVIDEO_NONE, this quantization parameter is + used by the whole video frame/field + + @param qpMaxP : regarded @ IH264ENC_DynamicParams::rateControlParams + Maximum Quantization Parameter for inter frame(s). Range [0 , 51]. + Useful to control a minimum quality level + + @param qpMinP : regarded @ IH264ENC_DynamicParams::rateControlParams + Minimum Quantization Parameter for inter frame(s). Range [0 , 51]. + Useful to control a maximum bit-rate level + + @param qpOffsetB : regarded @ IH264ENC_DynamicParams::rateControlParams + Offset of B frames Quantization Parameter from P frames. + Valid Range is [-1, 51] + -1 : Auto Initialization else other wise user provided offset + if after adding the qpOffsetB into qp of P frame it exceeds 51 then + it is clipped to 51 + when rateControlPreset = IVIDEO_NONE, this offset parameter is + used by the whole video frame/field + + @param qpMaxB : regarded @ IH264ENC_DynamicParams::rateControlParams + Maximum Quantization Parameter for B frame(s). Range [0 , 51]. + Useful to control a minimum quality level + + @param qpMinB : regarded @ IH264ENC_DynamicParams::rateControlParams + Minimum Quantization Parameter for B frame(s). Range [0 , 51]. + Useful to control a maximum bit-rate level + + @param allowFrameSkip : regarded @ IH264ENC_DynamicParams::rateControlParams + Controls Frame Skip. + non-zero means frames can be skipped to achieve target bit-rate + zero means frame can never be skipped + + @param removeExpensiveCoeff : + regarded @ IH264ENC_DynamicParams::rateControlParams + Flag to Remove high frequency expensive coeffecients + + @param chromaQPIndexOffset : + ignored @ IH264ENC_DynamicParams::rateControlParams + Specifies offset to be added to luma QP for addressing QPC values + table for chroma components. + Valid value is between -12 and 12, (inclusive) + + @param IPQualityFactor : ignored @ IH264ENC_DynamicParams::rateControlParams + This provides configurality to control I frame Quality wrt to P frame. + Higher Quality factor means I frame quality is given higher + improtance compared to P frame. + Refer IH264ENC_FrameQualityFactor for possible values + + @param initialBufferLevel : + ignored @ IH264ENC_DynamicParams::rateControlParams + Initial Buffer level for HRD compliance. It informs that Hypothtical + decoder can start after how much time. The value taken is the + obsolute value of the HRD buffer size For example if user want + Hypothtical decoder to start taking out data from HRD buffer after + half second then it should set initialBufferLevel = half of the + HRD buffer size that is programmed. + + @param HRDBufferSize : regarded @ IH264ENC_DynamicParams::rateControlParams + Hypothetical Reference Decoder Buffer Size. This size controls the + frame skip logic of the encoder. for low delay applications this + size should be small. Unit of this variable is bits + + @param minPicSizeRatio : regarded @ IH264ENC_DynamicParams::rateControlParams + This ratio is used to compute minimum picture size + in the following manner, + minPicSize = averagePicSize >> minPicSizeRatio + allowed values 1 to 4, Setting this to 0 will enable + encoder chosen ratio. + Note that this is guided value to rate control to + determine min picture size and encoder may not + strictly follow this + @param maxPicSizeRatio : regarded @ IH264ENC_DynamicParams::rateControlParams + To determines ratio for max picture size + This ratio is used to compute maximum picture size + in the following manner, + maxPicSize = averagePicSize * maxPicSizeRatio + allowed values 2 to 30.Setting this to 0 and 1 + will enable encoder chosen ratio. + Note that this is guided value to rate control + to determine max picture size and encoder may not + strictly follow this. + + @param enablePRC : regarded @ IH264ENC_DynamicParams::rateControlParams + This flag is used to control allowing PRC in the + frame + + @param enablePartialFrameSkip : regarded @ IH264ENC_DynamicParams:: + rateControlParams + This flag is used to control allowing partial frame + skip in the frame + @param reserved : 16 bit word, kept to not change the foot print + @param VBRDuration : During over which statistics during interval are + collected to switch bit-rate states.Increasing this + value will make VBR wait for longer time before + switching bit-rate state + @param VBRsensitivity : Specifies the target bitrate used by rate control in + high complexity state. + @param skipDistributionWindowLength : Number of frames over which the skip + frames can be distributed + @param numSkipInDistributionWindow : Number of skips allowed within the + distribution window + @param reservedRC + Some part is kept reserved to add parameters later without + changing the foot print of interface memory + + @todo More parameters to be added : delay (VBV), PRC related etc.. + + +*/ + +typedef struct IH264ENC_RateControlParams { + XDAS_Int8 rateControlParamsPreset; + XDAS_Int8 scalingMatrixPreset; + XDAS_Int8 rcAlgo; + XDAS_Int8 qpI; + XDAS_Int8 qpMaxI; + XDAS_Int8 qpMinI; + XDAS_Int8 qpP; + XDAS_Int8 qpMaxP; + XDAS_Int8 qpMinP; + XDAS_Int8 qpOffsetB; + XDAS_Int8 qpMaxB; + XDAS_Int8 qpMinB; + XDAS_Int8 allowFrameSkip; + XDAS_Int8 removeExpensiveCoeff; + XDAS_Int8 chromaQPIndexOffset; + XDAS_Int8 IPQualityFactor; + XDAS_Int32 initialBufferLevel; + XDAS_Int32 HRDBufferSize; + XDAS_Int16 minPicSizeRatioI; + XDAS_Int16 maxPicSizeRatioI; + XDAS_Int16 minPicSizeRatioP; + XDAS_Int16 maxPicSizeRatioP; + XDAS_Int16 minPicSizeRatioB; + XDAS_Int16 maxPicSizeRatioB; + XDAS_Int8 enablePRC; + XDAS_Int8 enablePartialFrameSkip; + XDAS_Int8 discardSavedBits; + XDAS_Int8 reserved; + XDAS_Int32 VBRDuration; + XDAS_Int8 VBRsensitivity; + XDAS_Int16 skipDistributionWindowLength; + XDAS_Int16 numSkipInDistributionWindow; + XDAS_Int8 enableHRDComplianceMode; + XDAS_Int32 frameSkipThMulQ5; + XDAS_Int32 vbvUseLevelThQ5; + XDAS_Int32 reservedRC[3]; + +} IH264ENC_RateControlParams; + +/** + @struct ROI_Interface + @brief This structure defines the ROI input parameters required by Encoder. + @param listROI: + List of ROIs with their x and y co-ordinates + @param roiType: + Type of each ROI + @param numOfROI: + Number of ROIs passed to codec + @param roiPriority: + Priority of each ROI +*/ +typedef struct IH264ENC_RoiInput { + XDM_Rect listROI[IH264ENC_MAX_ROI]; + XDAS_Int8 roiType[IH264ENC_MAX_ROI]; + XDAS_Int8 numOfROI; + XDAS_Int32 roiPriority[IH264ENC_MAX_ROI]; +}IH264ENC_RoiInput; + +/** + + @struct IH264ENC_InterCodingParams + @brief This structure contains all the parameters which controls Inter MBs + coding behavior + @param interCodingPreset + This Preset controls the USER_DEFINED vs DEFAULT mode. if User is + not aware about following fields, it should be set as + IH264_INTERCODING_DEFAULT + @param searchRangeHorP :regarded @ IH264ENC_DynamicParams::interCodingParams + Horizontal Search Range for P frames + @param searchRangeVerP :regarded @ IH264ENC_DynamicParams::interCodingParams + Vertical Search Range for P frames + @param searchRangeHorB :regarded @ IH264ENC_DynamicParams::interCodingParams + Horizontal Search Range for B frames + @param searchRangeVerB :regarded @ IH264ENC_DynamicParams::interCodingParams + Vertical Search Range for B frames + @param interCodingBias :regarded @ IH264ENC_DynamicParams::interCodingParams + Bias Control for having a macro block coded as inter vs Intra + Refer IH264ENC_BiasFactor for possible values + @param skipMVCodingBias :regarded @ IH264ENC_DynamicParams::interCodingParams + Bias Control for having a macro block use skip MV vs regular MV + refer IH264ENC_BiasFactor for possible values + @param minBlockSizeP : regarded @ IH264ENC_DynamicParams::interCodingParams + minimum block size for P frames. Refer IH264ENC_InterBlockSize + enumeration to see the valid values + @param minBlockSizeB : regarded @ IH264ENC_DynamicParams::interCodingParams + minimum block size for B frames. Refer IH264ENC_InterBlockSize + enumeration to see the valid values + +*/ + +typedef struct IH264ENC_InterCodingParams { + XDAS_Int8 interCodingPreset; + XDAS_Int16 searchRangeHorP; + XDAS_Int16 searchRangeVerP; + XDAS_Int16 searchRangeHorB; + XDAS_Int16 searchRangeVerB; + XDAS_Int8 interCodingBias; + XDAS_Int8 skipMVCodingBias; + XDAS_Int8 minBlockSizeP; + XDAS_Int8 minBlockSizeB; + XDAS_Int8 meAlgoMode; + +} IH264ENC_InterCodingParams; + +/** + + @struct IH264ENC_IntraCodingParams + @brief This structure contains all the parameters which controls Intra + encoding + + @param intraCodingPreset + This Preset controls the USER_DEFINED vs DEFAULT mode. if User is + not aware about following fields, it should be set as + INTRA_CODING_DEFAULT other wise INTRA_CODING_USER_DEFINED + @param lumaIntra4x4Enable + This parameter controls the Luma Intra4x4 encoding in video encoder. A + bit-field is given for each Luma intra4x4 mode as shown below. This + field is H.264 specific HOR_UP|VERT_LEFT|HOR_DOWN| + VERT_RIGHT|DIAG_DOWN_RIGHT|DIAG_DOWN_LEFT|DC|HOR|VER + Set/ reset particular bit to enable/disable that mode + (0=disable, 1=enable). DC (bit-2)is don't care + @param lumaIntra8x8Enable + This parameter controls the Luma Intra8x8 encoding in video encoder. A + bit-field is given for each Luma intra8x8 mode as shown below. + HOR_UP|VERT_LEFT|HOR_DOWN|VERT_RIGHT|DIAG_DOWN_RIGHT|DIAG_DOWN_LEFT| + DC|HOR|VER Set/ reset particular bit to enable/disable that + mode (0=disable, 1=enable) DC (bit-2)is don't care + Example : 139(decimal) ==> 0x8B =>> 010001011 (bits) ==> + HOR, VER, VERT_LEFT + are enabled and DC is always enabled + @param lumaIntra16x16Enable + This parameter controls the Luma Intra16x16 encoding in video encoder. + A bit-field is given for each Luma intra16x16 mode as shown below. + PLANE|DC|HOR|VER + Set/ reset particular bit to enable/disable that + mode (0=disable, 1=enable). DC (bit-2)is don't care + @param chromaIntra8x8Enable + This parameter controls the chroma Intra8x8 encoding in video encoder. + A bit-field is given for each chroma intra8x8 mode as shown below. + PLANE|VER|HOR|DC + Set/ reset particular bit to enable/disable + that mode (0=disable, 1=enable) DC (bit-0)is don't care + @param chromaComponentEnable + This parameter controls the chroma Intra prediction search. User + can choose to perfom chroma intra estimation for both Cb and Cr + samples or only on Cr samples. For more details + refer IH264ENC_ChormaComponent + @param intraRefreshMethod + Mechanism to do intra Refresh, see IH264ENC_IntraRefreshMethods + for valid values + @param intraRefreshRate + Rate at which intra Refresh is done, This rate is specified as + One IntraMB per # MBs. For example if rate is 20 it means that + there has to be one intra MB(s) per 20 Mbs. + When intraRefreshMethod == IH264_INTRAREFRESH_GDR, this parameter + is treated/interpreted number of rows to be intra refreshed per + frame. + + @param gdrOverlapRowsBtwFrames + Defines the Overlap of the Intra Refresh Region between successive + frame in case the intraRefreshMethod == IH264_INTRAREFRESH_GDR or + else treated to be don't care. + Again gdrOverlapRowsBtwFrames should be less than intraRefreshRate. + + @param constrainedIntraPredEnable + Controls the intra macroblock coding in P slices. + Valid values are [0,non-zero] + +*/ + +typedef struct IH264ENC_IntraCodingParams { + XDAS_Int8 intraCodingPreset; + XDAS_Int16 lumaIntra4x4Enable; + XDAS_Int16 lumaIntra8x8Enable; + XDAS_Int8 lumaIntra16x16Enable; + XDAS_Int8 chromaIntra8x8Enable; + XDAS_Int8 chromaComponentEnable; + XDAS_Int8 intraRefreshMethod; + XDAS_Int16 intraRefreshRate; + XDAS_Int16 gdrOverlapRowsBtwFrames; + XDAS_Int16 constrainedIntraPredEnable; + XDAS_Int8 intraCodingBias; +} IH264ENC_IntraCodingParams; + + +/** + + @struct IH264ENC_NALUControlParams + @brief This structure contains all the parameters which define the + control mechanism for insertion of different NALU types at + different point in video sequence + + @param naluControlPreset + This Preset controls the USER_DEFINED vs DEFAULT mode. if User is + not aware about following fields, it should be set as + IH264_NALU_CONTROL_DEFAULT other wise IH264_NALU_CONTROL_USERDEFINED + @param naluPresentMaskStartOfSequence + This parameter controls the insertion of different NALU at Start of + Sequence + A bit-field is given for each NALU type as shown below. This field is +\n ---------------------------------------------------------------------\n +\n 7| 6| 5| 4| 3| 2| 1| 0 \n +\n SPS|SEI|IDR_SLICE|SLICE_DP_C|SLICE_DP_B|SLICE_DP_A|SLICE|UNSPECIFIED \n +\n ---------------------------------------------------------------------\n +\n---------------------------------------------- +\n 14| 13| 12| 11| 10| 9| 8| +\n UD_SEI|SPS_VUI|FILLER|EOSTREAM|EOSEQ|AUD|PPS| +\n---------------------------------------------- + Set/ reset particular bit to enable/disable that insertion of that + NALU (0=disable, 1=enable) + UNSPECIFIED (bit-0), SLICE_DP_A(bit-2), SLICE_DP_B(bit-3), + SLICE_DP_C(bit-4), IDR_SLICE(bit-5), EOSEQ (bit-10) and + EOSTREAM (bit-11) are don't care and assumed to be zero . + SPS (bit-7), PPS(bit-8) are don't care and assumed to be one . + @param naluPresentMaskIDRPicture + This parameter controls the insertion of different NALU at IDR picture + A bit-field is given for each NALU type as shown below. This field is +\n ---------------------------------------------------------------------\n +\n 7| 6| 5| 4| 3| 2| 1| 0 \n +\n SPS|SEI|IDR_SLICE|SLICE_DP_C|SLICE_DP_B|SLICE_DP_A|SLICE|UNSPECIFIED \n +\n ---------------------------------------------------------------------\n +\n---------------------------------------------- +\n 14| 13| 12| 11| 10| 9| 8| +\n UD_SEI|SPS_VUI|FILLER|EOSTREAM|EOSEQ|AUD|PPS| +\n---------------------------------------------- + Set/ reset particular bit to enable/disable that insertion of that + NALU (0=disable, 1=enable) + UNSPECIFIED (bit-0), SLICE_DP_A(bit-2), SLICE_DP_B(bit-3), + SLICE_DP_C(bit-4), IDR_SLICE(bit-5), EOSEQ (bit-10) and + EOSTREAM (bit-11) are don't care and assumed to be zero . + @param naluPresentMaskIntraPicture + This parameter controls the insertion of different NALU at I picture + A bit-field is given for each NALU type as shown below. This field is +\n ---------------------------------------------------------------------\n +\n 7| 6| 5| 4| 3| 2| 1| 0 \n +\n SPS|SEI|IDR_SLICE|SLICE_DP_C|SLICE_DP_B|SLICE_DP_A|SLICE|UNSPECIFIED \n +\n ---------------------------------------------------------------------\n +\n---------------------------------------------- +\n 14| 13| 12| 11| 10| 9| 8| +\n UD_SEI|SPS_VUI|FILLER|EOSTREAM|EOSEQ|AUD|PPS| +\n---------------------------------------------- + Set/ reset particular bit to enable/disable that insertion of that + NALU (0=disable, 1=enable) + UNSPECIFIED (bit-0), SLICE_DP_A(bit-2), SLICE_DP_B(bit-3), + SLICE_DP_C(bit-4), IDR_SLICE(bit-5), EOSEQ (bit-10) and + EOSTREAM (bit-11) are don't care and assumed to be zero . + @param naluPresentMaskNonIntraPicture + This parameter controls the insertion of different + NALU at NON intra picture + A bit-field is given for each NALU type as shown below. This field is +\n ---------------------------------------------------------------------\n +\n 7| 6| 5| 4| 3| 2| 1| 0 \n +\n SPS|SEI|IDR_SLICE|SLICE_DP_C|SLICE_DP_B|SLICE_DP_A|SLICE|UNSPECIFIED \n +\n ---------------------------------------------------------------------\n +\n---------------------------------------------- +\n 14| 13| 12| 11| 10| 9| 8| +\n UD_SEI|SPS_VUI|FILLER|EOSTREAM|EOSEQ|AUD|PPS| +\n---------------------------------------------- + Set/ reset particular bit to enable/disable that insertion of that + NALU (0=disable, 1=enable) + UNSPECIFIED (bit-0), SLICE_DP_A(bit-2), SLICE_DP_B(bit-3), + SLICE_DP_C(bit-4), IDR_SLICE(bit-5), EOSEQ (bit-10) and + EOSTREAM (bit-11) are don't care and assumed to be zero . + @param naluPresentMaskEndOfSequence + This parameter controls the insertion of different NALU at End of Seq + A bit-field is given for each NALU type as shown below. This field is +\n ---------------------------------------------------------------------\n +\n 7| 6| 5| 4| 3| 2| 1| 0 \n +\n SPS|SEI|IDR_SLICE|SLICE_DP_C|SLICE_DP_B|SLICE_DP_A|SLICE|UNSPECIFIED \n +\n ---------------------------------------------------------------------\n +\n---------------------------------------------- +\n 14| 13| 12| 11| 10| 9| 8| +\n UD_SEI|SPS_VUI|FILLER|EOSTREAM|EOSEQ|AUD|PPS| +\n---------------------------------------------- + Set/ reset particular bit to enable/disable that insertion of that + NALU (0=disable, 1=enable) + UNSPECIFIED (bit-0), SLICE_DP_A(bit-2), SLICE_DP_B(bit-3), + SLICE_DP_C(bit-4), SPS_VUI (bit-13), FILLER (bit-12), AUD(bit-9), + PPS(bit-8), SPS(bit-7), SEI(bit-6), IDR_SLICE(bit-5), SLICE (bit-1) + are don't care and assumed to be zero . + +*/ + +typedef struct IH264ENC_NALUControlParams { + XDAS_Int16 naluControlPreset; + XDAS_Int16 naluPresentMaskStartOfSequence; + XDAS_Int16 naluPresentMaskIDRPicture; + XDAS_Int16 naluPresentMaskIntraPicture; + XDAS_Int16 naluPresentMaskNonIntraPicture; + XDAS_Int16 naluPresentMaskEndOfSequence; + +} IH264ENC_NALUControlParams; + +/** + + @struct IH264ENC_SliceCodingParams + @brief This structure contains all the parameters which controls Slice + encoding + + @param sliceCodingPreset + This Preset controls the USER_DEFINED vs DEFAULT mode. if User is + not aware about following fields, it should be set as + IH264_SLICECODING_DEFAULT + + @param sliceMode : regarded @ IH264ENC_DynamicParams::sliceCodingParams + This defines the control mechanism to split a picture in slices. + It can be either MB based or bytes based + + @param sliceUnitSize : regarded @ IH264ENC_DynamicParams::sliceCodingParams + The meaning of this parameter depends upon sliceMode. + sliceMode == IH264_SLICEMODE_MBUNIT then this + parameter informs the number of Macroblocks in one slice + sliceMode == IH264_SLICEMODE_BYTES then this + parameter informs the number of bytes in one slice + sliceMode == IH264_SLICEMODE_OFFSET then this + parameter informs the number of offset information provided by user. + Actual offset are provided with sliceStartOffset + + @param sliceStartOffset[IH264ENC_MAX_NUM_SLICE_START_OFFSET] : regarded @ + IH264ENC_DynamicParams::sliceCodingParams row numbering is assumed to + start from 0. Enteris in this array must have numbers in ascending + order. first slice of the picture is always starting from 0th row + of the picture so 0th entry is the offset of second slice in picture + Ex 1 : sliceStartRowNum[0] = 25 , + sliceStartRowNum[1] = 30, sliceStartRowNum[2] = 40 + will result into 4 slices starting from row# 0, 25, 30 and 40 + Ex 2 : sliceStartRowNum[0] = 25 , sliceStartRowNum[1] = 70, + sliceStartRowNum[2] = 60 is invalid + Ex 3 : sliceStartRowNum[0] = 25 , sliceStartRowNum[1] = 50, + sliceStartRowNum[2] = 100 + will result into 3 slices starting from row# 0, 25 and 50 + {if number of rows in picture < (100 + 1) } + + + @param streamFormat : ignored @ IH264ENC_DynamicParams::sliceCodingParams + Controls the type of stream : byte stream format or NALU format + refer IH264ENC_StreamFormat for possible values + +*/ + +typedef struct IH264ENC_SliceCodingParams { + XDAS_Int8 sliceCodingPreset; + XDAS_Int16 sliceMode; + XDAS_Int16 sliceUnitSize; + XDAS_Int8 sliceStartOffset[IH264ENC_MAX_NUM_SLICE_START_OFFSET]; + XDAS_Int8 streamFormat; + +} IH264ENC_SliceCodingParams; + + +/** + + @struct IH264ENC_LoopFilterParams + @brief This structure contains all the parameters which controls loop + filtering operations + + @param loopfilterPreset + This Preset controls the USER_DEFINED vs DEFAULT mode. if User is + not aware about following fields, it should be set as + IH264_SLICECODING_DEFAULT + @param loopfilterDisableIDC + Controls H.264 loop filter disabling options + @param filterOffsetA + alpha offset for loop filter [-12, 12] even number + @param filterOffsetB + beta offset for loop filter [-12, 12] even number + + +*/ +typedef struct IH264ENC_LoopFilterParams { + XDAS_Int8 loopfilterPreset; + XDAS_Int8 loopfilterDisableIDC; + XDAS_Int8 filterOffsetA; + XDAS_Int8 filterOffsetB; + +} IH264ENC_LoopFilterParams; + +/** + + @struct IH264ENC_FMOCodingParams + @brief This structure contains all the parameters which controls FMO behavior + + @param fmoCodingPreset + This Preset controls the USER_DEFINED vs DEFAULT mode. if User is + not aware about following fields, it should be set as + IH264_FMOCODING_DEFAULT + @param numSliceGroups + Total Number of slice groups, valid enteries are [0,8] + @param sliceGroupMapType + For Valid enteries see IH264ENC_SliceGroupMapType + @param sliceGroupChangeDirectionFlag + Only valid when sliceGroupMapType is equal to + IH264_RASTER_SCAN_SLICE_GRP, + IH264_WIPE_SLICE_GRP or IH264_WIPE_SLICE_GRP. + For valid values refer IH264ENC_SliceGroupChangeDirection + @param sliceGroupChangeRate + Only valid when sliceGroupMapType is equal to + IH264_RASTER_SCAN_SLICE_GRP, + IH264_WIPE_SLICE_GRP or IH264_WIPE_SLICE_GRP + valid values are : [0, factor of number of Mbs in a row] + @param sliceGroupChangeCycle + Only valid when sliceGroupMapType is equal to + IH264_RASTER_SCAN_SLICE_GRP, + IH264_WIPE_SLICE_GRP or IH264_WIPE_SLICE_GRP + Valid values can be 0 to numMbsRowsInPicture, also constrained by + sliceGroupChangeRate*sliceGroupChangeCycle < totalMbsInFrameOnly valid + when sliceGroupMapType is equal to IH264_RASTER_SCAN_SLICE_GRP. + valid values are : [0, factor of number of Mbs in a row] + @param sliceGroupParams[IH264ENC_MAXNUMSLCGPS] + This field is useful in case of sliceGroupMapType equal to either + IH264_INTERLEAVED_SLICE_GRP or IH264_FOREGRND_WITH_LEFTOVER_SLICE_GRP + In both cases it has different meaning: + In case of IH264_INTERLEAVED_SLICE_GRP: + The i-th entery in this array is used to specify the number of + consecutive slice group macroblocks to be assigned to the i-th slice + group in raster scan order of slice group macroblock units. + Valid values are 0 to totalMbsInFrame again constrained by sum of + all the elements shouldn't exceed totalMbsInFrame + In case of IH264_FOREGRND_WITH_LEFTOVER_SLICE_GRP: + First entry in the array specify the start position of foreground + region in terms of macroblock number, valid values are + [0, totalMbsInFrame-1] + Second entry in the array specify the end position of foreground + region in terms of macroblock number, valid values are + [0, totalMbsInFrame-1] with following constrains: + endPos > startPos && endPos%mbsInOneRow > startPos%mbsInOneRow + + @todo Review this structure and see all the fields are sufficient enough + + +*/ + +typedef struct IH264ENC_FMOCodingParams { + XDAS_Int8 fmoCodingPreset; + XDAS_Int8 numSliceGroups; + XDAS_Int8 sliceGroupMapType; + XDAS_Int8 sliceGroupChangeDirectionFlag; + XDAS_Int8 sliceGroupChangeRate; + XDAS_Int16 sliceGroupChangeCycle; + XDAS_Int16 sliceGroupParams[IH264ENC_MAXNUMSLCGPS]; +} IH264ENC_FMOCodingParams; + + +/** + + @struct IH264ENC_VUICodingParams + @brief This structure contains all the parameters which controls VUI + parameters. Refer Annex E of the H.264 standard for more details + of VUI and parameters + @param vuiCodingPreset + This Preset controls the USER_DEFINED vs DEFAULT mode. if User is + not aware about following fields, it should be set as + IH264_VUICODING_DEFAULT + @param aspectRatioInfoPresentFlag + This controls the insertion of aspect ratio information in VUI part + of bit-stream + zero : No aspect ratio related information is transmitted + non-zero : aspect ratio related information is transmitted + @param aspectRatioIdc + Encoder inserts aspectRatioIdc as it is in the bit-stream. It is + user's responsibility to feed appropriate value of this. + Refer Table E-1 of H264 standard (or enum IH264ENC_AspectRatioIdc) + for valid values of this. + when aspectRatioIdc == IH264ENC_ASPECTRATIO_EXTENDED(255), encoder + will look at IVIDENC2_DynamicParams::sampleAspectRatioHeightand + IVIDENC2_DynamicParams::sampleAspectRatioWidth and use them as + sar_height and sar_width respectively. aspectRatioIdc is left to + user to provide correct value. + if aspectRatioInfoPresentFlag ==0 then encoder ignores + this parameter + @param videoSignalTypePresentFlag + This controls the insertion of video signal type in VUI part of + bit-stream + zero : No video signal related information is transmitted + non-zero : video signal related information is transmitted + @param videoFormat + Encoder inserts videoFormat(lower 3 bits) as it is in the bit-stream. + It is user's responsibility to feed appropriate value of this. + Refer Table E-2 H264 standard (or enum IH264ENC_VideoFormat) + for valid values of this. + @param videoFullRangeFlag + zero: video range is not full{0, 255} ; non-zero: video range is full + @param timingInfoPresentFlag + This controls the insertion of timing info related parameters in + VUI part of bit-stream + @param hrdParamsPresentFlag + This controls the insertion of HRD parameters in + VUI part of bit-stream + @param numUnitsInTicks + This controls the insertion of numUnitsInTicks parameter in + VUI part of bit-stream. + Valid values are [1, targetFrameRate] + If this parameter is set by user then the targetFrameRate + has multiplication factor of numUnitInTicks instead of 1000 +*/ + +typedef struct IH264ENC_VUICodingParams { + XDAS_Int8 vuiCodingPreset; + XDAS_UInt8 aspectRatioInfoPresentFlag; + XDAS_UInt8 aspectRatioIdc; + XDAS_UInt8 videoSignalTypePresentFlag; + XDAS_UInt8 videoFormat; + XDAS_UInt8 videoFullRangeFlag; + XDAS_UInt8 timingInfoPresentFlag; + XDAS_UInt8 hrdParamsPresentFlag; + XDAS_UInt32 numUnitsInTicks; + + +} IH264ENC_VUICodingParams; + +/** + + @struct IH264ENC_StereoInfoParams + @brief This structure contains all the parameters which have Stereo + Video info for SEI message. + @param stereoInfoPreset + This Preset controls the Enable/Disable of stereo video coding & + if its enable then controls the USER_DEFINED vs DEFAULT mode. + If User is not aware about following fields, it should be set + as IH264_STEREOINFO_ENABLE_DEFAULT. + 0 :Stereo Video Coding is Disabled. + 1 :Default stereo video information parameters . + 2 :User defined steroe video information pamameters. + @remarks - When stereo video coding is enabled then input content type + (coding type) should be Interlaced coding. + @param topFieldIsLeftViewFlag + This indicates the top & bottom field in video coded sequence + as a left view or right view + non-zero :top fields in the coded video sequence represent a left view & the + bottom fields in the coded video sequence represent a right view. + zero :vice-versa. + @param viewSelfContainedFlag + This controls the Left/Right view should Refer/NotRefer to + Left/Right view. + zero :Leftview can refer to Rightview or Leftview & Rightview can refer to + Leftview or Rightview. + i.e.Possible values for left_view_self_contained_flag = 0 && + right_view_self_contained_flag = 0 in bit-stream. + non-zero:Leftview cannot refer to Rightview & Rightview cannot refer to + Leftview. + i.e Possible values for left_view_self_contained_flag = 1 && + right_view_self_contained_flag = 1 in bit-stream. + @remarks - This viewSelfContainedFlag overrides the interlaceCodingType. + viewSelfContainedFlag == 0 forces interlaceCodingType = ARF + viewSelfContainedFlag == 1 forces interlaceCodingType = SPF +*/ +typedef struct IH264ENC_StereoInfoParams { + XDAS_UInt8 stereoInfoPreset; + XDAS_UInt8 topFieldIsLeftViewFlag; + XDAS_UInt8 viewSelfContainedFlag; +}IH264ENC_StereoInfoParams; + +/** + + @struct IH264ENC_FramePackingSEIParams + @brief This structure contains all the parameters for Frame packing + SEI message. + @param framePackingPreset + This Preset controls the Enable/Disable of Frame packing + SEI message encoding.If its enable then controls + the USER_DEFINED vs DEFAULT mode. + If User is not aware about following fields, it should be set + as IH264_FRAMEPACK_SEI_ENABLE_DEFAULT. + 0 :Frame packing SEI is Disabled. + 1 :Default Frame packing SEI parameters . + 2 :User defined Frame packing SEI information pamameters. + @remarks - When Frame packing SEI coding is enabled then input content + type (coding type) should be Progressive coding. + @param framePackingType + indicates the type of packing arrangement of the frames as + specified standard. Refer IH264ENC_FramePackingType + @param frame0PositionX + location of the upper left sample of frame 0 (Left view) in + horizontal direction. Allowed values are [0,15]. Only lower + 4 bits of this parameter are significant. + @param frame0PositionY + location of the upper left sample of frame 0 (Left view) in + vertical direction. Allowed values are [0,15]. Only lower + 4 bits of this parameter are significant. + @param frame1PositionX + location of the upper left sample of frame 1 (Right view) in + horizontal direction. Allowed values are [0,15]. Only lower + 4 bits of this parameter are significant. + @param frame1PositionY + location of the upper left sample of frame 1 (Right view) in + vertical direction. Allowed values are [0,15]. Only lower + 4 bits of this parameter are significant. + @param reservedByte + reserved byte that needs to be encoded as part of SEI message + "frame_packing_arrangement_reserved_byte" + User should set it to 0 as current standard (March 2010) allows + only 0 of this value. This is kept for future provisions. + +*/ +typedef struct IH264ENC_FramePackingSEIParams { + XDAS_UInt8 framePackingPreset; + XDAS_UInt8 framePackingType; + XDAS_UInt8 frame0PositionX; + XDAS_UInt8 frame0PositionY; + XDAS_UInt8 frame1PositionX; + XDAS_UInt8 frame1PositionY; + XDAS_UInt8 reservedByte; +}IH264ENC_FramePackingSEIParams; + +/** + + @struct IH264ENC_SVCCodingParams + @brief This structure contains all the parameters which controls SVC + parameters. Refer Annex G of the H.264 standard for more details + of SVC and parameters + + @param svcExtensionFlag + This parameter configures the codec put SVC extensions in the + bit-stream. For normal H.264 operation this Flag needs to be ZERO + (default value). For Encoder instance to encode SSPS, Prefix-NALU, + Coded Slice in the bit-stream, this flag needs to be set. + + Allowed Values are [0,1,2] + + 0 - Disables all SVC features/syntaxes and rest of the structure + is not read/respected. + 1 - Encodes the required SVC related syntaxes of the layer for + which H.264 Codec has been instantiated. + 2 - Encoder the required SVC related syntaxes of the layer for + which H.264 Codec has been instantiated + Only in this mode, the JSVM error concealment will work on + encoded bitstreams as in this mode even Spatial/CGS is also + coded the MGS way (i.e. by setting + adaptive_xxx_prediction_flag and + default_xxxx_prediction_flag to zero). + + @param dependencyID + This parameter tell whether the current instance is for Base layer + or for enhancement layer and also conveys Layer ID Info. This field + is respected only when svcExtensionFlag is set. For configuring the + encoder instance for BL then this parameter should be ZERO. For + configuring the encoder instance for EL, this parameter should hold + the value of the layer ID. + + @param qualityID + This parameter tells Quality ID of the layer that the current instance + of encoder is going to encode. + This field is respected only when svcExtensionFlag is set. For + configuring the encoder instance for BL then this parameter should be + ZERO. + + @param enhancementProfileID + This parameter conveys the enhancement encoder instance like what + should be the profile ID to be encoded in the Sub-Sequence Parameter + Set (SSPS).This parameter is dont care when, the svcExtensionFlag is + not set.Possible values are IH264SVC_BASELINE_PROFILE (83) or + IH264SVC_HIGH_PROFILE (86) + @param layerIndex + This parameter conveys the enhancement encoder instance like what + should be the pic_parameter_set_id and seq_parameter_set_id to be + encoded in the Picture Parameter Set (PPS) and Sub-Sequence Parameter + Set (SSPS). layerIndex is dont care or treated to be ZERO when + svcExtensionFlag is not enabled. + @param refLayerDQId + This parameter conveys the the DQ Id of the ReferenceLayer. + +*/ + +typedef struct IH264ENC_SVCCodingParams { + XDAS_UInt8 svcExtensionFlag; + XDAS_UInt8 dependencyID; + XDAS_UInt8 qualityID; + XDAS_UInt8 enhancementProfileID; + XDAS_UInt8 layerIndex; + XDAS_Int8 refLayerDQId; + +} IH264ENC_SVCCodingParams; + +/**< + + @struct IH264ENC_Params + @brief This structure defines the Create time parameters for all + H264ENC objects + + @param videnc2Params must be followed for all video encoders. + Base class create params + @param rateControlParams Controls all Rate Control related parameters + @param interCodingParams Controls all Inter coding related parameters + @param intraCodingParams Controls all Intra coding related parameters + + @param nalUnitControlParams Controls the insertion of different NALUs at + different access points in video sequence + @param sliceCodingParams Controls all Slice coding related parameters + @param loopFilterParams Controls the in-loop filtering process + @param fmoCodingParams Controls the FMO behavior + @param vuiCodingParams Controls the VUI (Video Usability Information) + parameters. Refer Annex E for more details of + @param stereoInfoParams Controls the Stereo Video Information for SEI + NAL Unit. + @param framePackingSEIParams This structure contains all the parameters + for Frame packing SEI message. + @param svcCodingParams Controls the SVC coding parameters + + @param interlaceCodingType Controls the type of interlaced coding, refer + IH264ENC_InterlaceCodingType for more details + @param bottomFieldIntra This field is valid only for interlaced sequences + 0 = Bottom field of the first I frame in the GOP encoded as + P field. + non-zero = Bottom field of the first I frame in the GOP encoded as I + field. + + @param IDRFrameInterval Interval b/w two IDR frames, unit of this + parameter is intraFrameInterval + Ex: 0 : Only first I frame as IDR + 1 : All I frames are IDR. + 2 : 1 out of 2 I frames are IDR starting from first I frame + -ve values are not allowed. + + @param gopStructure Defines the gop structure type: + uniform/non-uniform. For more information refer + IH264ENC_GOPStructure + @param entropyCodingMode Controls the entropy coding type, see + IH264ENC_EntropyCodingMode for allowed values + @param transformBlockSize Tranform Block size. Refer + IH264ENC_TransformBlockSize + + @param log2MaxFNumMinus4 Limits the maximum frame number in the bit-stream + to (1<< (log2MaxFNumMinus4 + 4)) Range[0,12] + @param picOrderCountType Picture Order count type Valid values refer + IH264ENC_PicOrderCountType + @param enableWatermark This Parameter Enables or disables Water Mark + SEI message in the bit stream + 0 Disable, Non-Zero - Enable + @param pConstantMemory + This pointer points to the the memory area where constants are + located. It has to be in DDR addressable space by vDMA. This is + use ful to allow relocatable constants for the applications which + doesn't use M3 as host. Actual memory controller/allocator + is on another master processor. If this is set to NULL then + encoder assumes that all constants are pointed by symbol + H264ENC_TI_ConstData + + + @param maxIntraFrameInterval + This parameter contains the maximum Intra Frame interval. It is used + to reduce the memory requirement of refernce Buffers. Because for all + I frame/field configuration the reference frame buffers are not + required + @remarks For example, this field will be: + - 0 - Only first frame to be intra + coded. e.g. IPPPPPP... + - 1 - No inter frames (all intra + frames). + - 2 - Consecutive IPIPIP... sequence (if + no B frames). + - 3 - IPPIPP... or IPBIPBI... and so on. + + @param debugTraceLevel + This parameter configures the codec to dump a debug trace log + + @param lastNFramesToLog + This parameter configures the codec to maintain a history of last + N frames/pictures + + @param enableAnalyticinfo + This parameter configures the codec to expose analytic info like + MVs and SAD parameters + @param enableGMVSei + This Parameter Enable or disable the TI specific GMV SEI message + in the bit stream + 0 Disable, Non-Zero - Enable + + @param constraintSetFlags + Used to modify the values of constraint set flags that + are coded in te bit stream. The syntax of of this + flag is as follows + RESVD|RESVD|RESVD|PRESET|CST_0|CST_1|CST_2|CST_3 + if preset is set to zero then, CST flags are set by the + encoder internally. if preset is 1 then encoder takes the + preset values given by the user and encodes themin the + bit stream. Note that there are no error checks are placed + on the user defined values. + @param enableRCDO + This paramter is used to enable encoding a bit stream compliant to + Reduced Complexity Decoding Operations (RCDO) profile + + @param enableLongTermRefFrame + This paramter is used to enable support of long term reference frame. + Enabling this bit will instruct encoder to keep the recently marked + long-term frame in its refernce buffer list. So it increases the DDR + foot print by one or two frame buffers depends on the LTRPScheme used. + + @param LTRPPeriod + This parameter is used to specify the long-term reference frame + marking interval. This parameter is in use when + enableLongTermRefFrame = IH264ENC_LTRP_REFERTOP_REACTIVE or + IH264ENC_LTRP_REFERTO_PERIODICLTRP. + + @param numTemporalLayer + This parameter controls the temporal Levels in bit-stream. + 1 - Only Base Layer available in bit-stream. + 2 - Maximum Temporal Level 1 in bit-stream + 3 - Maximum Temporal Level 2 in bit-stream + 4 - Maximum Temporal Level 3 in bit-stream + @remarks - numTemporalLayer = 0 is not supported & its erroneous case. + + @param referencePicMarking + This parameter used to control the Reference Picture Marking + For any non-zero value means Long-term Picture (MMCO Commands) + 0 - Short-term Picture (Sliding Window) + 1 - Long-term Picture ( MMCO Commands) + @param reservedParams + Some part is kept reserved to add parameters later without + changing the foot print of interface object memory + + @todo + More parameters need to be added for Hieririchal frames, + error resilience options, SEI/VUI parameter options, Analytic exposure + from encoder like MVs and SAD parameters + + +*/ + typedef struct { - IVIDENC2_Params videnc2Params; - XDAS_Int8 reserved[148]; - XDAS_Int32 IDRFrameInterval; - XDAS_Int8 reserved1[4]; + IVIDENC2_Params videnc2Params; + IH264ENC_RateControlParams rateControlParams; + IH264ENC_InterCodingParams interCodingParams; + IH264ENC_IntraCodingParams intraCodingParams; + IH264ENC_NALUControlParams nalUnitControlParams; + IH264ENC_SliceCodingParams sliceCodingParams; + IH264ENC_LoopFilterParams loopFilterParams; + IH264ENC_FMOCodingParams fmoCodingParams; + IH264ENC_VUICodingParams vuiCodingParams; + IH264ENC_StereoInfoParams stereoInfoParams; + IH264ENC_FramePackingSEIParams framePackingSEIParams; + IH264ENC_SVCCodingParams svcCodingParams; + XDAS_Int8 interlaceCodingType; + XDAS_Int8 bottomFieldIntra; + XDAS_Int8 gopStructure; + XDAS_Int8 entropyCodingMode; + XDAS_Int8 transformBlockSize; + XDAS_Int8 log2MaxFNumMinus4; + XDAS_Int8 picOrderCountType; + /* XDAS_Int8 mbMetaDataEnable ; */ + XDAS_Int8 enableWatermark; + XDAS_Int32 IDRFrameInterval; + XDAS_Int32 pConstantMemory; XDAS_Int32 maxIntraFrameInterval; - XDAS_Int8 reserved2[16]; - XDAS_Int8 numTemporalLayer; - XDAS_Int8 reserved3[13]; + XDAS_UInt32 debugTraceLevel; + XDAS_UInt32 lastNFramesToLog; + XDAS_Int8 enableAnalyticinfo; + XDAS_Int8 enableGMVSei; + XDAS_Int8 constraintSetFlags; + XDAS_Int8 enableRCDO; + XDAS_Int32 enableLongTermRefFrame; + XDAS_Int32 LTRPPeriod; + XDAS_Int8 numTemporalLayer; + XDAS_Int8 referencePicMarking; + XDAS_Int32 reservedParams[3]; } IH264ENC_Params; + +/**< + + @struct IH264ENC_Status + @brief This structure informs back the status of H264 encoder and tells the + value of each control parameter + + @param videnc2Status must be followed for all video encoders. + Base class status + + @param rateControlParams Controls all Rate Control related parameters + @param interCodingParams Controls all Inter coding related parameters + @param intraCodingParams Controls all Intra coding related parameters + + @param nalUnitControlParams Controls the insertion of different NALUs at + different access points in video sequence + @param sliceCodingParams Controls all Slice coding related parameters + @param loopFilterParams Controls the in-loop filtering process + @param fmoCodingParams Controls the FMO behavior + @param vuiCodingParams Controls the VUI (Video Usability Information) + parameters. Refer Annex E for more details + of VUI and parameters + @param stereoInfoParams Controls the Stereo Video Information for SEI + NAL Unit. + @param framePackingSEIParams This structure contains all the parameters + for Frame packing SEI message. + @param svcCodingParams Controls the SVC behavior + @param interlaceCodingType Controls the type of interlaced coding, refer + IH264ENC_InterlaceCodingType for more details + @param bottomFieldIntra This field is valid only for interlaced sequences + 0 = Bottom field of the first I frame in the GOP + encoded as P field. + non-zero = Bottom field of the first I frame in + the GOP encoded as I field. + @param gopStructure Defines the gop structure type: Open/Close. + For more information refer IH264ENC_GOPStructure + @param entropyCodingMode Controls the entropy coding type, see + IH264ENC_EntropyCodingMode for allowed values + @param transformBlockSize Tranform Block size. Refer + IH264ENC_TransformBlockSize + + @param log2MaxFNumMinus4 Limits the maximum frame number in the bit-stream + to (1<< (log2MaxFNumMinus4 + 4)) Range[0,12] + @param picOrderCountType Picture Order count type Valid values refer + IH264ENC_PicOrderCountType + @param enableWatermark This Parameter Enables or disables Water Mark + SEI message in the bit stream + 0 Disable, Non-Zero - Enable + @param IDRFrameInterval Interval b/w two IDR frames, it should be and + integer multiple of intraFrameInterval + + @param maxIntraFrameInterval + This parameter contains the maximum Intra Frame interval. It is used + to reduce the memory requirement of refernce Buffers. Because for all + I frame/field configuration the reference frame buffers are not + required + @remarks For example, this field will be: + - 0 - Only first frame to be intra + coded. e.g. IPPPPPP... + - 1 - No inter frames (all intra + frames). + - 2 - Consecutive IPIPIP... sequence (if + no B frames). + - 3 - IPPIPP... or IPBIPBI... and so on. + + @param debugTraceLevel + This parameter configures the codec to dump a debug trace log + + @param lastNFramesToLog + This parameter configures the codec to maintain a history of last + N frames/pictures + + @param enableAnalyticinfo + This parameter configures the codec to expose analytic info like + MVs and SAD parameters + + @param enableGMVSei + This Parameter Enable or disable the TI specific GMV SEI message + in the bit stream + 0 Disable, Non-Zero - Enable + + @param constraintSetFlags + Used to modify the values of constraint set flags that + are coded in te bit stream. The syntax of of this + flag is as follows + RESVD|RESVD|RESVD|PRESET|CST_0|CST_1|CST_2|CST_3 + if preset is set to zero then, CST flags are set by the + encoder internally. if preset is 1 then encoder takes the + preset values given by the user and encodes themin the + bit stream. Note that there are no error checks are placed + on the user defined values. + + @param enableRCDO + This paramter is used to enable encoding a bit stream compliant to + Reduced Complexity Decoding Operations (RCDO) profile + + @param enableLongTermRefFrame + This paramter is used to enable support of long term reference frame. + Enabling this bit will instruct encoder to keep the recently marked + long-term frame in its refernce buffer list. So it increases the DDR + foot print by one or two frame buffers depends on the LTRPScheme used. + + @param LTRPPeriod + This parameter is used to specify the long-term reference frame + marking interval. This parameter is in use when + enableLongTermRefFrame = IH264ENC_LTRP_REFERTOP_REACTIVE or + IH264ENC_LTRP_REFERTO_PERIODICLTRP. + + @param searchCenter seacrh Center for motion estimation + @param enableStaticMBCount Flag to indicate enable/disable Static MB count + support + @param extMemoryDebugTraceAddr This parameter reports the external + memory address (as seen by M3) where debug trace + information is being dumped + @param extMemoryDebugTraceSize This parameter reports the external + memory buffer size (in bytes) where debug trace + information is being dumped + @param numTemporalLayer This parameter controls the temporal Levels in + bit-stream. + @param referencePicMarking This parameter used to control the Reference + Picture Marking. +*/ + +typedef struct { + IVIDENC2_Status videnc2Status; + + IH264ENC_RateControlParams rateControlParams; + IH264ENC_InterCodingParams interCodingParams; + IH264ENC_IntraCodingParams intraCodingParams; + IH264ENC_NALUControlParams nalUnitControlParams; + IH264ENC_SliceCodingParams sliceCodingParams; + IH264ENC_LoopFilterParams loopFilterParams; + IH264ENC_FMOCodingParams fmoCodingParams; + IH264ENC_VUICodingParams vuiCodingParams; + IH264ENC_StereoInfoParams stereoInfoParams; + IH264ENC_FramePackingSEIParams framePackingSEIParams; + IH264ENC_SVCCodingParams svcCodingParams; + + XDAS_Int8 interlaceCodingType; + XDAS_Int8 bottomFieldIntra; + XDAS_Int8 gopStructure; + XDAS_Int8 entropyCodingMode; + XDAS_Int8 transformBlockSize; + XDAS_Int8 log2MaxFNumMinus4; + XDAS_Int8 picOrderCountType; + XDAS_Int8 enableWatermark; + XDAS_Int32 IDRFrameInterval; + XDAS_Int32 maxIntraFrameInterval; + XDAS_UInt32 debugTraceLevel; + XDAS_UInt32 lastNFramesToLog; + XDAS_Int8 enableAnalyticinfo; + XDAS_Int8 enableGMVSei; + XDAS_Int8 constraintSetFlags; + XDAS_Int8 enableRCDO; + XDAS_Int32 enableLongTermRefFrame; + XDAS_Int32 LTRPPeriod; + XDM_Point searchCenter; + XDAS_Int8 enableStaticMBCount; + XDAS_UInt32 *extMemoryDebugTraceAddr; + XDAS_Int8 numTemporalLayer; + XDAS_Int8 referencePicMarking; + XDAS_UInt32 extMemoryDebugTraceSize; + XDAS_Int8 enableROI; +} IH264ENC_Status; + +/**< This structure must be the first field of all H264ENC instance objects */ +typedef struct IH264ENC_Obj { + struct IH264ENC_Fxns *fxns; +} IH264ENC_Obj; + +/**< This handle is used to reference all H264ENC instance objects */ +typedef struct IH264ENC_Obj *IH264ENC_Handle; + +/**numEntries > 1). + 2.Suggested value for this flag is 0 to have better performance + @params processParams : An array holding the process parameters viz., + handle,InArgs,outArgs etc of the channel(s) to be processed. + + */ + +typedef struct { + XDAS_Int32 numEntries; + XDAS_Int32 enableErrorCheck; + IH264ENC_ProcessParams processParams[IH264ENC_MAX_LENGTH_PROCESS_LIST]; +} IH264ENC_ProcessParamsList; + +/**< + + @struct IH264ENC_Fxns + @brief This structure defines of the operations on H264ENC objects + + @params IVIDENC2_Fxns : It is instance of base class. It contains all + function table + @params processMulti : pointer to the Function H264ENC_TI_encodemulti + +*/ +typedef struct IH264ENC_Fxns { + IVIDENC2_Fxns ividenc; + XDAS_Int32 (*processMulti)(IH264ENC_ProcessParamsList *processList); + +} IH264ENC_Fxns; + +#ifdef __cplusplus +} #endif + +/*@}*/ /* ingroup HDVICP2H264 */ + +#endif /* _IH264ENC_H_ --} */ + +/* ========================================================================*/ +/* End of file : ih264enc.h */ +/*-------------------------------------------------------------------------*/ +/* Copyright (c) 2009 Texas Instruments, Incorporated. */ +/* All Rights Reserved. */ +/* ========================================================================*/ + diff -Nru dce-1.6.5.4/packages/ivahd_codecs/ti/sdo/codecs/jpegvdec/ijpegvdec.h dce-1.6.7.3/packages/ivahd_codecs/ti/sdo/codecs/jpegvdec/ijpegvdec.h --- dce-1.6.5.4/packages/ivahd_codecs/ti/sdo/codecs/jpegvdec/ijpegvdec.h 1970-01-01 00:00:00.000000000 +0000 +++ dce-1.6.7.3/packages/ivahd_codecs/ti/sdo/codecs/jpegvdec/ijpegvdec.h 2012-11-28 09:54:14.000000000 +0000 @@ -0,0 +1,609 @@ +/* +******************************************************************************** +* HDVICP2.0 Based JPEG Decoder +* +* "HDVICP2.0 Based JPEG Decoder" is software module developed on +* TI's HDVICP2 based SOCs. This module is capable of generating a raw image +* by de-compressing/decoding a jpeg bit-stream based on ISO/IEC IS 10918-1. +* Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/ +* ALL RIGHTS RESERVED +******************************************************************************** +*/ + +/** +******************************************************************************** +* @file ijpegvdec.h +* +* @brief This file provides definisions for the interface handles. +* +* @author Odanaka +* +* @version 0.0 (Dec 2008) : Created the initial version. +* +* @version 0.1 (Dec 2009) : Added extended dynamic paramters[Chetan] +* +* @version 0.2 (Feb 2010) : Coding Guidelines[Chetan] +* +* @version 0.3 (July 2010) : Added Error Robustness Error Codes[Chetan] +* +* @version 0.4 (Sept 2010) : Added Error Robustness Error Codes for Data Sync +* [Chetan] +* +* @version 0.5 (Nov 2010) : Added support for Slice level decoding[Chetan] +* +* @version 0.6 (Feb 2011) : Added error codes for unsupported features [Chetan] +* +* @version 0.7 (Sep 2011) : Exposed default static/dynamic params [Naidu] +* +* @version 0.8 (Sep 2011) : Added error codes for un-supported resultions +* [Naidu] +* +******************************************************************************* +*/ + +/*----------------------compilation control switches -------------------------*/ +#ifndef _IJPEGVDEC_ +#define _IJPEGVDEC_ + +/******************************************************************************* +* INCLUDE FILES +*******************************************************************************/ +/* -------------------- system and platform files ----------------------------*/ +#include +#include +#include +#include +#include + +/*----------------------program files ----------------------------------------*/ + +/******************************************************************************* +* PUBLIC DECLARATIONS Defined here, used elsewhere +*******************************************************************************/ +/*-----------------------data declarations -----------------------------------*/ + + +/** +******************************************************************************* +* @enum ethumbnailMode +* +* @brief Enumerator which defines all the different types of thumbnail +* supported. +* +* @remarks IJPEGVDEC_THUMBNAIL_JFIF : Decode and output thumbnail +* available with JFIF marker +* +* @remarks IJPEGVDEC_THUMBNAIL_EXIF : Decode and output thumbnail +* available with EXIF marker +* +* @remarks IJPEGVDEC_THUMBNAIL_DOWNSAMPLE : Decode the image and +* downsample it toprovide it as thumbnail output +* +******************************************************************************* +*/ +typedef enum { + IJPEGVDEC_THUMBNAIL_JFIF = 1, + IJPEGVDEC_THUMBNAIL_EXIF = 2, + IJPEGVDEC_THUMBNAIL_DOWNSAMPLE = 3 +}ethumbnailMode; + +/** +******************************************************************************* +* @enum edownSamplingFactor +* +* @brief Enumerator which defines the factor with which the downsampling +* needs to be carried out. This applies to both Horizontal +* and vertical dimentions +* +* @remarks IJPEGVDEC_NODOWNSAMPLE : No Down Sample. +* +* @remarks IJPEGVDEC_DOWNSAMPLEBY2 : Downscale by 2 +* +* @remarks IJPEGVDEC_DOWNSAMPLEBY4 : Downscale by 4 +* +* +******************************************************************************* +*/ +typedef enum { + IJPEGVDEC_NODOWNSAMPLE = 1, + IJPEGVDEC_DOWNSAMPLEBY2 = 2, + IJPEGVDEC_DOWNSAMPLEBY4 = 4 +} edownSamplingFactor; + +/** +******************************************************************************* +* @enum eFrameErrorConcealment +* +* @brief Enumerator which defines values to ENABLE or DISABLE +* Error Concealment +* +* @remarks IJPEGVDEC_EC_DISABLE : Disable Error concealment +* +* @remarks IJPEGVDEC_EC_ENABLE : Enable Error Concealment +* +* +******************************************************************************* +*/ +typedef enum { + IJPEGVDEC_EC_DISABLE = 0, + IJPEGVDEC_EC_ENABLE +}eFrameErrorConcealment_jpegvdec; + +/** +******************************************************************************* +* @struct IJPEGVDEC_Obj +* +* @brief This structure must be the first field of all jpgVDEC instance +* objects +* +* @param fxns : Handle to extented jpeg video decoder library interface +* functions +* +******************************************************************************* +*/ +typedef struct IJPEGVDEC_Obj { + struct IJPEGVDEC_Fxns *fxns; +} IJPEGVDEC_Obj; + +/** +******************************************************************************* +* @struct IJPEGVDEC_Handle +* +* @brief This handle is used to reference all jpgVDEC instance objects +* +******************************************************************************* +*/ +typedef struct IJPEGVDEC_Obj *IJPEGVDEC_Handle; + +/** +******************************************************************************* +* @struct IJPEGVDEC_Status +* +* @brief Status structure defines the parameters that can be changed or +* read during real-time operation of the alogrithm. +* +* @param viddecStatus : Handle to base class status struture which defines +* the all run time parameters. +* +* @param extendedErrorCode0 : Extended Error Code0 returned by decoder +* +* @param extendedErrorCode1 : Extended Error Code1 returned by decoder +* +* @param extendedErrorCode2 : Extended Error Code2 returned by decoder +* +* @param extendedErrorCode3 : Extended Error Code3 returned by decoder +* +* @param debugTraceLevel : DebugTrace level being used by decoder +* +* @param lastNFramesToLog : Number of frames of debug data decoder is +* dumping trace buffer +* +* @param extMemoryDebugTraceAddr : Trace buffer base address in external memory +* +* @param extMemoryDebugTraceSize : Size of Trace buffer in external memory +* +******************************************************************************* +*/ +typedef struct IJPEGVDEC_Status { + /*--------------------------------------------------------------------------*/ + /*Base Class */ + /*--------------------------------------------------------------------------*/ + IVIDDEC3_Status viddecStatus; + + /*--------------------------------------------------------------------------*/ + /*Extended Error Code0 returned by decoder */ + /*--------------------------------------------------------------------------*/ + XDAS_UInt32 extendedErrorCode0; + + /*--------------------------------------------------------------------------*/ + /*Extended Error Code1 returned by decoder */ + /*--------------------------------------------------------------------------*/ + XDAS_UInt32 extendedErrorCode1; + + /*--------------------------------------------------------------------------*/ + /*Extended Error Code2 returned by decoder */ + /*--------------------------------------------------------------------------*/ + XDAS_UInt32 extendedErrorCode2; + + /*--------------------------------------------------------------------------*/ + /*Extended Error Code3 returned by decoder */ + /*--------------------------------------------------------------------------*/ + XDAS_UInt32 extendedErrorCode3; + + /*--------------------------------------------------------------------------*/ + /*DebugTrace level being used by decoder */ + /*--------------------------------------------------------------------------*/ + XDAS_UInt32 debugTraceLevel; + + /*--------------------------------------------------------------------------*/ + /*Number of frames of debug data decoder is dumping trace buffer */ + /*--------------------------------------------------------------------------*/ + XDAS_UInt32 lastNFramesToLog; + + /*--------------------------------------------------------------------------*/ + /* Trace buffer base address in external memory */ + /*--------------------------------------------------------------------------*/ + XDAS_UInt32 *extMemoryDebugTraceAddr; + + /*--------------------------------------------------------------------------*/ + /* Size of Trace buffer in external memory */ + /*--------------------------------------------------------------------------*/ + XDAS_UInt32 extMemoryDebugTraceSize; + +} IJPEGVDEC_Status; + +/** +******************************************************************************* +* @struct IJPEGVDEC_Cmd +* +* @brief The Cmd enumeration defines the control commands for the JPEG +* video decoder control method. +* +******************************************************************************* +*/ +typedef IVIDDEC3_Cmd IJPEGVDEC_Cmd; + +/** +******************************************************************************* +* @struct IJPEGVDEC_Params +* +* @brief This structure defines the creation parameters for all +* jpgVDEC objects +* +* @param viddecParams : Defines the creation time parameters for +* all IVIDDEC3 instance objects. +* +* @param ErrorConcealmentON : Enable/Disable Error Concealment +* +* @param debugTraceLevel : Enable/Disable Error Concealment +* +* @param lastNFramesToLog : Number of frames to log history for debugTrace +* +* @param sliceSwitchON : ENABLE/DISABLE Slice Switching feature. +* +* @param numSwitchPerFrame : Number of Switches in a Frame. +* +* @param numRestartMarkerPerSwitch : Number of Restart Marker(slices) to +* decode in one process call or in one switch. +* +******************************************************************************* +*/ +typedef struct IJPEGVDEC_Params { + /*--------------------------------------------------------------------------*/ + /*Base Class */ + /*--------------------------------------------------------------------------*/ + IVIDDEC3_Params viddecParams; + + /*--------------------------------------------------------------------------*/ + /*Enable/Disable Error Concealment */ + /* enumeration 'eFrameErrorConcealment' can be used to set this value */ + /*--------------------------------------------------------------------------*/ + XDAS_Int32 ErrorConcealmentON; + + /*--------------------------------------------------------------------------*/ + /*Debug trace Level */ + /*--------------------------------------------------------------------------*/ + XDAS_UInt32 debugTraceLevel; + + /*--------------------------------------------------------------------------*/ + /*Number of frames to log history for debugTrace */ + /*--------------------------------------------------------------------------*/ + XDAS_UInt32 lastNFramesToLog; + + /*--------------------------------------------------------------------------*/ + /* ENABLE/DISABLE Slice Switching feature. */ + /* enumeration 'eSliceSwitch' can be used to set this value */ + /*--------------------------------------------------------------------------*/ + XDAS_UInt32 sliceSwitchON; + + /*--------------------------------------------------------------------------*/ + /* Number of Switches in a Frame. This is valid only when sliceSwitchON is */ + /* enabled , when disabled , its dont care. */ + /* Application tells how many switches should happen in a frame , codec has */ + /* to decide how to handle each process call ( how many slices) and it has */ + /* process "numSwitchInFrame " process calls only */ + /*--------------------------------------------------------------------------*/ + XDAS_UInt32 numSwitchPerFrame; + + /*--------------------------------------------------------------------------*/ + /* Application tells a number meaning codec has to decode this much slices */ + /* or restart markers and come out of process call. Here each switch can */ + /*have N number of restart marker ( N should be greater than or equal to 1).*/ + /* Once codec process call is done , application will give again the next */ + /* number and application will handle till all the slices in the frame have */ + /* been decoded. */ + /* This paramter is valid only when "sliceSwitchON" is enabled */ + /*--------------------------------------------------------------------------*/ + XDAS_UInt32 numRestartMarkerPerSwitch; + +} IJPEGVDEC_Params; + +/** +******************************************************************************* +* @struct IJPEGVDEC_DynamicParams +* +* @brief This structure defines the run time parameters for all +* jpgVDEC objects +* +* @param viddecDynamicParams : Defines the run time parameters for +* all IVIDDEC3 instance objects. +* +* @param decodeThumbnail : Decode the ThumNail and provide the output for +* display. +* +* @param thumbnailMode : Specifies which thumbnail to decode. If none of +* the markers (JFIF and EXIF) have thumbnail image, +* use IJPEGVDEC_THUMBNAIL_DOWNSAMPLE. Refer to +* thumbnailMode enumeration +* +* @param downsamplingFactor : If decodeThumbnail is enabled and +* thumbnailMode is set to +* IJPEGVDEC_THUMBNAIL_DOWNSAMPLE, +* downsamplingFactor is used as scaling factor +* for ThumNail output +* If decodeThumbnail is disabled, this parameter +* is used as scaling factor for display buffer +* output. Refer to edownSamplingFactor +* +* @param streamingCompliant : If an Input Image is Non-Interleaved , +* Application has to set this params to "0" +* (DISABLE) , if it is Interleaved , value will +* be "1" (ENABLE). This Paramater along with +* ForceChromaFormat determines whether we +* have to give Planar Buffers from GetBufinfo. +* +******************************************************************************* +*/ +typedef struct IJPEGVDEC_DynamicParams { + IVIDDEC3_DynamicParams viddecDynamicParams; + + XDAS_Int32 decodeThumbnail; + + XDAS_Int32 thumbnailMode; + + XDAS_Int32 downsamplingFactor; + + XDAS_Int32 streamingCompliant; + +} IJPEGVDEC_DynamicParams; + +/** +******************************************************************************* +* @struct IJPEGVDEC_InArgs +* +* @brief This structure defines the run time input arguments for all VIDDEC +* objects. +* +* @param viddecInArgs : Defines the input arguments for all +* IVIDDEC3 instance process function. +* +******************************************************************************* +*/ +typedef struct IJPEGVDEC_InArgs { + IVIDDEC3_InArgs viddecInArgs; +}IJPEGVDEC_InArgs; + +/** +******************************************************************************* +* @struct IJPEGVDEC_OutArgs +* +* @brief This structure defines the run time output arguments for VIDDEC +* objects.This structure may be extended by individual codec +* implementation allowing customization with vendor specific +* parameters. +* +* @param viddecOutArgs : Defines the output arguments for all +* IVIDDEC3 instance process function. +* +******************************************************************************* +*/ +typedef struct IJPEGVDEC_OutArgs { + IVIDDEC3_OutArgs viddecOutArgs; + XDAS_UInt32 IsGrayFlag; +}IJPEGVDEC_OutArgs; + + +/** +******************************************************************************* +* @struct IJPEGVDEC_Fxns +* +* @brief This structure defines all of the operations on jpgVDEC objects. +* +* @param ividdec : handle to the all function of the operations +* on IVIDDEC3 objects +* +******************************************************************************* +*/ +typedef struct IJPEGVDEC_Fxns { + IVIDDEC3_Fxns ividdec; +} IJPEGVDEC_Fxns; + +typedef enum { + IJPEGDEC_ERR_UNSUPPORTED_VIDDEC3PARAMS = 0, + IJPEGDEC_ERR_UNSUPPORTED_VIDDEC3DYNAMICPARAMS, + IJPEGDEC_ERR_UNSUPPORTED_JPEGDECDYNAMICPARAMS, + IJPEGDEC_ERR_NOSLICE, + IJPEGDEC_ERR_MBDATA, + IJPEGDEC_ERR_STANDBY, + IJPEGDEC_ERR_INVALID_MBOX_MESSAGE, + IJPEGDEC_ERR_HDVICP_RESET, + IJPEGDEC_ERR_HDVICP_WAIT_NOT_CLEAN_EXIT = 16, + IJPEGDEC_ERR_FRAME_HDR, + IJPEGDEC_ERR_SCAN_HDR, + IJPEGDEC_ERR_HUFF_TBL_HDR, + IJPEGDEC_ERR_QUANT_TBL_HDR, + IJPEGDEC_ERR_OUTCHROMAFORMAT, + IJPEGDEC_ERR_UNSUPPORTED_MARKER, + IJPEGDEC_ERR_THUMBNAIL, + IJPEGDEC_ERR_IRES_HANDLE, + IJPEGDEC_ERR_DYNAMIC_PARAMS_HANDLE, + + /* Error Codes of Data Sync */ + IJPEGDEC_ERR_DATASYNC, + IJPEGDEC_ERR_DOWNSAMPLE_INPUT_FORMAT, + IJPEGDEC_ERR_NOT_SUPPORTED_FEATURE, + IJPEGDEC_ERR_NOT_SUPPORTED_RESOLUTION + +}IJPEGDEC_ExtendedErrorCodes; + +typedef enum { + JPEG_DECODE_THUMBNAIL_ERROR = 0, + JPEG_DYNAMIC_PARAMS_HANDLE_ERROR, + JPEG_THUMBNAIL_MODE_ERROR, + JPEG_DOWNSAMPLING_FACTOR_ERROR, + JPEG_STREAMING_COMPLIANT_ERROR, + JPEG_NON_INTERLEAVED_STREAMING_COMPLIANT_ERROR, + JPEG_DECODE_HEADER_ERROR, + JPEG_DISPLAY_WIDTH_ERROR, + JPEG_DYNAMIC_PARAMS_SIZE_ERROR, + JPEG_NULL_INSTANCE_HANDLE_ERROR, + JPEG_NULL_INARGS_POINTER_ERROR, + JPEG_NULL_OUTARGS_POINTER_ERROR, + JPEG_NULL_INPUT_BUF_DESC_ERROR, + JPEG_NULL_OUTPUT_BUF_DESC_ERROR, + JPEG_INVALID_INARGS_SIZE, + JPEG_INVALID_OUTARGS_SIZE, + JPEG_NULL_INPUT_BUFFER_POINTER_ERROR, + JPEG_NULL_OUTPUT_BUF_DESC_POINTER_ERROR, + JPEG_INVALID_NUM_OF_INPUT_BUFFERS_ERROR, + JPEG_INVALID_INPUT_BYTES_ERROR, + JPEG_INVALID_INPUT_BUFFER_MEMORY_TYPE_ERROR, + JPEG_INVALID_NUM_OF_OUTPUT_BUFFERS_ERROR, + JPEG_NULL_OUTPUT_BUFFER_POINTER0_ERROR, + JPEG_INVALID_OUTPUT_BUFFER0_SIZE_ERROR, + JPEG_INVALID_OUTPUT_BUFFER0_MEMTYPE_ERROR, + JPEG_NULL_OUTPUT_BUFFER_POINTER1_ERROR, + JPEG_INVALID_OUTPUT_BUFFER1_SIZE_ERROR, + JPEG_INVALID_OUTPUT_BUFFER1_MEMTYPE_ERROR, + JPEG_NULL_OUTPUT_BUFFER_POINTER2_ERROR, + JPEG_INVALID_OUTPUT_BUFFER2_SIZE_ERROR, + JPEG_INVALID_OUTPUT_BUFFER2_MEMTYPE_ERROR, + JPEG_INVALID_INPUT_ID_ERROR, + JPEG_NUM_VDMA_DESC_EXCEEDS_ERROR, + JPEG_INVALID_SOI_MARKER_ERROR, + JPEG_INVALID_MARKER_SEG_LENGTH_ERROR, + JPEG_NON_STANDARD_MARKER_CODE_ERROR, + JPEG_INVALID_QUANT_TABLE_TYPE_ERROR, + JPEG_QUANT_TABLE_BYTES_READ_ERROR, + JPEG_INVALID_HUFFMAN_TABLE_TYPE_ERROR, + JPEG_HUFFMAN_CODE_LENGTH_SIZE_EXCEED_ERROR, + JPEG_HUFFMAN_TABLE_MARKER_SEG_SIZE_ERROR, + JPEG_HUFFMAN_TABLE_BYTES_READ_ERROR, + JPEG_INVALID_SAMPLE_PRECISION_ERROR, + JPEG_INVALID_NUM_COMPONENTS_ERROR, + JPEG_FRAME_HDR_BYTES_READ_ERROR, + JPEG_NOT_SUPPORTED_FORMAT_ERROR, + JPEG_ARITHMETIC_DECODING_NOT_SUPPORTED_MARKER_ERROR, + JPEG_PROG_DECODING_NOT_SUPPORTED_MARKER_ERROR, + JPEG_LOSSLESS_DECODING_NOT_SUPPORTED_MARKER_ERROR, + JPEG_DIFFERENTIAL_DECODING_NOT_SUPPORTED_MARKER_ERROR, + JPEG_JFIF_THUMBNAIL_IDENTIFIER_ERROR, + JPEG_JFIF_THUMBNAIL_BYTES_READ_ERROR, + JPEG_JFIF_EXTN_NO_SOI_ERROR, + JPEG_JFIF_NOT_SUPPORTED_FEATURE_ERROR, + JPEG_FORCECHROMA_OUTPUTCHROMA_FORMAT_MISMATCH_ERROR, + JPEG_INVALID_VERT_SCAN_FREQ_ERROR, + JPEG_INVALID_HORI_SCAN_FREQ_ERROR, + JPEG_INVALID_QUANT_DEST_SELECTOR_ERROR, + JPEG_DC_ENTROPY_CODING_DEST_ERROR, + JPEG_AC_ENTROPY_CODING_DEST_ERROR, + JPEG_ECD_VLD_OUT_OF_TABLE_ERROR, + JPEG_ECD_RESTART_INTERVAL_ERROR, + JPEG_ECD_BLOCK_COEFF_NUM_ERROR, + JPEG_GET_DATA_SYNC_NULL_FUNC_POINTER_ERROR, + JPEG_PUT_DATA_SYNC_NULL_FUNC_POINTER_ERROR, + JPEG_HDVICP_ACQUIRE_AND_CONFIGURE_ERROR, + JPEG_NULL_ALGORITHM_HANDLE_ERROR, + JPEG_GETVERSION_NULL_BUF_POINTER_ERROR, + JPEG_IRES_RESOURCE_DESC_ERROR, + JPEG_IRES_RESOURCE_DESC_HANDLE_ERROR, + JPEG_NULL_STATUS_DATA_BUF, + JPEG_EXCEED_BYTES_CONSUMED_ERROR, + + /* Extended Error Codes for Data Sync */ + JPEG_INPUT_DATASYNC_NUMBLOCKS_ERROR, + JPEG_INPUT_DATASYNC_BUFF_POINTER_ERROR, + JPEG_INPUT_DATASYNC_BLOCKSIZE_ERROR, + JPEG_INPUT_DATASYNC_NOT_VALID, + + JPEG_OUTPUT_DATASYNC_NUMBLOCKS_ERROR, + + JPEG_SLICE_LEVEL_INPUT_NO_RST_MARKER_ERROR, + JPEG_DOWNSAMPLING_IN_NON_TILED_ERROR, + JPEG_DOWNSAMPLING_NOT_SUPPORTED_FORMAT_ERROR, + JPEG_DOWNSAMPLING_NOT_SUPPORTED_FEATURE_ERROR, + JPEG_THUMBNAIL_NOT_SUPPORTED_FEATURE_ERROR, + + /* Extended Error Codes for Unsupported Resolution */ + JPEG_NOT_SUPPORTED_WIDTH_ERROR, + JPEG_NOT_SUPPORTED_HEIGHT_ERROR + +}IjpegVDEC_ErrorStatus; +/* + * ======== IJPEGVDEC_Params ======== + * Default parameter values for JPEGVDEC instance objects + */ +extern const IJPEGVDEC_Params JPEGVDEC_TI_Static_Params; +/* + * ======== IJPEGVDEC_DynamicParams ======== + * Default dynamic parameter values for JPEGVDEC instance objects + */ +extern const IJPEGVDEC_DynamicParams JPEGVDEC_TI_DynamicParams; +/* ------------------------------ macros ------------------------------------ */ + +/**************************************************************** +* PRIVATE DECLARATIONS Defined here, used only here +****************************************************************/ +/*--------data declarations -----------------------------------*/ + +/** +* Extending control method commands +*/ +/** +* The Macro indicates the Get Status Command Enum for the Control API +*/ +#define IJPEGVDEC_GETSTATUS XDM_GETSTATUS + +/** +* The Macro indicates the SET PARAMS Command Enum for the Control API +*/ +#define IJPEGVDEC_SETPARAMS XDM_SETPARAMS + +/** +* The Macro indicates the XDM RESET Command Enum for the Control API +*/ +#define IJPEGVDEC_RESET XDM_RESET + +/** +* The Macro indicates the XDM FLUSH Command Enum for the Control API +*/ +#define IJPEGVDEC_FLUSH XDM_FLUSH + +/** +* The Macro indicates the SET DEFUALT Command Enum for the Control API +*/ +#define IJPEGVDEC_SETDEFAULT XDM_SETDEFAULT + +/** +* The Macro indicates the Get BUFINFO Command Enum for the Control API +*/ +#define IJPEGVDEC_GETBUFINFO XDM_GETBUFINFO + +/** +* The Macro indicates the Get VERSION Command Enum for the Control API +*/ +#define IJPEGVDEC_GETVERSION XDM_GETVERSION + +/** +* The Macro indicates the Get CONTEXTINFO Command Enum for the Control API +*/ +#define IJPEGVDEC_GETCONTEXTINFO XDM_GETCONTEXTINFO + +/** +* The Macro indicates the Get DYNAMICPARAM DEFAULT Command Enum for the +* Control API +*/ +#define IJPEGVDEC_GETDYNPARAMSDEFAULT XDM_GETDYNPARAMSDEFAULT + +#endif /* _IJPEGVDEC_ */ + diff -Nru dce-1.6.5.4/packages/ivahd_codecs/ti/sdo/codecs/mpeg2vdec/impeg2vdec.h dce-1.6.7.3/packages/ivahd_codecs/ti/sdo/codecs/mpeg2vdec/impeg2vdec.h --- dce-1.6.5.4/packages/ivahd_codecs/ti/sdo/codecs/mpeg2vdec/impeg2vdec.h 2012-09-24 15:13:39.000000000 +0000 +++ dce-1.6.7.3/packages/ivahd_codecs/ti/sdo/codecs/mpeg2vdec/impeg2vdec.h 2012-11-28 09:54:14.000000000 +0000 @@ -1,71 +1,508 @@ /* - * Copyright (c) 2010, Texas Instruments Incorporated - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of Texas Instruments Incorporated nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ +******************************************************************************** +* HDVICP2.0 Based MPEG-2 MP Decoder +* +* "HDVICP2.0 Based MPEG-2 MP Decoder" is software module developed on TI's +* HDVICP2 based SOCs. This module is capable of generating a raw 4:2:0 video +* data by de-compressing/decoding a main/simple profile bit-stream based on +* ISO/IEC 13818-2. +* Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/ +* ALL RIGHTS RESERVED +******************************************************************************** +*/ + +/** +******************************************************************************** +* @file impeg2vdec.h +* +* @brief This file provides definisions for the interface(API) parameters. +* +* @author Prashanth +* +* @version 0.0 (July 2008) : Created [Prashanth] +* @version 0.1 (Dec 2009) : Added extended dynamic paramters[Deepa] +* @version 0.2 (Feb 2010) : Coding Guidelines[Deepa] +* @version 0.3 (July 2010) : Error robustness added. +* [Deepa Nagendra]. +* @version 0.4 (Aug 2010) : Debug trace implementation. +* [Deepa Nagendra]. +* @version 0.5 (Aug 2010) : Error Concealment support. +* [Deepa Nagendra]. +* @version 0.6 (Dec 2011) : Default structures are exposed in interface file +* and macros are differenciated with codec name. +* [Naidu]. +* @version 0.6 (July 2012) : Added extended error codes for errors incase +* referenceframe is not available while decoding +* after flush and SEEK [Naidu]. +* +******************************************************************************** +*/ +/* ---------------------- compilation control switches ---------------------- */ +#ifndef _IMPEG2VDEC_ +#define _IMPEG2VDEC_ -#ifndef __IMPEG2VDEC_H__ -#define __IMPEG2VDEC_H__ +/******************************************************************************* +* INCLUDE FILES +*******************************************************************************/ +/* ---------------------- system and platform files ------------------------- */ +#include #include #include +#include +#include +/* --------------------------- program files -------------------------------- */ + +/******************************************************************************* +* PUBLIC DECLARATIONS Defined here, used elsewhere +*******************************************************************************/ +/*-----------------------data declarations -----------------------------------*/ + + +/******************************************************************************* +* PRIVATE DECLARATIONS Defined here, used only here +*******************************************************************************/ +/*-----------------------data declarations -----------------------------------*/ +/*-----------------------function prototypes ---------------------------------*/ + +/** +******************************************************************************** +* @struct IMPEG2VDEC_Obj +* +* @brief This structure must be the first field of all Mpeg2vdec instance +* objects +* +* @param fxns : Handle to extented mpeg2 video decoder library +* interface functions +* +******************************************************************************** +*/ +typedef struct IMPEG2VDEC_Obj { + struct IMPEG2VDEC_Fxns *fxns; +} IMPEG2VDEC_Obj; + +/** +******************************************************************************** +* @struct IMPEG2VDEC_Handle +* +* @brief This handle is used to reference all Mpeg2vdec instance objects +* +******************************************************************************** +*/ +typedef struct IMPEG2VDEC_Obj *IMPEG2VDEC_Handle; + +/** +******************************************************************************** +* @struct IMPEG2VDEC_Status +* +* @brief Status structure defines the parameters that can be changed or +* read during real-time operation of the alogrithm. +* +* @param viddecStatus : Handle to base class status struture which +* defines the all run time parameters. +******************************************************************************** +*/ typedef struct IMPEG2VDEC_Status { - IVIDDEC3_Status viddecStatus; - XDAS_UInt32 extendedErrorCode0; - XDAS_UInt32 extendedErrorCode1; - XDAS_UInt32 extendedErrorCode2; - XDAS_UInt32 extendedErrorCode3; - XDAS_UInt32 reserved[4]; + IVIDDEC3_Status viddecStatus; + /* Extended Error Code0 returned by decoder */ + XDAS_UInt32 extendedErrorCode0; + /* Extended Error Code1 returned by decoder */ + XDAS_UInt32 extendedErrorCode1; + /* Extended Error Code2 returned by decoder */ + XDAS_UInt32 extendedErrorCode2; + /* Extended Error Code3 returned by decoder */ + XDAS_UInt32 extendedErrorCode3; + + XDAS_UInt32 debugTraceLevel; + + XDAS_UInt32 lastNFramesToLog; + + XDAS_UInt32 *extMemoryDebugTraceAddr; + + XDAS_UInt32 extMemoryDebugTraceSize; + } IMPEG2VDEC_Status; +/** +* @brief The Cmd enumeration defines the control commands for the MPEG2 +* video decoder control method. +*/ +typedef IVIDDEC3_Cmd IMPEG2VDEC_Cmd; + +/** +******************************************************************************** +* @struct IMPEG2VDEC_Params +* +* @brief This structure defines the creation parameters for all +* mpeg2VDEC objects +* +* @param viddecParams : Defines the creation time parameters for +* all IVIDDEC1 instance objects. +* +******************************************************************************** +*/ typedef struct IMPEG2VDEC_Params { - IVIDDEC3_Params viddecParams; - XDAS_Int32 ErrorConcealmentON; - XDAS_UInt32 reserved[3]; + + IVIDDEC3_Params viddecParams; + XDAS_Int32 ErrorConcealmentON; + XDAS_Int32 outloopDeBlocking; + + /*--------------------------------------------------------------------------*/ + /*Debug trace Level */ + /*--------------------------------------------------------------------------*/ + XDAS_UInt32 debugTraceLevel; + + /*--------------------------------------------------------------------------*/ + /*History of last N frames */ + /*--------------------------------------------------------------------------*/ + XDAS_UInt32 lastNFramesToLog; + } IMPEG2VDEC_Params; +/** +******************************************************************************** +* @struct IMPEG2VDEC_DynamicParams +* +* @brief This structure defines the run time parameters for all +* Mpeg2vdec objects +* +* @param viddecDynamicParams : Defines the run time parameters for +* all IVIDDEC3 instance objects. +* +******************************************************************************** +*/ typedef struct IMPEG2VDEC_DynamicParams { - IVIDDEC3_DynamicParams viddecDynamicParams; - XDAS_Int32 gotoNextIFrame; - XDAS_Int32 skipBFrame; - XDAS_Int32 skipCurrFrame; - XDAS_Int32 seekFrameEnd; + /*Base class Parameters*/ + IVIDDEC3_DynamicParams viddecDynamicParams; + + /*--------------------------------------------------------------------------*/ + /* gotoNextIFrame : If enabled, during process call skips decoding of all */ + /* non I frames. Enable seekFrameEnd to get the bytes */ + /* consumed for each non I frame */ + /*--------------------------------------------------------------------------*/ + XDAS_Int32 gotoNextIFrame; + /*--------------------------------------------------------------------------*/ + /* skipBFrame : If enabled, skips decoding of all B frames. */ + /* Enable seekFrameEnd to get the bytes consumed for the */ + /* B-frames */ + /*--------------------------------------------------------------------------*/ + XDAS_Int32 skipBFrame; + /*--------------------------------------------------------------------------*/ + /* skipCurrFrame : If enabled, skips decoding of current frame */ + /* Enable seekFrameEnd to get the bytes consumed for the */ + /* Current frame */ + /*--------------------------------------------------------------------------*/ + XDAS_Int32 skipCurrFrame; + /*--------------------------------------------------------------------------*/ + /* seekFrameEnd : If enabled along with any SkipFrame option, prcoess call */ + /* returns the bytesconsumed for the frame w/o decoding the */ + /* frame */ + /*--------------------------------------------------------------------------*/ + XDAS_Int32 seekFrameEnd; + } IMPEG2VDEC_DynamicParams; +/** +******************************************************************************** +* @struct IMPEG2VDEC_InArgs +* +* @brief This structure defines the runtime input arguments for all VIDDEC +* objects. +* +* @param viddecInArgs : Defines the input arguments for all IVIDDEC3 +* instance process function. +* +******************************************************************************** +*/ typedef struct IMPEG2VDEC_InArgs { - IVIDDEC3_InArgs viddecInArgs; + + IVIDDEC3_InArgs viddecInArgs; + }IMPEG2VDEC_InArgs; +/** +******************************************************************************** +* @struct IMPEG2VDEC_OutArgs +* +* @brief This structure defines the run time output arguments for VIDDEC +* objects. +* +* @param viddecOutArgs : Defines the output arguments for all IVIDDEC3 +* instance process function. +* +******************************************************************************** +*/ typedef struct IMPEG2VDEC_OutArgs { - IVIDDEC3_OutArgs viddecOutArgs; + IVIDDEC3_OutArgs viddecOutArgs; }IMPEG2VDEC_OutArgs; -#endif /* __IMPEG2VDEC_H__ */ +/** +******************************************************************************** +* @struct IMPEG2VDEC_Fxns +* +* @brief This structure defines all of the operations on Mpeg2vdec objects. +* +* @param ividdec : handle to the all function of the operations on +* IVIDDEC3 objects +* +******************************************************************************** +*/ +typedef struct IMPEG2VDEC_Fxns { + IVIDDEC3_Fxns ividdec; +} IMPEG2VDEC_Fxns; + +/** + * Error concealment can be enabled or disabled through create time parameter. +*/ +typedef enum { + IMPEG2VDEC_EC_DISABLE = 0, + IMPEG2VDEC_EC_ENABLE +}eFrameErrorConcealment; + + +/** + * Flag to deblock enable + */ +#define IMPEG2VDEC_DEBLOCK_ENABLE (1) + +/** + * Flag to deblock disable + */ +#define IMPEG2VDEC_DEBLOCK_DISABLE (0) + +/** +* Number of MemTab required if Deblock is Off +*/ +#define IMPEG2VDEC_NUM_MEMTABS_DEBLOCK_OFF (0) + +/** +* Number of memtab required if deblock is on and it will be maximum +* resource required by codec +*/ +#define IMPEG2VDEC_NUM_MEMTABS_DEBLOCK_ON (6) + +/** + * The error codes correspond to the 32-bit extended error parameter passed + * through outargs and get sttus. The error have been categorised to the below + * 32 groups and the respective bit is set on error occurrence. + */ +typedef enum { + IMPEG2VDEC_ERR_UNSUPPORTED_VIDDEC3PARAMS = 0, + IMPEG2VDEC_ERR_UNSUPPORTED_VIDDEC3DYNAMICPARAMS, + IMPEG2VDEC_ERR_UNSUPPORTED_MPEG2DECDYNAMICPARAMS, + IMPEG2VDEC_ERR_IMPROPER_DATASYNC_SETTING, + + IMPEG2VDEC_ERR_NOSLICE, + IMPEG2VDEC_ERR_SLICEHDR, + IMPEG2VDEC_ERR_MBDATA, + IMPEG2VDEC_ERR_UNSUPPFEATURE, + + IMPEG2VDEC_ERR_STREAM_END = 16, + IMPEG2VDEC_ERR_UNSUPPRESOLUTION, + IMPEG2VDEC_ERR_STANDBY, + IMPEG2VDEC_ERR_INVALID_MBOX_MESSAGE, + + IMPEG2VDEC_ERR_HDVICP_RESET, + IMPEG2VDEC_ERR_HDVICP_WAIT_NOT_CLEAN_EXIT, + IMPEG2VDEC_ERR_SEQHDR, + IMPEG2VDEC_ERR_GOP_PICHDR, + + IMPEG2VDEC_ERR_SEQLVL_EXTN, + IMPEG2VDEC_ERR_PICLVL_EXTN, + IMPEG2VDEC_ERR_TRICK_MODE, + IMPEG2VDEC_ERR_PICSIZECHANGE, + + IMPEG2VDEC_ERR_SEMANTIC, + IMPEG2VDEC_ERR_DECODE_EXIT, + IMPEG2VDEC_ERR_IRES_RESHANDLE, + IMPEG2VDEC_ERR_IRES_RESDESC + +}IMPEG2VDEC_ExtendedErrorCodes; + +/** + * The enum corresponds to the 4 32-bit words used to pass the error codes to + * the application in the extended parameters of status stucture through the + * getstatus command. Each bit is set for an error which falls under one of + * the groups in the outargs 32 bvits. + */ +typedef enum { + MPEG2_ECD_ILLEGAL_EOM=0, + MPEG2_ECD_ILLEGAL_EOB, + MPEG2_ECD_ILLEGAL_MP1_ESCAPE_LVL, + MPEG2_ECD_ILLEGAL_MP2_ESCAPE_LVL, + + MPEG2_ECD_ILLEGAL_MARKER_CONCEAL, + MPEG2_ECD_ILLEGAL_MBTYPE_D_PIC, + MPEG2_ECD_ILLEGAL_DCT_COEFF, + MPEG2_ECD_ILLEGAL_CBP, + + MPEG2_ECD_ILLEGAL_MOTION_CODE, + MPEG2_ECD_ILLEGAL_MB_TYPE, + MPEG2_ECD_ILLEGAL_MB_ADDR_INCR, + MPEG2_ECD_ILLEGAL_EOS, + + MPEG2_ECD_ILLEGAL_QUANT_SCALE_CODE, + MPEG2_ECD_ILLEGAL_SLICE_START_POS, + MPEG2_ECD_ILLEGAL_START_CODE_SEARCH, + MPEG2_ECD_ILLEGAL_DC_COEFF_OVFL, + + MPEG2_DYNAMIC_PARAMS_HANDLE_ERROR, + MPEG2_STATUS_HANDLE_ERROR, + MPEG2_DYNAMIC_PARAMS_SIZE_ERROR, + MPEG2_STATUS_SIZE_ERROR, + + MPEG2_DECODE_HEADER_ERROR, + MPEG2_DISPLAY_WIDTH_ERROR, + MPEG2_FRAME_SKIP_MODE_ERROR, + MPEG2_NEW_FRAME_FLAG_ERROR, + + MPEG2_GOTO_IFRAME_ERROR, + MPEG2_SKIP_BFRAME_ERROR, + MPEG2_SKIP_CURRENTFRAME_ERROR, + MPEG2_SEEK_FRAMEEND_ERROR, + + MPEG2_NULL_STATUS_DATA_BUF, + MPEG2_INSUFFICIENT_STATUS_DATA_BUF, + MPEG2_NULL_INARGS_POINTER_ERROR, + MPEG2_INARGS_SIZE_ERROR, + + MPEG2_INVALID_INPUT_BYTES_ERROR, + MPEG2_INVALID_INPUT_ID_ERROR, + MPEG2_DECODER_NOT_INITIALIZED_ERROR, + MPEG2_NULL_INPUT_BUF_DESC_ERROR, + + MPEG2_NULL_INPUT_BUFFER_POINTER_ERROR, + MPEG2_INVALID_INPUT_BUFFER_SIZE_ERROR, + MPEG2_INVALID_NUM_OF_INPUT_BUFFERS_ERROR, + MPEG2_EXCESS_NUM_OF_INPUT_BUFFERS_ERROR, + + MPEG2_INVALID_INPUT_BUFFER_MEMTYPE_ERROR, + MPEG2_NULL_OUTARGS_POINTER_ERROR, + MPEG2_INVALID_OUTARGS_SIZE, + MPEG2_NULL_OUTPUT_BUF_DESC_POINTER_ERROR, + + MPEG2_NULL_OUTPUT_BUF_DESC_ERROR, + MPEG2_INVALID_OUTPUT_BUFFER0_POINTER_ERROR, + MPEG2_INVALID_OUTPUT_BUFFER0_SIZE_ERROR, + MPEG2_INVALID_NUM_OF_OUTPUT_BUFFERS_ERROR, + + MPEG2_INVALID_OUTPUT_BUFFER0_MEMTYPE_ERROR, + MPEG2_INVALID_OUTPUT_BUFFER0_ALIGNMENT_ERROR, + MPEG2_INVALID_OUTPUT_BUFFER1_POINTER_ERROR, + MPEG2_INVALID_OUTPUT_BUFFER1_SIZE_ERROR, + + MPEG2_INVALID_OUTPUT_BUFFER1_MEMTYPE_ERROR, + MPEG2_INVALID_OUTPUT_BUFFER1_ALIGNMENT_ERROR, + MPEG2_INVALID_OUTPUT_BUFFER2_POINTER_ERROR, + MPEG2_INVALID_OUTPUT_BUFFER2_SIZE_ERROR, + + MPEG2_INVALID_OUTPUT_BUFFER2_MEMTYPE_ERROR, + MPEG2_INVALID_BUFFER_USAGE_MODE, + MPEG2_SEQ_HDR_INVALID_FRAME_WIDTH, + MPEG2_SEQ_HDR_INVALID_FRAME_HEIGHT, + + MPEG2_SEQ_HDR_INVALID_ASPECT_RATIO, + MPEG2_SEQ_HDR_INVALID_FRAME_RATE_CODE, + MPEG2_INVALID_INTRA_QUANT_MAT, + MPEG2_INVALID_NON_INTRA_QUANT_MAT, + + MPEG2_SEQ_HDR_INVALID_INTRA_ESCAPE_BIT, + MPEG2_SEQ_HDR_INVALID_PROFILE, + MPEG2_SEQ_HDR_INVALID_LEVEL, + MPEG2_SEQ_HDR_INVALID_RESOLUTION_FORLVL, + + MPEG2_SEQ_HDR_INVALID_CHROMA_FORMAT, + MPEG2_SEQ_HDR_INVALID_LOW_DELAY, + MPEG2_SEQ_DSP_INVALID_VIDEO_FORMAT, + MPEG2_SEQ_DSP_INVALID_COLOUR_PRIM, + + MPEG2_SEQ_DSP_INVALID_TRF_CHARS, + MPEG2_SEQ_DSP_INVALID_MAT_COEFFS, + MPEG2_GOP_HDR_INVALID_DROP_FLAG, + MPEG2_GOP_HDR_INVALID_HOUR, + + MPEG2_GOP_HDR_INVALID_MIN, + MPEG2_GOP_HDR_INVALID_SEC, + MPEG2_GOP_HDR_INVALID_TIME_CODE_PICTURES, + MPEG2_GOP_HDR_INVALID_BROKEN_LINK, + + MPEG2_PIC_HDR_INVALID_TEMP_REF, + MPEG2_PIC_HDR_INVALID_PIC_TYPE, + MPEG2_PIC_HDR_INVALID_VBV_DELAY, + MPEG1_PIC_HDR_INVALID_FWD_FCODE, + + MPEG1_PIC_HDR_INVALID_BWD_FCODE, + MPEG2_PIC_HDR_INVALID_FCODE, + MPEG2_PIC_HDR_INVALID_PIC_STRUCTURE, + MPEG2_PIC_HDR_INVALID_FIELD_COMB, + + MPEG2_PIC_HDR_INVALID_TFF, + MPEG2_PIC_HDR_INVALID_FPFD, + MPEG2_PIC_HDR_INVALID_RFF, + MPEG2_PIC_HDR_INVALID_PROG_FLAG, + + MPEG2_QUANT_EXT_INVALID_LOAD_CHROMA_INTRA_FLAG, + MPEG2_QUANT_EXT_INVALID_LOAD_CHROMA_NON_INTRA_FLAG, + MPEG2_INVALID_EXTN_CODE, + MPEG2_SEQ_HDR_MISSING, + + MPEG2_NO_PICTURE_ENCODED_ERROR, + MPEG2_SEQ_EXT_MISSING, + MPEG2_PIC_CODING_EXT_MISSING, + MPEG2_SEQ_DISP_EXT_MISSING, + + MPEG2_GOP_FIRST_FRAME_NOT_I, + MPEG2_SCALABILITY_NOT_SUPPORTED, + MPEG2_END_OF_SEQ_DETECTED, + MPEG2_PIC_HDR_RFF_FRAME_RATE_MISMATCH, + + MPEG2_PIC_HDR_INVALID_DC_PRECISION, + MPEG2_INVALID_FRAME_RATE, + MPEG2_INVALID_BIT_RATE, + MPEG2_FRAME_SKIPPED, + + MPEG2_REF_FRAME_SKIPPED, + MPEG2_NO_REF_TO_FLUSH, + MPEG2_EXCESS_INPUT_BYTES, + MPEG2_ALL_MBS_NOT_DECODED, + + MPEG2_NO_REF_PFRAME, + MPEG2_NO_REF_BFRAME + +}Impeg2VDEC_ErrorStatus; + +/* + * ======== IMPEG2VDEC_PARAMS ======== + * Default parameter values for MPEG2VDEC instance objects + */ +extern const IMPEG2VDEC_Params MPEG2VDEC_TI_Static_Params; +/* + * ======== IMPEG2VDEC_IVDEC_DYNAMICPARAMS ======== + * Default dynamic parameter values for MPEG2VDEC instance objects + */ +extern const IMPEG2VDEC_DynamicParams MPEG2VDEC_TI_DynamicParams; +/* ------------------------ function prototypes ----------------------------- */ +/******************************************************************************* +* PRIVATE DECLARATIONS Defined here, used only here +*******************************************************************************/ +/* ------------------------ data declarations ------------------------------- */ +/* ----------------------- function prototypes ------------------------------ */ + +/* ------------------------------ macros ------------------------------------ */ +/*----------------------------------------------------------------------------*/ +/* Extending control method commands */ +/*----------------------------------------------------------------------------*/ +#define IMPEG2VDEC_GETSTATUS XDM_GETSTATUS +#define IMPEG2VDEC_SETPARAMS XDM_SETPARAMS +#define IMPEG2VDEC_RESET XDM_RESET +#define IMPEG2VDEC_FLUSH XDM_FLUSH +#define IMPEG2VDEC_SETDEFAULT XDM_SETDEFAULT +#define IMPEG2VDEC_GETBUFINFO XDM_GETBUFINFO +#define IMPEG2VDEC_GETVERSION XDM_GETVERSION +#define IMPEG2VDEC_GETCONTEXTINFO XDM_GETCONTEXTINFO +#define IMPEG2VDEC_GETDYNPARAMSDEFAULT XDM_GETDYNPARAMSDEFAULT + +#endif /* __IMPEG2VDEC__ */ + diff -Nru dce-1.6.5.4/packages/ivahd_codecs/ti/sdo/codecs/mpeg4dec/impeg4vdec.h dce-1.6.7.3/packages/ivahd_codecs/ti/sdo/codecs/mpeg4dec/impeg4vdec.h --- dce-1.6.5.4/packages/ivahd_codecs/ti/sdo/codecs/mpeg4dec/impeg4vdec.h 2012-09-24 15:13:39.000000000 +0000 +++ dce-1.6.7.3/packages/ivahd_codecs/ti/sdo/codecs/mpeg4dec/impeg4vdec.h 2012-11-28 09:54:14.000000000 +0000 @@ -1,71 +1,1010 @@ -/* - * Copyright (c) 2010, Texas Instruments Incorporated - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of Texas Instruments Incorporated nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#ifndef __IMPEG4VDEC_H__ -#define __IMPEG4VDEC_H__ - -#include -#include - -typedef struct IMPEG4VDEC_Status { - IVIDDEC3_Status viddec3Status; - XDAS_Int32 reserved[7]; -} IMPEG4VDEC_Status; - -typedef struct IMPEG4VDEC_Params { - IVIDDEC3_Params viddec3Params; - XDAS_Int32 outloopDeBlocking; - XDAS_Int32 ErrorConcealmentON; - XDAS_Int32 sorensonSparkStream; - XDAS_Int32 reserved[6]; -} IMPEG4VDEC_Params; - -typedef struct IMPEG4VDEC_DynamicParams { - IVIDDEC3_DynamicParams viddec3DynamicParams; - XDAS_Int32 reserved[3]; -} IMPEG4VDEC_DynamicParams; - -typedef struct IMPEG4VDEC_InArgs { - IVIDDEC3_InArgs viddec3InArgs; -} IMPEG4VDEC_InArgs; - -typedef struct IMPEG4VDEC_OutArgs { - IVIDDEC3_OutArgs viddec3OutArgs; - XDAS_Int32 vopTimeIncrementResolution; - XDAS_Int32 vopTimeIncrement; - XDAS_Int32 mp4ClosedGov; - XDAS_Int32 mp4BrokenLink; -} IMPEG4VDEC_OutArgs; - -#endif /*__IMPEG4VDEC_H__ */ - +/* +******************************************************************************** +* HDVICP2.0 Based MPEG4 ASP Decoder +* +* "HDVICP2.0 Based MPEG4 ASP Decoder" is software module developed on TI's +* HDVICP2 based SOCs. This module is capable of decode a 4:2:0 Raw +* video stream of Advanced/Simple profile and also H.263 bit-stream. +* Based on ISO/IEC 14496-2:2003." +* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ +* ALL RIGHTS RESERVED +******************************************************************************** +*/ + +/** +******************************************************************************** +* @file +* +* @brief This file provides definisions for the interface handles. +* +* @author: Ashish Singh (ashish.singh@ti.com) +* +* @version 0.0 (June 2009) : Base version created [Ashish] +* +* @version 0.1 (Apr 2010) : Review Comments Added [Ananya] +* +* @version 0.2 (oct 2010) : cleared doxygen warning and fixed VOP non coded +* related bugs. +* +* @version 0.3 (Nov 2010) : Modified the error bit 20. +* +* @version 0.4 (Dec 2010) : Removed the sorenson support and compile time +* parameter _DEBUGTRACE. [Nitesh] +* +* @version 0.5 (May 2011) : Added one more create time parameter paddingMode +* to support the padding of non multiple of +* 16 resolution clips, along with this removed some +* un-neccesary code from interface file [Ashish] + +* @version 0.6 (July 2011): rename the error code to have alignment of the error +* codes related mpeg4 [Ashish] +* +* @version 0.7 (Sep 2011): rename the error codes and also introduced more +* error code as IMPEG4D_ERR_FRAME_DROPPED etc. +* allocated some reserve space in all interface str +* for future uses. [Ashish] +* +* @version 0.8 (Oct 2011): renamed the enum macros to appropriate uses cases. +* removed unwanted enum from the inetrface file. +* added debug trace level enum to interface file +* [Ashish] +* +* @version 0.9 (Mar 2012) : Added create time params & enums to support Enhanced +* deblocking feature [Mahantesh] +* +* @version 1.0 [May 2012] : MB Info format structure added [Mahantesh] +* +******************************************************************************* +*/ + +/* -------------------- compilation control switches ---------------------- */ + +#ifndef _IMPEG4VDEC_H_ +#define _IMPEG4VDEC_H_ + +/**************************************************************************** +* INCLUDE FILES +*****************************************************************************/ +/* -------------------- system and platform files ------------------------- */ +/* ------------------------- program files -------------------------------- */ + +#include +#include +#include +#include + + +/**************************************************************************** +* EXTERNAL REFERENCES NOTE : only use if not found in header file +*****************************************************************************/ +/* ------------------------ data declarations ----------------------------- */ +/* ----------------------- function prototypes ---------------------------- */ + +/**************************************************************************** +* PUBLIC DECLARATIONS Defined here, used elsewhere +*****************************************************************************/ +/* ----------------------- data declarations ------------------------------ */ +/** +* Macro defined for Offset version length +*/ +#define IMPEG4DEC_VERSION_LENGTH 53 +/** +******************************************************************************* +* @struct IMPEG4VDEC_Obj +* +* @brief This structure must be the first field of all mp4VDEC instance +* objects +* +* @param fxns +* Handle to extented mpeg4 video decoder library interface functions +* +* @note None +******************************************************************************** +*/ +typedef struct IMPEG4VDEC_Obj +{ + struct IMPEG4VDEC_Fxns *fxns; +} IMPEG4VDEC_Obj; + +/** +******************************************************************************* +* @struct IMPEG4VDEC_Handle +* +* @brief This handle is used to reference all mp4VDEC instance objects +* +* @note None +******************************************************************************** +*/ +typedef struct IMPEG4VDEC_Obj *IMPEG4VDEC_Handle; + +/** +******************************************************************************* +* @struct IMPEG4VDEC_Status +* +* @brief Status structure defines the parameters that can be changed or +* read during real-time operation of the alogrithm. +* +* @param viddec3Status +* Handle to base class status struture which defines the all +* run time parameters. +* +* @param lastNFramesToLog +* element to set the number of frame traces required before the +* current frame decoded +* +* @param extMemoryDebugTraceAddr +* External memory address where codec dumps the debug trace logs +* +* @param extMemoryDebugTraceSize +* size of the debug trace logs dump by codec in external memory +* +* @param reserved[3] +* allocted reserve space for future uses +* +* @note None +******************************************************************************** +*/ +typedef struct IMPEG4VDEC_Status +{ + IVIDDEC3_Status viddec3Status; + + XDAS_UInt32 debugTraceLevel; + XDAS_UInt32 lastNFramesToLog; + XDAS_UInt32 *extMemoryDebugTraceAddr; + XDAS_UInt32 extMemoryDebugTraceSize; + XDAS_UInt32 reserved[3]; +} IMPEG4VDEC_Status; + +/** +******************************************************************************* +* @struct IMPEG4VDEC_Cmd +* +* @brief The Cmd enumeration defines the control commands for the MPEG4 +* video decoder control method. +* +* @note None +******************************************************************************** +*/ +typedef IVIDDEC3_Cmd IMPEG4VDEC_Cmd; + +/** +******************************************************************************* +* @struct IMPEG4VDEC_Params +* +* @brief This structure defines the creation parameters for all +* mp4VDEC objects +* +* @param viddecParams +* Defines the creation time parameters for +* all IVIDDEC3 instance objects. +* +* @param outloopDeBlocking +* Flag for Optional deBlock filter ON or Enhanced filtering ON +* +* @param errorConcealmentEnable +* flag to set error concealment feature-set on or off +* +* @param sorensonSparkStream +* Flag reserved for future usage for sorenson spark stream +* +* @param debugTraceLevel +* element to set the debug trace level, codec will give trace +* info base on tarce level +* +* @param lastNFramesToLog +* element to set the number of frame traces required before the +* current frame decoded +* +* @param paddingMode +* Flag to set the padding type used by codec for non multiple +* for 16 resolution clips +* +* @param enhancedDeBlockingQp +* QP value to be used for filtering all edges +* +* @param reserved[2] +* allocted reserve space for future uses +* +* @note None +******************************************************************************** +*/ +typedef struct IMPEG4VDEC_Params +{ + IVIDDEC3_Params viddec3Params; + XDAS_Int32 outloopDeBlocking; + XDAS_Int32 errorConcealmentEnable; + XDAS_Int32 sorensonSparkStream; + XDAS_UInt32 debugTraceLevel; + XDAS_UInt32 lastNFramesToLog; + XDAS_UInt32 paddingMode; + XDAS_UInt32 enhancedDeBlockingQp; + XDAS_UInt32 reserved[2]; +} IMPEG4VDEC_Params; + +extern IMPEG4VDEC_Params IMPEG4VDEC_PARAMS; + +/** +******************************************************************************* +* @struct IMPEG4VDEC_DynamicParams +* +* @brief This structure defines the run time parameters for all +* mp4VDEC objects +* +* @param viddecDynamicParams +* Defines the run time parameters for +* all IVIDDEC3 instance objects. +* +* @param reserved[3] +* allocted reserve space for future uses + +* @see None +******************************************************************************** +*/ +typedef struct IMPEG4VDEC_DynamicParams +{ + IVIDDEC3_DynamicParams viddec3DynamicParams; + XDAS_UInt32 reserved[3]; +} IMPEG4VDEC_DynamicParams; + +extern IMPEG4VDEC_DynamicParams IMPEG4VDEC_TI_DYNAMICPARAMS; +/** +******************************************************************************* +* @struct IMPEG4VDEC_InArgs +* +* @brief This structure defines the run time input arguments for all VIDDEC +* objects.This structure may be extended by individual codec +* implementation allowing customization with vendor specific +* parameters. +* +* @param viddec3InArgs +* Defines the input arguments for all IVIDDEC3 instance +* process function. +* +* @see None +******************************************************************************** +*/ +typedef struct IMPEG4VDEC_InArgs +{ + IVIDDEC3_InArgs viddec3InArgs; +}IMPEG4VDEC_InArgs; + +/** +******************************************************************************* +* @struct IMPEG4VDEC_OutArgs +* +* @brief This structure defines the run time output arguments for VIDDEC +* objects.This structure may be extended by individual codec +* implementation allowing customization with vendor specific +* parameters. +* +* @param viddec3OutArgs +* Defines the output arguments for all IVIDDEC3 instance +* process function. + +* @param vopTimeIncrementResolution +* VOP Time increamnet resolution info present in mpeg4 stream + +* @param vopTimeIncrement +* VOP Time increment info present in mpeg4 stream +* +* @param mp4ClosedGov +* Flag to get to know info about closed_gov +* +* @param mp4BrokenLink +* Flag to get to know info about mpeg4 broken link +* +* @note None +******************************************************************************** +*/ +typedef struct IMPEG4VDEC_OutArgs +{ + IVIDDEC3_OutArgs viddec3OutArgs; + XDAS_Int32 vopTimeIncrementResolution; + XDAS_Int32 vopTimeIncrement; + XDAS_Int32 mp4ClosedGov; + XDAS_Int32 mp4BrokenLink; +}IMPEG4VDEC_OutArgs; + +/** +******************************************************************************* +* @enum IMPEG4VDEC_ErrorBit +* +* @brief Mpeg4 Error Codes: Delaration of mpeg4 decoder specific Error +* Codes. +* @details Error status is communicated through a 32 bit word. In this, +* Error Bits 8 to 15 are used to indicate the XDM error bits. See +* XDM_ErrorBit definition in xdm.h. Other bits in a 32 bit word +* can be used to signal any codec specific errors. The staructure +* below enumerates the mpeg4 decoder specific error bits used. +* The algorithm can set multiple bits to 1 depending on the error +* condition +* +******************************************************************************** +*/ +typedef enum +{ + IMPEG4D_ERR_VOS = 0, + /**< +* Bit 0 +* 1 - No Video Object Sequence detected in the frame +* 0 - Ignore +*/ + + IMPEG4D_ERR_VO, + /**< +* Bit 1 +* 1 - Incorrect Video Object type +* 0 - Ignore +*/ + + IMPEG4D_ERR_VOL, + /**< +* Bit 2 +* 1 - Error in Video Object Layer detected +* 0 - Ignore +*/ + + IMPEG4D_ERR_GOV, + /**< +* Bit 3 +* 1 - Error in Group of Video parsing +* 0 - Ignore +*/ + + IMPEG4D_ERR_VOP, + /**< +* Bit 4 +* 1 - Error in Video Object Plane parsing +* 0 - Ignore +*/ + + IMPEG4D_ERR_SHORTHEADER, + /**< +* Bit 5 +* 1 - Error in short header parsing +* 0 - Ignore +*/ + + IMPEG4D_ERR_GOB, + /**< +* Bit 6 +* 1 - Error in GOB parsing +* 0 - Ignore +*/ + + IMPEG4D_ERR_VIDEOPACKET, + /**< +* Bit 7 +* 1 - Error in Video Packet parsing +* 0 - Ignore +*/ + + IMPEG4D_ERR_MBDATA = 16 , + /**< +* Bit 16 +* 1 - Error in MB data parsing +* 0 - Ignore +*/ + + IMPEG4D_ERR_INVALIDPARAM_IGNORE, + /**< +* Bit 17 +* 1 - Invalid Parameter +* 0 - Ignore +*/ + + IMPEG4D_ERR_UNSUPPFEATURE, + /**< +* Bit 18 +* 1 - Unsupported feature +* 0 - Ignore +*/ + + IMPEG4D_ERR_STREAM_END, + /**< +* Bit 19 +* 1 - End of stream reached +* 0 - Ignore +*/ + + IMPEG4D_ERR_VALID_HEADER_NOT_FOUND, + /**< +* Bit 20 +* 1 - Vaild header not found.i.e (VOL/VOP not found) +* 0 - Ignore +*/ + + IMPEG4D_ERR_UNSUPPRESOLUTION, + /**< +* Bit 21 +* 1 - Unsupported resolution by the decoder +* 0 - Ignore +*/ + + IMPEG4D_ERR_BITSBUF_UNDERFLOW, + /**< +* Bit 22 +* 1 - The stream buffer has underflowed +* 0 - Ignore +*/ + + IMPEG4D_ERR_INVALID_MBOX_MESSAGE, + /**< +* Bit 23 +* 1 - Invalid (unexpected) mail boX message recieved by IVAHD +* 0 - Ignore +*/ + IMPEG4D_ERR_NO_FRAME_FOR_FLUSH, + /**< +* Bit 24 +* 1 - Codec does not have any frame for flushing out to application +* 0 - Ignore +*/ + IMPEG4D_ERR_VOP_NOT_CODED, + /**< +* Bit 25 +* 1 - Given vop is not codec +* 0 - Ignore +*/ + IMPEG4D_ERR_START_CODE_NOT_PRESENT, + /**< +* Bit 26 +* 1 - Start code for given stream is not present in case of Parse Header +* Mode +* 0 - Ignore +*/ + IMPEG4D_ERR_VOP_TIME_INCREMENT_RES_ZERO, + /**< +* Bit 27 +* 1 - Unsupported time increment resolution by the decoder +* 0 - Ignore +*/ + IMPEG4D_ERR_PICSIZECHANGE, + /**< +* Bit 28 +* 1 - resolution gets change in between process call +* 0 - Ignore +*/ + IMPEG4D_ERR_UNSUPPORTED_H263_ANNEXS, + /**< +* Bit 29 +* 1 - Unsupported annexs of the H263 +* 0 - Ignore +*/ + IMPEG4D_ERR_HDVICP2_IMPROPER_STATE, + /**< +* Bit 30 +* 1 - HDVCIP is not in correct state +* 0 - Ignore +*/ + IMPEG4D_ERR_IFRAME_DROPPED + /**< +* Bit 31 +* 1 - Current frame is lost,no frame is present for decode +* 0 - Ignore +*/ + +} IMPEG4VDEC_ErrorBit; + +/** +****************************************************************************** +* @enum IMPEGVDEC_MetadataType +* @brief This enum indicates Meta Data types for MPEG4 ASP Decoder +* +* @remarks The way to get meta data from decoder is via outBufs of the +* decoder during process call. +****************************************************************************** +*/ + +typedef enum +{ + IMPEGVDEC_PARSED_MB_INFO_DATA = XDM_CUSTOMENUMBASE, + IMPEGVDEC_PARSED_MB_ERROR_INFO_DATA, + IMPEGVDEC_PARSED_ALFA_DATA +} IMPEGVDEC_MetadataType; + +/** +******************************************************************************* +* @enum _IMPEG4MemDescription +* @brief MemDescription of IVAHD MPEG4 ASP Decoder implementation by TI. +* +* @remarks this enum explain the type of memory required by mpeg4 ASP decoder +* +******************************************************************************* +*/ + +typedef enum _IMPEG4MemDescription +{ + IMPEG4VDEC_OBJECT, + /** +* this memory type is allocated by alg_alloc call & this is allocated +* for handle of decoder +*/ + IMPEG4VDEC_COLOC_PMBDATA, + + /** +* Number of MemTab required if no-Deblock and no-B colocated MB info +* required +*/ + IMPEG4VDEC_COLOC_BMBDATA , + /** +* this memory type is allocated by IRES & this is for storing the colocated +* MB data for B Frame +*/ + IMPEG4VDEC_DEBUG_TRACE_BUF, + /**< +* Memtab for debug trace parameter storage +*/ + IMPEG4VDEC_DEBLOCK_OFF_TOTAL_MEMTABS, + /** +* Number of MemTab required if Deblock is Off required +*/ + IMPEG4VDEC_LUMARECON_DATA_BUF0 = IMPEG4VDEC_DEBLOCK_OFF_TOTAL_MEMTABS, + /** +* this memory type is allocated by IRES & this is for storing the decoded +* Luma data for Recon Frame used in case of Deblock Enable +*/ + IMPEG4VDEC_LUMARECON_DATA_BUF1, + /** +* this memory type is allocated by IRES & this is for storing the decoded +* Luma data for Recon Frame used in case of Deblock Enable +*/ + IMPEG4VDEC_LUMARECON_DATA_BUF2, + /** +* this memory type is allocated by IRES & this is for storing the decoded +* Luma data for Recon Frame used in case of Deblock Enable +*/ + IMPEG4VDEC_CHROMARECON_DATA_BUF0, + /** +* this memory type is allocated by IRES & this is for storing the decoded +* Chroma data for Recon Frame used in case of Deblock Enable +*/ + IMPEG4VDEC_CHROMARECON_DATA_BUF1, + /** +* this memory type is allocated by IRES & this is for storing the decoded +* Chroma data for Recon Frame used in case of Deblock Enable +*/ + IMPEG4VDEC_CHROMARECON_DATA_BUF2, + /** +* this memory type is allocated by IRES & this is for storing the decoded +* Chroma data for Recon Frame used in case of Deblock Enable +*/ + + IMPEG4VDEC_DEBLOCK_ON_TOTAL_MEMTABS, + /** +* Number of memtab required if deblock is on and it will be maximum +* resource required by codec +*/ + IMPEG4VDEC_MAX_MEMTABS = IMPEG4VDEC_DEBLOCK_ON_TOTAL_MEMTABS + /** +* Maximum number of memtab required +*/ +}IMEPG4VDEC_MemDescription; + +/* +* Number of 1D resource required by codec from IRES +*/ +#define IMEPG4VDEC_TOTAL_1D_OBJECTS 0x4 +/* +* Number of 2D resource required by codec from IRES when filtering is off +*/ +#define IMEPG4VDEC_MIN_2D_OBJECTS 0x0 +/* +* Number of 2D resource required by codec from IRES when filtering is on +*/ +#define IMEPG4VDEC_MAX_2D_OBJECTS 0x6 + +/** +******************************************************************************* +* @struct IMPEG4VDEC_Fxns +* +* @brief This structure defines all of the operations on mp4VDEC objects. +* +* @param ividdec3 +* handle to the all function of the operations on IVIDDEC3 objects +* +* @see None +******************************************************************************** +*/ +typedef struct IMPEG4VDEC_Fxns +{ + IVIDDEC3_Fxns ividdec3; +} IMPEG4VDEC_Fxns; + +/** + ****************************************************************************** + * @enum IMPEG4VDEC_FrameFlushState + * @brief This enum indicates whether to frame needs to flush or not + * + ****************************************************************************** +*/ +typedef enum +{ + IMPEG4VDEC_FLUSH_DISABLE = 0, + /** + * Flag to set the frame flush is disable + */ + IMPEG4VDEC_FLUSH_ENABLE + /** + * Flag to set the frame flush is Enable + */ +}IMPEG4VDEC_FrameFlushState; + +/** + ****************************************************************************** + * @enum IMPEG4VDEC_ColocatedBFrameMBinfoStoreMode + * @brief This enum indicates whether to Application needs co-located + * MB data or not + * + ****************************************************************************** +*/ +typedef enum +{ + IMPEG4VDEC_STORE_COLOCATED_BMBINFO_DISABLE = 0, + /** + * Flag to set the co-located MB info disable + */ + IMPEG4VDEC_STORE_COLOCATED_BMBINFO_ENABLE + /** + * Flag to set the co-located MB info enable + */ +}IMPEG4VDEC_ColocatedBFrameMBinfoStoreMode; + +/** + ****************************************************************************** + * @enum IMPEG4VDEC_OptionalDeBlkMode + * @brief This enum indicates whether deblock need to be done or not + * + ****************************************************************************** +*/ +typedef enum +{ + IMPEG4VDEC_DEBLOCK_DISABLE = 0, + /** + * Flag to set the de-block disable + */ + IMPEG4VDEC_DEBLOCK_ENABLE, + /** + * Flag to set the de-block enable + */ + IMPEG4VDEC_ENHANCED_DEBLOCK_ENABLE + /** + * Flag to set the de-block enable for 8x8 edges of all Macroblocks + * including its top & left edges. + */ +}IMPEG4VDEC_OptionalDeBlkMode; + +/** + ****************************************************************************** + * @enum IMPEG4VDEC_EnhancedDeblockQp + * @brief This enum the MIN & MAX values that QP can take while filering + * for all edges is enabled + * + ****************************************************************************** +*/ +typedef enum +{ + IMPEG4VDEC_DEBLOCK_QP_MIN = 1, + /** + * Indicates min QP value when fitering all edges is enabled + */ + IMPEG4VDEC_DEBLOCK_QP_MAX = 31 + /** + * Indicates max QP value when fitering all edges is enabled + */ +}IMPEG4VDEC_EnhancedDeblockQp; +/** + ****************************************************************************** + * @enum IMPEG4VDEC_ErrorConcealmentMode + * @brief This enum indicates whether to apply error concealment or not + * + ****************************************************************************** +*/ +typedef enum +{ + IMPEG4VDEC_EC_DISABLE = 0, + /** + * Flag to set error concealement disable + */ + IMPEG4VDEC_EC_ENABLE + /** + * Flag to error concealment enable + */ +}IMPEG4VDEC_ErrorConcealmentMode; + +/** + ****************************************************************************** + * @enum IMPEG4VDEC_PaddingModeForNonMultipleOf16Res + * @brief These enumerations captures different methods of padding the Ref + * frame when dimension is non multiple of 16. + * + ****************************************************************************** +*/ +typedef enum +{ + /** + * Method as suggested by DivX spec. + */ + IMPEG4VDEC_DIVX_MODE_PADDING = 0, + /** + * Method as suggested by MPEG4 spec. + */ + IMPEG4VDEC_MPEG4_MODE_PADDING = 1 , + /** + * Default mode is DIVX suggested way. + */ + IMPEG4VDEC_DEFAULT_MODE_PADDING = IMPEG4VDEC_DIVX_MODE_PADDING +} IMPEG4VDEC_PaddingModeForNonMultipleOf16Res; + +/** + ****************************************************************************** + * @enum IMPEG4VDEC_debugTraceLevel + * @brief These enumerations captures different debug trace level supported by + * codec. + * + ****************************************************************************** +*/ +typedef enum +{ + IMPEG4VDEC_DEBUGTRACE_LEVEL0 = 0, + /** 0: Debug Trace Level 0 + */ + IMPEG4VDEC_DEBUGTRACE_LEVEL1, + /** 1: Debug Trace Level 1 + */ + IMPEG4VDEC_DEBUGTRACE_LEVEL2, + /** 2: Debug Trace Level 2 + */ + IMPEG4VDEC_DEBUGTRACE_MAXLEVEL = IMPEG4VDEC_DEBUGTRACE_LEVEL2 + /** 2: Max level of debug trace + */ +}IMPEG4VDEC_DebugTraceLevel; + +/** + ****************************************************************************** + * @enum IMPEG4VDEC_FrameToLog + * @brief These enumerations captures the max number of frame for which codec + * will dump debug trace. + * + ****************************************************************************** +*/ +typedef enum +{ + IMPEG4VDEC_MINNUM_OF_FRAME_LOGS = 0, + /** 0: minimum number of frames for which debug trace would be + * dump. + */ + IMPEG4VDEC_MAXNUM_OF_FRAME_LOGS = 10 + /** 10:max number of frames for which debug trace would be + * dump. + */ +}IMPEG4VDEC_FrameToLog; + +/** + ****************************************************************************** + * @struct IMPEG4VDEC_TI_CommonInfo + * + * @brief This structure defines the common fields in MB info + * + ****************************************************************************** +*/ +typedef struct _IMPEG4VDEC_TI_CommonInfo +{ + XDAS_UInt32 codec_type:8; + XDAS_UInt32 fmt_type:8; + XDAS_UInt32 mb_ll_avail:1; + XDAS_UInt32 mb_ul_avail:1; + XDAS_UInt32 mb_uu_avail:1; + XDAS_UInt32 mb_ur_avail:1; + XDAS_UInt32 pic_bound_l:1; + XDAS_UInt32 pic_bound_u:1; + XDAS_UInt32 pic_bound_r:1; + XDAS_UInt32 pic_bound_b:1; + XDAS_UInt32 first_mb_flag:1; + XDAS_UInt32 error_flag:1; + XDAS_UInt32 zero:6; + XDAS_UInt32 zeroes:16; + XDAS_UInt32 mb_addr:16; + +} IMPEG4VDEC_TI_CommonInfo; + +/** + ****************************************************************************** + * @struct IMPEG4VDEC_TI_CodecSpecificWordSix + * + * @brief This structure defines codec specific fields in MB info + * + ****************************************************************************** +*/ +typedef struct _IMPEG4VDEC_TI_CodecSpecificWordSix +{ + XDAS_UInt32 pred_mode:3; + XDAS_UInt32 zero7:9; + XDAS_UInt32 pred_type:2; + XDAS_UInt32 gob_frame_id:2; + XDAS_UInt32 gob_number:5; + XDAS_UInt32 gob_header_empty:1; + XDAS_UInt32 forward_top_field_reference:1; + XDAS_UInt32 forward_bottom_field_reference:1; + XDAS_UInt32 backward_top_field_reference:1; + XDAS_UInt32 backward_bottom_field_reference:1; + XDAS_UInt32 header_extension_code:1; + XDAS_UInt32 zero6:5; + XDAS_UInt32 pattern_code:6; + XDAS_UInt32 zero5:2; + XDAS_UInt32 intra_dc_vlc_thr:3; + XDAS_UInt32 zero4:5; + XDAS_UInt32 not_coded:1; + XDAS_UInt32 dct_type:1; + XDAS_UInt32 ac_pred_flag:1; + XDAS_UInt32 cond_skip_flag:1; + XDAS_UInt32 use_intra_dc_vlc:1; + XDAS_UInt32 end_of_texture:1; + XDAS_UInt32 zero3:2; + XDAS_UInt32 vop_fcode_forward:3; + XDAS_UInt32 zero2:1; + XDAS_UInt32 vop_fcode_backward:3; + XDAS_UInt32 zero1:1; + +} IMPEG4VDEC_TI_CodecSpecificWordSix; + +/** + ****************************************************************************** + * @struct IMPEG4VDEC_TI_CodecSpecificWordSix + * + * @brief This structure defines codec specific fields in MB info + * + ****************************************************************************** +*/ +typedef struct _IMPEG4VDEC_TI_CodecSpecificWordSeven +{ + XDAS_UInt32 dc_scaler_luma:6; + XDAS_UInt32 zero4:10; + XDAS_UInt32 dc_scaler_chroma:5; + XDAS_UInt32 zero3:11; + XDAS_UInt32 quant_c:5; + XDAS_UInt32 zero2:19; + XDAS_UInt32 quantiser_scale:5; + XDAS_UInt32 zero1:3; + +} IMPEG4VDEC_TI_CodecSpecificWordSeven; + +/** + ****************************************************************************** + * @struct IMPEG4VDEC_TI_MotionVector + * + * @brief This structure defines format of Motion Vectors as present in MBinfo + * + ****************************************************************************** +*/ +typedef struct _IMPEG4VDEC_TI_MotionVector +{ + XDAS_Int16 x; + XDAS_Int16 y; +} IMPEG4VDEC_TI_MotionVector; + +/** + ****************************************************************************** + * @struct IMPEG4VDEC_TI_MvBidirectional4 + * + * @brief This structure defines Motion Vectors at 8x8 level in both + * directions + * + ****************************************************************************** +*/ +typedef struct _IMPEG4VDEC_TI_MvBidirectional4 +{ + IMPEG4VDEC_TI_MotionVector mv_forward[4]; + IMPEG4VDEC_TI_MotionVector mv_backward[4]; + +} IMPEG4VDEC_TI_MvBidirectional4; + +/** + ****************************************************************************** + * @struct IMPEG4VDEC_TI_MbInfo + * + * @brief This structure details the data format for MB information shared to + * application. This helps application to understand all fields + * the way codec uses MB info internally. This structure is of size + * 112 Bytes. + * + * @param info : This elements gives details about the MB placement in the + * frame. + * + * @param IQedDCY2: This field holds the Inverse Quantized DC for Y2 MB + * + * @param IQedDCY3: This field holds the Inverse Quantized DC for Y3 MB + * + * @param IQedDCY2: This field holds the Inverse Quantized DC for Cb MB + * + * @param IQedDCY3: This field holds the Inverse Quantized DC for Cr MB + * + * @param IQedDCY1: This field holds the Inverse Quantized DC for Y1 MB + * + * @param zeroes1[3]: This field is set to 0 + * + * @param DP_DC_Y0: If data partition = 1, this field contains DC coefficient + * values for Y0 MB + * + * @param DP_DC_Y1: If data partition = 1, this field contains DC coefficient + * values for Y1 MB + * + * @param DP_DC_Y2: If data partition = 1, this field contains DC coefficient + * values for Y2 MB + * + * @param DP_DC_Y3: If data partition = 1, this field contains DC coefficient + * values for Y3 MB + * + * @param DP_DC_Cb: If data partition = 1, this field contains DC coefficient + * values for Cb MB + * + * @param DP_DC_Cr: If data partition = 1, this field contains DC coefficient + * values for Cr MB + * + * @param Reserved: Reserved field + * + * @param zeroes2[2]: This field is set to 0 + * + * @param codecSpecificinfoWordSix: Codec specific fields + * + * @param codecSpecificinfoWordSeven: Codec specific fields + * + * @param zeroes3[4]: This field is set to 0 + * + * @param mv_forward_backward: Lists all Motion vectors at 4x4 level in L0 & + * L1 direction. First 4 MVs in L0 next 4 MVs in + * L1 direction. + * + * @param bidirectional4: Lists all Motion vectors at 8x8 level in both + * directions + ****************************************************************************** +*/ +typedef struct _IMPEG4VDEC_TI_MbInfo +{ + IMPEG4VDEC_TI_CommonInfo info; + + XDAS_Int16 IQedDCY2; + XDAS_Int16 IQedDCY3; + XDAS_Int16 IQedDCCb; + XDAS_Int16 IQedDCCr; + + XDAS_Int16 IQedDCY1; + XDAS_Int16 zeroes1[3]; + + XDAS_Int16 DP_DC_Y0; + XDAS_Int16 DP_DC_Y1; + XDAS_Int16 DP_DC_Y2; + XDAS_Int16 DP_DC_Y3; + + XDAS_Int16 DP_DC_Cb; + XDAS_Int16 DP_DC_Cr; + XDAS_Int32 Reserved; + + XDAS_Int32 zeroes2[2]; + + IMPEG4VDEC_TI_CodecSpecificWordSix codecSpecificinfoWordSix; + + IMPEG4VDEC_TI_CodecSpecificWordSeven codecSpecificinfoWordSeven; + + XDAS_Int32 zeroes3[4]; + + union { + IMPEG4VDEC_TI_MotionVector mv_forward_backward[8]; + IMPEG4VDEC_TI_MvBidirectional4 bidirectional4; + } IMPEG4VDEC_TI_motion_vecs; + + +} IMPEG4VDEC_TI_MbInfo; + +#endif /*_IMPEG4VDEC_H_*/ + + + + + + + + + + + diff -Nru dce-1.6.5.4/packages/ivahd_codecs/ti/sdo/codecs/mpeg4enc/impeg4enc.h dce-1.6.7.3/packages/ivahd_codecs/ti/sdo/codecs/mpeg4enc/impeg4enc.h --- dce-1.6.5.4/packages/ivahd_codecs/ti/sdo/codecs/mpeg4enc/impeg4enc.h 1970-01-01 00:00:00.000000000 +0000 +++ dce-1.6.7.3/packages/ivahd_codecs/ti/sdo/codecs/mpeg4enc/impeg4enc.h 2012-11-28 09:54:14.000000000 +0000 @@ -0,0 +1,1254 @@ +/* ====================================================================== + * Copyright (C) 2010 Texas Instruments Incorporated + * + * All rights reserved. Property of Texas Instruments Incorporated. + * Restricted rights to use, duplicate or disclose this code are + * granted through contract. + * + * The program may not be used without the written permission + * of Texas Instruments Incorporated or against the terms and conditions + * stipulated in the agreement under which this program has been + * supplied. + * ====================================================================*/ +/* +******************************************************************************** + * HDVICP2.0 Based MPEG4 SP Encoder + * + * "HDVICP2.0 Based MPEG4 SP Encoder" is software module developed on TI's + * HDVICP2 based SOCs. This module is capable of compressing a 4:2:0 Raw + * video into a simple profile bit-stream. Based on ISO/IEC 14496-2." + * + * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/ + * ALL RIGHTS RESERVED +******************************************************************************** +*/ +/** +******************************************************************************** + * @file + * + * @brief Interface header file for MPEG4 SP Encoder + * + * @author: Venugopala Krishna + * + * @version 0.0 (Feb 2009) : Initial version. + * [Venugopala Krishna] + * @version 0.1 (Apr 2009) : Updated version. + * [Radhesh Bhat] + * + ******************************************************************************* +*/ + +/* -------------------- compilation control switches -------------------------*/ +#ifndef IMPEG4ENC_ +#define IMPEG4ENC_ + +/** + * @defgroup HDVICP2MPEG4 IMPEG4ENC_TI (V7M) + * @ingroup m3 + * + * The IMPEG4ENC_TI interface enables encoding in MPEG-4 format + * + */ + +/** @ingroup HDVICP2MPEG4 */ +/*@{*/ + +/*-------------------------------------------*/ +/* typecasting of control method commands */ +/*-------------------------------------------*/ +#define IMPEG4ENC_GETSTATUS XDM_GETSTATUS +#define IMPEG4ENC_SETPARAMS XDM_SETPARAMS +#define IMPEG4ENC_RESET XDM_RESET +#define IMPEG4ENC_FLUSH XDM_FLUSH +#define IMPEG4ENC_SETDEFAULT XDM_SETDEFAULT +#define IMPEG4ENC_GETBUFINFO XDM_GETBUFINFO + +/** +* MPEG4 Simple profile IDC +*/ +#define MPEG4_SIMPLE_PROFILE_IDC 3 + +/******************************************************************************* +* INCLUDE FILES +*******************************************************************************/ +/* -------------------- system and platform files ----------------------------*/ + +/*--------------------- program files ----------------------------------------*/ +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/******************************************************************************* +* PUBLIC DECLARATIONS Defined here, used elsewhere +*******************************************************************************/ +/*---------------------- data declarations -----------------------------------*/ + +/******************************************************************************* +* PRIVATE DECLARATIONS Defined here, used only here +*******************************************************************************/ +/*---------------------- data declarations -----------------------------------*/ +/*---------------------- function prototypes ---------------------------------*/ + + +/** + ******************************************************************************* + * @enum IMPEG4ENC_ErrorBit + * @brief error informations of IVAHD MPEG4 encoder implementation by TI. + * + * @remarks When an internal error occurs, the algorithm will return + * an error return value (e.g. EFAIL, EUNSUPPORTED) + * + * @remarks The value of each enum is the bit which is set. + * + * @remarks Bits 8-15 are defined by XDM and hence not used by codec + * implementation. rest all bits are used. + * XDM defined error bits are also active. + * + * @remarks The algorithm can set multiple bits to 1 based on conditions. + * e.g. it will set bits #XDM_FATALERROR (fatal) and + * #XDM_UNSUPPORTEDPARAM (unsupported params) in case + * of unsupported run time parameters. + * + ******************************************************************************* +*/ +typedef enum { + IMPEG4ENC_LEVEL_INCOMPLAINT_PARAMETER = 0, + /**< Bit 0 - level incomplaint parameters. + * @remarks This error is applicable when some parameters are set + * which are not meeting the limits set by MPEG4 standard + */ + + IMPEG4ENC_PROFILE_INCOMPLAINT_CONTENTTYPE = 1, + /**< Bit 1 - Profile incomplaint content type. + * @remarks This error is applicable when + * IVIDENC2_Params::inputContentType is not set as + * IVIDEO_PROGRESSIVE but IVIDENC2_Params::profile is set + * as IMPEG4_SIPPLE_PROFILE + */ + + IMPEG4ENC_IMPROPER_HDVICP2_STATE = 16, + /**< Bit 16 - Device is not proper state to use. + */ + + IMPEG4ENC_WARNING_H263_PLUS_CUSTOM_SOURCE_FORMAT = 17, + /**< Bit 17 - Indication that the input resolution given to codec + * is custom source format supported in H.263+ not the + * standard resolutions supported with H263 baseline or + * MPEG4 with short video header. + */ + + IMPEG4ENC_ERROR_BITSTREAM_MEMORY_INSUFFICIENT = 18, + /**< Bit 18 - Indication that the buffer given to codec from + * getBuffer function is insufficient so that codec + * cannot continue encoding. It means that if return value + * from getBuffer function is -1, then this bit gets set + * by the codec. This is the situation where application + * might not be able to provide memory to codec. + */ + + IMPEG4ENC_IMPROPER_DATASYNC_SETTING = 19, + /**< Bit 19 - data synch settings are not proper + * @remarks This error is set when encoder is asked to operate + * at sub frame level but the call back function pointer + * is NULL + */ + + IMPEG4ENC_UNSUPPORTED_VIDENC2PARAMS = 20, + /**< Bit 20 - Invalid videnc2 parameters + * @remarks This error is set when any parameter of struct + * IVIDENC2_Params is not in allowed range + */ + + IMPEG4ENC_UNSUPPORTED_RATECONTROLPARAMS = 21, + /**< Bit 21 - Invalid rate control parameters + * @remarks This error is set when any parameter of struct + * IMPEG4ENC_RateControlParams is not in allowed range + */ + + IMPEG4ENC_UNSUPPORTED_INTERCODINGPARAMS = 22, + /**< Bit 22 - Invalid inter coding parameters + * @remarks This error is set when any parameter of struct + * IMPEG4ENC_InterCodingParams is not in allowed range + */ + + IMPEG4ENC_UNSUPPORTED_INTRACODINGPARAMS = 23, + /**< Bit 23 - Invalid Intra coding parameters + * @remarks This error is set when any parameter of struct + * IMPEG4ENC_IntraCodingParams is not in allowed range + */ + + IMPEG4ENC_UNSUPPORTED_SLICECODINGPARAMS = 25, + /**< Bit 25 - Invalid slice coding parameters + * @remarks This error is set when any parameter of struct + * IMPEG4ENC_SliceControlParams is not in allowed range + */ + + IMPEG4ENC_UNSUPPORTED_MPEG4ENCPARAMS = 29, + /**< Bit 29 - Invalid Create time extended parameters + * @remarks This error is set when any parameter of struct + * IMPEG4ENC_CreateParams is not in allowed range + */ + + IMPEG4ENC_UNSUPPORTED_VIDENC2DYNAMICPARAMS = 30, + /**< Bit 30 - Invalid base class dyanmic parameters during control + * @remarks This error is set when any parameter of struct + * IVIDENC2_DynamicParams is not in allowed range + */ + + IMPEG4ENC_UNSUPPORTED_MPEG4ENCDYNAMICPARAMS = 31 + /**< Bit 31 -Invalid extended class dyanmic parameters during control + * @remarks This error is set when any parameter of struct + * IMPEG4ENC_DynamicParams (excluding embedded structures) + * is not in allowed range + */ + +} IMPEG4ENC_ErrorBit; + + +/** + ******************************************************************************* + * @enum IMPEG4ENC_Level + * @brief Enum for MPEG-4 Simple profile levels + * + * @remarks allowed levels are 0, 0b, 1, 2, 3, 4a & 5 + * + ******************************************************************************* +*/ +typedef enum { + IMPEG4ENC_SP_LEVEL_0 = 0, /**< MPEG4 Simple Profile Level 0 */ + + IMPEG4ENC_SP_LEVEL_0B = 9, /**< MPEG4 Simple Profile Level 0b*/ + + IMPEG4ENC_SP_LEVEL_1 = 1, /**< MPEG4 Simple Profile Level 1 */ + + IMPEG4ENC_SP_LEVEL_2 = 2, /**< MPEG4 Simple Profile Level 2 */ + + IMPEG4ENC_SP_LEVEL_3 = 3, /**< MPEG4 Simple Profile Level 3 */ + + IMPEG4ENC_SP_LEVEL_4A = 4, /**< MPEG4 Simple Profile Level 4a*/ + + IMPEG4ENC_SP_LEVEL_5 = 5, /**< MPEG4 Simple Profile Level 5 */ + + IMPEG4ENC_SP_LEVEL_6 = 6 /**< MPEG4 Simple Profile Level 6 */ + +} IMPEG4ENC_Level; + + +/** + ******************************************************************************* + * @enum IMPEG4ENC_H263Level + * @brief Enum for H.263 base profile levels + * + * @remarks allowed levels are 10,20,30,40, 45, 50, 60 and 70 + * + ******************************************************************************* +*/ +typedef enum { + IMPEG4ENC_H263_LEVEL_10 = 10, /**< H263 Baseline Profile Level 10 */ + + IMPEG4ENC_H263_LEVEL_20 = 20, /**< H263 Baseline Profile Level 20 */ + + IMPEG4ENC_H263_LEVEL_30 = 30, /**< H263 Baseline Profile Level 30 */ + + IMPEG4ENC_H263_LEVEL_40 = 40, /**< H263 Baseline Profile Level 40 */ + + IMPEG4ENC_H263_LEVEL_45 = 45, /**< H263 Baseline Profile Level 45 */ + + IMPEG4ENC_H263_LEVEL_50 = 50, /**< H263 Baseline Profile Level 50 */ + + IMPEG4ENC_H263_LEVEL_60 = 60, /**< H263 Baseline Profile Level 60 */ + + IMPEG4ENC_H263_LEVEL_70 = 70 /**< H263 Baseline Profile Level 70 */ +} IMPEG4ENC_H263Level; + +/** + ******************************************************************************* + * @enum IMPEG4ENC_PixelRange + * @brief pixel/video range enum + * + * @remarks + * + ******************************************************************************* +*/ + +typedef enum { + /** + * Y varies from 16 to 235 and Cb/Cr varies from 16 to 240 + */ + IMPEG4ENC_PR_16_235 = 0, + + /** + * Y/Cb/Cr varies from 0 to 255 + */ + IMPEG4ENC_PR_0_255 = 1, + + IMPEG4ENC_PR_DEFAULT = IMPEG4ENC_PR_0_255 + +} IMPEG4ENC_PixelRange; + + +/** + ******************************************************************************* + * @enum IMPEG4ENC_SceneChangeAlgo + * @brief Enum for enabling or disabling scene change detection algo + * + * @remarks + * + ******************************************************************************* +*/ + +typedef enum { + /** + * Disables the scene change detection algorithm + */ + IMPEG4ENC_SCDA_DISABLE = 0, + + /** + * Enables the scene change detection algorithm + */ + IMPEG4ENC_SCDA_ENABLE = 1, + + IMPEG4ENC_SCDA_DEFAULT = IMPEG4ENC_SCDA_ENABLE + +} IMPEG4ENC_SceneChangeAlgo; + + +/** + ******************************************************************************* + * @enum IMPEG4ENC_RateControlParamsPreset + * @brief These enumerations control the RateControl Params + * + * @remarks + * + ******************************************************************************* +*/ +typedef enum { + IMPEG4_RATECONTROLPARAMS_DEFAULT = 0, /**< Default RC params */ + + IMPEG4_RATECONTROLPARAMS_USERDEFINED = 1, /**< User defined RC params*/ + + /** + * Keep the Rate Control params as existing. + * This is useful because during control call if user don't want to chnage + * the Rate Control Params + */ + IMPEG4_RATECONTROLPARAMS_EXISTING = 2, + + + IMPEG4_RATECONTROLPARAMS_MAX + +} IMPEG4ENC_RateControlParamsPreset; + + +/** + ******************************************************************************* + * @enum IMPEG4ENC_RateControlAlgoPreset + * @brief These enumerations control the RateControl Algorithm + * + * @remarks + * + ******************************************************************************* +*/ +typedef enum { + /** + * Fixed QP + */ + IMPEG4_RATECONTROLALGO_NONE = 0, + + /** + * VBR Rate Control Algorithm + */ + IMPEG4_RATECONTROLALGO_VBR = 1, + + /** + * CBR Rate Control Algorithm -- Low Delay + */ + IMPEG4_RATECONTROLALGO_CBR = 2, + + IMPEG4_RATECONTROLALGO_MAX + +} IMPEG4ENC_RateControlAlgoPreset; + + +/** + ******************************************************************************* + * @enum IMPEG4ENC_InterCodingPreset + * @brief These enumerations control the type of inter coding + * + * @remarks + * + ******************************************************************************* +*/ +typedef enum { + + /** + * Default Inter coding params + */ + + IMPEG4_INTERCODING_DEFAULT = 0, + + /** + * User defined inter coding params + */ + IMPEG4_INTERCODING_USERDEFINED = 1, + + + /** + * Keep the inter coding params as existing + */ + IMPEG4_INTERCODING_EXISTING = 2, + + IMPEG4_INTERCODING_MAX + +} IMPEG4ENC_InterCodingPreset; + + +/** + ******************************************************************************* + * @enum IMPEG4ENC_InterBlockSize + * @brief These enumerations control the block size of each MB in encoding + * + * @remarks + * + ******************************************************************************* +*/ +typedef enum { + /** + * 16x16 Block size + */ + IMPEG4_BLOCKSIZE_16x16 = 0, + + /** + * 8x8 Block size + */ + IMPEG4_BLOCKSIZE_8x8 = 1, + + /** + * Default block size + */ + IMPEG4_BLOCKSIZE_DEFAULT = IMPEG4_BLOCKSIZE_8x8, + + IMPEG4_BLOCKSIZE_MAX = 2 + +} IMPEG4ENC_InterBlockSize; + + +/** + ******************************************************************************* + * @enum IMPEG4ENC_IntraRefreshMethods + * @brief Refresh method Type Identifier for MPEG4 Encoder + * + * @remarks + * + ******************************************************************************* +*/ +typedef enum { + + /** + * Doesn't insert forcefully any intra macro blocks + */ + IMPEG4_INTRAREFRESH_NONE = 0, + /** + * Inserts intra macro blocks in a cyclic fashion + * cyclic interval is equal to intraRefreshRate + */ + IMPEG4_INTRAREFRESH_CYCLIC_MBS, + + /** + * Inserts Intra Rows in a cyclic fashion + * Number of Rows equal to intraRefreshRate + */ + IMPEG4_INTRAREFRESH_CYCLIC_ROWS, + + /** + * Mandatory Intra Refresh -- evenly distributes number of INTRA MBs over + * frames. + */ + IMPEG4_INTRAREFRESH_MANDATORY, + + /** + * position of intra macro blocks is intelligently chosen by encoder, but the + * number of forcely coded intra macro blocks in a frame is gaurnteed to be + * equal to totalMbsInFrame/intraRefreshRate. + * This method is not implemented currently. + */ + IMPEG4_INTRAREFRESH_RDOPT_MBS + +} IMPEG4ENC_IntraRefreshMethods; + + +/** + ******************************************************************************* + * @enum IMPEG4ENC_IntraCodingPreset + * @brief These enumerations control the type of intra coding + * + * @remarks + * + ******************************************************************************* +*/ +typedef enum { + /** + * Default intra coding params + */ + IMPEG4_INTRACODING_DEFAULT = 0, + + /** + * User defined intra coding params + */ + IMPEG4_INTRACODING_USERDEFINED = 1, + IMPEG4_INTRACODING_MAX + +} IMPEG4ENC_IntraCodingPreset; + + +/** + ******************************************************************************* + * @enum IMPEG4ENC_SliceCodingPreset + * @brief These enumerations control the type of slice coding + * + * @remarks + * + ******************************************************************************* +*/ +typedef enum { + /** + * Default slice coding params + */ + IMPEG4_SLICECODING_DEFAULT = 0, + + /** + * User defined slicecoding params + */ + IMPEG4_SLICECODING_USERDEFINED = 1, + + /** + * Keep the slice coding params as existing + * This is useful because during control call if user don't want to chnage + * the sliceCodingParams + */ + IMPEG4_SLICECODING_EXISTING = 2, + IMPEG4_SLICECODING_MAX + +} IMPEG4ENC_SliceCodingPreset; + + +/** + ******************************************************************************* + * @enum IMPEG4ENC_SliceMode + * @brief These enumerations control the mode of slice coding + * + * @remarks + * + ******************************************************************************* +*/ +typedef enum { + IMPEG4_SLICEMODE_NONE = 0, + + /** + * Default slice coding mode is MB based + */ + IMPEG4_SLICEMODE_DEFAULT = IMPEG4_SLICEMODE_NONE, + + /** + * Slices are controlled based upon number of Macroblocks + */ + IMPEG4_SLICEMODE_MBUNIT = 1, + + /** + * Slices are controlled based upon number of bits consumed + */ + IMPEG4_SLICEMODE_BITS = 2, + IMPEG4_SLICEMODE_MAX + +} IMPEG4ENC_SliceMode; + +/** + ******************************************************************************* + * @enum IMPEG4ENC_nonMultiple16RefPadMethod + * @brief These enumerations captures different methods of padding the Ref + * frame when dimension is non multiple of 16. + * + * @remarks + * + ******************************************************************************* +*/ +typedef enum { + /** + * Method as suggested by DivX spec. + */ + IMPEG4_PAD_METHOD_DIVX = 0, + + /** + * Method as suggested by MPEG4 spec. + */ + IMPEG4_PAD_METHOD_MPEG4 = 1, + + /** + * Default mode is MPEG4 suggested way. + */ + IMPEG4_PAD_METHOD_DEFAULT = IMPEG4_PAD_METHOD_MPEG4, + IMPEG4_PAD_METHOD_MAX + +} IMPEG4ENC_nonMultiple16RefPadMethod; + + +/** + + @enum IMPEG4ENC_AspectRatioIdc + @brief Defines aspect ratio IDs + +*/ +typedef enum { + IMPEG4ENC_ASPECTRATIO_SQUARE = 1, /**< 1:1 (square) aspect ratio */ + IMPEG4ENC_ASPECTRATIO_12_11, /**< 12:11 aspect ratio */ + IMPEG4ENC_ASPECTRATIO_10_11, /**< 10:11 aspect ratio */ + IMPEG4ENC_ASPECTRATIO_16_11, /**< 16:11 aspect ratio */ + IMPEG4ENC_ASPECTRATIO_40_33, /**< 40:33 aspect ratio */ + IMPEG4ENC_ASPECTRATIO_EXTENDED = 15 /**< Extended aspect ratio */ + +} IMPEG4ENC_AspectRatioIdc; + +/** + ******************************************************************************* + * @struct IMPEG4ENC_Cmd + * @brief This structure defines the control commands for the IMP4VENC module + * + ******************************************************************************* +*/ +typedef IVIDENC2_Cmd IMPEG4ENC_Cmd; + + +/** + ******************************************************************************* + * @struct IMPEG4ENC_Obj + * @brief This structure must be the first field of all MPEG4ENC instance + * objects + * + * @param fxns - is a pointer to IMPEG4ENC_Fxns structure which includes the + * below function pointers + * IALG_Fxns + * Void algActivate(IALG_Handle handle) + * Int algAlloc(const IALG_Params *params, + * struct IALG_Fxns **parentFxns, IALG_MemRec *memTab) + * Void algControl(IALG_Handle handle, IALG_Cmd cmd, + * IALG_Status *status) + * Void algDeactivate(IALG_Handle handle) + * Int algFree(IALG_Handle handle, IALG_MemRec *memTab) + * Int algInit(IALG_Handle handle, const IALG_MemRec *memTab, + * IALG_Handle parent, const IALG_Params *params) + * Void algMoved(IALG_Handle handle, const IALG_MemRec *memTab, + * IALG_Handle parent, const IALG_Params *params) + * Int algNumAlloc(Void) + * + * XDAS_Int32 process(IVIDENC2_Handle handle, IVIDEO2_BufDesc *inBufs, + * XDM2_BufDesc *outBufs, IVIDENC2_InArgs *inArgs, + * IVIDENC2_OutArgs *outArgs) + * + * XDAS_Int32 control(IVIDENC2_Handle handle, IVIDENC2_Cmd id, + * IVIDENC2_DynamicParams *params, IVIDENC2_Status *status) + * + ******************************************************************************* +*/ +typedef struct IMPEG4ENC_Obj { + struct IMPEG4ENC_Fxns *fxns; +} IMPEG4ENC_Obj; + + +/** + ******************************************************************************* + * @struct IMPEG4ENC_Handle + * @brief This handle is used to reference all MPEG4ENC instance objects + * + ******************************************************************************* +*/ +typedef struct IMPEG4ENC_Obj *IMPEG4ENC_Handle; + +/** + ******************************************************************************* + * @struct IMPEG4ENC_RateControlParams + * @brief This structure contains all the parameters which controls Rate + * Control behavior + * + * @param rateControlParamsPreset : + * if this is IMPEG4_RATECONTROLPARAMS_DEFAULT the algorithm loads the + * default rate control parameters. + * if this is IMPEG4_RATECONTROLPARAMS_USERDEFINED the algorithm loads + * the user defined rate control parameters. if user is not aware of + * the floowing parameters it should be set to this enumeration. + * if this is IMPEG4_RATECONTROLPARAMS_EXISTING the algorithm loads + * the default rate control parameters. + * + * @param rcAlgo : + * if this is IMPEG4_RATECONTROLALGO_NONE the algorithm uses the fixed + * qpI/qpP depending on the Frame + * if this is IMPEG4_RATECONTROLALGO_PLR the algorithm uses the + * PLR algorithm for QP Selection and bitrate achievement + * + * @param qpI : + * Initial Quantization Parameter for I frames. Valid Range is [1, 31]. + * when rateControlPreset = IVIDEO_NONE, this quantization parameter is + * used by the I frame encoding + * + * @param qpP : + * Initial Quantization Parameter for P frames. Valid Range is [1, 31] + * when rateControlPreset = IVIDEO_NONE, this quantization parameter is + * used by the P frame encoding + * + * @param seIntialQP : + * when rcAlgo is anything other than IMPEG4_RATECONTROLALGO_NONE, + * frame encoding start with seIntialQP value. + * When the user does not have understanding of what to set, set to 0, + * so the Codec internally decides intelligently the initial QP to be + * used. + * + * @param qpMax : + * Maximum Quantization Parameter. Range [1, 31]. Useful to control + * a minimum quality level + * + * @param qpMin : + * Minimum Quantization Parameter. Range [1, 31]. Useful to control + * a maximum bit-rate level + * + * @param enablePerceptualQuantMode : + * perceptual quantization is enabled or diasabled. It varies the Qp at + * MB level instead of row level to improve the perceptual quality of + * video. + * 1 for enable + * 0 for disable + * + * @param allowFrameSkip : + * This enables the Frame Skip Feature looking at the VBV Fullness. + * This should be enabled when Low Delay Mode is enabled. + * 2 for enabling early frame skip + * 1 for enabling late frame skip + * 0 for disabling frame skip + * @param initialBufferLevel : + * Initial buffer level for VBV compliance. It informs that + * hypothetical decoder can start depending on the fullness of the + * VBV buffer. Default value is 0, where codec will internally + * calculate the value based on the RC algo type + * @param vbvBufferSize : + * Virtual Buffer Verifier buffer size. This size controls the frame + * skip logic of the encoder. For low delay applications this size + * should be small. This size is in bits. + * Default value is 0, where codec will internally calculate the + * value based on the RC algo type. + * + ******************************************************************************* +*/ +typedef struct IMPEG4ENC_RateControlParams { + XDAS_Int32 rateControlParamsPreset; + XDAS_Int32 rcAlgo; + XDAS_Int32 qpI; + XDAS_Int32 qpP; + XDAS_Int32 seIntialQP; + XDAS_Int32 qpMax; + XDAS_Int32 qpMin; + XDAS_Int32 enablePerceptualQuantMode; + XDAS_Int32 allowFrameSkip; + XDAS_Int32 initialBufferLevel; + XDAS_Int32 vbvBufferSize; + XDAS_Int32 qpMinIntra; +} IMPEG4ENC_RateControlParams; + + +/** + ******************************************************************************* + * @struct IMPEG4ENC_InterCodingParams + * @brief This structure contains all the parameters which controls Inter MBs + * coding behavior + * + * @param interCodingPreset : + * This Preset controls the USER_DEFINED vs DEFAULT mode. if User is + * not aware about following fields, it should be set as + * IMPEG4_INTERCODING_DEFAULT + * + * @param searchRangeHorP : + * Horizontal Search Range for ME algo, range is [16, 144] + * + * @param searchRangeVerP : + * Vertical Search Range for ME algo, range is [16, 32] + * + * @param globalOffsetME : + * This variable is used to control ME search algorithm to improve + * video quality by doing ME around Temporal average MV. + * 1 for Enable + * 0 for Disable + * + * @param earlySkipThreshold : + * Threshold to use for early skip determination + * The Inter SAD is compared against this Threshold for early skip + * selection + * + * @param enableThresholdingMethod : + * Thresholding cost Method is used by CALC3 suppress expensive + * coefficients.Thresholding cost Method is used to set a block to be + * not_coded if the block has very few small amplitude coeffs. + * + * @param minBlockSizeP : minimum block size for P frames. + * Refer IMPEG4ENC_InterBlockSize enumeration to see the valid values + * if this variable takes value of IMPEG4_BLOCKSIZE_8x8 a MB in P Frame + * can have 4 Motion Vectors one for each 8x8 MB to + * improve video quality (not necessarily). This mode is used only for + * MPEG-4. This Field is neglected or read as Disable for H263 encoding. + * Set + * IMPEG4_BLOCKSIZE_8x8 for 4MV + * else only 1MV + * + * @param enableRoundingControl : + * When enabled reduces the IDCT drift + * 1 for Enable + * 0 for Disable + ******************************************************************************* +*/ +typedef struct IMPEG4ENC_InterCodingParams { + XDAS_Int32 interCodingPreset; + XDAS_Int32 searchRangeHorP; + XDAS_Int32 searchRangeVerP; + XDAS_UInt32 globalOffsetME; + XDAS_Int32 earlySkipThreshold; + XDAS_Int32 enableThresholdingMethod; + XDAS_UInt32 minBlockSizeP; + XDAS_UInt32 enableRoundingControl; + +} IMPEG4ENC_InterCodingParams; + + +/** + ******************************************************************************* + * @struct IMPEG4ENC_IntraCodingParams + * @brief This structure contains all the parameters which controls Intra + * encoding + * + * @param intraCodingPreset : + * This Preset controls the USER_DEFINED vs DEFAULT mode. if User is + * not aware about following fields, it should be set as + * IMPEG4_INTERCODING_DEFAULT + * + * @param intraRefreshMethod : + * Intra Refresh methods, this can be any one of the + * IMPEG4ENC_IntraRefreshMethods enumeration. + * refer IMPEG4ENC_IntraRefreshMethods enumeration above. + * + * @param intraRefreshRate : + * if intraRefreshMethod is IMPEG4_INTRAREFRESH_CYCLIC_MBS, this value + * represents madulo cyclic MBs value. MPEG4 Encoder encodes a + * macro block as Intra after every intraRefreshRate number of macro + * blocks.if intraRefreshMethod is IMPEG4_INTRAREFRESH_CYCLIC_ROWS, + * this value represents number if rows which are intra. MPEG4 Encoder + * encodes those many rows as intra every frame and the location of + * intra rows moves in cyclic fashion. + * This variable is ignored if intraRefreshMethod is + * IMPEG4_INTRAREFRESH_NONE. + * + * @param acpredEnable : + * AC prediction + * 0 for Disable + * 1 for Enable + * + * @param insertGOVHdrBeforeIframe : + * inserts GOV Header before I Frame if enabled + * 0 for Disable + * 1 for Enable + * + ******************************************************************************* +*/ +typedef struct IMPEG4ENC_IntraCodingParams { + XDAS_Int32 intraCodingPreset; + XDAS_UInt32 intraRefreshMethod; + XDAS_UInt32 intraRefreshRate; + XDAS_UInt32 acpredEnable; + XDAS_UInt32 insertGOVHdrBeforeIframe; + XDAS_UInt32 enableDriftControl; + +} IMPEG4ENC_IntraCodingParams; + + +/** + ******************************************************************************* + * @struct IMPEG4ENC_sliceCodingParams + * @brief This structure contains all the parameters which controls Intra + * encoding + * + * @param sliceCodingPreset : + * This Preset controls the USER_DEFINED vs DEFAULT mode. if User is + * not aware about following fields, it should be set as + * IMPEG4_INTERCODING_DEFAULT + * + * @param sliceMode : + * This defines the control mechanism to split a picture in slices. + * It can be either MB based or bits based and takes the enum + * IMPEG4ENC_SliceMode + * + * @param sliceUnitSize : + * The meaning of this parameter depends upon sliceMode. + * sliceMode == IMPEG4_SLICEMODE_MBUNIT then this + * parameter informs the number of Macroblocks in one slice + * sliceMode == IMPEG4_SLICEMODE_BITS then this + * parameter informs the number of bits in one slice in MPEG4 + * jargon resyncIntervalInBits + * sliceMode == IMPEG4_SLICEMODE_NONE then this + * parameter is not respected + * + * @param gobInterval : + * insert GOB header after every n GOBs + * This field is only used for H263 + * gobInterval range is [0, Max GOB Number-1] + * + * @param useHec : + * Use Header extension code [0-2] + * 0 for Disable + * 1 Include HEC for only First GobHeader + * 2 Include HEC for for all GobHeader + * + * + ******************************************************************************* +*/ +typedef struct IMPEG4ENC_sliceCodingParams { + XDAS_Int32 sliceCodingPreset; + XDAS_Int32 sliceMode; + XDAS_Int32 sliceUnitSize; + XDAS_UInt32 gobInterval; + XDAS_UInt32 useHec; + +} IMPEG4ENC_sliceCodingParams; + + +/** + ******************************************************************************* + * @struct IMPEG4ENC_DynamicParams + * @brief This structure defines the dynamic parameters for MPEG4ENC objects + * + * @param videnc2DynamicParams : + * refer IVIDENC2_DynamicParams in ividenc2.h file + * + * @param rateControlParams : + * refer IMPEG4ENC_RateControlParams structure above + * + * @param interCodingParams : + * refer IMPEG4ENC_InterCodingParams structure above + * + * @param sliceCodingParams : + * refer IMPEG4ENC_sliceCodingParams structure above + * + * @param aspectRatioIdc : + * defines the value of pixel aspect ratio + * See Table 6-12 of standard spec for aspect ratio details + * + ******************************************************************************* +*/ +typedef struct IMPEG4ENC_DynamicParams { + IVIDENC2_DynamicParams videnc2DynamicParams; + IMPEG4ENC_RateControlParams rateControlParams; + IMPEG4ENC_InterCodingParams interCodingParams; + IMPEG4ENC_sliceCodingParams sliceCodingParams; + XDAS_UInt32 aspectRatioIdc; +}IMPEG4ENC_DynamicParams; + + +/** + ******************************************************************************* + * @struct IMPEG4ENC_DynamicParams + * @brief Default dynamic parameter values for MPEG4ENC instance objects + * if user defined dynamic parameters are not given to the encoder then + * encoder uses this default dynamic parameters (which can be found in + * impeg4enc.c file) for encoding. + * + ******************************************************************************* +*/ +extern IMPEG4ENC_DynamicParams MPEG4ENC_TI_DYNAMICPARAMS; + + +/** + ******************************************************************************* + * @struct IMPEG4ENC_Params + * @brief This structure defines the creation parameters for MPEG4ENC objects + * + * @param videnc2Params : + * Defines creation time parameters for all IVIDENC2 instance objects. + * refer IVIDENC2_Params structure in ividenc2.h file + * + * @param rateControlParams : + * refer IMPEG4ENC_RateControlParams structure above + * + * @param interCodingParams : + * refer IMPEG4ENC_InterCodingParams structure above + * + * @param intraCodingParams : + * refer IMPEG4ENC_IntraCodingParams structure above + * + * @param sliceCodingParams : + * refer IMPEG4ENC_sliceCodingParams structure above + * + * @param useDataPartitioning : + * Controls data partitioning for MPEG4 Encoder. + * This mode is automatically disabled when short video header is + * enabled + * 0 for Disable + * 1 for Enable + * + * @param useRvlc : + * Use Reversible Variable Length Coding. + * MPEG4 Encoder expects Data Partitioning to be enabled when RVLC is + * enabled or else it returns error. + * This mode is automatically disabled when short video header is + * enabled + * 0 for Disable + * 1 for Enable + * + * @param useShortVideoHeader : + * short video header / h263 base line profile + * MPEG4 Encoder automatically disable the 4 MV, Data Partitioning, + * RVLC modes and reset resync interval in bits (disable H.241 flow) + * 0 for Disable + * 1 for Enable + * + * @param vopTimeIncrementResolution : + * resolution of vop_time_increment bit-stream syntax element, + * number of ticks/sec + * + * @param nonMultiple16RefPadMethod : + * Controls the way the padding is done for Ref Frame when Height is + * non-multiple of 16. + * Follows the enum IMPEG4ENC_nonMultiple16RefPadMethod + * IMPEG4_PAD_METHOD_DIVX - VLC, DIVx way of padding + * IMPEG4_PAD_METHOD_MPEG4 - MPEG4 Standard specific way of padding + * default value is IMPEG4_PAD_METHOD_MPEG4. + * + * @param pixelRange :video_range=0 :Y from 16 to 235, Cb and Cr from 16 to 240; + * video_range=1 : Y from 0 to 255,Cb and Cr from 0 to 255. + * + * @param enableSceneChangeAlgo : Parameter to enable or disable scene change + * algorithm. + * @param useVOS : VOS header insertion, 0 = off, 1 = on + * @param enableMONA : enable MONA settings 0 = off, 1 = on + * @param enableAnalyticinfo : enable MV and SAD access to user + * 0 = off, 1 = on + * + * @param debugTraceLevel : Indicates level of debug trace info to be + * dumped. + * Disabled if this value is zero. + * + * @param lastNFramesToLog : Indicates no. of frames for which debug trace + * info to be dumped. Valid only if debugTraceLevel + * is non zero. + ******************************************************************************* +*/ +typedef struct IMPEG4ENC_Params { + IVIDENC2_Params videnc2Params; + IMPEG4ENC_RateControlParams rateControlParams; + IMPEG4ENC_InterCodingParams interCodingParams; + IMPEG4ENC_IntraCodingParams intraCodingParams; + IMPEG4ENC_sliceCodingParams sliceCodingParams; + + XDAS_UInt32 useDataPartitioning; + XDAS_UInt32 useRvlc; + XDAS_UInt32 useShortVideoHeader; + XDAS_UInt32 vopTimeIncrementResolution; + XDAS_UInt32 nonMultiple16RefPadMethod; + XDAS_UInt32 pixelRange; + XDAS_UInt32 enableSceneChangeAlgo; + XDAS_UInt32 useVOS; + XDAS_UInt32 enableMONA; + XDAS_Int32 enableAnalyticinfo; + + XDAS_UInt32 debugTraceLevel; + XDAS_UInt32 lastNFramesToLog; + +} IMPEG4ENC_Params; + + +/** + ******************************************************************************* + * @struct IMPEG4ENC_Params + * @brief Default parameter values for MPEG4ENC instance objects + * if user defined parameters are not given to the encoder then + * encoder uses this default parameters (which can be found in + * impeg4enc.c file) for encoding. + * + ******************************************************************************* +*/ +extern IMPEG4ENC_Params MPEG4ENC_TI_PARAMS; + + +/** + ******************************************************************************* + * @struct IMPEG4ENC_Status + * @brief Status structure defines the parameters that can be changed or read + * during real-time operation of the alogrithm. + * + * @param videnc2Status : + * Status of the MPEG4 encoder along with error information, if any. + * refer IVIDENC2_Status structure in ividenc2.h file + * + * @param rateControlParams : + * refer IMPEG4ENC_RateControlParams structure above + * + * @param interCodingParams : + * refer IMPEG4ENC_InterCodingParams structure above + * + * @param intraCodingParams : + * refer IMPEG4ENC_IntraCodingParams structure above + * + * @param sliceCodingParams : + * refer IMPEG4ENC_sliceCodingParams structure above + * + * @param useDataPartitioning : + * Use data partitioning + * 0 for Disable + * 1 for Enable + * + * @param useRvlc : + * Use Reversible Variable Length Coding + * 0 for Disable + * 1 for Enable + * + * @param useShortVideoHeader : + * short video header / h263 base line profile + * 0 for Disable + * 1 for Enable + * @param vopTimeIncrementResolution :Resolution of vop_time_increment + * bit-stream syntax element, + * number of ticks/sec. + * + * @param nonMultiple16RefPadMethod : Controls the way the padding is done + * for Ref Frame when Height is + * Non-multiple of 16. + * @param pixelRange : Pixel range to be put in header + * See IMPEG4VENC_PixelRange enumeration for details. + * + * @param enableSceneChangeAlgo : + * Scene change detection algorithm. + * 0 for Disable + * 1 for Enable + * @param useVOS : VOS header insertion, 0 = off, 1 = on + * @param enableMONA : enable MONA settings 0 = off, 1 = on + * @param enableAnalyticinfo : enable MV and SAD access to user + * 0 = off, 1 = on + * + * @param debugTraceLevel : + * 0 Disable dumping debug data + * 1-4 enable dumping debug data + * + * @param lastNFramesToLog : No. of frame for which debug trace info to be + * dumped. + * + * @param extMemoryDebugTraceAddr : External memory address where debug trace + * info is dunped + * + * @param extMemoryDebugTraceSize : Size of the debug trace info in the + * external memory. + * + ******************************************************************************* +*/ +typedef struct { + IVIDENC2_Status videnc2Status; + IMPEG4ENC_RateControlParams rateControlParams; + IMPEG4ENC_InterCodingParams interCodingParams; + IMPEG4ENC_IntraCodingParams intraCodingParams; + IMPEG4ENC_sliceCodingParams sliceCodingParams; + + XDAS_UInt32 useDataPartitioning; + XDAS_UInt32 useRvlc; + XDAS_UInt32 useShortVideoHeader; + XDAS_UInt32 vopTimeIncrementResolution; + XDAS_UInt32 nonMultiple16RefPadMethod; + XDAS_UInt32 pixelRange; + XDAS_UInt32 enableSceneChangeAlgo; + XDAS_UInt32 useVOS; + XDAS_UInt32 enableMONA; + XDAS_Int32 enableAnalyticinfo; + + XDAS_UInt32 debugTraceLevel; + XDAS_UInt32 lastNFramesToLog; + XDAS_UInt32 *extMemoryDebugTraceAddr; + XDAS_UInt32 extMemoryDebugTraceSize; + +} IMPEG4ENC_Status; + + +/** + ******************************************************************************* + * @struct IMPEG4ENC_InArgs + * @brief This structure defines the runtime input arguments for + * IMPEG4ENC::process function + * + * @param videnc2InArgs : + * Parameters common to video encoders + * refer IVIDENC2_InArgs structure in ividenc2.h file + * + ******************************************************************************* +*/ +typedef struct IMPEG4ENC_InArgs { + IVIDENC2_InArgs videnc2InArgs; +} IMPEG4ENC_InArgs; + + +/** + ******************************************************************************* + * @struct IMPEG4ENC_OutArgs + * @brief This structure defines the run time output arguments for + * IMPEG4ENC::process function + * + * @param videnc2OutArgs : + * output parameters from the IMPEG4ENC::process call + * refer IVIDENC2_OutArgs structure in ividenc2.h file + * + ******************************************************************************* +*/ +typedef struct IMPEG4ENC_OutArgs { + IVIDENC2_OutArgs videnc2OutArgs; +} IMPEG4ENC_OutArgs; + + +/** + ******************************************************************************* + * @struct IMPEG4ENC_Fxns + * @brief This structure defines all of the operations on MPEG4ENC objects + * + * @param ividenc : + * refer IVIDENC2_Fxns structure in ividenc2.h file + * + ******************************************************************************* +*/ +typedef struct IMPEG4ENC_Fxns { + IVIDENC2_Fxns ividenc; /* IMPEG4ENC extends IVIDENC */ +} IMPEG4ENC_Fxns; + +/** + ****************************************************************************** + * @struct IMPEG4ENC_DataSyncDesc + * @brief This structure is an extension of XDM_DataSyncDesc to provide add- + * itional information required for Mode B Packetization according to + * RFC2190. + * + * @param mbAddr: this is a pointer to an array of FIrst MB Addresses in diff + * packets. + * @param gobNumber: this is a pointer to an array of GOB Number of first Mb + * in different packets + * @param quantScale: this is a pointer to an array of Quant values of first + * Mb in different packets + * @param mv: this is a pointer to an array of MV of first MB in different + * packets. Note: the MV is in half-pel reolution as required in + * RFC2190. + ****************************************************************************** +*/ +typedef struct IMPEG4ENC_DataSyncDesc { + XDM_DataSyncDesc dataSyncDesc; + XDAS_UInt16 *mbAddr; + XDAS_UInt16 *gobNumber; + XDAS_UInt16 *quantScale; + XDAS_UInt32 *mv; +} IMPEG4ENC_DataSyncDesc; + +#ifdef __cplusplus +} +#endif /* extern "C" */ + +/*@}*/ /* ingroup HDVICP2MPEG4 */ + +#endif /* IMPEG4ENC_ */ + diff -Nru dce-1.6.5.4/packages/ivahd_codecs/ti/sdo/codecs/realvdec/irealvdec.h dce-1.6.7.3/packages/ivahd_codecs/ti/sdo/codecs/realvdec/irealvdec.h --- dce-1.6.5.4/packages/ivahd_codecs/ti/sdo/codecs/realvdec/irealvdec.h 2012-09-24 15:13:39.000000000 +0000 +++ dce-1.6.7.3/packages/ivahd_codecs/ti/sdo/codecs/realvdec/irealvdec.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2010, Texas Instruments Incorporated - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of Texas Instruments Incorporated nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#ifndef __IREALVDEC_H__ -#define __IREALVDEC_H__ - -#include -#include - -typedef struct IrealVDEC_Status { - IVIDDEC3_Status viddecStatus; - XDAS_UInt32 extendedErrorCode0; - XDAS_UInt32 extendedErrorCode1; - XDAS_UInt32 extendedErrorCode2; - XDAS_UInt32 extendedErrorCode3; - XDAS_UInt32 reserved[4]; -} IrealVDEC_Status; - -typedef struct IrealVDEC_Params { - IVIDDEC3_Params viddecParams; - XDAS_Int32 codec_version; - XDAS_Int32 stream_type; - XDAS_UInt32 reserved[2]; - XDAS_UInt32 errorConcealmentEnable; -} IrealVDEC_Params; - -typedef struct IrealVDEC_DynamicParams { - IVIDDEC3_DynamicParams viddecDynamicParams; -} IrealVDEC_DynamicParams; - -typedef struct IrealVDEC_InArgs { - IVIDDEC3_InArgs viddecInArgs; - XDAS_Int32 *packSize; - XDAS_UInt32 num_packets; -} IrealVDEC_InArgs; - -typedef struct IrealVDEC_OutArgs { - IVIDDEC3_OutArgs viddecOutArgs; -} IrealVDEC_OutArgs; - -#endif /* __IREALVDEC_H__ */ - diff -Nru dce-1.6.5.4/packages/ivahd_codecs/ti/sdo/codecs/vc1vdec/ivc1vdec.h dce-1.6.7.3/packages/ivahd_codecs/ti/sdo/codecs/vc1vdec/ivc1vdec.h --- dce-1.6.5.4/packages/ivahd_codecs/ti/sdo/codecs/vc1vdec/ivc1vdec.h 2012-09-24 15:13:39.000000000 +0000 +++ dce-1.6.7.3/packages/ivahd_codecs/ti/sdo/codecs/vc1vdec/ivc1vdec.h 2012-11-28 09:54:14.000000000 +0000 @@ -1,71 +1,725 @@ -/* - * Copyright (c) 2010, Texas Instruments Incorporated - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of Texas Instruments Incorporated nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#ifndef __IVC1VDEC_H__ -#define __IVC1VDEC_H__ - -#include -#include - -typedef struct IVC1VDEC_Status { - IVIDDEC3_Status viddecStatus; - XDAS_UInt32 extendedErrorCode0; - XDAS_UInt32 extendedErrorCode1; - XDAS_UInt32 extendedErrorCode2; - XDAS_UInt32 extendedErrorCode3; - XDAS_UInt32 reserved[4]; -} IVC1VDEC_Status; - -typedef struct IVC1VDEC_Params { - IVIDDEC3_Params viddecParams; - XDAS_Int32 ErrorConcealmentON; - union { - XDAS_Int32 frameLayerDataPresentFlag; - XDAS_Int32 FrameLayerDataPresentFlag; - }; - XDAS_Int32 reserved[2]; -} IVC1VDEC_Params; - -typedef struct IVC1VDEC_DynamicParams { - IVIDDEC3_DynamicParams viddecDynamicParams; -} IVC1VDEC_DynamicParams; - -typedef struct IVC1VDEC_InArgs { - IVIDDEC3_InArgs viddecInArgs; -}IVC1VDEC_InArgs; - -typedef struct IVC1VDEC_OutArgs { - IVIDDEC3_OutArgs viddecOutArgs; -} IVC1VDEC_OutArgs; - -#endif /* __IVC1VDEC_H__ */ +/* +******************************************************************************* +* HDVICP2.0 Based VC-1 Decoder +* +* "HDVICP2.0 Based VC-1 Decoder" is a software module developed on TI's +* HDVICP2 based SOCs. This module is capable of decoding a compressed +* advanced/main/simple profile VC-1 bit-stream into a YUV 4:2:0 Raw video. +* Based on SMPTE-421M standard. +* Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/ +* ALL RIGHTS RESERVED +******************************************************************************* +*/ +/** +******************************************************************************* +* @file ivc1vdec.h +* +* @brief This file contains the various defines for the implementation of +* ividec3 interface for VC-1 decoder. +* +* @author: Krishnakanth Rapaka +* +* @version 0.0 (Feb 2008) : Base version created [Krishnakanth Rapaka] +* +* @version 0.1 (May 2010) : Modified according to latest interface standard. +* [Dinesh Anand] +* +* @version 0.2 (Jun 2010) : Added review comments. [Dinesh Anand] +* +* @version 0.6 (Dec 2011) : Default structures are exposed in interface file. +* Added error codes for Ref picture Buffer. [Naidu]. +* +******************************************************************************* +*/ +#ifndef IVC1VDEC_H +#define IVC1VDEC_H + + + +/******************************************************************************* +* INCLUDE FILES +*******************************************************************************/ +#include +#include +#include + +/******************************************************************************* +* MACROS +*******************************************************************************/ + +/* + * Some of the operations performed by the control call + */ +#define IVC1VDEC_GETSTATUS XDM_GETSTATUS +#define IVC1VDEC_SETPARAMS XDM_SETPARAMS +#define IVC1VDEC_RESET XDM_RESET +#define IVC1VDEC_FLUSH XDM_FLUSH +#define IVC1VDEC_SETDEFAULT XDM_SETDEFAULT +#define IVC1VDEC_GETBUFINFO XDM_GETBUFINFO + +/* + * Macro defining the minimum version length of VC-1 decoder + */ +#define IVC1DEC_VERSION_LENGTH (200) + + +/******************************************************************************* +* PUBLIC DECLARATIONS Note: Defined here, used elsewhere +*******************************************************************************/ + +typedef enum { + /* Error bit for unsupported VIDDEC3PARAMS */ + IVC1DEC_ERR_UNSUPPORTED_VIDDEC3PARAMS = 0, + /* Error bit for unsupported VIDDEC3 Dynamic PARAMS */ + IVC1DEC_ERR_UNSUPPORTED_VIDDEC3DYNAMICPARAMS, + /* Error bit for unsupported VC1 VIDDEC3 Dynamic PARAMS */ + IVC1DEC_ERR_UNSUPPORTED_VC1DECDYNAMICPARAMS, + /* Error bit for improper data sync setting */ + IVC1DEC_ERR_IMPROPER_DATASYNC_SETTING, + /* Error bit for no slice */ + IVC1DEC_ERR_NOSLICE, + /* Error bit for slice header corruption */ + IVC1DEC_ERR_SLICEHDR, + /* Error bit for MB data corruption */ + IVC1DEC_ERR_MBDATA, + /* Error bit for unsupported VC1 feature */ + IVC1DEC_ERR_UNSUPPFEATURE, + /* Error bit for end of steam */ + IVC1DEC_ERR_STREAM_END = 16, + /* Error bit for unsupported resolution */ + IVC1DEC_ERR_UNSUPPRESOLUTION, + /* Error bit for IVAHD standby */ + IVC1DEC_ERR_STANDBY, + /* Error bit for invalid mailbox message */ + IVC1DEC_ERR_INVALID_MBOX_MESSAGE, + /* Error bit for sequence header corruption */ + IVC1DEC_ERR_SEQHDR, + /* Error bit for entry point header corruption */ + IVC1DEC_ERR_ENTRYHDR, + /* Error bit for picture header corruption */ + IVC1DEC_ERR_PICHDR, + /* Error bit for Ref picture Buffer */ + IVC1DEC_ERR_REF_PICTURE_BUFFER, + /* Error bit if there is no sequence header start code */ + IVC1DEC_ERR_NOSEQUENCEHEADER, + /* Error bit for invalid values of input/output buffer descriptors */ + IVC1DEC_ERR_BUFDESC = 30, + /* Error bit for picture size change. It will be set for a multiresolution */ + /* Stream */ + IVC1DEC_ERR_PICSIZECHANGE = 31 + +}Ivc1VDEC_ExtendedCommonErrorCodes; + +/** +******************************************************************************** + * @enum IVC1VDEC_ERROR_STATUS + * + * @brief This enum defines the 128 codec specific error status bits + * in VC-1 decoder. + * + * @note None: + * +******************************************************************************** +*/ +typedef enum { + /* Error bit for invalid dynamic params structure size */ + VC1_DYNAMIC_PARAMS_SIZE_ERROR = 0, + /* Error bit for decode header only mode */ + VC1_DECODE_HEADER_ERROR, + /* Error bit for invalid display width */ + VC1_DISPLAY_WIDTH_ERROR, + /* Error bit for invalid frame skip mode */ + VC1_FRAME_SKIP_MODE_ERROR, + /*Error bit for new frame flag */ + VC1_NEW_FRAME_FLAG_ERROR, + /* Error bit for datasync mode */ + VC1_PUT_DATA_FXN_ERROR, + /* Error bit for datasync mode */ + VC1_PUT_DATA_HANDLE_ERROR, + /* Error bit for datasync mode */ + VC1_GET_DATA_FXN_ERROR, + /* Error bit for datasync mode */ + VC1_GET_DATA_HANDLE_ERROR, + /* Error bit for datasync mode */ + VC1_PUT_BUFFER_FXN_ERROR, + /* Error bit for datasync mode */ + VC1_PUT_BUFFER_HANDLE_ERROR, + /* Error bit for late acquire argument */ + VC1_LATE_ACQUIRE_ARG_ERROR, + /* Error bit for inargs pointers */ + VC1_NULL_INARGS_POINTER_ERROR, + /* Error bit for inargs size */ + VC1_INARGS_SIZE_ERROR, + /* Error bit for invalid input bytes */ + VC1_INVALID_INPUT_BYTES_ERROR, + /* Error bit for invalid input bytes in flush mode */ + VC1_INVALID_INPUT_BYTES_IN_FLUSH_MODE_ERROR, + /* Error bit for invalid input ID */ + VC1_INVALID_INPUT_ID_ERROR, + /* Error bit for NULL instance handle */ + VC1_NULL_INSTANCE_HANDLE_ERROR, + /* Error bit if decoder is not initialized */ + VC1_DECODER_NOT_INITIALIZED_ERROR, + /* Error bit for invalid input buffer descriptor */ + VC1_INVALID_INPUT_BUF_DESC_ERROR, + /* Error bit for invalid input buffer pointer */ + VC1_INVALID_INPUT_BUFFER_POINTER_ERROR, + /* Error bit for invalid input buffer size */ + VC1_INVALID_INPUT_BUFFER_SIZE_ERROR, + /* Error bit for invalid number of input buffer */ + VC1_INVALID_NUM_OF_INPUT_BUFFERS_ERROR, + /* Error bit for excess number of input buffers */ + VC1_EXCESS_NUM_OF_INPUT_BUFFERS_ERROR, + /* Error bit for invalid memory type of input buffer */ + VC1_INVALID_INPUT_BUFFER_MEMTYPE_ERROR, + /* Error bit for invalid outargs pointer */ + VC1_INVALID_OUTARGS_POINTER_ERROR, + /* Error bit for invalid outargs size */ + VC1_INVALID_OUTARGS_SIZE, + /* Error bit for invalid output buffer descriptor pointer */ + VC1_INVALID_OUTPUT_BUF_DESC_POINTER_ERROR, + /* Error bit for invalid output buffer descriptor */ + VC1_INVALID_OUTPUT_BUF_DESC_ERROR, + /* Error bit for invalid output buffer */ + VC1_INVALID_NUM_OF_OUTPUT_BUFFERS_ERROR, + /* Error bit for invalid luma output buffer pointer */ + VC1_INVALID_OUTPUT_BUFFER0_POINTER_ERROR, + /* Error bit for invalid luma output buffer size */ + VC1_INVALID_OUTPUT_BUFFER0_SIZE_ERROR, + /* Error bit for invalid luma output buffer memory type */ + VC1_INVALID_OUTPUT_BUFFER0_MEMTYPE_ERROR, + /* Error bit for invalid chroma output buffer pointer */ + VC1_INVALID_OUTPUT_BUFFER1_POINTER_ERROR, + /* Error bit for invalid chroma output buffer size */ + VC1_INVALID_OUTPUT_BUFFER1_SIZE_ERROR, + /* Error bit for invalid chroma output buffer memory type */ + VC1_INVALID_OUTPUT_BUFFER1_MEMTYPE_ERROR, + /* Error bit for invalid output buffer2 pointer */ + VC1_INVALID_OUTPUT_BUFFER2_POINTER_ERROR, + /* Error bit for invalid output buffer2 size */ + VC1_INVALID_OUTPUT_BUFFER2_SIZE_ERROR, + /* Error bit for invalid output buffer2 memory type */ + VC1_INVALID_OUTPUT_BUFFER2_MEMTYPE_ERROR, + /* Error bit for invalid buffre usage mode */ + VC1_INVALID_BUFFER_USAGE_MODE, + /* Error bit for invalid tiled width for output buffer0 */ + VC1_INVALID_OUTPUT_BUFFER0_TILED_WIDTH_ERROR, + /* Error bit for invalid tiled height for output buffer0 */ + VC1_INVALID_OUTPUT_BUFFER0_TILED_HEIGHT_ERROR, + /* Error bit for invalid tiled width for output buffer1 */ + VC1_INVALID_OUTPUT_BUFFER1_TILED_WIDTH_ERROR, + /* Error bit for invalid tiled height for output buffer1 */ + VC1_INVALID_OUTPUT_BUFFER1_TILED_HEIGHT_ERROR, + /* Error bit for invalid tiled width for output buffer2 */ + VC1_INVALID_OUTPUT_BUFFER2_TILED_WIDTH_ERROR, + /* Error bit for invalid tiled height for output buffer2 */ + VC1_INVALID_OUTPUT_BUFFER2_TILED_HEIGHT_ERROR, + /* Error bit for invalid ref picture buffer */ + VC1_INVALID_REF_PICTURE_BUFFER, + /* Error bit for invalid profile */ + VC1_SEQ_HDR_INVALID_PROFILE = 64, + /* Error bit for invalid invalid level bits */ + VC1_SEQ_HDR_INVALID_LEVEL, + /* Error bit for invalid color diff format */ + VC1_SEQ_HDR_INVALID_COLORDIFF_FORMAT, + /* Error bit for invalid max coded width */ + VC1_SEQ_HDR_INVALID_MAX_CODED_WIDTH, + /* Error bit for invalid max code height */ + VC1_SEQ_HDR_INVALID_MAX_CODED_HEIGHT, + /* Error bit for invalid reserved bits */ + VC1_SEQ_HDR_INVALID_RESERVED, + /* Error bit for invalid aspect ratio */ + VC1_SEQ_HDR_INVALID_ASPECT_RATIO, + /* Error bit for invalid frame rate numerator bits */ + VC1_SEQ_HDR_INVALID_FRAMERATENR, + /* Error bit for invalid frame rate denominator bits */ + VC1_SEQ_HDR_INVALID_FRAMERATEDR, + /* Error bit for invalid color prim bits */ + VC1_SEQ_HDR_INVALID_COLOR_PRIM, + /* Error bit for invalid transfer character bits */ + VC1_SEQ_HDR_INVALID_TRANSFER_CHAR, + /* Error bit for invalid matrix coefficient bits */ + VC1_SEQ_HDR_INVALID_MATRIX_COEF, + /* Error bit for invalid loop filter bits */ + VC1_SEQ_HDR_INVALID_LOOPFILTER, + /* Error bit for invalid FASTUVMC bits */ + VC1_SEQ_HDR_INVALID_FASTUVMC, + /* Error bit for invalid Extended MV bits */ + VC1_SEQ_HDR_INVALID_EXTENDED_MV, + /* Error bit for invalid DQUANT bits */ + VC1_SEQ_HDR_INVALID_DQUANT, + /* Error bit for invalid sync marker bits */ + VC1_SEQ_HDR_INVALID_SYNCMARKER, + /* Error bit for invalid rang reduction bits */ + VC1_SEQ_HDR_INVALID_RANGERED, + /* Error bit for invalid max number of B frame bits */ + VC1_SEQ_HDR_INVALID_MAXBFRAMES, + /* Error bit for invalid DQUANT in entry point header */ + VC1_ENTRY_PNT_HDR_INVALID_DQUANT, + /* Error bit for invalid coded width */ + VC1_ENTRY_PNT_HDR_INVALID_CODED_WIDTH, + /* Error bit for invalid coded height */ + VC1_ENTRY_PNT_HDR_INVALID_CODED_HEIGHT, + /* Error bit for invalid PTYPE */ + VC1_PIC_HDR_INVALID_PTYPE, + /* Error bit for invalid PQINDEX */ + VC1_PIC_HDR_INVALID_PQINDEX, + /* Error bit for invalid MVRANGE */ + VC1_PIC_HDR_INVALID_MVRANGE, + /* Error bit for invalid RESPIC */ + VC1_PIC_HDR_INVALID_RESPIC, + /* Error bit for invalid FCM bits */ + VC1_PIC_HDR_INVALID_FCM, + /* Error bit for invalid RNDCTRL bits */ + VC1_PIC_HDR_INVALID_RNDCTRL, + /* Error bit for invalid MVMODE bits */ + VC1_PIC_HDR_INVALID_MVMODE, + /* Error bit for invalid DMVRANGE bits */ + VC1_PIC_HDR_INVALID_DMVRANGE, + /* Error bit for invalid BFRACTION bits */ + VC1_PIC_HDR_INVALID_BFRACTION, + /* Error bit for invalid REFDIST bits */ + VC1_PIC_HDR_INVALID_REFDIST, + /* Error bit for invalid number of MBs in a picture */ + VC1_ERR_MBNUMB, + /* Error bit for invalid SCALERES bits */ + VC1_ERR_SCALERES, + /* Error bit for invalid ALTPQUANT bits */ + VC1_ERR_ALTPQUANT, + /* Error bit for invalid ABSPQ bits */ + VC1_VOPDQUANT_INVALID_ABSPQ, + /* Error bit for invalid slice address bits */ + VC1_SLC_HDR_INVALID_SLICE_ADDR, + /* Error bit for improper IVAHD reset */ + VC1_IMPROPER_RESET, + /* Error bit for improper standby */ + VC1_IMPROPER_STANDBY, + /* Error bit MB error */ + VC1_ECD_MB_ERROR, + /* No Sequence header start code */ + VC1_NO_SEQUENCE_STARTCODE + +}IVC1VDEC_ERROR_STATUS; + + + +/** + + ****************************************************************************** + + * @enum IVC1VDEC_mbErrStatus + + * @brief This enum indicates if a MB was in error or not + + * + + ****************************************************************************** + +*/ + +typedef enum { + /* MB was non-erroneous */ + IVC1VDEC_MB_NOERROR = 0, + /* MB was erroneous */ + IVC1VDEC_MB_ERROR = 1 + +} IVC1VDEC_mbErrStatus; + +/** +******************************************************************************** +* @struct IVC1VDEC_TI_MbInfo +* +* @brief MB information structure that is written out by the IVA-HD hardware. +* +* @note None: +* +******************************************************************************** +*/ +typedef struct IVC1VDEC_TI_MbInfo { + /* MB address */ + XDAS_UInt8 mb_addr; + /* Error flag */ + XDAS_UInt8 error_flag; + /* First MB flag */ + XDAS_UInt8 first_mb_flag; + /* Picture bound */ + XDAS_UInt8 pic_bound_b; + /* Upper picture bound */ + XDAS_UInt8 pic_bound_u; + /* Right picture bound */ + XDAS_UInt8 pic_bound_r; + /* Left picture bound */ + XDAS_UInt8 pic_bound_l; + /* Availability of upper right MB */ + XDAS_UInt8 mb_ur_avail; + /* Availability of upper MB */ + XDAS_UInt8 mb_uu_avail; + /* Availability of upper left MB */ + XDAS_UInt8 mb_ul_avail; + /* Availability of left MB */ + XDAS_UInt8 mb_ll_avail; + /* Macroblock header format type */ + XDAS_UInt8 fmt_type; + /* Codec type */ + XDAS_UInt8 codec_type; + /* Indicates DC values of each Y block in current MB */ + XDAS_UInt8 dc_coef_q_y[4]; + /* Indicates DC values of Cr block in current MB */ + XDAS_UInt8 dc_coef_q_cr; + /* Indicates DC values of Cb block in current MB */ + XDAS_UInt8 dc_coef_q_cb; + /* Block type of cr block */ + XDAS_UInt8 block_type_cr; + /* Block type of cb block */ + XDAS_UInt8 block_type_cb; + /* Block types of luma */ + XDAS_UInt8 block_type_y[4]; + /* In decoding, if the current macroblock is the last macroblock in a slice,*/ + /* ECD sets 1 to this field during executing the macroblock. Otherwise, ECD */ + /* sets 0 to this field */ + XDAS_UInt8 end_of_slice; + /* 1 : allow skipping current MB if CBP = 0 */ + XDAS_UInt8 cond_skip_flag; + /* Skipped / non skipped MB */ + XDAS_UInt8 skip; + /* 1 indicates that overlap filtering is in use for the macroblock. */ + XDAS_UInt8 overlap; + /* 1 indicates that AC prediction is in use for the macroblock */ + XDAS_UInt8 acpred; + /* Denotes inter-prediction direction for the macroblock in B-picture */ + XDAS_UInt8 b_picture_direction; + /* Denotes the number of motion vectors. */ + XDAS_UInt8 mv_mode; + /* 1 indicates that the field transform is in use for the macroblock. */ + XDAS_UInt8 fieldtx; + /* 1 indicates that field inter-prediction is in use */ + XDAS_UInt8 mv_type; + /* Equals the reference frame distance */ + XDAS_UInt8 refdist; + /* 1 indicates that macroblock quantizer-scale (MQUANT) overflows */ + XDAS_UInt8 mquant_overflow; + /* Equals the quantizer-scale for the macroblock */ + XDAS_UInt8 quant; + /* 1 indicates that 0.5 shall be added to PQUANT in calculation of */ + /* quantizer-scale. This field is valid for decoding only. */ + XDAS_UInt8 halfqp; + /* Equals the DC coefficient step size which is derived from MQUANT in the */ + /* bit-stream */ + XDAS_UInt8 dc_step_size; + /* Denotes the coded sub-block pattern for cr block */ + XDAS_UInt8 cbp_cr; + /* Denotes the coded sub-block pattern for cb block */ + XDAS_UInt8 cbp_cb; + /* Denotes the coded sub-block pattern for luma blocks */ + XDAS_UInt8 cbp_y[3]; + /* Denotes the backward reference field picture */ + XDAS_UInt8 mv_bw_ref_y[4]; + /* Denotes the forward reference field picture */ + XDAS_UInt8 mv_fw_ref_y[3]; + /* Unclipped forward motion vector for luma */ + XDAS_UInt8 mv_fw_y[4][4]; + /* Unclipped backward motion vector for luma */ + XDAS_UInt8 mv_bw_y[1][1]; + /* Unclipped backward motion vector for chroma */ + XDAS_UInt8 mv_bw_c[2]; + /* Unclipped forward motion vector for chroma */ + XDAS_UInt8 mv_fw_c[2]; + /* Clipped forward motion vector for luma */ + XDAS_UInt8 cmv_fw_y[4][4]; + /* Clipped backward motion vector for luma */ + XDAS_UInt8 cmv_bw_y[4][4]; + /* Clipped forward motion vector for chroma */ + XDAS_UInt8 cmv_fw_c[4][4]; + /* Clipped backward motion vector for chroma */ + XDAS_UInt8 cmv_bw_c[4][4]; + +}IVC1VDEC_TI_MbInfo; + +/** +******************************************************************************** +* @struct IVC1VDEC_Obj +* +* @brief Object defnition of the VC-1 decoder algorithm.This structure +* must be the first field of all VC1VDEC instance objects. +* +* @param fxns: Pointer to the structure defining all the ividdec3 +* interface operations to be performed on the VC-1 decoder +* object. +******************************************************************************** +*/ +typedef struct IVC1VDEC_Obj { + + struct IVC1VDEC_Fxns *fxns; + +} IVC1VDEC_Obj; + +/** +******************************************************************************** +* @struct IVC1VDEC_Handle +* +* @brief Handle to the VC-1 decoder instance object. +* +******************************************************************************** +*/ +typedef struct IVC1VDEC_Obj *IVC1VDEC_Handle; + +/** +******************************************************************************** +* @struct IVC1VDEC_Status +* +* @brief This structure defines parameters that describe the status of the +* VC-1 Decoder and any other implementation specific parameters. +* The status parameters are defined in the XDM data structure, +* IVIDDEC3_Status +* +* @param viddecStatus : XDM Base class status structure (see ividdec3.h) +* +* @param eRes: Extended class +******************************************************************************** +*/ +typedef struct IVC1VDEC_Status { + IVIDDEC3_Status viddecStatus; + /*-------------------------------------------------------------------------*/ + /* Extended Error Code0 returned by decoder */ + /*-------------------------------------------------------------------------*/ + XDAS_UInt32 extendedErrorCode0; + /*-------------------------------------------------------------------------*/ + /* Extended Error Code1 returned by decoder */ + /*-------------------------------------------------------------------------*/ + XDAS_UInt32 extendedErrorCode1; + /*-------------------------------------------------------------------------*/ + /* Extended Error Code2 returned by decoder */ + /*-------------------------------------------------------------------------*/ + XDAS_UInt32 extendedErrorCode2; + /*-------------------------------------------------------------------------*/ + /* Extended Error Code3 returned by decoder */ + /*-------------------------------------------------------------------------*/ + XDAS_UInt32 extendedErrorCode3; + /*-------------------------------------------------------------------------*/ + /* Debug trace level configured for the codec */ + /*-------------------------------------------------------------------------*/ + XDAS_UInt32 debugTraceLevel; + /*-------------------------------------------------------------------------*/ + /* Number of frames for which history information is maintained by the */ + /* codec */ + /*-------------------------------------------------------------------------*/ + XDAS_UInt32 lastNFramesToLog; + /*-------------------------------------------------------------------------*/ + /* External memory address (as seen by M3) where debug trace information is*/ + /* being dumped */ + /*-------------------------------------------------------------------------*/ + XDAS_UInt32 *extMemoryDebugTraceAddr; + /*-------------------------------------------------------------------------*/ + /* External memory buffer size (in bytes) where debug trace information is */ + /* being dumped */ + /*-------------------------------------------------------------------------*/ + XDAS_UInt32 extMemoryDebugTraceSize; +} IVC1VDEC_Status; + + +/** +******************************************************************************** +* @struct IVC1VDEC_Params +* +* @brief This structure defines the creation parameters for all VC-1 decoder +* objects. This structure includes the xdm baseclass creation +* parameters and any other implementation specific parameters for +* VC-1 Decoder instance object. +* +* @param viddec3Params: XDM Baselass create time parameters. +* (see ividdec3.h) +* +******************************************************************************** +*/ +typedef struct IVC1VDEC_Params { + IVIDDEC3_Params viddecParams; + /*--------------------------------------------------------------------------*/ + /*Enable/Disable Error Concealment */ + /* enumeration 'eFrameErrorConcealment' can be used to set this value */ + /*--------------------------------------------------------------------------*/ + XDAS_Int32 errorConcealmentON; + /*--------------------------------------------------------------------------*/ + /* Flag to indicate that whether the application is providing the frame */ + /* layer data structure in case of simple & main profile */ + /*--------------------------------------------------------------------------*/ + XDAS_Int32 frameLayerDataPresentFlag; + /*--------------------------------------------------------------------------*/ + /* This parameter configures the codec to dump a debug trace log */ + /*--------------------------------------------------------------------------*/ + XDAS_UInt32 debugTraceLevel; + /*--------------------------------------------------------------------------*/ + /* This parameters configures the codec to maintain history of debug trace */ + /* parameters for last N frames. */ + /*--------------------------------------------------------------------------*/ + XDAS_UInt32 lastNFramesToLog; + +} IVC1VDEC_Params; + +/** +******************************************************************************** +* @struct IH264VDEC_DynamicParams +* +* @brief This structure defines the run-time parameters and any other +* implementation specific parameters for an H.264 instance object. +* The base run-time parameters are defined in the XDM data structure, +* IVIDDEC3_DynamicParams. +* +* @param viddecDynamicParams : XDM Base class dynamic structure +* (see ividdec3.h) +* +* @param outloopDeblocking : Out loop deblocking flag to be enabled +* for simple profile dynamically at frame level +* +* @param calc_sw_workaround: Flag used for switching the CALC software +* work around ON or OFF. +* +******************************************************************************** +*/ +typedef struct IVC1VDEC_DynamicParams { + IVIDDEC3_DynamicParams viddecDynamicParams; +} IVC1VDEC_DynamicParams; + + +/** +******************************************************************************** +* @struct IVC1VDEC_InArgs +* +* @brief This structure defines the run-time input arguments for an VC-1 +* decoder process function. +* +* @param viddec3InArgs : XDM Base class InArgs structure (see ividdec3.h) +* +******************************************************************************** +*/ +typedef struct IVC1VDEC_InArgs { + IVIDDEC3_InArgs viddecInArgs; +}IVC1VDEC_InArgs; + + +/** +******************************************************************************** +* @struct IVC1VDEC_OutArgs +* +* @brief This structure defines the run time output arguments for VC-1 +* decoder process function. +* +* @param viddecOutArgs : XDM Base class OutArgs structure (see ividdec3.h) +* +******************************************************************************** +*/ +typedef struct IVC1VDEC_OutArgs { + IVIDDEC3_OutArgs viddecOutArgs; + +} IVC1VDEC_OutArgs; + +/** +******************************************************************************** +* @struct IVC1VDEC_Fxns +* +* @brief This structure contains pointers to all the XDAIS and XDM interface +* functions +* +* @param ividdec : This structure contains pointers to all the XDAIS and +* XDM interface functions +******************************************************************************** +*/ +typedef struct IVC1VDEC_Fxns { + IVIDDEC3_Fxns ividdec; +} IVC1VDEC_Fxns; + + + +/** +******************************************************************************** +* @fn VC1VDEC_TI_decode(IVIDDEC3_Handle handle, +* XDM2_BufDesc *inptr, +* XDM2_BufDesc *outptr, +* IVIDDEC3_InArgs *inargs, +* IVIDDEC3_OutArgs *outargs) +* +* @brief TI's(Texas Instrument) implementation of the process API defined +* by XDM for the VC-1 Decoder.This process function is responsible +* for the decode of a given frame. +* +* @param [in, out]handle : Algorithm handle +* +* @param [in] inptr : Pointer to input buffer structure. +* +* @param [out] outptr: Pointer to output buffer structure. +* +* @param [in] inargs : Pointer to input arguments structure. +* +* @param [out] outargs : Pointer to output arguments structure. +* +* @return[out] Error Code : IVIDDEC3_EFAIL if any error happened else +* IVIDDEC3_EOK for sucessful decoding of frame. +******************************************************************************** +*/ +XDAS_Int32 VC1VDEC_TI_decode(IVIDDEC3_Handle handle, + XDM2_BufDesc *inptr, + XDM2_BufDesc *outptr, + IVIDDEC3_InArgs *inargs, + IVIDDEC3_OutArgs *outargs); + + +/** +******************************************************************************* +* @fn VC1VDEC_TI_control (IVIDDEC3_Handle handle, +* IVIDDEC3_Cmd cmd, +* IVIDDEC3_DynamicParams * params, +* IVIDDEC3_Status * status) +* +* @brief Control API for the VC-1 decoder, to control various object +* parameters.Some of the operations which can be performed by control +* call are, +* i)Get status of various elements defined in the IVC1dec_Status. +* ii)Set the parameters in the structure IVC1dec_DyanmicParams +* iii)Reset the algorithm. +* iV)Set predefined defaults. +* V)Flush buffers held by the system. +* +* @param[in] handle: Pointer to algorithm instance object. +* +* @param[in] cmd: Command specifying the operations to be performed. +* +* @param[in] params: Pointer to the IVIDDEC3_DynamicParams struct. +* +* @param[in] status: Pointer to the IVIDDEC1_Status struct. +* +* @return Pass or Fail (IALG_EOK / IALG_EFAIL) +* +******************************************************************************* +*/ +XDAS_Int32 VC1VDEC_TI_control (IVIDDEC3_Handle handle, + IVIDDEC3_Cmd cmd, + IVIDDEC3_DynamicParams *params, + IVIDDEC3_Status *status); + + +/** +****************************************************************************** + * ======== IVC1VDEC_Params ======== + * Default Create parameter values for VC1VDEC instance objects +******************************************************************************** +*/ +extern const IVC1VDEC_Params VC1VDEC_TI_PARAMS; +/** +****************************************************************************** + * ======== IVC1VDEC_DynamicParams ======== + * Default DynamicParams values for VC1VDEC instance objects +******************************************************************************** +*/ +extern const IVC1VDEC_DynamicParams VC1VDEC_TI_DYNAMICPARAMS; +/******************************************************************************* +* EXTERNAL REFERENCE Note: use only if not found in header file +*******************************************************************************/ + + +extern IVC1VDEC_Fxns VC1VDEC_TI_IVC1VDEC; + +extern IVIDDEC3_Fxns VC1VDEC_TI_IVIDDECFUNCTIONS; + + + +#endif /* IVC1VDEC_ */ + diff -Nru dce-1.6.5.4/packages/ivahd_codecs/ti/sdo/codecs/vp6dec/ivp6vdec.h dce-1.6.7.3/packages/ivahd_codecs/ti/sdo/codecs/vp6dec/ivp6vdec.h --- dce-1.6.5.4/packages/ivahd_codecs/ti/sdo/codecs/vp6dec/ivp6vdec.h 2012-09-24 15:13:39.000000000 +0000 +++ dce-1.6.7.3/packages/ivahd_codecs/ti/sdo/codecs/vp6dec/ivp6vdec.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2010, Texas Instruments Incorporated - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of Texas Instruments Incorporated nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#ifndef __IVP6VDEC_H__ -#define __IVP6VDEC_H__ - -#include -#include - -typedef struct Ivp6VDEC_Status { - IVIDDEC3_Status viddecStatus; - XDAS_UInt32 extendedErrorCode0; - XDAS_UInt32 extendedErrorCode1; - XDAS_UInt32 extendedErrorCode2; - XDAS_UInt32 extendedErrorCode3; - XDAS_UInt32 reserved[4]; -} Ivp6VDEC_Status; - -typedef struct Ivp6VDEC_Params { - IVIDDEC3_Params viddecParams; - XDAS_UInt32 ivfFormat; - XDAS_UInt32 reserved[2]; - XDAS_UInt32 payloadHeaderPresent; -} Ivp6VDEC_Params; - -typedef struct Ivp6VDEC_DynamicParams { - IVIDDEC3_DynamicParams viddecDynamicParams; -} Ivp6VDEC_DynamicParams; - -typedef struct Ivp6VDEC_InArgs { - IVIDDEC3_InArgs viddecInArgs; -} Ivp6VDEC_InArgs; - -typedef struct Ivp6VDEC_OutArgs { - IVIDDEC3_OutArgs viddecOutArgs; -} Ivp6VDEC_OutArgs; - -#endif /* __IVP6VDEC_H__ */ diff -Nru dce-1.6.5.4/packages/ivahd_codecs/ti/sdo/codecs/vp7dec/ivp7vdec.h dce-1.6.7.3/packages/ivahd_codecs/ti/sdo/codecs/vp7dec/ivp7vdec.h --- dce-1.6.5.4/packages/ivahd_codecs/ti/sdo/codecs/vp7dec/ivp7vdec.h 2012-09-24 15:13:39.000000000 +0000 +++ dce-1.6.7.3/packages/ivahd_codecs/ti/sdo/codecs/vp7dec/ivp7vdec.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2010, Texas Instruments Incorporated - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of Texas Instruments Incorporated nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - - -#ifndef __IVP7VDEC_H__ -#define __IVP7VDEC_H__ - -#include -#include - - -typedef struct Ivp7VDEC_Status { - IVIDDEC3_Status viddecStatus; - XDAS_UInt32 extendedErrorCode0; - XDAS_UInt32 extendedErrorCode1; - XDAS_UInt32 extendedErrorCode2; - XDAS_UInt32 extendedErrorCode3; - XDAS_UInt32 reserved[4]; -} Ivp7VDEC_Status; - -typedef struct Ivp7VDEC_Params { - IVIDDEC3_Params viddecParams; - XDAS_UInt32 ivfFormat; - XDAS_UInt32 reserved[2]; - XDAS_UInt32 payloadHeaderPresent; -} Ivp7VDEC_Params; - -typedef struct Ivp7VDEC_DynamicParams { - IVIDDEC3_DynamicParams viddecDynamicParams; -} Ivp7VDEC_DynamicParams; - -typedef struct Ivp7VDEC_InArgs { - IVIDDEC3_InArgs viddecInArgs; -}Ivp7VDEC_InArgs; - -typedef struct Ivp7VDEC_OutArgs { - IVIDDEC3_OutArgs viddecOutArgs; -}Ivp7VDEC_OutArgs; - -#endif /* __IVP7VDEC_H__ */ - diff -Nru dce-1.6.5.4/packages/xdais/Makefile.am dce-1.6.7.3/packages/xdais/Makefile.am --- dce-1.6.5.4/packages/xdais/Makefile.am 2012-09-24 15:13:39.000000000 +0000 +++ dce-1.6.7.3/packages/xdais/Makefile.am 2012-11-28 09:54:14.000000000 +0000 @@ -8,4 +8,6 @@ ti/xdais/dm/ivideo.h \ ti/xdais/dm/xdm.h \ ti/xdais/ialg.h \ + ti/xdais/ires.h \ + ti/xdais/ires_common.h \ ti/xdais/xdas.h diff -Nru dce-1.6.5.4/packages/xdais/ti/xdais/ires.h dce-1.6.7.3/packages/xdais/ti/xdais/ires.h --- dce-1.6.5.4/packages/xdais/ti/xdais/ires.h 1970-01-01 00:00:00.000000000 +0000 +++ dce-1.6.7.3/packages/xdais/ti/xdais/ires.h 2012-11-28 09:54:14.000000000 +0000 @@ -0,0 +1,280 @@ +/* + * Copyright (c) 2012, Texas Instruments Incorporated + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of Texas Instruments Incorporated nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +/** + * @file ti/xdais/ires.h + * + * @brief IRES Interface Definitions - Allows algorithms to + * request and receive handles representing private logical + * resources. + */ + +/** + * @defgroup DSPIRES IRES + * + * The IRES interface enables algorithms to request and + * receive handles representing private logical resources. + */ +#ifndef IRES_ +#define IRES_ + +/** @ingroup DSPIRES */ +/*@{*/ + + +#ifdef __cplusplus +extern "C" { +#endif + +#include "ires_common.h" + +typedef enum IRES_YieldResourceType { + IRES_ALL = 0, /**< Yielding all resources held by the + * algorithm. + */ + IRES_SCRATCHMEMORY, /**< Yielding all scratch memory + * resources held by the algorithm. + */ + IRES_SCRATCHDMA, /**< Yielding all IDMA3 resources held + * by the algorithm. + */ + IRES_RESOURCEHANDLE /**< Yielding IRES resource handle only. + */ + +} IRES_YieldResourceType; + +typedef Void (*IRES_ContextSaveFxn)(IALG_Handle algHandle, Void *contextArgs); +typedef Void (*IRES_ContextRestoreFxn) + (IALG_Handle algHandle, Void *contextArgs); + +/** + * @brief Specifies the algorithm specific handles + * and context save & restore function pointers and arguments + * that the framework will call during a context switch. + */ +typedef struct IRES_YieldContext { + + /** + * Handle of the algorithm instance issuing the "yield". + */ + IALG_Handle algHandle; + + /** + * Optional resource handle that may be used to yield a particular + * IRES resource. + * May be NULL when some other resource or ALL resources associated + * with an algorithm are to be yielded. + */ + IRES_Handle resourceHandle; + + /** + * The 'contextSave' function is implemented by the 'yielding' algorithm + * instance and must be called by the framework whenever the 'yield' + * results in a context switch. + * Any 'scratch' IRES, IALG or IDMA3 resource owned by the algorithm must + * be considered in volatile state during a 'yield' call, and must be + * re-initialized and activated following any context switch. + * The 'contextSave' function must save any volatile state information in + * its persistent memory that it needs in the subsequent 'contextRestore' + * function call to re-initialize and activate its scratch resources. + */ + IRES_ContextSaveFxn contextSave; + + /** + * The 'contextRestore' function is implemented by the 'yielding' algorithm + * instance and must be called by the framework following a context switch + * which occured as a result of the 'yield', prior to returning from the + * framework supplied 'yield-function'. + * + * Any 'scratch' IRES, IALG or IDMA3 resource owned by the algorithm must + * be considered in volatile state during a 'yield' call, and must be + * re-initialized and activated following any context swith. + * The 'contextRestore' function uses the saved context information in + * the preceeding 'contextSave' call to re-initialize and activate its + * scratch resources. + */ + IRES_ContextRestoreFxn contextRestore; + + /** + * The arguments that must be passed when calling the 'contextSave()' + * and 'contextRestore()' functions. + * The algorithm instance calling the 'yield function' optionally + * supplies any 'contextArgs' that it wants the framework to passed to the + * 'contextSave()' and 'contextRestore()' functions. + */ + Void *contextArgs; + +} IRES_YieldContext; + + +typedef IRES_YieldContext *IRES_YieldContextHandle; +typedef Void *IRES_YieldArgs; + +/** + * @brief The 'yield function' pointer and 'yield arguments' are supplied + * to an algorithm during its IRES interface 'initialization'. + * The algorithm optionally calls the yield function during its + * 'process' stages for co-operative multi-tasking and pre-emption + * by a higher priority algorithm. + * + * An operating system level context switch may occur during the + * yield call. Whenever a context switch occurs, all + * scratch resources owned by the yielding algorithm must be + * context saved prior to the context switch and restored and + * initialized prior to 'resumption' by the framework/application. + * The 'yielding' algorithm must supply the IRES_YieldContext and + * the 'yield arguments' it received during IRES initialization. + * The framework calls the context save & restore functions + * provided by the yielding algorithm's IRES_YieldContext. + */ +typedef Void (*IRES_YieldFxn)(IRES_YieldResourceType resourceType, + IRES_YieldContextHandle algYieldContext, IRES_YieldArgs yieldArgs); + +/** + * @brief These fxns are used to query/grant the resources requested + * by the algorithm at initialization time, and to change these + * resources at runtime. All these fxns are implemented by the + * algorithm, and called by the client of the algorithm. + */ +typedef struct IRES_Fxns { + + /** + * @brief Unique pointer that identifies the module implementing this + * interface. + */ + Void *implementationId; + + /** + * @brief Query function to obtain the list of IRES resources requested + * by the algorithm instance. + */ + IRES_Status (*getResourceDescriptors)(IALG_Handle handle, + IRES_ResourceDescriptor *resourceDescriptors); + + /** + * @brief Query function to obtain the number of IRES resources + * requested by the algorithm instance, which is also the number + * of resource descriptors that must be passed to the + * getResourceDescriptors() function. + * + */ + Int32 (*numResourceDescriptors)(IALG_Handle handle); + + /** + * @brief Assignment function to grant the algorithm instance the list + * of IRES resources it requested. The algorithm can initialize + * internal instance memory with resource information, but may not + * use or access the resource state until the resource is + * activated via the activateResource call. + * + * @remark Version of the resource handle being granted is updated in + * the resourceDescriptor, and may be different from the one + * requested. + */ + IRES_Status (*initResources)(IALG_Handle handle, + IRES_ResourceDescriptor * resourceDescriptor, + IRES_YieldFxn yieldFxn, IRES_YieldArgs yieldArgs); + + /** + * @brief Re-assignment function to grant the algorithm instance + * a list of "modified" IRES resources. + * The algorithm may choose to not support the re-assignment and + * indicate this by returning failure. + * In case of success the algorithm updates its internal state + * to reflect the new resource information, but may not + * use or access the resource state until the resource is + * activated via the activateResource call. + */ + IRES_Status (*reinitResources)(IALG_Handle handle, + IRES_ResourceDescriptor * resourceDescriptor, + IRES_YieldFxn yieldFxn, IRES_YieldArgs yieldArgs); + + /** + * @brief Deinitialization function to revoke back the resources + * that have been granted to the algorithm instance. + */ + IRES_Status (*deinitResources)(IALG_Handle handle, + IRES_ResourceDescriptor * resourceDescriptor); + + /** + * @brief Resource Activation call to grant the algorithm instance + * exclusive access to the potentially shared resource. + * Algorithm can now access, initialize and or restore from a + * previous context saved during deactivation to use the resource. + * Each resource must be activated individually to give the + * framework optimization opportunities by tracking and deciding + * which resources truely require activation. + */ + IRES_Status (*activateResource)(IALG_Handle handle, + IRES_Handle resourceHandle); + + /** + * @brief Resource Activation call to grant the algorithm instance + * exclusive access to all resources it acquired via IRES. + * Algorithm can now access, initialize and or restore from a + * previous context saved during deactivation to use the resources. + */ + IRES_Status (*activateAllResources)(IALG_Handle handle); + + /** + * @brief Resource Deactivation call to revoke the algorithm instance's + * exclusive access to the potentially shared resource. + * Algorithm must save any context that is needed to restore the + * state during the next resource activation call. + */ + IRES_Status (*deactivateResource)(IALG_Handle handle, + IRES_Handle resourceHandle); + + /** + * @brief Resource Deactivation call to revoke the algorithm instance's + * exclusive access to ALL shared resources. + * Algorithm must save any context that is needed to restore the + * state during the next resource activation call. + */ + IRES_Status (*deactivateAllResources)(IALG_Handle handle); + +} IRES_Fxns; + +/*@}*/ + + +#ifdef __cplusplus +} +#endif /* extern "C" */ + + +#endif /* IRES_ */ +/* + * @(#) ti.xdais; 1, 2.0, 1,1; 6-19-2012 17:57:45; /db/wtree/library/trees/dais/dais-w06/src/ xlibrary + + */ + diff -Nru dce-1.6.5.4/packages/xdais/ti/xdais/ires_common.h dce-1.6.7.3/packages/xdais/ti/xdais/ires_common.h --- dce-1.6.5.4/packages/xdais/ti/xdais/ires_common.h 1970-01-01 00:00:00.000000000 +0000 +++ dce-1.6.7.3/packages/xdais/ti/xdais/ires_common.h 2012-11-28 09:54:14.000000000 +0000 @@ -0,0 +1,211 @@ +/* + * Copyright (c) 2012, Texas Instruments Incorporated + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of Texas Instruments Incorporated nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +/** + * @file ti/xdais/ires_common.h + * + * @brief IRES Resource Protocol Definitions - IRES Resource + */ + +#ifndef IRES_COMMON_ +#define IRES_COMMON_ + +/** @ingroup DSPIRES */ +/*@{*/ + + +#ifdef __cplusplus +extern "C" { +#endif + +#include "ialg.h" + + +/** + * @brief IRES_Status defines the standard error and success codes + * returned by IRES APIs. + */ +typedef enum IRES_Status { + IRES_OK = 0, /**< Success */ + IRES_EALG = 1, /**< Error in algorithm IRES_Fxns functions */ + IRES_EEXISTS = 2, /**< Error, already exists */ + IRES_EFAIL = 3, /**< Generic Error Message */ + IRES_EINIT = 4, /**< Error, already initialized */ + IRES_ENOINIT = 5, /**< Error, not initialized */ + IRES_ENOMEM = 6, /**< Error, not enough memory */ + IRES_ENORESOURCE = 7, /**< Error, resource unavailable*/ + IRES_ENOTFOUND = 8 /**< Error, not found */ +} IRES_Status; + +/** + * @brief Protocol revision type. + * Used to ensure the given 'protocol' revision can be validated. + */ +typedef struct IRES_ProtocolRevision { + unsigned int Major; + unsigned int Source; + unsigned int Radius; /* Using unsigned int here to support + * xdc/std.h as well as tistdtypes.h + */ +} IRES_ProtocolRevision; + + +/** + * @brief Mode in which resources can be requested. + */ +typedef enum IRES_RequestMode { + IRES_SCRATCH, /**< Indicates that resource requested + * can be shared with other + * algorithms in the same group. + */ + IRES_PERSISTENT, /**< Indicates that resource requested + * for allocation exclusively for + * this algorithm. + */ + IRES_LATEACQUIRE /**< Indicates that resource requested + * will not be granted immediately, but + * afterwards. Specific IRES APIs will need + * to be called, to ensure that a particular + * algorithm is the only user of these + * resources. + */ +} IRES_RequestMode; + + +/** + * @brief Abstract Protocol Arguments structure definition. + * Actual arguments passed by the algorithm to request a resource + * from a specific IRES Protocol will extend and supply the + * concrete definitions. + */ +typedef struct IRES_ProtocolArgs { + + Int32 size; /**< Size of this structure. */ + IRES_RequestMode mode; /**< Resource request mode. + * + * @sa IRES_RequestMode + */ +} IRES_ProtocolArgs; + +/** + * @brief Descriptor to Logical Resource. + */ +typedef struct IRES_ResourceDescriptor { + + /** + * String containing the package name to identify the resource. + */ + String resourceName; + + /** + * @brief Pointer to the Resource Protocol Arguments. + * + * @remark The Resource Manager selects the appropriate resource protocol + * based on the supplied @c resourceName, and uses the protocol to + * construct the IRES Resource Handle. + */ + struct IRES_ProtocolArgs *protocolArgs; + + /** + * @brief The revision of the IRES_ResourceProtocol Interface expected + * by the client algorithm. + * + * @remark Depending on the resource manager implementation, + * the returned resource may/may not coincide with the version + * being requested. Resource manager will update this field with + * the version of the handle it returns (and supports). + */ + IRES_ProtocolRevision *revision; + + /** + * The handle to the object representing the requested resource. + * The handle is initially set to 'null' by the requesting algorithm. + * The 'resource manager' allocates the resource and constructs the + * handle. + */ + struct IRES_Obj * handle; + +} IRES_ResourceDescriptor; + +/** + * @brief Abstract Resource Properties structure/pointer definition. + * Actual resource protocol will supply the concrete property + * definitions. + * The list of attributes for the actual resource will expose the + * relevant features that needs to be known to a client to use the + * resource, such as: resource register base addresses and offsets, + * critical register and memory region addresses, ... + */ +typedef struct IRES_Properties { + Int32 size; /**< Size of this structure. */ +} IRES_Properties; + +/** + * @brief IRES_Obj holds the private state associated with each + * logical resource. + */ +typedef struct IRES_Obj { + + /** + * Indicates if the resource has been allocated as persistent. + */ + Int32 persistent; + + /** + * Obtain the static properties associated with this resource + * This could include information like the register layer of the + * device etc. + */ + Void (*getStaticProperties) (struct IRES_Obj * resourceHandle, + IRES_Properties * resourceProperties); + +} IRES_Obj; + +/** + * @brief Handle to "logical" resource + */ +typedef struct IRES_Obj *IRES_Handle; + + + +#ifdef __cplusplus +} +#endif /* extern "C" */ + +/*@}*/ + +#endif /* IRES_COMMON_ */ +/* + * @(#) ti.xdais; 1, 2.0, 1,1; 6-19-2012 17:57:45; /db/wtree/library/trees/dais/dais-w06/src/ xlibrary + + */ + diff -Nru dce-1.6.5.4/packages/xdctools/xdc/std.h dce-1.6.7.3/packages/xdctools/xdc/std.h --- dce-1.6.5.4/packages/xdctools/xdc/std.h 2012-09-24 15:13:39.000000000 +0000 +++ dce-1.6.7.3/packages/xdctools/xdc/std.h 2012-11-28 09:54:14.000000000 +0000 @@ -42,18 +42,29 @@ /* Generic Extended Types */ -typedef unsigned short xdc_Bool; +typedef unsigned short xdc_Bool; /* boolean flag */ typedef void *xdc_Ptr; /* data pointer */ typedef char *xdc_String; /* null terminated string */ /* we intentionally omit arguments from Fxn to indicate that it can have * any (or none). Unfortunately this causes gcc to emit warnings when - * -Wstrict-prototypes is used. Newer gcc's support a pragma that - * may work around this: + * -Wstrict-prototypes is used. Newer gcc's (4.6 or later) support a pragma + * that works around this: * - * #pragma GCC diagnostic ignored "-Wstrict-prototype" + * #pragma GCC diagnostic ignored "-Wstrict-prototypes" */ -typedef int (*xdc_Fxn)(); /* function pointer */ +#ifdef __GNUC__ + #if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 6)) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-prototypes" + typedef int (*xdc_Fxn)(); /* function pointer */ + #pragma GCC diagnostic pop + #else + typedef int (*xdc_Fxn)(); /* function pointer */ + #endif +#else + typedef int (*xdc_Fxn)(); /* function pointer */ +#endif /* * Import the target-specific std.h @@ -64,6 +75,12 @@ #ifdef xdc_target__ #include xdc_target__ #else +/* if the user did not supply the required xdc_target* definitions, ask well + * known compiler tool chains to select based on their pre-defined macros + */ +#ifdef __TI_COMPILER_VERSION__ +#include +#else /* * 'xdc_target_types__' must be defined to name a target-specific header * file (e.g., ti/targets/std.h) that has definitions for the basic types: @@ -73,8 +90,6 @@ * add the following option to your compiler's command line: * -Dxdc_target_types__=ti/targets/std.h */ -//#warning xdc_target_types__ must be defined to name a target-specific header containing definitions of xdc_Int8, xdc_Int16, ... -// XXX add stdint target to use stdint types.. /* the following definitions are required to keep the compiler from * complaining about references to these types in the rest of this header; @@ -89,6 +104,7 @@ typedef int xdc_Int32; typedef unsigned int xdc_UInt32; #endif +#endif /* Each modules' internal header file defines 'module' as * xdc__MODOBJADDR__(Module__state__V), where Module__state__V is the actual @@ -101,7 +117,7 @@ * xdc__MODOBJADDR__ in std.h for their target package. */ #ifndef xdc__MODOBJADDR__ -#define xdc__MODOBJADDR__(symbol) &symbol +#define xdc__MODOBJADDR__(symbol) (&(symbol)) #endif /* Long Long Types */ @@ -142,8 +158,10 @@ #ifndef xdc__ARGTOFLOAT /* - * functions to convert a single precision float to an arg - * Here assumption is that sizeof(Float) <= sizeof(IArg); + * functions to efficiently convert a single precision float to an IArg + * and vice-versa while maintaining client type safety + * + * Here the assumption is that sizeof(Float) <= sizeof(IArg); */ typedef union xdc_FloatData { xdc_Float f; @@ -263,8 +281,18 @@ /* Standard Constants */ +/* NULL must be 0 for C++ and is set to 0 in C to allow legacy code to + * compile without warnings. + * + * If xdc_strict is defined, NULL is defined to be a pointer to allow + * maximal type checking in "modern" C sources + */ #undef NULL +#if defined(__cplusplus) || !defined(xdc__strict) #define NULL 0 +#else +#define NULL ((void *)0) +#endif #undef FALSE #define FALSE 0 @@ -278,15 +306,15 @@ #define __FAR__ #endif -/* Code-Section Directive */ - /* * ======== xdc__CODESECT ======== - * targets can optionally #define xdc__CODESECT in their specific + * Code-Section Directive + * + * Targets can optionally #define xdc__CODESECT in their specific * std.h files. This directive is placed in front of all * "extern" function declarations, and specifies a section-name in * which to place this function. This approach - * will give folks more control on combining/organizing groups of + * provides more control on combining/organizing groups of * related functions into a single named sub-section (e.g., * "init-code") If this macro is not defined by the target, an * empty definition is used instead. @@ -295,7 +323,6 @@ #define xdc__CODESECT(fn, sn) #endif - /* * ======== xdc__META ======== * Embed unreferenced string in the current file @@ -316,6 +343,6 @@ #endif /* xdc_std__include */ /* - * @(#) xdc; 1, 1, 1,284; 6-23-2010 14:02:49; /db/ztree/library/trees/xdc/xdc-v41x/src/packages/ + * @(#) xdc; 1, 1, 1,390; 9-20-2012 15:01:49; /db/ztree/library/trees/xdc/xdc-y36x/src/packages/ */