Difference between revisions of "CVD subtitles"

From VideoLAN Wiki
Jump to navigation Jump to search
(Document the CVD subtitle format)
 
(Wikipedia says CVDs are closely related to SVCDs)
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The following information is culled by Rocky Bernstein from information provided by Julio Sanchez Fernandez in [http://subhandler.sourceforge.net http://subhandler.sourceforge.net]
+
'''CVD subtitles''' are [[subtitle]]s for CVDs (China Video Discs), a disc format closely related to [[SVCD]]s (Super Video CDs).
  
We do not have information on the subtitle format used on CVD's except the submux sample code and a couple of samples of dubious origin. Thus, the information below is result of reading some code whose correctness is not known and some experimentation.
+
A technical description is avaliable from the websites below:
 +
* [http://www.vcdimager.org/pub/vcdimager/manuals/0.7/cvd-subtitles.html CVD (Chaoji VCD) Subtitles Technical Description (vcdimager.org)]
 +
* [http://www.videohelp.com/forum/userguides/98177.php CVD (China Video Disc) Introduction and comparison to similar formats (videohelp.com)]
  
CVD subtitles are different in several ways from [[OGT|SVCD OGT]] subtitles.
+
[[Category:Subtitles]]
 
 
The image data comes first and meta data is at the end.  So that the metadata can be found easily, the subtitle packet starts with two bytes (everything is big-endian again) that the image data comes interlaced and is run-length encoded (RLE). Each field is a four-bit nibbles that is further subdivided in a two-bit repeat count and a two-bit color number - up to three pixels can be described in four bits.  What a 0 repeat count means not known.  It
 
might be used for RLE extension.  There is a special case of a 0 repeat count that has been inferred: when the full nibble is zero, the rest of the line is filled with the color value in the next nibble. It is unknown what happens if the color value is greater than three.
 
The rest seems to use a 4-entries palette.  It is possible that the fill-line general case above is not as described and the zero repeat count means fill line.  But since this hasn't been ever seen, the preceding is only conjecture.
 
 
 
Here is information given at the start of a subtitle:
 
 
 
* SPU size        2 bytes
 
* metadata offset 2 bytes
 
 
 
Although metadata information does come in a fixed field order, every metadata field consists of a tag byte followed by parameters. In all cases seen, the size including the tag byte is exactly four bytes.
 
 
 
{|
 
! code  !!  Meaning
 
|-
 
| 0x0c ||Unknown
 
|-
 
| 0x04 || 24-bit subtitle duration in 1/90000ths of a second
 
|-
 
| 0x17 ||upper left x, y position, each a 10-bit value, encoded:
 
          x = ((p[1]&0x0f)<<6) + (p[2]>>2)
 
          y = ((p[2]&0x03)<<8) + p[3];
 
|-
 
| 0x1f || lower right x, y position, each a 10-bit (0-1023) value, encoded as above
 
|-
 
| 0x24    || 3 bytes primary palette 0 - 1 byte for each of y, u, and v
 
|-
 
| 0x25    || 3 bytes primary palette 1 - 1 byte for each of y, u, and v
 
|-
 
| 0x26    || 3 bytes primary palette 2 - 1 byte for each of y, u, and v
 
|-
 
| 0x27    || 3 bytes primary palette 3 - 1 byte for each of y, u, and v
 
|-
 
| 0x2c    || 3 bytes highlight palette 0 - 1 byte for each of y, u, and v
 
|-
 
| 0x2d    || 3 bytes highlight palette 1 - 1 byte for each of y, u, and v
 
|-
 
| 0x2e    || 3 bytes highlight palette 2 - 1 byte for each of y, u, and v
 
|-
 
| 0x2f    || 3 bytes highlight palette 3 - 1 byte for each of y, u, and v
 
|-
 
| 0x37    || 3 bytes transparency for primary palette - 1 byte for each of y, u  and v
 
|-
 
| 0x3f    || 3 bytes transparency for highlight palette - 1 byte for each  of y, u  and v
 
|-
 
| 0x47    || Offset to start of even rows of interlaced image.
 
|-
 
| 0x4f    || Offset to start of odd rows of interlaced image.
 
|}
 

Latest revision as of 06:39, 23 February 2019

CVD subtitles are subtitles for CVDs (China Video Discs), a disc format closely related to SVCDs (Super Video CDs).

A technical description is avaliable from the websites below: