Texas Instruments SPRAA56 appendix Querying the H.263 Encoder for Status, TskInput, TskO utput

Page 9

SPRAA56

if(controlVideoProc.frameRateChanged) { txMsg.cmd = FRAMERATECHANGED; txMsg.arg1 = chanNum;

txMsg.arg2 = controlVideoProc.frameRateTarget; controlVideoProc.frameRateChanged = FALSE; MBX_post( &mbxProcess, &txMsg, 0 );

}

While implementing control via the host PC did not specifically require a separate task in the modified application, adding a discrete control task makes the application more scalable. For example, a user interface or communications link from another processor could send control commands to a DSP-based video system. The control task could then service that user interface or communications link. In the modified example, the control task simply monitors a global structure for commands, and sends appropriate commands to the processing task if necessary.

The priority of the control TSK is set to a lower level than that of the tskVideoProcess, tskInput, and tskOutput TSKs. This prevents the control task from adding latency or CPU overhead when responding to control commands. The control commands are only serviced at times when the three TSKs in the data stream are all in the blocked state and the processor would normally be running its background loop.

Figure 3 shows the task partitioning added to the application flow in Figure 2.

Device Driver

Buffer 3 frames

 

YAfter420

 

414 KB

Y uv

 

422to

 

420

CbAfter420

 

CrAfter420

 

207 KB

scratch1

 

14 KB = 20 lines

tskInput

 

bitBuf

 

y

 

 

 

414 KB

 

 

512 KB

 

 

 

 

 

 

 

 

 

 

Y uv

H .263

 

H .263

Cr

422to

 

420

enc

 

dec

CbArrau

 

 

 

 

Shared

 

 

 

 

Scratch

 

Cb

 

6 KB

92 KB

1.5 KB

207 KB

 

 

scratch2

Instance

 

Instance

 

memory

 

memory

 

14 KB

tskProcess

tskO utput

tskControl

 

 

 

Device

Driver

Buffer

3 frames

Figure 3. Task Partitioning in the Modified Application

3.3Querying the H.263 Encoder for Status

The third change made to the base application was the use of a run-time API call to query the algorithm as to its status after each frame. The eXpressDSP algorithm standard (xDAIS) states that algorithms should provide a control API such as the following.

H263ENC_cellControl(&(chanHandle->cellSet[CELLH263ENC]), IH263ENC_GETSTATUS, (IALG_Status *) &encStatus);

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

9

Image 9
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 Used2 STS 3 TRC4 UTL Requirements for Viewing RTA Benchmarks Modifications to the Base ExampleAdding the Control TSK and MBX Communication Splitting the Encode and Decode CELLsQuerying the H.263 Encoder for Status TskInputTskO utput 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 Viewing Benchmarks in the Instrumented Application Application-Specific Control via GEL Scripts in CCStudioRequirements 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