0% found this document useful (0 votes)
182 views

Data Compression Techniques

This document discusses various data compression techniques including lossless compression methods like run-length encoding and Huffman coding as well as lossy compression used for images, video, and audio. It explains how JPEG, MPEG, and MP3 compression work to reduce file sizes by removing redundant data spatially and temporally while preserving adequate quality for the intended use.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
182 views

Data Compression Techniques

This document discusses various data compression techniques including lossless compression methods like run-length encoding and Huffman coding as well as lossy compression used for images, video, and audio. It explains how JPEG, MPEG, and MP3 compression work to reduce file sizes by removing redundant data spatially and temporally while preserving adequate quality for the intended use.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 21

DATA

COMPRESSION
TECHNIQUES
PRESENTED BY- DEBABRATA MOHANTA
Introduction
Data compression is a reduction in the number of bits needed to represent data.

Compression data can save storage ,capacity, speed up file transfer and decrease
costs for storage hardware and network bandwidth.

The aim of compression is reduce the quantity of the file size but to keep the
quality of the original data.
Compression Techniques
There are two categories of compression techniques used with digital graphics.
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, in these methods, the compression and decompression algorithms are
exact inverses of each other: no part of the data is lost in the process.

 Redundant data is removed in compression and added during decompression.


Lossless compression methods are normally used when we cannot afford to lose
any data.
Run-Length Encoding
 Run-length encoding is probably the simplest method of compression. It can be
used to compress data made of any combination of symbols. It does not need to
know the frequency of occurrence of symbols and can be very efficient if data is
represented as 0s and 1s.

 The general idea behind this method is to replace consecutive repeating


occurrences of a symbol by one occurrence of the symbol followed by the number
of occurrences.

 The method can be even more efficient if the data uses only two symbols (for
example 0 and 1) in its bit pattern and one symbol is more frequent than the other.
Huffman Coding
 Huffman coding is a procedure to generate a binary code tree . The algorithm
invented by David Huffman in 1952.
 Use bottom-up approach
 It is effective data compression by reducing the amount of redundancy in the
coding of symbols.
 INPUT: Symbols and corresponding probabilities
 OUTPUT :Prefix-free codes with minimum expected lengths
 For example , we have a text file that uses only five characters (A, B, C, D, E).
Encoding Decoding
Lempel Ziv Encoding

 Lempel Ziv (LZ) encoding is an example of a category of algorithms called


dictionary-based encoding.
 The idea is to create a dictionary (a table) of strings used during the
communication session. If both the sender and the receiver have a copy of the
dictionary, then previously-encountered strings can be substituted by their index in
the dictionary to reduce the amount of information transmitted.
 It is a fixed length coding for variable length symbols.
 It provides very good compression for repetitive sequence.
 Size of the dictionary is limited.
Compression Decompression
Lossy Compression
 Our eyes and ears cannot distinguish subtle changes. In such cases, we can use a
lossy data compression method. These methods are cheaper—they take less time
and space when it comes to sending millions of bits per second for images and
video. Several methods have been developed using lossy compression techniques.
JPEG (Joint Photographic Experts Group) encoding is used to compress pictures
and graphics, MPEG (Moving Picture Experts Group) encoding is used to
compress video, and MP3 (MPEG audio layer 3) for audio compression.
Image Compression-JPEG Encoding
 An image can be represented by a two-dimensional array (table) of picture
elements (pixels).
 A grayscale picture of 307,200 pixels is represented by 2,457,600 bits, and a color
picture is represented by 7,372,800 bits.

 In JPEG, a grayscale picture is divided into blocks of 8 × 8 pixel blocks to


decrease the number of calculations because, as we will see shortly, the number of
mathematical operations for each picture is the square of the number of units.
 The whole idea of JPEG is to change the picture into a linear (vector) set of
numbers that reveals the redundancies. The redundancies (lack of changes) can
then be removed using one of the lossless compression methods we studied
previously.
Discrete Cosine Transform(DCT)

 In this step, each block of 64 pixels goes through a transformation called the discrete
cosine transform (DCT). The transformation changes the 64 values so that the relative
relationships between pixels are kept but the redundancies are revealed. The formula is
given in Appendix G. P(x, y) defines one value in the block, while T(m, n) defines the
value in the transformed block.

Quantization
 After the T table is created, the values are quantized to reduce the number of bits
needed for encoding. Quantization divides the number of bits by a constant and then
drops the fraction. This reduces the required number of bits even more. In most
implementations, a quantizing table (8 by 8) defines how to quantize each value. The
divisor depends on the position of the value in the T table. This is done to optimize the
number of bits and the number of 0s for each particular application.
Compression
 After quantization the values are read from the table, and
redundant 0s are removed. However, to cluster the 0s together,
the process reads the table diagonally in a zigzag fashion
rather than row by row or column by column. The reason is
that if the picture does not have fine changes, the bottom right
corner of the T table is all 0s.

 JPEG usually uses run-length encoding at the compression


phase to compress the bit pattern resulting from the zigzag
linearization.
Video Compression-MPEG Encoding

 The Moving Picture Experts Group (MPEG) method is used to compress video. In
principle, a motion picture is a rapid sequence of a set of frames in which each frame is a
picture. In other words, a frame is a spatial combination of pixels, and a video is a
temporal combination of frames that are sent one after another. Compressing video, then,
means spatially compressing each frame and temporally compressing a set of frames.

Spatial Compression
The spatial compression of each frame is done with JPEG, or a modification of it. Each
frame is a picture that can be independently compressed.
Temporal Compression
 In temporal compression, redundant frames are removed. When we watch television, for
example, we receive 30 frames per second. However, most of the consecutive frames are
almost the same. For example, in a static scene in which someone is talking, most
frames are the same except for the segment around the speaker’s lips, which changes
from one frame to the next.
Audio Compression
 Audio compression can be used for speech or music. For speech we need to compress a
64 kHz digitized signal, while for music we need to compress a 1.411 MHz signal.
Two categories of techniques are used for audio compression: predictive encoding and
perceptual encoding.

Predictive Encoding
 In predictive encoding, the differences between samples are encoded instead of
encoding all the sampled values. This type of compression is normally used for speech.
Several standards have been defined such as GSM (13 kbps), G.729 (8 kbps), and
G.723.3 (6.4 or 5.3 kbps). Detailed discussions of these techniques are beyond the
scope of this book.

Perceptual Encoding
 The most common compression technique used to create CD-quality audio is based on
the perceptual encoding technique. This type of audio needs at least 1.411 Mbps, which
cannot be sent over the Internet without compression. MP3 (MPEG audio layer 3) uses
this technique.
Conclusion

 LZW has given new dimension for the development of new compression
techniques.

 It has been implemented in well known compression format like Acrobat PDF and
many other types of compression packages .

 In combination with other compression techniques many other different


compression techniques are developed like LZMS

You might also like