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

Page 10
Image 10
Texas Instruments SPRAA56 appendix Controlling the Frame Rate