0% found this document useful (0 votes)
11 views35 pages

Final Report2

The seminar report by Azuh Chukwuebuka Wisdom focuses on image and video compression technology, highlighting the need for effective compression algorithms due to the rapid growth of digital technology. It discusses various compression techniques, including lossy and lossless methods, and their applications in reducing data size for efficient storage and transmission. The report aims to create an algorithm to compress images and videos without quality loss, emphasizing the significance of compression in optimizing bandwidth and storage costs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views35 pages

Final Report2

The seminar report by Azuh Chukwuebuka Wisdom focuses on image and video compression technology, highlighting the need for effective compression algorithms due to the rapid growth of digital technology. It discusses various compression techniques, including lossy and lossless methods, and their applications in reducing data size for efficient storage and transmission. The report aims to create an algorithm to compress images and videos without quality loss, emphasizing the significance of compression in optimizing bandwidth and storage costs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 35

RESEARCH ON IMAGE AND VIDEO COMPRESSION TECHNOLOGY

A SEMINAR REPORT BY

BY

AZUH CHUKWUEBUKA WISDOM

20161955573

COMMUNICATION OPTION

SUBMITTED TO

DEPARTMENT OF ELECTRICAL AND ELECTRONIC ENGINEERING

SCHOOL OF ENGINEERING AND ENGINEERING TECHNOLOGY


FEDERAL UNIVERSITY OF TECHNOLOGY, OWERRI (FUTO)

IN PARTIAL FULFILMENT OF THE REQUIREMENTS FOR THE AWARD OF


BACHELORS OF ENGINEERING DEGREE (B.Eng.)

IN ELECTRICAL AND ELECTRONICS ENGINEERING

OCTOBER, 2021
CERTIFICATION
This is to certify that this work, “RESEARCH ON IMAGE AND VIDEO
COMPRESSION TECHNOLOGY” was an authentic work carried out by AZUH
CHUKWUEBUKA WISDOM, in partial fulfillment of the requirements for the award of
the Bachelor of Engineering(B.Eng.) degree in Electrical and Electronics Engineering,
Federal University of Technology Owerri(FUTO)

Approved By

……………………. ..……..…..
Engr. Dr. L.S Ezema Date
Project Supervisor

………………………………………….. …………..
Engr. Dr. Nkwachukwu. Chukwuchekwa Date
(Head of Department)
…………………………… …………...
External Examiner Date
DEDICATION

I dedicate this report to the almighty to the almighty God, my mother and miss chidera
for their benevolent support and all Electrical and Engineering students
ACKNOWLEDGMENT

I would like to express my immense gratitude to my project supervisor, project


supervisor, Engr. Dr L.S Ezema for his constant support and motivation that has
encouraged us to come up with this project work.
I am very grateful to my HOD Engr. Dr. N. Chukwuchekwa for his strong
competence in carrying the department to greater heights and also to all my able
professors in my department; Engr. Prof. (Mrs.) G. A. Chukwudebe , Engr. Prof. E.
N. C. Okafor, Engr. Prof. M. C. Ndinechi, Engr. Prof. (Mrs.) G. N. Ezeh, Engr.
Prof. F. K. Opara, and Engr. Prof. (Mrs.) I. E. Achumba for being a backbone to
this department and also the following lecturers Engr. Dr. C. C. Mbaocha, Engr. Dr.
L. O. Uzoechi, Engr. Dr. O. Onojo, Engr. Dr. S. O. Okozi, Engr. Dr. M. Olubiwe,
Engr. Dr. I. O. Akwukwaegbu, and Engr. Dr. C. K. Agubor for their continuous
knowledge they impact in the department and also Engr. E. Ekwueme, Engr. C.
Anyalewechi, Engr. P. Nwammuo, Engr. R. C. Okpara, Engr. E. Ezugwu, and Engr.
C. K. Uzoegbu for their constant support in our knowledge. I want to also
appreciate our able Course Adviser, Engr. Dr. L. S. Ezema for his part he played as
a school father and his advice that has helped our stay in this institution.
Finally, special thanks go to my beloved parents, family, benefactors, course mates and
friends for the relentless support given to reach our goal.
ABSTRACT

The rapid growth of digital technology has paved the way for many image processing
applications and motivated the need for better compression algorithms. Image
compression is the technique where the size of an image is minimized by keeping the
quality of the image to an acceptable level. The main objective of image and video
compression is to decrease the redundancy of the image and video thereby increasing the
capacity of storage and efficient transmission. There are different ways by which images
and video can be compressed. The purpose of this research is to present information
about Image and video Compression Technique. With a basic concept of image and video
compression, an overview of various compression algorithms is presented here.
TABLE OF CONTENTS
Certification i
Dedication ii
Acknowledgement iii
Abstract ix
Tables of contents x
CHAPTER ONE: INTRODUCTION 1
1.1 Background of study
1.2 Statement of the problems

1.3 Aims/Objectives

1.4 Significance of work

1.5 Scope of the study

CHAPTER TWO: LITERTURE REVIEW

CHAPTER THREE: METHODLOGY

CHAPTER FOUR: RESULTS AND CONCLUSION

REFERENCES
CHAPTER ONE

INTRODUCTION

1.1 BACKGROUND OF THE STUDY

Compression is a tool to convert data to a different form by removing the existing


redundancies. It makes the data human readable and reduce the size also. Compression of
the signal enables or makes faster transmission and less memory space is used. Also the
digital data protection against transmission errors ensures data reliability.

The soaring number of images and videos requires efficient compression.


Therefore, the compression techniques are deployed in many appliances and applications
Including cameras, digital cinema, cable and satellite digital video transmissions
for entertainment, low-latency video telephone, storage-constrained surveillance
applications, machine vision and recognition, small-form and power-constrained mobile
handsets, and other handheld devices. For these applications, lossy video compression
already satisfies the human perceptual requirement. Whereas, for the especially
precious data, such as high quality studio products, fine arts and antique documents,
medical and satellite data, lossless archiving is needed to preserve every pixel exactly

1.1.1 Image Compression Model


Image compression aims at reducing the irrelevant and redundant part of the image data
in order to store or transmit data in an efficient form. This is achieved through the method
of minimizing the number of bits required to represent each pixel in an image. This
reduces the memory space required to store images and facilitates transmitting image in
less time . The basic flow image compression is illustrated in Fig 1. The image is given to
the encoder which transforms the image into bit streams. When the decoder gets these
encoded bit streams it decodes it and the resultant image is obtained from the output of
the decoder. Image compression occurs when the overall data quantity of the input image
is greater than that of the received bit stream.

INPUT ENCODER 1001011100 DECODER

Bit stream

RESULTANT
IMAGE

Fig 1.1 Image Compression Model

As discussed above, compression is performed by removing the redundant information in


images, there are three sources of redundancy

 Coding Redundancy

 Inter-pixel Redundancy

 Psycho-visual Redundancy

(i) Coding Redundancy: Usually the uncompressed image is coded with each pixel by a
fixed length code word. For example, an image with 256 gray values is represented by an
array of 8-bit integers. By making use of some variable length code schemes such as
Huffman coding and arithmetic coding, compression can be achieved, i.e. by assigning
less number of bits for more frequent gray levels and more number of bits for less
frequent gray levels, then the entire image can be represented by least possible number of
bits. In this way we can reduce the coding redundancy.

(ii) Inter-pixel Redundancy: It is a redundancy related to statistical dependencies among


pixels, especially between neighboring pixels. Information is unnecessarily replicates in
the correlated pixels.
(iii) Psycho-visual Redundancy: It is a redundancy corresponding to different sensitivities
of human eyes to all image signals. Therefore, eliminating some less sensitive
information from the image based on our visual processing may be acceptable.

Types of image compression

Image compression techniques are broadly classified into two categories: Lossy and
lossless image compression

a) Lossless image compression: In lossless compression the original data is perfectly


reconstructed from the compressed data. It make use of all the information in the
original image while compression, so when the image is decompressed, it will be
exactly identical to the original image. Images in which geometric shapes are
relatively simple can be considered for lossless image compression.
Various techniques include:
 Huffman Encoding
 Run Length Encoding
 Arithmetic Coding
 Entropy Encoding
 Lempel–Ziv–Welch Coding
b) Lossy Compression Techniques In lossy compression the reconstruction of an image
is only an approximation of the original data. This suffers from loss of some data. It is
most commonly used to compress multimedia data. An advantage of this technique is
that it allows for higher compression ratio than the lossless technique. Different
methods include:
 Predictive coding
 Transform coding
1.1.2 VIDEO MODEL COMPRESSION

Video compression is the process of reducing the total number of bits needed to represent
a given image or video sequence. Video compression is most commonly performed by a
program with a specific algorithm or formula for determining the best way to shrink the
size of the data. Video compression algorithms such as H.264/AVC
or H.265/HEVC reduce the raw content data by as much as 1,000 times.

Also is the process of encoding a video file in such a way that it consumes less space than
the original file and is easier to transmit over the network/Internet.

It is a type of compression technique that reduces the size of video file formats by
eliminating redundant and non-functional data from the original video file. Video
compression is performed through a video codec that works on one or more compression
algorithms. Usually video compression is done by removing repetitive images, sounds
and/or scenes from a video. For example, a video may have the same background, image
or sound played several times or the data displayed/attached with video file is not that
important. Video compression will remove all such data to reduce the video file size.

Once a video is compressed, its original format is changed into a different format
(depending on the codec used). The video player must support that video format or be
integrated with the compressing codec to play the video file.
COMPRESSION OF VIDEO COMPRESSION METHODS

H.264/AVC:

In early1998, the Video Coding Experts Group (VCBO)ITU-T issued a call for proposals
on a projectcalledH261,with a target of doubling the coding efficiency in comparison to
any other existing video coding standards for various applications. The Moving Picture
Expert Group (MPEG and the Video Coding Expert Group(VCBG) have developed a
new and outstanding standard that promises to out perform the earlier MPEG-4 an
dH.263 standard. Even though the fast draft design for the new standard was adopted in
October1999,it provides the most current balance between the coding efficiency ,cost
and implementation complexity. It has been finalized by the Joint Video Team (JVT) as
the draft of the new coding standard for formal approval submission referred to as
H.264/AVC and was approved by ITU-T in March2003, The standard is further designed
to give lower latency as well as better quality for higher latency. In addition, all these
improvements compared to previous standards were to come without increasing the
complexity of design so much that would be impractical or expensive to build
applications and systems.

H.261 H.261

] is a practical ITU-T video compression standard, which is developed for transmitting


over integrated services digital network lines of data rates 64 Kbits/s. This operates at
video bit rates between 40 Kbits/s and 2 Mbits/s. It supports the color space YCb Cr with
4:2:0 chrominance sub sampling. This coding standard is upgraded to video conference
and video telephony applications. In this standard, hybrid motion compensation is used
for inter-picture prediction. The video is the first spatial transform coded, on which scalar
quantization is applied. These quantized coefficients are zigzag scanned and then entropy
coding is performed.
H.263:

The video compression standard designed for a low bit-rate compression for videoconferencing
is H.263 [8]. Compensation through variable block size and overlapped block motion
compensations are the main features of H.263. This achieves better video at 18-24Kbps. H.263
supports the picture sizes 128×96 (Sub-QCIF), 176×144 (QCIF), 352×288 (CIF), 704×576
(4CIF), and 1408×1152 (16CIF)

Inter-picture prediction: It removes temporal redundancy transform coding, removes


spatial redundancy motion compensation and uses motion vectors to compensate.

A macro block, the basic unit of temporal coding, is used to represent a16x16 pixel
region. Each macro block is encoded using intra(I-coding) or predictive) P-coding.

Motion prediction uses only the previous picture to minimize delay.


1.2 PROBLEM STATEMENT

In the present era of Internet multimedia data especially Images and Videos are the most
widely used digital format for data transmission. However due to their large data sizes
and constraint of low bandwidth capacity of communication channel it is very difficult to
transmit them at optimum speed maintaining the signal quality. Compression therefore, is
a vital tool that not only reduces the data size thereby leading to faster data transmission
but also protects it to some extent from transmission errors.
1.3 AIMS / OBJECTIVES

AIMS: The aim of this project is to create an algorithm to reduce the size of an Image and
video file without losing quality.
OBJECTIVES

 To compress images and videos of all format without affecting its quality
 To get the exact same replica after decompressing the file.
 To reduce the redundancy of the file
 To reduce storage space occupied by files..
1.4 SIGNIFICANCE OF STUDY

Compressed files require significantly less storage capacity than uncompressed files,
meaning a significant decrease in expenses for storage. A compressed file also requires
less time for transfer while consuming less network bandwidth. This can also help with
costs, and also increases productivity.
1.5 SCOPE OF STUDY

A detailed literature research has been done to study the various techniques in both image
and video compression and enhancement. The performance metrics are considered by
understanding the literature research from various papers. Both the lossy and lossless
methods are used in image compression.

In this research work, we are focusing on the lossless compression technique and the
algorithm will be prepared for both image and video file.
The lossy compression technique won’t be handled in this research work.
CHAPTER TWO

LITERTURE REVIEW

2.1 HISTORICAL REVIEW OF DATA COMPRESSION

Data compression has been dated back to the early 1880’s, starting with
MORSE CODE which was invented in 1838 for the use of telegraphy. It was based on
using shorter codes to represent letters like E and T which are very common in the
English language.
Later in 1949 when mainframe computers started taking hold, ROBERT
FANO and CLAUDE SHANNON invented SHANNON-FANO CODING. Their
algorithm assigned codes to symbols in a given block of data based on the probability of
the symbol occurring. It works with the believe that the probability of occurrence of a
symbol is inversely proportional to the length of the code[1]
In 1951, DAVID HUFFMAN who was studying information theory under
Robert fano at MIT developed HUFFMAN CODING in the term paper that he wrote on
finding the most efficient method of binary coding. He was able to figure out a similar
and yet more efficient technique to SHANNON-FANO CODING.
The difference between the two is that in Shannon-fano coding, the probability tree
is built bottom-up creating a suboptimal result while in the Huffman coding, the
probability tree is built top-down[2]
The early implementation of Shannon-fano coding and Huffman coding was done
through the use of hardware and hardcoded codes. But in 1970s, with the presence of the
internet and online storages which lead to software compression that
Huffman codes were generated on the input data.[1]
In 1997, ABRAHAM LEMPEL and JACOB ZIV published the LZ77 algorithm which
was the first algorithm to use a dynamic dictionary oftentimes called a sliding window to
compress data[3]. Also in 1978, they also published LZ78 algorithm which also uses a
dictionary.
Unlike LZ77, the LZ78 parses the input data and generates a static dictionary rather than
generating it dynamically[4]
ARITHMETIC CODING was developed in 1979 at IBM which was investigating data
compression techniques for their mainframes. This is considered the most optimal
entropy coding technique and it achieves better results than the
Huffman coding but however it is more complicated when compared to other
techniques.
Rather than splitting the probabilities of symbols into tress, arithmetic coding transforms
the input data into single rational number between 0 and 1 by changing the base and
assigning a single value to each unique symbol from 0 up to the base.
Then it is further transformed into a fixed point binary number which is encoded result.
The value can be decoded into the original output by changing the base back to the
original and replacing the values with the symbols they correspond to
1. Calculate the number of unique symbols in the input. This number represents the base
b (e.g. base 2 is binary) of the arithmetic code.
2. Assign values from 0 to b to each unique symbol in the order they appear.
3. Using the values from step 2, replace the symbols in the input with their codes
4. Convert the result from step 3 from base b to a sufficiently long fixed-point binary
number to preserve precision.
5. Record the length of the input string somewhere in the result as it is needed for
decoding.[17]
Here is an example of an encode operation, given the input “ABCDAABD”:
1. Found 4 unique symbols in input, therefore base = 4. Length = 8
2. Assigned values to symbols: A=0, B=1, C=2, D=3
3. Replaced input with codes: “0.012300134” where the leading 0 is not a symbol.
4. Convert “0.012311234” from base 4 to base 2: “0.011011000001112”
5. Result found. Note in result that input length is 8.
Assuming 8-bit characters, the input is 64 bits long, while its arithmetic coding is just 15
bits long resulting in an excellent compression ratio of 24%. This example demonstrates
how arithmetic coding compresses well when given a limited character set.
1. Calculate the number of unique symbols in the input. This number represents the base
b (e.g. base 2 is binary) of the arithmetic code.
2. Assign values from 0 to b to each unique symbol in the order they appear.
3. Using the values from step 2, replace the symbols in the input with their codes
4. Convert the result from step 3 from base b to a sufficiently long
fixed-point binary number to preserve precision.
5. Record the length of the input string somewhere in the result as it is needed for
decoding.[17]
Here is an example of an encode operation, given the input “ABCDAABD”:
1. Found 4 unique symbols in input, therefore base = 4. Length = 8
2. Assigned values to symbols: A=0, B=1, C=2,
3. Replaced input with codes: “0.012300134” where the leading 0 is not a
symbol.
4. Convert “0.012311234” from base 4 to base 2: “0.011011000001112”
5. Result found. Note in result that input length is 8.
Assuming 8-bit characters, the input is 64 bits long, while its arithmetic coding is just 15
bits long resulting in an excellent compression ratio of 24%. This example demonstrates
how arithmetic coding compresses well when given a limited character set.

Run Length Encoding (RLE)


Run Length Encoding is a lossless compression technique that can be applied to bit
mapped graphic files, but the concept actually applies to any form of compression where
data is repeated in sequence.
The image shown below is compressed using run length encoding. There are 144 pixels
in this image, with a bit depth of 8 bits per pixel. Without compression, it would be
necessary to store the binary color code for all 144 pixels. The uncompressed size would
be 144 x 8 = 1,152 bits or 144 bytes.
When run length encoding is used, it is only necessary to store the color of a
pixel and how many times that color is to be repeated in sequence. In this
8-bit example, the first row of pixels could be stored using only 32 bits instead of the 96
needed for the uncompressed version.
First row of pixels:
· 8 bits used to store the color blue
· 8 bits used to store the number 9 –telling the system how many times to repeat the color
blue
· 8 bits used to store the color black
Figure 2.1 Run Length Encoding

The entire image could be stored using only 70 bytes rather than the original
uncompressed size of 144 bytes. For run length encoding to lead to high efficiency,
it is necessary for the image to have sequences of colour. If the colour were to
change a lot from pixel to pixel it would not always be an efficient compression
method.
2.1.2 Lossy compression:
Lossy compression reduces the amount of data required
to store a file. However, lossy compression also results in some loss of quality.
JPEG images and MP3 sound files both make use of lossy compression. Despite a
loss in quality, users are often unable to determine any major difference.
When an image is captured using a digital camera, it will be compressed and saved
as a JPEG. Compressing images as JPEGs can reduce file size by more than 80 percent,
with little noticeable change visible to humans. Similarly, a compressed MP3file may be
one tenth the size of the original audio file and may sound almost identical.
Most lossy compression algorithms allow for various quality settings, which
determine how much compression is applied to the file. The quality setting
involves a trade-off between quality and file size. A file that uses greater
compression will take up less space, but may not look or sound as good as a file
with less compression applied.

Figure 2.2 Comparison between low and high compression image

Perceptual coding:
Perceptual coding is a lossy compression technique that is applied to sound. MP3
sound files make use of perceptual coding. Algorithms are used to remove some
data from sound files. The algorithms focus on:
● Removing sound captured at frequencies out with the dynamic range of
human hearing
● Removing frequencies that cannot be detected by the human ear because
they play at the same time as higher more dominant frequencies
Intraframe and Interframe compression

MPEG video files often make use of intraframe and interframe compression.
Intraframe compression is simply the process of compressing each individual
image (frame) in the video. In the case of MPEG videos, each individual JPEG
frame is compressed using DCT encoding as described above. These frames are
then known as i-frames.
Interframe compression is the process of only saving changes between i-frames.
This is achieved by using p-frames and b-frames. A p-frame only stores the
changes that exist between the previous i-frame and the current i-frame. It does this
by disregarding any data that has not changed. A b-frame attempts to achieve
greater compression by storing changes from both the previous and next i-frames,
again by disregarding any data that does not change, either from the previous frame
or in the next frame.
Brief history of Compression Algorithms

Sliding Window Algorithms


LZ77
Published in 1977, LZ77 is the algorithm that started it all. It introduced the
concept of a 'sliding window' for the first time which brought about significant
improvements in compression ratio over more primitive algorithms. LZ77
maintains a dictionary using triples representing offset, run length, and a deviating
character. The offset is how far from the start of the file a given phrase starts at,
and the run length is how many characters past the offset are part of the phrase.
The deviating character is just an indication that a new phrase was found, and that
phrase is equal to the phrase from offset to offset+length plus the deviating
character. The dictionary used changes dynamically based on the sliding window
as the file is parsed. For example, the sliding window could be 64MB which means
that the dictionary will contain entries for the past 64MB of the input data.
Given an input "abbadabba" the output would look something like
"abb(0,1,'d')(0,3,'a')" as in the example below:

Postion Symbol Output


0 a a
1 b b
2 b b
3 a (0,1, ‘d’)
4 d (0,1, ‘d’)
5 a (0, 3, 'a')
6 b (0, 3, 'a')
7 b (0, 3, 'a')
bytes from the start of the input and the length is how many characters to read from that
position.[7]Another improvement over LZ77 comes from the elimination of the "next
character" and uses just an offset-length pair.
Here is a brief example given the input " these theses" which yields " these(0,6)s" which
saves just one byte, but saves considerably more on larger inputs.
Index 0 1 2 3 4 5 6 7 8 9 10 11

Symbol t h e s e t h e s e
Substituted t h e s e ( 0 , ) s

RAR It is also sometimes used for network data compression.


LZH
LZH was developed in 1987 and it stands for "Lempel-Ziv Huffman." It is a variant of
LZSS that utilizes Huffman coding to compress the pointers, resulting in slightly better
compression. However, the improvements gained using Huffman coding are negligible
and the compression is not worth the performance hit of using Huffman codes.[8]
LZW
LZW is the Lempel-Ziv-Welch algorithm created in 1984 by Terry Welch. It is the
most commonly used derivative of the LZ78 family, despite being heavily patent-
encumbered. LZW improves on LZ78 in a similar way to LZSS; it removes redundant
characters in the output and makes the output entirely out of pointers. It also includes
every character in the dictionary before starting compression, and employs other tricks to
improve compression such as encoding the last character of every new phrase as the first
character of the next phrase. LZW is commonly found in the Graphics Interchange
Format, as well as in the early specifications of the
ZIP format and other specialized applications. LZW is very fast, but achieves poor
2.2 TECHNOLOGIES

HUFFMAN COMPRESSION TECHNIQUE


Huffman coding is a lossless data compression algorithm. The idea is to assign variable-
length codes to input characters, lengths of the assigned codes are based on the
frequencies of corresponding characters. The most frequent character gets the smallest
code and the least frequent character gets the largest code.
The variable-length codes assigned to input characters are Prefix Codes, means the codes
(bit sequences) are assigned in such a way that the code assigned to one character is not
the prefix of code assigned to any other character. This is how
Huffman Coding makes sure that there is no ambiguity when decoding the generated bit
stream.
Let us understand prefix codes with a counter example. Let there be four characters
a, b, c and d, and their corresponding variable length codes be 00, 01, 0 and 1. This
coding leads to ambiguity because code assigned to c is the prefix of codes assigned to a
and b. If the compressed bit stream is 0001, the de-compressed output may be “cccd” or
“ccb” or “acd” or “ab”.
There are mainly two major parts in Huffman Coding
1. Build a Huffman Tree from input characters.
2. Traverse the Huffman Tree and assign codes to characters.
Steps to build Huffman Tree
Input is an array of unique characters along with their frequency of occurrences
and output is Huffman Tree.
1. Create a leaf node for each unique character and build a min heap of
all leaf nodes (Min Heap is used as a priority queue. The value of frequency
field is used to compare two nodes in min heap. Initially, the least frequent
character is at root)
2. Extract two nodes with the minimum frequency from the min heap.
3. Create a new internal node with a frequency equal to the sum of the
two nodes frequencies. Make the first extracted node as its left child and the
other extracted node as its right child. Add this node to the min heap.
4. Repeat steps#2 and #3 until the heap contains only one node. The
remaining node is the root node and the tree is complete.
Let us understand the algorithm with an example:
Character Frequency
A 5
B 9
c 12
d 13
e 16
f 45
Step 1. Build a min heap that contains 6 nodes where each node represents root of
a tree with single node.
Step 2 Extract two minimum frequency nodes from min heap. Add a new internal
node with frequency 5 + 9 = 14.
Now min heap contains 5 nodes where 4 nodes are roots of trees with single
element each, and one heap node is root of tree with 3 elements
character Frequency

c 12
d 13
Internal Node 14
e 16
f 45

Step 3: Extract two minimum frequency nodes from heap. Add a new internal
node with frequency 12 + 13 = 25
Now min heap contains 4 nodes where 2 nodes are roots of trees with single
element each, and two heap nodes are root of tree with more than one nodes
character Frequency
Internal Node 14
e 16
Internal Node 25
F 45
Step 4: Extract two minimum frequency nodes. Add a new internal node with
frequency 14 + 16 = 30
Now min heap contains 3 nodes.
Character Frequency
Internal Node 25
Internal Node 30
F 45
Step 5: Extract two minimum frequency nodes. Add a new internal node with
frequency 25 + 30 = 55
Now min heap contains 2 nodes.
Character Frequency
F 45
Internal Node 55
Step 6: Extract two minimum frequency nodes. Add a new internal node with
frequency 45 + 55 = 100
Now min heap contains only one node.
character Frequency
Internal Node 100
Since the heap contains only one node, the algorithm stops here.

2.3 Java
Java as a language provides lot of packages to work with data compression
and decompression. The main utility package is java.util.zip, which is used to
compress zip compatible files. These packages provide different classes to read,
write. create, modify GZIP and ZIP file formats. They also have checksums to
validate the size before and after compression. Different Java utilities related to
data compression and decompression can be checked in Oracle documentation.The
classical input/output (I/O) library in Java contains classes that support I/O
handling of streams with compressed data. You can easily compress and
decompress any text or binary data to or from any I/O stream using either a file or
any other stream (e.g., a servlet output stream). In this article, you'll see how easily
you can compress data streams in Java with GZIP and Zip data formats.Data
compressing classes use generic I/O streams at a lower level. It's important that
these classes are not a part of symbol streams hierarchy like Reader and Writer but are
based on byte streams InputStream and OutputStream. This is because the compressing
library works with bytes and not with symbols. Nevertheless, you can always use mixed
streams by converting a byte stream into symbol stream by using
InputStreamReader and OutputStreamWriter.

" DeflaterOutputStream: This is the base class for all data compressing
classes.
" CheckedInputStream: For any input stream InputStream, this class can
return a checksum with method getCheckSum().
" CheckedOutputStream: For any output stream OutputStream, this class
can return a checksum with method getCheckSum().
" ZipOutputStream: This is a subclass of DeflaterOutputStream; its
main purpose is compressing data in Zip format.
" GZIPOutputStream: This is a subclass of DeflaterOutputStream; it
compresses data in GZIP format.
" InflaterInputStream: This is a base class for decompressing data.
" ZipInputStream: This subclass of InflaterInputStream can
decompress Zip format data.
" GZIPInputStream: This subclass of InflaterInputStream can
decompress GZIP format data.
There are a lot of data compressing algorithms, but GZIP and Zip formats are the most
frequently used.
This is why they are implemented in a standard Java package
2.3 REVIEW OF RELATED JOURNALS
ASODLLAH SHAHBAHRAMI, RAMIN BAHRAMPUR demonstrates the relative
examination of entropy coding, number juggling or Huffman with other frame the
pressure systems. They actualized and tired Huffman and number juggling calculations.
The outcome demonstrate that pressure portion of number juggling coding is superior to
anything Huffman coding, while the execution of
Huffman coding is higher than number-crunching coding.
PRIYA BAJPAI ET AL have presented greedy algorithm for image compression in
image processing on 8 may, 2017. In this paper, change in the WDR calculation is been
proposed and change depends on choice calculation. The WRD is the productive
procedure in which the entire picture is partitioned into little network and lattice which
has unique properties are expelled from the picture. The proposed method has been
actualized in mat lab by taking the informational index of 10 pictures which are in the
grayscale. Hence this enhanced calculation is better since its pressure proportion is
higher.
XINFENG ZHANG ET AL IEEE members presented just-noticeable
difference-based perceptual optimization for JPEG compression on Jan 1, 2017. In this
letter, we propose adjust-detectable contrast (JND) based quantization table inference
technique for JPEG by improving the rate-contortion costs for the entire recurrence
group. To accomplish better quality, the DCT area JND-based contortion metric is used
to demonstrate the stair mutilation saw by HVS. The proposed technique accomplishes
around 16.7% to 22.0% piece rate investment funds for test pictures and 18.3% piece rate
reserve funds by and large contrasted and JPEG standard. The picture created with our
quantization table is all the more outwardly charming. Particularly less ringing ancient
rarities are seen at the back of the rider.
Each journal brought about a different method of compression and still the problem of
quality loss wasn’t totally handled. So in this research work we intend to use the Huffman
technique to compress images and videos without affecting its quality.
problem of quality loss wasn’t totally handled. So in this research work we intend to use
the Huffman technique to compress images and videos without affecting its
quality.
CHAPTER 3

METHODOLOGY

3.1 Materials to be used

a) Java Integrated Development Environment (IDE)


b) File Reader
c) Huffman Architecture
d) Java.Util.* Application Program Interface (API)
e) Java Package
f) Compression class
g) Java.io.*

3.2 Methods Used


a) Case studies
b) Algorithms
c) Huffman coding
Chapter Four

Conclusion

After implementation of the huffman technique to the file input algorithm, a


decrease in file size is observed with little effect to the information carried, its
efficacy is recorded at a percentage of 80% which passes as a lossless compression
as no form of data compression is absolutely lossless.
REFERENCE

[1] Wolfram, Stephen. Anew kind of science. Champaign, IL: Wolfram media,
2002. 1069. Print.
[2] Ken Huffman. Profile: David A. Huffman, scientific American, September
1991, page 54-58.
[3] Ziv J, Lempel A, A Universal algorithm for sequential Data compression, IEEE
transactions on information theory, Vol 23, No. 3 (1977), page 337-343
[4] Ziv J, Lempel A, Compression of individual sequences via variable-rate coding,
IEEE transactions on information theory, Vol 24, No. 5 (1977), page 530-536
[5] RODEH, M., PRATT, V. R., AND EVEN, S. 1981. Linear algorithm for data
compression via string matching. J. ACM 28, 1 (Jan.), 16-24.
[6] DEFLATE64 benchmarks
[7] STORER, J. A., AND SZYMANSKI, T. G. 1982. Data compression via textual
substitution. J. ACM 29, 4 (Oct.), 928-951.
[8] Bell, T., Witten, I., Cleary, J., "Modeling for Text Compression", ACM
Computing Surveys, Vol. 21, No. 4 (1989).

You might also like