Japanese
MOVIE TOOLS GUIDECinepak for SEGASaturn
BackForward
Cinepak for SEGA Saturn


4.4.2 Data details

(1) Basic data

 one
View
table
 Title

data specifications

 Data

basic data

 Data Name
 No

1.0

 Model name
 explanation
 Uint8
 An unsigned 1-byte integer.
 Sint8
 Signed 1-byte integer.
 Uint16
 An unsigned 2-byte integer.
 Sint16
 Signed 2-byte integer.
 Uint32
 An unsigned 4-byte integer.
 Sint32
 Signed 4-byte integer.
 Bool
 Logical type. Takes the following values.
FALSE
TRUE

(2)Constant

 one
View
table
 Title

data specifications

 Data

Error code

 Data Name

CPK_ERR_〜

 No

2.1

The following constants represent error codes.
 constant name
 explanation
 CPK_ERR_OK

CPK_ERR_OUT_OF_HANDLE
CPK_ERR_INSUFFICIENT_WORK
CPK_ERR_TOO_SMALL_BUF
CPK_ERR_NO_INIT
CPK_ERR_INVALID_HN
CPK_ERR_ILL_CREATE_MODE
CPK_ERR_TOO_SMALL_FLOP
CPK_ERR_TOO_LARGE_HEADER
CPK_ERR_HEADER_DATA
CPK_ERR_SAMPLE_ID
CPK_ERR_SAMPLE_DATA
CPK_ERR_ILLEGAL_PARA
CPK_ERR_ILLEGAL_HANDLE
CPK_ERR_NEXT_MOVI_STATUS
CPK_ERR_NEXT_MOVI_AUDIO
CPK_ERR_NEXT_MOVI_SCALE
CPK_ERR_CHANGE_NO_DATA
CPK_ERR_CHANGE_NO_ENTRY
CPK_ERR_PAUSE_STATUS
CPK_ERR_DMA_CPU_PCM
CPK_ERR_GFS_READ
CPK_ERR_DF_NO_DATA
CPK_ERR_DF_IS_NOT_VIDEO
 normal termination
Can't create handle
Insufficient work area
Ring buffer size is small
Initialization function not called
An invalid handle was specified
Different from the mode when creating
FLOP initial value is small
Header is too large (ring buffer is small)
Film header is abnormal
Movie identifier is abnormal
Movie data is abnormal
Incorrect argument specification
The handle is abnormal
The status of continuous playback movies is abnormal.
The audio conditions for the next movie to be played are not met.
The time scale of the next movie to play does not match
The data supply for the next movie to play is low.
There is no specification for the next movie to play.
The pause function was called when the movie was not playing or pausing.
DMA terminated abnormally
An error occurred while reading the file system
There is no data supply for the header.
Not a video sample

 one
View
table
 Title

data specifications

 Data

playback status

 Data Name

CPK_STAT_PLAY_〜

 No

2.2

Indicates the movie playback status.
 constant name
 explanation
 CPK_STAT_PLAY_ERR_STOP
 Abnormal stop
 CPK_STAT_PLAY_STOP
 Stop
 CPK_STAT_PLAY_PAUSE
 pause
 CPK_STAT_PLAY_START
 Start playing
 CPK_STAT_PLAY_HEADER
 Processing film header
 CPK_STAT_PLAY_TIME
 Playing (timer start)
 CPK_STAT_PLAY_END
 End of playback 

 one
View
table
 Title

data specifications

 Data

Pause control command

 Data Name

CPK_PAUSE_~

 No

2.3

Indicates how to pause.
 constant name
 explanation
 CPK_PAUSE_ON_AT_ONCE
 Immediate pause
 CPK_PAUSE_ON_KEYFRAME
 Pause at keyframe
 CPK_PAUSE_OFF
 Cancel pause 

 one
View
table
 Title

data specifications

 Data

work buffer size

 Data Name

CPK_**WORK_〜

 No

2.4

Represents the size of the work buffer that should be secured.
 constant name
 explanation
 CPK_24WORK_BSIZE

CPK_15WORK_BSIZE

 Work buffer when playing 24bit full color movie
number of bytes
Work buffer byte when playing 15bit color movie
Number of points

 one
View
table
 Title

data specifications

 Data

Number of display colors

 Data Name

CPK_COLOR_〜

 No

2.5

Specify the number of display colors at the expansion destination.
 constant name
 explanation
 CPK_COLOR_24BIT

CPK_COLOR_15BIT

 24bit full color display.
Specify when displaying in full color with VDP2.
Displays 15bit color.
Specified when displaying 15bit color with VDP1 or VDP2.

 one
View
table
 Title

data specifications

 Data

Forced switch possibility check value

 Data Name

CPK_CHANGE_~

 No

2.6

Represents the possibility of forced switching.
 constant name
 explanation
 CPK_CHANGE_OK_AT_ONCE
CPK_CHANGE_NO_DATA


CPK_CHANGE_NO_ENTRY


CPK_CHANGE_TOO_LARGE_HEADER
 Immediate forced switching is possible.
Data supply is insufficient. Forced switch (CPK_Change)
If you run , the playback will not play smoothly and continuously.
The next movie is not registered in CPK_EntryNext. Forced cut
change (CPK_Change) cannot be executed.
The header is too large, so forced switching is not possible. Ringba
buffer is too small.

 one
View
table
 Title

data specifications

 Data

Data transfer method

 Data Name

CPK_TRMODE_~

 No

2.7

typedef enum {
    CPK_TRMODE_CPU = 0, /* Software transfer */
    CPK_TRMODE_SDMA, /* DMA cycle steal (default value) */
    CPK_TRMODE_SCU, /* SCU DMA */
    CPK_TRMODE_SCUDSPDMA /* SCU-DSP DMA (new addition) */
} CpkTrMode;

Note 1
Transfer method settings have restrictions as shown in the table below.

Restrictions on data transfer method settings
Processing method software transfer CPU DMA SCU DMA SCU-DSP DMA
CPK_SetTrModeCd ×
CPK_SetTrModePcm ×

Note 2
If CPK_TRMODE_SCUDSPDMA is specified as the transfer method, the SCU-DSP usage rights are initially in the Cinepak library. When using SCU-DSP with both Cinepak library and application, use CPK_AllocScuDsp and CPK_FreeScuDsp.

 one
View
table
 Title

data specifications

 Data

CPU usage conditions

 Data Name

CPK_CPU_〜

 No

2.8

typedef enum {
    CPK_CPU_MAIN = 1, /* master cpu only (default) */
    CPK_CPU_SLAVE = 2, /* slave cpu only (not supported) */
    CPK_CPU_DUAL = 3, /* dual cpu */
    CPK_CPU_END
} CpkCpu;

Note
When using a slave CPU with Cinepac, applications cannot use the slave CPU.

 one
View
table
 Title

data specifications

 Data

Default value of silence rate [1/s]

 Data Name

CPK_DEFAULT_SILENCE_RATE

 No

2.9

#define CPK_DEFAULT_SILENCE_RATE (8)

 one
View
table
 Title

data specifications

 Data

Default playback speed (normal playback speed)

 Data Name

CPK_SPEED_ORIGINAL

 No

2.10

#define CPK_SPEED_ORIGINAL (0)

 one
View
table
 Title

data specifications

 Data

Playback speed setting unit

 Data Name

CPK_SPEED_UNIT

 No

2.11

#define CPK_SPEED_UNIT (1024)

(3) Data type

 one
View
table
 Title

data specifications

 Data

movie handle

 Data Name

CpkHn

 No

3.1

Represents information for each movie.
typedef void *CpkHn;

 one
View
table
 Title

data specifications

 Data

Creation parameters

 Data Name

CpkCreatePara

 No

3.2

Represents movie creation information. Set various parameter values to Cpk_Create~ as a structure.
typedef struct {
Uint32 *work_addr; /* Start address of work */
                   /* Working area when this library plays movies */
                   /* Number of bytes of work */
Uint32 work_size; /* Set CPK_24WORK_BSIZE or CPK_15WORK_BSIZE */
                   /* Buffer address to store the movie file */
Uint32 buf_addr; /* When playing a movie in memory, use its address */
                   /* When playing a movie on a CD, use the ring buffer address */
                   /* buffer size */
Uint32 buf_size; /* File size when playing a movie in memory */
                   /* Ring buffer size for CD movies */
                   /* Sound memory PCM buffer address */
Uint16 *pcm_addr; /* Sound memory PCM buffer size */
Uint32 pcm_size; /* Number of quantization for 1CH */
                   /* Make it an integer multiple of 4KB (4096*1..4096*16) */
} CpkCreatePara;

 one
View
table
 Title

data specifications

 Data

film header

 Data Name

CpkHeader

 No

3.3

Represents the movie header information.

/* Film sample table item */
typedef struct {
  Uint32 offset; /* Offset from media start position */
  Sint32 size; /* sample size */
  Sint32 time; /* Frame display time, -1: Audio sample */
  Sint32 duration;/* Frame display duration */
} CpkFilmSample;

/* film header */ typedef struct { /* FilmHeader */ Uint32 film; /* “FILM” */ Uint32 size_header; /* Header size (offset to media start)*/ Uint32 version; /* version */ Uint32<> reserved; /* Reserved */ /* FrameDescription */ Uint32 fdsc; /* “FDSC” */ Uint32 size_fdsc; /* FDSC size 0x0000001C = 7*4[byte] */ Uint32 c_type; /* Compression method “cvid” */ Uint32 height; /* Vertical width [pixel] */ Uint32 width; /* Horizontal width [pixel] */ Uin32 color; /* Number of display colors [bit] */ Uin32 sound_channel; /* Number of channels */ Uin32 sound_smpling_bit; /* Number of sampling bits [bit] */ Uin32 sound_compress; /* Compression 00h: None 01h: Reserved */ Uint32 sound_smpling_rate;/* Sampling rate [Hz] lower 2 bytes are decimals */ Uin32 ckey; /* Chroma key information */ /* FilmSampleTable /* Uint32 stab; /* “STAB” */ Uint32 size_stab; /* STAB size (total number of samples + 1)*16[byte] */ Uint32 time_scale_film; /* Time scale */ Uint32 sample_total; /* Total number of samples */ CpkFilmSample sample[1]; /* Sample table arbitrary size */ } CpkHeader;

 one
View
table
 Title

data specifications

 Data

Error registration function

 Data Name

CpkErrFunc

 No

3.4

Function called when an error occurs.
Format
void(*CpkErrFunc)(void *obj, Sint32 err_code)
input
obj: Registered object
err_code: error code
output
none

BackForward
MOVIE TOOLS GUIDECinepak for SEGA Saturn
Copyright SEGA ENTERPRISES, LTD. 1997