SPRAA56

Most current encoders use three primary frame types: Intracoded frames, Predicted frames, and Bidirectional predicted frames. These are referred to as I, P, and B frames. The H.263 encoder supplied with the example application encodes I and P frames only, but you can configure the ratio of I to P frames. Often this ratio is used in the quality vs. bitrate tradeoff. The H.263 encoder has hooks to allow for monitoring or selecting the frame type. This example application only monitors the frame type, and can be configured to display benchmark information on every I frame, for example.

Hooks for manipulating the Q (quantization) factor are provided with the H.263 algorithm in this example, but they are not modified after startup in this example. The encoder does not provide hooks for viewing statistics on the actual Q factor, so although this benchmark may be desirable in many applications, its measurement is not possible unless the algorithm provider provides API access to its status.

For many video applications, the encoders and decoders are purchased from third parties. The level of visibility and control accessible via APIs should be a factor considered when choosing algorithms, depending on the system's needs for control and benchmarking. Some applications require minimal control of the encoder (for example, to set the target bitrate), while other applications require more advanced control.

The percentage of macroblocks that are intracoded is another benchmark that could potentially be useful. Some encoders can report this benchmark, but the H.263 encoder algorithm used in this application does not. This number is the percentage of blocks for which no suitable motion vector could be found to describe the motion of that block from its location in a previous frame.

When a macroblock is intracoded, it is encoded independently of any other frame, as opposed to being encoded as a difference from a block in a previous frame. The larger the percentage of macroblocks intracoded, the higher the CPU performance required to encode that frame. A high percentage often occurs for video with rapid movement or scene changes.

4.9Methods for Transmitting Measured Performance Data

In the modified example, variables to enable benchmarking are contained in a single data structure for each stage: benchVideoCapRta, benchVideoProcRta, and benchVideoDisRta. The benchmarking structure for processing is shown below:

typedef struct BenchVideoProcRta {

BenchTime

timeProcess;

BenchTime

timeLastIframe;

BenchTime

busUtilization;

BenchTime

bitBucketSize;

BenchVal

frameProcessCount;

Int

frameType;

BenchVal

controlledFrameSkip;

BenchVal

framesDropped;

BenchVal

cpuLoad;

} BenchVideoProcRta;

 

Similar structures are defined for run-time control of processing, and for benchmarking the capture and display tasks. An instance of the BenchVideoProcRta structure type is declared globally in tskProcess.c for use by the benchmarking routines.

18DSP/BIOS Real-Time Analysis (RTA) and Debugging Applied to a Video Application

Page 18
Image 18
Texas Instruments SPRAA56 appendix Methods for Transmitting Measured Performance Data