SWE 423: Multimedia Systems Chapter 7: Data Compression (2)

Slides:



Advertisements
Similar presentations
T.Sharon-A.Frank 1 Multimedia Compression Basics.
Advertisements

Noise, Information Theory, and Entropy (cont.) CS414 – Spring 2007 By Karrie Karahalios, Roger Cheng, Brian Bailey.
15-583:Algorithms in the Real World
Sampling and Pulse Code Modulation
Arithmetic Coding. Gabriele Monfardini - Corso di Basi di Dati Multimediali a.a How we can do better than Huffman? - I As we have seen, the.
CELLULAR COMMUNICATIONS 5. Speech Coding. Low Bit-rate Voice Coding  Voice is an analogue signal  Needed to be transformed in a digital form (bits)
Chapter 7 End-to-End Data
School of Computing Science Simon Fraser University
Spring 2003CS 4611 Multimedia Outline Compression RTP Scheduling.
SWE 423: Multimedia Systems Chapter 7: Data Compression (3)
CSc 461/561 CSc 461/561 Multimedia Systems Part B: 1. Lossless Compression.
SWE 423: Multimedia Systems
2015/6/15VLC 2006 PART 1 Introduction on Video Coding StandardsVLC 2006 PART 1 Variable Length Coding  Information entropy  Huffman code vs. arithmetic.
Spatial and Temporal Data Mining
Lecture 7: Spring 2009 Lossless Compression Algorithms
Losslessy Compression of Multimedia Data Hao Jiang Computer Science Department Sept. 25, 2007.
Lecture 4 Source Coding and Compression Dr.-Ing. Khaled Shawky Hassan
Pulse Modulation CHAPTER 4 Part 3
Fundamentals of Multimedia Chapter 7 Lossless Compression Algorithms Ze-Nian Li and Mark S. Drew 건국대학교 인터넷미디어공학부 임 창 훈.
2015/7/12VLC 2008 PART 1 Introduction on Video Coding StandardsVLC 2008 PART 1 Variable Length Coding  Information entropy  Huffman code vs. arithmetic.
Lossless Compression - I Hao Jiang Computer Science Department Sept. 13, 2007.
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]
Lossless Compression in Multimedia Data Representation Hao Jiang Computer Science Department Sept. 20, 2007.
SWE 423: Multimedia Systems Chapter 7: Data Compression (4)
Data Compression Arithmetic coding. Arithmetic Coding: Introduction Allows using “fractional” parts of bits!! Used in PPM, JPEG/MPEG (as option), Bzip.
Basics of Compression Goals: to understand how image/audio/video signals are compressed to save storage and increase transmission efficiency to understand.
Speech coding. What’s the need for speech coding ? Necessary in order to represent human speech in a digital form Applications: mobile/telephone communication,
Huffman Coding Vida Movahedi October Contents A simple example Definitions Huffman Coding Algorithm Image Compression.
Chapter 7. Analog to Digital Conversion
Formatting and Baseband Modulation
Fundamentals of Digital Communication
15-853Page :Algorithms in the Real World Data Compression II Arithmetic Coding – Integer implementation Applications of Probability Coding – Run.
Computer Vision – Compression(2) Hanyang University Jong-Il Park.
CS Spring 2011 CS 414 – Multimedia Systems Design Lecture 7 – Basics of Compression (Part 2) Klara Nahrstedt Spring 2011.
Page 110/6/2015 CSE 40373/60373: Multimedia Systems So far  Audio (scalar values with time), image (2-D data) and video (2-D with time)  Higher fidelity.
CIS679: Multimedia Basics r Multimedia data type r Basic compression techniques.
1 Source Coding and Compression Dr.-Ing. Khaled Shawky Hassan Room: C3-222, ext: 1204, Lecture 5.
Chapter 5. Pulse Modulation
1 PCM & DPCM & DM. 2 Pulse-Code Modulation (PCM) : In PCM each sample of the signal is quantized to one of the amplitude levels, where B is the number.
Lossless Compression CIS 465 Multimedia. Compression Compression: the process of coding that will effectively reduce the total number of bits needed to.
Huffman Code and Data Decomposition Pranav Shah CS157B.
Spring 2000CS 4611 Multimedia Outline Compression RTP Scheduling.
Advances in digital image compression techniques Guojun Lu, Computer Communications, Vol. 16, No. 4, Apr, 1993, pp
Outline Transmitters (Chapters 3 and 4, Source Coding and Modulation) (week 1 and 2) Receivers (Chapter 5) (week 3 and 4) Received Signal Synchronization.
Lecture 4: Lossless Compression(1) Hongli Luo Fall 2011.
CS654: Digital Image Analysis Lecture 34: Different Coding Techniques.
Lossless Compression(2)
1 Source Coding and Compression Dr.-Ing. Khaled Shawky Hassan Room: C3-222, ext: 1204, Lecture 7 (W5)
ELE 488 F06 ELE 488 Fall 2006 Image Processing and Transmission ( ) Image Compression Review of Basics Huffman coding run length coding Quantization.
Image Processing Architecture, © Oleh TretiakPage 1Lecture 4 ECE-C490 Winter 2004 Image Processing Architecture Lecture 4, 1/20/2004 Principles.
Chapter 7 Lossless Compression Algorithms 7.1 Introduction 7.2 Basics of Information Theory 7.3 Run-Length Coding 7.4 Variable-Length Coding (VLC) 7.5.
CS Spring 2012 CS 414 – Multimedia Systems Design Lecture 7 – Basics of Compression (Part 2) Klara Nahrstedt Spring 2012.
Page 1KUT Graduate Course Data Compression Jun-Ki Min.
Fundamentals of Multimedia Chapter 6 Basics of Digital Audio Ze-Nian Li and Mark S. Drew 건국대학교 인터넷미디어공학부 임 창 훈.
Chapter 7 Lossless Compression Algorithms 7.1 Introduction 7.2 Basics of Information Theory 7.3 Run-Length Coding 7.4 Variable-Length Coding (VLC) 7.5.
Entropy vs. Average Code-length Important application of Shannon’s entropy measure is in finding efficient (~ short average length) code words The measure.
Chapter 7 Lossless Compression Algorithms
Digital Audio (2/2) S.P.Vimal CSIS Group BITS-Pilani
JPEG Compression What is JPEG? Motivation
CSI-447: Multimedia Systems
The Johns Hopkins University
Multimedia Outline Compression RTP Scheduling Spring 2000 CS 461.
Principios de Comunicaciones EL4005
JPEG.
Huffman Coding, Arithmetic Coding, and JBIG2
Context-based Data Compression
Scalar Quantization – Mathematical Model
PCM & DPCM & DM.
Speech coding.
Presentation transcript:

SWE 423: Multimedia Systems Chapter 7: Data Compression (2)

Outline Entropy Encoding –Arithmetic Coding Predictive Coding –Lossless Predictive Coding Differential Coding –Lossy Predictive Coding Differential Pulse Code Modulation Coding (DPCM) Delta Modulation (DM)

Entropy Encoding: Arithmetic Coding Initial idea introduced in 1948 by Shannon –Many researchers worked on this idea –Modern arithmetic coding can be attributed to Pasco (1976) and Rissanen and Langdon (1979) Arithmetic coding treats the whole message as one unit –In practice, the input data is usually broken up into chunks to avoid error propagation

Entropy Encoding: Arithmetic Coding A message is represented by a half-open interval [a,b), where a,b . –General idea of encoding Map the message into an open interval [a,b) Find a binary fractional number with minimum length that belongs to the above interval. This will be the encoded message –Initially, [a,b) = [0,1) –When the message becomes longer, the length of the interval shortens and the # of bits needed to represent the interval increases

Entropy Encoding: Arithmetic Coding Coding Algorithm Algorithm ArithmeticCoding // Input: symbol: Input stream of the message terminator: terminator symbol // : Low[] and High[]: all symbols’ ranges // Output: binary fractional code of the message low = 0; high = 1; range = 1; do { get (symbol); high = low + range * High(symbol); low = low + range * Low(symbol); range = high – low; } while (symbol != terminator) return CodeWord(low,high);

Entropy Encoding: Arithmetic Coding Binary code generation Algorithm CodeWord // Input: low and high // Output: binary fractional code code = 0; k = 1; while (value(code) < low) { assign 1 to the kth binary fraction bit; if (value(code) > high) replace the kth bit by 0; k++; }

Entropy Encoding: Arithmetic Coding Example: Assume S = {A,B,C,D,E,F,$}, where $ is the terminator symbol. In addition, assume the following probabilities for each character: –Pr (A) = 0.2 –Pr(B) = 0.1 –Pr(C) = 0.2 –Pr(D) = 0.05 –Pr(E) = 0.3 –Pr(F) = 0.05 –Pr($) = 0.1 Generate the fractional binary code of the message CAEE

Entropy Encoding: Arithmetic Coding It can be proven that  log 2 (1/  P i )  is the upper bound on the number of bits needed to encode a message –In our case, the maximum is equal to 12. –When the length of the message increases, the range decreases and the upper bound value Generally, arithmetic coding outperforms Huffman coding –Treats the whole message as one unit vs. an integral number of bits to code each character in Huffman coding –Redo the previous example CAEE$ using Huffman coding and notice how many bits are required to code this message.

Entropy Encoding: Arithmetic Coding Decoding Algorithm Algorithm ArithmeticDecoding // Input: code: binary code // : Low[] and High[]: all symbols’ ranges // Output: The decoded message value = convert2decimal(code); Do { find a symbol s so that Low(s) <= value < High(s); output s; low = Low(s); high = High(s); range = high – low; value = (value – low) / range; } while s is not the terminator symbol;

Entropy Encoding: Arithmetic Coding Example

Predictive Coding Predictive coding simply means transmitting differences –Predict the next sample as being equal to the current sample More complex prediction schemes can be used –Instead of sending the current sample, send the error involved in the previous assumption

Predictive Coding: Why? The idea of forming differences is to make the histogram of sample values more peaked. –In this case, what happens to the entropy? –As a result, which is better to compress?

Predictive Coding: Why?

Lossless Predictive Coding Formally, define the integer signal as the set of values f n. Then, we predict values f^ n and compute the error e n as follows: –when t = 1, we get... –Usually, t is between 2 and 4 (in this case it is called a linear predictor) –We might need to have a truncating or rounding operation following the prediction computation

Lossless Predictive Coding

Lossless Predictive Coding: Example Consider the following predictor: Show how to code the following sequence

Lossless Predictive Coding Examples in the Image Compression Domain –Differential Coding –Lossless JPEG

Lossy Predictive Coding: DPCM DPCM = Differential Pulse Code Modulation –Form the prediction f ^ n –Form an error e n –Quantize the error

Lossy Predictive Coding: DPCM The distortion is the average squared error –To illustrate the quality of a compression scheme, diagrams of distortion vs. the number of bit levels used are usually shown –Quantization used Uniform Lloyd-Max –Does better than “Uniform”

Lossy Predictive Coding: DPCM

Example Show how to code the following sequence

Lossy Predictive Coding DM (Delta Modulation) is a simplified version of DPCM that is used as a quick analog-to-digital converter. –Note that the prediction simply involves a delay