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

Chapter - 5 Data Compression

Data compression techniques allow for reducing the size of digital files like audio, images, and video. There are two main categories of compression: lossless, where no information is lost, and lossy, where some data is discarded. Common techniques include run-length coding, Huffman coding, and arithmetic coding which take advantage of patterns and redundancy in the data. Standards like JPEG, MPEG, and DVI apply these techniques to compress different media types, such as JPEG using discrete cosine transform and quantization on images and MPEG encoding differences between video frames.

Uploaded by

siddhartha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
127 views

Chapter - 5 Data Compression

Data compression techniques allow for reducing the size of digital files like audio, images, and video. There are two main categories of compression: lossless, where no information is lost, and lossy, where some data is discarded. Common techniques include run-length coding, Huffman coding, and arithmetic coding which take advantage of patterns and redundancy in the data. Standards like JPEG, MPEG, and DVI apply these techniques to compress different media types, such as JPEG using discrete cosine transform and quantization on images and MPEG encoding differences between video frames.

Uploaded by

siddhartha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Chapter – 5

Data compression
5.1. Data Compression and Coding Fundamentals

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 requirements (speech, audio, video)
Data compression implies sending or storing a smaller number of bits.
Although many methods are used for this purpose, in general these
methods can be divided into two broad categories: lossless and lossy
methods.

Coding Fundamentals

The following specifications are based on a typical window size of


640 x 480 pixels on a screen:

 For the representation of text, two bytes are used for each
character.
 For the representation of vector-graphics, a typical still image is
composed of 500 lines. Each line is defined by its horizontal
position, vertical position and an 8-bit attribute field. The
horizontal axis is represented using 10 bits and the vertical axis
is coded using 9 bits.
 In very simple color display modes, a single pixel of a bitmap
can be represented by 256 different colors; therefore, one per
pixel is needed.
How is compression possible?
 Redundancy in digital audio, image, and video data.
 Properties of human perception.
 Digital audio is a series of sample values; image is a rectangular
array of pixel values; video is a sequence of images played out at a
certain rate played out at a certain rate.
 Neighboring sample values are correlated.
Redundancy

 Adjacent audio samples are similar.


 Adjacent audio samples are similar (predictive encoding); samples
corresponding to silence (silence removal)
 In digital image, neighboring samples on a scanning line are
normally similar (spatial redundancy)
 In digital video, in addition to spatial redundancy, neighboring
images in a video sequence may be similar (temporal redundancy)
redundancy)

Human Perception Factors


 Compressed version of digital audio, image, video need not
represent the original information exactly.
 Perception sensitivities are different for different signal patterns.
Human eye is less sensitive to the higher spatial frequency
components than the lower frequencies (transform coding)

5.2. Source, Entropy and Hybrid Coding


Run-length Coding
Entropy Encoding Huffman Coding
Arithmetic Coding
Prediction DPCM
DM
Transformation FFT
Source Encoding DCT
Bit Position
Layered Coding Sub sampling
Sub-band Coding
Vector Quantization
JPEG
Hybrid Encoding MPEG
H.261
DVI RTV, DVI PLV
Entropy

 It is a measure of amount of information and noise present in a


signal/symbol.
 Amount of information (I) in a symbol of occurring probability p :
I = log2(1/p)
 Symbols that occur rarely convey a large amount of information
 Average information per symbol is called entropy (H)
H = pi x log2(1/pi) bits per codeword
 Average number of bits per codeword = Nipi where Ni is the
number of bits for the symbol generated by the encoding
algorithm
Run-length Coding

 Repeated occurrence of the same character is called a run


 Number of repetition is called the length of the run
 Run of any length is represented by three characters

Arithmetic Coding

The arithmetic coding is a more modern coding method than any


others. It can treat the whole message as one unit. In practice, the
input data is usually broken up into chunks to avoid error propagation.

 A message is represented by a half-open interval [a,b) where a


and b are real numbers between 0 and 1.
 Initially the interval is [0,1).
 When the message becomes longer, the length of the interval
shortens, and the number of bits needed to represent the
interval increases.
Source Coding

Source coding takes into account the semantics of the data. The degree
of compression that can be reached by source encoding depends on
the data contents. Different source encoding techniques make
extensive use of the characteristics of the specific medium. An example
is the sound source coding, where sound is transformed from time-
dependent to frequency-dependent sound concatenations. This
transformation reduces the amount of data.

 A content prediction technique can make use of spatial


redundancies within still images.
 Other techniques perform a transformation of the spatial domain
into the 2D frequency domain by using the Discrete Console
Transformation (DCT)
 Low frequencies define the average color and high frequencies
define the sharp edges. Hence low frequencies are much more
important than the high ones, which is a key feature used in DCT
compression.

Steps of data Compression


Uncompressed Picture Picture Quanti- Entropy
Compressed
Picture Preparation Processing zation Encoding Picture
Fig: Major steps of data compression.
1. Preparation includes analog-to-digital conversion and generating an
appropriate digital representation of the information. And image is divided
into blocks of 8x8 pixels, and represented by a fixed number of bits per pixel.

2. Processing is actually the first step of compression process. A transformation


from the time to the frequency domain can be performed using DCT.

3. Quantization processes the results of the previous step. It results in a


reduction of precision. It uses different number of bits per coefficient.

4. Entropy encoding is usually the last step. It compresses a sequential digital


data stream without loss.
5.3. Basic data compression techniques

5.4. Coding Standard JPEG, MPEG and DVI

JPEG (Joint Photographic Experts Group)


JPEG applies to color and gray-scaled still images. Following are some of the
requirements:
 The JPEG implementation should be independent of image size.
 It should be applicable to any image and pixel aspect ratio.
 Color representation itself should be independent of the special
implementation.
 Use of specialized hardware should substantially enhance image quality.
In JPEG, a grayscale picture is divided into blocks of 8 × 8 pixel blocks to decrease the
number of calculations.

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.
MPEG (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.

How MPEG encode the video stream?


In order to achieve higher compression ratio, MPEG uses the fact the image on
consecutive frames differ relative small. It uses a temporal prediction
technique to encode the frame so that the storage requirement is greatly
reduced.
Common MPEG data stream consists of four kinds of frames:

I-frame (Intra-frame)
It is a self contained frame, and it is coded without reference to any other
frames.

P-frame (Predictive-coded frame)


It is coded using the predictive technique with reference to the previous I-
frame and/or previous P-frame.

B-frame (Bi-directionally predictive coded frame)


It requires information of the previous and following I- and P-frames for
encoding and decoding.

D-frame (DC-coded frame)


Only the lowest frequency component of image is encoded. It is used in fast
forward or fast rewind.
DVI (Digital Video Interface)
DVI can process data, text, graphics, still images, video and audio.

Audio and Still image encoding


Audio signals are digitized using 16 bits per sample and either encoded or
compressed using Adaptive Differential Pulse Code Modulation (ADPCM)
technique. Thereby, a reduction to about four bits per sample is achieved at a
quality corresponding to stereo broadcasting.
When encoding still images, different video input formats can be used. These
can be composite, as well as component video signals like RGB. In the case of
an RGB signal, the color of each pixel is split into portions of the three colors of
the spectrum i.e. red, green and blue. Each color is processed separately.

Video encoding
For motion encoding DVI distinguishes two techniques with different
resolutions and dissimilar goals:

 Presentation-Level Video (PLV)


It is characterized by its better quality. This is achieved at the expense of
a very time-consuming asymmetric compression performed by
specialized facilities.

 Real-Time Video (RTV)


It is a symmetric compression technique that works with hardware and
software and can be performed in real-time. In this technique the overall
quality gets reduced.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy