Philips Semiconductors
Variable Length Decoder
File: vld.fm5, modified 7/26/99
PRELIMINARY INFORMATION
14-3
The VLD_BIT_ADR and VLD_BIT_CNT registers are
updated after each read from main memory. The content
of the VLD_BIT_ADR register reflects the next address
from which the bitstream data will be fetched. The con-
tent of the VLD_BIT_CNT register reflects the number of
bytes remaining to be read before the current transfer is
complete. When the number of bytes remaining to be
read from main memory becomes zero, a status flag is
set and an interrupt can be generated to the DSPCPU.
The DSPCPU will provide the new bitstream buffer ad-
dress and the number of bytes in the bitstream buffer to
the VLD.
14.5
VLD OUTPUT
The VLD outputs two data streams which are written
back to main memory by two output DMA engines.
These DMA engines are programmed by the DSPCPU.
One of the output streams contains macroblock header
information and the other contains run-length encoded
DCT coefficients. Each DMA engine contains a 64-byte
FIFO which is transferred to main memory once it is full.
The main memory address and count for the macroblock
header output are contained in the VLD_MBH_ADR and
VLD_MBH_CNT registers respectively. The main mem-
ory address and count for the DCT coefficient output are
contained in the VLD_RL_ADR and VLD_RL_CNT reg-
isters respectively. The counts for both the macroblock
header and coefficient data are expressed in terms of 32-
bit (4 bytes) words.
14.5.1
Macroblock Header Output Data
For each MPEG2 macroblock parsed by the VLD, six 32-
bit words of macroblock header information will be output
from the VLD.
Figure 14-2 pictures the layout of the VLD
output, while the fields are described in
Table 14-1. Note
that these fields may or may not be valid depending upon
the MPEG2 video standard[2]. For example, motion vec-
tors are not valid for intra coded macroblocks. Similarly,
‘DCT Type’ is not valid for field pictures.
For each MPEG1 macroblock parsed by the VLD, four
32-bit words of macroblock header information will be
output from the VLD.
Figure 14-3 pictures the layout of
the VLD output, while the fields are described in
Table 14-2. Note that these fields may or may not be val-
id depending upon the MPEG1 video standard[1].
Table 14-1. References for the MPEG-2 Macroblock
Header Data
Item
Default
value
References from MPEG-2
Video Standard, IS 13818-2
document
Esc Count
0
Section 6.2.5
MBA Inc
-
Section 6.2.5 and Table B-1
MB Type
Unde-
ned
Section 6.2.5.1 and Tables B-
2, B-3, and B-4; Only 5 Msb
bits from the tables are used
MotType
Unde-
ned
Section 6.2.5.1; Field or Frame
motion type will be decided by
the user
DCT Type
Unde-
ned
Section 6.2.5.1
MV Count
Unde-
ned
Tables 6-17 and 6-18. The MV
Count value is one less than
the value from the tables.
MV Format
Unde-
ned
Tables 6-17 and 6-18
DMV
Unde-
ned
Tables 6-17 and 6-17
MV Field Sel[0]0] to
MV Field Sel[1][1]
Unde-
ned
Section 6.2.5 and 6.2.5.2
Motion
Code[0][0][0] to
Motion
Code[1][1][1]
Unde-
ned
Section 6.2.5.2.1 and Table B-
10
Motion Resid-
ual[0][0][0] to
Motion Resid-
ual[1][1][1]
Unde-
ned
Section 6.2.5.2.1; the corre-
sponding rsize bits are
extracted from the bitstream
and stored as left justied; to
get the nal value shift the
given number by 8 (corre-
sponding rsize). The rsize val-
ues are stored in VLD_PI
register
dmvector[1] and
dmvector[0]
Unde-
ned
Section 6.2.5.2.1 and Table B-
11; signed 2-bit integer from
Table B11.
CBP
-
Section 6.2.5, 6.2.5.3 and
Table B-9
Quant Scale
-
Section 6.2.5; 5-bit from bit-
stream and use Table 7-6 to
compute the quant scale value.
Table 14-2. References for the MPEG-1 Macroblock
Header data
Item
Default
value
References from IS 11172-2
document
Esc Count
0
Section 2.4.3.6
MBA Inc
-
Section 2.4.3.6
MB Type
Unde-
ned
Section 2.4.3.6 and Tables B-
2a to B2d
Motion
Code[0][0][0] to
Motion
Code[0][1][1]
Unde-
ned
Section 2.4.2.7 and Table B-4
Motion Resid-
ual[0][0][0] to
Motion Resid-
ual[0][1][1]
Unde-
ned
Section 2.4.2.7;the corre-
sponding rsize bits are
extracted from the bitstream
and stored as left justied; to
get the nal value shift the
given number by (8 - corre-
sponding rsize). The rsize val-
ues are stored in VLD_PI
register.
CBP
-
Section 2.4.3.6 and Table B-3
Quant Scale
-
Section 2.4.2.7