Philips Semiconductors
Variable Length Decoder
File: vld.fm5, modified 7/26/99
PRELIMINARY INFORMATION
14-7
14.9
VLD OPERATIONAL REGISTERS
14.9.1
VLD Command (VLD_COMMAND)
This register indicates the next action to be taken by the
VLD. Some commands have an associated count which
resides in the least significant 8 bits of this register.
There are currently five commands recognized by the
VLD block:
Shift the bitstream by “count” bits (“count” must be
less than or equal to 15)
Parse “count” un-skipped macroblocks
Search for the next start code
Reset the VLD
Flush the VLD output buffers
The DSPCPU must wait for the VLD to halt before the
next command can be issued. Note that there are sever-
al ways in which a command may complete. Only a suc-
cessful
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 requested number of items has
been processed. Note also that expiration of a DMA
count does not constitute completion of a command.
When a DMA count expires the VLD is stalled as it waits
for a new DMA to be initiated. It is not halted. Default val-
ue (after hardware reset) is 0. VLD_COMMAND fields
are described in
Table 14-5 and the different commands
Table 14-5. VLD Command Register
Name
Size
(bits)
Description
COUNT
8
Count for current command
COMMAND
4
VLD command to be exe-
cuted
Table 14-6. VLD Commands
Command
Field
coding
Flags Set after
Completion of the
Command
Description
Shift the bit-
stream by “count”
bits
1
COMMAND_DONE
or
DMA_IN_DONE
VLD shifts the number of bits in its internal shift register. The shift register value
is available in the VLD_SR register.
The DMA_IN_DONE ag will be set when VLD runs out of data from input FIFO.
The ag is reset by issuing the new command.
Search for the
next start code
3
STARTCODE
or
COMMAND_DONE
or
DMA_IN_DONE
VLD search for a start code. The search code has 0x000001 prex and an addi-
tional 8-bit value.
The DMA_IN_DONE ag will be set when VLD runs out of data from input FIFO.
The STARTCODE detected ag is reset by writing a ‘1’ value to the ag.
The COMMAND_DONE flag is reset by issuing the new command.
Reset the VLD
4
None
Refer section
14.12 for more details
Parse for a given
number of mac-
roblocks
2
COMMAND_DONE
or
STARTCODE
or
ERROR
or
DMA_IN_DONE
VLD parses for a given number of un-skipped macroblocks and the associated
run-level values. COUNT eld will indicate the remaining macroblocks to parse.
Note that this number is slightly inaccurate since a parsed macroblock can still
be in internal 64-byte FIFO.
If VLD encounters a start code, the parsing action will be terminated and VLD
sets only the STARTCODE detected ag. If VLD parses the given number of un-
skipped macroblocks without encountering a start code, VLD will set the
COMMAND_DONE flag.
The ERROR ag will be set when VLD encounters an error while parsing the bit-
stream.
The DMA_IN_DONE ag will be set when VLD runs out of data from input FIFO.
The STARTCODE detected ag is reset by writing a ‘1’ value to the ag.
The COMMAND_DONE flag is reset by issuing the new command.
Flush the VLD
output buffer
8
COMMAND_DONE
VLD ushes the remaining macroblock header data and the remaining run-level
data to the main memory. The highway byte-enables will be used in order to
write only the valid data to the main memory. Only the valid word count values
written to the main memory will be subtracted from the VLD_MBH_CNT and the
VLD_RL_CNT registers.