SPRAA56
The
The corresponding code in the video output task finishes the benchmark once the frame has propagated through the system:
if (!benchCapVid.captodisplay.done) { // benchVideoDisRta.captodisplay benchCapVid.captodisplay.latency
=CLK_getltime() - benchCapVid.captodisplay.latency;
//current time - last captured frame timestamp = latency
UTL_logDebug2("Latency = %d [ms], for frame %d ", benchCapVid.captodisplay.latency, benchCapVid.captodisplay.frameNum );
benchCapVid.captodisplay.done = 1;
}
Note that this measurement does not include the latency introduced by the capture and display drivers. Similar techniques could be applied, using the UTL or STS APIs, to measure the driver latency, however this would require modifying and rebuilding the driver, which is outside the scope of this application note. To measure the total
4.4Measuring the Frame Rate
Frame rate is the rate, in frames per second or Hz, of the capture, processing, or display of video frames by the system. In video systems it is possible for the display frame rate to exceed the capture and/or processing frame rate, so it is often important to measure it separately for the capture, processing, and display stages in the data stream.
In this example application, the actual frame rate is measured at each stage, and user control of the frame rate is provided for the processing stage.
During periods of peak CPU loading, the processing rate of the DSP can fall below the display rate of the output device, resulting in dropped frames. Dropped frames are frames that were received during capture or decode but not displayed, or frames that were captured but not encoded. Frame dropping can occur when the CPU is overloaded by the processing required for
The VPORT display driver from the DDK is written to handle this condition gracefully. If a new frame is not received from the application in time for the video port to display it, the device driver continues to show the previously displayed frame. With
The following code from the tskProcess function measures the number of dropped frames by subtracting the reference time from the actual time required to capture 30 or 25 frames. The reference time should be approximately 1 second for NTSC or PAL systems, respectively.
DSP/BIOS | 13 |