PROGRAMMER'S GUIDECD communication I / F (MPEG part)
Back | ■
CD communication I / F (MPEG part)

8. MPEG function specification


Describe the function specifications of the MPEG communication interface.

(1) Format
In the figure, the unused area is represented by "-". The value of the unused area is 0.

(2) Retention of MPEG status information (status and MPEG report)
The MPEG communication interface holds the status at the time of issuing the MPEG command and the MPEG report. The initial value of the retained contents is all 0.
The functions that update the retention status / MPEG report are indicated by the following symbols.

[SR]: Update status and MPEG report ┐
[S-]: Update only the status ├─────┐
[-]: Do not update (do not issue command) ┘ │
│
<< Example of function title >> ↓
┌───────┬──────────┬────────────────┬────┐
│ Title │ Function │ Function Name [SR] │ No │ No │
│ Function specifications │ MPEG playback │ CDC_MpPlay │ 20.7 │
└───────┴──────────┴────────────────┴────┘

However, nothing is updated at the time of error (when the error code is other than CDC_ERR_OK).

(3) Function that generates WAIT
The functions in which WAIT occurs are shown in the function list with the following symbols.
For WAIT, refer to " 6.4 REJECT and WAIT for MPEG commands ".

[L]: LONG WAIT can occur ┐
[S]: SHORT WAIT can occur ├──┐
[LS]: LONG, SHORT WAIT may occur ┘│
     │
<< Example of function list >> ↓
┌──────────────┬──────────────────┬────┐
│ Decoding method setting │ CDC_MpSetDec [LS] │ 20.8 │
└──────────────┴──────────────────┴────┘

(5) Command end flag (in interrupt cause register)
If there is a related command end flag,
End flag
Describe in the item column.

"example"
End flag
MPED flag

For details on the exclusive processing of command issuance, refer to "Table 3.5 Commands belonging to the command end flag (MPEG part)" and the manual of the CD part.

(6) MPCM flag (in interrupt factor register)
The MPEG communication function, except for some functions, checks the MPCM flag when the command is issued. If the command cannot be issued, the error code CDC_ERR_MP_COMU is returned.
For details on the MPCM flag, refer to " 3.1.2 Indefinite operation section ".

8.1 List of MPEG functions

Table 8.1 shows a list of functions of the MPEG communication interface.

Table 8.1 List of MPEG communication interface functions
function Function name number
MPEG decoder 20.0
Get current MPEG status information CDC_MpGetCurStat 20.1
Get last MPEG status information CDC_MpGetLastStat 20.2
Get MPEG interrupt factor CDC_MpGetInt 20.3
MPEG interrupt mask setting CDC_MpSetIntMsk 20.4
MPEG decoder initialization CDC_MpInit 20.5
MPEG operation mode setting CDC_MpSetMode [S] 20.6
MPEG playback CDC_MpPlay [S] 20.7
Decoding method setting CDC_MpSetDec [LS] 20.8
Sending a decode sync signal CDC_MpOutDsync [LS] 20.9
Get video timecode CDC_MpGetTc [S] 20.10
-Getting the Dio time stamp CDC_MpGetPts 20.11
MPEG stream 21.0
Setting the connection destination of the MPEG decoder CDC_MpSetCon [LS] 21.1
Get the connection destination of the MPEG decoder CDC_MpGetCon 21.2
Switching the connection destination of the MPEG decoder CDC_MpChgCon [LS] 21.3
MPEG stream settings CDC_MpSetStm [LS] 21.4
Get MPEG stream CDC_MpGetStm 21.5
Get stream image size CDC_MpGetPictSiz [S] 21.6
MPEG display screen 22.0
Image display CDC_MpDisp [S] 22.1
Framebuffer window position setting CDC_MpSetWinFpos 22.2
Framebuffer window magnification setting CDC_MpSetWinFrat 22.3
Display window position setting CDC_MpSetWinDpos 22.4
Display window size setting CDC_MpSetWinDsiz 22.5
Display wind offset setting CDC_MpSetWinDofs 22.6
Border color settings CDC_MpSetBcolor 22.7
Fade settings CDC_MpSetFade [S] 22.8
Screen special effects settings CDC_MpSetVeff [S] 22.9
MPEG frame buffer 23.0
Extraction of image data CDC_MpGetImg [L] 23.1
Image data window position setting CDC_MpSetImgPos 23.2
Image data window size setting CDC_MpSetImgSiz 23.3
Loading from the image data window CDC_MpReadImg 23.4
Export to image data window CDC_MpWriteImg 23.5
MPEG sector buffer 24.0
Read sector from MPEG sector buffer CDC_MpReadSct 24.1
Exporting sectors to the MPEG sector buffer CDC_MpWriteSct 24.2

8.2 MPEG function details

8.2.1 MPEG decoder

List
 Title

Function specifications

 Function

Get current MPEG status information

 Function Name [SR]

CDC_MpGetCurStat

 No

20.1

Form
Sint32 CDC_MpGetCurStat (CdcMpStat * mpstat)
input
none
output
mpstat: MPEG status information
Function value
Returns an error code.
function
Get the current MPEG status information.

List
 Title

Function specifications

 Function

Get last MPEG status information

 Function Name [-]

CDC_MpGetLastStat

 No

20.2

Form
Sint32 CDC_MpGetLastStat (CdcMpStat * mpstat)
input
none
output
mpstat: MPEG status information
Function value
Returns an error code.
function
Acquires MPEG status information for the previous MPEG command.

List
 Title

Function specifications

 Function

Get MPEG interrupt factor

 Function Name [S-]

CDC_MpGetInt

 No

20.3

Form
Sint32 CDC_MpGetInt (Sint32 * intreq)
input
none
output
intreq: Interrupt factor (lower 24 bits are valid) …… Refer to the data specification (Intreq)
Function value
Returns an error code.
function
Acquires the interrupt factor of MPEG interrupt.
remarks
The MPEG interrupt factor is cleared to 0 by executing this function.

List
 Title

Function specifications

 Function

MPEG interrupt mask setting

 Function Name [SR]

CDC_MpSetIntMsk

 No

20.4

Form
Sint32 CDC_MpSetIntMsk (Sint32 intmsk)
input
intmsk: Interrupt mask (lower 24 bits are valid)
output
none
Function value
Returns an error code.
function
Set the interrupt mask for MPEG interrupts.
The meaning of each bit of the interrupt mask is the same as the MPEG interrupt factor.
remarks
Set the bit you want to mask to 0 and the others to 1.
When an unmasked interrupt factor occurs in this function, the MPST flag turns ON.

List
 Title

Function specifications

 Function

MPEG decoder initialization

 Function Name [SR]

CDC_MpInit

 No

20.5

Form
Sint32 CDC_MpInit (Bool sw)
input
sw: MPEG system switch
output
none
Function value
Returns an error code.
End flag
MPED flag (only clearing 0) …… Can be executed regardless of the MPED value
function
Initializes the MPEG system and controls the start / stop of the MPEG system.

(1) MPEG system switch
When the MPEG system is turned off, all other MPEG communication functions are REJECT until it is turned on.
It affects the performance of the CD part while the MPEG system is booting. When using only the function of the CD part, stop the MPEG system with this switch.

Constant name explanation
OFF OFF Stop …… Initial value
ON Start-up

remarks

  1. This function waits about 3ms internally and then issues the command, ignoring the MPED and MPCM flags.

  2. To determine the completion of initialization, wait for 2VSYNC or more to elapse after executing this function and for the MPED flag to become 1.


List
 Title

Function specifications

 Function

MPEG operation mode setting

 Function Name [SR]

CDC_MpSetMode

 No

20.6

Form
Sint32 CDC_MpSetMode (Sint32 actmod, Sint32 dectim, Sint32 out, Sint32 scnmod)
input
actmod: MPEG operation mode dectim: Decoding timing out: Image data output destination scnmod: Scanning mode (lower 8 bits are valid)
output
none
Function value
Returns an error code.
function
Set the operating mode of the MPEG decoder.

(1) MPEG operation mode
Be sure to execute the CDC_MpInit function before switching to MPEG sector buffer mode.
Constant name explanation
CDC_MPACT_NMOV Video playback mode …… Initial value
CDC_MPACT_NSTL Still image playback mode
CDC_MPACT_HMOV High-definition video playback mode (not supported)
CDC_MPACT_HSTL High-definition still image playback mode
CDC_MPACT_SBUF MPEG sector buffer mode
CDC_PARA_NOCHG Do not change settings

(2) Decoding timing
Specifies the timing of the decode sync signal (DSYNC). It is effective in the video playback mode.
Host synchronization is effective when the MPEG playback mode of the CDC_MpPlay function is the independent playback mode.
Constant name explanation
CDC_MPDEC_VSYNC Decoding by VSYNC synchronization …… Initial value
CDC_MPDEC_HOST Decoding by host synchronization (DSYNC is sent at the instruction of the host)
CDC_PARA_NOCHG Do not change settings

(3) Image data output destination
Constant name explanation
CDC_MPOUT_VDP2 Output to VDP2 …… Initial value
CDC_MPOUT_HOST Output to host (extract from MPEG register)
CDC_PARA_NOCHG Do not change settings

(4) Scanning mode
bit 7 6 5 4 3 2 1 0
   ┌─┬─┬─┬─┬─┬─┬─┬─┐
   │ │ − │ − │ − │ − │ − │ │ │ Initial value: 00H Unchanged: CDC_PARA_NOCHG
   └┬┴─┴─┴─┴─┴─┴┬┴┬┘
   │ │ └─1: Non-interlaced 0: Interlaced │ └─── 1: PAL 0: NTSC
   └─────────────── 1: Do not change the setting 0: Change

remarks

  1. The frame rate is set automatically.

  2. Execute this function when the operating status of MPEG / Video is stopped.


List
 Title

Function specifications

 Function

MPEG playback

 Function Name [SR]

CDC_MpPlay

 No

20.7

Form
Sint32 CDC_MpPlay (Sint32 plymod, Sint32 tmod_a, Sint32 tmod_v, Sint32 dec_v)
input
plymod : MPEG playback mode
tmod_a : MPEG / Audio transfer mode
tmod_v : MPEG / Video transfer mode
dec_v : MPEG / Video decode switch
output
none
Function value
Returns an error code.
function
Set audio and video synchronous playback, transfer mode, and video decode switch.

(1) MPEG playback mode
Synchronous playback mode is effective when the decoding timing of the CDC_MpSetMode function is VSYNC synchronization.
Constant name explanation
CDC_MPPLY_SYNC Synchronous playback mode …… Initial value
CDC_MPPLY_INDP Independent playback mode
CDC_PARA_NOCHG Do not change settings

(2) MPEG decoder transfer mode
In the automatic transfer mode, when the required amount of data is stored in the CD buffer, the transfer to the decoder is automatically started.
Constant name explanation
CDC_MPTRN_AUTO Automatic transfer mode …… Initial value
CDC_MPTRN_FORCE Forced transfer mode
CDC_PARA_NOCHG Do not change settings

(a) Video
Transfer mode explanation
Automatic forwarding When data of STD buffer size + 16KB is stored in the CD buffer,
Start transferring and decoding to the VBV buffer.
Forced transfer Transfer / decoding is started regardless of the state of the CD buffer.

(b) Audio
Transfer mode explanation
Automatic forwarding When the data for two sectors is stored in the CD buffer, transfer / decoding is started.
For synchronous playback, decoding starts when the first picture of the video is displayed.
Forced transfer Regardless of the state of the CD buffer or the state of the video
Start transfer / decoding.

(3) MPEG / Video decode switch
Directly control the MPEG / Video LSI decode switch.
Normally, be sure to specify CDC_PARA_NOCHG. (Do not change the settings.)
Constant name explanation
OFF OFF Decoding stop
ON Decoding start …… Initial value
CDC_PARA_NOCHG Do not change the setting …… Normally specified value

caution
The MPEG decoder starts decoding by connecting to the buffer partition. The start / end of decoding must not be controlled by executing this function.
When the connection by the CDC_MpSetCon function or the forced switching by the CDC_MpChgCon function is executed, decoding starts regardless of this switch. (Even if decoding is stopped.)
Use the CDC_MpChgCon function to kill the decoding.


List
 Title

Function specifications

 Function

Decoding method setting

 Function Name [SR]

CDC_MpSetDec

 No

20.8

Form
Sint32 CDC_MpSetDec (Sint32 mute, Sint32 pautim, Sint32 frztim)
input
mute : MPEG / Audio mute (lower 8 bits are valid)
pautim : MPEG / Video pause timing (lower 16 bits are valid)
frztim : MPEG / Video freeze timing (lower 16 bits are valid)
output
none
Function value
Returns an error code.
function
Set the decoding method of the MPEG decoder.

(1) MPEG / Audio mute
Be sure to set bit2 = 1 and set the value regardless of whether it is muted or not.
Since the initial value of this parameter is 0, bit2 = 0 if it is not changed (CDC_PARA_NOCHG). Therefore, be sure to explicitly specify a fixed value (CDC_MPMUT_DFL) at the beginning.
bit 7 6 5 4 3 2 1 0
   ┌─┬─┬─┬─┬─┬─┬─┬─┐
   │ │ − │ − │ − │ − │ │ │ │ Initial value: 00H Unchanged: CDC_PARA_NOCHG
   └┬┴─┴─┴─┴─┴┬┴┬┴┬┘
   │ │ │ └─CDC_MPMUT_R 1: Mute the right channel │ │ └─── CDC_MPMUT_L 1: Mute the left channel │ └───── CDC_MPMUT_DFL 1: Fixed value (must be specified)
   └─────────────── 1: Do not change the setting 0: Change

(2) MPEG / Video pause timing
Constant name explanation
0000H Pose (re-pause during pause: frame-by-frame) …… Initial value
0001H Unpause
0002H ~ FFFEH Frame interval until repause (slow playback interval)
FFFFH Do not change the setting (CDC_PARA_NOCHG)

(3) MPEG / Video freeze timing
Constant name explanation
0000H Freeze (refreeze during freeze) …… Initial value
0001H Unfreeze
0002H ~ FFFEH Frame interval until refreeze (strobe playback interval)
FFFFH Do not change the setting (CDC_PARA_NOCHG)

remarks

  1. Pause / freeze is disabled in still image playback mode. (Valid in video playback mode)

  2. If pause / freeze is set when the operating state of the video is in the restoration process, it becomes WAIT.


List
 Title

Function specifications

 Function

Sending a decode sync signal

 Function Name [SR]

CDC_MpOutDsync

 No

20.9

Form
Sint32 CDC_MpOutDsync (Sint32 fbn)
input
fbn: Frame bank number (0-3) …… Valid in still image playback mode
output
none
Function value
Returns an error code.
function
Sends a decode sync signal (DSYNC). The decoding timing of each frame can be controlled by the host.

(1) Frame bank number
In the still image reproduction mode, the frame bank number (0 to 3) to be decoded can be specified.
The frame bank number is invalid in video playback mode.

(2) Transmission timing of decode synchronization signal
Be sure to set the DSYNC transmission timing at least one frame worth of decoding time (2VSYNC). Normally, it is necessary to take synchronization timing using VSYNC or audio playback volume.

caution
Specification restrictions on picture start code (PSC) detection <BR> For video streams with a picture period of M ≤ 3, PSC detection and DSYNC transmission can be synchronized except for the last 3 frames of the stream. That is, PSC detection can be used as the DSYNC transmission timing.
(PSC detection is notified by the video interrupt bit8 of the MPEG interrupt factor flag.)
However, when the last 3 frames of the stream and M ≧ 4, PSC detection and DSYNC transmission do not have a one-to-one correspondence. In this case, PSC detection cannot be used, and it is necessary to take the synchronization timing by the method (2) above.

remarks

List
 Title

Function specifications

 Function

Get video timecode

 Function Name [S-]

CDC_MpGetTc

 No

20.10

Form
Sint32 CDC_MpGetTc (Sint32 * bnk, Sint32 * pictyp, Sint32 * tr, CdcMpTc * mptc)
input
none
output
bnk : Currently displayed frame bank number (0-3)
pictyp : Picture type
tr : Temporal reference (lower 8 bits are valid)
mptc : Time code
Function value
Returns an error code.
function
Get the timecode and temporal reference of the frame being displayed.
In the still image playback state, it refers to a frame that is waiting for decoding or is being decoded.

(1) Picture type
Same as the picture information in the MPEG status information. (Initial value: 0)
Constant name explanation
CDC_MPPICT_I I picture
CDC_MPPICT_P P picture
CDC_MPPICT_B B picture
CDC_MPPICT_D D picture

(2) Temporal reference
Returns the temporal reference (lower 8 bits) of the currently displayed picture.

(3) Time code
Returns the timecode of the currently displayed picture. (It is not the time code at the beginning of the GOP layer in the stream.)


List
 Title

Function specifications

 Function

Get audio time stamps

 Function Name [S-]

CDC_MpGetPts

 No

20.11

Form
Sint32 CDC_MpGetPts (Sint32 * pts_a)
input
none
output
pts: MPEG / Audio time stamp
Function value
Returns an error code.
function
Get an audio time stamp (PTS: Presentation Time Stamp).

(1) MPEG / Audio time stamp
The time stamp value is the value obtained by extracting the lower 32 bits of the 33-bit PTS (90KHz).
This value is the latest value just before entering decoding. When MPEG / Audio is not operating, the previous value is retained.


8.2.2 MPEG stream


List
 Title

Function specifications

 Function

Setting the connection destination of the MPEG decoder

 Function Name [SR]

CDC_MpSetCon

 No

21.1

Form
Sint32 CDC_MpSetCon (Sint32 next, CdcMpCon * mpcon_a, CdcMpCon * mpcon_v)
input
next : Next stream flag
mpcon_a : MPEG / Audio connection destination parameters
mpcon_v : MPEG / Video connection destination parameters
output
none
Function value
Returns an error code.
function
Set / register the connection destination (buffer partition and other parameters) of the MPEG decoder.
If CDC_NUL_SEL is specified for the buffer partition number, the connection destination setting is canceled.

(1) Next stream flag
Constant name explanation
CDC_MPSTF_CUR Current connection destination setting (starting stream)
CDC_MPSTF_NEXT Registration of the next connection destination (next stream)

remarks
Cancellation (disconnection) of the connection destination depends on the MPEG operating state. In particular, it is necessary to use the CDC_MpChgCon function to disconnect (force termination) the current connection destination during playback.
See the data specification (CdcMpCon) for details.


List
 Title

Function specifications

 Function

Get the connection destination of the MPEG decoder

 Function Name [S-]

CDC_MpGetCon

 No

21.2

Form
Sint32 CDC_MpGetCon (Sint32 next, CdcMpCon * mpcon_a, CdcMpCon * mpcon_v)
input
next: Next stream flag
output
mpcon_a : MPEG / Audio connection destination parameters
mpcon_v : MPEG / Video connection destination parameters
Function value
Returns an error code.
function
Get the connection destination (buffer partition and other parameters) of the MPEG decoder.
If not connected (unregistered), CDC_NUL_SEL is returned in the buffer partition number.

(1) Next stream flag
Constant name explanation
CDC_MPSTF_CUR Get current connection (starter stream)
CDC_MPSTF_NEXT Get the next connection destination (next stream)


List
 Title

Function specifications

 Function

Switching the connection destination of the MPEG decoder

 Function Name [SR]

CDC_MpChgCon

 No

21.3

Form
Sint32 CDC_MpChgCon (Sint32 chg_a, Sint32 chg_v, Sint32 clr_a, Sint32 clr_v)
input
chg_a : MPEG / Audio connection switching flag
chg_v : MPEG / Video connection switching flag
clr_a : MPEG / Audio clear method
clr_v : MPEG / Video clearing method
output
none
Function value
Returns an error code.
function
Forcibly switch the connection destination of the MPEG decoder. Alternatively, forcibly disconnect the connection destination.
To forcibly terminate MPEG playback, specify disconnection with this function.

(1) MPEG decoder connection switching flag
To specify switching, the next stream to be played must be registered in advance using the CDC_MpSetCon function.
When switching is specified, the clear method is effective. After the clearing process is completed, the connection destination is switched.
Constant name explanation
CDC_MPCOF_ABT Detachment (forced termination)
CDC_MPCOF_CHG Forced switching
CDC_PARA_NOCHG Do not change settings

(2) MPEG / Audio clearing method
Constant name explanation
CDC_MPCLA_OFF Do not clear (data for one sector is transferred)
CDC_MPCLA_ON Immediately clear one sector buffer

(3) MPEG / Video clearing method
Constant name explanation
CDC_MPCLV_FRM Immediately clear VBV and WBC (waiting for display MPEG framebuffer)
CDC_MPCLV_VBV Clear VBV at the next I or P picture start

remarks
This function can be executed only when the MPEG operating state is playing.
To disconnect the connection destination in other states, you need to use the CDC_MpSetCon function.


List
 Title

Function specifications

 Function

MPEG stream settings

 Function Name [SR]

CDC_MpSetStm

 No

21.4

Form
Sint32 CDC_MpSetStm (Sint32 next, CdcMpStm * mpstm_a, CdcMpStm * mpstm_v)
input
next : Next stream flag
mpstm_a : MPEG / Audio stream parameters
mpstm_v : MPEG / Video stream parameters
output
none
Function value
Returns an error code.
function
Set the stream number (stream ID) and channel number to be decoded.

(1) Next stream flag
Constant name explanation
CDC_MPSTF_CUR Current stream settings (starting stream)
CDC_MPSTF_NEXT Registration of the next stream (next stream)

remarks
When the MPEG operating state is being switched, it becomes WAIT.

List
 Title

Function specifications

 Function

Get MPEG stream

 Function Name [S-]

CDC_MpGetStm

 No

21.5

Form
Sint32 CDC_MpGetStm (Sint32 next, CdcMpStm * mpstm_a, CdcMpStm * mpstm_v)
input
next: Next stream flag
output
mpstm_a : MPEG / Audio stream parameters
mpstm_v : MPEG / Video stream parameters
Function value
Returns an error code.
function
Acquire the stream number (stream ID) and channel number to be decoded.

(1) Next stream flag
Constant name explanation
CDC_MPSTF_CUR Get current stream (starting stream)
CDC_MPSTF_NEXT Get the next stream (next stream)


List
 Title

Function specifications

 Function

Get stream image size

 Function Name [S-]

CDC_MpGetPictSiz

 No

21.6

Form
Sint32 CDC_MpGetPictSiz (Sint32 * siz_h, Sint32 * siz_v)
input
none
output
siz_h : Horizontal image size (in pixels)
siz_v : Vertical image size (in pixels)
Function value
Returns an error code.
function
Get the image size in the video stream. The initial value is 0 for both.

8.2.3 MPEG display screen


List
 Title

Function specifications

 Function

Image display

 Function Name [SR]

CDC_MpDisp

 No

22.1

Form
Sint32 CDC_MpDisp (Bool dspsw, Sint32 fbn)
input
dspsw : Display switch (display ON / OFF on VDP2)
fbn : Frame bank number (0-3) …… Valid in still image playback mode
output
none
Function value
Returns an error code.
function
Display the image according to the display switch.

(1) Display switch
Constant name explanation
OFF OFF Not displayed in VDP2 …… Initial value
ON Display on VDP2

(2) Frame bank number
In the still image reproduction mode, the frame bank number (0 to 3) to be decoded can be specified.
The frame bank number is invalid in video playback mode.


List
 Title

Function specifications

 Function

Framebuffer window position setting

 Function Name [SR]

CDC_MpSetWinFpos

 No

22.2

Form
Sint32 CDC_MpSetWinFpos (Bool chgflg, Sint32 fpx, Sint32 fpy)
input
chgflg : Setting change flag (OFF: Register setting value, ON: Change setting to registered value)
fpx : Upper left X coordinate of framebuffer window
fpy : Upper left Y coordinate of framebuffer window
output
none
Function value
Returns an error code.
function
Set the position of the frame buffer window in pixel units.

(1) Upper left coordinates of the frame buffer window
The initial value is 0 for both fpx and fpy.
If CDC_PARA_NOCHG is set for fpx and fpy, the previous values will be retained.
Coordinate Normal output mode High definition output mode
NTSC fpx 0 to 351 (CDC_MPNT_NPX) 0 to 703 (CDC_MPNT_HPX)
fpy 0 to 239 (CDC_MPNT_NPY) 0 to 479 (CDC_MPNT_HPY)
PAL fpx 0 to 351 (CDC_MPPL_NPX) 0 to 703 (CDC_MPPL_HPX)
fpy 0 to 287 (CDC_MPPL_NPY) 0 to 575 (CDC_MPPL_HPY)

List
 Title

Function specifications

 Function

Framebuffer window magnification setting

 Function Name [SR]

CDC_MpSetWinFrat

 No

22.3

Form
Sint32 CDC_MpSetWinFrat (Bool chgflg, Sint32 frx, Sint32 fry)
input
chgflg : Setting change flag (OFF: Register setting value, ON: Change setting to registered value)
frx : X-direction enlargement ratio of frame buffer window (lower 16 bits are valid)
fry : Y-direction enlargement ratio of frame buffer window (lower 16 bits are valid)
output
none
Function value
Returns an error code.
function
Set the magnification of the framebuffer window.

(1) Enlargement ratio of the frame buffer window in each direction
The initial value is 01H (magnification = 1) for both frx and fry.
If CDC_PARA_NOCHG is specified for frx and fry, the previous values are retained respectively.
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0  
   ┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐
   │ C │ │ ← ─────── A───────── → │ D │ ← ─ B─ → │
   └┬┴┬┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴┬┴─┴─┴─┘
   │ │ ↑ │ ↑ 
   │ │ Enlargement ratio │ Correction coefficient │ │ │ │
   │ │ └─ Correction coefficient polarity │ │
   │ └──────────── Preserve value 1: Do not change 0: Change └────────────── Reduce flag 1: Reduce 0: Enlarge

Each bit of A, B, C, and D is set so as to satisfy the following relationship.
However, A <1024, B> 0.

C D Expansion rate
expansion 0 0 A + 2-1 / B
0 1 A + 1 + 1 / B
Shrink 1 0 1 / (A + 1-1 / B)
1 1 1 / (A + 1 / B)

List
 Title

Function specifications

 Function

Display window position setting

 Function Name [SR]

CDC_MpSetWinDpos

 No

22.4

Form
Sint32 CDC_MpSetWinDpos (Bool chgflg, Sint32 dpx, Sint32 dpy)
input
chgflg : Setting change flag (OFF: Register setting value, ON: Change setting to registered value)
dpx : Upper left X coordinate of the display window
dpy : Upper left Y coordinate of the display window
output
none
Function value
Returns an error code.
function
Set the position of the display window in pixel units.

(1) Upper left coordinates of the display window
The initial value is 0 for both dpx and dpy.
If CDC_PARA_NOCHG is set for dpx and dpy, the previous values are retained respectively.
Coordinate Normal output mode High definition output mode
NTSC dpx 0 to 351 (CDC_MPNT_NPX) 0 to 703 (CDC_MPNT_HPX)
dpy 0 to 239 (CDC_MPNT_NPY) 0 to 479 (CDC_MPNT_HPY)
PAL dpx 0 to 351 (CDC_MPPL_NPX) 0 to 703 (CDC_MPPL_HPX)
dpy 0 to 287 (CDC_MPPL_NPY) 0 to 575 (CDC_MPPL_HPY)

List
 Title

Function specifications

 Function

Display window size setting

 Function Name [SR]

CDC_MpSetWinDsiz

 No

22.5

Form
Sint32 CDC_MpSetWinDsiz (Bool chgflg, Sint32 dsx, Sint32 dsy)
input
chgflg : Setting change flag (OFF: Register setting value, ON: Change setting to registered value)
dsx : X-direction size of the display window
dsy : Display window Y direction size
output
none
Function value
Returns an error code.
function
Set the size of the display window in pixels.

(1) Display window size
The initial values are dsx = 352, dsy = 240 regardless of NTSC / PAL, normal / high definition.
If CDC_PARA_NOCHG is set for dsx and dsy, the previous values are retained respectively.
Coordinate Normal output mode High definition output mode
NTSC dsx 0 to 352 (CDC_MPNT_NSX) 0 to 704 (CDC_MPNT_HSX)
dsy 0-240 (CDC_MPNT_NSY) 0 to 480 (CDC_MPNT_HSY)
PAL dsx 0 to 352 (CDC_MPPL_NSX) 0 to 704 (CDC_MPPL_HSX)
dsy 0 to 288 (CDC_MPPL_NSY) 0 to 576 (CDC_MPPL_HSY)

List
 Title

Function specifications

 Function

Display wind offset setting

 Function Name [SR]

CDC_MpSetWinDofs

 No

22.6

Form
Sint32 CDC_MpSetWinDofs (Bool chgflg, Sint32 dox, Sint32 doy)
input
chgflg : Setting change flag (OFF: Register setting value, ON: Change setting to registered value)
dox : Display window X-direction offset
doy : Display window Y-direction offset
output
none
Function value
Returns an error code.
function
Set the display window offset in bright spot units. (Not in pixel units.)

(1) Display window offset
Neither the initial value nor the setting range depends on NTSC / PAL and normal / high definition.
If CDC_PARA_NOCHG is set for dox and doy, the previous value is retained.
offset initial value Setting range remarks
dox 150 18-704 Border color display on the entire surface when dox ≤ 17
doy 38 8 to 480 Border color display on the entire surface when doy ≤ 7

remarks
PAL recommends dox = 150 and doy = 45 as standard values for setting in the center of the screen.


List
 Title

Function specifications

 Function

Border color settings

 Function Name [SR]

CDC_MpSetBcolor

 No

22.7

Form
Sint32 CDC_MpSetBcolor (Sint32 bcolor)
input
bcolor: Border color (lower 16 bits are valid)
output
none
Function value
Returns an error code.
function
Set the border color color data (RGB555 format).

(1) Border color
Initial value: 8000H (border color output)
bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0  
   ┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐
   │ │ ← ─ B data ─ → │ ← ─ G data ─ → │ ← ─ R data ─ → │
   └┬┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘
   │
   └── Transparent bit 1: Output border color 0: Do not output (transparent state)

remarks
It works only when the image is output to VDP2.
If the output destination is the host (MPEG register), the border color is not output.


List
 Title

Function specifications

 Function

Fade settings

 Function Name [SR]

CDC_MpSetFade

 No

22.8

Form
Sint32 CDC_MpSetFade (Sint32 gain_y, Sint32 gain_c)
input
gain_y : Luminance signal gain (-8 to 7, initial value: 0)
gain_c : Color difference signal gain (-8 to 7, initial value: 0)
output
none
Function value
Returns an error code.
function
Change the luminance / color difference signal level in 1/8 steps.
Used for fade-in and fade-out.

(1) Luminance / color difference signal gain
The range of set values is -8 to 7, and the initial value is 0. If you specify a value outside this range, it will be REJECT.
The gain setting value and the actual magnification are shown below.
 Gain setting value
 -8
 -7
 -6
 -5
 -4
 -3
 -2
 -1
 0
 +1
 +2
 +3
 +4
 +5
 +6
 +7
 Double rate
0 1/8 2/8 3/8 4/8 5/8 6/8 7/8 1 9/8 10/8 10/8 12/8 12/8 2 2

List
 Title

Function specifications

 Function

Screen special effects settings

 Function Name [SR]

CDC_MpSetVeff

 No

22.9

Form
Sint32 CDC_MpSetVeff (CdcMpVeff * mpvef)
input
mpvef: Screen special effects parameter
output
none
Function value
Returns an error code.
function
Set screen special effects.

8.2.4 MPEG frame buffer


List
 Title

Function specifications

 Function

Extraction of image data

 Function Name [S-]

CDC_MpGetImg

 No

23.1

Form
Sint32 CDC_MpGetImg (Sint32 * dwnum)
input
none
output
dwnum: Number of image data transfer words
Function value
Returns an error code.
function
Extract the image data in the display window to the host.
It does not work when the output destination of image data is VDP2. Be sure to set the output destination to the host.
remarks

  1. After executing the function, it is necessary to transfer and retrieve the data from the MPEG register.

  2. The horizontal size dsx usually needs to be set to 5 or more (10 or more in high definition).

  3. In the high-definition still image mode, it is necessary to set the sizes dsx and dsy to an integral multiple of 2.

  4. Before executing, turn on the display switch of the CDC_MpDisp function.

  5. Execute after the output ready flag of the MPEG report becomes 1.

  6. During image data transfer, it is desirable to fix the display window by freezing or the like.


List
 Title

Function specifications

 Function

Image data window position setting

 Function Name [SR]

CDC_MpSetImgPos

 No

23.2

Form
Sint32 CDC_MpSetImgPos (Sint32 fbn, Sint32 ipx, Sint32 ipy)
input
fbn : Frame bank number (0-3)
ipx : Upper left X coordinate of the image data window
ipy : Upper left Y coordinate of the image data window
output
none
Function value
Returns an error code.
function
Set the position of the image data window in pixel units for the specified frame bank.

(1) Upper left coordinates of the image data window
The initial value is 0 for both ipx and ipy.
The specified value is rounded down in units of 2 pixels.
Coordinate Normal output mode High definition output mode
NTSC ipx 0 to 351 (CDC_MPNT_NPX) 0 to 703 (CDC_MPNT_HPX)
ipy 0 to 239 (CDC_MPNT_NPY) 0 to 479 (CDC_MPNT_HPY)
PAL ipx 0 to 351 (CDC_MPPL_NPX) 0 to 703 (CDC_MPPL_HPX)
ipy 0 to 287 (CDC_MPPL_NPY) 0 to 575 (CDC_MPPL_HPY)

List
 Title

Function specifications

 Function

Image data window size setting

 Function Name [SR]

CDC_MpSetImgSiz

 No

23.3

Form
Sint32 CDC_MpSetImgSiz (Sint32 fbn, Sint32 isx, Sint32 isy)
input
fbn : Frame bank number (0-3)
isx : X-direction size of the image data window
isy : Y-direction size of the image data window
output
none
Function value
Returns an error code.
function
Set the size of the image data window in pixels for the specified frame bank.

(1) Image data window size
The initial value is 0 for both isx and isy.
The specified value is rounded down in units of 2 pixels.
Coordinate Normal output mode High definition output mode
NTSC isx 0 to 352 (CDC_MPNT_NSX) 0 to 704 (CDC_MPNT_HSX)
isy 0-240 (CDC_MPNT_NSY) 0 to 480 (CDC_MPNT_HSY)
PAL isx 0 to 352 (CDC_MPPL_NSX) 0 to 704 (CDC_MPPL_HSX)
isy 0 to 288 (CDC_MPPL_NSY) 0 to 576 (CDC_MPPL_HSY)

List
 Title

Function specifications

 Function

Loading from the image data window

 Function Name [SR]

CDC_MpReadImg

 No

23.4

Form
Sint32 CDC_MpReadImg (Sint32 srcfbn, Sint32 fln_y, Sint32 fln_cr, Sint32 fln_cb)
input
srcfbn : Reading source frame bank number (0-3)
fln_y : Aperture number for luminance data (Y)
fln_cr : Aperture number for color difference data (Cr)
fln_cb : Aperture number for color difference data (Cb)
output
none
Function value
Returns an error code.
End flag
MPED flag
function
From the image data window in the frame bank, read the image data (YCC) into the buffer partition through the aperture.
remarks

  1. This function is valid only in the still image playback mode.

  2. Depending on the screen size, the amount of data may exceed the capacity of the CD buffer.
    In such a case, please process while fetching the data to the host side.

  3. This function does not end even if the CD buffer is full. (MPED = 1 does not hold.)
    To stop the process in the middle, execute the CDC_MpInit function (or soft reset by the CDC_CdInit function).


List
 Title

Function specifications

 Function

Export to image data window

 Function Name [SR]

CDC_MpWriteImg

 No

23.5

Form
Sint32 CDC_MpWriteImg (Sint32 bn_y, Sint32 bn_cr, Sint32 bn_cb, Sint32 dstfbn, Bool clrmod)
input
bn_y : Buffer partition number for luminance data (Y)
bn_cr : Buffer partition number for color difference data (Cr)
bn_cb : Buffer partition number for color difference data (Cb)
dstfbn : Export destination frame bank number (0 to 3)
clrmod : Erase mode of sectors in buffer partition
output
none
Function value
Returns an error code.
End flag
MPED flag
function
Write image data (YCC) from the buffer partition to the image data window in the frame bank.

(1) Erase mode
Constant name explanation
OFF OFF Preserve (do not erase) sectors in the buffer partition
ON Erase the sectors in the buffer partition

remarks

  1. This function is valid only in the still image playback mode.

  2. This function does not end even if the data in the buffer partition becomes empty. (MPED = 1 does not occur.) To cancel the process in the middle, execute the CDC_MpInit function (or soft reset by the CDC_CdInit function).


8.2.5 MPEG sector buffer

To use this function, be sure to execute the CDC_MpInit function and then switch to the MPEG sector buffer mode with the CDC_MpSetMode function. The initial value in the MPEG sector buffer is undefined.
List
 Title

Function specifications

 Function

Read sector from MPEG sector buffer

 Function Name [SR]

CDC_MpReadSct

 No

24.1

Form
Sint32 CDC_MpReadSct (Sint32 srcmsp, Sint32 snum, Sint32 dstfln)
input
srcmsp : Reading source MPEG sector position
snum : Number of sectors
dstfln : Aperture number
output
none
Function value
Returns an error code.
End flag
MPED flag
function
Read sector data from the MPEG sector buffer into the buffer partition through the aperture.
The sector range to be read is specified by the MPEG sector position and the number of sectors.

remarks

  1. Depending on the specified number of sectors, the amount of data may exceed the capacity of the CD buffer.
    In such a case, please process while fetching the data to the host side.

  2. This function does not end even if the CD buffer is full. (MPED = 1 does not hold.)
    To stop the process in the middle, execute the CDC_MpInit function (or soft reset by the CDC_CdInit function).


List
 Title

Function specifications

 Function

Exporting sectors to the MPEG sector buffer

 Function Name [SR]

CDC_MpWriteSct

 No

24.2

Form
Sint32 CDC_MpWriteSct (Sint32 srcbn, Sint32 sp, Sint32 snum, Sint32 dst msp)
input
srcbn : Buffer partition number
sp : Sector position (CDC_SPOS_END: Indicates the last sector of the partition)
snum : Number of sectors (CDC_SNUM_END: Indicates the number of sectors from sp to the end of the partition)
dstmsp : Export destination MPEG sector position
output
none
Function value
Returns an error code.
End flag
MPED flag
function
Write sector data from the buffer partition to the MPEG sector buffer.
The sector range to be written is specified by the sector position and the number of sectors.
remarks

  1. The sectors of the buffer partition are erased when writing.

  2. This function does not end even if the data in the buffer partition becomes empty. (MPED = 1 does not hold.)
    To stop the process in the middle, execute the CDC_MpInit function (or soft reset by the CDC_CdInit function).


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