Algorithms in the Real World

Slides:



Advertisements
Similar presentations
JPEG Compresses real images Standard set by the Joint Photographic Experts Group in 1991.
Advertisements

15 Data Compression Foundations of Computer Science ã Cengage Learning.
Data Compression CS 147 Minh Nguyen.
Image Compression. Data and information Data is not the same thing as information. Data is the means with which information is expressed. The amount of.
Chapter 7 End-to-End Data
SWE 423: Multimedia Systems
Spring 2003CS 4611 Multimedia Outline Compression RTP Scheduling.
CSE 589 Applied Algorithms Spring 1999 Image Compression Vector Quantization Nearest Neighbor Search.
SWE 423: Multimedia Systems
Department of Computer Engineering University of California at Santa Cruz Data Compression (3) Hai Tao.
Spatial and Temporal Data Mining
Losslessy Compression of Multimedia Data Hao Jiang Computer Science Department Sept. 25, 2007.
CS :: Fall 2003 MPEG-1 Video (Part 1) Ketan Mayer-Patel.
CMPT 365 Multimedia Systems
T.Sharon-A.Frank 1 Multimedia Image Compression 2 T.Sharon-A.Frank Coding Techniques – Hybrid.
CS430 © 2006 Ray S. Babcock Lossy Compression Examples JPEG MPEG JPEG MPEG.
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.
©Brooks/Cole, 2003 Chapter 15 Data Compression. ©Brooks/Cole, 2003 Realize the need for data compression. Differentiate between lossless and lossy compression.
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.
Image Compression - JPEG. Video Compression MPEG –Audio compression Lossy / perceptually lossless / lossless 3 layers Models based on speech generation.
Software Research Image Compression Mohamed N. Ahmed, Ph.D.
Trevor McCasland Arch Kelley.  Goal: reduce the size of stored files and data while retaining all necessary perceptual information  Used to create an.
CS559-Computer Graphics Copyright Stephen Chenney Image File Formats How big is the image? –All files in some way store width and height How is the image.
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.
1 Image Compression. 2 GIF: Graphics Interchange Format Basic mode Dynamic mode A LZW method.
296.3Page 1 CPS 296.3:Algorithms in the Real World Data Compression: Lecture 2.5.
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.
Multimedia Data DCT Image Compression
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.
Understanding JPEG MIT-CETI Xi’an ‘99 Lecture 10 Ben Walter, Lan Chen, Wei Hu.
An introduction to audio/video compression Dr. Malcolm Wilson.
Advances in digital image compression techniques Guojun Lu, Computer Communications, Vol. 16, No. 4, Apr, 1993, pp
JPEG Image Compression Standard Introduction Lossless and Lossy Coding Schemes JPEG Standard Details Summary.
JPEG.
STATISTIC & INFORMATION THEORY (CSNB134) MODULE 11 COMPRESSION.
Introduction to JPEG m Akram Ben Ahmed
An introduction to audio/video compression Prepared by :: Bhatt shivani ( )
IS502:M ULTIMEDIA D ESIGN FOR I NFORMATION S YSTEM M ULTIMEDIA OF D ATA C OMPRESSION Presenter Name: Mahmood A.Moneim Supervised By: Prof. Hesham A.Hefny.
Entropy vs. Average Code-length Important application of Shannon’s entropy measure is in finding efficient (~ short average length) code words The measure.
Submitted To-: Submitted By-: Mrs.Sushma Rani (HOD) Aashish Kr. Goyal (IT-7th) Deepak Soni (IT-8 th )
Data Compression Michael J. Watts
JPEG Compression What is JPEG? Motivation
Image compression.
IMAGE PROCESSING IMAGE COMPRESSION
IMAGE COMPRESSION.
Chapter 9 Image Compression Standards
15-853:Algorithms in the Real World
Data Compression.
Multimedia Outline Compression RTP Scheduling Spring 2000 CS 461.
Algorithms in the Real World
JPEG Image Coding Standard
Image Compression The still image and motion images can be compressed by lossless coding or lossy coding. Principle of compression: - reduce the redundant.
JPEG.
Data Compression.
Chapter 7.2: Layer 5: Compression
Data Compression CS 147 Minh Nguyen.
CMPT 365 Multimedia Systems
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.
JPEG Pasi Fränti
Judith Molka-Danielsen, Oct. 02, 2000
JPEG Still Image Data Compression Standard
The JPEG Standard.
Image Coding and Compression
15 Data Compression Foundations of Computer Science ã Cengage Learning.
Chapter 8 – Compression Aims: Outline the objectives of compression.
CPS 296.3:Algorithms in the Real World
15 Data Compression Foundations of Computer Science ã Cengage Learning.
Presentation transcript:

Algorithms in the Real World Data Compression 4

Compression Outline Introduction: Lossy vs. Lossless, Benchmarks, … Information Theory: Entropy, etc. Probability Coding: Huffman + Arithmetic Coding Applications of Probability Coding: PPM + others Lempel-Ziv Algorithms: LZ77, gzip, compress, … Other Lossless Algorithms: Burrows-Wheeler Lossy algorithms for images: JPEG, MPEG, ... Scalar and vector quantization JPEG and MPEG Compressing graphs and meshes: BBK 296.3

Scalar Quantization Quantize regions of values into a single value: input output uniform input output non uniform Why would one use a non-uniform quantization? Quantization is lossy Can be used, e.g., to reduce # of bits for a pixel

Vector Quantization: Example representative codevectors Input vectors are (Height, Weight) pairs. Map each input vector to a representative “codevector”. Codevectors are stored in a codebook.

Vector Quantization input output generate input vector generate output codevector index of code- vector compress index decompress index find closest code- vector index codebook codebook encode decode

Vector Quantization What do we use as vectors? Color (Red, Green, Blue) Can be used, for example to reduce 24bits/pixel to 12bits/pixel Used in some terminals to reduce data rate from the CPU (colormaps) k consecutive samples in audio Block of k x k pixels in an image How do we decide on a codebook Typically done with clustering Next two slides are overheads.

Linear Transform Coding Want to encode values over a region of time or space typically used for images or audio represented as a vector [x1,x2,…] Select a set of linear basis functions i that span the space sin, cos, spherical harmonics, wavelets, … defined at discrete points

Linear Transform Coding Coefficients: In matrix notation: Where A is an n x n matrix, and each row defines a basis function

Example: Cosine Transform … Qi xj j small values ?

Other Transforms Polynomial: 1 x x2 Wavelet (Haar):

How to Pick a Transform Goals: Decorrelate (remove repeated patterns in data) Low coefficients for many terms Some terms affect perception more than others Why is using a Cosine or Fourier transform across a whole image bad? -- If there is no periodicity in the image, large coefficients for high-frequency terms How might we fix this? -- use basis functions that are not as smoothly periodic

Usefulness of Transform Typically transforms A are orthonormal: A-1 = AT Properties of orthonormal transforms: å x2 = å Q2 (energy conservation) Would like to compact energy into as few coefficients as possible (the transform coding gain) arithmetic mean/geometric mean si = (Qi - Qav) The higher the gain, the better the compression

Case Study: JPEG A nice example since it uses many techniques: Transform coding (Discrete Cosine Transform) Scalar quantization Difference coding Run-length coding Huffman or arithmetic coding JPEG (Joint Photographic Experts Group) was designed in 1991 for lossy and lossless compression of color or grayscale images. The lossless version is rarely used. Can be adjusted for compression ratio (typically 10:1) 296.3

JPEG in a Nutshell Typically down- sample I and Q planes by a factor of 2 in each dimension – lossy. Factor of 4 compression for I and Q, 2 overall. original image inter- phase Brightness 0.59 Green + 0.30 Red + 0.11 Blue three planes of 8-bit pixel values quadra- ture (two-dimensional DCT) break each plane into 8x8 blocks of pixels

JPEG: Quantization Table 16 11 10 24 40 51 61 12 14 19 26 58 60 55 13 57 69 56 17 22 29 87 80 62 18 37 68 109 103 77 35 64 81 104 113 92 49 78 121 120 101 72 95 98 112 100 99 Divide each coefficient by factor shown. Also divided through uniformly by a quality factor which is under control.

JPEG: Block scanning order Scan block of coefficients in zig-zag order Use difference coding upper left (DC) coefficient between consecutive blocks Uses run-length coding for sequences of zeros for rest of block

JPEG: example .125 bits/pixel (factor of 192)

Case Study: MPEG Pretty much JPEG with interframe coding Three types of frames I = intra frame (approx. JPEG) anchors P = predictive coded frames – based on previous I or P frame in output order B = bidirectionally predictive coded frames - based on next and/or previous I or P frames in output order Example: ordered chronologically in input Type: I B P OutputOrder: 1 3 4 2 6 7 5 9 10 8 12 13 11 I frames are used for random access. In the sequence, each B frame appears after any frame on which it depends.

MPEG matching between frames

MPEG: Compression Ratio 356 x 240 image Type Size Compression I 18KB 7/1 P 6KB 20/1 B 2.5KB 50/1 Average 4.8KB 27/1 30 frames/sec x 4.8KB/frame x 8 bits/byte = 1.2 Mbits/sec + .25 Mbits/sec (stereo audio) HDTV has 15x more pixels = 18 Mbits/sec

MPEG in the “real world” DVDs Adds “encryption” and error correcting codes Direct broadcast satellite HDTV standard Adds error correcting code on top Storage Tech “Media Vault” Stores 25,000 movies Encoding is much more expensive than decoding. Still requires special purpose hardware for high resolution and good compression.

Compression Summary How do we figure out the probabilities Transformations that skew them Guess value and code difference Move to front for temporal locality Run-length Linear transforms (Cosine, Wavelet) Renumber (graph compression) Conditional probabilities Neighboring context In practice one almost always uses a combination of techniques