NTU CSIE 1 Ch.6 H.264/AVC Part2 (pp.200~222) Chun-Wei Hsieh
NTU CSIE 2 Outline CAVLC Main profile –B slices, weighted prediction, CABAC Extended profile –SP & SI slices Transport of H.264
NTU CSIE 3 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
NTU CSIE 4 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
NTU CSIE 5 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
NTU CSIE 6 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
NTU CSIE 7 Main profile
NTU CSIE 8 Main profile(2) Suitable application: –broadcast media –applications such as digital television and stored digital video
NTU CSIE 9 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
NTU CSIE 10 B slices(2) Prediction options
NTU CSIE 11 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
NTU CSIE 12 B slices: Direction prediction(2) No motion vector is transmitted Spatial direct mode –Using the process described in Temporal direct mode
NTU CSIE 13 Weighted prediction 1. P slice macroblock, ‘ explicit ’ weighted prediction; 2. B slice macroblock, ‘ explicit ’ weighted prediction; 3. B slice macroblock, ‘ implicit ’ weighted prediction. Explicit: weighting factor are transmitted Implicit: weighting factor are calculated based on reference picture
NTU CSIE 14 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
NTU CSIE 15 Interlaced video(2)
NTU CSIE 16 Interlaced video(3)
NTU CSIE 17 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
NTU CSIE 18 CABAC(2) Binarisation Context model selection –Context model is a probability model for one or more bins of binarised symbol Arithmetic encoding Probability update
NTU CSIE 19 Extended profile
NTU CSIE 20 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
NTU CSIE 21 SP slices
NTU CSIE 22 SI slice Prediction is formed using the 4 × 4 Intra Prediction modes (see Section ) from previously-decoded samples of the reconstructed frame
NTU CSIE 23 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)
NTU CSIE 24 Transport of H.264 A coded H.264 video sequence consists of a series of NAL units, each containing an RBSP
NTU CSIE 25 RBSP type
NTU CSIE 26 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
NTU CSIE 27 Thank You!!