©Brooks/Cole, 2003 Chapter 15 Data Compression. ©Brooks/Cole, 2003 Realize the need for data compression. Differentiate between lossless and lossy compression.

Slides:



Advertisements
Similar presentations
T.Sharon-A.Frank 1 Multimedia Compression Basics.
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.
Data Compression Michael J. Watts
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
CS :: Fall 2003 MPEG-1 Video (Part 1) Ketan Mayer-Patel.
Fundamentals of Multimedia Chapter 7 Lossless Compression Algorithms Ze-Nian Li and Mark S. Drew 건국대학교 인터넷미디어공학부 임 창 훈.
T.Sharon-A.Frank 1 Multimedia Image Compression 2 T.Sharon-A.Frank Coding Techniques – Hybrid.
Lossless Data Compression Using run-length and Huffman Compression pages
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]
CS430 © 2006 Ray S. Babcock Lossy Compression Examples JPEG MPEG JPEG MPEG.
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.
Spring 2015 Mathematics in Management Science Binary Linear Codes Two Examples.
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.
Software Research Image Compression Mohamed N. Ahmed, Ph.D.
Lecture 10 Data Compression.
Chapter 2 Source Coding (part 2)
Compression is the reduction in size of data in order to save space or transmission time. And its used just about everywhere. All the images you get on.
ECE472/572 - Lecture 12 Image Compression – Lossy Compression Techniques 11/10/11.
MULTIMEDIA TECHNOLOGY SMM 3001 DATA COMPRESSION. In this chapter The basic principles for compressing data The basic principles for compressing data Data.
DATA COMPRESSION LOSSY COMPRESSION METHODS What it is… A compression of information that is acceptable in pictures or videos, but not texts or programs.
Data Compression.
Source Coding-Compression
D ATA C OMMUNICATIONS Compression Techniques. D ATA C OMPRESSION Whether data, fax, video, audio, etc., compression can work wonders Compression can be.
Prof. Amr Goneid Department of Computer Science & Engineering
JPEG. The JPEG Standard JPEG is an image compression standard which was accepted as an international standard in  Developed by the Joint Photographic.
JPEG CIS 658 Fall 2005.
Chapter 7 – End-to-End Data Two main topics Presentation formatting Compression We will go over the main issues in presentation formatting, but not much.
MPEG MPEG : Motion Pictures Experts Group MPEG : ISO Committee Widely Used Video Compression Standard.
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.
Addressing Image Compression Techniques on current Internet Technologies By: Eduardo J. Moreira & Onyeka Ezenwoye CIS-6931 Term Paper.
Digital Image Processing Image Compression
Lossless Compression CIS 465 Multimedia. Compression Compression: the process of coding that will effectively reduce the total number of bits needed to.
Chapter 17 Image Compression 17.1 Introduction Redundant and irrelevant information  “Your wife, Helen, will meet you at Logan Airport in Boston.
Huffman Code and Data Decomposition Pranav Shah CS157B.
Spring 2000CS 4611 Multimedia Outline Compression RTP Scheduling.
The task of compression consists of two components, an encoding algorithm that takes a file and generates a “compressed” representation (hopefully with.
JPEG.
STATISTIC & INFORMATION THEORY (CSNB134) MODULE 11 COMPRESSION.
Introduction to JPEG m Akram Ben Ahmed
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.
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.
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.
Submitted To-: Submitted By-: Mrs.Sushma Rani (HOD) Aashish Kr. Goyal (IT-7th) Deepak Soni (IT-8 th )
1 Chapter 3 Text and image compression Compression principles u Source encoders and destination decoders u Lossless and lossy compression u Entropy.
Data Compression Michael J. Watts
Textbook does not really deal with compression.
JPEG Compression What is JPEG? Motivation
IMAGE COMPRESSION.
Data Compression.
Multimedia Outline Compression RTP Scheduling Spring 2000 CS 461.
Digital Image Processing Lecture 21: Lossy Compression May 18, 2005
JPEG.
Data Compression.
Chapter 7.2: Layer 5: Compression
Data Compression CS 147 Minh Nguyen.
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.
Image Coding and Compression
15 Data Compression Foundations of Computer Science ã Cengage Learning.
Chapter 8 – Compression Aims: Outline the objectives of compression.
Fundamentals of Video Compression
15 Data Compression Foundations of Computer Science ã Cengage Learning.
Presentation transcript:

©Brooks/Cole, 2003 Chapter 15 Data Compression

©Brooks/Cole, 2003 Realize the need for data compression. Differentiate between lossless and lossy compression. Understand three lossless compression encoding techniques: run-length, Huffman, and Lempel Ziv. After reading this chapter, the reader should be able to: O BJECTIVES Understand two lossy compression methods: JPEG and MPEG.

©Brooks/Cole, 2003 Figure 15-1 Data compression methods Data compression means sending or storing a smaller number of bits.

©Brooks/Cole, 2003 LOSSLESSCOMPRESSIONMETHODSLOSSLESSCOMPRESSIONMETHODS 15.1

Lossless compression In lossless data compression, the integrity of the data is preserved. The original data and the data after compression and decompression are exactly the same because the compression and decompression algorithms are exactly the inverse of each other. Example: Run-length encoding Run-length encoding Huffman encoding Huffman encoding Lempel Ziv (L Z) encoding (dictionary-based encoding) Lempel Ziv (L Z) encoding (dictionary-based encoding)

©Brooks/Cole, 2003 Figure 15-2 Run-length encoding It does not need knowledge of the frequency of occurrence of symbols and can be very efficient if data are represented as 0s and 1s. For example:

©Brooks/Cole, 2003 Figure 15-3 Run-length encoding for two symbols We can encode one symbol which is more frequent than the other. This example only encode 0’s between 1’s. There is no 0 between 1’s

©Brooks/Cole, 2003 Table 15.1 Frequency of characters Character A B C D E Frequency Huffman coding In Huffman coding, you assign shorter codes to symbols that occur more frequently and longer codes to those that occur less frequently. For example:

©Brooks/Cole, 2003 Figure 15-4 Huffman coding

©Brooks/Cole, 2003 Figure 15-5 Final tree and code

©Brooks/Cole, 2003 Figure 15-6 Huffman encoding

©Brooks/Cole, 2003 Figure 15-7 Huffman decoding

©Brooks/Cole, 2003 Huffman coding The beauty of Huffman coding is that no code in the prefix of another code. There is no ambiguity in encoding. The receiver can decode the received data without ambiguity. Huffman code is called instantaneous ( 即時的 ) code because the decoder can unambiguously decode the bits instantaneously with the minimum number of bits.

©Brooks/Cole, 2003 Lempel Ziv encoding LZ encoding is an example of a category of algorithms called dictionary-based encoding. The idea is to create a dictionary (table) of strings used during the communication session. The compression algorithm extracts the smallest substring that cannot be found in the dictionary from the remaining non- compressed string.

©Brooks/Cole, 2003 Figure 15-8:Part I Example of Lempel Ziv encoding

©Brooks/Cole, 2003 Figure 15-8:Part 2 Example of Lempel Ziv encoding

©Brooks/Cole, 2003 Figure 15-9: Part I Example of Lempel Ziv decoding

©Brooks/Cole, 2003 Figure 15-9: Part II Example of Lempel Ziv decoding

©Brooks/Cole, 2003 LOSSYCOMPRESSIONMETHODSLOSSYCOMPRESSIONMETHODS 15.2

Lossy compression methods Loss of information is acceptable in a picture of video. The reason is that our eyes and ears cannot distinguish subtle changes. Loss of information is not acceptable in a text file or a program file. For examples: Joint photographic experts group (JPEG) Joint photographic experts group (JPEG) Motion picture experts group (MPEG) Motion picture experts group (MPEG)

©Brooks/Cole, 2003 Figure JPEG gray scale example, 640 x 480 pixels Image compression: JPEG

©Brooks/Cole, 2003 Figure JPEG process DTC: discrete cosine transform QuantizationCompression

©Brooks/Cole, 2003 Figure Case 1: uniform gray scale Discrete cosine transform T(0, 0): DC value (direct current value) T(m, n) : AC values (represent changes in the pixel values) T(0, 0)

©Brooks/Cole, 2003 Figure Case 2: two sections Discrete cosine transform

©Brooks/Cole, 2003 Figure Case 3: gradient gray scale Discrete cosine transform

©Brooks/Cole, 2003 DCT discussion The DCT transformation creates table T from table P. The DC value gives the average value of the pixels. The AC values gives the changes. Lack of changes in neighboring pixels creates 0s. The DCT transformation is reversible. Appendix F (Mathematical formula for DCT transformation)

©Brooks/Cole, 2003 Quantization After the T table is created, the values are quantized to reduce the number of bits needed for encoding. Quantization: Divide the number by a constant and then drop the fraction. Divide the number by a constant and then drop the fraction. The quantizing phase is not reversible. The quantizing phase is not reversible. Some information will be lost. Some information will be lost.

©Brooks/Cole, 2003 Compression After quantization, the values are read from the table, and redundant 0s are removed. The reason is that if the picture does not have fine changes, the bottom right corner of the T table is all 0s. Fig

©Brooks/Cole, 2003 Figure Reading the table

©Brooks/Cole, 2003 品質 :100%

©Brooks/Cole, 2003 品質 :50%

©Brooks/Cole, 2003 品質 :10%

©Brooks/Cole, 2003 品質 :5%

©Brooks/Cole, 2003 Video compression--MPEG MPEG method Spatial compression Spatial compression The spatial compression of each frame is done with JPEG. Temporal compression Temporal compression The temporal compression removes the redundant frames. MPEG method first divides frames into three categories: I-frames, P-frames, B- frames.

©Brooks/Cole, 2003 Figure MPEG frames I-frames: (intra-coded frame) It is an independent frame that is not related to any other frame. It is an independent frame that is not related to any other frame. They are present at regular intervals. They are present at regular intervals. I-frames are independent of other frames and cannot be constructed from other frames. I-frames are independent of other frames and cannot be constructed from other frames.

©Brooks/Cole, 2003 Figure MPEG frames P-frames: (predicted frame) It is related to the preceding I-frame or P-frame. It is related to the preceding I-frame or P-frame. Each P-frame contains only the changes from the preceding frame. Each P-frame contains only the changes from the preceding frame. P-frames can be constructed only from previous I- or P-frames. P-frames can be constructed only from previous I- or P-frames. B-frames: (bidirectional frame) It is relative to the preceding and following I-frame or P-frame. It is relative to the preceding and following I-frame or P-frame. Each B-frame is relative to the past and the future. Each B-frame is relative to the past and the future. A B-frame is never related to another B-frame. A B-frame is never related to another B-frame.

©Brooks/Cole, 2003 Figure MPEG frame construction Input sequence MPEG sequence

©Brooks/Cole, 2003 Key terms AC value B-frame Binary tree BranchCompression Data compression DC value Decoding decompression Dictionary-based encoding DCT Huffman coding I-frame JPEG LZ encoding Lossless data compression Lossy data compression MPEGNodeP-frameQuantization Run-length encoding Spatial compression Temporal compression