7.9 Decoder

7.9 Decoder

The decoder block diagram is based on the same principle as the local decoder associated with the encoder as shown in Figure 7.16.

click to expand
Figure 7.16: A block diagram of an MPEG-1 decoder

The incoming bit stream is stored in the buffer, and is demultiplexed into the coding parameters such as DCT coefficients, motion vectors, macroblock types, addresses etc. These are then variable length decoded using the locally provided tables. The DCT coefficients after inverse quantisation are inverse DCT transformed and added to the motion compensated prediction (as required) to reconstruct the pictures. The frame stores are updated by the decoded I and P-pictures. Finally, the decoded pictures are reordered to their original scanned form.

At the beginning of the sequence, the decoder will decode the sequence header, including the sequence parameters. If the bit stream is not constrained, and a parameter exceeds the capability of the decoder, then the decoder should be able to detect this. If the decoder determines that it can decode the bit stream, then it will set up its parameters to match those defined in the sequence header. This will include horizontal and vertical resolutions and aspect ratio, the bit rate and the quantisation weighting matrices.

Next, the decoder will decode the group of picture header field, to determine the GOP structure. It will then decode the first picture header in the group of pictures and, for constant bit rate operation, determine the buffer fullness. It will delay de-coding the rest of the sequence until the input buffer is filled to the correct level. By doing this, the decoder can be sure that no buffer overflow or underflow will occur during decoding. Normally, the input buffer size will be larger than the minimum required by the bit stream, giving a range of fullness at which the decoder may start to decode.

If it is required to play a recorded sequence from a random point in the bit stream, the decoder should discard all the bits until it finds a sequence start code, a group of pictures start code, or a picture start code which introduces an I-picture. The slices and macroblocks in the picture are decoded and written into a display buffer, and perhaps into another buffer. The decoded pictures may be postprocessed and displayed in the order defined by the temporal reference at the picture rate defined in the sequence header. Subsequent pictures are processed at the appropriate times to avoid buffer overflow and underflow.

7.9.1 Decoding for fast play

Fast forward can be supported by D-pictures. It can also be supported by an appropriate spacing of I-pictures in a sequence. For example, if I-pictures were spaced regularly every 12 pictures, then the decoder might be able to play the sequence at 12 times the normal speed by decoding and displaying only the I-pictures. Even this simple concept places a considerable burden on the storage media and the decoder. The media must be capable of speeding up and delivering 12 times the data rate. The decoder must be capable of accepting this higher data rate and decoding the I-pictures. Since I-pictures typically require significantly more bits to code than P and B-pictures, the decoder will have to decode significantly more than the of the data rate. In addition, it has to search for picture start codes and discard the data for P and B-pictures. For example, consider a sequence with N = 12 and M = 3, such as:

  • I B B P B B P B B P B B I B B

Assume that the average bit rate is C, each B-picture requires 0.6C, each P-picture requires 1.4C and the remaining 3C are assigned to the I-picture in the GOP. Then the I-pictures should code per cent of the total bit rate in just of the display time.

Another way to achieve fast forward in a constant bit rate application is for the medium itself to sort out the I-pictures and transmit them. This would allow the data rate to remain constant. Since this selection process can be made to produce a valid MPEG-1 video bit stream, the decoder should be able to decode it. If every I-picture of the preceding example were selected, then one I-picture would be transmitted every three picture periods, and the speed up rate would be times.

If alternate I-pictures of the preceding example were selected, then one I-picture would again be transmitted every three picture periods, but the speed up rate would be times. If one in N I-pictures of the preceding example were selected, then the speed up rate would be 4N.

7.9.2 Decoding for pause and step mode

Decoding for pause requires the decoder to be able to control the incoming bit stream, and display a decoded picture without decoding any additional pictures. If the decoder has full control over the bit stream, then it can be stopped for pause and resumed when play begins. If the decoder has less control, as in the case of a CD-ROM, there may be a delay before play can be resumed.

7.9.3 Decoding for reverse play

To decode a bit stream and play in reverse, the decoder must decode each group of pictures in the forward direction, store the entire decoded pictures, then display them in reverse order. This imposes severe storage requirements on the decoder in addition to any problems in gaining access to the decoded bit stream in the correct order.

To reduce decoder memory requirements, groups of pictures should be small. Unfortunately, there is no mechanism in the syntax for the encoder to state what the decoder requirements are in order to play in reverse. The amount of display buffer storage may be reduced by reordering the pictures, either by having the storage unit read and transmit them in another order, or by reordering the coded pictures in a decoder buffer. To illustrate this, consider the typical group of pictures shown in Figure 7.17.

start figure

B

B

I

B

B

P

B

B

P

B

B

P

pictures in display order

0

1

2

3

4

5

6

7

8

9

10

11

temporal reference

I

B

B

P

B

B

P

B

B

P

B

B

pictures in decoding order

2

0

1

5

3

4

8

6

7

11

9

10

temporal reference

I

P

P

P

B

B

B

B

B

B

B

B

pictures in new order

2

5

8

11

10

9

7

6

4

3

1

0

temporal reference

end figure

Figure 7.17: Example of group of pictures, in the display, decoding and new orders

The decoder would decode pictures in the new order, and display them in the reverse of the normal display. Since the B-pictures are not decoded until they are ready to be displayed, the display buffer storage is minimised. The first two B-pictures, 0 and 1, would remain stored in the input buffer until the last P-picture in the previous group of pictures was decoded.



Standard Codecs(c) Image Compression to Advanced Video Coding
Standard Codecs: Image Compression to Advanced Video Coding (IET Telecommunications Series)
ISBN: 0852967101
EAN: 2147483647
Year: 2005
Pages: 148
Authors: M. Ghanbari

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net