![background image](http://html.mh-extra.com/html/texas-instruments/dsp-bios-real-time-analysis/dsp-bios-real-time-analysis_user-manual_1097127009.webp)
SPRAA56
DSP/BIOS Real-Time Analysis (RTA) and Debugging Applied to a Video Application
9
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
Device
Driver
Device
Driver
Buffer
3 frames
YAfter420
414 KB
CrAfter420
Y uv
422to
420
CbAfter420
Y uv
422to
420
207 KB
y
414 KB
Cb
CbArrau
207 KB
Cr
bitBuf
512 KB
92 KB
6 KB
1.5 KB
scratch2
14 KB
scratch1
14 KB = 20 lines
Shared
Scratch
Instance
m em ory
Instance
m em ory
H .263
dec
H .263
enc
tskProcess
tskInput
tskO utput
tskControl
Buffer
3 frames
Buffer
3 frames
Figure 3. Task Partitioning in the Modified Application
3.3 Querying 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);