1 / 15

Lecture06

Lecture06. Video Compression. Spatial Vs. Temporal Redundancy. Image compression techniques exploit spatial redundancy, the phenomenon that picture contents often change relatively slowly across images, making a large suppression of higher spatial frequency components viable.

chaim
Télécharger la présentation

Lecture06

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture06 Video Compression

  2. Spatial Vs. Temporal Redundancy • Image compression techniques exploit spatial redundancy, the phenomenon that picture contents often change relatively slowly across images, making a large suppression of higher spatial frequency components viable. • Since frame rate of video is often relatively high, and camera parameters usually do not change rapidly between frames, the contents of consecutive frames are usually similar, thus resulting in temporal redundancy.

  3. 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.

  4. Video Compression with Motion Compensation • Temporal redundancy is exploited so that not every frame of the video needs to be coded independently as a new image. The difference between the current frame and other frame (s) in the sequence will be coded - small values and low entropy, good for compression. • Steps of Video compression based on Motion Compensation (MC): 1. Motion Estimation (motion vector search). 2. MC-based Prediction. 3. Derivation of the prediction error, i.e., the difference. • This prediction error as well as motion vector need to be coded.

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

  6. Macro blocks and Motion Vector in Video Compression • MV search is usually limited to a small immediate neighbourhood - both horizontal and vertical displacements in the range [−p, p]: This makes a search window of size (2p + 1)x(2p + 1).

  7. Search for Motion Vectors • The difference between two macro blocks can then be measured by their Mean Absolute Difference (MAD): N - size of the macro block, k and l - indices for pixels in the macro block, i and j - horizontal and vertical displacements, C(x + k, y + l) - pixels in macro block in Target frame, R(x + i + k, y + j + l) - pixels in macro block in Reference frame. • The goal of the search is to find a vector (i, j) as the motion vector MV = (u, v), such that MAD(i, j) is minimum:

  8. Sequential Search • sequentially search the whole (2p+1)x(2p+1) window in the Reference frame (also referred to as Full search). • a macro block centred at each of the positions within the window is compared to the macro block in the Target frame pixel by pixel and their respective MAD is then derived. • The vector (i, j) that offers the least MAD is designated as the MV (u, v) for the macro block in the Target frame.

  9. Motion-vector: sequential-search • begin min_MAD = LARGE_NUMBER; /* Initialization */ for i = -p to p for j = -p to p { cur_MAD = MAD(i,j); if cur_MAD < min_MAD { min_MAD = cur_MAD; u = i; /* Get the coordinates for MV. */ v = j; } } end • 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 macro block is • (2p + 1)(2p + 1)N23 ⇒ O(p2N2).

  10. 2D Logarithmic Search

  11. 2D 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: • 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 centre 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. • It could be computed the complexity of this search is O(log2p . N2)

  12. H.261 • This standard was designed for videophone, videoconferencing, and other audiovisual services over ISDN telephone lines. • It performs motion-compensation-based compression. • The video codec supports bitrates of px64 kbps, where p ranges from 1 to 30. • It defines two types of frames: intra-frames (I-frames) and inter-frames (P-frames) • I-frames are treated as independent images. A transform coding method similar to JPEG is applied within each I-frame, hence the name “intra”. • P-frames are not independent. They are coded by forward predictive coding method in which current macro blocks are predicted from similar macro blocks in the preceding I or P-frame.

  13. Video formats supported by H.261

  14. I-frame coding

  15. P-frame coding

More Related