Chapter 8 – Compression Aims: Outline the objectives of 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.
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
T.Sharon-A.Frank 1 Multimedia Image Compression 2 T.Sharon-A.Frank Coding Techniques – Hybrid.
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.
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.
{ Lossy Compression William Dayton Nick Trojanowski.
Media File Formats Jon Ivins, DMU. Text Files n Two types n 1. Plain text (unformatted) u ASCII Character set is most common u 7 bits are used u This.
Lecture 10 Data Compression.
Chapter 2 Source Coding (part 2)
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.
MULTIMEDIA TECHNOLOGY SMM 3001 DATA COMPRESSION. In this chapter The basic principles for compressing data The basic principles for compressing data Data.
: Chapter 12: Image Compression 1 Montri Karnjanadecha ac.th/~montri Image Processing.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 14 Introduction to Computer Graphics.
Multimedia Specification Design and Production 2012 / Semester 1 / L3 Lecturer: Dr. Nikos Gazepidis
Image Processing and Computer Vision: 91. Image and Video Coding Compressing data to a smaller volume without losing (too much) information.
Data Compression. Compression? Compression refers to the ways in which the amount of data needed to store an image or other file can be reduced. This.
Still-image compression Moving-image compression and File types.
CIS679: Multimedia Basics r Multimedia data type r Basic compression techniques.
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.
22-Oct-15CPSC558: Advanced Computer Networks Chapter 7 End-to-End Data –Data Manipulating Functions (Affecting Throughputs) How to encode the message into.
CS 111 – Sept. 10 Quiz Data compression –text –images –sounds Commitment: –Please read rest of chapter 1. –Department picnic next Wednesday.
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.
1 Image Formats. 2 Color representation An image = a collection of picture elements (pixels) Each pixel has a “color” Different types of pixels Binary.
Compression video overview 演講者:林崇元. Outline Introduction Fundamentals of video compression Picture type Signal quality measure Video encoder and decoder.
Chapter 17 Image Compression 17.1 Introduction Redundant and irrelevant information  “Your wife, Helen, will meet you at Logan Airport in Boston.
Spring 2000CS 4611 Multimedia Outline Compression RTP Scheduling.
Multimedia Basics (1) Hongli Luo CEIT, IPFW. Topics r Image data type r Color Model : m RGB, CMY, CMYK, YUV, YIQ, YCbCr r Analog Video – NTSC, PAL r Digital.
Data compression. lossless – looking for unicolor areas or repeating patterns –Run length encoding –Dictionary compressions Lossy – reduction of colors.
STATISTIC & INFORMATION THEORY (CSNB134) MODULE 11 COMPRESSION.
Image File Formats By Dr. Rajeev Srivastava 1. Image File Formats Header and Image data. A typical image file format contains two fields namely Dr. Rajeev.
Introduction to JPEG m Akram Ben Ahmed
Multi-media Data compression
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.
Submitted To-: Submitted By-: Mrs.Sushma Rani (HOD) Aashish Kr. Goyal (IT-7th) Deepak Soni (IT-8 th )
Data Compression: Huffman Coding in Weiss (p.389)
Data Compression Michael J. Watts
JPEG Compression What is JPEG? Motivation
Compression & Huffman Codes
IMAGE COMPRESSION.
Computer Science Higher
Data Compression.
Multimedia Outline Compression RTP Scheduling Spring 2000 CS 461.
Algorithms in the Real World
Introduction to Computer Science - Lecture 4
Data Compression.
Chapter 7.2: Layer 5: Compression
Data Compression CS 147 Minh Nguyen.
Software Equipment Survey
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.
الوحدة الرابعة ضغط البيانات
Representing Images 2.6 – Data Representation.
Web Design and Development
UNIT IV.
Judith Molka-Danielsen, Oct. 02, 2000
Image Coding and Compression
15 Data Compression Foundations of Computer Science ã Cengage Learning.
Quantizing Compression
15 Data Compression Foundations of Computer Science ã Cengage Learning.
Quantizing Compression
Presentation transcript:

Chapter 8 – Compression Aims: Outline the objectives of compression. Define the key methods used to compress data. Outline methods used to compress images, video and audio.

Key factors in reducing the amount of data storage Getting rid of redundant data. This involves determining the parts of the data that are not required Identifying irrelevant data. This involves identifying the parts of the data which are perceived to be irrelevant. Converting the data into a different format. This will typically involve changing the way that the data is processed and stored Reducing the quality of the data. Often the user does not require the specified quality of the data.

RGB #FF0000 (255,0,0) #00FF00 (0,255,0) #0000FF (0,0,255) #FFFFFF (255,255,255) #000000 (0,0,0) #6496C8 (100,150,200) #C89664 (200,150,100) #64C896 (100,200,150)

Changes between images

Audio, image and video compression JPEG/GIF. The JPEG (Joint Photographic Expert Group) compression technique is well matched to what the human eye and the brain perceive. MPEG. MPEG (Motion Picture Experts Group) uses many techniques to reduce the size of the motion video data. MPEG (MP-3). The digital storage of audio allows for the data to be compressed.

Compression process

Sampling

Quantization

Error and number of conversion bits Bits (N) Quantization levels Accuracy (%) 1 2 25 8 256 0.2 4 12.5 12 4096 0.012 3 6.25 14 16384 0.003 16 3.125 65536 0.00076

Lossy and lossless compression Lossless compression. Where the data, once uncompressed, will be identical to the original uncompressed data. This will obviously be the case with computer-type data, such as data files, computer programs, and so on, as any loss of data may cause the file to be corrupted. Lossy compression. Where the data, once uncompressed, cannot be fully recovered. It normally involves analysing the data and determining which data has little effect on the perceived information.

Entropy and source coding Entropy coding. This does not take into account any of the characteristics of the data and treats all the bits in the same way. As it does not know which parts of the data can be lost, it produces lossless coding. Typical coding techniques are: Statistical encoding. Analysing the occurrence and patterns of data. Suppressing repetitive sequences. Source encoding. This normally takes into account characteristics of the information.

Entropy coding Normally, general data compression does not take into account the type of data which is being compressed and is lossless. As it is lossless it can be applied to computer data files, documents, images, and so on. The two main techniques are statistical coding and repetitive sequence suppression. Huffman. Huffman coding uses a variable length code for each of the elements within the data. This normally involves analysing the data to determine the probability of its elements. The most probable elements are coded with a few bits and the least probable coded with a greater number of bits. This could be done on a character-by-character basis, in a text file, or could be achieved on a byte-by-byte basis for other files. Lempel-Ziv. Around 1977, Abraham Lempel and Jacob Ziv developed the Lempel–Ziv class of adaptive dictionary data compression techniques (also known as LZ-77 coding), which are now some of the most popular compression techniques.

‘e’ ‘i’ ‘o’ ‘p’ ‘b’ ‘c’ 57 51 33 20 12 3 ‘e’ 11 ‘i’ 10 ‘o’ 00 ‘p’ 011 Huffman Letter: ‘b’ ‘c’ ‘e’ ‘i’ ‘o’ ‘p’ No. of occurrences: 12 3 57 51 33 20 ‘e’ ‘i’ ‘o’ ‘p’ ‘b’ ‘c’ 57 51 33 20 12 3 ‘e’ 11 ‘i’ 10 ‘o’ 00 ‘p’ 011 ‘b’ 0101 ‘c’ 0100

Huffman example (goals scored)

‘e’ ‘o’ ‘p’ ‘c’ ‘i’ ‘p’ ‘c’ Huffman (cont.) 11000110100100110100 will be decoded as: ‘e’ ‘o’ ‘p’ ‘c’ ‘i’ ‘p’ ‘c’ ‘e’ 11 ‘i’ 10 ‘o’ 00 ‘p’ 011 ‘b’ 0101 ‘c’ 0100

‘The receiver#9#3quires a#20#5pt for it. Lempel-Ziv ‘The receiver#9#3quires a#20#5pt for it. This is automatically sent wh#6#2 it #30#2#47#5ved.’

LZW The Lempel–Ziv–Welsh (LZW) algorithm (also known LZ-78) builds a dictionary of frequently used groups of characters (or 8-bit binary values A simple example is to use a six-character alphabet and a 16-entry dictionary, thus the resulting code word will have 4 bits. If the transmitted message is: ababacdcdaaaaaaef Then the transmitter and receiver would initially add the following to its dictionary: 0000 ‘a’ 0001 ‘b’ 0010 ‘c’ 0011 ‘d’ 0100 ‘e’ 0101 ‘f’ 0110–1111 empty

LZW (cont.) 0000 ‘a’ 0001 ‘b’ 0010 ‘c’ 0011 ‘d’ 0100 ‘e’ 0101 ‘f’ 0110–1111 empty 0110 ‘ab’ 0111–1111 empty

Morse coding Pure coding (example) Statistical coding Statistical encoding is an entropy technique which identifies certain sequences within the data. These ‘patterns’ are then coded so that they have fewer bits. Frequently used patterns are coded with fewer bits than less common patterns. For example, text files normally contain many more ‘e’ characters than ‘z’ characters. Thus the ‘e’ character could be encoded with a few bits and the ‘z’ with many bits a 00000 b 00001 c 00010 d 00011 e 00100 f 00101 g 00110 h 00111 i 01000 j 01001 k 01010 l 01011 m 01100 n 01101 o 01110 p 01111 q 10000 r 10001 s 10010 t 10011 u 10100 v 10101 w 10110 x 10111 y 11000 z 11001 SP 11010 Morse coding a 01 b 1000 c 1010 d 100 e f 0010 g 110 h 0000 i 00 j 0111 k 101 l 0100 m 11 n 10 o 111 p 0110 q 1101 r 010 s 000 t 1 u 001 v 0001 w 011 x 1001 y 1011 z 1100 SP 0011 Pure coding (example)

Repetitive character sequence suppression Repetitive sequence suppression involves representing long runs of a certain bit sequence with a special character. A special bit sequence is then used to represent that character, followed by the number of times it appears in sequence. 8.3200000000000 could be coded as: 8.32F11 where F is a special flag.

Source compression Source compression takes into account the type of information that is being compressed, and is typically used with image, video and audio information. For example the following might be integer values for the samples: 321, 322, 324, 324, 320, 317, 310, 311 This could be coded as difference values as: 321, +1, +2, 0, –4, –3, –7, +1

Image compression File Compression type Max. resolution or colours TIFF Huffman RLE and/or LZW 48-bit colour TIFF (tagged image file format) is typically used to transfer graphics from one computer system to another. It allows high resolutions and colours of up to 48 bits (16 bits for red, green and blue). GIF LZW 65,563 65,536 (24-bit colour, but only 256 displayable colours) Standardized graphics file format which can be read by most graphics packages. It has similar graphics characteristics to PCX files and allows multiple images in a single file and interlaced graphics. JPG JPEG compression (DCT, quantization and Huffman) Depends on the compression Excellent compression technique which produces lossy compression. It normally results in much greater compression than the methods outlined above.

Image with a good deal of repetition Image with a good deal of changes Image compression Image with a good deal of repetition Image with a good deal of changes Type Size(B) Compression (%) BMP 308278 100.0 BMP, RBG encoded (640480, 256 colours) 301584 97.8 BMP, RLE encoded GIF 124304 40.3 GIF, Version 89a, non-interlaced 127849 41.5 GIF, Version 89a, interlaced TIF 136276 44.2 TIF, LZW compressed 81106 26.3 TIF, CCITT Group 3, MONOCHROME JPG 28271 9.2 JPEG – JFIF Complaint (Standard coding) 26511 8.6 JPEG – JFIF Complaint (Progressive coding) Type Size (B) Compression (%) BMP 750054 100.0 BMP, RBG encoded (500500, 16.7M colours) 7832 1.0 BMP, RLE encoded (256 colours) PCX 31983 4.3 PCX, Version 5 (256 colours) GIF 4585 0.6 GIF, Version 89a, non-interlaced (256 colours) TIF 26072 3.5 TIF, LZW compressed (16.7M colours) JPG 15800 2.1 JPEG (Standard coding, 16.7M colours) 12600 1.7 JPEG (Progressive coding, 16.7M colours)

JPEG It is a compression technique for grey-scale or colour images and uses a combination of discrete cosine transform, quantization, run-length and Huffman coding. The components are computed from the RGB components: Y = 0.299R+0.587G+0.114B Cb = 0.1687R–0.3313G+0.5B Cr = 0.5R–0.4187G+0.0813B

MPEG

Segmentation

I, P and B-frames Intra frame (I-frame). An intra frame, or I-frame, is a complete image and does not require any extra information to be added to it to make it complete. As it is a complete frame, it cannot contain any motion estimation processing. It is typically used as a starting point for other referenced frames, and is usually the first frame to be sent. Predictive frame (P-frame). The predictive frame, or P-frame, uses the preceding I-frame as its reference and has motion estimation processing. Each macroblock in this frame is supplied as referenced to an I-frame as either a vector and difference, or if no match was found, as a completely encoded macroblock (called an intracoded macroblock). The decoder must thus retain all I-frame information to allow the P-frame to be decoded. Bidirectional frame (B-frame). The bidirectional frame, or B-frame, is similar to the P-frame except that it references frames to the nearest preceding or future I- or P-frame. When compressing the data, the motion estimation works on the future frame first, followed by the past frame. If this does not give a good match, an average of the two frames is used. If all else fails, the macroblock can be intracoded.

Audio compression Digitized audio signal rate = 44.116 kbps = 705.6kbps

Psycho-acoustic model