8-18
System Stream Decoding and Synchronization
Final Rev F
Copyright 1996 by LSI Logic Corporation. All rights reserved.
There are two basic parts to synchronization. First, the synchronization
must be acquired, regardless of the initial state of the decoder and the
state of its buffers. Second, synchronization must be maintained in the
event of errors in the bit stream. Clearly, in closed systems, such as com-
puter multimedia and CD players, channel errors are signicantly less
likely and special handling may not be required. However, in applications
with an unreliable transport, the decoder must track the PTSs continu-
ously to minimize the effect of errors.The sync controller in the system
runs with the host microprocessor as the loop controller to allow signi-
cant exibility at minimal cost.
A number of operations are needed to achieve and maintain synchroni-
zation:
Clock recovery – recovering and tracking the system clock from the
PCR or the ESCR.
PTS association – recovering the PTS or DTS data from the system
layer and associating these with a presentation unit such as a video
picture SC or an audio frame in the elementary layer.
Measuring the presentation time – determining the actual presenta-
tion time of the presentation unit—audio or video.
Calculating presentation error – determining the amount of sync error
from the ideal PTS value for any presentation unit.
Adjustment of synchronization – based upon the presentation error,
adjust the video or audio play rate to reduce the error towards zero.
The clock recovery and PTS association are handled at PES header
interrupt time. The other three operations—measuring presentation time,
calculating presentation error, and adjusting synchronization— are han-
dled at the audio sync interrupt and the video vertical sync interrupt,
when the video and audio units are presented.
The following steps describe in detail the operations required for accom-
plishing audio/video synchronization. Assume that the MPEG-2 bit
stream is delivered from transport level —which means that the L64005
receives multiplexed video and audio PES bit streams. The SCR can be
transmitted in PCR eld of the transport layer, or optionally, in the ESCR
eld of the PES header. Because the L64005 cannot accept transport
layer packets, it cannot receive the PCR. A transport device such as LSI
Logic’s L64007 Transport Demultiplexer can perform clock recovery and