Texas Instruments SPRAA56 appendix TskInput

Page 4

SPRAA56

Figure 1 shows a simplified view of the sequential flow of capture, processing, and display tasks in the application.

Camera

TSK

tskInput

Device

Driver

TSK

tskVideoProcess

SCOM

TSK

tskOutput

Device Driver

Figure 1. Basic Data Flow of the Video Application

Before video data reaches the first stage, it must be converted to digital data, a process that is managed by the input device driver. Analog video input is converted by an on-board NTSC decoder chip into a digital bitstream compliant with the BT.656 format with embedded synchronization. The decoder chip sends the bitstream to the TMS320DM642 DSP’s video port. A device driver, implementing the IOM interface recommended in the DSP/BIOS Driver Developer’s Guide (SPRU616), is used to manage the initialization and synchronization of the EDMA channel, the video port, and the NTSC decoder used for video capture.

In Figure 1, TSK refers to a DSP/BIOS task, which is described in detail in the DSP/BIOS User's Guide and the DSP/BIOS API Reference. Tasks support blocking calls, which are used to synchronize the application and the video data stream. The main data flow then has three stages: capture, processing, and display. Each stage has its own task object.

The example’s first stage is a task called tskInput, which runs the tskVideoInput function. The task receives digital video buffers from the device driver. It then converts the buffers to the 4:2:0 format from the 4:2:2 formatted data it receives from the driver.

The next stage, the tskVideoProcess task, which runs the tskProcess function. The task includes algorithms that require input data in the 4:2:0 format. The tskInput task sends a message to the tskVideoProcess task with pointers to the newly formatted data buffers. The tskVideoProcess task then calls an xDAIS-compliant H.263 encoder algorithm to compress the data, which is stored in an intermediate buffer. A second xDAIS-compliant algorithm, an H.263 decoder, is called to decode the data in the buffer.

The tskOutput task runs the tskVideoOutput function. It converts the data back to 4:2:2 format as required by the output driver and the NTSC encoder chip, and calls the driver with the data buffer for display. The output driver is also an eXpressDSP compliant device driver with the same API interface as the input driver.

Data is passed between the tasks using SCOM messaging objects to pass the pointers and synchronization semaphore required to ready the output task. The SCOM module is from Reference Framework 5, which is described in the next section.

4

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

Image 4
Contents Modifications to the Base Example RTA Techniques for Performance MeasurementViewing Benchmarks in the Instrumented Application 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 720*480 = 345,600 B 86,400 B14,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 Debug Mode Expected Values Delivered to the Message LogControlling the Run-Time Parameters Dynamically Expected and Measured Logged BenchmarksReferences Capture and Display Task BenchmarkingAppendix A. Performance Impact Overhead of Performance Measurement TechniquesRTA Effects on CPU Load Measured Performance of Benchmarking TechniquesMemory Footprint Memory Footprint DetailsImportant Notice