digital television audio and video compressing - mpegshadowcat.no-ip.info/kooli_asjad/telekom/mpeg,...

32
21.1.2003 Digital televsion techniques – Lecture 2 1 Digital television Audio and Video compressing - MPEG * MPEG Motivation / History * Overall structure * Fundamental blocks: DCT, Motion estimation, Entropy coding * MPEG stream

Upload: duongnga

Post on 13-May-2018

220 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: Digital television Audio and Video compressing - MPEGshadowcat.no-ip.info/Kooli_asjad/telekom/MPEG, DCT, zigzag... · 4:2:0 Co-sited (PAL DV) Normal profile MPEG-2 Video Sampling

21.1.2003 Digital televsion techniques – Lecture 2 1

Digital television

Audio and Video compressing - MPEG

* MPEG Motivation / History

* Overall structure

* Fundamental blocks: DCT, Motion estimation,Entropy coding

* MPEG stream

Page 2: Digital television Audio and Video compressing - MPEGshadowcat.no-ip.info/Kooli_asjad/telekom/MPEG, DCT, zigzag... · 4:2:0 Co-sited (PAL DV) Normal profile MPEG-2 Video Sampling

21.1.2003 Digital televsion techniques – Lecture 2 2

MPEG motivation

Page 3: Digital television Audio and Video compressing - MPEGshadowcat.no-ip.info/Kooli_asjad/telekom/MPEG, DCT, zigzag... · 4:2:0 Co-sited (PAL DV) Normal profile MPEG-2 Video Sampling

21.1.2003 Digital televsion techniques – Lecture 2 3

Digital TV: Sampling

s[k] = s(kTs)

k ∈ {..., -1, 0 1, 2, 3,...}

1/fs = Ts sampling interval

Nyqvist rate 2 fmax

Page 4: Digital television Audio and Video compressing - MPEGshadowcat.no-ip.info/Kooli_asjad/telekom/MPEG, DCT, zigzag... · 4:2:0 Co-sited (PAL DV) Normal profile MPEG-2 Video Sampling

21.1.2003 Digital televsion techniques – Lecture 2 4

Digital TV: Sampling

Sampling of video signal (composite video):Normally ”4fsc” 4 * colorsubcarrier frequency

-> 14.318 MHz at 12 bits = 171 Mbit/s

Sampling components (Y / Cb / Cr):Normally 13.5 MHz luminance frequencyAt 4:2:2 sampling totally 27 MHz, 8 bit ->

Available: 5 Mbit/sCompression ”40:1”

Page 5: Digital television Audio and Video compressing - MPEGshadowcat.no-ip.info/Kooli_asjad/telekom/MPEG, DCT, zigzag... · 4:2:0 Co-sited (PAL DV) Normal profile MPEG-2 Video Sampling

21.1.2003 Digital televsion techniques – Lecture 2 5

MPEG: History

JPEG – during the 80s

H.120 – 2Mbit/s – DCPM - videoconferencingH.261, 1989, – 384 kbit/s-1Mbit/s – DCT - videoconferencingMPEG-1 (ISO/IEC-11172), 1989-1996 – VHS quality at 1,5 Mbit/sMPEG-2 (ISO/IEC-13818), 1991-2000 – video broadcastingMPEG-4 (ISO/IEC-14496), 1995-2002 – objects, waveletsMPEG-7 2002 – “content-based coding”

Page 6: Digital television Audio and Video compressing - MPEGshadowcat.no-ip.info/Kooli_asjad/telekom/MPEG, DCT, zigzag... · 4:2:0 Co-sited (PAL DV) Normal profile MPEG-2 Video Sampling

21.1.2003 Digital televsion techniques – Lecture 2 6

MPEG-1

•This standard is named after the ISO committee that created it. It has a bandwidth of about 188 KBps, and consists of three layers:

•MPEG video, encoded at 138 KBps•MPEG system (responsible, among other things, for A/V sync), encoded at 34 KBps•MPEG audio, the Third Layer, hence MP3, encoded at 128 kilobits per second (16 KBps)

MPEG-2Improvements for broadcastingPossibilty to perform parallel decoding

Page 7: Digital television Audio and Video compressing - MPEGshadowcat.no-ip.info/Kooli_asjad/telekom/MPEG, DCT, zigzag... · 4:2:0 Co-sited (PAL DV) Normal profile MPEG-2 Video Sampling

21.1.2003 Digital televsion techniques – Lecture 2 7

Compression in general

- Lossythere is loss in data,taking advt. of limitsof eye and ear

Ex. Interpolation,subsampling, quantization(YUV, Wavelets, Fractals)

- Losslessdecompressed stream identical to original

Ex. Run-length encodingHuffman-encoding(ZIP, GIF)

- Hybrid codingJpeg, Mpeg,Last step entropy

Page 8: Digital television Audio and Video compressing - MPEGshadowcat.no-ip.info/Kooli_asjad/telekom/MPEG, DCT, zigzag... · 4:2:0 Co-sited (PAL DV) Normal profile MPEG-2 Video Sampling

21.1.2003 Digital televsion techniques – Lecture 2 8

- Temporal, spatial redundancy- Impercitible details

MPEG compression techiniques

Page 9: Digital television Audio and Video compressing - MPEGshadowcat.no-ip.info/Kooli_asjad/telekom/MPEG, DCT, zigzag... · 4:2:0 Co-sited (PAL DV) Normal profile MPEG-2 Video Sampling

21.1.2003 Digital televsion techniques – Lecture 2 9

Video compression - methods

Page 10: Digital television Audio and Video compressing - MPEGshadowcat.no-ip.info/Kooli_asjad/telekom/MPEG, DCT, zigzag... · 4:2:0 Co-sited (PAL DV) Normal profile MPEG-2 Video Sampling

21.1.2003 Digital televsion techniques – Lecture 2 10

4:2:2 Sampling (Digital Betacam)High profile MPEG-2

4:1:1 Sampling (NTSC DV)

4:2:0 Co-sited (PAL DV)Normal profile MPEG-2

Video Sampling Formats

Page 11: Digital television Audio and Video compressing - MPEGshadowcat.no-ip.info/Kooli_asjad/telekom/MPEG, DCT, zigzag... · 4:2:0 Co-sited (PAL DV) Normal profile MPEG-2 Video Sampling

21.1.2003 Digital televsion techniques – Lecture 2 11

Sample interpolation Chrominance

Page 12: Digital television Audio and Video compressing - MPEGshadowcat.no-ip.info/Kooli_asjad/telekom/MPEG, DCT, zigzag... · 4:2:0 Co-sited (PAL DV) Normal profile MPEG-2 Video Sampling

21.1.2003 Digital televsion techniques – Lecture 2 12

MPEG fundamental blocks

Page 13: Digital television Audio and Video compressing - MPEGshadowcat.no-ip.info/Kooli_asjad/telekom/MPEG, DCT, zigzag... · 4:2:0 Co-sited (PAL DV) Normal profile MPEG-2 Video Sampling

21.1.2003 Digital televsion techniques – Lecture 2 13

JPEG / Still coding

Page 14: Digital television Audio and Video compressing - MPEGshadowcat.no-ip.info/Kooli_asjad/telekom/MPEG, DCT, zigzag... · 4:2:0 Co-sited (PAL DV) Normal profile MPEG-2 Video Sampling

21.1.2003 Digital televsion techniques – Lecture 2 14

Intra-frame coding: Overall

Page 15: Digital television Audio and Video compressing - MPEGshadowcat.no-ip.info/Kooli_asjad/telekom/MPEG, DCT, zigzag... · 4:2:0 Co-sited (PAL DV) Normal profile MPEG-2 Video Sampling

21.1.2003 Digital televsion techniques – Lecture 2 15

Transformation based compression

Encode differences with less precision!!

Common transformations: Fourier, DCT, WaveletsMPEG2 uses DCT

Page 16: Digital television Audio and Video compressing - MPEGshadowcat.no-ip.info/Kooli_asjad/telekom/MPEG, DCT, zigzag... · 4:2:0 Co-sited (PAL DV) Normal profile MPEG-2 Video Sampling

21.1.2003 Digital televsion techniques – Lecture 2 16

Discrete cosinus transform

Page 17: Digital television Audio and Video compressing - MPEGshadowcat.no-ip.info/Kooli_asjad/telekom/MPEG, DCT, zigzag... · 4:2:0 Co-sited (PAL DV) Normal profile MPEG-2 Video Sampling

21.1.2003 Digital televsion techniques – Lecture 2 17

Discrete cosinus transformRepresents input as sum of basic functions

Page 18: Digital television Audio and Video compressing - MPEGshadowcat.no-ip.info/Kooli_asjad/telekom/MPEG, DCT, zigzag... · 4:2:0 Co-sited (PAL DV) Normal profile MPEG-2 Video Sampling

21.1.2003 Digital televsion techniques – Lecture 2 18

DCT on frames

Page 19: Digital television Audio and Video compressing - MPEGshadowcat.no-ip.info/Kooli_asjad/telekom/MPEG, DCT, zigzag... · 4:2:0 Co-sited (PAL DV) Normal profile MPEG-2 Video Sampling

21.1.2003 Digital televsion techniques – Lecture 2 19

DCT on frames: Example

Page 20: Digital television Audio and Video compressing - MPEGshadowcat.no-ip.info/Kooli_asjad/telekom/MPEG, DCT, zigzag... · 4:2:0 Co-sited (PAL DV) Normal profile MPEG-2 Video Sampling

21.1.2003 Digital televsion techniques – Lecture 2 20

Quantization

* Variable in MPEG stream

Page 21: Digital television Audio and Video compressing - MPEGshadowcat.no-ip.info/Kooli_asjad/telekom/MPEG, DCT, zigzag... · 4:2:0 Co-sited (PAL DV) Normal profile MPEG-2 Video Sampling

21.1.2003 Digital televsion techniques – Lecture 2 21

Zig-zag walking

In order to increas effectiveness of run-length encoding

43,3,3,1,3,2,1,2,1,1,1,0,0,1,1,0,0,....After RLE:43, (3,2), 1, 3, 2, 1, 2, (1,3), (0,2), (1,2),(0,49)

Page 22: Digital television Audio and Video compressing - MPEGshadowcat.no-ip.info/Kooli_asjad/telekom/MPEG, DCT, zigzag... · 4:2:0 Co-sited (PAL DV) Normal profile MPEG-2 Video Sampling

21.1.2003 Digital televsion techniques – Lecture 2 22

Run-length encoding

Page 23: Digital television Audio and Video compressing - MPEGshadowcat.no-ip.info/Kooli_asjad/telekom/MPEG, DCT, zigzag... · 4:2:0 Co-sited (PAL DV) Normal profile MPEG-2 Video Sampling

21.1.2003 Digital televsion techniques – Lecture 2 23

Huffman encoder - principles

Page 24: Digital television Audio and Video compressing - MPEGshadowcat.no-ip.info/Kooli_asjad/telekom/MPEG, DCT, zigzag... · 4:2:0 Co-sited (PAL DV) Normal profile MPEG-2 Video Sampling

21.1.2003 Digital televsion techniques – Lecture 2 24

Transformation based compression: Wavelets

2.88 bppOrig:64x648bpp 1.68 bpp

0.88 bpp 0.4 bpp 0.16 bpp

Page 25: Digital television Audio and Video compressing - MPEGshadowcat.no-ip.info/Kooli_asjad/telekom/MPEG, DCT, zigzag... · 4:2:0 Co-sited (PAL DV) Normal profile MPEG-2 Video Sampling

21.1.2003 Digital televsion techniques – Lecture 2 25

MPEG motion compensation

• Performed on macroblock (16x16 pixels)• The prediction search space is not specified in the standard• Objective: Find an motion vector w that minimizes some

cost function, e.g.

Page 26: Digital television Audio and Video compressing - MPEGshadowcat.no-ip.info/Kooli_asjad/telekom/MPEG, DCT, zigzag... · 4:2:0 Co-sited (PAL DV) Normal profile MPEG-2 Video Sampling

21.1.2003 Digital televsion techniques – Lecture 2 26

MPEG motion compensationBi-directional prediction

• Not only prediction, also interpolation• Both past and future frames are used to predict the

current frame

Page 27: Digital television Audio and Video compressing - MPEGshadowcat.no-ip.info/Kooli_asjad/telekom/MPEG, DCT, zigzag... · 4:2:0 Co-sited (PAL DV) Normal profile MPEG-2 Video Sampling

21.1.2003 Digital televsion techniques – Lecture 2 27

MPEG motion compensationBi-directional prediction

• 3 types of pictures in a MPEG stream• I – Intracoded pictures (still images)• P – Predicted pictures from previous I or P pictures• B – Bi-directinally pictures (interpolated pictures)

Page 28: Digital television Audio and Video compressing - MPEGshadowcat.no-ip.info/Kooli_asjad/telekom/MPEG, DCT, zigzag... · 4:2:0 Co-sited (PAL DV) Normal profile MPEG-2 Video Sampling

21.1.2003 Digital televsion techniques – Lecture 2 28

MPEG motion compensationBi-directional prediction

Page 29: Digital television Audio and Video compressing - MPEGshadowcat.no-ip.info/Kooli_asjad/telekom/MPEG, DCT, zigzag... · 4:2:0 Co-sited (PAL DV) Normal profile MPEG-2 Video Sampling

21.1.2003 Digital televsion techniques – Lecture 2 29

Structure of MPEG encoding

Page 30: Digital television Audio and Video compressing - MPEGshadowcat.no-ip.info/Kooli_asjad/telekom/MPEG, DCT, zigzag... · 4:2:0 Co-sited (PAL DV) Normal profile MPEG-2 Video Sampling

21.1.2003 Digital televsion techniques – Lecture 2 30

MPEG fundamental blocks

» Sequence Layer* decoding parameters (bit-rate, buffer size, picture resolution,

framerate, ...)» Group of Pictures Layer* a random access point

» Picture Layer* picture type and reference picture information

» Slice Layer* position and state information for decoder resynchronization

» Macroblock Layer* coded motion vectors

» Block Layer* coded DCT coefficients, quantizer step size, etc.

MPE

G-2

Str

eam

Page 31: Digital television Audio and Video compressing - MPEGshadowcat.no-ip.info/Kooli_asjad/telekom/MPEG, DCT, zigzag... · 4:2:0 Co-sited (PAL DV) Normal profile MPEG-2 Video Sampling

21.1.2003 Digital televsion techniques – Lecture 2 31

Compression artifacts

Page 32: Digital television Audio and Video compressing - MPEGshadowcat.no-ip.info/Kooli_asjad/telekom/MPEG, DCT, zigzag... · 4:2:0 Co-sited (PAL DV) Normal profile MPEG-2 Video Sampling

21.1.2003 Digital televsion techniques – Lecture 2 32

• pre-processing: (or "how to fit a square peg in a round hole?"). • motion estimation (or "how to efficiently find a good prediction.")• macroblock decision models (efficient, but does it also optimise

the ripple effect on subsequent macroblocks ?) • rate control and buffer management in editing environments (MPEG: video only exists within a sequence. Real world: decoder is displaying picture from previous sequence, while reconstructinga picture from the new sequence) • implementation complexity reduction ("let's run it on a Pentium!").

MPEG standardizationWhat about research???