Texas Instruments SPRAA56 appendix Methods for Transmitting Measured Performance Data

Page 18

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

Image 18
Contents Viewing Benchmarks in the Instrumented Application Modifications to the Base ExampleRTA Techniques for Performance Measurement References Appendix A. Performance ImpactImportant Benchmarks for Video Applications FiguresBase Application Overview SPRAA56TskInput DSP/BIOS and RF5 Components Used 1 LOG2 STS 3 TRC4 UTL Modifications to the Base Example Requirements for Viewing RTA BenchmarksSplitting the Encode and Decode CELLs Adding the Control TSK and MBX CommunicationQuerying the H.263 Encoder for Status TskInputTskO utput Controlling the Frame Rate RTA Techniques for Performance Measurement Measuring Function Execution Time with the UTL ModuleMeasuring Task Scheduling Latencies Measuring End-to-End LatenciesMeasuring the Frame Rate Programmatic Measurement of Total CPU Load Memory Bus Utilization 14,400 B 720*480 = 345,600 B86,400 B External memoryBitrate and Frame Type Methods for Transmitting Measured Performance Data Viewing Benchmarks in the Instrumented Application Application-Specific Control via GEL Scripts in CCStudioRequirements Running the Application Load the h263loopbackrta.out programSPRAA56 Interpreting the Benchmarks Expected Values for the STS Objects Expected and Measured STS Benchmarks Controlling the Run-Time Parameters Dynamically Debug ModeExpected Values Delivered to the Message Log Expected and Measured Logged BenchmarksReferences Capture and Display Task BenchmarkingRTA Effects on CPU Load Appendix A. Performance ImpactOverhead of Performance Measurement Techniques Measured Performance of Benchmarking TechniquesMemory Footprint Memory Footprint DetailsImportant Notice