User`s manual

136 Reference Manual
OSD Frame
An OSD frame is made up with at least one OSD string and one
OSD_EOF. An OSD string starts with a ST_CD which is followed
by a series of font base addresses, and ends with an OSD_EOS.
An example is shown as follows:
ST_CD: 16-bit, as the macroblock coordinate (x, y) for the first
font of this string.
ST_CD[15:8] = y, ST_CD[7:0] = x.
Example: Preview window is 720*480, max value of X is 720/
16-1=44, max value of Y is 480/16-1 = 29.
ADDRx: 16-bit, as the base address for the its font of this string
Notes: n in ADDRn is from 0 to 93.
OSD_EOS: 0x0000
OSD_EOF: 0xAAAA.
OSD Algorithm
Before encoding each macroblock, the firmware makes an OSD
function call. In this call, the chip decides if the current macroblock
has an OSD font over it. If so, it obtains this font’s base address
and sends it to the DMA controller. Then, a 32-DWORD bitmap of
this font will be overlapped to that macroblock. At the first macrob-
lock (0, 0) of each video frame, the firmware determines which
buffer (index_buffer1 or index_buffer2) is in use. The firmware
keeps comparing the ST_CD of each OSD string with current mac-
roblock’s coordinate until they match. After getting ST_CD, the
firmware reads the next base address and sends it to the DMA
controller, until an OSD_EOS is met.
ST_CD ADDR0 ADDR1 ADDRn OSD_EOS ST_CD ADDR0 OSD_EOS OSD_EOF