Introduction to Video Compression

Similar documents
The Scope of Picture and Video Coding Standardization

MPEG-4: Simple Profile (SP)

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

Video Compression An Introduction

Digital Video Processing

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

Lecture 6: Compression II. This Week s Schedule

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

DIGITAL TELEVISION 1. DIGITAL VIDEO FUNDAMENTALS

Week 14. Video Compression. Ref: Fundamentals of Multimedia

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

In the name of Allah. the compassionate, the merciful

Ch. 4: Video Compression Multimedia Systems

VIDEO COMPRESSION STANDARDS

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

Choosing a Processor: Benchmarks and Beyond (S043)

Video coding. Concepts and notations.

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

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

Introduction to Video Encoding

Anatomy of a Video Codec

10.2 Video Compression with Motion Compensation 10.4 H H.263

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

Standard Codecs. Image compression to advanced video coding. Mohammed Ghanbari. 3rd Edition. The Institution of Engineering and Technology

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

Lecture 13 Video Coding H.264 / MPEG4 AVC

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:

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

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

Benchmarking Processors for DSP Applications

Lecture 5: Error Resilience & Scalability

EE 5359 H.264 to VC 1 Transcoding

Emerging H.26L Standard:

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

DigiPoints Volume 1. Student Workbook. Module 8 Digital Compression

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

PREFACE...XIII ACKNOWLEDGEMENTS...XV

Wireless Communication

CMPT 365 Multimedia Systems. Media Compression - Video

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

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

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

Using animation to motivate motion

JPEG decoding using end of block markers to concurrently partition channels on a GPU. Patrick Chieppe (u ) Supervisor: Dr.

The Basics of Video Compression

4G WIRELESS VIDEO COMMUNICATIONS

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

Compressed-Domain Video Processing and Transcoding

IMPLEMENTATION OF H.264 DECODER ON SANDBLASTER DSP Vaidyanathan Ramadurai, Sanjay Jinturkar, Mayan Moudgill, John Glossner

LIST OF TABLES. Table 5.1 Specification of mapping of idx to cij for zig-zag scan 46. Table 5.2 Macroblock types 46

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

Multimedia Decoder Using the Nios II Processor

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

Audio Compression. Audio Compression. Absolute Threshold. CD quality audio:

5LSE0 - Mod 10 Part 1. MPEG Motion Compensation and Video Coding. MPEG Video / Temporal Prediction (1)

PERFORMANCE ANALYSIS OF AN H.263 VIDEO ENCODER FOR VIRAM

JPEG Compression. What is JPEG?

Video Coding Standards: H.261, H.263 and H.26L

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

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

Introduction to Video Coding

VC 12/13 T16 Video Compression

Multimedia Standards

Emerging Architectures for HD Video Transcoding. Leon Adams Worldwide Manager Catalog DSP Marketing Texas Instruments

Emerging Architectures for HD Video Transcoding. Jeremiah Golston CTO, Digital Entertainment Products Texas Instruments

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

Upcoming Video Standards. Madhukar Budagavi, Ph.D. DSPS R&D Center, Dallas Texas Instruments Inc.

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

Efficient MPEG-2 to H.264/AVC Intra Transcoding in Transform-domain

H.264/AVC und MPEG-4 SVC - die nächsten Generationen der Videokompression

CAMED: Complexity Adaptive Motion Estimation & Mode Decision for H.264 Video

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

TKT-2431 SoC design. Introduction to exercises

Parallel Implementation of Arbitrary-Shaped MPEG-4 Decoder for Multiprocessor Systems

Lecture 3 Image and Video (MPEG) Coding

Overview: motion-compensated coding

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

CS 335 Graphics and Multimedia. Image Compression

Complexity Estimation of the H.264 Coded Video Bitstreams

Image and Video Compression Fundamentals

MPEG-2 Video Decoding on the TMS320C6X DSP Architecture

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

The VC-1 and H.264 Video Compression Standards for Broadband Video Services

Benchmarking Multithreaded, Multicore and Reconfigurable Processors

Module 7 VIDEO CODING AND MOTION ESTIMATION

Multimedia Signals and Systems Motion Picture Compression - MPEG

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

Fernando Pereira. Instituto Superior Técnico

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

Video Coding Standards

Fundamentals of Video Compression. Video Compression

Lecture 5: Compression I. This Week s Schedule

Lecture 8 JPEG Compression (Part 3)

EE Low Complexity H.264 encoder for mobile applications

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

Recommended Readings

Multimedia Communications: Coding, Systems, and Networking. Prof. Tsuhan Chen H.261

H.264 STANDARD BASED SIDE INFORMATION GENERATION IN WYNER-ZIV CODING

JPEG: An Image Compression System. Nimrod Peleg update: Nov. 2003

LECTURE VIII: BASIC VIDEO COMPRESSION TECHNIQUE DR. OUIEM BCHIR

Transcription:

Insight, Analysis, and Advice on Signal Processing Technology Introduction to Video Compression Jeff Bier Berkeley Design Technology, Inc. info@bdti.com http://www.bdti.com Outline Motivation and scope Still-image compression techniques Motion estimation and compensation Reducing artifacts Color conversion Conclusions 2 GSPx Page 1

Motivation and Scope Consumer video products increasingly rely on video compression DVDs, digital TV, personal video recorders, Internet video, multimedia jukeboxes, video-capable cell phones and PDAs, camcorders Video product developers need to understand the operation of video codecs To select codecs, processors, software modules To optimize software This presentation covers: Operation of video codecs and post-processing Computational and memory demands of key codec and postprocessing components 3 Outline Motivation and scope Still-image compression techniques Motion estimation and compensation Reducing artifacts Color conversion Conclusions 4 GSPx Page 2

Still-Image Compression Still-image compression Still-image techniques provide a basis for video compression Video can be compressed using still-image compression individually on each frame E.g., Motion JPEG or MJPEG But modern video codecs go well beyond this Start with still-image compression techniques Add motion estimation/compensation Takes advantage of similarities between frames in a video sequence 5 Still-Image Compression Transform Quantization Run-length coding Variable length coding Frame Header Frame Header Typical Still-Image Compression Data Flow 6 GSPx Page 3

Block Transform: 8x8 DCT Y values 8x8 DCT 8x8 DCT blocks applied on Y, U, and V planes individually The energy is concentrated in the low frequencies Perceptual information also concentrated in low frequencies High energy Low energy 8x8 IDCT Spatial domain Frequency domain 7 Block Transform: Resource Reqt s Compute load: Up to 30% of total video decoder processor cycles MPEG-4 CIF (352x288) @ 30 fps: 71,280 DCTs/s ~40 MHz on a TMS320C55x DSP ~10 MHz if using TMS320C55x DCT accelerator Many implementation and optimization options Can make compute requirements hard to predict Memory usage: negligible 8 GSPx Page 4

Quantization Original Quantizer Reconstructed Spatial domain Frequency domain Removes perceptually less significant data Reduces the number of bits per DCT coefficient 9 Quantization: Resource Reqt s Quantization (encoder) and dequantization (decoder and encoder) have similar compute loads Compute load: From 3% to about 15% of total decoder processor cycles Typically near the lower end of this range MPEG-4 CIF (352x288) @ 30 fps: ~10 MHz on a TMS320C55x DSP (estimated) Memory usage: negligible 10 GSPx Page 5

Coding Quantized DCT Coefficients Goal: Reduce the number of bits required to transmit the quantized coefficients Occurrence Quantized DCT values Observation: Unequal distribution of quantized DCT coefficient values 11 Variable Length Coding (VLC/VLD) Allocates fewer bits to the most frequent symbols (e.g., using Huffman) Integer number of bits per symbol Not the most efficient coding method Arithmetic coding more efficient, but expensive Run-length coding improves efficiency of VLC/VLD for image and video coding Symbol A B C D E F... Frequency 22 16 9 7 4 2... Code 1 011 0101 0100 0011 0010... 12 GSPx Page 6

Run-Length Coding Encodes value and number of successive occurrences Takes advantage of the high number of recurring zeros 20,1 ; 18,1 ; 20,1 ; 18,4 ;... ; 0, 37 13 Variable Length Coding: Processing Reqt s VL decoding much more computationally demanding than VL encoding VLD compute load: Up to 25% of total video decoder processor cycles MPEG-4 CIF (352x288) @ 30 fps, 700 kbps: ~15-25 MHz on a TMS320C55x DSP (estimated) About 11 operations per bit on average Memory usage A few KB of memory for lookup tables More for speed optimizations 14 GSPx Page 7

Resynchronization Markers Without markers, a single bit error in the coded bitstream prevents decoding of the rest of the frame Size of a corrupted variable-length code word is unknown Therefore, the start of the next code word (and all following code words) is unknown Resynchronization markers help the decoder recover from bitstream errors Provide a known bit pattern interspersed throughout the bitstream In case of an error, decoder searches for next marker, then continues decoding Corrupted codeword Un-decodable data Frame Header Frame Header Resynchronization markers 15 Reversible VLC Reversible VLC, in conjunction with resynchronization markers, further assists error recovery Code words can be decoded forward and backward In case of error, data can be decoded backward from the next resynchronization marker More data is recovered compared to resynchronization markers alone Corrupted codeword Data decoded backward Normal decoding continues forward Frame Header Frame Header Resynchronization markers 16 GSPx Page 8

AC-DC Prediction Spatial domain Frequency domain Current block Candidates not selected for prediction Candidate selected for prediction AC-DC prediction: encode first differential row and column DC prediction: encode differential DC value 17 AC-DC Prediction AC-DC prediction cannot be used in conjunction with motion compensation Used mostly for compressing a single image DC prediction used in JPEG AC-DC prediction often uses simple filters to predict each coefficient value from one or more adjacent blocks 18 GSPx Page 9

AC-DC Prediction: Processing Reqt s Compute load: DC prediction has negligible load AC-DC prediction used in about 8% of frames in typical video Negligible average load (~2% of processor cycles in decoder) Substantial per-frame load (~20-30% of cycles required to decode a frame that uses AC-DC prediction) Memory usage: Under 2 KB for CIF (352x288) resolution But more memory (up to 10 KB) can result in faster code May be overlapped with other memory structures not in use during prediction 19 Outline Motivation and scope Still-image compression techniques Motion estimation and compensation Reducing artifacts Color conversion Conclusions 20 GSPx Page 10

Motion Estimation and Compensation Still image compression ignores the correlation between frames of video JPEG achieves ~10:1 compression ratio Wavelet transform-based image coding reaches compression ratios up to ~30:1 Adding motion estimation and compensation results in much higher compression ratios Good video quality at compression ratios as high as ~200:1 21 Motion Estimation and Compensation Requires at least one reference frame Reference frame must be encoded before the current frame But, reference frame can be a future frame in the display sequence Three kinds of frames: I, P, and B I frame is encoded as a still image and doesn t depend on any reference frame I P frame depends on previously displayed reference frame P B frame depends on previous and future reference frames B 22 GSPx Page 11

Typical Sequence of I, P, B frames Display order (left to right) Encoding order (top to bottom) I B B B P B B B P B B B P I 23 Motion Estimation Predict the contents of each macroblock based on motion relative to reference frame Search reference frame for a 16x16 region that matches the macroblock Encode motion vectors Encode difference between predicted and actual macroblock pixels MV MV= Motion Vector Reference frame Current frame 24 GSPx Page 12

Video Encoder Block Diagram (Current MB) Input *MB + Diff block (2.5%) - 8x8 DCT (3.4%) Quantize (0.4%) VLC + scan (7.3%) Intra/Inter mode Inv-Quantize (0.5%) 0 Motion Compensation (1%) Motion Estimation (63.4%): - Fast Integer ME: 37% - Half-Pel + 4MV refine: 26% 8x8 IDCT (1.7%) + + Add block (2.9%) Frame Store (Reference MB) Bitstream MUX MV Coder Bitstream Out Encode Intra MB (1.8%) Encode Inter MB control code (3.9%) Misc functions (4.1%) 25 *MB Macro-Block Source: Motorola SPS Motion Estimation: The Problem Search area Search on 16x16 blocks Typically on luminance only or Sub-pixel interpolation required for non-integer motion vectors Σ Y[i] 2 SSD Σ Y[i] SAD SAD more often used 26 GSPx Page 13

Motion Estimation: Efficient Motion Vector Search Exhaustive search is impractical Evaluate only promising candidate motion vectors Don t have to find absolute best match Trade video quality for computational load Many methods in use Often proprietary Refine candidate vector selection in stages Predict candidate vectors from surrounding macroblocks and/or previous frames ~ ~Σ Motion vector search approach is a key differentiator between video encoder implementations 27 Motion Estimation: Processing Reqt s Compute load Most demanding task in video compression Up to 80% of total encoder processor cycles Many search methods exist; requirements vary by method May vary with video program content Makes encoder computational demand several times greater than that of the decoder Dominated by SAD computation Memory usage Motion estimation requires reference frame buffers Frame buffers dominate the memory requirements of the encoder E.g., 152,064 bytes per frame @ CIF (352x288) resolution High memory bandwidth required 28 GSPx Page 14

Motion Compensation: Processing Reqt s Motion compensation copies pixels from reference frame to predict current macroblock Requires interpolation for non-integer motion vector values Compute load Varies with video program content Can require from 5% to 40% of total decoder processor cycles MPEG-4 CIF (352x288) @ 30 fps: Roughly 15-25 MHz on a TMS320C55x DSP (estimated) Memory usage Requires reference frame buffers Frame buffers dominate decoder memory requirements Good memory bandwidth is desirable, but less critical compared to motion estimation 29 Outline Motivation and scope Still-image compression techniques Motion estimation and compensation Reducing artifacts Color conversion Conclusions 30 GSPx Page 15

Artifacts: Blocking and Ringing Blocking: Borders of 8x8 blocks visible in reconstructed frame Ringing: Distortions near edges of image features Original image Reconstructed image (with ringing Artifacts) 31 Deblocking and Deringing Filters Low-pass filters are used to smooth the image where artifacts occur Deblocking: Low-pass filter the pixels at borders of 8x8 blocks One-dimensional filter applied perpendicular to 8x8 block borders Deringing: Detect edges of image features Adaptively apply 2D filter to smooth out areas near edges Little or no filtering applied to edge pixels in order to avoid blurring 32 GSPx Page 16

Artifact Reduction Example: Deblocking Original MPEG Still Frame Horizontally & Vertically Deblocked Still Frame 33 Artifact Reduction: Post-processing vs. In-loop Deblocking/deringing often applied after the decoder (post-processing) Reference frames are not filtered Developers free to select best filters for the application or not filter at all Video Decoder Deblock Dering Reference frame Deblocking/deringing can be incorporated in the compression algorithm (in-loop filtering) Reference frames are filtered Same filters must be applied in encoder and decoder Better image quality at very low bit-rates Video Decoder Deblock Dering Reference frame 34 GSPx Page 17

Artifact Reduction: Processing Reqt s Deblocking and deringing filters can require more processor cycles than the video decoder Example: MPEG-4 Simple Profile, Level 1 (176x144, 15 fps) decoding requires 14 MIPS on ARM s ARM9E for a relatively complex video sequence With deblocking and deringing added, load increases to 39 MIPS Nearly 3x increase compared to MPEG-4 decoding alone! Post-processing may require an additional frame buffer 35 Outline Motivation and scope Still-image compression techniques Motion estimation and compensation Reducing artifacts Color conversion Conclusions 36 GSPx Page 18

Color Space Conversion Need for color conversion Capture and display video equipment: RGB......while codecs use YUV Computational demand 12 operations per pixel 36 million operations/second for CIF (352x288) @ 30 fps About 36 MHz on a TMS320C55x DSP Not including interpolation of chrominance planes Roughly 1/3 to 2/3 as many processor cycles as the video decoder 37 Outline Motivation and scope Still-image compression techniques Motion estimation and compensation Reducing artifacts Color conversion Conclusions 38 GSPx Page 19

Conclusions Understanding the computational and memory requirements of video compression is critical but challenging Application design choices are driven by computational and memory requirements Algorithm selection, processor selection, software optimization Video processing often stresses processing resources But video applications combine many different signalprocessing techniques Transforms, prediction, quantization, entropy coding, image filtering, etc. And there is large variation in computational and memory requirements among different applications E.g., digital camcorder has vastly different requirements from a video-enabled cell phone, even when using the same compression standard 39 Conclusions, cont. Understanding computational load Computational load of encoder is several times greater than that of decoder due to motion estimation Computational load proportional to frame size and rate for most functions Note: VLD computational load is proportional to bit rate Post-processing steps deblocking, deringing, color space conversion add considerably to the computational load Computational load can be difficult to predict Many different approaches to motion estimation Computational load of some tasks can fluctuate wildly depending on video program content E.g., motion compensation 40 GSPx Page 20

Conclusions, cont. Understanding memory requirements: Memory requirements dominated by frame buffers A decoder that supports only I and P frames requires two frame buffers (current and reference) A decoder that supports I, P, and B frames requires three buffers (current and two reference) Deblocking/deringing/color conversion may require an additional buffer Program memory, tables, other data comprise a nonnegligible portion of memory use But this portion is still several times smaller than frame buffers High memory use often necessitates off-chip memory Off-chip memory bandwidth can be a performance bottleneck 41 Conclusions, cont. Video compression used in many products DVDs, digital TV, personal video recorders, Internet video, multimedia jukeboxes, video-capable cell phones and PDAs, camcorders Different products have different needs Wide range of frame sizes and rates, video quality, bit rates, post-processing options, etc. Result in wide range of computational and memory requirements Need to understand the operation of video codecs To understand computational and memory requirements To select codecs, processors, software modules To optimize software 42 GSPx Page 21

For More Information www.bdti.com Inside [DSP] newsletter and quarterly reports Benchmark scores for dozens of processors Pocket Guide to Processors for DSP Basic stats on over 40 processors Articles, white papers, and presentation slides Processor architectures and performance Signal processing applications Signal processing software optimization comp.dsp FAQ 2004 Edition 43 GSPx Page 22