Multimedia Systems Video II (Video Coding) Mahdi Amiri April 2012 Sharif University of Technology

Similar documents
Motion estimation for video compression

Digital Video Processing

Redundancy and Correlation: Temporal

Lecture 7, Video Coding, Motion Compensation Accuracy

Module 7 VIDEO CODING AND MOTION ESTIMATION

International Journal of Emerging Technology and Advanced Engineering Website: (ISSN , Volume 2, Issue 4, April 2012)

CMPT 365 Multimedia Systems. Media Compression - Video

Review for the Final

Dense Image-based Motion Estimation Algorithms & Optical Flow

Review and Implementation of DWT based Scalable Video Coding with Scalable Motion Coding.

Video Compression An Introduction

Outline Introduction MPEG-2 MPEG-4. Video Compression. Introduction to MPEG. Prof. Pratikgiri Goswami

Overview: motion-compensated coding

Compression of Stereo Images using a Huffman-Zip Scheme

Video Compression MPEG-4. Market s requirements for Video compression standard

Motion Estimation for Video Coding Standards

Professor Laurence S. Dooley. School of Computing and Communications Milton Keynes, UK

Using animation to motivate motion

Video Compression Standards (II) A/Prof. Jian Zhang

Multimedia Systems Image III (Image Compression, JPEG) Mahdi Amiri April 2011 Sharif University of Technology

Interframe coding A video scene captured as a sequence of frames can be efficiently coded by estimating and compensating for motion between frames pri

Automatic Video Caption Detection and Extraction in the DCT Compressed Domain

VC 12/13 T16 Video Compression

Introduction to Video Compression

Chapter 10. Basic Video Compression Techniques Introduction to Video Compression 10.2 Video Compression with Motion Compensation

LECTURE VIII: BASIC VIDEO COMPRESSION TECHNIQUE DR. OUIEM BCHIR

MPEG-2. ISO/IEC (or ITU-T H.262)

Laboratoire d'informatique, de Robotique et de Microélectronique de Montpellier Montpellier Cedex 5 France

Tutorial T5. Video Over IP. Magda El-Zarki (University of California at Irvine) Monday, 23 April, Morning

Advanced Video Coding: The new H.264 video compression standard

Video coding. Concepts and notations.

Lecture 5: Video Compression Standards (Part2) Tutorial 3 : Introduction to Histogram

Comparative Study of Partial Closed-loop Versus Open-loop Motion Estimation for Coding of HDTV

CS 260: Seminar in Computer Science: Multimedia Networking

An Adaptive Cross Search Algorithm for Block Matching Motion Estimation

Lecture 3 Image and Video (MPEG) Coding

Multimedia Standards

10.2 Video Compression with Motion Compensation 10.4 H H.263

Efficient Block Based Motion Estimation

EE 5359 H.264 to VC 1 Transcoding

Digital Image Stabilization and Its Integration with Video Encoder

Fast Mode Decision for H.264/AVC Using Mode Prediction

Digital video coding systems MPEG-1/2 Video

Lec 08 Video Signal Processing I

Rate Distortion Optimization in Video Compression

Lecture 6: Compression II. This Week s Schedule

Semi-Hierarchical Based Motion Estimation Algorithm for the Dirac Video Encoder

Star Diamond-Diamond Search Block Matching Motion Estimation Algorithm for H.264/AVC Video Codec

Frequency Band Coding Mode Selection for Key Frames of Wyner-Ziv Video Coding

Displacement estimation

AUDIOVISUAL COMMUNICATION

DIGITAL TELEVISION 1. DIGITAL VIDEO FUNDAMENTALS

Chapter 11.3 MPEG-2. MPEG-2: For higher quality video at a bit-rate of more than 4 Mbps Defined seven profiles aimed at different applications:

VIDEO COMPRESSION STANDARDS

IN the early 1980 s, video compression made the leap from

In the name of Allah. the compassionate, the merciful

About MPEG Compression. More About Long-GOP Video

Week 14. Video Compression. Ref: Fundamentals of Multimedia

A High Quality/Low Computational Cost Technique for Block Matching Motion Estimation

Advanced Encoding Features of the Sencore TXS Transcoder

Implementation and analysis of Directional DCT in H.264

Compression and File Formats

LOW DELAY DISTRIBUTED VIDEO CODING. António Tomé. Instituto Superior Técnico Av. Rovisco Pais, Lisboa, Portugal

VIDEO AND IMAGE PROCESSING USING DSP AND PFGA. Chapter 3: Video Processing

Welcome Back to Fundamentals of Multimedia (MR412) Fall, 2012 Chapter 10 ZHU Yongxin, Winson

Range Imaging Through Triangulation. Range Imaging Through Triangulation. Range Imaging Through Triangulation. Range Imaging Through Triangulation

Chapter 3 Image Registration. Chapter 3 Image Registration

JPEG 2000 vs. JPEG in MPEG Encoding

15 Data Compression 2014/9/21. Objectives After studying this chapter, the student should be able to: 15-1 LOSSLESS COMPRESSION

Lec 08 Video Signal Processing I

Cross Layer Protocol Design

Lecture 13 Video Coding H.264 / MPEG4 AVC

A REAL-TIME H.264/AVC ENCODER&DECODER WITH VERTICAL MODE FOR INTRA FRAME AND THREE STEP SEARCH ALGORITHM FOR P-FRAME

Video Coding Standards. Yao Wang Polytechnic University, Brooklyn, NY11201 http: //eeweb.poly.edu/~yao

Introduction to Video Encoding

Aiyar, Mani Laxman. Keywords: MPEG4, H.264, HEVC, HDTV, DVB, FIR.

Mahdi Amiri. February Sharif University of Technology

Wireless Communication

Overview: motion estimation. Differential motion estimation

MPEG-4: Simple Profile (SP)

A New Fast Motion Search Algorithm for Block Based Video Encoders

Introduction to Video Encoding

Multiresolution motion compensation coding for video compression

Lecture 5: Error Resilience & Scalability

Final report on coding algorithms for mobile 3DTV. Gerhard Tech Karsten Müller Philipp Merkle Heribert Brust Lina Jin

Improving Intra Pixel prediction for H.264 video coding

Enhanced Hexagon with Early Termination Algorithm for Motion estimation

Video Coding in H.26L

Index. 1. Motivation 2. Background 3. JPEG Compression The Discrete Cosine Transformation Quantization Coding 4. MPEG 5.

Georgios Tziritas Computer Science Department

Video Transcoding Architectures and Techniques: An Overview. IEEE Signal Processing Magazine March 2003 Present by Chen-hsiu Huang

2014 Summer School on MPEG/VCEG Video. Video Coding Concept

Motion. 1 Introduction. 2 Optical Flow. Sohaib A Khan. 2.1 Brightness Constancy Equation

System Modeling and Implementation of MPEG-4. Encoder under Fine-Granular-Scalability Framework

Introduction to LAN/WAN. Application Layer 4

IMAGE COMPRESSION. Image Compression. Why? Reducing transportation times Reducing file size. A two way event - compression and decompression

Megapixel Video for. Part 2 of 4. Brought to You by. Presented by Video Security Consultants

Video Coding Standards

EE 5359 MULTIMEDIA PROCESSING SPRING Final Report IMPLEMENTATION AND ANALYSIS OF DIRECTIONAL DISCRETE COSINE TRANSFORM IN H.

MPEG-2. And Scalability Support. Nimrod Peleg Update: July.2004

Transcription:

Course Presentation Multimedia Systems Video II (Video Coding) Mahdi Amiri April 2012 Sharif University of Technology

Video Coding Correlation in Video Sequence Spatial correlation Similar pixels seem to group together just like spatial correlation in images Temporal correlation Similar background with a few moving objects in the foreground There is usually much more temporal correlation then spatial. Page 1

Video Coding, Temporal Activity Page 2 Temporal activity in a Talking Head video sequence

Video Coding Motion Model in Video Sequence Natural motion Moving people & moving objects Translational, rotational, scaling Camera motion Camera panning, camera zooming, fading Page 3

Motion-JPEG Encoder 1 Intraframe compression Encodes every frame independently Pros: Cons: Very simple and fast No latency (frame delay) Easy frame access for video editing Does not take into account any temporal correlation Low coding performance Page 4

Motion-JPEG Encoder 2 Interframe compression Takes advantage of minimal changes from one frame to the next to achieve dramatic compression. Instead of storing complete information about each frame only the difference information between frames is stored. Encodes frame difference Pros: Cons: Improves compression Low latency Requires very stationary background to be effective Still low coding performance (too simple motion model) To prevent quantization error accumulation from coder/decoder mismatch, has to be closed-loop Page 5

Motion-Compensated Framework Introduction Motion Estimation and Motion Compensation (MEMC) Transform-based coding on motion-compensated prediction error (residue) All international video coding standards are based on this coding framework Video teleconferencing: H.261, H.263, H.263++, H.26L/H.264 Video archive & play-back: MPEG-1, MPEG-2 (in DVDs) MPEG-4 Page 6

Motion-Compensated Framework Motion Estimation Motion estimation is the process of determining motion vectors that describe the transformation from one 2D image to another. Block Matching Algorithm (BMA): Subdivide current frame into blocks. Find one displacement vector for each block (Within a search window, find a best match that minimizes an error measure). Intelligent search strategies can reduce computation. Search window Page 7

Motion-Compensated Framework Block Matching Algorithm, Ex. 1 Measurement window is compared with a shifted block of pixels in the other image, to determine the best match Block of pixels is selected as a measurement window Page 8

Motion-Compensated Framework Block Matching Algorithm, Ex. 2... process repeated for another block. Page 9

Block Matching Algorithm Optical Flow, Ex. 1 Suzie QCIF animation: The sequence shows a woman that faces the camera while speaking on the telephone. Frames 47 to 52 Frame 47 48 The circles in the plot above marks the center of a block in the current frame and the lines goes out from the center of a circle to the position of where this block was located in the previous frame. This sequence mainly has two moving parts that move in different directions. These are the head that goes to the right while turning and the telephone that goes down. The frames also consist of a rather large portion that is, except from some noise, constant from frame to frame. A typical motion between frames in this sequence is 5 pixels for the telephone and 0 for the background. In these frames the woman is simply listening to the phone and the frames contains virtually no motion at all. Page 10 Frames 125 to 130 Frame 125 126

Block Matching Algorithm Optical Flow, Ex. 2 The foreman data set are the frames 308 to 313 of the foreman qcif movie. These frames show a pan of the camera across a construction yard. The sequence consist of large diagonal motion. Large portions of new image is presented in the lover and right edges of each frame. The size of the motion between frames is somewhere between 8 and 9 pixels. All motion of this sequence is translatory. Page 11

Block Matching Algorithm From Current to Previous Frame Previous frame Current frame Page 12

Motion-Compensated Framework Motion Compensation Applying the motion vectors to an image to synthesize the transformation to the next image is called motion compensation. Differences between the original frame and the next frame Original frame Differences between the original frame and the next frame, shifted right by 2 pixels. Shifting the frame compensates for the panning of the camera, thus there is greater overlap between the two frames. Motion compensated difference Page 13

Motion-Compensated Framework Encoder and Decoder Page 14

Block Matching Algorithm Issues: Block size? Search range?, Search strategy? Summary Motion vector accuracy? (Motion model? Matching criterion?) Advantages: Motion typically estimated only from luminance Good, robust performance for compression. Resulting motion vector field is easy to represent (one MV per block) and useful for compression. Simple, periodic structure, easy VLSI implementations. Disadvantages: Assumes translational motion model Breaks down for more complex motion. Often produces blocking artifacts (OK for coding with Block DCT). Page 15

Motion-Compensated Framework Affine motion Motion Model for Estimation Translation, rotation, scaling 6 parameters in 2-D space Complex Simplified translation model Motion vectors (2 parameters) Page 16

Motion-Compensated Framework Matching Criterion Mean Square Error (MSE) Current frame Previous frame 1 MSE u, v f i, j f i u, j v, 2 16 15 15 2 t t 1 i 0 j 0 u: Horizontal shift v: Vertical Shift 15 uv, 15 Page 17

Motion-Compensated Framework Matching Criterion Sum of Squared Differences (SSD) Current frame Previous frame 15 15 2 t t 1 i 0 j 0 SSD u, v f i, j f i u, j v, u: Horizontal shift v: Vertical Shift 15 uv, 15 Page 18

Motion-Compensated Framework Matching Criterion Sum of Absolute Differences (SAD) 15 15 SAD u, v f i, j f i u, j v, i 0 j 0 t Current frame Previous frame t 1 u: Horizontal shift v: Vertical Shift 15 uv, 15 Page 19

Motion-Compensated Framework Matching Criterion Page 20

v or dy Block Matching Search Strategies, Full Search All possible displacements within the search range are compared. Computationally expensive. Highly regular, parallelizable. u or dx Page 21

Motion-Compensated Framework MEMC, Example Page 22

MEMC, Example MEMC, Example Page 23

MEMC, Example MEMC, Example Page 24

Block Matching Divide and Conquer Search Strategies, Fast methods Sampling the search space Divide search space into regions Pick a center point for each region Perform more elaborate search on the region with best center Gradient Search Sampling the search space At every stage, investigate a few candidates Move in the direction of the best match Can adaptively reduce the displacement size for each stage Page 25

Block Matching Search Strategies, 2D Log Search Algorithm: Gradient Search Use + pattern at each stage (5 candidates) Move center to best match Reduce step size at each stage Fast, reasonable quality Similar algorithms: Three-step-search Four-step-search Cross search... Page 26

Block Matching, 3 Step Search Page 27

Block Matching, 3 Step Search Block Based Gradient Descent Search Page 28

Block Matching Search Strategies, Binary Search Algorithm: Divide-and-conquer Move search to region with best match Finer search at later stages Page 29

Block Matching Search Strategies, Diamond Search Page 30

Block Matching Search Strategies, Acceleration Predictive motion search Use median of motion vectors in causal neighborhood as starting point for search. Additionally test zero-vector as a starting point Early termination Interrupt summation to calculate SSD or SAD, if value grows too quickly (relative to previous best match) Stop search, if match is good enough (SSD, SAD < threshold) Tradeoff between the quality of the motion vector versus the complexity of the motion estimation process is left to the implementer. Page 31

Block Matching Block Size Small Blocks: It is possible in this case that a match may be erroneously established between blocks containing similar gray-level patterns which are otherwise unrelated in the sense of motion. Large Blocks: If the motion varies locally (possibly within the measurement block), for instance due to independently moving smaller size structures within the block, it is obvious that block matching will provide inaccurate motion estimates when large blocks are used. Page 32

Video Coding Temporal picture structures Page 33

Video Coding Picture Types I-frames are the least compressible but don't require other video frames to decode (a.k.a Key frames). P-frames can use data from previous frames to decompress and are more compressible than I-frames. B-frames can use both previous and forward frames for data reference to get the highest amount of data compression. MPEG-1 has a unique frame type not found in later video standards. D-frames or DC-pictures are independent images (intra-frames) that have been encoded DC-only (AC coefficients are removed) and hence are very low quality. Page 34

Video Coding B-frames Often an object moves in front of a background. P frames code the object fine, but can t effectively code the revealed background. Page 35

Video Coding B-frames Coded from one previous frame, one future frame, or a combination of both. 1. Do motion vector search separately in past reference frame and future reference frame. 2. Compare: Difference from past frame. Difference from future frame. Difference from average of past and future frame. 3. Encode the version with the least difference. Page 36

Video Coding Group of Pictures (GOP) A GOP always begins with an I-frame. Afterwards several P-frames follow, in each case with some frames distance. In the remaining gaps are B-frames. A few video codecs allow for more than one I-frame in a GOP. The more I-frames the video stream has, the more editable it is. However, having more I-frames increases the stream size. In order to save bandwidth and disk space, videos prepared for internet broadcast often have only one I-frame per GOP. The GOP structure is often referred by two numbers, for example M=3, N=12. The first one tells the distance between two anchor frames (I or P). The second one tells the distance between two full images (I-frames): it is the GOP length. For the example M=3 N=12, the GOP structure is IBBPBBPBBPBBI. Instead of the M parameter one can use the maximal count of B- frames between two consecutive anchor frames. GOP, M=3, N=9. Page 37

Video Coding A few hints: How Many I, P, or B Only use motion vector if a close match can be found. Evaluate closeness with MSE or other metric. Can t search all possible blocks, so need a smart algorithm. If no suitable match found, just code the macroblock as an I-block If a scene change is detected, start fresh. Don t want too many P or B frames in a row Predictive error will keep propagating until next I frame. Delay in decoding. Page 38

Video Coding Codec Information Appliance Sample Tool: http://www.headbands.com/gspot/ Page 39

Multimedia Systems Video II (Video Coding) Thank You Next Session: Video III (Video Coding Standards) FIND OUT MORE AT... 1. http://ce.sharif.edu/~m_amiri/ 2. http://www.dml.ir/ Page 40