1 / 69

JPEG

JPEG. -595-. Motivations: Uncompressed video and audio data are huge. In HDTV, the bit rate easily exceeds 1 Gbps. --> big problems for storage and network communications. -596-.

fabian
Download Presentation

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. JPEG -595-

  2. Motivations: • Uncompressed video and audio data are huge. In HDTV, the bit rate easily exceeds 1 Gbps. --> big problems for storage and network communications. -596-

  3. 2. The compression ratio of lossless methods (e.g., Huffman, Arithmetic, LZW) is not high enough for image and video compression, especially when distribution of pixel values is relatively flat. -597-

  4. Spatial Redundancy Removal -- Intraframe coding (JPEG) • Spatial and temporal Redundancy Removal -- Intraframe and Interframe coding (H.261, MPEG) -598-

  5. What is JPEG ? • "Joint Photographic Expert Group". Voted as international standard in 1992. • Works with color and grayscale images, e.g., satellite, medical, ... -599-

  6. The JPEG standard for coding of digital images. • designed by the Joint Photographic Experts Group • a collaborative effort between ITU-T and ISO -600-

  7. It aims to support • compression of continuous-tone images • compression of still images -601-

  8. Adobe’s Postscript language for printing systems • The Raster Content portion of the ISO Office document architecture and interchange format -602-

  9. The ITU-T color facsimile standard • the European ETSI videotext standard • JPEG can also be used in coding of viode, Motion JPEG (UBR or internet) -603-

  10. JPEG overview • Encoding • Decoding -- Reverse the order -604-

  11. Major Steps • DCT (Discrete Cosine Transformation) • Quantization • Zigzag Scan • DPCM on DC component -605-

  12. Major Steps 5. RLE on AC Components 6. Entropy Coding -606-

  13. -607-

  14. -608-

  15. 1. Discrete Cosine Transform (DCT) • From spatial domain to frequency domain -609-

  16. The 64 (8 x 8) DCT basis functions -610-

  17. DEFINITIONS Forward Discrete Cosine Transform (DCT): -611-

  18. Inverse Discrete Cosine Transform (IDCT) -612-

  19. Computing the DCT Factoring reduces problem to a series of 1D DCTs -613-

  20. -614-

  21. -615-

  22. What is F[0,0]? -- define DC • and AC components -616-

  23. 2. Quantization F'[u, v] = round ( F[u, v] / q[u, v] ) Why ? -- To reduce number of bits per sample -617-

  24. Quantization Example: 101101 = 45 (6 bits). q[u, v] = 4 --> Truncate to 4 bits: 1011 = 11. Quantization error is the main source of the Lossy Compression. -618-

  25. Uniform quantization • Divide by constant N and round result (N = 4 or 8 in examples above). • Non powers-of-two gives fine control (e.g., N = 6 loses 2.5 bits) -619-

  26. Non-uniform Quantization • Eye is most sensitive to low frequencies (upper left corner), less sensitive to high frequencies (lower right corner) -620-

  27. In JPEG, each F[u,v] is divided by a constant q(u,v). • Table of q(u,v) is called quantization table. -621-

  28. Standard defines 2 default quantization tables, one for luminance, one for chrominance. -622-

  29. The Luminance Quantization Table q(u,v) 16 11 10 16 24 40 51 61 12 12 14 19 26 58 60 55 14 13 16 24 40 57 69 56 14 17 22 29 51 87 80 62 18 22 37 56 68 109 103 77 24 35 55 64 81 104 113 92 49 64 78 87 103 121 120 101 72 92 95 98 112 100 103 99 -623-

  30. The Chrominance Quantization Table q(u, v) 17 18 24 47 99 99 99 99 18 21 26 66 99 99 99 99 24 26 56 99 99 99 99 99 47 66 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 99 -624-

  31. The numbers in the above quantization tables can be scaled up (or down) to adjust the so called quality factor. Custom quantization tables can also be put in image/scan header. -625-

  32. 3. Zig-zag Scan • Why? -- to group low frequency coefficients in top of vector. • Maps 8 x 8 to a 1 x 64 vector -626-

  33. -627-

  34. 4. Differential Pulse Code Modulation (DPCM) on DC component • DC component is large and varied, but often close to previous value (like lossless JPEG). -628-

  35. Differential Pulse Code Modulation (DPCM) on DC component • Encode the difference from previous 8x8 blocks -- DPCM -629-

  36. 5. Run Length Encode (RLE) on AC components • 1x64 vector has lots of zeros in it -630-

  37. RLE on AC components • Encode as (skip, value) pairs, where skip is the number of zeros and value is the next non-zero component. • Send (0,0) as end-of-block sentinel value. -631-

  38. 6. Entropy Coding • Categorize DC values into SSS (number of bits needed to represent) and actual bits. • · --------------------· Value SSS · 0 0 · -1,1 1 · -3,-2,2,3 2 · -7..-4,4..7 3 · -------------------- -632-

  39. Entropy Coding • Example: if DC value is 4, 3 bits are needed. • Send off SSS as Huffman symbol, followed by actual 3 bits. -633-

  40. For AC components (skip, value), encode the composite symbol (skip,SSS) using the Huffman coding. • Huffman Tables can be custom (sent in header) or default. -634-

  41. Overview of the JPEG bitstream -635-

  42. -636-

  43. A "Frame" is a picture, • a "scan" is a pass through the pixels (e.g., the red component), • a "segment" is a group of blocks, • a "block" is an 8 x 8 group of pixels. -637-

  44. Frame header: • - sample precision (width, height) of image - number of components - unique ID (for each component) - horizontal/vertical sampling factors (for each component) - quantization table to use (for each component) -638-

  45. Scan header - Number of components in scan component ID (for each component) - Huffman table for each component (for each component) • Misc. (can occur between headers) - Quantization tables - Huffman Tables - Arithmetic Coding Tables Comments - Application Data -639-

  46. JPEG Modes • Baseline/Sequential -- the one that we described in detail • Lossless • Progressive • Hierarchical • "Motion JPEG" -- Baseline JPEG applied to each image in a video. -640-

  47. 1. Sequential Mode • Each image component is encoded in a single left-to-right, top-to-bottom scan. -641-

  48. Sequential Mode • Baseline Sequential Mode is a simple case of the Sequential mode: • It supports only 8-bit images (not 12-bit images) • It uses only Huffman coding (not Arithmetic coding) -642-

  49. -643-

  50. 2. Lossless Mode • A special case of the JPEG where indeed there is no loss. • Its block diagram is as below: -644-

More Related