Ch.6 H.264/AVC Part2 (pp.200~222)

Download Report

Transcript Ch.6 H.264/AVC Part2 (pp.200~222)

Ch.6 H.264/AVC Part2 (pp.200~222)

Chun-Wei Hsieh Mikemage@CMLab, 2004 NTU CSIE 1

Outline

• 6.4.13.2 CAVLC • Main profile – B slices, weighted prediction, CABAC • Extended profile – SP & SI slices • Transport of H.264

Mikemage@CMLab, 2004 NTU CSIE 2

CAVLC

• Context-Based Adaptive Variable Length Coding • Characteristics: – Run-level coding to compact zero string – Trailing ones (+1, -1 after 0) – Number of nonzero coefficient in neighboring blocks is correlated – Choice VLC lookup table for level parameter for level magnitude Mikemage@CMLab, 2004 NTU CSIE 3

CAVLC Encoding process

• 1. Encode the number of coefficients and trailing ones (coeff token) – TotalCoeffs : 0 ~ 16 – TrailingOnes : 0 ~ 3 • if more than tree TrailingOnes, only last three are treated as ‘ special cases ’ – Four look up table • Three variable-length, one fixed-length • Choice depend on neighboring blocks Mikemage@CMLab, 2004 NTU CSIE 4

CAVLC Encoding process(2)

• 2. Encode the sign of each TrailingOne – In reverse order • 3. Encode the levels of the remaining nonzero coefficients – level_prefix, level_suffix Mikemage@CMLab, 2004 NTU CSIE 5

CAVLC Encoding process(3)

• 4.Encode the total number of zeros before the last coefficient – Zero-runs at start of the array need not to be encoded • 5. Encode each run of zeros • If less then 3 TrailingOnes, the first nonzero coefficient is adjusted Mikemage@CMLab, 2004 NTU CSIE 6

Main profile

Mikemage@CMLab, 2004 NTU CSIE 7

Main profile(2)

• Suitable application: – broadcast media – applications such as digital television and stored digital video Mikemage@CMLab, 2004 NTU CSIE 8

B slices

• May be predicted from one or two reference pictures, before or after the current in temporal order.

• List 0 – The closest past picture, followed by any other past pictures, followed by any future pictures • List 1 – The closest future picture, followed by any other future picture followed by any past picture Mikemage@CMLab, 2004 NTU CSIE 9

B slices(2)

• Prediction options Mikemage@CMLab, 2004 NTU CSIE 10

B slices: Bi-direction prediction

• Each sample of the prediction block is calculated as an average of the list 0 and list 1 prediction sample • pred(i,j) = (pred0(i,j) + pred1(i,j) + 1) >> 1 Mikemage@CMLab, 2004 NTU CSIE 11

B slices: Direction prediction(2)

• No motion vector is transmitted • Spatial direct mode – Using the process described in 6.4.5.4

• Temporal direct mode Mikemage@CMLab, 2004 NTU CSIE 12

Weighted prediction

• 1. P slice macroblock, ‘ explicit ’ prediction; • 2. B slice macroblock, ‘ explicit ’ weighted weighted prediction; • 3. B slice macroblock, ‘ implicit ’ weighted prediction.

• Explicit: weighting factor are transmitted • Implicit: weighting factor are calculated based on reference picture Mikemage@CMLab, 2004 NTU CSIE 13

Interlaced video

• In macroblock-adaptive frame/field (MB-AFF) coding mode, the choice of field or frame coding may be specified at the macroblock level – 16 luminance samples wide and 32 luminance samples high Mikemage@CMLab, 2004 NTU CSIE 14

Interlaced video(2)

Mikemage@CMLab, 2004 NTU CSIE 15

Interlaced video(3)

Mikemage@CMLab, 2004 NTU CSIE 16

CABAC

• Context-based Adaptive Binary Arithmetic Coding – Selecting probability models for each syntax element according to the element ’ s context – Adapting probability estimates based on local statistics – Using arithmetic coding rather than variable-length coding Mikemage@CMLab, 2004 NTU CSIE 17

CABAC(2)

• Binarisation • Context model selection – Context model is a probability model for one or more bins of binarised symbol • Arithmetic encoding • Probability update Mikemage@CMLab, 2004 NTU CSIE 18

Extended profile

Mikemage@CMLab, 2004 NTU CSIE 19

SP & SI slices

• SP and SI slices are specially-coded slices that enable efficient switching between video streams and efficient random access for video decoders • SP-slices are designed to support switching between similar coded sequences without the increased bitrate penalty of I-slices • SI-slice may be used to switch from one sequence to a completely different sequence Mikemage@CMLab, 2004 NTU CSIE 20

SP slices

Mikemage@CMLab, 2004 NTU CSIE 21

SI slice

• Prediction is formed using the 4 Intra Prediction modes (see Section 6.4.6.1) from previously-decoded × 4 samples of the reconstructed frame Mikemage@CMLab, 2004 NTU CSIE 22

Data partitioned slices

• The coded data that makes up a slice is placed in three separate Data Partitions (A, B and C) • Partition A contains the slice header and header data for each macroblock in the slice • Partition B contains coded residual data for Intra and SI slice macroblocks • Partition C contains coded residual data for inter coded macroblocks (forward and bi-directional) Mikemage@CMLab, 2004 NTU CSIE 23

Transport of H.264

• A coded H.264 video sequence consists of a series of NAL units, each containing an RBSP Mikemage@CMLab, 2004 NTU CSIE 24

RBSP type

Mikemage@CMLab, 2004 NTU CSIE 25

Parameter set

sequence parameter set contains parameters to be applied to a complete video sequence • picture parameter set contains parameters which are applied to one or more decoded pictures within a sequence Mikemage@CMLab, 2004 NTU CSIE 26

• Thank You!!

Mikemage@CMLab, 2004 NTU CSIE 27