Texas Instruments Codec Engine Server manual Controlling I/O Buffer Caching for xDM 0.9 Codecs

Models: Codec Engine Server

1 36
Download 36 pages 9.54 Kb
Page 27
Image 27
2.2.3.1Controlling I/O Buffer Caching for xDM 0.9 Codecs

Creating a Codec Server

2.2.3.1Controlling I/O Buffer Caching for xDM 0.9 Codecs

The DSP server's support—the "skeletons"—for remote execution of codecs written for xDM 0.9 always manages the cache for all codec I/O buffers exchanged with the ARM application.

This can be a performance problem for some video codecs, where the codec accesses the buffers exclusively via DMA, yet the generic skeleton invalidates and flushes those buffers anyway, thus wasting up to a few milliseconds for every frame. (In xDM 1.0 codecs, this cache management is negotiated automatically.)

To disable management for specific buffers, you need to determine the type of buffer and its number, then set the cache management field for the buffer to "false", as shown in the following example.

The first step is to determine the buffer type. Supported buffer types are: "in" and "out" for both video encoders and video decoders, "recon" (short for reconstruction) for video encoders, and "display" for video decoders.

Next, determine the number of the buffer you want to manage. Buffers are numbered 0 to 15. You're typically looking for buffer number 0 or 1.

Finally, set the buffer's cache management field to "false" as shown in this example:

var H264ENC = xdc.loadModule( "ti.sdo.codecs.h264enc.H264ENC" );

//don't cache-manage inbuf #0: H264ENC.manageInBufsCache[0] = false;

//don't cache-manage outbuf #1: H264ENC.manageOutBufsCache[1] = false;

//don't manage any of the reconstruction buffers:

H264ENC.manageReconBufsCache = [ false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false ];

The cache management array names are:

For video encoder modules. manageInBufsCache[], manageOutBufsCache[], manageReconBufsCache[], each with elements 0..15.

For video decoder modules. manageInBufsCache[], manageOutBufsCache[], manageDisplayBufsCache[], each with elements 0..15.

Always check with a codec producer first to determine whether it is safe to turn off cache management for certain buffers. When it comes to cache mis-management, things might appear to work on your system for some data and in some configurations, but will not work for other data and configurations (that your customer may use).

Configuring a Codec Server

2-11

Page 27
Image 27
Texas Instruments Codec Engine Server manual Controlling I/O Buffer Caching for xDM 0.9 Codecs