This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

IMGENC1_create/process vs. IIMGENC1_Fxns

In dvsdk 3.1, dvtb is using IMGENC1_create and IMGENC1_process functions where as the docs in codecs directory refer to IIMGENC1_Fxns structure.

What is the difference between the two? Is there documentation for IMGENC1_create/process functions? Where are those functions defined?

If I use IIMGENC1_Fxns, how to I populate the structure with the pointers to the actual functions?

Thanks.

  • Gennadiy Kiryukhin said:

    In dvsdk 3.1, dvtb is using IMGENC1_create and IMGENC1_process functions where as the docs in codecs directory refer to IIMGENC1_Fxns structure.

    What is the difference between the two?

    IIMGENC1_Fxns is an XDAIS-compliant interface/struct defined by, and distributed with, the XDAIS product.  Codecs/Algorithms implement this interface.  Any multimedia framework (like Codec Engine and others), can use codecs that implement this IIMGENC1 interface.  The extra 'I' prefix indicates 'Interface'.  It looks a little funny with imaging APIs, but looks better with video (e.g. IVIDENC1_Fxns).

    IMGENC1_* APIs are defined by the Codec Engine framework - a popular framework provided with many TI devices that provides access to XDAIS-complaint codecs/algorithms.  Codec Engine natively supports algorithms that implement IIMGDEC1_Fxns - it does this via its IMGENC1_* APIs.  These Codec Engine APIs (sometimes referred to as "VISA" APIs), expose all the codec features via 4 fxns - *_create(), *_delete(), *_process() and *_control().  Note there's no extra 'I' prefix on these IMGENC_* APIs.

    For example:

    • Codec Engine's IMGENC1_create() and IMGENC1_delete() implementations utilize the codec's IIMGENC1_Fxns under the covers to negotiate resources (e.g. memory, DMA, hardware accelerators, etc).  The Codec Engine user doesn't need to know the details, they just call create() and delete().
    • IMGENC1_process() and IMGENC1_control() invoke IIMGENC1_Fxns->process() and IIMGENC1_Fxns->control() respectively.

    Gennadiy Kiryukhin said:
    Is there documentation for IMGENC1_create/process functions? Where are those functions defined?

    Now you know these are part of Codec Engine, and API Reference is included with that product.  Here's the latest online API Reference:

    http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/ce/latest_2_x/docs/html/group__ti__sdo__ce__image1___i_m_g_e_n_c1.html

    DVTB uses Codec Engine, and that's why you'll find these CE calls throughout DVTB.

    Gennadiy Kiryukhin said:
    If I use IIMGENC1_Fxns, how to I populate the structure with the pointers to the actual functions?

    If you don't want to use Codec Engine (which is possible, but difficult sometimes), you could call the codec's IIMGENC1_Fxns APIs directly.  The codec libraries include (and should document) a codec-specific symbol that implements IIMGENC1_Fxns.  The IIMGENC1_Fxns struct behind this symbol is already filled out with the codec fxn ptrs; you would just have to link the codec lib into your app and use the IIMGENC1_Fxns-compliant functions behind the symbol.

    Note that if you go this non-Codec Engine route, you'll have to do all the complex resource management/sharing and other misc that Codec Engine takes care of.  Again, it's possible, but isn't recommended very often, and probably has varying levels of support.  The codec producer sometimes provides example apps that directly use its IIMGENC1_Fxns interface independent of any framework like Codec Engine.

    Chris

  • Hi,

    Most codecs include a sample application that shows how to use the XDM APIs without using the Codec Engine. This application is usually located in the codec package. For example for a h264 decoder it would be in packages/ti/sdo/codecs/h264dec/app/Client/Test/Src. The codec user's guide provided in the h264dec/docs folder includes some information about how to run it.

    Thanks

    Cesar

  • I did try to learn from the example. Just like Chris mentioned, it was A BIT complicated. I remembered seeing IMGENC1_* functions before and was wondering where they went. Now I understand.

    I will still need to find out if any libraries/files need to be linked to/from my program/Makefile. I will try to find this information from the link above.