low complexity transform and quantization in h.264/avc speaker: pei-cheng huang 2005/6/2

19
Low Complexity Transform and Quantization in H.264/AVC Speaker: Pei-cheng Huang 2005/6/2

Post on 20-Dec-2015

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Low Complexity Transform and Quantization in H.264/AVC Speaker: Pei-cheng Huang 2005/6/2

Low Complexity Transform and Quantization in

H.264/AVCSpeaker: Pei-cheng Huang2005/6/2

Page 2: Low Complexity Transform and Quantization in H.264/AVC Speaker: Pei-cheng Huang 2005/6/2

2005/6/2 Low-Complexity Transform and Quantization in H.264/AVC

2

Outline

• Introduction to transform and quantization in H.264

• Details of transform procedure• Details of quantization procedure

Page 3: Low Complexity Transform and Quantization in H.264/AVC Speaker: Pei-cheng Huang 2005/6/2

2005/6/2 Low-Complexity Transform and Quantization in H.264/AVC

3

Reference

• Henrique S. Malvar, Antti Hallapuro, Marta Karczewicz, and Louis Kerofsky, “Low-Complexity Transform and Quantization in H.264/AVC,” IEEE Transactions on Circuits and Systems for Video Technology, Vol. 13, No. 7, July 2003

• Iain E. G. Richardson, “H.264 and MPEG-4 Video Compression,” Wiley, 2003, ISBN 0-470-84837-5

Page 4: Low Complexity Transform and Quantization in H.264/AVC Speaker: Pei-cheng Huang 2005/6/2

2005/6/2 Low-Complexity Transform and Quantization in H.264/AVC

4

H.264 block diagram

Page 5: Low Complexity Transform and Quantization in H.264/AVC Speaker: Pei-cheng Huang 2005/6/2

2005/6/2 Low-Complexity Transform and Quantization in H.264/AVC

5

Transform procedure in H.264

• Discrete Cosine Transform (DCT)• 4x4

Page 6: Low Complexity Transform and Quantization in H.264/AVC Speaker: Pei-cheng Huang 2005/6/2

2005/6/2 Low-Complexity Transform and Quantization in H.264/AVC

6

Implementation problems

• How to express real numbers?• System complexity

Page 7: Low Complexity Transform and Quantization in H.264/AVC Speaker: Pei-cheng Huang 2005/6/2

2005/6/2 Low-Complexity Transform and Quantization in H.264/AVC

7

DCT

Hkn = H(k,n) = ck2

Ncos n +

1

2

⎝ ⎜

⎠ ⎟kπ

N

⎣ ⎢

⎦ ⎥

a a a a

b c −c −b

a −a −a a

c −b b −c

⎢ ⎢ ⎢ ⎢

⎥ ⎥ ⎥ ⎥

a =1

2

b =1

2cos

π

8

⎝ ⎜

⎠ ⎟

c =1

2cos

8

⎝ ⎜

⎠ ⎟

Page 8: Low Complexity Transform and Quantization in H.264/AVC Speaker: Pei-cheng Huang 2005/6/2

2005/6/2 Low-Complexity Transform and Quantization in H.264/AVC

8

DCT

0.5 0.5 0.5 0.5

0.653 0.271 0.271 −0.653

0.5 −0.5 −0.5 0.5

0.271 −0.653 −0.653 0.271

⎢ ⎢ ⎢ ⎢

⎥ ⎥ ⎥ ⎥

Cosines in real number format:

X = HxOrthogonal matrix H-1 = HT

Page 9: Low Complexity Transform and Quantization in H.264/AVC Speaker: Pei-cheng Huang 2005/6/2

2005/6/2 Low-Complexity Transform and Quantization in H.264/AVC

9

Fixed point DCT in TML

• Very similar to original DCT• Orthogonal rows• Constant row norm• Higher dynamic range

– Max value of Hx = 52A

13 13 13 13

17 7 −7 −17

13 −13 −13 13

7 −17 17 −7

⎢ ⎢ ⎢ ⎢

⎥ ⎥ ⎥ ⎥

a =13

b =17

c = 7

log2(522) =11.4

round(αH)

α = 26

Page 10: Low Complexity Transform and Quantization in H.264/AVC Speaker: Pei-cheng Huang 2005/6/2

2005/6/2 Low-Complexity Transform and Quantization in H.264/AVC

10

Fixed point DCT in H.264

• Also has orthogonal rows• Non-constant row norm€

1 1 1 1

2 1 −1 −2

1 −1 −1 1

1 −2 2 −1

⎢ ⎢ ⎢ ⎢

⎥ ⎥ ⎥ ⎥

a =1

b = 2

c =1

round(αH)

α = 2.5

Page 11: Low Complexity Transform and Quantization in H.264/AVC Speaker: Pei-cheng Huang 2005/6/2

2005/6/2 Low-Complexity Transform and Quantization in H.264/AVC

11

Dynamic range of low complexity DCT

• Max value of DCT coefficients = 6A•

1 1 1 1

2 1 −1 −2

1 −1 −1 1

1 −2 2 −1

⎢ ⎢ ⎢ ⎢

⎥ ⎥ ⎥ ⎥

log2(62) = 5.17

Page 12: Low Complexity Transform and Quantization in H.264/AVC Speaker: Pei-cheng Huang 2005/6/2

2005/6/2 Low-Complexity Transform and Quantization in H.264/AVC

12

Inverse Transform

• Max value of DCT coefficients = 4A•

1 1 1 1

2 1 −1 −2

1 −1 −1 1

1 −2 2 −1

⎢ ⎢ ⎢ ⎢

⎥ ⎥ ⎥ ⎥

1 1 1 1

1 12

−12 −1

1 −1 −1 11

2 −1 1 −12

⎢ ⎢ ⎢ ⎢

⎥ ⎥ ⎥ ⎥

log2(42) = 4

Page 13: Low Complexity Transform and Quantization in H.264/AVC Speaker: Pei-cheng Huang 2005/6/2

2005/6/2 Low-Complexity Transform and Quantization in H.264/AVC

13

Influence of non-constant row norm

1 1 1 12

1 12 −1 −1

1 −12 −1 1

1 −1 1 −12

⎢ ⎢ ⎢ ⎢ ⎢

⎥ ⎥ ⎥ ⎥ ⎥

1 1 1 1

2 1 −1 −2

1 −1 −1 1

1 −2 2 −1

⎢ ⎢ ⎢ ⎢

⎥ ⎥ ⎥ ⎥

A

1 2 1 1

1 1 −1 −2

1 −1 −1 2

1 −2 1 −1

⎢ ⎢ ⎢ ⎢

⎥ ⎥ ⎥ ⎥

1 1 1 1

1 12

−12 −1

1 −1 −1 11

2 −1 1 −12

⎢ ⎢ ⎢ ⎢

⎥ ⎥ ⎥ ⎥€

H iHAHTH i

T

A⊗

16 20 16 20

20 25 20 25

16 20 16 20

20 25 20 25

⎢ ⎢ ⎢ ⎢

⎥ ⎥ ⎥ ⎥

Page 14: Low Complexity Transform and Quantization in H.264/AVC Speaker: Pei-cheng Huang 2005/6/2

2005/6/2 Low-Complexity Transform and Quantization in H.264/AVC

14

Cancel the scale factors

H iDiHAHTDi

TH iT

Di =

14 0 0 0

0 15 0 0

0 0 14 0

0 0 0 15

⎢ ⎢ ⎢ ⎢ ⎢

⎥ ⎥ ⎥ ⎥ ⎥€

IAI = A

Page 15: Low Complexity Transform and Quantization in H.264/AVC Speaker: Pei-cheng Huang 2005/6/2

2005/6/2 Low-Complexity Transform and Quantization in H.264/AVC

15

Low complexity DCT

butterfly diagram

Page 16: Low Complexity Transform and Quantization in H.264/AVC Speaker: Pei-cheng Huang 2005/6/2

2005/6/2 Low-Complexity Transform and Quantization in H.264/AVC

16

Quantization

0 1.0 2.0

Xq (i, j) = sign{X(i, j)}X(i, j)

Qstep

Page 17: Low Complexity Transform and Quantization in H.264/AVC Speaker: Pei-cheng Huang 2005/6/2

2005/6/2 Low-Complexity Transform and Quantization in H.264/AVC

17

Avoid divisions

Xq (i, j) = sign{X(i, j)} X(i, j) A(Q) + f 2L( ) >> L

X r(i, j) = Xq (i, j)B(Q)

xr = HTX r + 2N−1( ) >> N

A(Q)B(Q)G2 ≈ 2N +L

Page 18: Low Complexity Transform and Quantization in H.264/AVC Speaker: Pei-cheng Huang 2005/6/2

2005/6/2 Low-Complexity Transform and Quantization in H.264/AVC

18

Quantization in H.264

Page 19: Low Complexity Transform and Quantization in H.264/AVC Speaker: Pei-cheng Huang 2005/6/2

2005/6/2 Low-Complexity Transform and Quantization in H.264/AVC

19

Performance

• Coding gain 5.39 dB --> 5.38 dB• PSNR 0.01 dB loss• Significantly lower complexity