1 / 54

Media Compression

Media Compression. You are Here. Encoder. Decoder. Middlebox. Receiver. Sender. Network. Why compress?. “Bandwidth Not Enough” “Disk Space Not Enough” Size of Uncompressed DVD Movie =. Why compress?. “Bandwidth Not Enough” “Disk Space Not Enough”

kaethe
Download Presentation

Media Compression

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. Media Compression

  2. You are Here Encoder Decoder Middlebox Receiver Sender Network

  3. Why compress? • “Bandwidth Not Enough” • “Disk Space Not Enough” • Size of Uncompressed DVD Movie =

  4. Why compress? • “Bandwidth Not Enough” • “Disk Space Not Enough” • Size of Uncompressed DVD Movie = 720 x 576 x 3 x 25 x 60 x 120 =208.6GB

  5. JPEG Compression

  6. Original Image (1153KB) 1:1

  7. Original Image (1153KB) 3.5:1

  8. Original Image (1153KB) 17:1

  9. Original Image (1153KB) 27:1

  10. Original Image (1153KB) 72:1

  11. Original Image (1153KB) 192:1

  12. Compression Ratio

  13. Magic of JPEG • Throw away information we cannot see • Color information • “High frequency signals” • Rearrange data for good compression • Use standard compression

  14. Discard color information Y V U

  15. Color Sub-sampling 4:4:4 4:2:0 4:2:2 4:1:1

  16. 4:2:2 Sub-sampling Y V U

  17. Original Image (1153KB) 4:2:0

  18. Original Image (1153KB) “4:1:0”

  19. Discrete Cosine Transform Demo

  20. Quantization DC 242 65 23 5 8 8 8 8 30 8 2 0 -54 -10 -4 -2 8 8 8 16 -6 -1 0 0 / = 13 6 3 5 8 8 16 32 1 0 0 0 2 1 -1 -2 8 16 32 64 0 0 0 0 Quantization Table AC

  21. -5 30 30 27 2 25 8 3 3 3 3 8 2 1 1 1 1 2 0 0 0 0 0 0 2 6 6 2 2 2 1 1 -1 -1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 4 4 4 4 1 0 0 0 0 0 0 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Differential Coding

  22. 27 3 1 0 2 1 0 0 4 0 1 0 0 0 0 0 Zig-zag ordering 27, 3, 2, 4, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0

  23. 27 3 1 0 2 1 0 0 4 0 1 0 0 0 0 0 Run-Length Encoding 27, 3, 2, 4, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 (27, 1) (3, 1) (2, 1), (4, 1), (1, 2), (0, 5), (1, 1), (0, 4)

  24. Idea: Motion JPEG • Compress every frame in a video as JPEG • DVD-quality video = 208.6GB • Reduction ratio = 27:1 • Final size = 7.7GB

  25. Video Compression

  26. Temporal Redundancy

  27. Motion Estimation

  28. Bi-directional Prediction

  29. Watch for Motion Vectors Demo

  30. H.261 P-Frame I-Frame

  31. MPEG-1 B-Frame

  32. MPEG Frame Pattern • Example display sequence: • IBBPBBP … • Example encoding sequence: • IPBBPBB

  33. Compression Ratio

  34. Sequence • sequence header: • width • height • frame rate • bit rate • :

  35. GOP: Group of Picture • gop header: • time • :

  36. Picture • pic header: • number • type (I,P,B) • :

  37. Picture

  38. Slice

  39. Macroblock

  40. Y Y Y Y Block U 1 Macroblock = V

  41. For I-Frame • Every macroblock is encoded independently (“I-macroblock”)

  42. For P-Frame • Every macroblock is either • I-macroblock • a motion vector + error terms wrt a prev I/P-frame (“P-macroblock”)

  43. For B-Frame • Every macroblock is either • I-macroblock • P-macroblock • a motion vector + error terms wrt a future I/P-frame • 2 motion vectors + error terms wrt a prev/future I/P-frame

  44. Review: MPEG structure • Sequence • GOP • Picture • Slice • Macroblock • Block

  45. MPEG Decoding (I-Frame) Entropy Decoding Dequantize 101000101 IDCT

  46. MPEG Decoding (P-Frame) Entropy Decoding Dequantize 101000101 IDCT Prev Frame +

  47. MPEG Decoding (B-Frame) Entropy Decoding Dequantize 101000101 Future Frame IDCT AVG Prev Frame +

  48. There are more.. • Half-pel Motion Prediction • Skipped Macroblock • etc.

More Related