Texas Instruments SPRAA56 appendix Bitrate and Frame Type

Page 17

SPRAA56

These estimates are fairly accurate for the color conversion functions in the input and display tasks, but the estimates are less accurate for the encoder and decoder algorithms in the processing task. Ideally, the memory bus utilization should be available in the status structure or estimated on the data sheet of an algorithm. It is recommended that you request this information from third-party algorithm providers during application development, particularly for applications above D1 (720x480) resolution.

The estimates of the memory bus utilization of the algorithms and major functions in the system are defined in rtaVideodebug.h as:

#define EST_ENCODE_BUSUTIL_IN_FRAMES 2.5 #define EST_DECODE_BUSUTIL_IN_FRAMES 2.5 #define EST_CAP_BUSUTIL_IN_FRAMES 3.5 #define EST_DIS_BUSUTIL_IN_FRAMES 3.5

The number 2.5 * frame size (in pixels) was chosen for the encoder and decoder as an estimate of the bus utilization. Actual values may vary, so you can modify this estimate, or can replace it with an actual calculation if the algorithm can provide that data in its status structure.

The bus utilization benchmarks are reset by the benchmarking routines every 30 frames, and are logged to the STS object named sts+”task”+BusUtil for viewing in the DSP/BIOS Statistics View tool. This results in a bus utilization statistic in bytes per second.

4.8Bitrate and Frame Type

Bitrate is important in applications that do encoding or decoding. The bitrate of encoded video often varies greatly with different video content, increasing to high values during periods of high motion and image complexity, and decreasing to low values during relatively still video with less image complexity. Encoder applications must trade off bitrate for quality, so the capability to accurately measure and monitor bitrate is an important tool for video system designers.

This example provides a mechanism for real-time bitrate measurement and control. This is possible because the H.263 encoder algorithm used by the application allows control and monitoring of the bitrate.

#ifdef RTA_INCLUDED

while( MBX_pend( &mbxProcess, &rxMsg, 0) ) // poll with zero timeout value, which // returns zero right away if no message is available

{

switch(rxMsg.cmd) { case BITRATECHANGED:

h263encParams.bitRate = rxMsg.arg2; // controlVideoProc.bitRateTarget from GEL H263ENC_cellControl(&(chanHandle->cellSet[CELLH263ENC]), IH263ENC_SETPARAMS,

(void *)&h263encParams);

break;

case FRAMERATECHANGED:

frameRateTarget = rxMsg.arg2; // controlVideoProc.bitRateTarget from GEL h263encParams.frameRate = frameRateTarget; H263ENC_cellControl(&(chanHandle->cellSet[CELLH263ENC]), IH263ENC_SETPARAMS,

(void *)&h263encParams);

break;

}

}// end polling of MBX #endif // #ifdef RTA_INCLUDED

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

17

Image 17
Contents RTA Techniques for Performance Measurement Modifications to the Base ExampleViewing Benchmarks in the Instrumented Application References Appendix A. Performance ImpactFigures Important Benchmarks for Video ApplicationsSPRAA56 Base Application OverviewTskInput 1 LOG DSP/BIOS and RF5 Components Used4 UTL 2 STS3 TRC Requirements for Viewing RTA Benchmarks Modifications to the Base ExampleAdding the Control TSK and MBX Communication Splitting the Encode and Decode CELLsTskO utput Querying the H.263 Encoder for StatusTskInput Controlling the Frame Rate Measuring Function Execution Time with the UTL Module RTA Techniques for Performance MeasurementMeasuring End-to-End Latencies Measuring Task Scheduling LatenciesMeasuring the Frame Rate Programmatic Measurement of Total CPU Load Memory Bus Utilization 86,400 B 720*480 = 345,600 B14,400 B External memoryBitrate and Frame Type Methods for Transmitting Measured Performance Data Requirements Viewing Benchmarks in the Instrumented ApplicationApplication-Specific Control via GEL Scripts in CCStudio Load the h263loopbackrta.out program Running the ApplicationSPRAA56 Interpreting the Benchmarks Expected Values for the STS Objects Expected and Measured STS Benchmarks Expected Values Delivered to the Message Log Debug ModeControlling the Run-Time Parameters Dynamically Expected and Measured Logged BenchmarksCapture and Display Task Benchmarking ReferencesOverhead of Performance Measurement Techniques Appendix A. Performance ImpactRTA Effects on CPU Load Measured Performance of Benchmarking TechniquesMemory Footprint Details Memory FootprintImportant Notice