Japanese
PROGRAMMER'S GUIDECD communication I/F (MPEG part)
BackForward
CD communication I/F (MPEG part)

6. Other MPEG features


6.1 MPEG display screen
(framebuffer window and display window)

Screen display in the MPEG system is performed by outputting data in a frame buffer window to a display window. Figure 6.1 shows the relationship between each window.

Figure 6.1 Frame buffer window and display window

(1) Frame buffer window
The display data rectangular area within the frame buffer is called a frame buffer window.
The following values can be set for frame buffer windows:

  1. Position (fpx, fpy):

  2. Frame buffer window top left coordinate ( CDC_MpSetWinFpos )

  3. Magnification rate (frx, fry):

  4. Frame buffer window magnification ( CDC_MpSetWinFrat )

However, the actual formula for calculating the frame buffer window size is not a simple multiplication of the display window size and the magnification ratio.

(2) Display window
The rectangular area actually displayed on the TV monitor is called a display window.
The following values can be set for display windows:

  1. Position (dpx, dpy):

  2. Display window top left coordinate ( CDC_MpSetWinDpos )

  3. Size (dsx, dsy):

  4. Display window size ( CDC_MpSetWinDsiz )

  5. Offset (dox, doy):

  6. Position of display area on TV monitor ( CDC_MpSetWinDofs )

"remarks"
The window size and coordinate values set here are unrelated to the settings for VDP2.

6.2 MPEG Frame Buffer

6.2.1 Extracting image data
Image data generated in the MPEG frame buffer can be retrieved to the host through MPEG registers.
The image data retrieved is not the frame buffer window data itself, but the same data as the display window image.

Figure 6.2 Extracting image data

(1) Image data format
The image data is reduced to 32K color data in 15-bit RGB555 format.

(2) Retrieving image data (CDC_MpGetImg)
Issue the command when the image output preparation is complete. After issuing the command, the host transfers and retrieves the data from the MPEG register.
The output destination of image data must be set to host output. (Invalid for VDP2 output)
This function is valid in both video playback mode and still image playback mode.

6.2.2 Reading and writing image data
(Image data window)
The MPEG frame buffer consists of four frame banks at normal resolution and one frame bank at high definition resolution.
In still image playback mode, image data can be read and written between the image data window defined in the frame bank and the buffer section.

Figure 6.3 Reading and writing image data

(1) Image data window
The image data window can be set for any frame bank among frame banks 0 to 3. (Fixed frame bank to 0 when using high-definition resolution)
The following values can be set for image data windows:

  1. Location (ipx, ipy):

  2. Top left coordinate of image data window (CDC_MpSetImgPos)

  3. Size (isx, isy):

  4. Image data window size (CDC_MpSetImgSiz)

Figure 6.4 Image data window

(2) Image data format
Image data is decomposed into YCC4:2:0 format luminance/color difference data (the following three elements).

To read and write, it is necessary to assign a selector (aperture and buffer section) to each element.

(3) Reading image data (CDC_MpReadImg)
Loads image data from the image data window into the buffer section by specifying the destination aperture number.
Image data is treated as a mode 2 form 1 sector in the buffer section and stored in the user data area (2048 bytes). The first 24 bytes are filled with 0, and the area after the user data is undefined.

Figure 6.5 Loading from the image data window

(4) Exporting image data (CDC_MpWriteImg)
Writes image data from the buffer section to the image data window by specifying the source buffer section number.

Figure 6.6 Export to image data window

(5) Selector settings
The selector settings required when reading and writing image data must be done on the host side using the CD communication interface. (Clearing the buffer section, connecting the aperture and buffer section, etc.) No selector settings are made on the CD block side.

6.3 MPEG sector buffer

In MPEG sector buffer mode, the MPEG buffer is used as an MPEG sector buffer. This function allows the memory inside the MPEG cartridge to be freely used as a data storage area when the MPEG decoder is not in use.
Access to the MPEG sector buffer is performed by reading and writing sector data (2048 bytes) to and from the CD buffer.
The total number of MPEG sectors is 256. (Does not depend on NTSC/PAL.)

(1) Reading sector data (CDC_MpReadSct)
Specify the read destination aperture number and read sector data from an arbitrary MPEG sector position in the MPEG sector buffer into the buffer section.
MPEG sector data is handled as a mode 2 form 1 sector in the buffer section and is stored in the user data area (2048 bytes). The first 24 bytes are filled with 0, and the area after the user data is undefined.

Figure 6.7 Reading from MPEG sector buffer

(2) Writing sector data (CDC_MpWriteSct)
Specify the write source buffer partition number and write sector data from the buffer partition to an arbitrary MPEG sector position in the MPEG sector buffer.

Figure 6.8 Writing to MPEG sector buffer

6.4 REJECT and WAIT for MPEG commands

(1) REJECT by operation mode
Table 6.1 shows the conditions under which an MPEG command becomes REJECT depending on the MPEG operation mode and the output destination of image data.

Table 6.1 Conditions for MPEG command to become REJECT
function name MPEG operation mode Image data output destination
CDC_MpGetImg - VDP2 output
CDC_MpReadImg , CDC_MpWriteImg Other than still image playback mode -
CDC_MpReadSct , CDC_MpWriteSct Other than MPEG sector buffer mode -

(2) LONG WAIT and SHORT WAIT
WAIT for MPEG commands includes LONG WAIT and SHORT WAIT.
LONG WAIT occurs when a command that cannot be executed in the current MPEG operation mode or MPEG status is issued. The host should retry (re-execute) after these conditions have changed.
SHORT WAIT occurs when a specific command is issued while the internal state of the CD block is changing. The host should retry several times at intervals of 50 μsec or more.

Table 6.2 Factors that cause LONG WAIT

CDC_MpSetDec
Pause or freeze was set when the video was in the recovery process.

CDC_MpOutDsync
The decode timing is VSYNC synchronized.

CDC_MpSetCon
A connection destination buffer section was already set, but it was set again.
The current connection destination was canceled when the video or audio operating state was playback, switching, or restoration processing.
The next connection destination was canceled when the video or audio operating status was switched.

CDC_MpChgCon
Switching was performed when the next destination buffer partition was not registered. The operating state is not playing.

CDC_MpSetStm
The video or audio operating state is in a switching state.

CDC_MpGetImg
The MPEG/Video status output ready flag is 0.

Table 6.3 Functions that can cause SHORT WAIT

When a WAIT occurs, first remove the cause of the LONG WAIT, and if the WAIT still does not resolve, retry the SHORT WAIT.


BackForward
PROGRAMMER'S GUIDECD communication I/F (MPEG part)
Copyright SEGA ENTERPRISES, LTD., 1997