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:

Defining the Start Time

The display start time is triggered by the STA_DSP (Start Display) command (opcode 0x01). In practical scenarios:

  1. The first control sequence (SP_DCSQ 0) usually features an SP_DCSQ_STM value of 0x0000.
  2. When the system clock matches the PES PTS, execution begins immediately.
  3. The decoder processes the STA_DSP command alongside color lookup, contrast, and coordinate mapping commands (SET_COLOR, SET_CONTR, SET_DAREA).
  4. 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:

  1. The initial sequence points to a second sequence (SP_DCSQ 1) via SP_NXT_DCSQ_SA.
  2. The second sequence defines an SP_DCSQ_STM representing the total visible duration of the subtitle, measured from the base PTS.
  3. When the playback time reaches Base PTS + SP_DCSQ_STM, the decoder executes the STP_DSP command found in this second sequence.
  4. 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: