Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

IMPLEMENTATION OF JPEG ENCODER WITH BASE LINE METHOD

USING LOW COST FPGA


V. Srinivasa rao1, G.V.H. Prasad2, M. Prema Kumar3, T.Baby Priyanka4, M.Pradeep5
1, 2,3,4,5
ECE Dept. Shri Vishnu Engg College for Women, Bhimavaram, A.P., INDIA.

Mail id:vemu1974@gmail.com

ABSTRACT: Image compression is an important FPGA designer. The key to efficient FPGA
topic in commercial, industrial, and academic implementation of complex floating-point functions
applications. Whether it be in commercial is to use multiplier-based algorithms. To compress
photography, industrial imaging, or video, digital data, it is important to recognize redundancies in
pixel information can comprise considerably large data, in the form of coding redundancy, inter-pixel
amounts of data. Management of such data can redundancy, and psycho-visual redundancy. Data
involve significant overhead in computational redundancies occur when unnecessary data is used
complexity, storage, and data processing. Typical to represent source information. Compression is
access speeds for storage mediums are inversely achieved when one or more of these types of
proportional to capacity. Through data redundancies are reduced.Intuitively, removing
compression, such tasks can be optimized. The unnecessary data will decrease the size of the data,
implementation of this project was successful on without losing any important information. However,
achieving significant compression ratios. The sample this is not the case for psycho-visual redundancy.
images chosen showed different degrees of contrast
and in detail to show how the compression affected The sequential DCT based mode of operation
high frequency components within the images. The comprises the baseline JPEG algorithm. This
throughput of the design excelled in the FPGA core. technique can produce very good compression
However, inherent limitations in the interface to the ratios, while sacrificing image quality. The
FPGA limited the overall performance of the design. sequential DCT based mode achieves much of its
The JPEG algorithm was chosen for this paper as it compression through quantization, which removes
is well defined and highly recognizable. JPEG entropy from the data set. Although this baseline
provides a baseline compression algorithm that can algorithm is transform based, it does use some
be modified in numerous ways to fit any desired measure of predictive coding called the differential
application. pulse code modulation (DPCM). Progressive DCT
based JPEG compression actually uses two
Key words: JPEG, FPGA, Base-line method. complimentary coding methods. The goal of this
extension is to display low quality images during
I.INTRODUCTION Compression which successively improve. The first
method for such a technique is known as spectral-
selection. This implies that data is compressed in
Typically image and video compressors and
bands.The first band contains DC components and a
decompresses (CODECS) are performed mainly in
very few AC components to get an image that is
software as signal processors can manage these
somewhat discernable. The second method
operations without incurring too much overhead in
employed is known as successive approximation.
computation. However, the complexity of these
Baseline JPEG compression has some configurable
operations can be efficiently implemented in
portions, such as quantization tables, and Huffman
hardware. Hardware specific CODECS can be
tables, which can individually be specified in the
integrated into digital systems fairly easily .Many
JPEG file header.
complex systems in communications, military and
medical and other applications are first simulated or
         The rest of the paper is organized as follows:
modeled using floating-point data-processing, using
C or MATLAB software. However, the final Section II describes the architecture of the proposed
implementation is nearly always performed using baseline method for JPEG Encoder. Section III
fixed-point or integer arithmetic .Previously a lack discusses the implementation of the algorithm.
of support with a FPGA tool suites made floating- Section IV presents the results of applying the
point arithmetic an unattractive option for the
Encoder to test images. Finally, section V states the The quantization and rounding module will
work conclusion. quantize each of the DCT zigzag coefficients, and
round the result to the nearest whole number. This
II.ARCHITECTURE 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-
1. DCT based JPEG Encoder
restoring divider. The algorithm will initially use the
dividend as the quotient, shift it and based on the
A block diagram of the proposed DCT based
sign, will add or subtract the divisor. This process is
JPEG encoder shown figure 1. 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 to
one, the quotient is rounded up, and similarly
rounded down if the least significant bit is zero. This
architecture is depicted in figure 2.
Figure1: DCT based JPEG Encoder
3. Modular Addressing
The basic JPEG Encoder consists of Discrete
Cosine Transform (DCT), The Quantizer, The run- As the JPEG design was modularized, there was
length encoder and the Huffman Encoder. a fair level of testability designed into it, as shown in
figure 3. Through the control register, the input and
2. Quantization and rounding output module can be selected. This was a very
useful debugging tool. In fact, the entire module can
The process of Quantization and rounding to nearby be bypassed if a specific address is set in the control
register.
integer is shown in Figure 2.

Figure 2: Quantization and rounding


Figure 3: Modular Addressing
For visibility and controllability into the design, was greatly reduced by using co-emulation for
status and control registers were added. The control design testing and verification.
register is a general purpose register that has
numerous bits that are used for enabling and Table 1: Synthesis of JPEG encoder for Xilinx
disabling certain functions. Status registers are used Spartan-3 XC3S400 for DCT weight memory width
to represent the current state of the system. of size 16 bits.

FPGA Resource JPEG-16


4. FPGA Overview Slices 623(28%)
Flip Flops 423(12%)
The FPGA core which is used for the IOBs 89(45%)
implementation of JPEG encoder is shown in figure
BRAMS 10(62%)
4. The FPGA is composed of two main systems.
4 input LUTs 1023(28%)
First is the FIFO interface to the DSP. The FIFO
8*8 multipliers 3(18%)
interface is designed to allow for high speed data
transactions in an asynchronous environment. Performance 37.12MHz
Additionally an interrupt source state machine is
associated with the FIFO interface to assist in a sort IV. RESULTS
of handshaking between the DSP and FPGA. The
second portion of the design is the JPEG encoding The test results for various images such as Lena,
core. The JPEG encoder core runs on a 25 MHz Baboon is shown in table 2.
clock and is fully synchronous, pipelined in stages,
and employs parallel computation to help increase
Image Aspect Input Output Compression
throughput.
ratio (Bytes) (Bytes)
Lena 200X200 120015 9411 12.75
Baboon 512X512 786448 31262 25.16
Peppers 512X512 786448 28033 28.05

Table 2: Test results

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 Figure 5: Image: Baboon Source
development time of the proposed JPEG encoder
Figure 8: Image: Lena Result
Figure 6: Image: Baboon 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 many extensions. 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 implementation
runs is to encode the image components sequentially.
This can potentially lower the time required to
encode a color image. The quantization tables can
be 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 needs
to 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 JPEG
Motion JPEG is arguably the most interesting
application to this project. Simulation results show
that the throughput of the FPGA encoder core is
Figure 7: Image: Lena Source 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
could allow for multiple data paths in sending data [13] M.Beauchamp, S.Hauck, K.Underwood, and
to the encoder, and retrieving data to store into K.Hemmert. “Embedded floating –point units in
memory. FPGAS,” in Proc.FPGA, 06, ACM Press, 2006.

REFERENCES [14] G.K.Wallace,“The JPEG still compression


standard”.Commun.ACM.vol. 34,pp.30-
[1] Iain Richardson. Video Codec Design - 44,Apr.1991.
Developing Image and Video Com-pression Systems.
Copyright by John Wiley & Sons Ltd. 2002 (ISBN [15] R.deQueiroz, C.Choi, Y.Huh and K.Rao,
0471485535).
“Wavelet transforms in a JPEG-like image coder,”
[2] Peter Symes. Video Compression Demyste¯ed. IEEE Tran.Circuits Syst.Video.Technol., vol.7,
Copyright by The McGraw-Hill Companies, Inc. pp.419-424, Apr.1997.
2001 (ISBN 0071363246).
[16] Z.Xiong, O.Guleryuz and M.T. Orchard, “ A
[3] Gonzalez Woods. Digital Image Processing. DCT- based embedded image coder ,” IEEE Signal
Copyright by Prentice Hall, Inc.2002 (ISBN Processing Let., vol. 3,pp.289-290.Nov.1996.
0201508036).
[17] T.Acharya and Ping-Sing Tsai, JPEG2000
[4] John Watkinson. The Art of Digital Video. Standard for Image Compression Concepts,
Copyright by John Watkinson, 2000 (ISBN
algorithms and VLSI Architectures. John Wiley &
0240512871).
Sons press,2005.
[6] Weidong Kou. Digital Image Compression -
Algorithms and Standards.Copyright by Kluwer [18] E.farzad, C.Matthieu, and W.stefan, “JPEG
Academic Publishers, 1995 (ISBN 079239626X). versus JPEG2000:an objective comparison of image
encoding quality,” SPIE Proceedings ,vol
[7] Netraveali Haskell. Digital Pictures - 5558,pp.300-308,2004.
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.

You might also like