YOU ARE DOWNLOADING DOCUMENT

Please tick the box to continue:

Transcript
Page 1: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

Multimedia Data Compression

Mee Young SungUniversity of Incheon

Department of Computer Science & [email protected]

Page 2: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

1. Lossless Compression Algorithms1. Introduction2. Basics of Information Theory3. Run-Length Coding4. Variable-Length Coding(VLC)

1. Shannon-Fano Algorithm2. Huffman Coding3. Adaptive Huffman Coding

5. Dictionary-Based Coding6. Arithmetic Coding7. Lossless Image Compression8. Differential Coding of Images

1. Differential Coding of Images2. Lossless JPEG

Page 3: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

2. Lossy Compression Algorithms1. Introduction2. Distortion Measures3. The Rate-Distortion Theory4. Quantization

1. Uniform Scalar Qunantization2. Nonuniform Saclar Qunantization3. Vector Qunantization

5. Quantization1. Discrete Cosine Transform(DCT)2. Karhunen-Loève Transform*

6. Wavelet-Based Coding1. Introduction2. Continuous Wavelet Transform*3. Discrete Wavelet Transform*

7. Wavelet Packets8. Embedded Zerotree of Wavelet Coefficients

1. The Zerotree Data Structure2. Successive Approximation Quantization3. EZW Example

9. Set Partitioning in Hierarchical Trees (SPIHT)

Page 4: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

3. Image Compression Standard1. The JPEG Standard

1. Main Steps in JPEG Image Compression2. JPEG Modes3. A Glance at the JPEG Bitstream

2. The JPEG2000 Standard1. Main Steps of JPEG2000 Image Compression*2. Adapting EBCOT to JPEG20003. Region-of-Interest Coding4. Comparison of JPEG and JPEG2000 Performance

3. The JPEG-LS Standard1. Prediction2. Context Determination3. Residual Coding4. Near-Lossless Mode

4. Bilevel Image Compression Standard1. The JBIG Standard2. The JBIG2 Standard

Page 5: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

4. Basic Video Compression Techniques1. Introduction to Video Compression2. Video Compression Based on Motion Compensation3. Search for Motion Vectors

1. Sequential Search2. 2D Logarithmic Search3. Hierarchical Search

4. H.2611. Intra-Frame (I-Frame) Coding2. Inter-Frame (P-Frame) Predictive Coding3. Quantization in H.2614. H.261 Encoder and Decoder5. A Glance at the H.261 Video Bitstream Syntax

5. H.2631. Motion Compensation in H.2632. Optional H.263 Coding Modes3. H.263+ and H.263++

Page 6: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

5. MPEG Video Coding I — MPEG-1 and 21. Overview2. MPEG-1

1. Motion Compensation in MPEG-12. Other Major Differences form H.2613. MPEG-1 Video Bitstream

3. MEPG-21. Supporting Interlaced Video2. MPEG-2 Scalabilities3. Other Major Differences form MPEG-1

Page 7: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

6. MPEG Video Coding II – MPEG-4, 7, and Beyond1. Overview of MPEG-42. Object-Based Visual Coding in MPEG-4

1. VOP-Based Coding vs. Frame-Based Coding2. Motion Compensation3. Texture Coding4. Shape Coding5. Static Texture Coding6. Sprite Coding7. Global Motion Compensation

3. Synthetic Object Coding in MPEG-41. 2D Mesh Object Coding2. 3D Model-based Coding

4. MPEG-4 Object Types, Profiles and Levels5. MPEG-4 Part10/H.264

1. Core Features2. Baseline Profile Features3. Main Profile Features4. Extended Profile Features

6. MPEG-71. Descriptor (D)2. Description Scheme (DS)3. Description Definition Language (DDL)

7. MPEG-21

Page 8: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

7. Basic Audio Compression Techniques1. ADPCM in Speech Coding

1. ADPCM

2. G.726 ADPCM3. Vocoders

1. Phase Insensitivity2. Channel Vocoder3. Formant Vocoder4. Linear Predictive Coding5. CELP6. Hybrid Excitation Vocoders*

Page 9: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

8. MPEG Audio Compression1. Psychoacoustics

1. Equal-Loudness Relations2. Frequency Masking3. Temporal Masking

2. MPEG Audio1. MPEG Layers2. MPEG Audio Strategy3. MPEG Audio Compression Algorithm4. MPEG-2 AAC(Advanced Audio Coding)5. MPEG-4 Audio

3. Other Commercial Audio Codecs4. The Future: MPEG-7 and MPEG-21

Page 10: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

Run-Length Coding

• 비트열 00 ... 00100 ... 001100 ... 00100 ... 001100 ... 00 : 89 비트 ↑ ↑ 0 비트열의길이 14 9 20 30 9

0 비트없음 0 비트없음

• 실행길이 부호화의 일례Run length( 이진 ) 1110 1001 0000 1111 0101 1111 1111 0000 0000 1001 : 40 비트 Run length( 십진 ) 14 9 0 15 5 15 15 0 0 9

Page 11: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

Huffman Coding• Encoding for Huffman Algorithm: • A bottom-up approach • 1. Initialization: Put all nodes in an OPEN list, keep it sorted at all times (e.g., ABCDE). • 2. Repeat until the OPEN list has only one node left: • (a) From OPEN pick two nodes having the lowest frequencies/probabilities, create a

parent node of them. (b) Assign the sum of the children's frequencies/probabilities to the parent node and insert it into OPEN. (c) Assign code 0, 1 to the two branches of the tree, and delete the children from OPEN.

Symbol

Count log2(1/pi) Code Subtotal (# of bits)

A 15 1.38 0 15

B 7 2.48 100 21

C 6 2.70 101 18

D 6 2.70 110 18

E 5 2.96 111 15

Page 12: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

Huffman Coding• 산술 부호화 방법과 함께 통계적인 기법을 사용하여 부호화 함으로써 , 발생 데이터

량을 최소화하고자 하는 기법

• 서로 다른 문자들을 부호화할 때 고정된 비트 수를 사용하지 않고 , 통계적인 분포를 이용하여 자주 나타나는 값에는 보다 적은 비트를 , 드물게 나타나는 값에는 보다 많은 비트를 사용하여 부호화 함으로써 압축하는 기법

•부호화할 문자들과 각각의 발생확률이 주어지면 최소 비트 수를 사용하여 최적의 코드를 생성할 수 있음

• 이진 트리 형태의 허프만 코딩

Page 13: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

Fourrier Transform

Page 14: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

Reinforcement and Interference

Page 15: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

Complex Wave Fundamental and Spectral

Frequencies

Page 16: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

Line Spectrum

Page 17: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

Fundamental Frequency in a Line Spectrum

Page 18: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

DCT

• Discrete Cosine Transform (DCT):

• Inverse Discrete Cosine Transform (IDCT):

otherwise1

0 2

2)( ifC

1

0

1

0

),(2

)12(cos

2

)12(cos

)()(2),(

M

i

N

j

jifN

vj

M

ui

MN

vCuCvuF

7

0

7

0

),(16

)12(cos

16

)12(cos

4

)()(),(

i j

jifvjuivCuC

vuF

7

0

7

0

),(16

)12(cos

16

)12(cos

4

)()(),(

~

i j

vuFvjuivCuC

jif

Page 19: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

283

)1001100110011001

1001100110011001(22

2)0(1

F

0

)10016

15cos100

16

13cos100

16

11cos100

16

9cos

10016

7cos100

16

5cos100

16

3cos100

16(cos

2

1)1(1

F

Example 1

)(16

)12(cos

2

)()(

7

0

ifuiuC

uFi

7

0

)(16

)12(cos

2

)()(

~

u

uFuviuC

if

1D DCT:

1D IDCT:

Page 20: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

18

sin8

cos8

3cos

8cos 2222

18

15sin

8

13cos

18

11cos

8

9cos

18

7cos

8

5cos

22

22

22

200100)1111(2

1

100)8

15cos

8

15cos

8

13cos

8

13cos

8

11cos

8

11cos

8

9cos

8

9cos

8

7cos

8

7cos

8

5cos

8

5cos

8

3cos

8

3cos

8cos

8(cos

2

1)2(2

F

0

)16

15cos100

16

13cos100

16

11cos100

16

9cos100

16

7cos100

16

5cos100

16

3cos100

16cos100(1

22

2)0(2

F Example

2

)8

7cos

8(cos

Page 21: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

)()()(

0)7()4()3()1(

,200)2(

,283)0(

213

3333

3

3

uFuFuF

FFFF

F

F

Example 3

Page 22: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

5441171611744969:)7...0)((

6090355630156585:)7...0)((

uuF

iif

Example 4

Page 23: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

6090355630156585:)7...0)((

5441171611744969:)7...0)((~

iif

uuF

)()()( qTpTqpT

5441171611744969:)7...0)(( uuF

8

)12(cos37

16

)12(cos5.243.24

)2(8

)12(cos

2

)2()1(

16

)12(cos

2

)1()0(0cos

2

)0()(f :2Iteration

16

)12(cos5.243.24

16

)12(cos)49(

2

13.24

)1(16

)12(cos

2

)1()0(0cos

2

)0()(f :1Iteration

3.2469122

2)0(0cos

2

)0()(f :0Iteration

ii

FiC

FiC

FC

i

ii

FiC

FC

i

FC

i

Example of 1D IDCT(Inverse DCT)

Page 24: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

6090355630156585:)7...0)(( iif

qp if 0)()( i

qp iBiB qp if 1)()( i

qp iBiB

qp if 116

)12(cos

2

)(

16

)12(cos

2

)(

qp if 016

)12(cos

16

)12(cos

7

0i

7

0i

qiqCpipC

qipi

1)1,0,0()1,0,0(z

1)0,1,0()0,1,0(y

1)0,0,1()0,0,1(x

0)0,1,0()0,1,0(y

0)1,0,0()0,0,1(x

0)0,1,0()0,0,1(x

z

y

x

z

z

y

Page 25: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

7

0

),(16

)12(cos)(

2

1),(

j

jifvj

vCviG

7

0

),(16

)12(cos)(

2

1),(

i

viGui

uCvuF

dtetfF ti )()( )sin()cos( xixeix

7

0

8

2

x

xi

x efF

7

0

7

0

)8

2sin()

8

2cos(

xx

xx

xfi

xfF

Page 26: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.
Page 27: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.
Page 28: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.
Page 29: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

JPEG• Joint Photographic Expert Group• Motivation

– The compression ratio of lossless methods (e.g., Huffman, Arithmetic, LZW) is not high enough for image and video compression, especially when the distribution of pixel values is relatively flat.

– JPEG uses transform coding, it is largely based on the following observations:

• Observation 1: A large majority of useful image contents change relatively slowly across images, i.e., it is unusual for intensity values to alter up and down several times in a small area, for example, within an 8 x 8 image block. Translate this into the spatial frequency domain, it says that, generally, lower spatial frequency components contain more information than the high frequency components which often correspond to less useful details and noises.

• Observation 2: Pshchophysical experiments suggest that humans are more receptive to loss of higher spatial frequency components than loss of lower frequency components.

Page 30: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

JPEG (DCT)

• Discrete Cosine Transform (DCT):

• Inverse Discrete Cosine Transform (IDCT):

otherwise1

0 2

2)( ifC

1

0

1

0

),(2

)12(cos

2

)12(cos

)()(2),(

M

i

N

j

jifN

vj

M

ui

MN

vCuCvuF

7

0

7

0

),(16

)12(cos

16

)12(cos

4

)()(),(

i j

jifvjuivCuC

vuF

7

0

7

0

),(16

)12(cos

16

)12(cos

4

)()(),(

~

i j

vuFvjuivCuC

jif

Page 31: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

JPEG

• Encoding

Page 32: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

JPEG

• Major Steps – DCT (Discrete Cosine Transformation)– Quantization– Zigzag Scan– DPCM on DC component – RLE on AC Components– Entropy Coding

Page 33: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

JPEG (DCT)

• The 64 (8 x 8) DCT basis functions:

Page 34: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

JPEG (DCT)

• Computing the DCT • Factoring reduces problem to a series of 1D DCTs:

)(16

)12(cos

2

)()(

7

0

ifuiuC

uFi

7

0

)(16

)12(cos

2

)()(

~

u

uFuviuC

if

Page 35: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

JPEG (Quantization)• F'[u, v] = round ( F[u, v] / q[u, v] ). Why? -- To reduce number of bits per

sample – Example: 101101 = 45 (6 bits).

q[u, v] = 4 --> Truncate to 4 bits: 1011 = 11. • Quantization error is the main source of the Lossy Compression. • Uniform Quantization

– Each F[u,v] is divided by the same constant N. • Non-uniform Quantization -- Quantization Tables

– Eye is most sensitive to low frequencies (upper left corner), less sensitive to high frequencies (lower right corner)

• The numbers in the above quantization tables can be scaled up (or down) to adjust the so called quality factor.

• Custom quantization tables can also be put in image/scan header.

Page 36: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

JPEG (Quantization) The Luminance Quantization Table q(u, v) The Chrominance Quantization Table q(u, v)

17 18 24 47 99 99 99 9918 21 26 66 99 99 99 9924 26 56 99 99 99 99 9947 66 99 99 99 99 99 9999 99 99 99 99 99 99 9999 99 99 99 99 99 99 9999 99 99 99 99 99 99 9999 99 99 99 99 99 99 99

16 11 10 16 24 40 51 6112 12 14 19 26 58 60 5514 13 16 24 40 57 69 5614 17 22 29 51 87 80 6218 22 37 56 68 109 103 7724 35 55 64 81 104 113 9249 64 78 87 103 121 120 10172 92 95 98 112 100 103 99

Eye Sensitivity

Page 37: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

JPEG (Zig-Zag Scan)• Zig-zag Scan

– Why? -- to group low frequency coefficients in top of vector. – Maps 8 x 8 to a 1 x 64 vector DC

Page 38: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

JPEG (DPCM on DC component )

• DPCM (Differential Pulse Code Modulation) • DC component is large and varied, but often close to previous value. • Encode the difference from previous 8 x 8 blocks – DPCM• DPCM 부호화 / 복호화 예

– 인접한 신호간에는 일반적으로 상관관계가 매우 크므로 , 이들 신호 각각을 부호화하는 것 대신에 이들의 차이값을 부호화하는 방식

(a) 부호화 이전의 데이터 14 19 25 36 43 55 66 52 48 34

(b) DPCM 부호화 데이터 +14

+5 +6+11

+7+12

+11

-14 +4 -14

(c) 복원된 데이터 14 19 25 36 43 55 66 52 48 34

Page 39: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

JPEG (RLE on AC components )

• RLE (Run Length Encode)• 1 x 64 vector has lots of zeros in it • Keeps skip and value, where skip is the number of zeros and value is t

he next non-zero component. • Send (0,0) as end-of-block sentinel value• Zig-Zag scanned ACs

Page 40: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

JPEG (Entropy Coding )

• Categorize DC values into SIZE (number of bits needed to represent) and actual bits.

• Example: if DC value is 4, 3 bits are needed. • Send off SIZE as Huffman symbol, followed by actual 3 bits. • For AC components two symbols are used: Symbol_1: (skip,

SIZE), Symbol_2: actual bits. Symbol_1 (skip, SIZE) is encoded using the Huffman coding, Symbol_2 is not encoded.

• Huffman Tables can be custom (sent in header) or default.

Size Amplitude 0 0 1 -1,1 2 -3,-2,2,3 3 -7,-6,-5,-4,4,5,6,7

DC (n-1) DC (n)

Page 41: Multimedia Data Compression Mee Young Sung University of Incheon Department of Computer Science & Engineering mysung@incheon.ac.kr.

참고 사이트• http://www.cs.sfu.ca/mmbook/demos.

htm• http://www.cs.sfu.ca/CC/365/li/materi

al/misc/demos.html


Related Documents