1 / 52

Video Encoding and Compression

Video Encoding and Compression. Incremental Steps: Getting to more High Definition. August 25, 2009. Justin Cardones Justin@CardonesConsulting.com (401) 441-6801. Agenda. MPEG-2 Background Deployment Techniques MPEG-4 & Transcoding A Few Ways to Get More HD. Compression.

kaia
Télécharger la présentation

Video Encoding and 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. Video Encoding and Compression Incremental Steps:Getting to more High Definition August 25, 2009 Justin Cardones Justin@CardonesConsulting.com (401) 441-6801

  2. Agenda • MPEG-2 Background • Deployment Techniques • MPEG-4 & Transcoding • A Few Ways to Get More HD

  3. Compression Familiar Examples

  4. Audio/Video Encoding 1 Analog-to-Digital Conversion 3 Encoding 4 6 Video or Audio Input Compressed Video or Audio 8 10 8 7 10 14 14

  5. Audio/Video Encoding 1 Analog-to-Digital Conversion 3 Encoding 4 6 Video or Audio Input Compressed Video or Audio 8 10 8 7 10 14 14 1 Digital-to-Analog Conversion 3 Decoding 4 6 8 10 8 7 10 14 14

  6. Going from Analog to Digital 1 Analog-to-Digital Conversion 3 4 6 Video or Audio Input 8 10 8 7 10 14 14

  7. SDI Video • Serial digital interface (SDI) • 270 MHz clock • 8-bit or 10-bit • Video data plus timing codes (SAV, EAV)

  8. SDI Ancillary Data Used for: • Embedded audio (PCM or compressed) • Captioning • Aspect ratio signaling • And more… Video SDI Data

  9. Audio Compression • MPEG Layer II (“MUSICAM”) • AC-3 (Dolby) • Advanced Audio Codec (AAC) Sample rate Bit rate 1 3 4 6 8 10 8 7 10 14 14

  10. CATV Channels 108.000 MHz 6 MHz 114.000 MHz 120.000 MHz 126.000 MHz 132.000 MHz 138.000 MHz 144.000 MHz 150.000 MHz 156.000 MHz 162.000 MHz 170.000 MHz

  11. CATV Channels 108.000 MHz QAM 256  38.8 Mbps 114.000 MHz QAM 120.000 MHz QAM 126.000 MHz QAM 64  27 Mbps 132.000 MHz 138.000 MHz 144.000 MHz 150.000 MHz 156.000 MHz 162.000 MHz 170.000 MHz

  12. CATV Channels QAM  38.8 Mbps QAM QAM SDI Digital Video 270 Mbps QAM

  13. CATV Channels 38.8 Mbps MPEG Video Compression SDI Digital Video 270 Mbps

  14. Digital Video System MPEG-2 Encoders Subscribers Multiplexer Program sources QAM Modulator CATV network

  15. Transporting MPEG • Transport Stream (TS) • Allows multiplexing • 188-byte packets

  16. Transport Rate • Overall rate of MPEG stream • Usually constant bit rate • Includes video + audio + data • Video can be CBR or VBR • Null packets

  17. Multiplexer MPEG-2 Encoders • Combines multiple programs • Adjusts control tables (PAT, PMT) • Splices advertisements • Rate shaping Multiplexer Program sources QAM Modulator CATV network

  18. QAM Modulator MPEG-2 Encoders • Rate shaping (limited) • Encryption • Forward error correction • Transmit on CATV channel Multiplexer Program sources QAM Modulator

  19. Equipment Interconnect Ethernet • UDP/IP protocol • 7 transport packets per Ethernet frame • 100Base-T or Gigabit

  20. MPEG Video Compression • Remove redundancy • Take advantage of human visual system

  21. MPEG Video Compression Step 1 • Filtering • Analog to digital conversion • More filtering Clean, noise-free signal  Best results

  22. MPEG Video Compression Step 2 • Divide image into 16x16 macroblocks

  23. MPEG Macroblocks 16 x 16 pixels 720 Each macroblock = • Four 8x8 luma blocks • Two 8x8 chroma blocks • 4:2:0 480 http://mia.ece.uic.edu/~papers/WWW/MultimediaStandards/chapter7.pdf (adapted)

  24. Frames vs. Fields Interlaced scanning • 2 fields per frame • MPEG supports field or frame encoding

  25. Film Mode • Movies filmed at 24 frames/sec • Converted to 30 frames/sec for TV • 1 out of 5 fields is a duplicate • Encoder can skip duplicate (save bits) 1 2 3 4 1 2 3 4 4

  26. MPEG Picture Types Three ways to encode a picture: • I (Intra-coded) • P (Predicted) • B (Bidirectionally predicted) I B B P B B

  27. I-frames • “Intra-coded” • Similar to JPEG image • Relatively large (# of bits) I B B P B B

  28. P-frames • “Predicted” • Changes from previous reference frame • Relatively small P I B B B B

  29. B-frames • “Bidirectionally predicted” • Changes from previous or next reference frame • Smallest B I B P B B

  30. Motion Estimation • For each macroblock: • Find similar 16x16 block in reference frame • Subtract them  Residual • Send motion vector and residual http://mia.ece.uic.edu/~papers/WWW/MultimediaStandards/chapter7.pdf

  31. I B B P B B P P B B B B Group of Pictures Example: • GOP length = 15 • I/P spacing = 3 I B B P B B

  32. Breaking the Pattern Fixed GOP = Fixed I/B/P pattern • Or encoder may insert I-frames • Scene changes • Splice points I B B P B B

  33. Video Quality GOP Length Shorter GOPs: • Lower latency • Faster recovery (not always) Longer GOPs: • Better video quality (at low bit rates) Recommended range: 12 - 18

  34. MPEG Transport Stream • Usually constant bit rate • Elementary streams can be CBR or VBR • Single or multiple programs • Each has clock reference (PCR)

  35. MPEG Transport Packet 47 1F FF 10 4 byte header + 184 byte payload = 188 bytes (Plus 16 error-correction bytes = 204 bytes)

  36. MPEG Transport Header 47 1F FF 10 47 1F FF 0 Sync byte PID (13 bits) Continuity counter (4 bits)

  37. MPEG Transport Stream PAT PMT Null packet Video packet Audio packet

  38. MPEG Tables Program Specific Information (PSI) • PAT = Program Association Table • PMT = Program Map Table • CAT = Conditional Access Table • NIT = Network Information Table

  39. PSI Tables http://www.iec.org/online/tutorials/test_dv/topic01.html

  40. DVB and ATSC Tables • Service Information (SI) • Program and System Information Protocol (PSIP) • Terrestrial and satellite networks • Electronic program guide • Real-time clock • Ratings MPEG PSI DVB SI ATSC PSIP

  41. Variable Bit Rate • Target bit rate range (min, max) • Target video quality • Bit rate changes to achieve target • Varies with time • Varies across program mix

  42. Variable Bit Rate “Easy” content: • News channels • Cartoons “Difficult” content: • Sports action • Quick scene changes

  43. Open-loop VBR Encoding Rate-Shaping Modulation

  44. Rate Shaping Goal: Fit streams in fixed-bandwidth channel • 38.8 Mbps (256-QAM) 38.8 Mbps

  45. Rate Shaping • Partially decode MPEG stream • Change quantization • Reconstruct stream • Favor high-priority channels

  46. Closed-loop VBR Closed-loop controller Bit rate assignments Complexity estimates Modulation Encoding

  47. All-CBR Architecture Modulation Encoding

  48. Ad Splicing • Ads are usually CBR • May need rate shaping

  49. Ad Splicing SCTE 35 Encoder Mux/Splicer QAM Ad stream Network Cue tones SCTE 104 CATV Network SCTE 30 Ad Server

  50. MPEG-2 vs. MPEG-4 http://www.balooga.com/mpeg4.php3

More Related