Texas Instruments SPRAA56 User Manual
Size:
402.53 Kb
Download

Application Report

SPRAA56 – September 2004

DSP/BIOS Real-TimeAnalysis (RTA) and Debugging Applied to a Video Application

Brian Jeff

DSP Field Software Applications

Arnie Reynoso

Software Development Systems

ABSTRACT

DSP/BIOS and the Reference Frameworks allow developers to non-intrusivelyinstrumentreal-timeapplications. The software provided with this application note appliesreal-timeanalysis (RTA) services to a working application a H.263 encode/decode loopback example for the TMS320DM642 evaluation module. The software demonstrates techniques for benchmarking and controlling video software. It also introduces a service to programmatically measure CPU and TSK loading. Debugging and troubleshooting techniques forreal-timeapplications, using Code Composer Studio, is also discussed.

 

 

Contents

 

1 Important Benchmarks for Video Applications..........................................................................

2

2

Base Application Overview .........................................................................................................

3

 

2.1

DSP/BIOS and RF5 Components Used..................................................................................

5

 

2.2

Requirements for Viewing RTA Benchmarks ..........................................................................

7

3 Modifications to the Base Example.............................................................................................

7

 

3.1

Splitting the Encode and Decode CELLs ................................................................................

8

 

3.2

Adding the Control TSK and MBX Communication .................................................................

8

 

3.3

Querying the H.263 Encoder for Status ..................................................................................

9

 

3.4

Controlling the Frame Rate...................................................................................................

10

4 RTA Techniques for Performance Measurement .....................................................................

11

 

4.1

Measuring Function Execution Time with the UTL Module ...................................................

11

 

4.2

Measuring Task Scheduling Latencies .................................................................................

12

 

4.3

Measuring End-to-End Latencies..........................................................................................

12

 

4.4

Measuring the Frame Rate ...................................................................................................

13

 

4.5

Simulating High CPU Load Stress Conditions with Dummy NOP Loads...............................

14

 

4.6

Programmatic Measurement of Total CPU Load...................................................................

14

 

4.7

Memory Bus Utilization .........................................................................................................

15

 

4.8

Bitrate and Frame Type ........................................................................................................

17

 

4.9

Methods for Transmitting Measured Performance Data........................................................

18

 

4.10 Application-Specific Control via GEL Scripts in CCStudio.....................................................

19

5 Viewing Benchmarks in the Instrumented Application ...........................................................

19

 

5.1

Requirements .......................................................................................................................

19

 

5.2

Running the Application........................................................................................................

20

 

5.3

Interpreting the Benchmarks.................................................................................................

22

 

5.4

Controlling the Run-Time Parameters Dynamically...............................................................

25

6

References..................................................................................................................................

26

Appendix A. Performance Impact.....................................................................................................

27

 

A.1

Overhead of Performance Measurement Techniques...........................................................

27

 

A.2

RTA Effects on CPU Load ....................................................................................................

27

 

A.3

Memory Footprint .................................................................................................................

28

1

SPRAA56

 

 

Figures

 

Figure 1. Basic Data Flow of the Video Application......................................................................

4

Figure 2. Detailed Application Data Flow Showing Memory Buffers ...........................................

8

Figure 3. Task Partitioning in the Modified Application ...............................................................

9

Figure 4.

CPU Load Measurement at Run-Time ..........................................................................

15

Figure 5.

External Internal Memory Transfers, YUV4:2:0 to 4:2:2 Conversion Function ....

16

Figure 6.

Workspace Including RTA Windows............................................................................

22

Figure 7.

Statistics View Showing Benchmark Measurements..................................................

23

1Important Benchmarks for Video Applications

Diverse video applications often require similar benchmarks to quantify their performance. Some of the most commonly needed benchmarks are as follows:

Frame rate

Resolution

End-to-endlatency

Processor utilization

Bitrate*

Quantization factor*

Frame type*

Group-of-pictures(GOP) structure*

Items marked with an asterisk are of importance in applications where encoders or decoders are involved. This application note provides a method for measuring many of these benchmarks during the capture, processing, and display phases of the example video application.

Frame rate is the rate at which frames are captured, processed, and displayed. The capture, process, and display frame rates can differ by design or under overloaded conditions where frames are dropped. Therefore, it is important to measure all three frame rates separately.

Resolution is the size in pixels of the capture, processing, and display. Resolution is typically static at run-time,so it is not usually benchmarked withreal-timetools. However, it is important to know the capture, processing, and display resolutions of the system design. For example, the H.263 loopback application used in this application note captures and displays video in D1 resolution and processes in 4CIF resolution.

End-to-endlatency is a measurement of the time between the capture of a video frame in realtime and the display of that same video frame some number of milliseconds later.

Processor utilization is the percentage of DSP resources used by an algorithm. In video applications, the significant benchmarks of processor utilization include not only the number of CPU cycles used, but also the memory bus utilization since such large amounts of data must be moved from external memory to L2 and back repeatedly.

Bitrate is the number of bits per second output by a video encoder, or delivered to a video decoder. Higher bitrates are generally associated with higher quality video. The bitrate often varies with the complexity and motion in a video source, so it is important to measure bitrate dynamically in video applications.

2

DSP/BIOS Real-TimeAnalysis (RTA) and Debugging Applied to a Video Application