Presentation is loading. Please wait.

Presentation is loading. Please wait.

Implementing JPEG Encoder for FPGA ECE 734 PROJECT Deepak Agarwal.

Similar presentations


Presentation on theme: "Implementing JPEG Encoder for FPGA ECE 734 PROJECT Deepak Agarwal."— Presentation transcript:

1 Implementing JPEG Encoder for FPGA ECE 734 PROJECT Deepak Agarwal

2 Background: JPEG Encoder Main Components DCT (Discrete Cosine Transformation) Quantization Zigzag Scan DPCM on DC component RLE on AC Components Entropy Coding

3 Implementation Steps -Matlab generates the input stream from image -Divided into 8X8 blocks -Input to encoder is 8x8 blocks of data in RGB. One pixel per clock. Each component 8 bits -Convert from RGB to YCbCr (8 bits each for Y, Cb & Cr) -DCT for all the 8X8 blocks (Y, Cb, Cr seperately) Each element in 8x8 output block is 11 bit DCT converts spatial domain to frequency domain

4 Implementation continued -Quantization of Y, Cb and Cr components using Quantization Matrix (Q matrix can be varied) 11 bits output -Zig Zag Scan of each 8x8 block -DPCM for DC and Huffman Encoding using standard Huffman table -RLE and Huffman Encoding for AC components -The encoded stream coming from Y, Cb and Cr are combined to form final output stream -Matlab creates JPEG header to construct final JPEG image using output stream

5 Synthesis Setup Synthesis & Simulation : Quartus Language: Verilog HDL Target : Stratix IV FPGA Matlab : To create input RGB stream for testbench and JPEG file from output stream

6 Synthesis Results Resource Utilization Logic Utilization : 20% Total Registers : 31061 Total Pins : 67 Memory Block : <1% DSP block : 95%

7 Synthesis Results Performance Max Clk Freq(Standard Quantiztion Matrix) : 121MHz : Max Clk Freq(Q Matrix is all 1 ) : 124 MHz

8 Effect of Change in Quantization Matrix Quantization is the main Lossy Component Independent JPEG Group Quality factor(Qf) lies between 0 and 100 Formula for Scaling Factor (S) 5000/Q 1<Qf<50 200 – 2Q 50<Qf<100 QMatrix[i] = (stdQMatrix[i] * S + 50) /100 So If Qf = 25, S =200 & QMatrix[i] is approx. stdQMatrix[i] * 2 JPEG Standard Quantization

9 Testing Code with different Quantization Matrix Qf = 100Qf = 50 Qf = 25Qf = 10

10 Size Variation with Quality factor Quality Factor Size in KB 10067 7517 5011 257.5 104.5

11 Conclusion & Future work Synthesized JPEG encoder for FPGA with clk frequency of 124 MHz Trying to further optimize design for better performance Possible to select optimal huffman for better compression based on image Possible to use dynamic Quantization matrix based on image

12 Questions


Download ppt "Implementing JPEG Encoder for FPGA ECE 734 PROJECT Deepak Agarwal."

Similar presentations


Ads by Google