Basic Video Compression Techniques: H.261, MPEG-1, and MPEG-2, Study notes of Electrical and Electronics Engineering

An overview of video compression techniques used in h.261, mpeg-1, and mpeg-2. It covers the principles of motion compensation, macroblocks, motion vectors, and search algorithms for motion vectors. The document also discusses the differences between h.261 and mpeg-1, including frame formats, quantization, and source formats.

Typology: Study notes

Pre 2010

Uploaded on 09/17/2009

koofers-user-xb8
koofers-user-xb8 🇺🇸

4

(1)

10 documents

1 / 53

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ECE160
Spring 2008
Lecture 10
Basic Video Compression Techniques
1
ECE160 / CMPS182
Multimedia
Lecture 10: Spring 2008
Basic Video Compression Techniques
H.261, MPEG-1 and MPEG-2
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35

Partial preview of the text

Download Basic Video Compression Techniques: H.261, MPEG-1, and MPEG-2 and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

ECE Lecture 10 1

ECE160 / CMPS

Multimedia

Lecture 10: Spring 2008

Basic Video Compression Techniques

H.261, MPEG-1 and MPEG-

ECE Lecture 10 2

Introduction to Video Compression

  • A video consists of a time-ordered sequence of

frames, i.e., images.

  • An obvious solution to video compression would

be predictive coding based on previous frames.

  • Compression proceeds by subtracting images:

subtract in time order and code the residual

error.

  • It can be done even better by searching for just

the right parts of the image to subtract from the

previous frame.

ECE Lecture 10 4 Motion Compensation

  • Each image is divided into macroblocks of size NxN.
    • By default, N = 16 for luminance images. For chrominance images, N = 8 if 4:2:0 chroma subsampling is adopted.
  • Motion compensation operates at the macroblock level.
    • The current image frame is referred to as Target Frame.
    • A match is sought between the macroblock in the Target Frame and the most similar macroblock in previous and/or future frame(s) (referred to as Reference frame(s) ).
    • The displacement of the reference macroblock to the target macroblock is called a motion vector MV.

ECE Lecture 10 5 Motion Compensation

  • Macroblocks and Motion Vector in Video Compression.
  • MV search is usually limited to a small immediate neighborhood – both horizontal and vertical displacements in the range [ −p,p ]. This makes a search window of size (2 p +1)(2 p +1).

ECE Lecture 10 7 Sequential Search

  • Sequential search : sequentially search the whole (2 p +1)x(2 p +1) window in the Reference frame (also referred to as Full search).
  • A macroblock centered at each of the positions within the window is compared to the macroblock in the Target frame pixel by pixel and their respective MAD is then derived using the equation above.
  • The vector ( i,j ) that offers the least MAD is designated as the MV ( u,v ) for the macroblock in the Target frame.
  • Sequential search method is very costly - assuming each pixel comparison requires three operations (subtraction, absolute value, addition), the cost for obtaining a motion vector for a single macroblock is (2 p +1).(2 p +1). N 2 .3 ) => O ( p 2 N 2 ).

ECE Lecture 10 8 Logarithmic Search

  • Logarithmic search : a cheaper version, that is

suboptimal but still usually effective.

  • The procedure for 2D Logarithmic Search of

motion vectors takes several iterations and is

akin to a binary search:

  • As illustrated in the Figure below, initially only nine locations in the search window are used as seeds for a MAD-based search; they are marked as `1'.
  • After the one that yields the minimum MAD is located, the center of the new search region is moved to it and the step-size ("offset") is reduced to half.
  • In the next iteration, the nine new locations are marked as `2', and so on.

ECE Lecture 10 10 Hierarchical Search

  • The search can benefit from a hierarchical (multiresolution) approach in which initial estimation of the motion vector is obtained from images with a significantly reduced resolution.
  • The Figure below shows a three-level hierarchical search in which the original image is at Level 0, images at Levels 1 and 2 are obtained by down- sampling from the previous levels by a factor of 2, and the initial search is conducted at Level 2.
  • Since the size of the macroblock is smaller and p can also be proportionally reduced, the number of operations required is greatly reduced.

ECE Lecture 10 11 Three-level Hierarchical Search for Motion Vectors

ECE Lecture 10 13 Comparison of Computational Cost of Motion Vector Search

ECE Lecture 10 14 H. H.261 : An earlier digital video compression standard, its principle of MC-based compression is retained in all later video compression standards.

  • The standard was designed for videophone, video conferencing and other audiovisual services over ISDN.
  • The video codec supports bit-rates of px 64 kbps, where p ranges from 1 to 30 (Hence also known as px 64).
  • Require that the delay of the video encoder be less than 150 msec so that the video can be used for real-time bidirectional video conferencing.

ECE Lecture 10 16 Video Formats Supported by H.

ECE Lecture 10 17 H.261 Frame Sequence Two types of image frames are defined: Intra-frames ( I-frames ) and Inter-frames ( P-frames ):

  • I-frames are treated as independent images. Transform coding method similar to JPEG is applied within each I-frame, hence “Intra".
  • P-frames are not independent: coded by a forward predictive coding method (prediction from a previous P-frame is allowed - not just from a previous I-frame).
  • Temporal redundancy removal is included in P-frame coding, whereas I-frame coding performs only spatial redundancy removal.
  • To avoid propagation of coding errors, an I-frame is usually sent a couple of times in each second of the video.
  • Motion vectors in H.261 are always measured in units of full pixel and they have a limited range of 15 pixels, i.e., p = 15.

ECE Lecture 10 19 Inter-frame (P-frame) Predictive Coding

  • For each macroblock in the Target frame, a motion vector is found by one of the search methods discussed earlier.
  • After the prediction, a difference macroblock is derived to measure the prediction error.
  • Each of these 8x8 blocks go through DCT, quantization, zigzag scan and entropy coding procedures.
  • The P-frame coding encodes the difference macroblock (not the Target macroblock itself).
  • Sometimes, a good match cannot be found, i.e., the prediction error exceeds an acceptable level. - The MB itself is then encoded (treated as an Intra MB) and in this case it is termed a non-motion compensated MB.
  • For motion vector, the difference MVD is sent for entropy coding: MVD = MV Preceding MV Current

ECE Lecture 10 20 P-frame Coding based on Motion Compensation.