1 / 36

Introduction to JPEG

http://en.wikipedia.org/wiki/JPEG. Introduction to JPEG. m5141153 Akram Ben Ahmed. Outline. Introduction Encoding Decoding Summary and Future work. Introduction. JPEG (Joint Photographic Experts Group) is one of the most widely used lossy compression method.

sabine
Download Presentation

Introduction to JPEG

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. http://en.wikipedia.org/wiki/JPEG Introduction to JPEG m5141153 Akram Ben Ahmed

  2. Outline • Introduction • Encoding • Decoding • Summary and Future work Research Paper Reading

  3. Introduction • JPEG (Joint Photographic Experts Group) is one of the most widely used lossy compression method. • JPEG has many standards and can be encoded in many ways. Research Progress Seminar

  4. Outline • Introduction • Encoding • Decoding • Summary and Future work Research Paper Reading

  5. Encoding: Color space transformation • The image should be converted first from RGB to YCrCb. • Y represents the brightness of the picture while Cr and Cb represent the red and bleu chrominance respectively. • This picture shows a color image and the Y, Cb and Cr elements of it. Research Progress Seminar

  6. Encoding: Color space transformation • The conversion is done by multiplying the pixels values of the RGB image by Y, Cr and Cb factors as shown below. Research Progress Seminar

  7. Encoding: Downsampling • In this step, the resolution of the Chroma components (Cr and Cb) is reduced. • This reduction came from the fact that human eyes detect the brightness change more than the color differences. Research Progress Seminar

  8. Encoding: Downsampling • The ratios at which the downsampling is ordinarily done for JPEG images are 4:4:4, 4:2:2 or 4:2:0 (most commonly) . Research Progress Seminar

  9. Encoding • The next process steps are done to each Y Cr Cb components separately. Research Progress Seminar

  10. Encoding: Discrete cosine transform • We divide first the image into 8x8 blocks. • If one block can’t be exactly represented in 8x8, the encoder must fill the remaining area of the incomplete blocks with some form of dummy data. Research Progress Seminar

  11. Encoding: Discrete cosine transform • Before computing the DCT of the 8×8 block, its values are shifted from a positive range (0-->255) to one centered around zero by subtracting the mid-point of the range (128 in our case)from the original block values. Research Progress Seminar

  12. Encoding: Discrete cosine transform m= Original Block matrix g= Resulted shifted matrix Research Progress Seminar

  13. Encoding: Discrete cosine transform • We perform now the 2D DCT given by: • u is the horizontal spatial frequency, for the integers 0<u<8. • v is the vertical spatial frequency, for the integers 0<v<8. • . • gx,yis the pixel value at coordinates (x,y) • Gu,v is the DCT coefficient at coordinates (u,v) Research Progress Seminar

  14. Encoding: Discrete cosine transform • The resulted DCT matrix G is: Research Progress Seminar

  15. Encoding: Quantization • This step consists of dividing each component in the frequency domain by a constant for that component, and then rounding to the nearest integer. • This makes the quantization the only lossy operation due to the rounding operation. Research Progress Seminar

  16. Encoding: Quantization • Assuming the following quantization matrix: Research Progress Seminar

  17. Encoding: Quantization • And that the quantization formula is: • The resulted rounded matrix is: Research Progress Seminar

  18. Encoding: Entropy coding • Involves arranging the image components in a "zigzag" order employing run-length encoding (RLE) algorithm that groups similar frequencies together, inserting length coding zeros, and then using Huffman coding on what is left. Research Progress Seminar

  19. Encoding: Entropy coding • The zigzag sequence for the above quantized matrix B is: Research Progress Seminar

  20. Encoding: Entropy coding • In order to encode the above generated coefficient pattern, JPEG uses Huffman encoding. • If we consider that an image can be divided into n 8x8 blocks {B1, B2, … Bn} and each block is represented by horizontal (x) and vertical (y) coordinates, we distinguish 2 different types of encoding. Research Progress Seminar

  21. Encoding: Entropy coding • Baseline sequential encoding: Takes the components of one single block then go to next block of the image. • Starting from i=1, the order of the zigzag encoding is Bi(0,0), B0(0,1), Bi(1,0), Bi(2,0), Bi(1,1), Bi(0,2), Bi(0,3), Bi(1,2). Then the next block (i+1) until Bn. Research Progress Seminar

  22. Encoding: Entropy coding • Progressiveencoding: Takes one single component for all the different blocks, then move to the next component. • The order of the zigzag encoding starts with Bi(0,0) for all the blocks {B1, B2, … Bn} then Bi(0,1) also for all the blocks. • JPEG has a special Huffman code word for ending the sequence prematurely when the remaining coefficients are zero. Research Progress Seminar

  23. Encoding: Entropy coding • Using this special code word: "EOB", the sequence becomes: Research Progress Seminar

  24. Encoding: Compression ratio and artifacts • One of the problems that can be found with JPEG, is some differences between the original and the resulted compressed image. • These differences are called artifacts and I should be fixed to assure a good compression quality. Research Progress Seminar

  25. Outline • Introduction • Encoding • Decoding • Summary and Future work Research Paper Reading

  26. Decoding • Decoding consists of doing all the encoding steps in reverse. Starting with DCT coefficient matrix of one single 8x8 block: Research Progress Seminar

  27. Decoding • Make entry-for-entry product with the same quantization Q matrix as in Encoding : Research Progress Seminar

  28. Decoding • Using the Inverse 2D-DCT expressed by: Research Progress Seminar

  29. Decoding • We round then the resulted values we can get the following matrix: Research Progress Seminar

  30. Decoding • As we did in the Encoding part, we should shift back the values by 128 to obtain : Research Progress Seminar

  31. Decoding • Since the previous steps are for one block, we should reassemble all the blocks together to form the complete image. • One way to check the quality of the compression is to compare the original image with the decompressed one. Research Progress Seminar

  32. Decoding • Subtracting the uncompressed resulted image from the original one we can obtain the following error matrix: Research Progress Seminar

  33. Decoding • Finally we can calculate the average absolute error to evaluate the decompression quality: Research Progress Seminar

  34. Outline • Introduction • Encoding • Decoding • Other • Summary and Future work Research Paper Reading

  35. Summary and Future work • In this article, JPEG was presented as a well known compression technique widely used in different image processing domains thanks to its simplicity and high flexibilitymaintaining a good compression quality. Research Progress Seminar

  36. Summary and Future work • Unfortunately this article doesn’t explain the steps after the Huffman coding and the buffering operation after this process. • As this part of the JPEG encoder is extremely important, I should investigate more about it as a future work. Research Progress Seminar

More Related