video encoding and compression

52
August 25, 2009 Video Encoding and Compression Justin Cardones [email protected] (401) 441-6801 Incremental Steps: Getting to more High Definition

Upload: kaia

Post on 11-Jan-2016

34 views

Category:

Documents


1 download

DESCRIPTION

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

TRANSCRIPT

Page 1: Video Encoding  and  Compression

August 25, 2009

Video Encoding and Compression

Justin [email protected]

(401) 441-6801

Incremental Steps:Getting to more High Definition

Page 2: Video Encoding  and  Compression

Agenda

MPEG-2 Background

Deployment Techniques

MPEG-4 & Transcoding

A Few Ways to Get More HD

Page 3: Video Encoding  and  Compression

Compression

Familiar Examples

Audio CD iPod Digital camera

Video DVD

Compressed? No Yes Yes Yes

Compression method

-- MP3, AAC JPEG MPEG-2

Page 4: Video Encoding  and  Compression

13468

1087

101414

Video or Audio Input

Audio/Video Encoding

Analog-to-Digital Conversion Encoding

Compressed Video or

Audio

Page 5: Video Encoding  and  Compression

13468

1087

101414

Video or Audio Input

Audio/Video Encoding

Analog-to-Digital Conversion Encoding

Compressed Video or

Audio

13468

1087

101414

DecodingDigital-to-Analog

Conversion

Page 6: Video Encoding  and  Compression

13468

1087

101414

Video or Audio Input

Going from Analog to Digital

Analog-to-Digital Conversion

Page 7: Video Encoding  and  Compression

SDI Video

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

Page 8: Video Encoding  and  Compression

SDI Ancillary Data

Used for: Embedded audio (PCM or compressed) Captioning Aspect ratio signaling And more…

SDI

Video

Data

Page 9: Video Encoding  and  Compression

Audio Compression

MPEG Layer II (“MUSICAM”) AC-3 (Dolby) Advanced Audio Codec (AAC)

13468

1087

101414

Sample rate Bit rate

Page 10: Video Encoding  and  Compression

CATV Channels

108.000 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

6 MHz

Page 11: Video Encoding  and  Compression

CATV Channels

108.000 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

QAM 256QAM

QAM

38.8 Mbps

27 MbpsQAM 64

Page 12: Video Encoding  and  Compression

CATV Channels

QAM

QAM

QAM

QAM

38.8 Mbps

SDI Digital Video

270 Mbps

Page 13: Video Encoding  and  Compression

CATV Channels

38.8 Mbps

SDI Digital Video

270 Mbps

MPEG Video Compression

Page 14: Video Encoding  and  Compression

Program sources

MPEG-2 Encoders

Multiplexer

QAM Modulator

CATV network

Subscribers

Digital Video System

Page 15: Video Encoding  and  Compression

Transporting MPEG

Transport Stream (TS) Allows multiplexing 188-byte packets

Page 16: Video Encoding  and  Compression

Transport Rate

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

Page 17: Video Encoding  and  Compression

Program sources

MPEG-2 Encoders

Multiplexer

QAM Modulator

CATV network

Multiplexer

• Combines multiple programs• Adjusts control tables (PAT, PMT)• Splices advertisements• Rate shaping

Page 18: Video Encoding  and  Compression

Program sources

MPEG-2 Encoders

Multiplexer

QAM Modulator

QAM Modulator

• Rate shaping (limited)• Encryption• Forward error correction• Transmit on CATV channel

Page 19: Video Encoding  and  Compression

Equipment Interconnect

Ethernet UDP/IP protocol 7 transport packets per Ethernet frame 100Base-T or Gigabit

Page 20: Video Encoding  and  Compression

MPEG Video Compression

Remove redundancy Take advantage of human visual system

Page 21: Video Encoding  and  Compression

MPEG Video Compression

Step 1 Filtering Analog to digital conversion More filtering

Clean, noise-free signal Best results

Page 22: Video Encoding  and  Compression

MPEG Video Compression

Step 2 Divide image into 16x16 macroblocks

Page 23: Video Encoding  and  Compression

MPEG Macroblocks

16 x 16 pixels

720

480

http://mia.ece.uic.edu/~papers/WWW/MultimediaStandards/chapter7.pdf (adapted)

Each macroblock =• Four 8x8 luma blocks• Two 8x8 chroma blocks• 4:2:0

Page 24: Video Encoding  and  Compression

Frames vs. Fields

Interlaced scanning 2 fields per frame MPEG supports field or frame encoding

Page 25: Video Encoding  and  Compression

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

Page 26: Video Encoding  and  Compression

MPEG Picture Types

Three ways to encode a picture: I (Intra-coded) P (Predicted) B (Bidirectionally predicted)

I B B P B B

Page 27: Video Encoding  and  Compression

I-frames

“Intra-coded” Similar to JPEG image Relatively large (# of bits)

I B B P B B

Page 28: Video Encoding  and  Compression

P-frames

“Predicted” Changes from previous reference frame Relatively small

I B B P B B

Page 29: Video Encoding  and  Compression

B-frames

“Bidirectionally predicted” Changes from previous or next reference

frame Smallest

I B B B BP

Page 30: Video Encoding  and  Compression

Motion Estimation

http://mia.ece.uic.edu/~papers/WWW/MultimediaStandards/chapter7.pdf

For each macroblock:• Find similar 16x16 block in reference frame• Subtract them Residual• Send motion vector and residual

Page 31: Video Encoding  and  Compression

BBPBBI

Group of Pictures

Example: GOP length = 15 I/P spacing = 3

BP BBP BBBPBBI

Page 32: Video Encoding  and  Compression

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

Page 33: Video Encoding  and  Compression

Shorter GOPs: Lower latency Faster recovery

GOP Length

(not always)

Video Quality

Recommended range: 12 - 18

Longer GOPs: Better video quality (at low bit rates)

Page 34: Video Encoding  and  Compression

MPEG Transport Stream

Usually constant bit rate Elementary streams can be CBR or VBR Single or multiple programs Each has clock reference (PCR)

Page 35: Video Encoding  and  Compression

47

MPEG Transport Packet

4 byte header + 184 byte payload = 188 bytes

(Plus 16 error-correction bytes = 204 bytes)

1F FF 10

Page 36: Video Encoding  and  Compression

MPEG Transport Header

47 1F FF 10

47 1F FF

Sync byte PID (13 bits) Continuity counter (4 bits)

0

Page 37: Video Encoding  and  Compression

MPEG Transport Stream

PAT

PMT

Null packet Video packet Audio packet

Page 38: Video Encoding  and  Compression

MPEG Tables

Program Specific Information (PSI) PAT = Program Association Table PMT = Program Map Table CAT = Conditional Access Table NIT = Network Information Table

Page 39: Video Encoding  and  Compression

PSI Tables

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

Page 40: Video Encoding  and  Compression

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

Page 41: Video Encoding  and  Compression

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

Page 43: Video Encoding  and  Compression

Encoding Rate-Shaping Modulation

Open-loop VBR

Page 44: Video Encoding  and  Compression

Rate Shaping

Goal: Fit streams in fixed-bandwidth channel 38.8 Mbps (256-QAM)

38.8 Mbps

Page 45: Video Encoding  and  Compression

Rate Shaping

• Partially decode MPEG stream• Change quantization• Reconstruct stream• Favor high-priority channels

Page 46: Video Encoding  and  Compression

Closed-loopcontroller

Encoding

Modulation

Closed-loop VBR

Complexity estimates

Bit rate assignments

Page 47: Video Encoding  and  Compression

Modulation

Encoding

All-CBR Architecture

Page 48: Video Encoding  and  Compression

Ad Splicing

Ads are usually CBR May need rate shaping

Page 49: Video Encoding  and  Compression

Ad Splicing

Network

Encoder Mux/Splicer

Ad Server

QAM

CATV Network

Cue tonesSCTE 104

SCTE 35

SCTE 30

Ad stream

Page 50: Video Encoding  and  Compression

MPEG-2 vs. MPEG-4

http://www.balooga.com/mpeg4.php3

Page 51: Video Encoding  and  Compression

Moving to MPEG-4

Lower bit rates Same transport stream Upgrade encoders Upgrade set tops

Page 52: Video Encoding  and  Compression

August 25, 2009

Video Encoding and Compression

Presented By:Justin [email protected]

(401) 441-6801

Derived from Original Content by Marty Sauser, EGT, inc.