ECE 417 Guest Lecture Video Compression in MPEG-1/2/4. Min-Hsuan Tsai Apr 02, 2013

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

Digital Video Processing

Week 14. Video Compression. Ref: Fundamentals of Multimedia

DIGITAL TELEVISION 1. DIGITAL VIDEO FUNDAMENTALS

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

INF5063: Programming heterogeneous multi-core processors. September 17, 2010

Video Compression An Introduction

DigiPoints Volume 1. Student Workbook. Module 8 Digital Compression

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

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

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

Lecture 6: Compression II. This Week s Schedule

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

Introduction ti to JPEG

Video coding. Concepts and notations.

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

LECTURE VIII: BASIC VIDEO COMPRESSION TECHNIQUE DR. OUIEM BCHIR

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

Computer and Machine Vision

Features. Sequential encoding. Progressive encoding. Hierarchical encoding. Lossless encoding using a different strategy

Ch. 4: Video Compression Multimedia Systems

Digital video coding systems MPEG-1/2 Video

Using animation to motivate motion

Introduction to Video Encoding

Lecture 3 Image and Video (MPEG) Coding

Digital Image Representation Image Compression

The Scope of Picture and Video Coding Standardization

VC 12/13 T16 Video Compression

Cross Layer Protocol Design

Multimedia Signals and Systems Motion Picture Compression - MPEG

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:

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

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

COMP 249 Advanced Distributed Systems Multimedia Networking. The Video Data Type Coding & Compression Basics

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

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

CSCD 443/533 Advanced Networks Fall 2017

Compression of Stereo Images using a Huffman-Zip Scheme

ESE532: System-on-a-Chip Architecture. Today. Message. Project. Expect. Why MPEG Encode? MPEG Encoding Project Motion Estimation DCT Entropy Encoding

Wireless Communication

Perceptual Coding. Lossless vs. lossy compression Perceptual models Selecting info to eliminate Quantization and entropy encoding

EE 5359 H.264 to VC 1 Transcoding

High Efficiency Video Coding. Li Li 2016/10/18

The Basics of Video Compression

CMPT 365 Multimedia Systems. Media Compression - Video

Multimedia Standards

Fundamentals of Video Compression. Video Compression

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

Lecture 8 JPEG Compression (Part 3)

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

Lecture 4: Video Compression Standards (Part1) Tutorial 2 : Image/video Coding Techniques. Basic Transform coding Tutorial 2

06/12/2017. Image compression. Image compression. Image compression. Image compression. Coding redundancy: image 1 has four gray levels

10.2 Video Compression with Motion Compensation 10.4 H H.263

A real-time SNR scalable transcoder for MPEG-2 video streams

CS 335 Graphics and Multimedia. Image Compression

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

Lossy compression CSCI 470: Web Science Keith Vertanen Copyright 2013

Course Syllabus. Website Multimedia Systems, Overview

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

Image, video and audio coding concepts. Roadmap. Rationale. Stefan Alfredsson. (based on material by Johan Garcia)

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

Robert Matthew Buckley. Nova Southeastern University. Dr. Laszlo. MCIS625 On Line. Module 2 Graphics File Format Essay

Mahdi Amiri. February Sharif University of Technology

Lecture Coding Theory. Source Coding. Image and Video Compression. Images: Wikipedia

MULTIMEDIA AND CODING

MPEG-4: Simple Profile (SP)

TKT-2431 SoC design. Introduction to exercises

CMPT 365 Multimedia Systems. Media Compression - Image

IMAGE COMPRESSION USING FOURIER TRANSFORMS

TKT-2431 SoC design. Introduction to exercises. SoC design / September 10

Compression Part 2 Lossy Image Compression (JPEG) Norm Zeck

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

About MPEG Compression. More About Long-GOP Video

CMPT 365 Multimedia Systems. Media Compression - Video Coding Standards

Video Codecs. National Chiao Tung University Chun-Jen Tsai 1/5/2015

CS 260: Seminar in Computer Science: Multimedia Networking

Compression II: Images (JPEG)

Zonal MPEG-2. Cheng-Hsiung Hsieh *, Chen-Wei Fu and Wei-Lung Hung

CISC 7610 Lecture 3 Multimedia data and data formats

Part 1 of 4. MARCH

An introduction to JPEG compression using MATLAB

Lossy compression. CSCI 470: Web Science Keith Vertanen

Image/video compression: howto? Aline ROUMY INRIA Rennes

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

Lecture 8 JPEG Compression (Part 3)

Digital Television DVB-C

VIDEO COMPRESSION STANDARDS

Lecture 3: Image & Video Coding Techniques (II) & Standards (I) A/Prof. Jian Zhang

COLOR IMAGE COMPRESSION USING DISCRETE COSINUS TRANSFORM (DCT)

Digital Image Processing

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

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

Introduction to Video Compression

Overview. Videos are everywhere. But can take up large amounts of resources. Exploit redundancy to reduce file size

Lecture 5: Compression I. This Week s Schedule

Audio and video compression

Pipelined Fast 2-D DCT Architecture for JPEG Image Compression

Objective: Introduction: To: Dr. K. R. Rao. From: Kaustubh V. Dhonsale (UTA id: ) Date: 04/24/2012

Multimedia Decoder Using the Nios II Processor

Multimedia Signals and Systems Still Image Compression - JPEG

Transcription:

ECE 417 Guest Lecture Video Compression in MPEG-1/2/4 Min-Hsuan Tsai Apr 2, 213

What is MPEG and its standards MPEG stands for Moving Picture Expert Group Develop standards for video/audio compression and transmission A partial list of the MPEG standards: MPEG-1 (Systems, Video, Audio) MPEG-2 (Systems, Video, Audio, DSM-CC) MPEG-4 (Visual, Audio, AVC, File Format, AFX, Open Font Format) MPEG-7 (Visual Description, Audio Description, Image and Video Signature, MPEG Query Format)

MPEG-Video The following parts of MPEG standards are about video compression MPEG-1 part 2 (video) MPEG-2 part 2 (video) MPEG-4 part 2 (visual) MPEG-4 part 1 (AVC)

MPEG-Video Compression The need for video compression Using 8 bits per color channel lines pixels color channels frame rate (frame/s) data rate (Mbps) CD 288 352 3 25 61 DVD 48 72 3 29.97 249 HDTV 72 128 3 6 1327 Some interesting bit-rates TV broadcasting channel: ~2 Mbps DVD: 5-2 Mbps Ethernet: 1/1/1 Mbps

MPEG-Video Compression Intra-frame Compression Exploiting spatial redundancy (same as JPEG) Inter-frame Compression Exploiting temporal redundancy Motion estimation/ compensation

MPEG-Video Compression Intra-frame compression Exploiting spatial redundancy (same as JPEG) Quantization matrix Huffman table input image Color space Transformation Pixel Coding Quantization Entropy Coding compressed image

MPEG-Video Compression Intra-frame compression Exploiting spatial redundancy (same as JPEG) Quantization matrix Huffman table input image Color space Transformation Pixel Coding Quantization Entropy Coding compressed image

Color space transformation Convert RGB frames to YUV (YCbCr) color space Luminance information is more important to the perception of color in the human visual system Original image Luminance Chrominance (blue) Chrominance (red) Remove more chrominance info than luminance info (downsampling on chrominance components) (Images courtesy of Wikipedia)

Color space transformation Chrominance subsampling (J:a:b) J: horizontal sampling reference (width of the conceptual region). Usually, 4. a: number of chrominance samples (Cr, Cb) in the first row of J pixels. b: number of (additional) chrominance samples (Cr, Cb) in the second row of J pixels. (Images courtesy of Wikipedia)

Color space transformation Chrominance subsampling 4:4:4 4:2:

MPEG-Video Compression Intra-frame compression Exploiting spatial redundancy (same as JPEG) Quantization matrix Huffman table input image Color space Transformation Pixel Coding Quantization Entropy Coding compressed image

Pixel coding using the DCT Pixel coding Human eyes are insensitive to high frequent color changes DCT converts each frame into a frequency-domain representation which has a nice strong energy compact property: Most of the signal information tends to be concentrated in a few low-frequency components of the DCT Thus DCT is often used for lossy data compression

Discrete Cosine Transformation DCT expresses a signal (x n, n=,,n-1) in terms of a sum of sinusoids with different freq and amplitudes forms N basis functions DCT transforms the signal to a set of independent parts to reduce the entropy, so that the transformed signal can be quantized to decrease the number of bits to represent the original signal

1-D DCT 42.5-16.1-1.68 -.5 -.13 * 42.5 * -16.1 * * -1.68 * * -.5 Perfect reconstruction (on the dots) * * -.13

1-D DCT Lossy compression 42.5-16.1-1.68 -.5 -.13 42.5-16.1-1.68 -.5 -.13 42.5-16.1-1.68 -.5 -.13 42.5-16.1-1.68 -.5 -.13

2-D DCT On a 8-bit image sized 8x8 (a block), the DCT basis functions are -34 21 14-69 1 2-12 7-327 -26 67 7-1 -15 21 8 93-84 -66 16 24-2 -5 9 DCT* 89 33-19 -2-26 21-3 -9 42 18 27-7 -17 29-7 -5 15-1 17 32-15 -4 7 1 3-12 -1 2 3-2 -3 12 3-3 -3-6 12-1 * with nearest integer truncation (Image courtesy of Wikipedia)

MPEG-Video Compression Intra-frame compression Exploiting spatial redundancy (same for JPEG) Quantization matrix Huffman table input image Color space Transformation Pixel Coding Quantization Entropy Coding compressed image

Quantization DCT tends to aggregate most of the signal in one corner of the result DCT* G = Inverse DCT* I = * with nearest integer truncation M+S+L M+S M

Quantization A better quantization scheme: quantization matrix (with loss parameter p) Q Y (p) = p* G = round(g./ Q Y (1)) G = G = Note: Superscript Y indicates the quantization matrix is for luminance

Quantization vs quality Original image P=1 P=4 P=8

Closer look Original P = 14 8image

MPEG-Video Compression Intra-frame compression Exploiting spatial redundancy (same for JPEG) Quantization matrix Huffman table input image Color space Transformation Pixel Coding Quantization Entropy Coding compressed image

Encoding (I) Run-length encoding (RLE) To represent a sequence of data by a single data value and count E.g., aaaaabbaaaaaaabbbbbbabbbbbaaaabbb can be represented by 5a2b7a6b1a5b4a3b Save lots of storage for the data sequence where the same data value occurs in many consecutive elements For 2-D cases, need to smartly vectorize G* for RLE (how?)

How to vectorize G* Such that the resulting sequence can be better compressed w.r.t. RLE Zigzag Sequencing -26-3 -6 2 2-1 -2-4 1 1 G* = -3-3 1 1 5 2-1 -1-1 1

Encoding (II) Entropy coding Given a set of symbols and their weights (e.g., probabilities), find a prefix-free and variable-length code with minimum expected #bits needed Prefix-free code: the bit string representing some particular symbol is never a prefix of the bit string representing any other symbol Variable-length code (VLC) a b c d Cost (#bits) probability.5.6.3.5 Fixed-length 1 1 11 2. Variable-length 111 1 11 1.5

Encoding (II) Entropy coding Any prefix free code is uniquely decodeable 1111111111 Symbol a b c d 1111111111 Code 111 1 11 abcdcba Huffman coding is a greedy algorithm for producing a variable-length prefix code with Optimality guaranteed 1 Efficient construction time (O(nlogn)) 1 When the symbols are independently distributed

MPEG-Video Compression Inter-frame compression Exploiting temporal redundancy i-th frame (i+1)-th frame Time

MPEG-Video Compression Exploiting temporal redundancy Macoblocks: composed of several (usually a multiple of 4) blocks of pixels Typical macroblock for a 4:2: color space 8 pixels = + + 4 Y 1 Cb 1 Cr

Motion estimation Motion estimation (at the macroblock level) macroblock Search area Motion vector I/P frame at T P frame at (T+ T) Used to indicate where exactly to get the data in the reference frame(s) The motion vectors are up to sub-pel accuracies. E.g., half-pel in MPEG-1/2 and quarter-pel in MPEG-4 Motion vector would be zero for a static background MPEG does not specify the motion estimation algorithm

MPEG-Video frames Types of video frames I-frame (intra) Compressed using only intra-frame coding Moderate compression but faster random access P-frame (predicted) Coded with motion compression using past I- or P-frames Can be used as reference pictures for additional motion compensation B-frame (bidirectional) Coded by motion compensation by either past or future I- or P-frames I B B P B B P

Motion estimation Inter-frame predictive coding (P-frames) For each macroblock the motion estimator produces the best matching macroblock The two macroblocks are subtracted and the difference is DCT coded Inter-frame interpolative coding (B-frames) The motion vector estimation is performed twice The encoder forms a prediction error macroblock from either or from their average The prediction error is encoded using a block-based DCT The encoder needs to reorder pictures because B-frames always arrive late

Motion compensation P-frames Macroblocks can be reconstructed by Forward prediction (with a motion vector) Intra coded macroblocks

Motion compensation B-frames Macroblocks can be reconstructed by Bi-directional prediction (with two motion vector) Forward prediction (with a motion vector) Backward prediction (with a motion vector) Intra coded macroblocks (backward reference) (predicted) (forward reference)

Group of pictures (GOP) A group of successive pictures within a coded bit stream The structure of GOP specifies the order in which different types of pictures are arranged Always starts with an I-frame, followed usually by a number of P-frames and B-frames Characterized by two parameters: GOP size M (distances between anchor frames) and GOP length N (distances between I-frames) Can be as small as a single I-frame (e.g., IMAX) usually allow only 1 I-frame in a GOP E.g., IBBPBBPBBPBB (M=3, N=12)

Structure of GOP The structure of GOP determines the compression ratio For MPEG-1 NTSC with the GOP structure (M=3, N=12), there are 1 I-frame, 3 P-frames and 8 B-frames: IBBPBBPBBPBB Type Size Compress I 18K 7:1 P 6K 2:1 B 2.5K 5:1 Avg 4.8K 27:1 Other examples of GOP length used in common MPEG formats: MPEG-2 for DVD: (M=3, N=18) for NTSC or (M=3, N=15) frames for PAL. 18-line HDV: (M=3, N=15) 72-line HDV: (M=3, N=6) IMX: Uses only I-frames

Ordering frames for decoding Presentation order Coding order I B1 B2 P1 B3 B4 P2 Decode Time Stamps (DTS) Presentation Time Stamps (PTS) I P1 B1 B2 P2 B3 B4 1 2 3 4 5 6 3 1 2 6 4 5

Milestones for video compression (slide courtesy of Wiegand and Girod)

Milestones for video compression (slide courtesy of Wiegand and Girod)

Visual comparison (slide courtesy of Wiegand and Girod)