1 / 29

MPEG-1 Video Coding Standard

MPEG-1 Video Coding Standard. Jianping Fan. Department of Computer Science. University of North Carolina at Charlotte. Charlotte, NC 28223. jfan@uncc.edu. http://www.cs.uncc.edu/~jfan. 1. What does MPEG mean?. MPEG: Moving Picture Experts Group. 2. Why we do not use MJPEG?. 12. 13.

Télécharger la présentation

MPEG-1 Video Coding Standard

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. MPEG-1 Video Coding Standard Jianping Fan Department of Computer Science University of North Carolina at Charlotte Charlotte, NC 28223 jfan@uncc.edu http://www.cs.uncc.edu/~jfan

  2. 1. What does MPEG mean? MPEG: Moving Picture Experts Group 2. Why we do not use MJPEG? 12 13 14 • Spatial correlations among neighboring pixels! • Temporal correlations among neighboring frames!

  3. 3. Why we need MPEG? Temporal Redundancy Exploit temporal relationship among frames for coding! save our money for: a. Storage space; b. Bandwidth CIF: 352*288 MPEG Frame rate: 25f/s 1.5Mbits/s Space: ~21.6Mbits/s

  4. 4. MPEG Video Structure Temporal relationships could be in short period! GOP 1 GOP 2 GOP 3 GOP 4 time Why we need this? I B B P B B P B B B P GOP

  5. 4. MPEG Video Structure 16*16 8*8 block macroblock frame Universal structure is very important for universal decoder!!

  6. 5. MPEG-1 Encoder MPEG-1 has defined three frame coding types: I, P, B. I frame: Intra-coding frame P frame: motion-based predictive coding frame B frame: motion-based bidirectional predictive coding frame The difference between I and P or B: I can be encoded/decoded without reference The difference between P and B: P can be encoded/decoded with one reference

  7. 5. MPEG-1 Encoder DCT Q VLC Buffer 01001…. Q: quantization IQ ME IDCT IDCT IQ VLC Buffer 01001…. ME: motion estimation ME IQ: reverse quantization

  8. 5. MPEG-1 Encoder I B P

  9. 6. How to Encode I Frame? slice Y block DCT U V macroblock Entropy coding 10010100010…………

  10. 6. How to Encode I Frame? a. Color Space (1) RGB: display (2) YUV: coding (3) CIE: more close to human vision b. DCT (Discrete Cosine Transformation) 2550 0 0 0 0 0 0 255 255 255 255 255 255 255 255 0 0 0 0 0 0 0 0 255 255 255 255 255 255 255 255 DCT 0 0 0 0 0 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0 0 0 0 0 0 0 0 255 255 255 255 255 255 255 255 0 0 0 0 0 0 0 0 255 255 255 255 255 255 255 255 0 0 0 0 0 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0 0 0 0 0 0 0 0

  11. 6. How to Encode I Frame? b. DCT (Discrete Cosine Transformation) 2550 0 0 0 0 0 0 255 255 255 255 255 255 255 255 0 0 0 0 0 0 0 0 255 255 255 255 255 255 255 255 DCT 0 0 0 0 0 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0 0 0 0 0 0 0 0 255 255 255 255 255 255 255 255 0 0 0 0 0 0 0 0 255 255 255 255 255 255 255 255 0 0 0 0 0 0 0 0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 0 0 0 0 0 0 0 0

  12. 6. How to Encode I Frame? 255 217 120 110 0 0 0 0 7 2 2 1 0 0 0 0 120 110 0 0 0 0 0 0 5 3 0 0 0 0 0 0 DCT 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 0 120 0 0 0 0 0 0 0 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 0 0 0 0 0 0 0 0 Zigzag scale Quantization (7,0), (5,0), (2,0), (2,0), (3,4), (1,4), (1,41) Q(u) = integer round (u/scale) Entropy coding

  13. 6. How to Encode I Frame?

  14. 6. How to Encode I Frame? Entrpoy coding: Code probability 1 1 Pc=1/2 1 01 Pc=1/4 0 1 001 Pc=1/8 0 0 000 Pc=1/8 Huffman Tree

  15. 7. How to Encode P Frame? Motion-based prediction I or P frame Current P frame I B B P B B P B B P

  16. 7. How to Encode P Frame? Motion compensation: motion vectors + errors

  17. 7. How to Encode P Frame? Motion estimation: a. Find the reference block at the same position (x,y) (x,y) Reference Frame Current Frame I, P blocks & Skip

  18. 7. How to Encode P Frame? b. Take the reference block as the search center

  19. 8. How to Encode B Frame? Forward prediction Backward prediction Previous reference Current frame Future reference I B B P B B P

  20. 8. How to Encode B Frame? Why we need B frame? Higher compression ratio I, P, B blocks & Skips

  21. 8. How to Encode B Frame? Why we cannot put too much B frames? Display order: 1 2 3 4 5 6 7 8 9 10 11 12 13 I B B P B B P B B P B B P Encoding order: 1 4 2 3 7 5 6 10 8 9 13 11 12 I P B B P B B P B B P B B Buffer Size: 3 frames

  22. 9. How to Design MPEG Decoder? Video sequence Sequence header Sequence end code Sequence layer GOP GOP GOP GOP GOP header GOP layer I-frame P-frame B-frame B-frame Picture header slice slice slice Picture layer Slice header macroblock macroblock Slice layer Macroblock header Macroblock layer Block(0) Block(1) Block(5)

  23. 9. How to Design MPEG Decoder? a. Search for the start codes: Sequence header code: 0x000001B5 32bits Sequence end code: 0x000001B7 32bits Group_start_code: 0x000001B8 32bits Picture_start_code: 0x00000100 32bits Slice_start_code: 0x000001AF 32bits

  24. 9. How to Design MPEG Decoder? b. Functions for decoding the video data: Sequence header() Sequence_start_code 32 Horizontal size 12 12 Vertical size 4 Pel_aspect_ratio 4 Picture_rate 18 Bit rate Marker_bit 1 Buffer_size 10 Q table 22 Quantization table Done

  25. 9. How to Design MPEG Decoder? Group_of_picture () Group_start_code 32 Drop_frame_flag 1 Time_code_hours 5 Time_code_minutes 6 Market_bit 1 Time_code_seconds 6 6 Time_code_pictures Close_gop 1 1 Broken_link Picture( ) Done

  26. 9. How to Design MPEG Decoder? Picture ( ) 32 Picture_start_code 10 Temporal_reference 3 Picture_coding_type 16 Decoding_delay 3 Forward_vector_type 3 Backward_vector_type Slice( ) Done

  27. 9. How to Design MPEG Decoder? Slice ( ) 32 Slice_start_code 5 Quantization scale Macroblock ( ) Done

  28. 9. How to Design MPEG Decoder? Macroblock ( ) 11 Macroblock_escape Macroblock_address_increase 1-11 Macroblock_type 1-6 5 Quantizer_scale Motion_vector ( ) 3-9 Coded_block_pattern Block (i) Done

  29. 10. Where you can find MPEG? a. http://www.mpeg.org b. http://www.cs.wayne.edu/~dil/research Question: If you are offered a job on designing MPEG decoder, how you can do? Show me the video frames from 1228 to 1338? IBM, Microsoft, Intel, NEC, Cisco, Eastman Kodak, ……, .com

More Related