Compression Algorithms

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 16

COMPRESSION ALGORITHMS

OUTLINE
-What is Compresssing?

-What is it for?

-How Does it Work?

-Which Algorithm is More Efficient?


COMPRESSION
AND
ITS STANDARTS

Compression is a process or set of


processes for some data which has a
definite length to decrease its size by
using several methods.
ECMA
Standardizing Information and
Communication Systems

ALDC(Adaptive Lossless Data Compression)

The latest standarts about the compression in


which data loss cen be prevented.
WHAT DOES IT FOR?
As told in the previous page,
compression process is mainly to
decrease the size of a data or media
occupying on the hard drive.
Also it is very convenient for data
transfers on the internet or on transfer
protocols. Since the size of the
compressed data is decreased the time
to transfer it takes a less time than ever.
HOW DOES IT WORK?
The working style depends on the
algorithms applied but in data
compression(not also in the other types
such as media) the common method is
about the contents of the file(the typing in
a text file etc.).
There are two main methods:
-Compression without loss for data files.
-Compression with loss for the images,in
short , media files.
RLE ALGORITHM
RLE(Running Length Encoding) is an old
and the simplest algorithm for
compressing data files.
In this method, the data is stored
according to its repeatability.
RLE ALGORITHM 2
By keeping the repeatability of the data, we
compress them in this method but this
doesn’t work in most of data files according
to their repeatability.

As seen above, sometimes the compressed


form may be larger than the original one.
Huffman Algorithm
• 1. Find the frequencies of all letters in a text
file.

• 2. List them from smaller to bigger.


Huffman Algorithm…
• 3. Join two nodes which have smaller
frequencies.

• 4.Insert the new node


according to sorted
list.
Huffman Algorithm…

• 5.Do the same


operations until
making all the nodes
joined.
Huffman Algorithm…

• 6. After joining all the nodes, give right and


left nodes 1 and 0 codes as you see in the
example.
Huffman Algorithm…
Huffman Algorithm…
• After that we will have a code for all letters existing
1’s and 0’s.

• a:1
• b : 10
• k : 110
• m: 1110
• ğ : 11110
• d : 11111
Huffman Algorithm…
• Let’s find the original bit number before we
give codes to the letters
• = (50+35+20+10+4+8) * 8 (8 bit for all letters)
= 1016 bits
And now,let’s find the new value after using
Huffman Coding,
= 50*1 + 35*2 + 20*3+10*4+4*5+8*5)
= 280 bits
Huffman Algorithm…

• We compressed the text file almost 72% with


the help of Huffman Algorithm.

We can see that Huffman Algorithm is much


more efficient and effective from the others.
Huffman Algorithm is considered to be the
most powerful compression algorithms today.

You might also like