Run length encoding

praseethasnair123 21,099 views 13 slides Jan 19, 2013
Slide 1
Slide 1 of 13
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13

About This Presentation

No description available for this slideshow.


Slide Content

RUN LENGTH ENCODING Praseetha S Nair M.Tech(CS)

COMPRESSION Data compressed by eliminating redundant elements. Purpose of compression:- -save storage space -reduce communications capacity requirements Some code must be substituted for eliminated element. Based on this code receiver can reconstruct original data.

Categories:- 1.lossless compression -no information lost -decompressed data are identical to original uncompressed data 2.lossy compression -decompressed data may be an approximation to the original uncompressed data

Null Suppression Oldest and simplest Long string of blanks , nulls etc cause redundancy. At transmitter: -scans data for string of blanks. -substitute two character code for any string that is encountered.

Example : the string XYZ bbbbb QRX is replaced by XYZS C 5QRX where S c is a special compression indication character b is symbol for a blank space

At receiver : -scan incoming character for special indication character -reconstruct original data

Run-Length E ncoding Compress any type of repeating data sequence At transmitter: -identify repeating characters to replace -if found, eliminate and replace by three- character code

S c X C c S c -Special character indicating compression follows X-Any repeated data character C c -Character count (a) Compression format Original data string Encoded data string $******55.72 $ c *655.72 --------- S c- 9 Guns bbbbbbbbb Butter GunsS c b9Butter (b)Examples Fig: Run-Length Encoding

Efficiency depends on -number of repeated character occurrences in data to be compressed -average repeated character length. Compression ratio= length of uncompressed data length of compressed data Any compression scheme will have variable performance as the content of the input varies.

It is used as an element in more complex image compression technique. For run-length encoding on an image, transmission of digital line scan is replaced by transmission of a quantity count of each of successive run of black or white scanned picture element.

0000000000 0000000000 000 1111 000 000 1 00 1 000 000 1111 000 000000 1 000 000000 1 000 000 1111 000 0000000000 0000000000 Length:100 bit 23W 4B 6W 1B 2W 1B 6W 4B 9W 1B 9W 1B 6W 4B 23W or: 23 4 6 1 6 4 9 1 916 4 23 Length:15characters=120bit (c)Simple run-length encoding (a)Image Fig: Run-Length Code for a 100-pixel image

Application of run length encoding to a 10X10 image. 10X10 representation is converted to a 100-bit code. Each pixel is represented by a single bit indicate black or white. Run-length code consist of length of alternate black or white sequence. Encoded data stream is a string of number that indicate length of alternate black or white runs.

THANK YOU
Tags