
L64005 MPEG-2 Audio/Video Decoder Technical Manual
8-3
Final Rev F
Copyright 1996 by LSI Logic Corporation. All rights reserved.
matches the requested stream (if enabled). If the parser does not nd a
match, it discards the remainder of the packet. The parser uses the
Packet Length eld to determine where the packet ends. Determining
where the packet ends is necessary to avoid mistakenly parsing the pos-
sible emulation of restart codes in audio packet data.
If the stream I.D. is an audio stream, the parser skips any packet stufng
bytes and moves the remainder of the packet header into the system
channel buffer. This causes an audio packet interrupt to indicate that the
packet header is in the system channel. The parser then samples the
write pointer for the audio elementary stream buffer and moves its value
into the system channel buffer. The host can subsequently use this value
for system synchronization. The parser then moves the packet payload
into the audio elementary stream channel buffer. The parser uses the
Packet Length eld in the packet header to determine the end of the
audio elementary data payload.
If the stream I.D. is a video stream, the parser skips any packet stufng
bytes and moves the remainder of the packet header into the system
channel buffer. This causes a video packet interrupt to indicate that the
packet header is in the system channel buffer. The parser then samples
the write pointer for the video elementary stream buffer and stores its
value in the system channel buffer. The host can subsequently uses this
value for system synchronization. The parser then moves the packet pay-
load into the video elementary stream channel buffer.
Note that the system parser must be able to parse the Packet header
because there is no header length eld.
The only error that the parser can detect is a mismatch between the
packet length eld and the next packet start code. If this occurs, the
preparser generates an interrupt and optionally clears the elementary
stream channel buffers and the system channel buffers.
8.1.1.2 Parsing an MPEG-2 Program Stream
Parsing an MPEG-2 program stream is very similar to the MPEG-1 case.
System data is presented to the decoder over the serial or parallel chan-
nel interface. When the decoder encounters any System Start Code, it
causes the decoder to synchronize to it, if it is not already in sync. The
decoder then stores the packet headers in the system channel buffer as
follows. The decoder moves the Pack Header, Packet Headers and Sys-