AN1482 ST Microelectronics, Inc., AN1482 Datasheet - Page 5
![no-image](/images/no-image-200.jpg)
AN1482
Manufacturer Part Number
AN1482
Description
Mpeg2 Main Profile Video Decoding on St100
Manufacturer
ST Microelectronics, Inc.
Datasheet
1.AN1482.pdf
(8 pages)
Table 3 : Huffman decoding/Inverse quantization/Inverse scan
All these functions are located in the module getblk.st1. The Huffman look-up tables needed for these
functions takes 1732 bytes (read-only data memory).
2.4 - Temporal Prediction
This function is basically made of three parts: the memory read from the external frame buffer, the
computation of horizontal and/or vertical interpolation and/or the average with the previously computed
predictor in case of bidirectional interpolation or dual prime prediction.
The first task is left to a DMA, that will be programmed with the address of the predictor just after the
macroblock header decoding, based on the prediction type information and on the motion vectors. For P
skipped macroblocks, the DMA will directly copy the predictor into the current frame buffer.
So, the profiling reported here only includes the computational cost of the interpolation and/or average.
An efficient implementation should envisage the use of a "powered" DMA, able to make itself this task, in
particular to cope with B skipped macroblocks. For these on, a simple memory copy is not enough, since
a B skipped macroblock inherit the prediction mode and the vectors from the previous one, whereas a P
skipped macroblock is simply patched with the corresponding one in the previous image.
Anyway, the software complexity of this task is computed here for the sake of completeness and for an
eventual implementation on a small video format. There are several possible combinations of
interpolations/average. The following Table 4 gives the number of clock cycles needed for a 16x16
luminance macroblock computation, in the different cases. The function is located in the module
motion_comp.st1 and its name is form_component_prediction().
Table 4 : Temporal prediction : the different cases
The code size for this function is of 5524 bytes. A read-only table of 48 bytes is needed for the jump at the
beginning (switch structure). The algorithm for the chroma components is the same, but the cost is
reduced by a factor 4 for each component.
2.5 - Bitstream Parsing
This block represents a set of small functions that are used basically to decode the macroblock headers
(containing information about the contents of the macroblock and the motion vectors). These functions
are located in the modules mb_headers.st1 ( macroblock_modes(), Get_coded_block_pattern(),
Get_macroblock_address_increment() ) and motion.st1( motion_vector() and motion_vectors() ).
The code size of these functions amounts to 2336 bytes. The data memory needed for the Huffman
tables is of 584 bytes. The computational cost of these functions cannot be provided as standalone, since
it depends on the bitstream to be decoded.
Decode_MPEG1_Intra_Block()
Decode_MPEG1_Non_Intra_Block()
Decode_MPEG2_Intra_Block()
Decode_MPEG2_Non_Intra_Block()
Simple copy
Copy with average
Vertical interpolation
Vertical interpolation + average
Horizontal interpolation
Horizontal interpolation + average
Vert+Hor interpolation
Vert+Hor interpolation + average
Function
Operation
Code Size (Bytes)
1272
1040
1184
896
Clock Cycles For 16x16 Luminance
AN1482 - APPLICATION NOTE
125
240
274
434
271
431
623
815
Cycles/Symbol
24
24
24
24
5/8