low complexity transform and quantization in h.264/avc speaker: pei-cheng huang 2005/6/2
Post on 20-Dec-2015
221 Views
Preview:
TRANSCRIPT
Low Complexity Transform and Quantization in
H.264/AVCSpeaker: Pei-cheng Huang2005/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
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
2005/6/2 Low-Complexity Transform and Quantization in H.264/AVC
4
H.264 block diagram
2005/6/2 Low-Complexity Transform and Quantization in H.264/AVC
5
Transform procedure in H.264
• Discrete Cosine Transform (DCT)• 4x4
2005/6/2 Low-Complexity Transform and Quantization in H.264/AVC
6
Implementation problems
• How to express real numbers?• System complexity
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
3π
8
⎛
⎝ ⎜
⎞
⎠ ⎟
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
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
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
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
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
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
⎡
⎣
⎢ ⎢ ⎢ ⎢
⎤
⎦
⎥ ⎥ ⎥ ⎥
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
2005/6/2 Low-Complexity Transform and Quantization in H.264/AVC
15
Low complexity DCT
butterfly diagram
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
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
2005/6/2 Low-Complexity Transform and Quantization in H.264/AVC
18
Quantization in H.264
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
top related