Group No 5 1.Muhammad Talha Islam 2.Karim Akhter 3.Muhammad Arif 4.Muhammad Umer Khalid.

24
Group No 5 1.Muhammad Talha Islam 2.Karim Akhter 3.Muhammad Arif 4.Muhammad Umer Khalid

Transcript of Group No 5 1.Muhammad Talha Islam 2.Karim Akhter 3.Muhammad Arif 4.Muhammad Umer Khalid.

Page 1: Group No 5 1.Muhammad Talha Islam 2.Karim Akhter 3.Muhammad Arif 4.Muhammad Umer Khalid.

Group No 51.Muhammad Talha Islam

2.Karim Akhter

3.Muhammad Arif

4.Muhammad Umer Khalid

Page 2: Group No 5 1.Muhammad Talha Islam 2.Karim Akhter 3.Muhammad Arif 4.Muhammad Umer Khalid.

PROJECT TITLE

Huffman Implementation on FPGA and Its Application in Image Compression

Page 3: Group No 5 1.Muhammad Talha Islam 2.Karim Akhter 3.Muhammad Arif 4.Muhammad Umer Khalid.

INTERNAL

SIR UMAR TALHALECTURER – SSUET

TELECOMMUNICATION ENGINEERING DEPARTMENT

Page 4: Group No 5 1.Muhammad Talha Islam 2.Karim Akhter 3.Muhammad Arif 4.Muhammad Umer Khalid.

Contents

• Introduction

• Background

• JPEG

• Block diagram

• Huffman Algorithm

• Time Line

• Conclusion

Page 5: Group No 5 1.Muhammad Talha Islam 2.Karim Akhter 3.Muhammad Arif 4.Muhammad Umer Khalid.

Introduction

• Compression

To reduce the amount of data required to represent an image.

• Compression techniques

Lossy and Lossless

• Why Compression?

Communication and storage cost.

Constrains of bandwidth.

• Joint photograph Expert Group (JPEG).

• Application of Huffman coding. In JPEG

Page 6: Group No 5 1.Muhammad Talha Islam 2.Karim Akhter 3.Muhammad Arif 4.Muhammad Umer Khalid.

Background

• Multimedia Compression Standards

JPEG, TIF, GIF, PNG

• JPEG is widely used for still images

• Entropy coding

Huffman is used for lossless compression

• Using FPGA

Page 7: Group No 5 1.Muhammad Talha Islam 2.Karim Akhter 3.Muhammad Arif 4.Muhammad Umer Khalid.

JPEG

• JPEG is an image compression standard which was accepted as an international standard in 1992.

• Developed by the Joint Photographic Expert Group of the ISO/IEC for coding and compression of color/gray scale images.

• JPEG is lossy compression technique.

• Size depends on compression ratio.

Page 8: Group No 5 1.Muhammad Talha Islam 2.Karim Akhter 3.Muhammad Arif 4.Muhammad Umer Khalid.

Steps in JPEG

• The main steps in JPEG encoding are the following• Transform RGB to YUV or YIQ and subsample color

• DCT on 8x8 image blocks

• Quantization

• Zig-zag ordering and run-length encoding

• Entropy coding ( Huffman Coding)

Page 9: Group No 5 1.Muhammad Talha Islam 2.Karim Akhter 3.Muhammad Arif 4.Muhammad Umer Khalid.

Block Diagram for Image Transformation

Page 10: Group No 5 1.Muhammad Talha Islam 2.Karim Akhter 3.Muhammad Arif 4.Muhammad Umer Khalid.

JPEG Flow chart

RGB image

Transformation

RGB YCbCr

2-D DCTQuantizat

ion

Run length coding

Huffman coding

Quantization

Table

Huffman Table

Page 11: Group No 5 1.Muhammad Talha Islam 2.Karim Akhter 3.Muhammad Arif 4.Muhammad Umer Khalid.

Huffman Coding

• Developed by David Huffman.

• Uniquely and instantaneously decodable

• Huffman is the method of storing string of data and binary code

in efficient manner.

• Huffman is a lossless compression technique

• Huffman code will be always providing on the average code length

Which is less than any other code.

Run length coding

Huffman coding

Page 12: Group No 5 1.Muhammad Talha Islam 2.Karim Akhter 3.Muhammad Arif 4.Muhammad Umer Khalid.

Huffman Coding

• Contains smallest possible no of code symbols.

• Huffman code provides an optimized coding.

• As described in ICTs, in optimized coding, there should be:

The most occurring symbol must have smallest code word length.

In an optimum code the two symbols that occur least frequently will have same length

• Example

Page 13: Group No 5 1.Muhammad Talha Islam 2.Karim Akhter 3.Muhammad Arif 4.Muhammad Umer Khalid.

Huffman AlgorithmStart

Is current

symbol is part of tree?

Start with the leaf node

Is the current node

the most significant of

the block?

Increment the weight of node

Is the current

node equal to the root?

End

Continue with parent node

Generate new node for this symbol

Generate new node for NYA

Subordinate new nodes to the old NYA

no

yes

no

no

yes yes

yes

no

Exchange the node with most

significant node of block

Is the most significant

node a parent node?

Page 14: Group No 5 1.Muhammad Talha Islam 2.Karim Akhter 3.Muhammad Arif 4.Muhammad Umer Khalid.

Hardware-FPGA• Field Programmable Gate Arrays

• FPGA is integrated circuit designed to be configured by the customer or designer after manufacturing – hence “field Programmable”.

• Can be seen as “Soft” ASICs;

• Introduce a new computer paradigm;

• Enable the designers to implement algorithms directly in silicon.

• Make parallelism a key feature.

• Permit any required external interface to be established.

Page 15: Group No 5 1.Muhammad Talha Islam 2.Karim Akhter 3.Muhammad Arif 4.Muhammad Umer Khalid.

FPGA Architecture

• Static memory cells.• Volatile.• Essential component and generic FPGA.• Logic block usually based on LUTs.• I/O is interface between core of FPGA and

external devices.• Parallel processing• High Speed processing• Higher Power consumption• Any digital system can be implemented

Page 16: Group No 5 1.Muhammad Talha Islam 2.Karim Akhter 3.Muhammad Arif 4.Muhammad Umer Khalid.
Page 17: Group No 5 1.Muhammad Talha Islam 2.Karim Akhter 3.Muhammad Arif 4.Muhammad Umer Khalid.
Page 18: Group No 5 1.Muhammad Talha Islam 2.Karim Akhter 3.Muhammad Arif 4.Muhammad Umer Khalid.

• Developed and tested

• Applied JPEG

• Design of Huffman Algorithm

• Extraction of Huffman code and stream

• For the text file of the code

MATLAB Implementation

Page 19: Group No 5 1.Muhammad Talha Islam 2.Karim Akhter 3.Muhammad Arif 4.Muhammad Umer Khalid.

• Two main languages.

• Verilog – the C based language.

• Two types of variables; wire and reg.

• Initial and always block.

• Choice of an FPGA development board.

• Market stake holders of FPGA.

Verilog Programming Language

Page 20: Group No 5 1.Muhammad Talha Islam 2.Karim Akhter 3.Muhammad Arif 4.Muhammad Umer Khalid.

Time Line

Month Activity

January-February Preparation of proposal

March-June Literature Review

July-August Implementation on MATLAB

September Verilog Programming

October-November Design of algorithm in Verilog

December Implementing on FPGA

Page 21: Group No 5 1.Muhammad Talha Islam 2.Karim Akhter 3.Muhammad Arif 4.Muhammad Umer Khalid.

Conclusion

• JPEG is a compression lossy compression technique but Huffman man is a lossless compression technique.

• Huffman coding is an efficient source coding algorithm for source symbols that are not equally probable.

• Huffman provides uniquely decodable codes (prefix code).

• Implementing Huffman algorithm on FPGA is a better approach because

on FPGA hardware are designed for specific algorithm. End

Page 22: Group No 5 1.Muhammad Talha Islam 2.Karim Akhter 3.Muhammad Arif 4.Muhammad Umer Khalid.

Huffman Encoding Example

Page 23: Group No 5 1.Muhammad Talha Islam 2.Karim Akhter 3.Muhammad Arif 4.Muhammad Umer Khalid.

Appendix a- MATLAB test code

Click to open code text file

Page 24: Group No 5 1.Muhammad Talha Islam 2.Karim Akhter 3.Muhammad Arif 4.Muhammad Umer Khalid.

Thanks for Watching