jpeg using baseline method2
TRANSCRIPT
-
8/8/2019 JPEG Using Baseline Method2
1/5
IMPLEMENTATION OF JPEG ENCODER WITH BASE LINE METHOD
USING LOW COST FPGA
V. Srinivasa rao1,G.V.H. Prasad
2, M. Prema Kumar
3, T.Baby Priyanka
4, M.Pradeep
5
1, 2,3,4,5
ECE Dept. Shri Vishnu Engg College for Women, Bhimavaram, A.P., INDIA.
Mail id:[email protected]
ABSTRACT: Image compression is an importanttopic in commercial, industrial, and academic
applications. Whether it be in commercial
photography, industrial imaging, or video, digital
pixel information can comprise considerably large
amounts of data. Management of such data can
involve significant overhead in computational
complexity, storage, and data processing. Typical
access speeds for storage mediums are inversely
proportional to capacity. Through datacompression, such tasks can be optimized. Theimplementation of this project was successful on
achieving significant compression ratios. The sample
images chosen showed different degrees of contrast
and in detail to show how the compression affected
high frequency components within the images. The
throughput of the design excelled in the FPGA core.
However, inherent limitations in the interface to the
FPGA limited the overall performance of the design.The JPEG algorithm was chosen for this paper as it
is well defined and highly recognizable. JPEG
provides a baseline compression algorithm that can
be modified in numerous ways to fit any desiredapplication.
Key words: JPEG, FPGA, Base-line method.
I.INTRODUCTION
Typically image and video compressors and
decompresses (CODECS) are performed mainly in
software as signal processors can manage these
operations without incurring too much overhead in
computation. However, the complexity of these
operations can be efficiently implemented in
hardware. Hardware specific CODECS can beintegrated into digital systems fairly easily .Many
complex systems in communications, military and
medical and other applications are first simulated or
modeled using floating-point data-processing, using
C or MATLAB software. However, the final
implementation is nearly always performed using
fixed-point or integer arithmetic .Previously a lack
of support with a FPGA tool suites made floating-
point arithmetic an unattractive option for the
FPGA designer. The key to efficient FPGA
implementation of complex floating-point functions
is to use multiplier-based algorithms. To compress
data, it is important to recognize redundancies in
data, in the form of coding redundancy, inter-pixel
redundancy, and psycho-visual redundancy. Data
redundancies occur when unnecessary data is used
to represent source information. Compression is
achieved when one or more of these types of
redundancies are reduced.Intuitively, removingunnecessary data will decrease the size of the data,
without losing any important information. However,
this is not the case for psycho-visual redundancy.
The sequential DCT based mode of operation
comprises the baseline JPEG algorithm. This
technique can produce very good compression
ratios, while sacrificing image quality. The
sequential DCT based mode achieves much of its
compression through quantization, which removes
entropy from the data set. Although this baseline
algorithm is transform based, it does use some
measure of predictive coding called the differential
pulse code modulation (DPCM). Progressive DCTbased JPEG compression actually uses two
complimentary coding methods. The goal of this
extension is to display low quality images during
Compression which successively improve. The first
method for such a technique is known as spectral-
selection. This implies that data is compressed in
bands.The first band contains DC components and a
very few AC components to get an image that is
somewhat discernable. The second method
employed is known as successive approximation.
Baseline JPEG compression has some configurable
portions, such as quantization tables, and Huffman
tables, which can individually be specified in theJPEG file header.
The rest of the paper is organized as follows:
Section II describes the architecture of the proposed
baseline method for JPEG Encoder. Section III
discusses the implementation of the algorithm.
Section IV presents the results of applying the
-
8/8/2019 JPEG Using Baseline Method2
2/5
Encoder to test images. Finally, section V states the
work conclusion.
II.ARCHITECTURE
1. DCT based JPEG Encoder
A block diagram of the proposed DCT based
JPEG encoder shown figure 1.
Figure1: DCT based JPEG Encoder
The basic JPEG Encoder consists of Discrete
Cosine Transform (DCT), The Quantizer, The run-
length encoder and the Huffman Encoder.
2. Quantization and rounding
The process of Quantization and rounding to nearby
integer is shown in Figure 2.
Figure 2: Quantization and rounding
The quantization and rounding module will
quantize each of the DCT zigzag coefficients, and
round the result to the nearest whole number. This
unit is pipelined with 12 stages, which supports 12-
bit inputs, suitable for the DCT output. The division
takes place by using a signed by unsigned non-
restoring divider. The algorithm will initially use the
dividend as the quotient, shift it and based on the
sign, will add or subtract the divisor. This process is
repeated to produce a quotient and remainder. The
remainder is not important as the purpose of
quantization is to scale the data element to be on a
specific quantization level. The signed by unsigned
non-restoring divider, at the lowest level is an un-
signed non-restoring divider. The module where this
is instantiated has a shift register which stores the
sign of what the quotient will be. After the sign is
applied to the quotient, the least significant bit is
used to round the result. This is because the radix
point of the result lies one bit left of the least
significant bit. If the least significant bit is equal toone, the quotient is rounded up, and similarly
rounded down if the least significant bit is zero. This
architecture is depicted in figure 2.
3. Modular Addressing
As the JPEG design was modularized, there was
a fair level of testability designed into it, as shown in
figure 3. Through the control register, the input and
output module can be selected. This was a very
useful debugging tool. In fact, the entire module can
be bypassed if a specific address is set in the control
register.
Figure 3: Modular Addressing
-
8/8/2019 JPEG Using Baseline Method2
3/5
For visibility and controllability into the design,
status and control registers were added. The control
register is a general purpose register that has
numerous bits that are used for enabling and
disabling certain functions. Status registers are used
to represent the current state of the system.
4. FPGA Overview
The FPGA core which is used for the
implementation of JPEG encoder is shown in figure
4. The FPGA is composed of two main systems.
First is the FIFO interface to the DSP. The FIFO
interface is designed to allow for high speed data
transactions in an asynchronous environment.
Additionally an interrupt source state machine is
associated with the FIFO interface to assist in a sort
of handshaking between the DSP and FPGA. The
second portion of the design is the JPEG encoding
core. The JPEG encoder core runs on a 25 MHz
clock and is fully synchronous, pipelined in stages,
and employs parallel computation to help increase
throughput.
Figure 4: FPGA Core over view.
III. IMPLEMENTATION
The proposed JPEG encoder using baseline
method was implemented on the low-cost Xilinx
Spartan-3 XC3S400.The results are given in table 1
for the DCT weight memory width 16 bits. As given,
with the exception of BRAMS much less than half of
the available FPGA resources were utilized. The
development time of the proposed JPEG encoder
was greatly reduced by using co-emulation for
design testing and verification.
Table 1: Synthesis of JPEG encoder for Xilinx
Spartan-3 XC3S400 for DCT weight memory width
of size 16 bits.
FPGA Resource JPEG-16
Slices 623(28%)
Flip Flops 423(12%)
IOBs 89(45%)
BRAMS 10(62%)
4 input LUTs 1023(28%)
8*8 multipliers 3(18%)
Performance 37.12MHz
IV. RESULTS
The test results for various images such as Lena,Baboon is shown in table 2.
Image Aspect
ratio
Input
(Bytes)
Output
(Bytes)
Compression
Lena 200X200 120015 9411 12.75
Baboon 512X512 786448 31262 25.16
Peppers 512X512 786448 28033 28.05
Table 2: Test results
Figure 5: Image: Baboon Source
-
8/8/2019 JPEG Using Baseline Method2
4/5
Figure 6: Image: Baboon Result
Figure 7: Image: Lena Source
Figure 8: Image: Lena Result
V. CONCLUSION
In the process of developing this project,
there were several ideas that were never integrated
into the design. As this is the JPEG baseline
algorithm, there are manyextensions. The building
blocks used in this design can be utilized in the
JPEG extensions, as well as other compression
algorithms. Also, there are many optimizations
which can be performed on this design to improve
throughput.Currently, the way this implementationruns is to encode the image components sequentially.
This can potentially lower the time required to
encode a color image. The quantization tables canbe scaled according to a quality factor selected by
the user. This has a direct impact on compression
ratios. This will allow a user to set the desired level
of compression for a given application.Work needsto be done to optimize the FIFO interface to the
encoder. This interface must be improved to help
achieve higher throughput, as right now, the current
interrupt driven DMA transfers are sub- optimal, as
seen from the experimental results .Motion JPEGMotion JPEG is arguably the most interesting
application to this project. Simulation results show
that the throughput of the FPGA encoder core is
fast enough to achieve motion JPEG required
speeds. This project would likely require a daughter
circuit board to mate to the I/O of the FPGA pinned
out on the PLogic PCI card. This daughter board
would likely have a camera, and memory, which
-
8/8/2019 JPEG Using Baseline Method2
5/5
could allow for multiple data paths in sending data
to the encoder, and retrieving data to store into
memory.
REFERENCES
[1] Iain Richardson. Video Codec Design -Developing Image and Video Com-pression Systems.
Copyright by John Wiley & Sons Ltd. 2002 (ISBN
0471485535).
[2] Peter Symes. Video Compression Demysteed.
Copyright by The McGraw-Hill Companies, Inc.
2001 (ISBN 0071363246).
[3] Gonzalez Woods. Digital Image Processing.
Copyright by Prentice Hall, Inc.2002 (ISBN
0201508036).
[4] John Watkinson. The Art of Digital Video.
Copyright by John Watkinson, 2000 (ISBN
0240512871).
[6] Weidong Kou. Digital Image Compression -
Algorithms and Standards.Copyright by Kluwer
Academic Publishers, 1995 (ISBN 079239626X).
[7] Netraveali Haskell. Digital Pictures -
Representation, Compression and Standards.
Copyright by ATT Bell Laboratories, 1995 (ISBN
030644917X).
[8] Anil K. Jain. Fundamental of Digital Image
Processing. Prentice-Hall, 1989
[9]S.Hasu,S.Mathew,M.Andres,B.Zeydel,V.Oklobdz
ija,R.Krishnamuthy,and S.Borkar,A 110 GOPS/W
16-bit multiplier and reconfigurable PLA loop in 90-
nm CMOS, IEEE journal of Solid State
Circuits,pp.256-264,2006.
[10] C.Wait, IBM Power PC 440 FPU with complex
arithmeticextensions,IBMJ.Res&ev.,vol.49,no.2/3,p
p.249-254,March/may 2005.
[11] K. R. Rao and P. Yip, Floating Point FPGA: An
Architecture and Modeling, London, U. K.,
Academic Press, 1990.
[12] J.Rabaey, A.Chandrakasan, and B.Nikolic,
Digital integrated Circuits A Design Perspective.
Prentice-Hall, 2002.
[13] M.Beauchamp, S.Hauck, K.Underwood, and
K.Hemmert. Embedded floating point units in
FPGAS, in Proc.FPGA, 06, ACM Press, 2006.
[14] G.K.Wallace,The JPEG still compression
standard.Commun.ACM.vol. 34,pp.30-
44,Apr.1991.
[15] R.deQueiroz, C.Choi, Y.Huh and K.Rao,
Wavelet transforms in a JPEG-like image coder,
IEEE Tran.Circuits Syst.Video.Technol., vol.7,
pp.419-424, Apr.1997.
[16] Z.Xiong, O.Guleryuz and M.T. Orchard, A
DCT- based embedded image coder , IEEE Signal
Processing Let., vol. 3,pp.289-290.Nov.1996.
[17] T.Acharya and Ping-Sing Tsai, JPEG2000
Standard for Image Compression Concepts,algorithms and VLSI Architectures. John Wiley &
Sons press,2005.
[18] E.farzad, C.Matthieu, and W.stefan, JPEG
versus JPEG2000:an objective comparison of image
encoding quality, SPIE Proceedings ,vol
5558,pp.300-308,2004.