Philips Semiconductors
PNX15xx Series
Volume 1 of 1
Chapter 21: MPEG-1 and MPEG-2 Variable Length Decoder
12NC 9397 750 14321
Koninklijke Philips Electronics N.V. 2002-2003-2004. All rights reserved.
Product data sheet
Rev. 2 — 1 December 2004
21-8
The CPU must wait for the VLD to halt before the next command can be issued. Note
that there are several ways in which a command may complete. Only a successful
completion is indicated by the command done bit in the status register. A command
may complete unsuccessfully if a start code or an error is encountered before the
Table 4: VLD Commands
Code Command
Flags Set
(after completion
of the command)
Description
0x1
Shift the bitstream
by ‘‘count’’ bits
Command Done
VLD shifts the number of bits in its internal shift register. The shift register
value is available in the VLD_SR register.
The flag is reset by issuing the new command.
0x2
Parse for a given
number of
macroblocks
Command Done
and/or Start Code
Detected
VLD parses for a given number of macroblocks; however, if VLD
encounters a start code, the parsing action will be terminated and VLD sets
only the start code detected flag. If VLD parses the given number of
macroblocks without encountering a start code, VLD will set the command
done flag.
The start code detected flag is reset by writing a ‘1’ value to the flag.
The command done flag is reset by issuing the new command
0x3
Searchforthenext
start code
Start Code
Detected and
Command Done
VLD search for a start code. The search code has 0x000001 prefix and
additional 8-bit value; a 32-bit value with 0x000001 prefix.
the start code detected flag is reset by writing a ‘1’ value to the flag.
The command done flag is reset by issuing the new command
0x4
Reset the Variable
Length Decoder
Command Done
Refer to
Section 3.4 Error Handling
.
0x5
Initialize the VLD
None
The bit count register is initialized to zero. The initialization action is
immediate without any delay.
0x6
Search for the
given start code
Start Code
Detected and
Command Done
VLD search for a start code with a given 8-bit lsb of the 32-bit start code.
The search code has 0x000001 prefix and the additional 8-bit value is
given in the ‘count’ field of the VLD_COMMAND register.
The start code detected flag is reset by writing a ‘1’ value to the flag.
The command done flag is reset by issuing the new command
0x7
Parse one row of
macroblocks
Start Code
Detected
This command instructs the VLD to parse one complete row of
macroblocks. If the row contains more than one slice, VLD parses the
intermediate slice headers without CPU intervention, provided these slice
headers have a 0 bit after the 5-bit quantizer_scale_code. If the VLD
encounters a start code different from the start code of the current slice, or
if the slice header has a 1 bit after the quantizer_scale_code, it sets the
Start-Code-Detected flag and ends the operation.
WARNING:
The ‘Count’ field of the VLD_COMMAND register is still in
effect as in the ‘Parse A Number Of Macroblocks’ Command: VLD stops
and sets the Command-Done flag after ‘Count’ macroblock headers are
parsed. ‘Count’ must be set to at least mb_width (number of macroblocks
per row in the picture) to guarantee the entire row is parsed before the VLD
stops.
0x8
Flush Write FIFOs Command Done
The VLD flushed the remaining macroblock header data and the remaining
run-level data to the main memory.
0x9
Parse Long
Command Done
This command instructs the VLD to parse and to continue as long as the
next start code ID is for the next slice. Any other start code ID will cause
the VLD to stop and interrupt with the ‘Command Done’ status bit set.
Note the count field cannot be programmed to 0.