Codec Engine Integration (end)

Source: Internet
Author: User
Tags sdo server memory

This article is translated from TI's manual, which is a golden document for studying GPP + DSP development. I hope it will be helpful for you to get started. Please kindly advise if you have any improper understanding.

Codec engine application developer user's guide.pdf (Literature number: sprue67d)

Codec engine application development user manual http://blog.csdn.net/dyzok88/article/details/42154487

Chapter I codec engine overview http://blog.csdn.net/dyzok88/article/details/42214813

Chapter 2 codec engine installation and setting http://blog.csdn.net/dyzok88/article/details/42278109

Chapter 3 sample applications using codec engine http://blog.csdn.net/dyzok88/article/details/42302793

Chapter 4 using codec engine API functions (a) http://blog.csdn.net/dyzok88/article/details/42323123

Chapter 4 using codec engine API functions (2) http://blog.csdn.net/dyzok88/article/details/42324061

Chapter 4 using codec engine API functions (3) http://blog.csdn.net/dyzok88/article/details/42344661

Chapter 4 API functions using codec engine (4) http://blog.csdn.net/dyzok88/article/details/42353141

Chapter 4 API functions using codec engine (5) http://blog.csdn.net/dyzok88/article/details/42374715

Chapter 4 API functions using codec engine (6) http://blog.csdn.net/dyzok88/article/details/42342539

Chapter 4 API functions using codec engine (7) http://blog.csdn.net/dyzok88/article/details/42583837

Chapter 4 API functions using codec engine (8) http://blog.csdn.net/dyzok88/article/details/42611221


// Body


Chapter 5 integrate a codec Engine

This chapter describes how Engine Integration engineers configure an engine used by application developers.

5.1 Summary

5.2 reusable examples

5.3 understand the engine configuration syntax


5.1 Summary

As described in 1.4.3, Engine Integration engineers and application engineers obtain engine configuration files from engine integration engineers. In practice, these roles can be shared by one person.

The engine configuration information is stored in an xdc *. in the cfg file, makefile is used for processing, and makefile uses package. xdc generation *. c file and from *. cfg file link command file (*. xdl ). For compilation instructions, see ce_install_dir/examples/build_instructions.html.

Application Instances of the codec engine generally support GPP + DSP, single GPP, and single DSP. For GPP + DSP usage, the engine configuration is often defined in a file named remote. cfg, and the specified codec program runs remotely on the DSP server. For single GPP or single DSP, the configuration information is usually located in a file named "Local. cfg", specifying that the codec program runs locally (as the cpu Of the main application.

The configuration of an engine includes the engine name, The codecs in each engine, and their names. Whether each decoder is local or remote (relative to the application ), the group to which each decoder should be included (used to support resource sharing environments), if an engine contains the name of the server image of the remote decoder, and so on.

However, in its simplest form, the engine configuration script can simply name the DSP server software package and the executable program of the corresponding server, and automatically import the codec definitions of all servers. This allows you to use the codecs from remote codecs.

For the latter form of configuration work, it is very important to receive your DSP server in your package. This is the default server delivery method of Ce 2.00, it is not just a binary executable file of a DSP server.


5.2 reusable examples

The video_copy example uses the following ceapp. cfg configuration file:

/*   ======== ceapp.cfg ======== *//* use the tracing utility module */var TraceUtil = xdc.useModule('ti.sdo.ce.utils.trace.TraceUtil');//TraceUtil.attrs = TraceUtil.SOCRATES_TRACING;/* set up OSAL */var osalGlobal = xdc.useModule('ti.sdo.ce.osal.Global');osalGlobal.runtimeEnv = osalGlobal.DSPLINK_LINUX;/* ======== Engine Configuration ======== */var Engine = xdc.useModule('ti.sdo.ce.Engine');var myEngine = Engine.createFromServer(    "video_copy",        // Engine name (as referred to in the C app)    "./video_copy.x64P", // path to server exe, relative to its package dir    "ti.sdo.ce.examples.servers.video_copy.evmDM6446" // server package);

Most of the configuration files can be referenced. For your application, you should modify the section in bold: Your engine name (your choice), the name of the server executable file, and the name of the server executable file package.

The codecs included in the server will be provided to the application with their original names. To facilitate the compilation of the application, see the following excerpt:

configuring ceapp.x470MV from package/cfg/ceapp_x470MV.cfg ...Info: Configuring engine named 'video_copy' from the info file for DSP server './video_copy.x64P', located in package 'ti.sdo.ce.examples.servers.video_copy.evmDM6467':      Target app will look for the DSP server image 'video_copy.x64P' in its current directory.      Adding codec 'viddec_copy' (ti.sdo.ce.examples.codecs.viddec_copy.VIDDEC_COPY), scratch groupId=0      Adding codec 'videnc_copy' (ti.sdo.ce.examples.codecs.videnc_copy.VIDENC_COPY), scratch groupId=0Info: Reading DSP memory map from the info file for DSP server './video_copy.x64P', located in package 'ti.sdo.ce.examples.servers.video_copy.evmDM6467':...

This is a good practice to verify that the information in the compiled log (server executable file/package name, codec name, scratch groups) meets your expectations.

Even if the engine is generated by the information configuration stored in the server software package, you must include all the codecs on the server in your software package path. If no decoder package is required, compilation fails. If you have a decoder package different from the one used to compile the server, you will receive a warning.


5.2.1 advanced engine Creation

The engine. createfromserver () method in the preceding configuration example applies to codec engine 2.00, which replaces the lower-level engine. Create () method for the most common use cases.

The lower-level engine creation method allows you to add non-local codecs, use different names for remote codecs, and omit the codecs you do not have. You may need it in some advanced use cases. The following example uses the lower-level engine. Create () method:

/* get various codec modules; i.e., implementation of codecs */var VIDDEC_COPY =     xdc.useModule('ti.sdo.ce.examples.codecs.viddec_copy.VIDDEC_COPY');var VIDENC_COPY =    xdc.useModule('ti.sdo.ce.examples.codecs.videnc_copy.VIDENC_COPY');/*  ======== Engine Configuration ========  */var Engine = xdc.useModule('ti.sdo.ce.Engine');var myEngine = Engine.create("video_copy", [    {name: "videnc_copy", mod: VIDENC_COPY, local: false},    {name: "viddec_copy", mod: VIDDEC_COPY, local: false}]);myEngine.server = "./video_copy.x64P";/*  ======== Server memory map (DSPLINK) configuration ======== *  This table must match exactly the addresses and sizes of segments in the Server’s *  BIOS configuration (.tcf) script. There is exactly one "main", one "link", and *  one "reset" segment type, and zero or more of "other" types. */myEngine.armDspLinkConfig = {    memTable: [        ["DDRALGHEAP", {addr: 0x88000000, size: 0x07A00000, type: "other"}],        ["DDR2",       {addr: 0x8FA00000, size: 0x00400000, type: "main" }],        ["DSPLINKMEM", {addr: 0x8FE00000, size: 0x00100000, type: "link" }],        ["RESETCTRL",  {addr: 0x8FF00000, size: 0x00000080, type: "reset"}],    ],};

In addition, the characters displayed in bold are the places you may need to change in the application.


5.3 understand engine configuration syntax

The syntax used in engine configuration is based on JavaScript. It can also be used to statically configure the tconf language of DSP/BIOS. (See spru007 for details .)

Different from JavaScript used in Web pages, an object model is provided to meet engine configuration requirements. This object model is recorded in the configuration reference document ce_install_dir/xdoc/index.html.

For example, the following statement causes the configuration script to provide a global module in the TI. SDO. Ce. osal software package. Set the runtimeenv attribute of the global module dsplink_linux. This indicates that applications using this engine can use DSP/BIOS link and Linux operating environment.

var osalGlobal = xdc.useModule( 'ti.sdo.ce.osal.Global' );osalGlobal.runtimeEnv = osalGlobal.DSPLINK_LINUX;

To view other options of the runtimeenv attribute, follow these steps:

1) Open ce_install_dir/xdoc/index.html to view the configuration reference. This document depends on your browser. You may need to enable the activity content to view the node list on the left.

2) Click the TI. SDO. Ce. osal package link.

3) Click the global module link.

4) you can see the valid settings of runtimeenv and other global module documents.

5) Click "back" in the upper-right corner of the window ". Note that the back button in the browser may not return to the online help system as expected.

After the runtime environment is set, the configuration file ceapp. cfg in the example gets the permission to access the required Codec Module. For example:

var VIDDEC_COPY =    xdc.useModule('ti.sdo.ce.examples.codecs.viddec_copy.VIDDEC_COPY');

This statement uses the viddec_copy module in the "TI. SDO. Ce. Examples. codecs. viddec_copy" package and stores the handle with a variable named viddec_copy. You can obtain the corresponding Video Encoder by using similar statements. You can modify these statements to reference any codec engine codecs.

Source of the original article link http://blog.csdn.net/dyzok88/article/category/2786543, reproduced please indicate the source!

The Ti. SDO. Ce. Examples. codecs. viddec_copy package corresponds to ce_install_dir/examples/Ti/SDO/CE/examples/codecs/viddec_copy, and viddec_copy matches the Upload File name in the directory.

The content of the next statement declaration engine.

var Engine = xdc.useModule('ti.sdo.ce.Engine');var vcr = Engine.create("video_copy", [    {name: "videnc_copy", mod: VIDENC_COPY, local: false},    {name: "viddec_copy", mod: VIDDEC_COPY, local: false}]);

First, the engine module in the TI. SDO. CE software package is provided to the script. Then, use the CREATE () method of the engine module to create an engine. As in the global module of the Ti. SDO. Ce. osal software package, you can use the configuration reference online help to obtain detailed information about the engine module of the Ti. SDO. CE software package.

Each engine has a name used by application engineers to call the engine_open () API. The engine name is "video_copy ".

An array of the prediction algorithm description of the create method. Each algorithm description includes the following members:

1. Name. This string specifies the "local" name used by the Application Engineer to identify the algorithm that uses videnc_create and viddec_create visa API function instantiation.

2. Mod. This member is a reference to identify the algorithm instance implemented by the actual module. This is the variable name declared like the previous statement. This variable calls xdc. usemodule to obtain the TI. SDO. Ce. Examples. codecs. viddec_copy.viddec_copy module.

3. Local. If it is true, the algorithm is instantiated to the "local" CPU. Otherwise, the decoder server creates a remote algorithm (determined by MoD) instance.


5.3.1 framework component configuration

Sample configuration file-remote. CFG (for GPP + DSP) and local. CFG (for GPP-only and DSP-only)-ti. SDO. FC. dskt2.dskt2 and Ti. SDO. FC. dman3.dman3 modules are all part of the framework components. Dskt2 is the memory allocation manager of the xdais algorithm, while dman3 is the DMA manager. For more information about how to configure these modules, see the framework component file in ce_install_dir/xdoc/index.html.

Codec Engine Integration (end)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.