Wireless Communication Systems @CS.NCTU Lecture 8: Video H261 - - PowerPoint PPT Presentation

wireless communication systems
SMART_READER_LITE
LIVE PREVIEW

Wireless Communication Systems @CS.NCTU Lecture 8: Video H261 - - PowerPoint PPT Presentation

Wireless Communication Systems @CS.NCTU Lecture 8: Video H261 Instructor: Kate Ching-Ju Lin ( ) Chap. 10.4 of Fundamentals of Multimedia Outline Introduction Frame sequence Frame coding Quantization


slide-1
SLIDE 1

Lecture 8: Video – H261

Instructor: Kate Ching-Ju Lin (林靖茹)

Wireless Communication Systems

@CS.NCTU

  • Chap. 10.4 of “Fundamentals of Multimedia”
slide-2
SLIDE 2

Outline

  • Introduction
  • Frame sequence
  • Frame coding
  • Quantization
  • Encoder and decoder
  • H.261 syntax

2

slide-3
SLIDE 3

Introduction to H.261

  • Video coding and decoding for the moving

picture component of audiovisual services at the rates of p × 64 (kbps), where p ranges form 1 to 30

  • Improve storage and transmission efficiency in

ISDN (Integrated Service Digital Network)

  • considering a relatively low bitrate
  • Belong to the following set of ITU

recommendations

  • H.221, H230, H.242, H.261, H.320

3

slide-4
SLIDE 4

Example: Recommendation H.320

Video Equipment Audio Equipment Data and Image (T.4,T.6,T.81,T.83) Video Codec (H.261) Audio Codec (G.722,G.726,G.728) System Control (H.230,H.242) MUX/DMUX (H.221) Delay End-to-end Network Signaling (ISDN Standards) Network Interface (ISDN Standards)

4

slide-5
SLIDE 5

Video Formats in H.261

  • Chroma subsampling: 4:2:0
  • Compression ratio: about 100 to 300
  • Designed for lowrate

à QCIF is specified as required, while CIF is optional

Video format Luminance image resolution Chroma image resolution Bitrate (Mbps) for 30fps H.261 support QCIF 176 x 144 88 x 72 9,1 required CIF 352 x 288 176 x 144 36,5

  • ptional

5

slide-6
SLIDE 6

Outline

  • Introduction
  • Frame sequence
  • Frame coding
  • Quantization
  • Encoder and decoder
  • H.261 syntax

6

slide-7
SLIDE 7

H.261 Frame Sequence

  • I-frame
  • Independently coded
  • Coded using a transform coding method, e.g., DCT (similar to

JPEG), hence called intra-frame

  • Spatial redundancy removal only
  • P-frame
  • Not independent, coded using a forward predictive coding

method

  • Difference between frames are coded
  • Both spatial and temporal redundancy removal

I P P P I P P P I

7

slide-8
SLIDE 8

H.261 Frame Sequence (Cont.)

  • Interval between pairs of I-frames is a variable
  • Motion vectors are measured within a range of

±15 pixels, i.e., p=15

  • A P-frame can be predicted by the preceding I-
  • r P-frame

I P P P I P P P I

8

slide-9
SLIDE 9

Outline

  • Introduction
  • Frame sequence
  • Frame coding
  • Quantization
  • Encoder and decoder
  • H.261 syntax

9

slide-10
SLIDE 10

Stage 1 - Reducing Temporal Redundancy

  • Segment a frame into macroblocks
  • Compensate motion and remove temporal

redundancy

  • Output energy is related to the degree of

temporal redundancy

  • This stage is inter-frame coding

10

slide-11
SLIDE 11

Stage 2 - Reducing Spatial Redundancy

  • Processing the difference frame (spatially

correlated) from stage 1

  • Usually using DCT coding
  • This stage is intra-frame coder

These two stages together are hybrid coding

11

slide-12
SLIDE 12

I-frame Coding

  • Partition a frame into macroblocks
  • Macroblocks is further partitioned into 8 × 8 blocks
  • Adopt 4:2:0 chroma sampling
  • each macroblock is of 16 ×16 pixels for Y frames
  • each macroblock is of 8 × 8 pixels for Cb and Cr frames
  • Apply DCT to code each 8 × 8 block
  • then go through quantization, zigzag scanning and

entropy coding

  • similar to JPEG

Y Cb Cr

For each 8 × 8 block

DCT Quantization Entropy coding

001010001… For each macroblock

12

slide-13
SLIDE 13

P-frame Coding

  • Coded based on motion compensation
  • For each macroblock, find the motion vector
  • Find the difference between the target MB and reference

MB à prediction error = difference macroblock

  • =
  • =

Example 1 Example 2

13

slide-14
SLIDE 14

P-frame Coding

prediction error < threshold? code the difference macroblock code the original macroblock non-motion-compensation MB

  • Coded based on motion compensation
  • For each macroblock, find the motion vector
  • Find the difference between the target MB and reference

MB à prediction error = difference macroblock

14

slide-15
SLIDE 15

P-frame Coding

  • Coded based on motion compensation
  • For each macroblock, find the motion vector
  • Find the difference between the target MB and reference

MB à prediction error = difference macroblock

  • Code the difference macroblock if the error is small

enough

  • Difference MV usually has a much smaller entropy
  • In fact, motion vector (MV) is not coded directly
  • Instead, the difference between motion vectors

(MVD) is coded

  • MVD = MVpreceding - MVcurrent

15

slide-16
SLIDE 16

motion vector

P-frame Coding

16 16 current macroblock best match

  • Y

Cb Cr difference macroblock DCT Quantization Entropy coding for each 8 × 8 block 01100010 …

16

  • 1. Spatial coding for difference MB
  • 2. Entropy coding for motion vector
slide-17
SLIDE 17

Summary of Hybrid Coding

  • Temporal redundancy
  • Removed by Motion Estimation/Compensation
  • Spatial redundancy
  • Removed by Transform coding
  • Statistic redundancy
  • Removed by Entropy coding (VLC)
  • Applied for both 8x8 blocks and motion vectors

17

slide-18
SLIDE 18

Outline

  • Introduction
  • Frame sequence
  • Frame coding
  • Quantization
  • Encoder and decoder
  • H.261 syntax

18

slide-19
SLIDE 19

Quantization

  • Does not use 8 × 8 quantization matrices (as in

JPEG/MPEG)

  • Instead, use a constant, called step_size, for all

DCT coefficients

  • step_size can be any one of the 31 even values

from [2, 62]

  • However, for the DC coefficient, step_size is

always set to 8 QDCT = round

  • DCT

step_size

  • QDCT =
  • DCT

step_size

  • 19
slide-20
SLIDE 20

Outline

  • Introduction
  • Frame sequence
  • Frame coding
  • Quantization
  • Encoder and decoder
  • H.261 syntax

20

slide-21
SLIDE 21

Coding Loop

  • Encoder and decoder should maintain the

same reference frames (quantized one!)

  • To avoid error propagation (error drift)

+

DCT Q VLC Q-1 IDCT

frame buffer motion compensation motion estimation

+

Input MB Motion vector

  • utput

Image Motion vector (1) (2) (3) (4) (5) (6)

21

slide-22
SLIDE 22

Encoding I-frame

  • 1. Receive macroblocks from the I-frame
  • Go to DCT, Q, VLC and be output
  • 4. Use Q-1 and IDCT to get to get the

reconstructed frame I

  • 5. Combine with a zero input
  • 6. Remain as I, stored in the frame buffer as

the reference frame for the following P- frame

~ ~

Why store the reconstructed I as the reference frame, instead of the original I?

~

22

slide-23
SLIDE 23

Encoding P-frame

  • 1. Receive macroblocks from the P-frame
  • Go to motion estimation
  • Find the motion vector best matching I
  • Send the motion vector to VLC
  • 2. Yield the best matching MB P’
  • 3. Find the difference (prediction error)

D = P – P’

  • Send the error D to DCT, Q and VLC
  • 4. Also send D to Q and IDCT to reconstruct D
  • 5. Find the reconstructed P-frame P = P’ + D
  • 6. Store P in the frame buffer as the reference

frame of the next P-frame

~

~ ~ ~ ~

23

slide-24
SLIDE 24

Encoding System

  • Switching between intra- and inter-frame modes by a multiplexer
  • “Coding control” controls step_size according to the buffer level

encoding rate control

F

used for prediction

INTRA

F D ˜ FR D ˜ D ˜ F or

24

slide-25
SLIDE 25

Decoding System

INTRA

˜ FR

F

˜ F

˜ D

  • r

˜ F

25

slide-26
SLIDE 26

Outline

  • Introduction
  • Frame sequence
  • Frame coding
  • Quantization
  • Encoder and decoder
  • H.261 syntax

26

slide-27
SLIDE 27

Coding Hierarchy

  • Defined in the standard to ensure that the system

can be interpreted universally

  • Four-layer hierarchy
  • Picture layer: corresponding to one video frame (CIF or

QCIF)

  • Group of block (GOB) layer: each is of 11×3

macroblocks (i.e., 176×48 pixels in luminance images), corresponding to 1/12 of CIF or 1/3 of QCIF

  • Macroblock layer: corresponding to 16×16 pixels of

luminance (Y) and 8×8 of chrominance (Cb, Cr)

  • Block layer: corresponding to 8×8 pixels, coded by DCT

and run-length coding

27

slide-28
SLIDE 28

H.261 Video Bitstream

H.261 Picture frame PSC TR RType GOB GOB … GOB GBSC GN GQuant MB MB … MB Address Type MQuant MVD CBP b0 b1 … b5 DC (Run, Level) … (Run, Level) EOB

28

slide-29
SLIDE 29

Blocks Arrangement

1 2 3 4 5 6 7 8 9 10 11 12 1 2 3

CIF QCIF (a) GOB arrangement in a picture 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 (b) macroblock arrangement in a GOB

1 2 3 4 6 2

Y Cb Cr (c) block arrangement in a MB

29

slide-30
SLIDE 30

Prediction Intra Intra Inter Inter Inter + MC Inter + MC Inter + MC Inter + MC + FIL Inter + MC + FIL Inter + MC + FIL MQUANT x x x x MVD x x x x x x CBP x x x x x x TCOEFF x x x x x x x x VLC 0001 0000001 1 00001 000000001 00000001 0000000001 001 01 000001

Macroblock Type

30

slide-31
SLIDE 31

H.261

  • Does not specify:
  • Preprocessing and post processing
  • The criteria for choosing the mode for coding a

macroblock

  • The use of BCH (511,493) in the decoder
  • Motion estimation in the encoder
  • The quantizer decision levels
  • Rate-control algorithm
  • Frame-rate
  • Specifies:
  • Bit-stream syntax and decoding
  • A macroblock should be forcibly updated at least once

per every 132 times it is transmitted

  • For CIF, the number of bits created by coding any single

picture must not exceed 256 kb; for QCIF, 64 kb

  • Hypothetical Reference Decoder (HRD)

31

slide-32
SLIDE 32

Summary

  • Frame sequence
  • Consist of I-frames and P-frames
  • Frame coding
  • I-frames are coded similar to JPEG
  • P-frames are predicted by I-frames
  • Quantization
  • Slightly different from JPEG
  • Encoder and decoder
  • Code loop for implementing motion estimation and

prediction

  • H.261 syntax

32