Texas Instruments SPRAA56 appendix Controlling the Frame Rate

Page 10

SPRAA56

This call returns a status structure of type IH263ENC_Status that contains the number of bits sent to the encoder, the frame type, and other data.

The features implemented in the control API can vary widely from one algorithm to another. The bitrate and frame type measured by this API may not be available with all third-party video algorithms unless specifically requested. Thus, it is important that the encoder and decoder algorithms used by your application have the necessary hooks to allow complete benchmarking of the end application.

3.4Controlling the Frame Rate

The final structural change made to the base example was the addition of a mechanism for controlling the processing frame rate of the application. This change required the introduction of some counters and a conditional statement to measure the number of frames skipped during the last 30. The conditional statement is shown here:

if( DISPLAYRATE*(frameCnt-frameSkip) > frameCnt*frameRateTarget ) { frameSkip++;

// Tell the capture routine we're done

SCOM_putMsg(fromProctoInput,&(thrProcess.scomMsgRx)); continue;

}

The condition requires that the ratio of the target frame rate to the display frame rate be the same as the ratio of the number of frames currently shown to the number that should be shown at the set target frame rate. If the counters indicate that the ratio is exceeded, then the current captured frame will not be processed or displayed, prompting the display driver to re-display the most recent frame.

The capture frame rate and display frame rate are left unchanged at DISPLAYRATE, which is set to 30 frames for second in NTSC applications or 25 frames per second in PAL applications. Because the capture driver is using external memory bandwidth to copy unused frames from the video port FIFO to external buffers, it may be desirable or necessary to control the frame rate at the driver to eliminate this overhead. The frame rate control allows you to quickly evaluate the visual quality of an encoder and decoder when using a lower frame rate.

The frame rate target can be controlled at runtime from a GEL script. Code Composer Studio’s General Extension Language (GEL) provides a message for script-based control of most of the debugger functions available in CCStudio. You can also manipulate variables on the target using GEL, though this briefly halts the processor to update the value.

The GEL file included with the modified application is h263rateControl.gel. It provides sliders and dialog boxes to control bitrate, frame rate, and other application parameters. Its control is implemented by manipulating flags and variables in a global structure visible to the tskVideoProcess and tskControl tasks. The control task passes bitrate and frame rate control messages to the processing task, while other manipulations are handled directly by tskVideoProcess.

The remaining changes to the application are not structural in nature. Instead, they consist of short API calls added for run-time benchmarking. These remaining modifications are therefore described in the next section on RTA techniques.

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

Image 10
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 LOG3 TRC 2 STS4 UTL Modifications to the Base Example Requirements for Viewing RTA BenchmarksSplitting the Encode and Decode CELLs Adding the Control TSK and MBX CommunicationTskInput Querying the H.263 Encoder for StatusTskO 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 Application-Specific Control via GEL Scripts in CCStudio Viewing Benchmarks in the Instrumented ApplicationRequirements 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