h.264/avc 指導教授 : 陽士萱 博士 指導教授 : 陽士萱 博士 學生 : 陳柏源 碩一...

27
H.264/AVC H.264/AVC 指指指指 指指指指 : : 指指指 指指 指指指 指指 指指 指指 : : 指指指 指指指 指指 指指 : : 93598022 93598022

Post on 21-Dec-2015

261 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: H.264/AVC 指導教授 : 陽士萱 博士 指導教授 : 陽士萱 博士 學生 : 陳柏源 碩一 學生 : 陳柏源 碩一 學號 : 93598022 學號 : 93598022

H.264/AVCH.264/AVC 指導教授指導教授 :: 陽士萱 博士陽士萱 博士

學生學生 :: 陳柏源 碩一陳柏源 碩一 學號學號 ::9359802293598022

Page 2: H.264/AVC 指導教授 : 陽士萱 博士 指導教授 : 陽士萱 博士 學生 : 陳柏源 碩一 學生 : 陳柏源 碩一 學號 : 93598022 學號 : 93598022

OutlineOutline

IntroductionIntroduction

Video codingVideo coding 技術說明技術說明H.264H.264 技術說明技術說明ConclusionsConclusions

未來進度未來進度

Page 3: H.264/AVC 指導教授 : 陽士萱 博士 指導教授 : 陽士萱 博士 學生 : 陳柏源 碩一 學生 : 陳柏源 碩一 學號 : 93598022 學號 : 93598022

IntroductionIntroduction

ITU-T ITU-T (( International Telecommunications UnionInternational Telecommunications Union ,, TelecommunicatiTelecommunications ons Standardization Sector Standardization Sector )) H.26xH.26x 系列 系列 ex:H.261ex:H.261 、、 H.262H.262 、、 H.263H.263 、、

H.264 (MPEG-4 part 10)H.264 (MPEG-4 part 10)   ISO/IECISO/IEC (( International Standardization Organization/InternationalInternational Standardization Organization/International

Electrotechnical Commission )Electrotechnical Commission )

MPEG-xMPEG-x 系列 系列 ex:MPEG-1ex:MPEG-1 、、 MPEG-2MPEG-2 、、 MPEG-4MPEG-4

Page 4: H.264/AVC 指導教授 : 陽士萱 博士 指導教授 : 陽士萱 博士 學生 : 陳柏源 碩一 學生 : 陳柏源 碩一 學號 : 93598022 學號 : 93598022

ITU-TITU-T 規範和規範和 ISO/IEC MPEGISO/IEC MPEG 標準的演進歷程標準的演進歷程

Page 5: H.264/AVC 指導教授 : 陽士萱 博士 指導教授 : 陽士萱 博士 學生 : 陳柏源 碩一 學生 : 陳柏源 碩一 學號 : 93598022 學號 : 93598022

Video codingVideo coding 技術說明技術說明

DPCM/DCT video encoder

Fn(current)

F'n-1(reference)

MotionEstimate

MotionCompensate

F'n(reconstructed)

DCT Quant

IDCT Rescale ReorderEntropyencode

P

Dn

D'n

Vectors andheaders

X

Coded bitstream

Page 6: H.264/AVC 指導教授 : 陽士萱 博士 指導教授 : 陽士萱 博士 學生 : 陳柏源 碩一 學生 : 陳柏源 碩一 學號 : 93598022 學號 : 93598022

partitions

Frame partitions Macroblock partitions

161

32

16 8

8 0

4

4

16

16

16x16 blocks 8x8 blocks 4x4 blocks

Page 7: H.264/AVC 指導教授 : 陽士萱 博士 指導教授 : 陽士萱 博士 學生 : 陳柏源 碩一 學生 : 陳柏源 碩一 學號 : 93598022 學號 : 93598022

Motion estimation/compensationMotion estimation/compensation

Motion estimationMotion estimation

Page 8: H.264/AVC 指導教授 : 陽士萱 博士 指導教授 : 陽士萱 博士 學生 : 陳柏源 碩一 學生 : 陳柏源 碩一 學號 : 93598022 學號 : 93598022

Motion vector map(16x16 blocksMotion vector map(16x16 blocks ,, inter vectors)inter vectors)

Page 9: H.264/AVC 指導教授 : 陽士萱 博士 指導教授 : 陽士萱 博士 學生 : 陳柏源 碩一 學生 : 陳柏源 碩一 學號 : 93598022 學號 : 93598022

Motion vector map(4x4 blocksMotion vector map(4x4 blocks ,, quarter-pixel vectors)quarter-pixel vectors)

Page 10: H.264/AVC 指導教授 : 陽士萱 博士 指導教授 : 陽士萱 博士 學生 : 陳柏源 碩一 學生 : 陳柏源 碩一 學號 : 93598022 學號 : 93598022

IntegerInteger ,, half-pixel and quarter-pixel motion estimationhalf-pixel and quarter-pixel motion estimation

Key:Integer search positions

Best integer match

Half-pel search positions

Best half-pel match

Quarter-pel search positions

Best quarter-pel match

Page 11: H.264/AVC 指導教授 : 陽士萱 博士 指導教授 : 陽士萱 博士 學生 : 陳柏源 碩一 學生 : 陳柏源 碩一 學號 : 93598022 學號 : 93598022

Frame1 Fram2Frame1 Fram2

Residual (no motion compensation) Residual (16x16 block size)

Page 12: H.264/AVC 指導教授 : 陽士萱 博士 指導教授 : 陽士萱 博士 學生 : 陳柏源 碩一 學生 : 陳柏源 碩一 學號 : 93598022 學號 : 93598022

Residual (8x8 block size) Residual (4x4 block size)

Residual (4x4 block size , half-pixel) Residual (4x4 block size , quarter pixel)

Page 13: H.264/AVC 指導教授 : 陽士萱 博士 指導教授 : 陽士萱 博士 學生 : 陳柏源 碩一 學生 : 陳柏源 碩一 學號 : 93598022 學號 : 93598022

Input frame Fn Reconstructed reference frame F’n-1

Page 14: H.264/AVC 指導教授 : 陽士萱 博士 指導教授 : 陽士萱 博士 學生 : 陳柏源 碩一 學生 : 陳柏源 碩一 學號 : 93598022 學號 : 93598022

Residual Fn-F’n-1 (no motion compensation) 16x16 motion vector

Page 15: H.264/AVC 指導教授 : 陽士萱 博士 指導教授 : 陽士萱 博士 學生 : 陳柏源 碩一 學生 : 陳柏源 碩一 學號 : 93598022 學號 : 93598022

Motion compensation reference frame Motion compensation residual frame

Page 16: H.264/AVC 指導教授 : 陽士萱 博士 指導教授 : 陽士萱 博士 學生 : 陳柏源 碩一 學生 : 陳柏源 碩一 學號 : 93598022 學號 : 93598022

DCT (Discrete Cosine Transform)DCT (Discrete Cosine Transform)

Two-dimensional 8x8 DCT tranTwo-dimensional 8x8 DCT transform sform

Inverse two-dimension 8x8 DCInverse two-dimension 8x8 DCT transformT transform

Page 17: H.264/AVC 指導教授 : 陽士萱 博士 指導教授 : 陽士萱 博士 學生 : 陳柏源 碩一 學生 : 陳柏源 碩一 學號 : 93598022 學號 : 93598022

88 84 38 84 85 86 83 8286 82 82 83 82 83 83 8182 82 84 87 87 87 81 8481 86 87 89 82 82 84 8781 84 83 87 85 89 80 8181 85 85 86 81 89 81 8582 81 86 83 86 89 81 8488 88 90 84 85 88 88 81

675-42-3413-1

113-13-20-1

-624010-1-5

2162-1-305

-25-20-22-12

012-21-1-1-2

5-312-3102

-505-411-20

DCT

Page 18: H.264/AVC 指導教授 : 陽士萱 博士 指導教授 : 陽士萱 博士 學生 : 陳柏源 碩一 學生 : 陳柏源 碩一 學號 : 93598022 學號 : 93598022

QuantizationQuantization

675-42-3413-1

113-13-20-1

-624010-1-5

2162-1-305

-25-20-22-12

012-21-1-1-2

5-312-3102

-505-411-20

Quant

168-1001000

00000000

-1010000-1

00100001

01000000

00000000

-101-10000

Page 19: H.264/AVC 指導教授 : 陽士萱 博士 指導教授 : 陽士萱 博士 學生 : 陳柏源 碩一 學生 : 陳柏源 碩一 學號 : 93598022 學號 : 93598022

Zig-Zag Scan And Zig-Zag Scan And Run Length Encoding (RLE) Run Length Encoding (RLE)

168-1001000

00000000

-1010000-1

00100001

01000000

00000000

-101-10000

168,0,-1,0,0,-1,0,0,0,0,1,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,1,-1,0,

0,0,-1,1,0,0,0,0,0,0,0,0,0

Zigzag

168,0,-1,0,0,-1,0,0,0,0,1,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,1,-1,0,

0,0,-1,1,0,0,0,0,0,0,0,0,0

(1,-1)(2,-1)(4,1)(1,1)(3,1)(0,1)(9,-1)(12,1)(0,-1)(3,-1)(0,1)(9,0)EOB

RLE

Page 20: H.264/AVC 指導教授 : 陽士萱 博士 指導教授 : 陽士萱 博士 學生 : 陳柏源 碩一 學生 : 陳柏源 碩一 學號 : 93598022 學號 : 93598022

DPCM/DCT video decoder

F'n-1(reference)

MotionCompensate

F'n(reconstructed)

IDCT Rescale ReorderEntropydecode

P

D'n

Vectors andheaders

X Coded bitstream

Page 21: H.264/AVC 指導教授 : 陽士萱 博士 指導教授 : 陽士萱 博士 學生 : 陳柏源 碩一 學生 : 陳柏源 碩一 學號 : 93598022 學號 : 93598022

H.264H.264 技術說明技術說明

H.264 Encoder

Fn(current)

F'n-1(reference)

ME

MC

Intraprediction

ChooseIntra

predition

F'n(reconstructed)

Filter

T Q ReorderEntropyencode

T -1 Q -1

Dn X

D'n

Inter

Intra

P

uF'n

NAL

(1 or 2 previouslyencoded frames)

Page 22: H.264/AVC 指導教授 : 陽士萱 博士 指導教授 : 陽士萱 博士 學生 : 陳柏源 碩一 學生 : 陳柏源 碩一 學號 : 93598022 學號 : 93598022

Intra predictionIntra prediction

M A G H

I

J

K

L

a b c d

e f g h

i j k l

m n o p

B C D E F

M A G HIJKL

B C D E F M A G HIJKL

B C D E F M A G HIJKL

B C D E F M A G HIJKL

B C D E F

M A G HIJKL

B C D E F

M A G HIJKL

B C D E F

M A G HIJKL

B C D E F M A G HIJKL

B C D E F M A G HIJKL

B C D E F

0 (vertical) 1 (horizontal) 2 (DC) 3 (diagonal down-left) 4 (diagonal down-right)

5 (vertical-right) 6 (horizontal-down) 7 (vertical-left) 8 (horizontal-up)

Labelling of prediction samples( 4x4)

Page 23: H.264/AVC 指導教授 : 陽士萱 博士 指導教授 : 陽士萱 博士 學生 : 陳柏源 碩一 學生 : 陳柏源 碩一 學號 : 93598022 學號 : 93598022

Macroblock partitionsMacroblock partitions

0 11

10

0 0

32

16

16

8 8

8

8x16 16x8 8x8

1

110 0

0 0

32

8

8x8

4 4

16x16

4x8 8x4 4x4

Macroblock partitions

Sub-macroblock partitions

Page 24: H.264/AVC 指導教授 : 陽士萱 博士 指導教授 : 陽士萱 博士 學生 : 陳柏源 碩一 學生 : 陳柏源 碩一 學號 : 93598022 學號 : 93598022

移動估算的精準度移動估算的精準度motion vectorsmotion vectors 可以精確到可以精確到 1/41/4 像素精準度像素精準度,,既有標準大多採用既有標準大多採用 1/21/2 像像素精準度,只有最新的素精準度,只有最新的 MPEG-4MPEG-4 標準才提供標準才提供 1/41/4 像素精準度。像素精準度。

多重參考畫面選擇多重參考畫面選擇

Deblocking FilterDeblocking Filter

Page 25: H.264/AVC 指導教授 : 陽士萱 博士 指導教授 : 陽士萱 博士 學生 : 陳柏源 碩一 學生 : 陳柏源 碩一 學號 : 93598022 學號 : 93598022

H.264 DecoderH.264 Decoder

F'n-1(reference)

F'n(reconstructed)

MC

Intraprediction

Filter T -1 Q -1 ReorderEntropyencode

X D'n

P

Inter

Intra

uF'nNAL

Page 26: H.264/AVC 指導教授 : 陽士萱 博士 指導教授 : 陽士萱 博士 學生 : 陳柏源 碩一 學生 : 陳柏源 碩一 學號 : 93598022 學號 : 93598022

ConclusionsConclusionsH.264H.264 之優點之優點

最多節省最多節省 5050 %%位元速率:相較於位元速率:相較於 H.263v2H.263v2 (( H.263+H.263+ ))或是或是 MPEG-4 MPEG-4 Simple ProfileSimple Profile ,在相同編碼器最佳化的條件下,以,在相同編碼器最佳化的條件下,以 H.264H.264 最多可節省最多可節省5050 %%的位元速率。的位元速率。

高品質視訊:無論位元速率的高低,高品質視訊:無論位元速率的高低, H.264H.264 都提供穩定一致的良好視都提供穩定一致的良好視

訊品質。訊品質。 抗錯性抗錯性(( error resilienceerror resilience ):): H.264H.264 提供多種必要工具,不但能處理提供多種必要工具,不但能處理封包網路的封包遺失,還能針對容易發生錯誤的無線網路,處理其中封包網路的封包遺失,還能針對容易發生錯誤的無線網路,處理其中可能出現的位元錯誤。可能出現的位元錯誤。

網路友善性:透過網路適應層網路友善性:透過網路適應層(( Network AdaptationNetwork Adaptation LayerLayer )),, H.264H.264位元串流很容易就能在不同網路上傳輸。上述優點使得位元串流很容易就能在不同網路上傳輸。上述優點使得 H.264H.264 成為許成為許多應用的理想標準,例如視訊會議和廣播視訊。 多應用的理想標準,例如視訊會議和廣播視訊。

Page 27: H.264/AVC 指導教授 : 陽士萱 博士 指導教授 : 陽士萱 博士 學生 : 陳柏源 碩一 學生 : 陳柏源 碩一 學號 : 93598022 學號 : 93598022

未來進度未來進度

11 12 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 72005 20062004

C/C++

H.264

論文

國防役

英文

計畫