Image/video compression: howto? Aline ROUMY INRIA Rennes

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

Image and Video Coding I: Fundamentals

STUDY AND IMPLEMENTATION OF VIDEO COMPRESSION STANDARDS (H.264/AVC, DIRAC)

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

Image and Video Coding I: Fundamentals

Comparative and performance analysis of HEVC and H.264 Intra frame coding and JPEG2000

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

Digital Video Processing

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

Wireless Communication

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

Introduction ti to JPEG

CISC 7610 Lecture 3 Multimedia data and data formats

Compression of Stereo Images using a Huffman-Zip Scheme

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

Introduction to Video Coding

Lecture 5: Compression I. This Week s Schedule

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

VC 12/13 T16 Video Compression

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

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

EE 5359 Low Complexity H.264 encoder for mobile applications. Thejaswini Purushotham Student I.D.: Date: February 18,2010

COMPARISON OF HIGH EFFICIENCY VIDEO CODING (HEVC) PERFORMANCE WITH H.264 ADVANCED VIDEO CODING (AVC)

DigiPoints Volume 1. Student Workbook. Module 8 Digital Compression

VHDL Implementation of H.264 Video Coding Standard

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

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

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

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

Digital Image Representation Image Compression

High Efficiency Video Coding (HEVC) test model HM vs. HM- 16.6: objective and subjective performance analysis

Comparative and performance analysis of HEVC and H.264 Intra frame coding and JPEG2000

STUDY AND PERFORMANCE COMPARISON OF HEVC AND H.264 VIDEO CODECS

HEVC The Next Generation Video Coding. 1 ELEG5502 Video Coding Technology

Reducing/eliminating visual artifacts in HEVC by the deblocking filter.

Part 1 of 4. MARCH

Performance Comparison between DWT-based and DCT-based Encoders

Testing HEVC model HM on objective and subjective way

EE Low Complexity H.264 encoder for mobile applications

Homogeneous Transcoding of HEVC for bit rate reduction

Computer and Machine Vision

The Scope of Picture and Video Coding Standardization

IMAGE COMPRESSION. Chapter - 5 : (Basic)

Fundamentals of Video Compression. Video Compression

7.5 Dictionary-based Coding

Department of Electrical Engineering

A COMPARISON OF CABAC THROUGHPUT FOR HEVC/H.265 VS. AVC/H.264. Massachusetts Institute of Technology Texas Instruments

CMPT 365 Multimedia Systems. Media Compression - Image

IMAGE COMPRESSION. October 7, ICSY Lab, University of Kaiserslautern, Germany

Lecture 6: Compression II. This Week s Schedule

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

Lecture Information Multimedia Video Coding & Architectures

DIGITAL TELEVISION 1. DIGITAL VIDEO FUNDAMENTALS

COMPARATIVE ANALYSIS OF DIRAC PRO-VC-2, H.264 AVC AND AVS CHINA-P7

White paper: Video Coding A Timeline

Professor, CSE Department, Nirma University, Ahmedabad, India

H.264/AVC BASED NEAR LOSSLESS INTRA CODEC USING LINE-BASED PREDICTION AND MODIFIED CABAC. Jung-Ah Choi, Jin Heo, and Yo-Sung Ho

EFFICIENT DEISGN OF LOW AREA BASED H.264 COMPRESSOR AND DECOMPRESSOR WITH H.264 INTEGER TRANSFORM

Rotate Intra Block Copy for Still Image Coding

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

Lecture Information. Mod 01 Part 1: The Need for Compression. Why Digital Signal Coding? (1)

CS 335 Graphics and Multimedia. Image Compression

MULTIMEDIA COMMUNICATION

CS 260: Seminar in Computer Science: Multimedia Networking

[30] Dong J., Lou j. and Yu L. (2003), Improved entropy coding method, Doc. AVS Working Group (M1214), Beijing, Chaina. CHAPTER 4

Video Compression An Introduction

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

Lecture 8 JPEG Compression (Part 3)

Cross Layer Protocol Design

AUDIOVISUAL COMMUNICATION

Image and Video Compression Fundamentals

EE 5359 H.264 to VC 1 Transcoding

IMAGE PROCESSING (RRY025) LECTURE 13 IMAGE COMPRESSION - I

DCT Based, Lossy Still Image Compression

Compression II: Images (JPEG)

ENCODER COMPLEXITY REDUCTION WITH SELECTIVE MOTION MERGE IN HEVC ABHISHEK HASSAN THUNGARAJ. Presented to the Faculty of the Graduate School of

High Efficiency Video Coding: The Next Gen Codec. Matthew Goldman Senior Vice President TV Compression Technology Ericsson

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

FRACTAL IMAGE COMPRESSION OF GRAYSCALE AND RGB IMAGES USING DCT WITH QUADTREE DECOMPOSITION AND HUFFMAN CODING. Moheb R. Girgis and Mohammed M.

NEW CAVLC ENCODING ALGORITHM FOR LOSSLESS INTRA CODING IN H.264/AVC. Jin Heo, Seung-Hwan Kim, and Yo-Sung Ho

Video coding. Concepts and notations.

Multimedia Signals and Systems Still Image Compression - JPEG

Differential Compression and Optimal Caching Methods for Content-Based Image Search Systems

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

A comparison of CABAC throughput for HEVC/H.265 VS. AVC/H.264

Topic 5 Image Compression

DIGITAL IMAGE PROCESSING WRITTEN REPORT ADAPTIVE IMAGE COMPRESSION TECHNIQUES FOR WIRELESS MULTIMEDIA APPLICATIONS

Video Codec Design Developing Image and Video Compression Systems

Overview, implementation and comparison of Audio Video Standard (AVS) China and H.264/MPEG -4 part 10 or Advanced Video Coding Standard

"Block Artifacts Reduction Using Two HEVC Encoder Methods" Dr.K.R.RAO

Chapter 1. Digital Data Representation and Communication. Part 2

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

Repetition 1st lecture

COLOR IMAGE COMPRESSION USING DISCRETE COSINUS TRANSFORM (DCT)

HYBRID TRANSFORMATION TECHNIQUE FOR IMAGE COMPRESSION

An Intraframe Coding by Modified DCT Transform using H.264 Standard

Introduction to Video Encoding

Analysis of Information Hiding Techniques in HEVC.

Color Imaging Seminar. Yair Moshe

Multimedia Communications ECE 728 (Data Compression)

Transcription:

Image/video compression: howto? Aline ROUMY INRIA Rennes October 2016

1. Why a need to compress video? 2. How-to compress (lossless)? 3. Lossy compression 4. Transform-based compression 5. Prediction-based compression - 2

1 Why a need to compress video? - 3

Definition Compression = store same image/video with less bits Compression standards: given by ITU International Telecommunication Union ISO International Organization for Standardization Joint teams: JVT Joint Video Team (H.264/MPEG-4-AVC in 2003) JCT-VC Joint Collaborative Team on Video Coding for development de HEVC (High efficiency video codec) (Jan. 2013, ITU-T H.265 Avril 2013) - 4

What is a digital image? Discrete grid with M (columns) x N (rows) pixels Canonical processing order: scanning row-by-row from left to right) m M n N - 5

Color image decomposition R G B (red green blue) YCbCr (called YUV) Y luminance = 0,3R + 0,6V + 0,1B Cb Cr chrominance Cb ~Y - B Cr ~Y - R backward compatible TV B&W eye +sensitive to Y than CbCr - 6

Chroma sub-sampling Color sampling is defined by three terms: J : a : b J Horizontal width of the sampling reference region, usually 4 a Number of chrominance samples (Cr, Cb) in the first row of J pixels b Number of new chrominance samples (Cr, Cb) in the second row of J pixels - 7

Chroma sub-sampling - 8

Why a need to compress? i.e. transmit same image with less bits. Example: HD 1080p = 1920 1080, 50 Hz (images/sec) Y luminance Cb Chrominance Cr Chrominance Nb pixels 1920x1080= 2.1 M 960x540=.5 M 960x540=.5 M Nb bits par pixel 8 bit 8 bit 8 bit Raw data rate 1.2 Gbps Some data rate vs storage capacity (under evolution) DVD 4.7 GB 3s TNT 20 Mbps Ethernet/Fast Ethernet < 10 / 100 / 1000 Mbps DSL downlink 384 2048 kbps Mobile phone (true datarate 2G /3G /4G) 9.05 / 384 kbps / 40 Mbps - 9

Quality measure Objective criteria to measure the quality of image compression, mapping that depends on : original image : reconstructed (after compression) Mean square error (MSE): Peak signal-to-noise ratio: db - 10

1. Why a need to compress video? 2. How-to compress (lossless)? 3. Lossy compression 4. Transform-based compression 5. Prediction-based compression - 11

2 How-to compress? - 12

Hangman game Objective = play and explain your strategy _ - 13

2 winning ideas 1. Letter frequency probability 2. Correlation between successive letters dependence - 14

Analogy hangman game- compression word image Answer to a question (yes/no). 1 bit of the bistream that represents image Goal: propose a minimum number of letter Goal: propose a minimum number of bits - 15

Exploit idea 1: Use non uniformity of the probabilities Consider a car race: Name A natole B arnabe C hef D arius Probability to win 1/4 1/2 1/8 1/8 A wins 1 out of 4, etc For instance, let us consider the winner sequence: ABBCBBDABCBABBCBBDAABABC Question: encode the winner sequence into a bitsequence in an efficient way. - 16

Exploit idea 1: Use non uniformity of the probabilities Consider a car race: Nom A natole B arnabé C hef D arius Probability 1/4 1/2 1/8 1/8 Codeword 00 01 10 11 First try to encode the winner sequence: ABBCBBDABCBABBCBBDAABABC 00 01 01 10 01 01 etc Average length 2 bits/race Better idea? - 17

Exploit idea 1: Use non uniformity of the probabilities Consider a car race: Nom A natole B arnabé C hef D arius probability 1/4 1/2 1/8 1/8 codeword 10 0 110 111 Second try to encode the winner sequence: ABBCBBDABCBABBCBBDAABABC Average length (fixed length code) 2 bits/race Average length 2*1/4+1*1/2+3*1/8+3*1/8 Optimal length [information theory Shannon48] 1,75 bits/race 1,75 bits/race - 18

course 2 course 1 Idea 2: use dependence between data Assume that the car races results are dependent _A _B _C _D A_.25.5.125.125 B_.25.5.125.125 C_.25.5 0.25 D_.25.5.25 0-19

Idea 2: use dependence between data _A _B _C _D average length A_.25.5.125.125 Optimal code 10 0 110 111 1.75 1.75 B_.25.5.125.125 10 0 110 111 1.75 1.75 C_.25.5 0.25 10 0 11 1.5 1.5 D_.25.5.25 0 10 0 11 1.5 1.5-20

Idea 2: use dependence between data _A _B _C _D Average length A_.25.5.125.125 Optimal code.25 10 0 110 111 1.75 1.75 B_.25.5.125.125.5 10 0 110 111 1.75 1.75 C_.25.5 0.25.125 10 0 11 1.5 1.5 D_.25.5.25 0.125 10 0 11 1.5 1.5 1.69 1.69 Complexity: storage grows exponentially with the number of letters jointly processed i.e. the memory: from 4 to 16 =4² codewords - 21

Information theory: a primer Random process (source) Example: model of the pixels Minimal average length (in bits) to represent one sample discrete i.i.d. source [Shannon]: ENTROPY bits/sample discrete stationary ergodic source [Shannon-McMillan-Breiman] bits/sample

Information theory Theorem: independence bound for joint entropy equality iff X1,, Xn independents Interpretation 1. Exploit the dependency allows to reduce the number of bits. BUT requires to store the joint law (complexity grows exponentially with n) 2. Separate encoding of independent data is optimal.

Information theory Exploit idea: encode SEPARATELY dependent data Transform the random vector X into an equivalent vector Y Invertible transform Y independents Transform the data s.t. the transformed data are independent and s.t. one can compress the data separately (scalar entropy coding = coding with the marginal law).

1. Why a need to compress video? 2. How-to compress (lossless)? 3. Lossy compression 4. Transform-based compression 5. Prediction-based compression - 25

3 Lossy compression - 26

Compression with losses Compression under a rate constraint rate = nb bits / pixel (or letter) distortion = distance between original and compressed image distortion D Use case: medical, file transfer R lossless rate - 27

Implementing lossy compression 3 2 1 0 63 127 191 255 Uniform scalar quantization 8 bits 2 bits - 28

Implementing lossy compression 7 0 63 127 191 255 Uniform scalar quantization 8 bits 3 bits - 29

Implementing efficiently lossy compression Entropy coding c= C(q) image x Quantiz. indices q bits c q= Q(y) A B C D 1/4 1/2 1/8 1/8 10 0 110 111 Uniform scalar quantization + entropy coding degrades by 1.53 db with respect to optimal - 30

1. Why a need to compress video? 2. How-to compress (lossless)? 3. Lossy compression 4. Transform-based compression 5. Prediction-based compression - 31

4 Dependent data transform coding - 32

Where do we address dependency? Entropy coding c= C(q) image x Quantiz. indices q bits c q= Q(y) A B C D 1/4 1/2 1/8 1/8 10 0 110 111 Scheme is quasi-optimal if pixels were independent... - 33

Where do we address dependency? Entropy coding c= C(q) image x Transform coefficients y Quantiz. indices q bits c y= T(x) q= Q(y) A B C D 1/4 1/2 1/8 1/8 10 0 110 111 Traiter la dépendance au niveau code entropique : trop complexe Scheme is quasi-optimal if pixels were independent... transform the pixels into independent data - 34

Exploit data dependency (a,b,c,d) -> (m, b-m, c-m, d-m): invertible a b c d m=(a+b+c+d)/4 transform Dependence = Neighboring pixels have similar value m c-m b-m d-m Mean difference: small amplitude break dependence within a block? - 35

Exploit data dependency a c b d This transform is a particular case: discrete cosine transform (DCT) (MPEG 1, 2, 4, HEVC) wavelets (JPEG-2000, Dirac) m=(a+b+c+d)/4 m c-m b-m d-m - 36

Original Lena (512 x 512 Pixels, 8-Bit Y/ pixel, 257Ko) - 37

Gray = 0 since m-d coded by m-d+128 Dependences remain - 38

Gray = 0-39

Gray = 0 Wavelet example - 40

Transform used in JPEG 2000 Less dependence but still some remains - 41

JPEG2000 Entropy c= C(q) image x Transform coefficients y Quantiz. indices q bits c y= T(x) q= Q(y) A B C D 1/4 1/2 1/8 1/8 10 0 110 111-42

Compression results JPEG2000 Original Carol (512 x 512 Pixels, 24-Bit RGB/pixel, Size 786kbytes) - 43

Compression results JPEG2000 75:1, 10.6 kbytes - 44

Compression results JPEG2000 150:1, 5.3 kbytes - 45

Compression results JPEG2000 300:1, 2.6 kbytes - 46

Comparison JPEG (1992) vs. JPEG2000 Lena, 256x256 RGB Baseline JPEG: 4572 bytes Lena, 256x256 RGB JPEG-2000: 4572 bytes - 47

1. Why a need to compress video? 2. How-to compress (lossless)? 3. Lossy compression 4. Transform-based compression 5. Prediction-based compression - 48

5 Dependent data prediction - 49

Dependency remains image x Transform y= T(x) Quantiz. q= Q(y) Entropy coding c= C(q) bits c A B C D 1/4 ½ 1/8 1/8 10 0 110 111 Dependent data - 50

Dependency remains image x Prediction z= P(x) Transform y= T(z) Quantiz. q= Q(y) Entropy coding c= C(q) bits c A B C D 1/4 ½ 1/8 1/8 10 0 110 111 Prediction: further/better suppress dependencies 56-51

Prediction between images Intra: image coded independently of other images (synchro) Inter: (P/B) image expressed in terms of other images Used in MPEG-2, -4, HEVC - 52

Prediction between images: inter prediction Very efficient: rate (inter) << rate (intra) Intra: image codée indépendamment des autres (synchro) Inter: (P/B) image codée en fonction d autres images Utilisé en MPEG-2, -4, HEVC - 53

Intra prediction (MPEG-4, HEVC) If efficient prediction, difference between original and prediction (residue) : independent samples [estimation theory] - 54

6 Conclusion Take Home Messages - 55

Take-home-message image x Prediction z= P(x) Transform y= T(z) Quantiz. q= Q(y) Entropy coding c= C(q) bits c A B C D 1/4 ½ 1/8 1/8 10 0 110 111 Transform and prediction: exploit pixel dependency Quantization: introduce losses Entropy coding: exploit non uniform pixel distribution - 56

Results with HEVC Vidéo BasketBallPass 416x240 pixels 50Hz (8 + (8+8)/4 bits) 60 Mbps Quantization step Rate Compression ratio uncompressed 60 Mbps 22 1 Mbps 60:1 32 340 kbps 176:1 51 30 kbps 2000:1 original 60:1-57

Results with HEVC Vidéo BasketBallPass 416x240 pixels 50Hz (8 + (8+8)/4 bits) 60 Mbps Quantization step Rate Compression ratio uncompressed 60 Mbps 22 1 Mbps 60:1 32 340 kbps 176:1 51 30 kbps 2000:1 original 176:1-58

Results with HEVC Vidéo BasketBallPass 416x240 pixels 50Hz (8 + (8+8)/4 bits) 60 Mbps Quantization step Rate Compression ratio uncompressed 60 Mbps 22 1 Mbps 60:1 32 340 kbps 176:1 51 30 kbps 2000:1 original 2000:1-59

Encoding scheme HEVC Elements in gray correspond to the decoder (Overview of HEVC Standard, TCSVT Dec 2012) 56-60

Pour en savoir plus 1. Thomas Wiegand and Heiko Schwarz: Source Coding: Part I of Fundamentals of Source and Video Coding, Foundations and Trends in Signal Processing, vol. 4, no. 1-2, pp. 1-222, January 2011. http://iphome.hhi.de/wiegand/pubs.htm 2. Ian Richardson The Advanced H 264 video compression standard, Wiley 2010. 3. Vivienne Sze, Madhukar Budagavi, Gary J. Sullivan High Efficiency Video Coding (HEVC), Springer 2014. 56-61

Thank you www.inria.fr