Enum DVDSubPictureCoding
- Namespace
- VisioForge.Core.Types.MediaInfo
- Assembly
- VisioForge.Core.dll
Specifies the encoding method used for DVD subpicture (subtitle and menu overlay) data streams.
public enum DVDSubPictureCodingFields
RunLength = 0-
Standard DVD subpicture encoding using run-length encoding (RLE) compression.
Run-length encoding is the primary compression method for DVD subpictures. It works by encoding consecutive pixels of the same color as a count followed by the color value, significantly reducing the data size for typical subtitle and menu graphics.
RLE encoding process: - Pixels are encoded in pairs (2 pixels = 1 byte) - Runs of identical pixel pairs are compressed - Special codes indicate line endings and field switches - Achieves compression ratios of 10:1 or better for typical subtitles
This format is mandatory for all DVD players and ensures universal compatibility. The RLE data is organized as: - Top field data (even lines for interlaced video) - Bottom field data (odd lines for interlaced video) - Display control commands (timing, palette, position)
Extended = 1-
Extended subpicture coding format with additional capabilities beyond standard RLE.
Extended coding formats may include: - Enhanced compression algorithms - Support for more than 4 colors - Anti-aliased text rendering - Animation sequences for menu transitions - Advanced transparency effects
While the DVD specification allows for extended formats, they must maintain backward compatibility with standard players. Extended features are typically used in special editions or enhanced DVD formats while providing fallback to standard RLE for basic players.
Common extensions include: - HD-DVD and Blu-ray subtitle formats - Proprietary studio enhancements - PC-DVD additional features - Interactive subtitle formats
Other = 2-
Other or proprietary subpicture coding format not covered by standard specifications.
This value indicates a non-standard encoding format that may be: - Vendor-specific implementations - Experimental or development formats - Region-specific variations - Future format reservations
Players encountering this format should: - Check for codec availability - Provide appropriate error handling - Fall back to standard formats if available - Inform users about compatibility issues
Use of non-standard formats may limit disc playability to specific players or regions, so this is rarely used in commercial releases.
Examples
// Checking subpicture encoding type
var subpicAttrs = dvdInfo.GetSubpictureAttributes(streamNumber);
switch (subpicAttrs.Coding)
{
case DVDSubPictureCoding.RunLength:
Console.WriteLine("Standard DVD subpicture with RLE compression");
break;
case DVDSubPictureCoding.Extended:
Console.WriteLine("Extended coding format with enhanced features");
break;
case DVDSubPictureCoding.Other:
Console.WriteLine("Non-standard or proprietary coding format");
break;
}
Remarks
DVD subpictures are overlay graphics used for subtitles, karaoke lyrics, menu buttons, and other visual elements that appear on top of the main video. The DVD-Video specification defines specific compression methods to efficiently store these graphics while maintaining compatibility across all DVD players.
Subpicture data characteristics: - 2-bit color depth (4 colors maximum per subpicture) - Resolution matches the video frame (720x480 NTSC, 720x576 PAL) - Includes transparency information for each pixel - Compressed using run-length encoding to minimize storage
The compression is particularly effective because: - Subtitles contain large areas of transparency - Text and graphics typically use solid colors - Menu highlights often consist of simple geometric shapes - The 4-color limitation encourages simple, compressible designs
Color palette structure: - Color 0: Background (usually transparent) - Color 1: Pattern/foreground (text color) - Color 2: Emphasis 1 (outline or shadow) - Color 3: Emphasis 2 (additional highlight)