FAQMovie related
BackForward
FAQ / Movie related

Cinepak



I want to play Cinepak with only audio from the middle.

Q)

  1. Is it possible to play Cinepak data from any position?
    How can it be done if possible?

  2. Is it possible with sound-only (no image data) Cinepak data?

Please tell us about these two points.

A)

  1. The method of playing Cinepak data from any position is possible if it is in memory, there is no sound, and all are keyframes.

  2. can not.


When I pause at the joint of a movie in Cinepak, the sound of the next movie sounds.

Q)
If you pause with the CPK_Pause function at the joint of split movies in Cinepak (just before the next movie starts), the sound of the next movie registered with CPK_EntryNext will sound while you pause. (Loop) When you cancel the pause, the sound will be out of sync for a while.

A)
There are two problems.

The first is to return the return value to the CPK_Pause function after Ver1.10, and if Pause cannot be done correctly, an error code will be output.

<Specification change of pause function CPK_Pause>
Old specification: No return value.
New specification: Returns a Bool type return value.
TRUE : Command accepted
FALSE : Command was not accepted

Returns FALSE if:

Be sure to check the above error code.

Second, if you execute this CPK_Pause function at the turn of the movie, the change cannot be determined in the function, so the same phenomenon may occur even if you perform the first check.
For the processing to be performed before executing the CPK_Pause function, refer to "(11) Changing the registration of the next handle" in the Cinepak User's Manual.


About poses during seamless brunch.

Q)
The movie currently being played is called Movie1, and the movie to be played next after being registered with CPK_EntryNext is called Movie2.

When I pause with Movie2 registered, I am calling the CPK_Pause function for both Movie1 and Movie2, but when I pause while Movie1 is playing (before Movie2 is played), Movie1 is TRUE. Returns FALSE because Movie2 hasn't played yet. What should I do to determine if I was able to pause correctly?

A)
The CPK_Pause function, but use with caution when doing seamless branches. Before executing, be sure to execute the CPK_Pause function only for the one that is being played by the status acquisition function (CPK_GetPlayStatus). So don't run CPK_Pause on both as above.

And if you execute CPK_EntryNext, check the transition period of the next handle of the CPK_EntryNext function and do not execute the CPK_Pause function until Movie2 is definitely in the play state.


What is Cinepak error CPK_ERR_SAMPLE_ID?

Q)
The Cinepak error code CPK_ERR_SAMPLE_ID (0x00000401) is described in the manual as "The movie identifier is abnormal". What is this movie identifier?

Also, when playing Cinepak, I got an error (error code 0x301) that the initial value of "FLOP" is too small. What is "FLOP"? How can I make it bigger again?

A)
This error code is output when the data captured in the ring buffer is not Cinepak data.
This is an error that is output when the decompression process is actually performed, not when the data is sent from the CD-ROM to the ring buffer.

As a case where this error code is output,

Such will be considered.

Please tell me about the stereo / monaural settings.

Q)
How can I switch between stereo and monaural for Cinepak playback?

A)
Please control the stereo / monaural switching of Cinepak playback on the sound driver side.

There is a function called CPK_SetPan, which is the so-called left-right balance. Therefore, it does not make the sound of Cinepak stereo / monaural.


Do you prepare as many buffers as there are movies when doing seamless branching?

Q)
For seamless branch playback of movies, do I need to have as many buffers as there are movies to play?

For example, when playing A, B, C, and 3 movies seamlessly, can A and C be shared in the same buffer?

A)
Since the buffer is just a buffer, using multiple movies does not mean that you have to prepare as many buffers as there are movies to play.
Therefore, if there is an unused buffer, it is possible to reuse it.


How to play Cinepak correctly in PAL?

Q)
When playing Cinepak normally played on NTSC with PAL, the sound may be interrupted for a moment or the sound and video may be out of sync.
What should I do to play correctly with PAL?

A)
This happens because Cinepak's data transfer isn't in time.
As a method to be done on the program side

  1. Increase the number of CPK_Tasks.
    (PAL has decreased the number of V-Blanks from 1/60 to 1/50, so simply increase it.)

  2. Execute in the mode that uses Slave CPU supported from Cinepak library Ver1.10.
    (The Cinepak library may malfunction if your application uses a Slave CPU.)

There are two possibilities.
In the case of this trouble, there is a possibility that it will be cleared by the response of (1). In fact, the change from 1/60 to 1/50 (from NTSC to PAL) causes symptoms like yours due to the difference in timing.

As a response to the program change, it is possible to change the graphics transfer timing and transfer method.

Other than that, it is conceivable to modify the data for PAL and deal with it, and as a modification method, it is conceivable to drop frames or change keyframes (30 to 25, etc.).


What is the timing of movie registration when doing a seamless branch?

Q)
I have a question about seamless branch playback of a movie.
In the sample (smpcpk5.c), two movies are played continuously, but when playing three or more movies, when should the registration of the third movie [CPK_EntryNext ()] be performed? ??

      > / * Start movie * /
      > CPK_Start (cpk [0]);
      >
      > / * Register the next movie to play * /
      > for (i = 1; i <FILE_MAX; i ++)
      > {
      > CPK_EntryNext (cpk [i]);
      >}

So, if you register when the second movie starts playing, will it behave like detecting the end of the first movie and then issuing CPK_EntryNext?

A)
I don't think there is a problem with the above method.
If you want to enter 3 or more movies one after another, it is effective to prepare two ring buffers and switch the buffers.


What should I be aware of when handling errors?

Q)
What should I be aware of when handling errors?

A)
If an error occurs in the file system or stream system during movie playback, movie playback cannot continue after that.
In this case, delete the movie handle and close the file. After that, perform processing such as playing the movie again.

Be sure to set each error handling function GFS_SetErrFunc, STM_SetErrFunc, CPK_SetErrFunc to detect an error. It also improves debugging efficiency.


Are there any precautions when using SCU-DMA for data transfer?

Q)
Are there any precautions to take when using SCU-DMA to transfer data from a CD block to a ring buffer?

A)
When transferring data from a CD block to a ring buffer with SCU-DMA, peripheral information may not be obtained correctly.
In this case, you can improve by setting the maximum number of transfer sectors (default value 20) small, but if you set it small, you need to call the task function frequently enough to match it.

[Processing example]
CPK_SetTrModeCd (cpk, CPK_TRMODE_SCU); / * Transfer by SCU-DMA * /
CPK_SetLoadNum (cpk, 10); / * Maximum value of one transfer [sector] * /

Also, since the bus used during transfer by SCU-DMA is occupied, SH2 will be in a weighted state from the time it tries to access the CPU bus.
Do not use SCU-DMA as much as possible.


Please tell me about the relationship between the frame size and the Cinepak compression method.

Q)
Please tell me about the relationship between the frame size and the Cinepak compression method.

A)
Cinepak divides one frame into 1 to 3 and compresses it according to the frame size (area).

Before and after the division condition, the internal compression efficiency and image quality become discontinuous, and it is thought that there are the following tendencies.

If it is smaller than the division condition and close to the division condition:
Poor image quality (compression rate is a little good)

When it is larger than the division condition and close to the division condition:
Good image quality (compression rate is a little bad)

The exact division conditions are unknown, but the confirmed range is shown below.

Area [pixel] Number of frame divisions (number of tiles)
96000 = 480 x 200 or more 3
95744 = 352 × 272 or less
59904 = 208 x 288 or more
2
57344 = 256 × 224 or less 1
(Do not divide)
* The Cinepak library supports up to 2 divisions .


What should I do for an efficient processing method for image expansion processing?

Q)
What should be the efficient processing method of image expansion processing?

A)
Since it is more efficient to output the image expansion process to WORK RAM-H than to output it directly to VRAM, the task function operates faster.
If you output to WORK RAM-H and transfer it to VRAM with SCU-DMA, the processing time will be shorter even if you add the transfer time.


I want to make an uncompressed movie.

Q)
I would like to display an uncompressed movie.

A)

(1) Conditions for using uncompressed mode
It is used when you want to reduce the image size and frame rate and give priority to image quality.

It does not support 15-bit color movies. It supports 32K color display of 24-bit data, but it wastes high quality data.

Convert uncompressed QuickTime Movie with MovieToSaturn_J. No functions have been added for playing uncompressed movies.
Since the file header is interpreted and processed, it can be played with exactly the same procedure. However, only the ring buffer must be reserved larger than when compressed.

(2) Ring buffer size
The ring buffer must be secured to meet the following conditions.

ring ≧ header + sound + frame

ring: ring buffer size
header: File header size (rounded up to sector size boundary)
sound: Sound size for 0.5 seconds
frame: 1 frame uncompressed size

(3) Video performance
From the data transfer rate from the CD, the video performance will be as shown below.

Audio conditions Marginal video performance
 44kHz, 16bit stereo
320 × 224 [dot] 0.60 [fps]
 22kHz, 8bit monaural
320 × 224 [dot] 1.32 [fps]
 Video only movie
320 × 224 [dot] 1.42 [fps]
 Video only movie
160 × 112 [dot] 5.71 [fps]


Please tell me about the history output of debug execution.

Q)
Please tell me about the history output of debug execution.

A)
Outputting the execution history of the main processes of the Cinepak library is useful for investigating the cause when there is a malfunction such as not being able to play smoothly. You can check whether task calls are made regularly, data supply is not interrupted, and frames are dropped.

It is easier to analyze the history by making a simpler execution history after confirming the reproducibility of the malfunction.
This function outputs the result to the SIMM area. Therefore, it does not work with SIMM's trivial CartDev + DevSaturn.
In that case, you need to purchase a buffer card of the type that can use SIMM separately.

[Internal processing of Cinepak library that outputs history]
When an error occurs When a task function is called When ring buffer data is supplied and when it is consumed When the display request flag is turned on / off Frame drop processing PCM start / stop

[Specify output]

  1. When using the production program as it is
    Breaks after processing CPK_Init. Look up the address of the CpkdSys type structure cpkd_sys in the map file created during linking, and set the value of cpkd_sys.mode to 0x00000001 with a debugger command.

    Example. Operation from the command line of the E7000 / EVA board

    : m 060XXXXX 1; l

    The output address will be 0x04000000 to 0x047fffff.
    (Turn off SW2-5 <SIMMCART> in Programming Box.)

  2. When creating a program for debug output
    CPK_Init followed by CPKD_SetMode (ON). You can set the output address with CPKD_SetPrintAddr. With CPKD_PrintStr and CPKD_PrintData, it is possible to add and output the execution history of the processing on the application side.

    For additional output, make the output size an integral multiple of 164 bytes to make the history information easier to read.

[Check output information]
Dump the output address with a debugger command. Saving the displayed content as a text file and viewing it with a text editor makes it easier to analyze the behavior.

Example. Operation from the command line of the E7000 / EVA board

:> hist.txt [RET]
: d 04000000 04001000; l [RET]
:>-[RET]

[Format output information]
-------- + ----------------------------------------- --- +
ADDRESS: 0 1 2 3 4 5 6 7 8 9 ABCDEF:
-------- + ----------------------------------------- --- +
04000000: AAAA_AAAA ---- ---- ---- ---- ---- ----:
04000010: "Err" ---- VVVV ---- ---- EEEE_EEEE: Error 
04000020: "Task" PPPP VVVV HHHH_HHHH CCCC_CCCC: start of CPK_MeTask
04000030: "RWri" WWWW VVVV HHHH_HHHH DDDD_DDDD: WRIte Ringbuffer
04000040: "RRea" RRRR VVVV HHHH_HHHH DDDD_DDDD: READ Ringbuffer
04000050: "DOn" FFFF VVVV LLLL_LLLL TTTT_TTTT: set Disp flag On
04000060: "DOff" FFFF VVVV HHHH_HHHH TTTT_TTTT: set Disp flag Off
04000070: "PcmS" MODE VVVV HHHH_HHHH ADDR SIZE: PCM Start
04000080: "PcmE" MODE VVVV HHHH_HHHH ---- ----: PCM Stop
04000090: "LosF" FFFF VVVV LFLF_LFLF SSSS_SSSS: LOse Frame
                              ::
                              ::

[Description of output information]

AAAA_AAAA:
Current history information output address.

---- VVVV:
Vbl counter. You can see the approximate time.

EEEE_EEEE:
Error code.

PPPP ----:
Playback status [-1, 0, 1, 2, 3, 4, 5].

HHHH_HHHH:
Cinepak handle.

CCCC_CCCC:
Cinepak task call counter.

DDDD_DDDD:
The remaining amount of data in the ring buffer [byte]. You can see if the supply is stagnant.

WWWW ----:
Write size to the ring buffer [sector].

RRRR ----:
Read size from the ring buffer [byte].

FFFF ----:
Frame number.

LLLL_LLLL:
Delay time. (Current time-frame display time)

TTTT_TTTT:
Frame time. (Frame display time + Frame display duration)

LFLF_LFLF:
Frame drop counter.

SSSS_SSSS:
Sample counter.

MODE ----:
0x80 ##: Stereo, 0x10 ##: 8bit, 0x ## 03: PCM stream playback number 3
(In the case of PCM Stop, only the PCM stream playback number is displayed)

ADDR ----:
PCM buffer start address (4bit right shift value)

SIZE ----:
PCM buffer size [sample / ch]


The numerical value indicated by the playback time field of the movie playback information is different from the original playback time.

Q)
The numerical value indicated by the playback time field of the playback information of the movie object is different from the original playback time. Could I ask the reason.

A)
QuickTime manages movie time in units called TimeScale, which is finer than timecode. You can manage accuracy up to 1/600 second.

Commercial applications typically use the maximum accuracy of 1/600 second.
Author Editor also handles videos assuming TimeScale is 600.
However, some applications, such as Adobe Premiere, do not necessarily fix the Time Scale to 600.

Therefore, if the resulting movie does not treat TimeScale as 600, the playback time (called DurationTime in QuickTime) will look different.
(However, there is no effect on playback.)

An example is shown below.

<Example: When making a 30-second Cinepak movie>
TimeScale TimeCode DurationTime
1. 600 00:00:30:00 18000 Normal movie
2. 30 00:00:30:00 900 A movie with a Time Scale of 30
3. 20 00:00:30:00 600 A movie with a Time Scale of 20
* TimeScale and DurationTime are consistent just because the unit of time management is different, so note that the above three movies are all genuine crease-correct movies with no apparent difference! !!
When the Author Editor loads a movie with a TimeScale of 30, it calculates the playback time by referring to the number 900 pointed to by DurationTime as follows.

900 ÷ 600 = 1.5

Therefore, the playback time of 30 seconds is mistaken for 1.5 seconds.

【measures】
Use Dumpster (included in QuickTime Developer's Kit) to find out what the TimeScale of your movie is.
Start Dumpster and open the target movie.
Of the numbers that can be referenced here, if TimeScale shows a number other than 600, correct it to 600 (there are multiple locations, so fix all).

In addition, fix the Duration, Track Dur, and samp Dur to be consistent with the TimeScale changes. (Fix all of these as well.) When you have finished making corrections, save and exit.

【postscript】
We are currently investigating and are not sure where the determinants of the Movie Time Scale numbers are. What we now know is that when you make a Cinepak movie using Adobe Premiere, the TimeScale is often something other than 600.

Other compression tools (MovieConverter, ConvertToMovie, Movie Conversion, MovieShop, CoSA After Effects, etc.) always showed a value of 600 as far as I could see.

Therefore, if you don't have to use Premiere, it's best to use an external compression tool to avoid this problem.


BackForward
FAQMovie related
Copyright SEGA ENTERPRISES, LTD ,. 1997