Mahir Hassan

Transcription

Mahir Hassan
Lecture 6: lossless Compression Algorithms
Mahir Hassan
Multimedia 4th stage
kerabala University- Science College-Computer Science
……………………………………………………………………
Lossless Compression Algorithms
Introduction
Compression: the process of coding that will effectively reduce
the total number of bits needed to represent certain
information.
Broad Classification
Entropy Coding (statistical)
Lossless : independent of data characteristics
e.g. : RLE, Huffman, LZW, Arithmetic coding, Shift Coding (SCode)
1|Page
Lecture 6: lossless Compression Algorithms
Mahir Hassan
Multimedia 4th stage
kerabala University- Science College-Computer Science
……………………………………………………………………
Source Coding
Depends on characteristics of the data
e.g. DCT, DPCM, ADPCM, color model transform
Hybrid Coding (used by most MM systems)
Combine entropy with source encoding
e.g., JPEG, H.263, MPEG-1, MPEG-2, MPEG-4
2|Page
Lecture 6: lossless Compression Algorithms
Mahir Hassan
Multimedia 4th stage
kerabala University- Science College-Computer Science
……………………………………………………………………
Need for Compression
Overview
 Compression refers to a process; coding
 coding refers to a process of representing data such that
it satisfies a particular need
 Information theory studies efficient coding algorithms
 complexity, compression, likelihood of error
3|Page
Lecture 6: lossless Compression Algorithms
Mahir Hassan
Multimedia 4th stage
kerabala University- Science College-Computer Science
……………………………………………………………………
Data Compression
Branch of information theory
 Minimize amount of information to be transmitted
Transform a sequence of characters into a new string of bits
 Same information content length as short as possible
Concepts
Coding (the code) maps source messages from alphabet (A)
into code words (B)
Source message (symbol) is basic unit into which a string is
partitioned
 can be a single letter or a string of letters
Example: aa bbb cccc ddddd eeeeee fffffff gggggggg
A = {a, b, c, d, e, f, g, space}
B = {0, 1}
4|Page
Lecture 6: lossless Compression Algorithms
Mahir Hassan
Multimedia 4th stage
kerabala University- Science College-Computer Science
……………………………………………………………………
Taxonomy of Codes
 Block-block
Source massages and code words of fixed length; e.g., ASCII
 Block-variable
Source message fixed, code words variable; e.g., Huffman
coding
 Variable-block
Source variable, code word fixed; e.g., RLE, LZW, S-Code
 Variable-variable
Source variable, code words variable; e.g., Arithmetic
Example of Block -Block
Coding “aa bbb cccc ddddd eeeeee
fffffffgggggggg”
Requires 120 bits
5|Page
Lecture 6: lossless Compression Algorithms
Mahir Hassan
Multimedia 4th stage
kerabala University- Science College-Computer Science
……………………………………………………………………
Example of Block -Block
Coding “aa bbb cccc ddddd eeeeee
fffffffgggggggg”
Requires 30 bits
Don’t forget the spaces
6|Page
Lecture 6: lossless Compression Algorithms
Mahir Hassan
Multimedia 4th stage
kerabala University- Science College-Computer Science
……………………………………………………………………
Variable-Length Coding - Entropy
What is the minimum number of bits per symbol?
Answer: Shannon’s result – theoretical (lower limit of just 1 bit
per character, mean a compression scheme which is 8 times
more effective than ASCII (Huffman coding)
7|Page
Lecture 6: lossless Compression Algorithms
Mahir Hassan
Multimedia 4th stage
kerabala University- Science College-Computer Science
……………………………………………………………………
1-Variable-Length Coding – Entropy
8|Page
Lecture 6: lossless Compression Algorithms
Mahir Hassan
Multimedia 4th stage
kerabala University- Science College-Computer Science
……………………………………………………………………
Data Compression
Trade-Offs
Run-Length Encoding (RLE)
Run-length Encoding is a very simple example of lossless data
compression.
It is simple techniques to compress digital data.
The objective is to reduce the amount of data needed for
storage/transmission etc...
9|Page
Lecture 6: lossless Compression Algorithms
Mahir Hassan
Multimedia 4th stage
kerabala University- Science College-Computer Science
……………………………………………………………………
Consider these repeated pixels values in an image …
000000000000555500000000
We could represent them more efficiently as
(12, 0)(4, 5)(8, 0)
24 bytes reduced to 6 gives a compression ratio of 24/6 = 4:1
Could we say (0,12)(5,4)(0,8) instead of (12,0)(4,5)(8,0)?
Notice 0 5 0 5 0 5 would actually expand to
(1,0)(1,5)(1,0)(1,5)(1,0)(1,5)
If the values in the original data are exactly the same RLE can
reduce data to just two values, if there are no repeating values
in the data RLE could actually double the amount of number
compared with the original data.
10 | P a g e

Similar documents

Mahir Hassan

Mahir Hassan kerabala University- Science College-Computer Science

More information

Mahir Hassan ..........................................................

Mahir Hassan .......................................................... It is amazing how many display problems are caused by loose cables between the computer and data projector. Make sure all cables are securely

More information