Post on 03-Nov-2014
CHAPTER 1
INTRODUCTION
Digital images are widely used in computer applications. Uncompressed
digital images require considerable storage capacity and transmission bandwidth.
Efficient image compression solutions are becoming more critical with the recent
growth of data intensive, multimedia based web applications. Data compression is
the process of converting data files into smaller files for efficiency of storage and
transmission. As one of the enabling technologies of the multimedia revolution,
data compression is a key to rapid progress being made in information technology.
It would not be practical to put images, audio, and video alone on websites without
compression. Data compression algorithms are used in those standards to reduce
the number of bits required to represent an image or a video sequence.
Compression is the process of representing information in a compact form.
Data compression treats information in digital form as binary numbers represented
by bytes of data with very large data sets. Compression is a necessary and
essential method for creating image files with manageable and transmittable sizes.
In order to be useful, a compression algorithm has a corresponding
decompression algorithm that, given the compressed file, reproduces the original
file. There have been many types of compression algorithms developed. These
algorithms fall into two broad types, lossless algorithms and lossy algorithms. A
lossless algorithm reproduces the original exactly. A lossy algorithm, as its name
implies, loses some data. Data loss may be unacceptable in many applications.
Depending on the quality required of the reconstructed image, varying amounts of
loss of information can be accepted. Video and Audio files are very large. There is
need to compress an image to utilize the bandwidth effectively. Compression
becomes part of the representation or coding scheme which have become popular
audio, image and video formats. Compression basically employs redundancy in
the data. Video and audio compression techniques are most suited to this form of
lossy compression. Lossy compression use source encoding techniques that
includes Huffman encoding.
1
1.1 BACKGROUND WORK
In certain applications like video conferencing and television, large amount
of images are transmitted through internet. It necessitates an image compression
technique to efficiently utilize the bandwidth. Various lossy compression
techniques using Discrete Wavelet Transform are listed. Ability of these
techniques is dependent on the selection of transforms. The performance is
measured in terms of compression ratio. An extensive survey on various
techniques used for Image compression using DWT are listed.
1.1.1 Review of DWT based image compression techniques
Henry Y.H Chuang et al (1995) implemented VLSI architecture for fast 2D
discrete orthonormal wavelet transform. They presented a parallel pipelined VLSI
array architecture for 2D dyadic separable DWT. The 2D data array is partitioned
into non-overlapping groups of rows. All rows in a partition are processed in
parallel, and consecutive partitions are pipelined. Moreover, multiple wavelet
levels are computed in the same pipeline, and multiple DWT problems can be
pipelined also. The whole computation requires a single scan of the image data
array. Thus, it is suitable for on-line real-time applications. For an N×N image, an
m-level DWT can be computed in N22q+2m−1(2p+3) time units on a processor
costing no more than 83(Cm+Cu)p(p+2q) , where q is the partition size, p is the
length of corresponding 1D DWT filters, C m and C a are the costs of a parallel
multiplier and a parallel adder respectively, and a time unit is the time for a
multiplication and an addition. For q=N ≫ m, the computing time reduces to N2.
They found that when a large number of DWT problems are pipelined, the
computing time is about N22q per problem.
Chu Yu et al (1999) implemented a design of an efficient VLSI architecture
for 2-D Discrete Wavelet Transforms. They presented VLSI architecture for the
separable two-dimensional Discrete Wavelet Transform (DWT) decomposition.
Using a computation-schedule table, they showed how the proposed separable
architecture uses only a minimal number of filters to generate all levels of DWT
computations in real time. For the computation of an N x N 2-D DWT with a filter
2
length L, this architecture spends around N2 clock cycles, and requires 2NL-2N
storage unit, 3L multipliers, as well as 3(L-1) adders. This architecture utilized a
computation-schedule table to accomplish all the resolution levels of
computations. Since this architecture has a low latency, a low hardware cost, and
ability to process 2-D digital signals in real-time, it can be applied very well to the
codec implementation for various video image processing standards, such as
MPEG-4 and JPEG-2000. They found that For a video signal processing, the
computation time of the architecture per picture spends about N 2 only, which
meets the real-time requirement of many 2-D signal-processing applications.
Ching-Hsien Chang et al (2000) presented an efficient VLSI architectures
for fast computation of the Discrete Fourier Transform and its inverse. They have
developed two new VLSI architectures for computing the point discrete Fourier
transform (DFT) and its inverse (IDFT) based on a radix-2 fast algorithm, where is
a power of two. First they have presented a linear systolic array that requires log2
complex multipliers and is able to provide a throughput of one transform sample
per clock cycle. Compared with other related systolic designs based on direct
computation or a radix-2 fast algorithm, the proposed one has the same
throughput performance but involves less hardware complexity. This design is
suitable for high-speed real-time applications, but it would not be easily realized in
a single chip when gets large. It has been verified that the proposed memory-
based architecture that can be realized in a single chip with throughput
performance up to several Mega Transform samples per second for a transform
length as high as several thousand. They found that Such area-time performance
makes this design very competitive for use in long-length DFT applications, such
as asymmetric digital subscriber lines (ADSL) and orthogonal frequency division
multiplexing (OFDM) systems.
Francescomaria Marino et al (2001) implemented two fast architectures for
the direct 2-D Discrete Wavelet Transform. They have presented two architectures
for the direct two–dimensional (2-D) discrete wavelet transform (DWT). The first
architecture is based on a modified recursive pyramid algorithm (MRPA) and
performs a “nonstandard” decomposition (i.e., Mallat’s tree) of an image in
3
approximately 2 2 3 clock cycles (ccs). They found that this consistently speeds up
other known architectures that commonly need approximately 2 ccs.
Furthermore, the proposed architecture is simpler than others in terms of
hardware complexity. Subsequently, they showed how “symmetric”/“anti-
symmetric” properties of linear-phase wavelet filter bases can be exploited in order
to further reduce the VLSI area. This is used to design a second architecture that
provides one processing unit for each level of decomposition (pipelined approach)
and performs a decomposition in approximately 2 2 ccs.
Jörg Ritter et al (2001) implemented a pipelined architecture for partitioned
DWT based lossy image compression using FPGA’s. They have presented a
promising FPGA based hardware architecture for DWT in case of lossy and
lossless image compression. The FPGA implementation proposed achieves its
computational power by using the partitioned approach and taking advantage of
pipelining. Currently, an EZT algorithm based on this 2D-DWT architecture is
implemented within the scope of a master’s thesis at our institute. They
investigated the applicability of the approach presented for video compression, in
particular to motion estimation. The partitioned approach is suitable for being
applied to this area because motion seems to be usually localized through the sub
images used. Furthermore, they have been looking for methods allowing the
partitioned approach to result in higher compaction ratios than the non-partitioned
algorithms. One point of departure is to classify the sub images with respect to
similarity, to compress only one representative JC of each class C, and to
represent the remaining sub images I of class C by the image I − JC which
specifies the differences between sub image I and its representative JC. Another
point of departure is to exploit similarities between the trees of the multi-scale
representation.
Abdullah AlMuhit et al (2004) implemented VLSI implementation of Discrete
Wavelet Transform (DWT) for image compression. They presented an approach
towards VLSI implementation of the Discrete Wavelet Transform (DWT) for image
compression. The design follows the JPEG2000 standard and can be used for
both lossy and lossless compression. In order to reduce complexities of the 4
design, linear algebra view of DWT and IDWT has been used. This design can be
used for image compression in a robotic system. They developed an improved and
efficient Discrete Wavelet Transform algorithm and tested in MATLAB. Then the
algorithm has been modified for implementation in VHDL.
Jose Oliver et al (2006) implemented a Huffman coding of wavelet lower
trees for very fast image compression. They have presented a very fast variation
of the Lower-Tree Wavelet (LTW) image encoder. LTW is a fast non-embedded
encoder with state-of-the-art compression efficiency, which employs a tree
structure as a fast method of coding coefficients, being faster than other encoders
like SPIHT or JPEG 2000.They have described the coding algorithm that all the
wavelet subbands are scanned in 2x2 blocks of coefficients, from the first level to
the Nth. They showed that this encoder is more efficient than other very fast
wavelet encoders, like the recently proposed PROGRESS (which is surpassed in
up to 0.5 dB), and faster than them (from 4 to 9 times in coding). Compared with
the JPEG 2000 reference software, the encoder is from 18 to 38 times faster,
while PSNR is similar at low bit-rates, and about 0.5 lower at high bit-rates. A very
fast version of the lower-tree wavelet encoder using Huffman coding and other
strategies have been presented to reduce execution time. The loss of coding
efficiency is compensated by the reduction of execution time. They found that the
encoder can be considered one of the fastest wavelet-based image encoders, and
therefore it is good for real-time interactive multimedia communications, allowing
simple implementations both in hardware and software.
Barbara Penna et al (2007) implemented transform coding techniques for
lossy hyper spectral data compression. Transform-based lossy compression has a
huge potential for hyperspectral data reduction. Hyperspectral data are 3-D, and
the nature of their correlation is different in each dimension. These calls for a
careful design of the 3-D transform to be used for compression. They have
investigated the transform design and rate allocation stage for lossy compression
of hyper spectral data. First, they selected a set of 3-D transforms, obtained by
combining in various ways wavelets, wavelet packets, the discrete cosine
transform, and the Karhunen–Loève transform (KLT), and evaluate the coding
efficiency of these combinations. Second, they proposed a low-complexity version 5
of the KLT, in which complexity and performance can be balanced in a scalable
way, allowing one to design the transform that better matches a specific
application. Third, they integrated this, as well as other existing transforms, in the
framework of Part 2 of the Joint Photographic Experts Group (JPEG) 2000
standard, taking advantage of the high coding efficiency of JPEG 2000, and
exploiting the interoperability of an international standard. An evaluation
framework based on both reconstruction fidelity and impact on image exploitation
has been introduced, and evaluate the proposed algorithm by applying this
framework to AVIRIS scenes. They found that the scheme based on the proposed
low-complexity KLT significantly outperforms previous schemes as to rate-
distortion performance.
Mukul Shirvaikar et al (2008) implemented VHDL implementation of wavelet
packet transforms using SIMULINK tools. The real-time implementation of the
Discrete Wavelet Transform (DWT) is a current area of research as it is one of the
most time consuming steps in the JPEG2000 standard. The standard implements
two different wavelet transforms: irreversible and reversible Daubechies. The
former is a lossy transform, whereas the latter is a lossless transform. Many
current JPEG2000 implementations are software based and not efficient enough
to meet real-time deadlines. Field Programmable Gate Arrays (FPGAs) are
revolutionizing image and signal processing. Many major FPGA vendors like
Altera and Xilinx have recently developed SIMULINK tools to support their FPGAs.
These tools are intended to provide a seamless path from system-level algorithm
design to FPGA implementation. They investigated FPGA implementation of 2-D
lifting-based Daubechies 9/7 and Daubechies 5/3 transforms using a
Matlab/Simulink tool that generates synthesizable VHSIC Hardware Description
Language (VHDL) code. They found that the feasibility of this approach for real
time image processing by comparing the performance of the high-level toolbox
with a handwritten VHDL implementation.
Chao Cheng et al (2008) implemented high-speed VLSI implementation of
2-D Discrete Wavelet Transform. They presented a systematic high-speed VLSI
implementation of the discrete wavelet transform (DWT) based on hardware-
efficient parallel FIR filter structures. High-speed 2-D DWT with computation time 6
as low as 2 12 can be easily achieved for an image with controlled increase of
hardware cost. Hardware efficient parallel FIR filter structures are developed to
speed up the processing speed of 2-D DWT and to control the increase of
hardware cost at the same time. They found that this design can be easily
extended to achieve higher processing speed than the given highest processing
speed with computing time and it is suitable for high-speed VLSI implementation of
2-D DWT because of its regular structure, simple control and 100% hardware
utilization for continuous images.
A. Mansouri et al (2009) implemented an efficient VLSI architecture and
FPGA implementation of high-speed and low power 2-D DWT for (9, 7) wavelet
Filter. They presented an efficient VLSI architecture of a high speed, low power 2-
D Discrete Wavelet Transform computing. This architecture, based on new and
fast lifting scheme approach for (9, 7) filter in DWT, reduces the hardware
complexity and memory accesses and this verified by simulation and successfully
implemented in a Cyclone II and Stratix III FPGAs, and the estimated frequency of
operation is 350 MHz. They found that the resulting computing rate is up to 48
frames (4096x2160) per second with 24 bpp. The architecture has regular
structure, simple control flow, small embedded buffers and low power
consumption. Thus, it is very suitable for new generation image compression
systems, such as JPEG2000. Also they found that the advantages of the proposed
architecture are saving embedded memories, fast computing time, low power
consumption, and low control complexity.
Chengjun Zhang et al (2010) presented a pipeline VLSI architecture for
high-speed computation of the 1-D Discrete Wavelet Transform. They developed a
scheme for the design of a high-speed pipeline VLSI architecture for the
computation of the 1-D discrete wavelet transform (DWT). The main focus of the
scheme is on reducing the number and period of clock cycles for the DWT
computation with little or no overhead on the hardware resources by maximizing
the inter- and intra stage parallelisms of the pipeline. The inter stage parallelism is
enhanced by optimally mapping the computational load associated with the
various DWT decomposition levels to the stages of the pipeline and by
synchronizing their operations. The intra stage parallelism is enhanced by 7
decomposing the filtering operation equally into two subtasks that can be
performed independently in parallel and by optimally organizing the bitwise
operations for performing each subtask so that the delay of the critical data path
from a partial-product bit to a bit of the output sample for the filtering operation is
minimized. They showed that an architecture designed based on the proposed
scheme requires a smaller number of clock cycles compared to that of the
architectures employing comparable hardware resources. In fact, the requirement
on the hardware resources of the architecture designed by using the proposed
scheme also gets improved due to a smaller number of registers that need to be
employed. Based on the proposed scheme, a specific example of designing an
architecture for the DWT computation is considered. Finally, they found that the
principle of maximizing the inter- and intra stage parallelisms for the design of
architecture for the 1-D DWT computation is extendable to that for the 2-D DWT
computation.
Rohit Arora et al (2011) implemented an algorithm for image compression
using 2D wavelet transform. The standard image MASK is analyzed using wavelet
techniques for image compression. The transformations used for wavelet
transformations are Haar, Symlet, Coiflet and db4. The results in terms of
compression ratio and MSE show that the Haar transformation has the best
performance. The Haar transform is then used to compress the image up to four
levels. They sown that the reconstructed image after every level of compression.
They found that DWT has potential application in compression problem and the
use of Haar transformation for Wavelet Transformation provides the best results.
Chengjun Zhang et al (2011) implemented a pipeline VLSI architecture for
fast computation of the 2-D Discrete Wavelet Transform. They developed, a
scheme for the design of a high-speed 3-stage pipeline VLSI architecture for the
computation of the 2-D discrete wavelet transform (DWT). The main focus in the
development of the architecture is on providing a high operating frequency and a
small number of clock cycles along with an efficient hardware utilization by
maximizing the inter-stage and intra-stage computational parallelism for the
pipeline. The inter-stage parallelism is enhanced by optimally mapping the
computational task of multi decomposition levels to the stages of the pipeline and 8
synchronizing their operations. The intra-stage parallelism is enhanced by dividing
the 2-D filtering operation into four subtasks that can be performed independently
in parallel and minimizing the delay of the critical path of bit-wise adder networks
for performing the filtering operation. To validate this scheme, a circuit is designed,
simulated, and implemented in FPGA for the 2-D DWT computation. They showed
that the circuit is capable of operating with a maximum clock frequency of 134MHz
and processing 1022 frames of size 512 512 per second with this operating
frequency. They showed that the performance in terms of the processing speed of
the architecture designed based on the proposed scheme is superior to those of
the architectures designed using other existing schemes, and it has similar or
lower hardware consumption. Finally, they found that the architecture designed is
scalable in that its processing speed can be adjusted upward or downward by
changing the number of MAC cells in each of the processing units by a factor
equal to that of the reduction required in the processing speed.
V. V. Sunil Kumar et al (2012) have developed image compression
techniques by using wavelet transform. This is associated with a certain type of
compression techniques by using wavelet transforms. Wavelets are used to
characterize a complex pattern as a series of simple patterns and coefficients that,
when multiplied and summed, reproduce the original pattern. The data
compression schemes can be divided into lossless and lossy compression. Lossy
compression generally provides much higher compression than lossless
compression. Wavelets are a class of functions used to localize a given signal in
both space and scaling domains.A Minimage was originally created to test one
type of wavelet and the additional functionality was added to image to support
other wavelet types and the EZW(Embedded Zerotree Wavelet) coding algorithm
was implemented to achieve better compression results.
1.2 MOTIVATION
Various image compression techniques were developed and stopped in
simulation level itself. In order to implement an image compression technique on
FPGA, it is necessary to develop VHDL code. This motivates to propose an
9
efficient image compression technique based on Discrete Wavelet Transform and
Huffman encoding using VHDL.
1.3 PROBLEM DEFINITION
In this proposed work, aims at compressing an image using 2-d Discrete
Wavelet Transform and Huffman encoding to increase the compression ratio and
reduce the Data Redundancy. Discrete wavelet transform and Huffman encoding
will be implemented using VHDL. The performance will be evaluated in terms of
compression ratio for five different images.
1.4 OBJECTIVES
To acquire the images.
To perform Discrete Wavelet Transform on the images.
To perform Huffman Encoding for the approximation coefficients.
To measure the compression ratio for different images.
1.5 SCOPE OF THE WORK
The main scope of the project is to compress an image to utilize the
bandwidth efficiently for certain applications like Television and Video
Conferencing. Video and Audio files are very large. There is a need to compress
an image to utilize the bandwidth effectively. Compression becomes part of the
representation or coding scheme which have become popular audio, image and
video formats. An efficient image compression technique that uses Huffman
encoding for the approximation coefficients obtained from Discrete Wavelet
Transform is used during the transmission of images through an internet. This
compression technique based on Discrete Wavelet Transform and Huffman
encoding is proposed to increase compression ratio and reduce data redundancy.
This proposed work is highly suitable for an applications like video conferencing.
10
CHAPTER 2
OVERVIEW OF DWT AND HUFFMAN ENCODING
The wavelet transform (WT) provides an alternative approach to signal
processing, especially suited for the analysis of spatial and spectral locality. In
recent years, there has been a number of studies on wavelet transforms for signal
analysis and synthesis. Generally, the 2- D DWT is frequently applied in image
and video processing. The discrete wavelet transform (DWT) has been widely
used in audio and image processing, digital communications and other application
fields. This computation transform has been widely implemented in very-large-
scale integration (VLSI) because of the real-time requirement. Wavelets are
functions defined over a finite interval. The basic idea of the wavelet transform is
to represent an arbitrary function as a linear combination of a set of such wavelets
or basis functions. These basis functions are obtained from a single prototype
wavelet called the mother wavelet by dilations (scaling) and translations (shifts).
The purpose of wavelet transform is to change the data from time-space domain to
time-frequency domain which makes better compression results. The fundamental
idea behind wavelets is to analyze the signal at different scales or resolutions,
which is called multiresolution.
Huffman coding is based on the frequency of occurrence of a data item
(pixel in images). The principle is to use a lower number of bits to encode the data
that occurs more frequently. Codes are stored in a code Book which may be
constructed for each image or a set of images. In all cases the code book plus
encoded data must be transmitted to enable decoding.
2.1 OVERVIEW OF DWT
Wavelets are a class of functions used to localize a given signal in both
space and scaling domains. A family of wavelets can be constructed from a
mother wavelet. Compared to Windowed Fourier analysis, a mother wavelet is
stretched or compressed to change the size of the window. In this way, big
wavelets give an approximate image of the signal, while smaller and smaller
wavelets zoom in on details. Therefore, wavelets automatically adapt to both the
high-frequency and the low-frequency components of a signal by different sizes of
11
windows. Any small change in the wavelet representation produces a
correspondingly small change in the original signal, which means local mistakes
will not influence the entire transform. The wavelet transform is suited for non
stationary signals, such as very brief signals and signals with interesting
components at different scales.
2.1.1 Wavelet Decomposition
There are several ways wavelet transforms can decompose a signal into
various sub bands. These include uniform decomposition, octave-band
decomposition, and adaptive or wavelet-packet decomposition. Out of these,
octave-band decomposition is the most widely used.
The procedure is as follows: wavelet has two functions “wavelet “and
“scaling function”. They are such that there are half the frequencies between them.
They act like a low pass filter and a high pass filter. The decomposition of the
signal into different frequency bands is simply obtained by successive high pass
and low pass filtering of the time domain signal. This filter pair is called the
analysis filter pair. First, the low pass filter is applied for each row of data, thereby
getting the low frequency components of the row. But since the low pass filter is a
half band filter, the output data contains frequencies only in the first half of the
original frequency range. By Shannon's Sampling Theorem, they can be sub-
sampled by two, so that the output data now contains only half the original number
of samples. Now, the high pass filter is applied for the same row of data, and
similarly the high pass components are separated. In DWT, an image can be
analysed by passing it through an analysis filter bank followed by decimation
operation. An analysis filter bank consists of a low-pass and high-pass filter at
each decomposition stage. When the signal passes through these filters, it splits
into two bands. the low-pass filter, which corresponds to an averaging operation,
extracts the coarse information of the signal. The high-pass filter which
corresponds to a differencing operation, extracts the detail information of the
signal. The output of the filtering operation is then decimated by two. A two-
dimensional transform is accomplished by performing two separate one
dimensional transforms. This is shown in Fig 2.1.
12
Figure 2.1 Decomposition of an image
This is a non-uniform band splitting method that decomposes the lower
frequency part into narrower bands and the high-pass output at each level is left
without any further decomposition. This procedure is done for all rows. Next, the
filtering is done for each column of the intermediate data. The resulting two-
dimensional array of coefficients contains four bands of data, each labelled as LL
(low-low), HL (high-low), LH (low-high) and HH (high-high). The LL band can be
decomposed once again in the same manner, thereby producing even more sub
bands.
2.1.2 Wavelet Transform using Haar Wavelets
Image transforms are very important in digital processing they allow to
accomplish less with more. For example the Fourier Transform may be used to
effectively compute convolutions of images1 or the Discrete Cosine Transform
may be used to significantly decrease space occupied by images without
noticeable quality loss. Wavelet Transform (WT) is a relatively new concept as a
whole, even it though it incorporates some of the transforms, which have been
know for long time. Haar wavelet is a simplest wavelet and the wavelet coefficients
are used with the scaling function.
13
2.1.2.1 Algorithm of Discrete Wavelet Transform
Discrete wavelet Transform is given by
The following algorithm is also known as subband coding. Assume the
highest frequency component that exists in a signal will be π radians. To provide
sufficient information about the signal without its loss due to sampling, the signal is
sampled at Nyquist’s rate (which is twice the maximum frequency that exists in the
signal). Next, the signal is passed through two filters – one half band low pass and
one half band high band filter. The output of the high pass filter is preserved.
After passing the signal through a half band low pass filter, half of the
samples can be eliminated according to the Nyquist’s rule, since the signal now
has a highest frequency of π/2 radians instead of π radians Simply discarding
every other sample will subsample the signal by two, and the signal will then have
half the number of points. The scale of the signal is now doubled. Note that the low
pass filtering removes the high frequency information, but leaves the scale
unchanged. Only the sub sampling process changes the scale. Resolution, on the
other hand, is related to the amount of information in the signal, and therefore, it is
affected by the filtering operations. Half band low pass filtering removes half of the
frequencies, which can be interpreted as losing half of the information. Therefore,
the resolution is halved after the filtering operation. Note, however, the sub
sampling operation after filtering does not affect the resolution, since removing half
of the spectral components from the signal makes half the number of samples
redundant anyway. Half the samples can be discarded without any loss of
information. In summary, the low pass filtering halves the resolution, but leaves the
scale unchanged. The signal is then sub sampled by 2 since half of the number of
samples is redundant. This doubles the scale.
14
Figure 2.2 Subband coding
The transformation
x = (x1, . . . , xN) (s | d) = (s1, . . . , sN/2 | d1, . . . , dN/2) is called the Discrete
Haar Wavelet Transformation.
2.1.2.2 Formulation for Haar wavelet Transform
Digital images require large amounts of memory to store and, when
retrieved from the internet, can take a considerable amount of time to download.
The Haar wavelet transform provides a method of compressing image data so that
it takes up less memory. A 256 x 256 pixel gray scale image is stored as a 256 x
256 matrix, with each element of the matrix being a number ranging from zero (for
black) to some positive whole number (for white). A 256 x 256 color image is
stored as three 256 x 256 matrices (One each for the colors red, green, and blue).
This matrix can be used and some linear algebra to maximize compression.
15
The Haar wavelet is the simplest wavelet.
1 0 < x <1/2
wH(x) = -1 ½ < x < 1
0 otherwise
The mother wavelet obviously satisfies the two wavelet requirements, as it
is both local and oscillatory. The picture below shows the shapes of Haar wavelets
for various scales and translations.
Figure 2.3 Shape of the Haar Wavelets
Wavelet Transform is a type of signal representation that can give the
frequency content of the signal at a particular instant of time or spatial location.
The Haar wavelet transform decomposes the image into different sub-band
images, It splits component into numerous frequency bands called sub-bands.
They are LL, LH, HL, and HH sub-bands. A high-frequency sub-band contains the
edge information of input image and LL sub-band contains the clear information
about the image.
An outstanding property of the Haar functions is that except function haar(0,
t), the i–th Haar function can be generated by the restriction of the (j − 1)–th
function to be half of the interval where it is different from zero, by multiplication
with p2 and scaling over the interval [0, 1]. These properties give considerable
interest of the Haar function, since they closely relate them to the wavelet theory.
In this setting, the first two Haar functions are called the global functions, while all
the others are denoted as the local functions. Hence, the Haar function, which is
16
an odd rectangular pulse pair, is the simplest and oldest wavelet. The motivation
for using the discrete wavelet transform is to obtain information that is more
discriminating by providing a different resolution at different parts of the time–
frequency plane. The wavelet transforms allow the partitioning of the time-
frequency domain into non uniform tiles in connection with the time–spectral
contents of the signal. The wavelet methods are strongly connected with classical
basis of the Haar functions; scaling and dilation of a basic wavelet can generate
the basis Haar functions. The Haar wavelet transform decomposes the image into
different sub-band images, It splits component into numerous frequency bands
called sub-bands. They are LL, LH, HL, and HH sub-bands. A high-frequency sub-
band contains the edge information of input image and LL sub-band contains the
clear information about the image.
consider the Filter h=(h0,h1)
y=h*x
yn=1/2 xn + 1/2 xn-1
2.1.2.3. Point Haar Wavelet(oldest & simplest)
g[n] = 1/2 for n = −1, 0
g[n] = 0 otherwise
h[0] = 1/2, h[−1] = −1/2,
h[n] = 0 otherwise
17
2.1.2.4 2-Dimension(analysis) of Discrete wavelet transform
In DWT, an image can be analysed by passing it through an analysis filter
bank followed by decimation operation. An analysis filter bank consists of a low-
pass and high-pass filter at each decomposition stage. When the signal passes
through these filters, it splits into two bands. the low-pass filter, which corresponds
to an averaging operation, extracts the coarse information of the signal. The high-
pass filter which corresponds to a differencing operation, extracts the detail
information of the signal. The output of the filtering operation is then decimated by
two. A two-dimensional transform is accomplished by performing two separate one
dimensional transforms. First, an image is filtered along the row and decimated by
two. It is then followed by filtering the sub image along the column and decimated
by two. This operation splits an image into four bands namely LL,LH,HL and HH
respectively. Further decomposition can be achieved by acting upon the LL sub-
band successfully and the resultant image is split into multiple bands. This process
is shown in Fig 2.4.
.
Figure 2.4 Two Dimension analysis of Discrete wavelet transform
18
2.1.2.5 Working of Haar Wavelet Transform
The Haar wavelet uses a method of manipulating matrices called
averaging and differencing.
If y is a row of an image matrix, when it is averaged and differenced
will get the following results.
y 448 768 704 640 1280 1408 1600 1600
y1 608 672 1344 1600 −160 32 −64 0
y2 640 1472 −32 −128 −160 32 −64 0
y3 1056 −416 −32 −128 −160 32 −64 0
Table 2.1 Average and Difference
Blue = Approximation Coefficients
Red = Detail Coefficients
Using Matrix multiplication, but Y1=yA1
where A1 is the Matrix
1/2 0 0 0 1/2 0 0 0
1/2 0 0 0 -1/2 0 0 0
A1= 0 1/2 0 0 0 1/2 0 0
0 1/2 0 0 0 -1/2 0 0
0 0 1/2 0 0 0 1/2 0
0 0 1/2 0 0 0 -1/2 0
0 0 0 1/2 0 0 0 1/2
0 0 0 1/2 0 0 0 -1/2
and Y2=y1A2
19
where A2 is the Matrix
1/2 0 1/2 0 0 0 0 0
1/2 0 -1/2 0 0 0 0 0
0 1/2 0 1/2 0 0 0 0
0 1/2 0 -1/2 0 0 0 0
A2= 0 0 0 0 1 0 0 0
0 0 0 0 0 1 0 0
0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 1
and y3=y2A3
where A3 is the matrix
1/2 1/2 0 0 0 0 0 0
1/2 -1/2 0 0 0 0 0 0
0 0 1 0 0 0 0 0
A3= 0 0 0 1 0 0 0 0
0 0 0 0 1 0 0 0
0 0 0 0 0 1 0 0
0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 1
20
This set of operations can all be done in one step:
y3 = yW
Where W is is the transformation matrix:
W = A1 A2 A3
Also note that since each column of the Ai matrices that comprise
W is orthogonal to every other, the matrices are invertible. Thus:
W^-1=A3^-1 A2^-1 A1^-1
This means that original can get data back using the equation.
y = y3W^-1
In general, it says that Q = I W, where Q is the row transformed matrix and I
is the original image matrix. But, the Haar wavelet transformation does these
transformations to each column of the image matrix, and then repeats them on
each column of the matrix. This is done by multiplying I on the left by the
transpose of W. This gives us our final equation for the row-and-column
transformed matrix T.
T = WT I W
start with an 8 x 8 image represented by matrix P
576 704 1152 1280 1344 1472 1536 1536
P= 704 640 1156 1088 1344 1408 1536 1600
768 832 1216 1472 1472 1536 1600 1600
832 832 960 1344 1536 1536 1600 1536
832 832 960 1216 1536 1600 1536 1536
960 896 896 1088 1600 1600 1600 1536
768 768 832 832 1280 1472 1600 1600
448 768 704 640 1280 1408 1600 1600
21
Last row is our vector y.
First there is a need to average and difference the rows of matrix P. In order
to get the row averaged matrix Q we simply multiply P on the right by matrix W,
our transformation matrix. This yields:
1200 −272 −288 −64 −64 −64 −64 0
1185 −288 −225 −96 32 34 −32 −32
1312 −240 −272 −48 −32 −128 −32 0
1272 −280 −160 −16 0 −192 0 32
Q= 1256 −296 −128 16 0 −128 −32 0
1272 −312 −32 16 32 −96 0 32
1144 −344 −32 −112 0 0 −96 0
1056 −416 −32 −128 −160 32 −64
0
Now average and difference the columns of Q to get row and column
transformed matrix T by multiplying Q on the left by WT .
This yields:
1212 −306 −146 −54 −24 −68 −40 4
30 36 −90 −2 8 −20 8 −4
-50 −10 -20 −24 0 72 −16 −16
T= 82 38 −24 68 48 −64 32 8
8 8 −32 16 −48 −48 −16 16
20 20 −56 −16 −16 32 −16 −16
−8 8 −48 0 −16 −16 −16 −16
44 36 0 8 80 −16 −16 0
Now matrix T is ready to be compressed.
22
2.1.2.6 Approximation and Detail Coefficients
If there is a need to average and difference each row and column of matrix
P only once (T1 = AT1 P A1), we would essentially divide our 8 x 8 matrix into four
4 x 4 sub-matrices. The resulting filtered outputs are approximation and detail
coefficients. That are approximation, vertical detail, horizontal detail and diagonal
detail subbands of the input image. These contains the clear and edge information
about an input image.
Approximation coefficients contains the information of an image. The detail
coefficients left out during the Huffman encoding to efficiently compress an image
and also to increase the quality of an image. The Haar wavelet transform
decomposes the image into different sub-band images, It splits component into
numerous frequency bands called sub-bands. They are LL, LH, HL, and HH sub-
bands. A high-frequency sub-band contains the edge information of input image
and approximation sub-band contains the clear information about the image.
These coefficients are shown in Fig 2.5.
656 1169 1392 1552 −16 −15 −48 −16
816 1248 1520 1584 −16 −160 −16 16
880 1040 1584 1552 16 −112 −16 16
688 752 1360 1600 −80 16 −80 0
T1= −16 47 16 −16 −48 −49 −16 16
−16 96 −16 16 −16 32 −16 −16
−48 48 −16 −16 −16 −16 −16 −16
80 80 16 0 80 −16 −16 0
23
Figure 2.5 Coefficients of DWT
2.1.2.7 Applications of Haar Transform
Due to its low computing requirements, the Haar transform has been mainly
used for pattern recognition and image processing . Hence, two dimensional signal
and image processing is an area of efficient applications of Haar transforms due to
their wavelet-like structure. In this area, it is usually reported that the simplest
possible orthogonal wavelet system is generated from the Haar scaling function
and wavelet. Moreover, wavelets are considered as a generalization of the Haar
functions and transforms. Such a transform is also well suited in communication
technology for data coding, multiplexing and digital filtering. For example,
application of non-normalized Haar transform in a sequence division multiplex
system is described. Bandwidth economy for multiplexed digital channels based
on Haar transform is presented in. For real time applications, hardware-based fast
Haar chips have been developed. Different generalizations of Haar functions and
24
transform are used in digital speech processing with applications in voice
controlled computing devices and robotics. The advantages of computational and
memory requirements of the Haar transform make it of a considerable interest to
VLSI designers as well. Digital MOS ICs as a tool external to the circuit, but also
as a possibility for a self-test strategy. The use of this set of CAD tools allowed the
derivation of strategies for testing MOS circuits when memory states were
encountered as a consequence of some type of faults. The advantage of using
Haar functions instead of Walsh functions in CAD system based on spectra
methods for some classes of Boolean.
2.2 OVERVIEW HUFFMAN ENCODING
Huffman code is a Optimum prefix code developed by D. Huffman in a class
assignment. Construction of Huffman codes is based on two ideas:
In an optimum code, symbols with higher probability should have shorter
code words
In an optimum prefix code, the two symbols that occur least frequently will
have the same length (otherwise, the truncation of the longer codeword to
the same length still produce a decodable code)
Huffman coding is a popular method for compressing data with variable-
length codes. Given a set of data symbols (an alphabet) and their frequencies of
occurrence (or, equivalently, their probabilities), the method constructs a set of
variable-length code words with the shortest average length and assigns them to
the symbols. Huffman coding serves as the basis for several applications
implemented on popular platforms. Some programs use just the Huffman method,
while others use it as one step in a multistep compression process. The Huffman
method [Huffman 52] is somewhat similar to the Shannon–Fano method, proposed
independently by Claude Shannon and Robert Fano in the late 1940s ([Shannon
48] and [Fano 49]). It generally produces better codes, and like the Shannon–Fano
method, it produces the best variable-length codes when the probabilities of the
symbols are negative powers of 2. The main difference between the two methods
is that Shannon–Fano constructs its codes from top to bottom (and the bits of each
codeword are constructed from left to right), while Huffman constructs a code tree 25
from the bottom up (and the bits of each codeword are constructed from right to
left).
Since its inception in 1952 by D. Huffman, the method has been the subject
of intensive research in data compression. The long discussion in [Gilbert and
Moore 59] proves that the Huffman code is a minimum-length code in the sense
that no other encoding has a shorter average length. A much shorter proof of the
same fact was discovered by Huffman himself [Motil 07]. An algebraic approach to
constructing the Huffman code is introduced in [Karp 61]. In [Gallager 78], Robert
Gallager shows that the redundancy of Huffman coding is at most p1 + 0.086
where p1 is the probability of the most-common symbol in the alphabet. The
redundancy is the difference between the average Huffman codeword length and
the entropy. Given a large alphabet, such as the set of letters, digits and
punctuation marks used by a natural language, the largest symbol probability is
typically around 15–20%, bringing the value of the quantity p1 + 0.086 to around
0.1. This means that Huffman codes are at most 0.1 bit longer (per symbol) than
an ideal entropy encoder, such as arithmetic coding. The Huffman encoding
algorithm starts by constructing a list of all the alphabet symbols in descending
order of their probabilities. It then constructs, from the bottom up, a binary tree with
a symbol at every leaf. This is done in steps, where at each step two symbols with
the smallest probabilities are selected, added to the top of the partial tree, deleted
from the list, and replaced with an auxiliary symbol representing the two original
symbols. When the list is reduced to just one auxiliary symbol (representing the
entire alphabet), the tree is complete. The tree is then traversed to determine the
codewords of the symbols.
Huffman coding is based on the frequency of occurrence of a data item
(pixel in images). The principle is to use a lower number of bits to encode the data
that occurs more frequently. Codes are stored in a Code Book which may be
constructed for each image or a set of images. In all cases the code book plus
encoded data must be transmitted to enable decoding.
26
2.2.1 Principle of Huffman codes
Starting with two least probable symbols, g and d, of an alphabet A, if the
codeword for g is [m]0, the codeword for d would be [m]1, where [m] is a string of
1s and 0s. Now, the two symbols can be combined into a group, which represents
a new symbol y in the alphabet set.
Five steps:
Find the gray-level probabilities for the image by finding the histogram
Order the input probabilities (histogram magnitudes)from smallest to largest
Combine the smallest two by addition
Go to step2,until only two probabilities are left
By working backward along the tree, generate code by alternating
assignment of 0 and 1.
The symbol y has the probability P(g) + P(d). Recursively determine the bit
pattern [m] using the new alphabet set.
Let A = {a1, …, a5}, P(ai) = {0.2, 0.4, 0.2, 0.1, 0.1}.
Table 2.2 Principle of Huffman codes
27
2.2.2 Efficiency of Huffman codes
Redundancy – the difference between the entropy and the average length
of a code.
Table 2.3 Efficiency of Huffman codes
The average codeword length for this code is
l = 0.4 x 1 + 0.2 x 2 + 0.2 x 3 + 0.1 x 4 + 0.1 x 4 = 2.2 bits/symbol.
The redundancy is 0.078 bits/symbol.
For Huffman code, the redundancy is zero when the probabilities are negative
powers of two.
2.2.3 Length of Huffman codes
Given a sequence of positive integers {l1, l2, …, lk} satisfies
there exists a uniquely decodable code whose codeword lengths are given by { l1,
l2, …, lk}.
The optimal code for a source S has an average code length lavg with the
following bounds:
where H(S) is the entropy of the source.
28
The lower-bound can be obtained by showing that:
For the upper-bound, notice that given an alphabet {a1, a2, …, ak}, and a set of
codeword lengths.
the code satisfies the Kraft-McMillan inequality and
has lavg < H(S) + 1.
2.2.4 Encoding Procedure
Huffman coding is based on the frequency of occurrence of a data item
(pixel in images). The principle is to use a lower number of bits to encode the data
that occurs more frequently. Codes are stored in a Code Book which may be
constructed for each image or a set of images. In all cases the code book plus
encoded data must be transmitted to enable decoding. Huffman coding is a
popular method for compressing data with variable-length codes. Given a set of
data symbols (an alphabet) and their frequencies of occurrence (or, equivalently,
their probabilities), the method constructs a set of variable-length code words with
the shortest average length and assigns them to the symbols.
An Encoding procedure for the Huffman encoding are as follows:
Find the gray-level probabilities for the image by finding the histogram
Order the input probabilities (histogram magnitudes)from smallest to largest
Combine the smallest two by addition
Go to step2,until only two probabilities are left
By working backward along the tree, generate code by alternating
assignment of 0 and 1.This is shown in Fig 2.6.
29
Figure 2.6 Encoding Procedure
2.2.5 Example of Huffman coding
An example of Huffman encoding is shown if Fig 2.7. In such an alphabet,
one symbol can be assigned the code 0 and the other code 1. The Huffman
method cannot assign to any symbol a code shorter than one bit, so it cannot
improve on this simple code. If the original data (the source) consists of individual
bits, such as in the case of a bi-level (monochromatic) image, it is possible to
combine several bits (perhaps four or eight) into a new symbol and pretend that
the alphabet consists of these (16 or 256) symbols. The problem with this
approach is that the original binary data may have certain statistical correlations
between the bits, and some of these correlations would be lost when the bits are
combined into symbols. When a typical bi-level image is digitized by scan lines, a
pixel is more likely to be followed by an identical pixel than by the opposite one.
30
Figure 2.7 Huffman code for the 26-letter Alphabet
Therefore have a file that can start with either a 0 or a 1 (each has 0.5
probability of being the first bit). A zero is more likely to be followed by another 0
and a 1 by another 1. Figure 2.7 is a finite-state machine illustrating this situation.
If these bits are combined into, say, groups of eight, correlated by the original pixel
probabilities. If the input data contains, e.g., the two adjacent groups 00011100
and 00001110, they will be encoded independently, ignoring the correlation
between the last 0 of the first group and the first 0 of the next group. Selecting
larger groups improves this situation but increases the number of groups, which
implies more storage for the code table and longer time to calculate the table.
31
CHAPTER 3
DWT BASED IMAGE COMPRESSION TECHNIQUE FOR VIDEO
CONFERENCING
A scheme of compression technique is used based on the combination of
2-D DWT/Huffman encoding is proposed to compress an input image by reducing
the coding redundancy. Here, the Discrete wavelet transform and Huffman coding
are implemented using VHDL. Input image size of 256x256 is read using MATLAB
R2012 and image pixels are stored in Memory block module to perform Discrete
Wavelet Transform. Here, the image compression technique is based on Discrete
wavelet transform and Huffman coding. Approximation coefficients are obtained
from DWT using VHDL source code. Huffman coding of approximation coefficients
are obtained using VHDL and Compression ratio is measured. Simulation of DWT
and Huffman Coding using Modelsim is performed. The block diagram of
proposed work is shown in Fig 3.1.
Input image
256x256
compressed
image
Figure 3.1 Block Diagram of proposed system
32
Image acquisition
Memory block module
Discrete Wavelet Transform with Haar module
Huffman Encoding module
Compressed image in terms of compression ratio
3.1 INPUT IMAGE AND MEMORY BLOCK
An input image is red and it is converted into gray scale image. An image
pixel values are created and stored in memory. This is show in figure 4.1.
Figure 3.2 Flowchart to read an input image and Memory block module
3.2 DISCRETE WAVELET TRANSFORM MODULE
This module computes the wavelet transform coefficients of the input image
pixels obtained from the memory module. In this band splitting method that
decomposes the lower frequency part into narrower bands and the high-pass
output at each level is left without any further decomposition. This procedure is
done for all rows. Next, the filtering is done for each column of the intermediate
data. The resulting two-dimensional array of coefficients contains four bands of
data, each labelled as LL (low-low), HL (high-low), LH (low-high) and HH (high-
high). The Low pass and High pass coefficients are computed. This is shown in
figure 3.2.33
Image acquisition
Convert an input image into gray scale image
Create text file containing pixel values
Store the image pixel values in memory block module
Figure 3.3 Flowchart of DWT
The Approximation coefficients are applied as an input to Huffman
encoding module to code the data. The Huffman data for those coefficients are
determined. Further decomposition can be achieved by acting upon the LL sub-
band successfully and the resultant image is split into multiple bands. An input
sequence is decomposed into low-pass and high-pass sub bands in this method of
DWT with Haar wavelet. This Haar wavelet transform decomposes the image into
different sub-band images, It splits component into numerous frequency bands
called sub-bands. They are LL, LH, HL, and HH sub-bands. A high-frequency sub-
band contains the edge information of input image and LL sub-band contains the
clear information about the image.
34
Start
Image acquisition
Apply horizontal decomposition
Apply vertical decomposition
DWT Coefficients
Stop
3.3 HUFFMAN ENCODING MODULE
The Huffman encoding of DWT output has been computed. The compressed
values are viewed serially.
No
Yes
Figure 3.4 Flowchart of Huffman encoding module
35
Find the gray-level probabilities for the image by finding the histogram
Order the input probabilities (histogram magnitudes) from smallest to largest
Combine the smallest two by addition
Are only two
probabilities are left?
By working backward along the tree, generate code by alternating assignment of 0 and 1
3.3.1 Huffman Code
The reference codeword for the approximation coefficients along with
codeword length are shown in Table 2.4.
Table 2.4 Huffman Code
3.4 COMPRESSED IMAGE
The compressed image is displayed in terms of compression ratio. The
compressed values are viewed serially. This s shown if figure 3.4.
Figure 3.5 Flowchart for compressed image in terms of compression ratio
36
View the compressed values serially
Obtain the compression ratio
Measure the performance by obtaining compression ratio for different images
3.5 OVERALL FLOWCHART
An image is red and the pixels are stored as a text file. The approximation
coefficients are obtained by implementing the DWT with haar. Then, the Huffman
encoding of Approximation coefficients are described to find the compressed
values. Compressed image is obtained in terms of Compression ratio.
Figure 3.6 Flowchart of proposed system
CHAPTER 4
37
Start
Image acquisition
Perform DWT with Haar Wavelet and obtain the approximation ad detail
coefficients
Perform Huffman Encoding of
Approximation coefficients
Compressed imageStop
RESULTS AND DISCUSSION
4.1 INPUT IMAGES
The Different colour images are given as an input for the DWT based
imaged compression. The input images are shown below.
Figure 4.1. Input Image 1 Figure 4.2. Input Image 2
Figure 4.3. Input Image 3 Figure 4.4. Input Image 4
38
Figure 4.5. Input Image 5
4.2 GRAY SCALE IMAGES
The gray scale images for the given input images are shown below.
Figure 4.6. Gray scale Image 1 Figure 4.7. Gray scale Image 2
Figure 4.8. Gray scale Image 3 Figure 4.9. Gray scale Image 4
Figure 4.10 Gray scale Image 5
4.3 SIMULATION OUTPUT FOR DISCRETE WAVELET TRANSFORM
39
Discrete Wavelet Transform with Haar wavelet is simulated using VHDL.
Memory bock module is used to store the image pixel values, then the pixels are
read from memory through the data lines and wavelet coefficients are obtained.
The LL, LH,HL,HH coefficients are calculated using wavelet decomposition. The
simulation output of DWT for an image 1 is shown in Fig 4.11.
Figure 4.11 Simulation output of DWT for image 1
The DWT coefficients of an image 1 are LL(Low-Low), LH(Low-High),
HL(High-Low), HH(High-High) are shown in Fig 4.12.
Figure 4.12 DWT coefficients for image 1
Figure 4.13 Simulation output of DWT for image 2
The DWT coefficients of an image 2 are shown in Fig 4.14.
40
Figure 4.14 DWT coefficients for image 2
Discrete Wavelet Transform with Haar wavelet is simulated using VHDL.
Memory bock module is used to store the image pixel values, then the pixels are
read from memory through the data lines and wavelet coefficients are obtained.
The LL, LH,HL,HH coefficients are calculated using wavelet decomposition. The
pixel values and the corresponding coefficients of those pixel values are shown in
Fig 4.13. An address lines and data lines which are used in memory block are also
specified. Whenever the clock pin is high the process will be initialised and the
coefficients are determined.
41
Figure 4.15 Simulation output of DWT for image 3
Discrete Wavelet Transform with Haar wavelet is simulated using VHDL.
Memory bock module is used to store the image pixel values, then the pixels are
read from memory through the data lines and Wavelet coefficients are obtained.
The LL, LH,HL,HH coefficients are calculated using wavelet decomposition. The
pixel values and the corresponding coefficients of those pixel values are shown in
Fig 4.15. An address lines and data lines which are used in memory block are also
specified. Whenever the clock pin is high the process will be initialised and the
coefficients are determined. The DWT coefficients for an image 3 are shown in Fig
4.16.
42
Figure 4.16 DWT coefficients for image 3
Discrete Wavelet Transform with Haar wavelet is simulated using VHDL.
Memory bock module is used to store the image pixel values, then the pixels are
read from memory through the data lines and wavelet coefficients are obtained.
The LL, LH,HL,HH Coefficients are calculated using wavelet decomposition. The
Pixel values and the corresponding coefficients of those pixel values are shown in
Fig 4.17. An address lines and data lines which are used in memory block are also
specified. Whenever the clock pin is high the process will be initialised and the
coefficients are determined. The DWT coefficients for an image 4 are shown in Fig
4.18.
43
Figure 4.17 Simulation output of DWT for image 4
Figure 4.18 DWT coefficients for image 4
44
Figure 4.19 Simulation output of DWT for image 5
Discrete Wavelet Transform with Haar wavelet is simulated using VHDL.
Memory bock module is used to store the image pixel values, then the pixels are
read from memory through the data lines and wavelet coefficients are obtained.
The LL, LH,HL,HH coefficients are calculated using wavelet decomposition. The
Pixel values and the corresponding coefficients of those pixel values are shown in
Fig 4.19. An address lines and data lines which are used in memory block are also
specified. Whenever the clock pin is high the process will be initialised and the
coefficients are determined. The DWT coefficients for an image 5 are shown in
Fig 4.20.
45
Figure 4.20 DWT coefficients for image 5
4.4 SIMULATION OUTPUT FOR HUFFMAN ENCODING
The approximation coefficients are given as an input to Huffman data table
to obtain the Huffman data for each coefficient. Huffman code variable has an
input of codeword length and the compressed data is viewed as serially. Huffman
code for the approximation coefficients of an image 1 is shown in Fig 4.21.
Figure 4.21 Simulation output of Huffman coding for image 1
46
The approximation coefficients are given as an input to Huffman data table
to obtain the Huffman data for each coefficient. Huffman code variable has an
input of codeword length and the compressed data is viewed as serially. Huffman
code for the approximation coefficients of an image 2 is shown in Fig 4.22.
Figure 4.22 Simulation output for image 2
The approximation coefficients are given as an input to Huffman data table
to obtain the Huffman data for each coefficient. Huffman code variable has an
input of codeword length and the compressed data is viewed as serially. Huffman
code for the approximation coefficients of an image 3 is shown in Fig 4.23.
47
Figure 4.23 Simulation output for image 3
The approximation coefficients are given as an input to Huffman data table
to obtain the Huffman data for each coefficient. Huffman code variable has an
input of codeword length and the compressed data is viewed as serially.
48
The Huffman codewords for the approximation coefficients of an image 4 is
shown in Fig 4.24.
Figure 4.24 Simulation output for image 4
49
The approximation coefficients are given as an input to Huffman data table
to obtain the Huffman data for each coefficient. Huffman code variable has an
input of codeword length and the compressed data is viewed as serially. Huffman
code for the approximation coefficients of an image 5 is shown in Fig 4.25.
Figure 4.25 Simulation output for image 5
50
4.5 COMPRESSED VALUES AND COMPRESSION RATIO
The compressed values and compression ratio of an image 1 is shown Fig
4.26.
Figure 4.26 Compressed values and compression ratio for image 1
The compressed values and compression ratio of an image 2 is shown Fig 4.27.
Figure 4.27 Compressed values and compression ratio for image 2
51
The compressed values and compression ratio of an image 3 is shown Fig 4.28.
Figure 4.28 Compressed values and compression ratio for image 3
The compressed values and compression ratio of an image 4 is shown Fig 4.29.
Figure 4.29 Compressed values and compression ratio for image 4
52
The compressed values and compression ratio of an image 5 is shown
Fig 4.30.The parallel compressed values are converted into serial and these are
viewed serially by column wise. All the serial values are showing the
corresponding Huffman code for the approximation coefficients.
Figure 4.30 Compressed values and compression ratio for image 5
53
The Compression ratio for five different images are compared and these
ratio are shown in Table 5.1.
Table 5.1 Comparison of Compression ratio for five different images
The compression ratio for five different images are plotted as a graph. This
is shown in Fig 4.31.
Figure 4.31 Flow graph of compression ratio for five different images
54
Images Compression ratio
Desert 0.9478
Hydrangeas 0.9389
Lighthouse 0.9532
Penguins 0.9524
Tulips 0.9536
CHAPTER 5
CONCLUSION
In this work, an efficient compression technique that uses Huffman
encoding for the approximation coefficients of the given images has been
successfully developed. In the first stage, the discrete wavelet transform is
performed using Haar wavelet filter coefficients. The DWT coefficients are
approximation and detail coefficients. These coefficients are determined using
wavelet decomposition. In the second stage, the Huffman encoding for the
approximation coefficients are performed. The compressed values are viewed
serially by converting the parallel values. The Huffman code for each coefficient is
determined.
The performance of the proposed technique is evaluated in terms of
compression ratio for five different images. It is found that the compression ratio
has decreased significantly as only approximation coefficients are considered as
the same time the quality of image has been compromised as detail coefficients
are left out. The proposed lossy compression technique is highly suitable for
applications like video conferencing during the transmission of images through an
internet but not that suitable for medical image transmission also the compression
ratio can be further reduced by incorporating quantization of the approximation
coefficients.
55
CHAPTER 6
BIBLIOGRAPHY
[1] Angelopoulou. M, Masselos. K, Cheung. P and Andreopoulos. Y (2007), “A comparison of 2-D discrete wavelet transform computation schedules on FPGAs,” in Proc. IEEE Int. Conf. Field Programmable Technology (FPT), Bangkok, Tailand, pp. 181–188.
[2] Averbuch. A, Lazar. D and Israeli. M (1996), “Image compression using wavelet transform and multiresolution decomposition. ” IEEE Transactions on Image Processing, vol. 5, no. 1, pp. 4-15.
[3] Chao Cheng (2008), Member, IEEE “High-Speed VLSI Implementation of 2-D Discrete Wavelet Transform,” IEEE Trans, Signal Processing, Vol. 56, No. 1.
[4] Chengjun Zhang, Chunyan Wang (2010), Senior Member, IEEE” “A Pipeline VLSI Architecture for High-Speed Computation of the 1-D Discrete Wavelet Transform,” IEEE Transactions On Circuits and Systems—I: Regular Papers, Vol. 57, No. 10.
[5] Ching-Hsien Chang, Chin-Liang Wang (2000), Member, IEEE “Efficient VLSI Architectures for Fast Computation of the Discrete Fourier Transform and Its Inverse,” IEEE Transactions On Signal Processing, Vol. 48, No. 11.
[6] Chrysytis. C and Ortega. A (2000), “Line-based, reduced memory, waveletimage compression,” IEEE Trans. Circuits Syst. Video Technol., vol. 9, no. 3, pp. 378–389.
[7] Grzesczak. A, Mandal. M. K and Panchanathan. S (1996), “VLSI implementation of discrete wavelet transform,” IEEE Trans. Very Large ScaleIntegr. (VLSI) Syst., vol. 4, no. 4, pp. 421–433.
[8] Mallat. S (2009), “A theory for multiresolution signal decomposition : The wavelet representation, ” IEEE Trans. Pattern Anal. and Machine Intell.
56
[9] Mansouri. A (2009) “An Efficient VLSI Architecture and FPGA Implementation of High-Speed and Low Power 2-D DWT for (9, 7) Wavelet Filter,” IJCSNS International Journal of Computer Science and Network Security, VOL.9 No.3.
[10] Raghunath. S and Aziz. S. M (2006), “High speed area efficient multi-resolution 2-D 9/7 filter DWT processor,” in Proc. Int. Conf. Very Large Scale Integration (IFIP), vol. 16–18, pp. 210–215.
[11] Rioul. O and Vetterli. M (1991), “Wavelets and signal processing,” IEEE Signal Processing Magazine, vol. 8, no.4, pp. 14-38.
[12] Sunil kumar. V. V (2012) “Image Compression Techniques by using Wavelet Transform,” Journal of International Engineering and Applications ISSN 2224-5782 (print) ISSN 2225-0506 (online) Vol 2, No.5.
.
57