Introduction to JPEG and MPEG Ingemar J. Cox University College London.

Slides:



Advertisements
Similar presentations
Chapter 7 End-to-End Data
Advertisements

SWE 423: Multimedia Systems
Spring 2003CS 4611 Multimedia Outline Compression RTP Scheduling.
Department of Computer Engineering University of California at Santa Cruz Data Compression (3) Hai Tao.
JPEG.
CSc 461/561 Multimedia Systems Part B: 2. Lossy Compression
CS :: Fall 2003 MPEG-1 Video (Part 1) Ketan Mayer-Patel.
JPEG Still Image Data Compression Standard
CMPT 365 Multimedia Systems
T.Sharon-A.Frank 1 Multimedia Image Compression 2 T.Sharon-A.Frank Coding Techniques – Hybrid.
Department of Computer Engineering University of California at Santa Cruz Data Compression (2) Hai Tao.
2007Theo Schouten1 Compression "lossless" : f[x,y]  { g[x,y] = Decompress ( Compress ( f[x,y] ) | “lossy” : quality measures e 2 rms = 1/MN  ( g[x,y]
5. 1 JPEG “ JPEG ” is Joint Photographic Experts Group. compresses pictures which don't have sharp changes e.g. landscape pictures. May lose some of the.
1 Image and Video Compression: An Overview Jayanta Mukhopadhyay Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur,
Why Compress? To reduce the volume of data to be transmitted (text, fax, images) To reduce the bandwidth required for transmission and to reduce storage.
©Brooks/Cole, 2003 Chapter 15 Data Compression. ©Brooks/Cole, 2003 Realize the need for data compression. Differentiate between lossless and lossy compression.
Roger Cheng (JPEG slides courtesy of Brian Bailey) Spring 2007
1 JPEG Compression CSC361/661 Burg/Wong. 2 Fact about JPEG Compression JPEG stands for Joint Photographic Experts Group JPEG compression is used with.jpg.
CSE679: MPEG r MPEG-1 r MPEG-2. MPEG r MPEG: Motion Pictures Experts Group r Standard for encoding videos/movies/motion pictures r Evolving set of standards.
Image and Video Compression
Image Compression - JPEG. Video Compression MPEG –Audio compression Lossy / perceptually lossless / lossless 3 layers Models based on speech generation.
Trevor McCasland Arch Kelley.  Goal: reduce the size of stored files and data while retaining all necessary perceptual information  Used to create an.
Lossy Compression Based on spatial redundancy Measure of spatial redundancy: 2D covariance Cov X (i,j)=  2 e -  (i*i+j*j) Vertical correlation   
Introduction to JPEG Alireza Shafaei ( ) Fall 2005.
CS Spring 2012 CS 414 – Multimedia Systems Design Lecture 8 – JPEG Compression (Part 3) Klara Nahrstedt Spring 2012.
ECE472/572 - Lecture 12 Image Compression – Lossy Compression Techniques 11/10/11.
1 Image Compression. 2 GIF: Graphics Interchange Format Basic mode Dynamic mode A LZW method.
MPEG MPEG-VideoThis deals with the compression of video signals to about 1.5 Mbits/s; MPEG-AudioThis deals with the compression of digital audio signals.
Video Coding. Introduction Video Coding The objective of video coding is to compress moving images. The MPEG (Moving Picture Experts Group) and H.26X.
MPEG-1 and MPEG-2 Digital Video Coding Standards Author: Thomas Sikora Presenter: Chaojun Liang.
MPEG: (Moving Pictures Expert Group) A Video Compression Standard for Multimedia Applications Seo Yeong Geon Dept. of Computer Science in GNU.
Video Compression Techniques By David Ridgway.
Klara Nahrstedt Spring 2011
JPEG. The JPEG Standard JPEG is an image compression standard which was accepted as an international standard in  Developed by the Joint Photographic.
Image Processing and Computer Vision: 91. Image and Video Coding Compressing data to a smaller volume without losing (too much) information.
CIS679: Multimedia Basics r Multimedia data type r Basic compression techniques.
JPEG CIS 658 Fall 2005.
June, 1999 An Introduction to MPEG School of Computer Science, University of Central Florida, VLSI and M-5 Research Group Tao.
Image Compression Supervised By: Mr.Nael Alian Student: Anwaar Ahmed Abu-AlQomboz ID: IT College “Multimedia”
8. 1 MPEG MPEG is Moving Picture Experts Group On 1992 MPEG-1 was the standard, but was replaced only a year after by MPEG-2. Nowadays, MPEG-2 is gradually.
1 Classification of Compression Methods. 2 Data Compression  A means of reducing the size of blocks of data by removing  Unused material: e.g.) silence.
Hardware/Software Codesign Case Study : JPEG Compression.
Digital Image Processing Image Compression
Compression video overview 演講者:林崇元. Outline Introduction Fundamentals of video compression Picture type Signal quality measure Video encoder and decoder.
An introduction to audio/video compression Dr. Malcolm Wilson.
Spring 2000CS 4611 Multimedia Outline Compression RTP Scheduling.
CS Spring 2014 CS 414 – Multimedia Systems Design Lecture 10 – Compression Basics and JPEG Compression (Part 4) Klara Nahrstedt Spring 2014.
Advances in digital image compression techniques Guojun Lu, Computer Communications, Vol. 16, No. 4, Apr, 1993, pp
JPEG (Joint Photographic Expert Group)
MPEG.
JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.
JPEG.
Page 11/28/2016 CSE 40373/60373: Multimedia Systems Quantization  F(u, v) represents a DCT coefficient, Q(u, v) is a “quantization matrix” entry, and.
Block-based coding Multimedia Systems and Standards S2 IF Telkom University.
STATISTIC & INFORMATION THEORY (CSNB134) MODULE 11 COMPRESSION.
Introduction to JPEG m Akram Ben Ahmed
Image Processing Architecture, © Oleh TretiakPage 1Lecture 7 ECEC 453 Image Processing Architecture Lecture 8, February 5, 2004 JPEG: A Standard.
MPEG CODING PROCESS. Contents  What is MPEG Encoding?  Why MPEG Encoding?  Types of frames in MPEG 1  Layer of MPEG1 Video  MPEG 1 Intra frame Encoding.
By Dr. Hadi AL Saadi Lossy Compression. Source coding is based on changing of the original image content. Also called semantic-based coding High compression.
6/9/20161 Video Compression Techniques Image, Video and Audio Compression standards have been specified and released by two main groups since 1985: International.
MP3 and AAC Trac D. Tran ECE Department The Johns Hopkins University Baltimore MD
Video Compression Video : Sequence of frames Each Frame : 2-D Array of Pixels Video: 3-D data – 2-D Spatial, 1-D Temporal Video has both : – Spatial Redundancy.
H. 261 Video Compression Techniques 1. H.261  H.261: An earlier digital video compression standard, its principle of MC-based compression is retained.
JPEG Compression What is JPEG? Motivation
IMAGE COMPRESSION.
Multimedia Outline Compression RTP Scheduling Spring 2000 CS 461.
JPEG Image Coding Standard
JPEG.
CMPT 365 Multimedia Systems
JPEG Still Image Data Compression Standard
Presentation transcript:

Introduction to JPEG and MPEG Ingemar J. Cox University College London

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox2 Outline  Elementary information theory  Lossless compression  Quantization  Fundamentals of images  Discrete Cosine Transform (DCT)  JPEG  MPEG-1, MPEG-2

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox3 Bibliography  D. MacKay, “Information Theory, Inference and learning Algorithms”, Cambridge University Press,  W. B. Pennebaker and J. L. Mitchell, “JPEG Still Image Data Compression Standard”, Chapman Hall, 1993 (ISBN ).  G. K. Wallace, “The JPEG Still-Picture Compression Standard”, IEEE Trans. On Consumer Electronics, 38, 1, 18-34, 

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox4 Bibliography   T. Sikora, “MPEG Digital Video-Coding Standards”, IEEE Signal Processing Magazine, , September 1997

Elementary Information Theory

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox6 Elementary Information Theory  How much information does a symbol convey?  Intuitively, the more unpredictable or surprising it is, the more information is conveyed.  Conversely, if we strongly expected something, and it occurs, we have not learnt very much

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox7 Elementary Information Theory  If p is the probability that a symbol will occur  Then the amount of information, I, conveyed is:  The information, I, is measured in bits  It is the optimum code length for the symbol

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox8 Elementary Information Theory  The entropy, H, is the average information per symbol  Provides a lower bound on the compression that can be achieved

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox9 Elementary Information theory  A simple example. Suppose we need to transmit four possible weather conditions: 1.Sunny 2.Cloudy 3.Rainy 4.Snowy  If all conditions are equally likely, p(s)=0.25, and H=2  i.e. we need a minimum of 2 bits per symbol

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox10 Elementary information theory  Suppose instead that it is: 1.Sunny 0.5 of the time 2.Cloudy 0.25 of the time 3.Rainy of the time, and 4.Snowy of the time  Then the entropy is

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox11 Elementary Information Theory  Variable length codewords  Huffman code – integer code lengths  Arithmetic codes – non-integer code lengths

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox12 Elementary Information Theory  Huffman code WeatherProbabilityInformationInteger code Sunny0.510 Cloudy Rainy Snowy

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox13 Elementary Information Theory  Previous illustration is an example of a lossless code  I.e. we are able to recover the information exactly

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox14 Elementary Information Theory  Note that we have assumed that each symbol is independent of the other symbols  I.e. the current symbol provides no information regarding the next symbol

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox15 Quantization  Quantization is the process of approximating a continuous (or range of values) by a (much) smaller range of values  Where Round(y) rounds y to the nearest integer   is the quantization stepsize

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox16 Quantization  Example:  =

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox17 Quantization  Quantization plays an important role in lossy compression  This is where the loss happens

Fundamentals of Images

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox19 Fundamentals of images  An image consists of pixels (picture elements)  Each pixel represents luminance (and colour)  Typically, 8-bits per pixel

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox20 Fundamentals of images  Colour  Colour spaces (representations)  RGB (red-green-blue)  CMY (cyan-magenta-yellow)  YUV Y = 0.3R+0.6G+0.1B (luminance) U=R-Y V=B-Y  Greyscale  Binary

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox21 Fundamentals of images  A TV frame is about 640x480 pixels  If each pixels is represented by 8-bits for each colour, then the total image size is  640×480*3=921,600 bytes or  7.4Mbits  At 30 frames per second, this would be   220Mbits/second

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox22 Fundamentals of images  Do we need all these bits?

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox23 Fundamentals of images  Here is an image represented with 8-bits per pixel

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox24 Fundamentals of images  Here is the same image at 7-bits per pixel

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox25 Fundamentals of images  And at 6-bits per pixel

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox26 Fundamentals of images  And at 5-bits per pixel

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox27 Fundamentals of images  And at 4-bits per pixel

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox28 Fundamentals of images  Do we need all these bits?  No!  The previous example illustrated the eye’s sensitivity to luminance  We can build a perceptual model  Only code what is important to the human visual system (HVS)  Usually a function of spatial frequency

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox29 Fundamentals of Images  Just as audio has temporal frequencies  Images have spatial frequencies  Transforms  Fourier transform  Discrete cosine transform  Wavelet transform  Hadamard transform

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox30 Discrete cosine transform  Forward DCT  Inverse DCT

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox31 Basis functions  DC term

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox32 Basis functions  First term

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox33 Basis functions  Second term

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox34 Basis functions  Third term

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox35 Basis functions  Fourth term

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox36 Basis functions  Fifth term

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox37 Basis functions  Sixth term

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox38 Basis functions  Seventh term

DCT Example

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox40 Example  Signal

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox41 Example  DCT coefficients are:   0   0   0

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox42 Example: DCT decomposition  DC term

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox43 Example: DCT decomposition  2 nd AC term

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox44 Example: DCT decomposition  6 th AC term

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox45 Example: summation of DCT terms  First two non-zero coefficients

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox46 Example: summation of DCT terms  All 3 non-zero coefficients

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox47 Example  What if we quantize DCT coefficients?   =1  Quantized DCT coefficients are:  4  0  -3  0

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox48 Example  Approximate reconstruction

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox49 Example  Exact reconstruction

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox50 2-D DCT Transform  Let i(x,y) represent an image with N rows and M columns  Its DCT I(u,v) is given by  where

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox51 Fundamentals of images  Discrete cosine transform  Coefficients are approximately uncorrelated  Except DC term  C.f. original 8×8 pixel block  Concentrates more power in the low frequency coefficients  Computationally efficient  Block-based DCT  Compute DCT on 8×8 blocks of pixels

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox52 Fundamentals of images  Basis functions for the 8×8 DCT (courtesy Wikipedia)

Fundamentals of JPEG

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox54 Fundamentals of JPEG DCTQuantizerEntropy coder IDCTDequantizer Entropy decoder Compressed image data Encoder Decoder

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox55 Fundamentals of JPEG  JPEG works on 8×8 blocks  Extract 8×8 block of pixels  Convert to DCT domain  Quantize each coefficient  Different stepsize for each coefficient  Based on sensitivity of human visual system  Order coefficients in zig-zag order  Entropy code the quantized values

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox56 Fundamentals of JPEG  A common quantization table is

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox57 Fundamentals of JPEG  Zig-zag ordering

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox58 Fundamentals of JPEG  Entropy coding  Run length encoding followed by  Huffman  Arithmetic  DC term treated separately  Differential Pulse Code Modulation (DPCM)  2-step process 1.Convert zig-zag sequence to a symbol sequence 2.Convert symbols to a data stream

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox59 Fundamentals of JPEG  Modes  Sequential  Progressive  Spectral selection Send lower frequency coefficients first  Successive approximation Send lower precision first, and subsequently refine  Lossless  Hierarchical  Send low resolution image first

Fundamentals of MPEG-1/2

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox61 Fundamentals of MPEG  A sequence of 2D images  Temporal correlation as well as spatial correlation  TV broadcast  Frame-based  Field-based

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox62 MPEG  Moving Picture Experts Group  Standard for video compression  Similarities with JPEG

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox63 MPEG  Design is a compromise between  Bit rate  Encoder/decoder complexity  Random access capability

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox64 MPEG  Images  Spatial redundancy  Perceptual redundancy  Video  Spatial redundancy  Intraframe coding  Temporal redundancy  Interframe coding  Perceptual redundancy

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox65 MPEG  Consider a sequence of n frames of video.  It consists of:  I-frames  P-frames  B-frames  A sequence of one I-frame followed by P- and B-frames is known as a GOP  Group of Pictures  E.g. IBBPBBPBBPBBP

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox66 MPEG  I-frames  Intraframe coded  No motion compensation  P-frames  Interframe coded  Motion compensation Based on past frames only  B-frames  Interframe coded  Motion compensation Based on past and future frames

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox67 MPEG  Motion-compensated prediction  Divide current frame, i, into disjoint 16×16 macroblocks  Search a window in previous frame, i-1, for closest match  Calculate the prediction error  For each of the four 8×8 blocks in the macroblock, perform DCT-based coding  Transmit motion vector + entropy coded prediction error (lossy coding)

UCL Adastral Park Postgraduate Campus Nov 27th 2006Ingemar J. Cox68 MPEG  Like JPEG, the DC term is treated separately  DPCM  B-frame compression high  Need buffer and delay