Final Report2
Final Report2
A SEMINAR REPORT BY
BY
20161955573
COMMUNICATION OPTION
SUBMITTED TO
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
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
REFERENCES
CHAPTER ONE
INTRODUCTION
Bit stream
RESULTANT
IMAGE
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.
Image compression techniques are broadly classified into two categories: Lossy and
lossless image 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
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)
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.
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
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.
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.
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
Symbol t h e s e t h e s e
Substituted t h e s e ( 0 , ) s
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
Conclusion
[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).