How SPU Defines Start and Stop Times in a VOB
A Subpicture Unit (SPU) inside a DVD Video Object (VOB) file manages its presentation timing through a two-tier synchronization mechanism. While the overarching MPEG-2 Packetized Elementary Stream (PES) header supplies the baseline Presentation Time Stamp (PTS) to lock the subpicture to the global audio and video streams, internal structures known as Display Control Sequence Tables (SP_DCSQT) calculate relative execution offsets. Together, these elements determine the exact field or frame when a subtitle or graphic overlay becomes visible and when it disappears from the screen.
The Baseline Timing: MPEG-2 PES PTS
At the container level, subpicture streams are multiplexed within standard MPEG-2 Program Stream packets. When an SPU begins, its first PES packet contains a 33-bit Presentation Time Stamp (PTS) clocked at 90 kHz.
This PTS acts as the master reference point (\(T_0\)) for the entire SPU. It informs the DVD player's subpicture decoder precisely when the SPU data should be loaded into the buffer and made ready for processing relative to the accompanying audio and video packets.
Internal Sequencing: The SP_DCSQT
While the PTS establishes the baseline start reference, the SPU
itself contains an internal control block called the Subpicture Display
Control Sequence Table (SP_DCSQT). This table resides at
the end of the SPU and contains one or more Display Control Sequences
(SP_DCSQ).
Each SP_DCSQ contains:
SP_DCSQ_STM(Start Time): A 16-bit relative execution offset measured in video field intervals (typically 1/50th of a second for PAL or 1/59.94th of a second for NTSC, or derived from a 90 kHz/1024 clock multiplier). This offset is added to the initial PES PTS to define the exact execution moment of the commands within that sequence.SP_NXT_DCSQ_SA(Next Sequence Address): A pointer directing the decoder to the next control sequence, allowing chained display modifications over time.- Display Control Commands (
SP_DCC_MD): Operational opcodes that modify the display state.
Defining the Start Time
The display start time is triggered by the STA_DSP
(Start Display) command (opcode 0x01). In practical
scenarios:
- The first control sequence (
SP_DCSQ 0) usually features anSP_DCSQ_STMvalue of0x0000. - When the system clock matches the PES PTS, execution begins immediately.
- The decoder processes the
STA_DSPcommand alongside color lookup, contrast, and coordinate mapping commands (SET_COLOR,SET_CONTR,SET_DAREA). - The decoded pixel buffer becomes visible on the video output at that exact field.
If a delay is required between SPU arrival and display,
SP_DCSQ_STM is set to a non-zero value, postponing the
execution of STA_DSP until that relative duration has
elapsed.
Defining the Stop Time
The visibility of an SPU terminates when the decoder executes the
STP_DSP (Stop Display) command (opcode 0x02).
This is typically scheduled through a chained control sequence:
- The initial sequence points to a second sequence
(
SP_DCSQ 1) viaSP_NXT_DCSQ_SA. - The second sequence defines an
SP_DCSQ_STMrepresenting the total visible duration of the subtitle, measured from the base PTS. - When the playback time reaches
Base PTS + SP_DCSQ_STM, the decoder executes theSTP_DSPcommand found in this second sequence. - The display generator stops blending the subpicture buffer with the background video, removing the subtitle.
Implicit Termination Conditions
If a subpicture lacks an explicit STP_DSP command,
display termination is handled by external stream events:
- Arrival of a New SPU: Subpicture channels operate sequentially; loading and activating a subsequent SPU on the same sub-stream will overwrite or reset the active display buffer.
- Cell or VOB Boundaries: Reaching the end of a DVD Cell, Program Chain (PGC), or VOB unit forces the subpicture decoder to flush its current display buffers, automatically terminating any lingering SPU overlays.