ÐÏà¡±á>þÿ / :":ª9«9¬99®9¯9°9±9²9³9´9µ9¶9·9¸9¹9º9»9¼9½9¾9¿9À9Á9Â9Ã9Ä9Å9Æ9Ç9È9É9Ê9Ë9Ì9Í9Î9Ï9Ð9Ñ9Ò9Ó9Ô9Õ9Ö9×9Ø9Ù9Ú9Û9Ü9Ý9Þ9ß9à9á9â9ã9ä9å9æ9ç9è9é9ê9ë9ì9í9î9ï9ð9ñ9ò9ó9ô9õ9ö9÷9ø9ù9ú9û9ü9ý9þ9ÿ9::::::::: :
:::
:::::::::::ì¥Á#` ø¿09lobjbj5G5G ˜ÌoW-W-cv"1ÿÿÿÿÿÿ¤è[è[è[è[8\8\8\d”VNXNXNX°þXtlr{Xt¶®ãr²gÆò1YúÑì[:&[&[&[|[´†0]Ü¾L^p_rgrgrgrgrgrgrg$8¸gh ºg()rgy>8\˜°^Z["|[˜°^˜°^)rgè[è[&[&[4¢°gL–N`–N`–N`˜°^®è[8&[8\&[rg–N`˜°^rg–N`–N`:#èsce \8\ Âc&[æ1Y0ƒFv}ÉNXF±_l^Mc¦wàcŒ‘î±g„r²gó’c/È¼g²`Î>È¼g Âc^È¼g8\gÂc|«^€ü¬^–N`®^Üê®^®|«^|«^|«^)rg)rg€N`|«^|«^|«^r²g˜°^˜°^˜°^˜°^®ã¤O‚3Dæö0ú*D$ú®ãR30Æ00úD0œ\Ôpz¦è[è[è[è[è[è[ÿÿÿÿ
International Telecommunication UnionITU-TH.264TELECOMMUNICATIONSTANDARDIZATION SECTOROF ITUCorrigendum 1
(01/2009) SERIES H: AUDIOVISUAL AND MULTIMEDIA SYSTEMS
Infrastructure of audiovisual services – Coding of moving video
Advanced video coding for generic audiovisual services
Corrigendum 1
Recommendation ITUT H.264 (2007) – Corrigendum 1
ITU-T H-SERIES RECOMMENDATIONS
AUDIOVISUAL AND MULTIMEDIA SYSTEMS
CHARACTERISTICS OF VISUAL TELEPHONE SYSTEMSH.100–H.199INFRASTRUCTURE OF AUDIOVISUAL SERVICESGeneralH.200–H.219Transmission multiplexing and synchronizationH.220–H.229Systems aspectsH.230–H.239Communication proceduresH.240–H.259Coding of moving videoH.260–H.279Related systems aspectsH.280–H.299Systems and terminal equipment for audiovisual servicesH.300–H.349Directory services architecture for audiovisual and multimedia servicesH.350–H.359Quality of service architecture for audiovisual and multimedia servicesH.360–H.369Supplementary services for multimediaH.450–H.499MOBILITY AND COLLABORATION PROCEDURESOverview of Mobility and Collaboration, definitions, protocols and proceduresH.500–H.509Mobility for H-Series multimedia systems and servicesH.510–H.519Mobile multimedia collaboration applications and servicesH.520–H.529Security for mobile multimedia systems and servicesH.530–H.539Security for mobile multimedia collaboration applications and servicesH.540–H.549Mobility interworking proceduresH.550–H.559Mobile multimedia collaboration inter-working proceduresH.560–H.569BROADBAND AND TRIPLE-PLAY MULTIMEDIA SERVICESBroadband multimedia services over VDSLH.610–H.619Advanced multimedia services and applicationsH.620–H.629IPTV MULTIMEDIA SERVICES AND APPLICATIONS FOR IPTVGeneral aspectsH.700–H.719IPTV terminal devicesH.720–H.729For further details, please refer to the list of ITU-T Recommendations.
ITU-T Recommendation H.264
Advanced video coding for generic audiovisual services
Corrigendum 1
Summary
This Recommendation | International Standard represents an evolution of the existing video coding standards (H.261, H.262, and H.263) and it was developed in response to the growing need for higher compression of moving pictures for various applications such as videoconferencing, digital storage media, television broadcasting, Internet streaming, and communication. It is also designed to enable the use of the coded video representation in a flexible manner for a wide variety of network environments. The use of this Recommendation | International Standard allows motion video to be manipulated as a form of computer data and to be stored on various storage media, transmitted and received over existing and future networks and distributed on existing and future broadcasting channels.
The revision approved 2005-03 contained modifications of the video coding standard to add four new profiles, referred to as the High, High 10, High 4:2:2, and High 4:4:4 profiles, to improve video quality capability and to extend the range of applications addressed by the standard (for example, by including support for a greater range of picture sample precision and higher-resolution chroma formats). Additionally, a definition of new types of supplemental data was specified to further broaden the applicability of the video coding standard. Finally, a number of corrections to errors in the published text were included.
Corrigendum 1 to ITU-T Rec. H.264 corrected and updated various minor aspects to bring the ITU-T version of the text up to date relative to the April 2005 output status approved as a new edition of the corresponding jointly-developed and technically-aligned text ISO/IEC 14496-10. It additionally fixed a number of minor errors and needs for clarification and defined three previously-reserved sample aspect ratio indicators.
The H.264 edition published in 2005-11 included the text approved 2005-03 and its Corrigendum 1 approved 2005-09.
Amendment 1 "Support of additional colour spaces and removal of the High 4:4:4 Profile" contained alterations to ITUT Rec. H.264 | ISO/IEC 1449610 Advanced Video Coding to specify the support of additional colour spaces and to remove the definition of the High 4:4:4 Profile.
NOTE – ITU-T Rec. H.264 is a twin text with ISO/IEC 1449610 and this amendment was published in two different documents in the ISO/IEC series:
– The removal of the High 4:4:4 profile was found in ISO/IEC 14496-10:2005/Cor.2.
– The specification for support of additional colour spaces was found in ISO/IEC 14496-10:2005/Amd.1.
Amendment 2 "New profiles for professional applications" contained extensions to ITU-T Rec. H.264 | ISO/IEC 1449610 Advanced Video Coding to specify the support of five additional profiles intended primarily for professional applications (the High 10 Intra, High 4:2:2 Intra, High 4:4:4 Intra, CAVLC 4:4:4 Intra, and High 4:4:4 Predictive profiles) and two new types of supplemental enhancement information (SEI) messages (the post-filter hint SEI message and the tone mapping information SEI message).
Amendment 3 "Scalable video coding" contained extensions to ITU-T Rec. H.264 | ISO/IEC 14496-10 Advanced Video Coding to specify a scalable video coding extension in three profiles (the Scalable Baseline, Scalable High, and Scalable High Intra profiles).
The H.264 edition published in 2005-11 included the text approved 2005-03 and its Corrigendum 1 approved 2005-09. H.264 (2005) Amd.2 (2007) was available only as pre-published text since it was superseded by H.264 Amd.3 (2007-11) before its publication; further, H.264 Amd.3 was not published separately. This third edition integrates into the H.264 edition published in 2005-11 all changes approved in Amendments 1 (2006-06), 2 (2007-04) and 3 (2007-11).
Corrigendum 1 (2009) provides a significant number of minor corrections, clarifications, consistency improvements and formatting improvements drafted in response to accumulated errata reports collected since publication of the 2nd edition (dated 2005-03, which included a Cor.1 approved 2005-09).
Source
Corrigendum 1 to Recommendation ITUT H.264 (2007) was approved on 13 January 2009 by ITUT Study Group 16 (2009-2012) under Recommendation ITUT A.8 procedure.FOREWORD
The International Telecommunication Union (ITU) is the United Nations specialized agency in the field of telecommunications, information and communication technologies (ICTs). The ITU Telecommunication Standardization Sector (ITU-T) is a permanent organ of ITU. ITU-T is responsible for studying technical, operating and tariff questions and issuing Recommendations on them with a view to standardizing telecommunications on a worldwide basis.
The World Telecommunication Standardization Assembly (WTSA), which meets every four years, establishes the topics for study by the ITUT study groups which, in turn, produce Recommendations on these topics.
The approval of ITU-T Recommendations is covered by the procedure laid down in WTSA Resolution 1.
In some areas of information technology which fall within ITU-T's purview, the necessary standards are prepared on a collaborative basis with ISO and IEC.
NOTE
In this Recommendation, the expression "Administration" is used for conciseness to indicate both a telecommunication administration and a recognized operating agency.
Compliance with this Recommendation is voluntary. However, the Recommendation may contain certain mandatory provisions (to ensure e.g. interoperability or applicability) and compliance with the Recommendation is achieved when all of these mandatory provisions are met. The words "shall" or some other obligatory language such as "must" and the negative equivalents are used to express requirements. The use of such words does not suggest that compliance with the Recommendation is required of any party.
INTELLECTUAL PROPERTY RIGHTS
ITU draws attention to the possibility that the practice or implementation of this Recommendation may involve the use of a claimed Intellectual Property Right. ITU takes no position concerning the evidence, validity or applicability of claimed Intellectual Property Rights, whether asserted by ITU members or others outside of the Recommendation development process.
As of the date of approval of this Recommendation, ITU [had/had not] received notice of intellectual property, protected by patents, which may be required to implement this Recommendation. However, implementers are cautioned that this may not represent the latest information and are therefore strongly urged to consult the TSB patent database at HYPERLINK "http://www.itu.int/ITU-T/ipr/" http://www.itu.int/ITU-T/ipr/.
( ITU 2009
All rights reserved. No part of this publication may be reproduced, by any means whatsoever, without the prior written permission of ITU.
CONTENTS
Page
TOC \o "1-6" \h \z HYPERLINK \l "_Toc219707753" Foreword PAGEREF _Toc219707753 \h xix
HYPERLINK \l "_Toc219707754" 0 Introduction PAGEREF _Toc219707754 \h 1
HYPERLINK \l "_Toc219707755" 0.1 Prologue PAGEREF _Toc219707755 \h 1
HYPERLINK \l "_Toc219707756" 0.2 Purpose PAGEREF _Toc219707756 \h 1
HYPERLINK \l "_Toc219707757" 0.3 Applications PAGEREF _Toc219707757 \h 1
HYPERLINK \l "_Toc219707758" 0.4 Publication and versions of this specification PAGEREF _Toc219707758 \h 1
HYPERLINK \l "_Toc219707759" 0.5 Profiles and levels PAGEREF _Toc219707759 \h 2
HYPERLINK \l "_Toc219707760" 0.6 Overview of the design characteristics PAGEREF _Toc219707760 \h 3
HYPERLINK \l "_Toc219707761" 0.6.1 Predictive coding PAGEREF _Toc219707761 \h 3
HYPERLINK \l "_Toc219707762" 0.6.2 Coding of progressive and interlaced video PAGEREF _Toc219707762 \h 3
HYPERLINK \l "_Toc219707763" 0.6.3 Picture partitioning into macroblocks and smaller partitions PAGEREF _Toc219707763 \h 3
HYPERLINK \l "_Toc219707764" 0.6.4 Spatial redundancy reduction PAGEREF _Toc219707764 \h 4
HYPERLINK \l "_Toc219707765" 0.7 How to read this specification PAGEREF _Toc219707765 \h 4
HYPERLINK \l "_Toc219707766" 1 Scope PAGEREF _Toc219707766 \h 4
HYPERLINK \l "_Toc219707767" 2 Normative references PAGEREF _Toc219707767 \h 4
HYPERLINK \l "_Toc219707768" 3 Definitions PAGEREF _Toc219707768 \h 5
HYPERLINK \l "_Toc219707769" 4 Abbreviations PAGEREF _Toc219707769 \h 13
HYPERLINK \l "_Toc219707770" 5 Conventions PAGEREF _Toc219707770 \h 13
HYPERLINK \l "_Toc219707771" 5.1 Arithmetic operators PAGEREF _Toc219707771 \h 13
HYPERLINK \l "_Toc219707776" 5.2 Logical operators PAGEREF _Toc219707776 \h 14
HYPERLINK \l "_Toc219707777" 5.3 Relational operators PAGEREF _Toc219707777 \h 14
HYPERLINK \l "_Toc219707778" 5.4 Bit-wise operators PAGEREF _Toc219707778 \h 14
HYPERLINK \l "_Toc219707779" 5.5 Assignment operators PAGEREF _Toc219707779 \h 15
HYPERLINK \l "_Toc219707780" 5.6 Range notation PAGEREF _Toc219707780 \h 15
HYPERLINK \l "_Toc219707781" 5.7 Mathematical functions PAGEREF _Toc219707781 \h 15
HYPERLINK \l "_Toc219707782" 5.8 Order of operation precedence PAGEREF _Toc219707782 \h 16
HYPERLINK \l "_Toc219707784" 5.9 Variables, syntax elements, and tables PAGEREF _Toc219707784 \h 17
HYPERLINK \l "_Toc219707785" 5.10 Text description of logical operations PAGEREF _Toc219707785 \h 17
HYPERLINK \l "_Toc219707786" 5.11 Processes PAGEREF _Toc219707786 \h 18
HYPERLINK \l "_Toc219707787" 6 Source, coded, decoded and output data formats, scanning processes, and neighbouring relationships PAGEREF _Toc219707787 \h 19
HYPERLINK \l "_Toc219707788" 6.1 Bitstream formats PAGEREF _Toc219707788 \h 19
HYPERLINK \l "_Toc219707789" 6.2 Source, decoded, and output picture formats PAGEREF _Toc219707789 \h 19
HYPERLINK \l "_Toc219707790" 6.3 Spatial subdivision of pictures and slices PAGEREF _Toc219707790 \h 24
HYPERLINK \l "_Toc219707791" 6.4 Inverse scanning processes and derivation processes for neighbours PAGEREF _Toc219707791 \h 25
HYPERLINK \l "_Toc219707792" 6.4.1 Inverse macroblock scanning process PAGEREF _Toc219707792 \h 26
HYPERLINK \l "_Toc219707793" 6.4.2 Inverse macroblock partition and sub-macroblock partition scanning process PAGEREF _Toc219707793 \h 26
HYPERLINK \l "_Toc219707794" 6.4.2.1 Inverse macroblock partition scanning process PAGEREF _Toc219707794 \h 27
HYPERLINK \l "_Toc219707795" 6.4.2.2 Inverse sub-macroblock partition scanning process PAGEREF _Toc219707795 \h 27
HYPERLINK \l "_Toc219707796" 6.4.3 Inverse 4x4 luma block scanning process PAGEREF _Toc219707796 \h 28
HYPERLINK \l "_Toc219707797" 6.4.4 Inverse 4x4 Cb or Cr block scanning process for ChromaArrayType equal to 3 PAGEREF _Toc219707797 \h 28
HYPERLINK \l "_Toc219707798" 6.4.5 Inverse 8x8 luma block scanning process PAGEREF _Toc219707798 \h 28
HYPERLINK \l "_Toc219707799" 6.4.6 Inverse 8x8 Cb or Cr block scanning process for ChromaArrayType equal to 3 PAGEREF _Toc219707799 \h 29
HYPERLINK \l "_Toc219707800" 6.4.7 Derivation process of the availability for macroblock addresses PAGEREF _Toc219707800 \h 29
HYPERLINK \l "_Toc219707801" 6.4.8 Derivation process for neighbouring macroblock addresses and their availability PAGEREF _Toc219707801 \h 29
HYPERLINK \l "_Toc219707802" 6.4.9 Derivation process for neighbouring macroblock addresses and their availability in MBAFF frames PAGEREF _Toc219707802 \h 30
HYPERLINK \l "_Toc219707803" 6.4.10 Derivation processes for neighbouring macroblocks, blocks, and partitions PAGEREF _Toc219707803 \h 30
HYPERLINK \l "_Toc219707804" 6.4.10.1 Derivation process for neighbouring macroblocks PAGEREF _Toc219707804 \h 31
HYPERLINK \l "_Toc219707805" 6.4.10.2 Derivation process for neighbouring 8x8 luma block PAGEREF _Toc219707805 \h 31
HYPERLINK \l "_Toc219707806" 6.4.10.3 Derivation process for neighbouring 8x8 chroma blocks for ChromaArrayType equal to 3 PAGEREF _Toc219707806 \h 32
HYPERLINK \l "_Toc219707807" 6.4.10.4 Derivation process for neighbouring 4x4 luma blocks PAGEREF _Toc219707807 \h 32
HYPERLINK \l "_Toc219707808" 6.4.10.5 Derivation process for neighbouring 4x4 chroma blocks PAGEREF _Toc219707808 \h 33
HYPERLINK \l "_Toc219707809" 6.4.10.6 Derivation process for neighbouring 4x4 chroma blocks for ChromaArrayType equal to 3 PAGEREF _Toc219707809 \h 33
HYPERLINK \l "_Toc219707810" 6.4.10.7 Derivation process for neighbouring partitions PAGEREF _Toc219707810 \h 34
HYPERLINK \l "_Toc219707811" 6.4.11 Derivation process for neighbouring locations PAGEREF _Toc219707811 \h 35
HYPERLINK \l "_Toc219707812" 6.4.11.1 Specification for neighbouring locations in fields and non-MBAFF frames PAGEREF _Toc219707812 \h 35
HYPERLINK \l "_Toc219707813" 6.4.11.2 Specification for neighbouring locations in MBAFF frames PAGEREF _Toc219707813 \h 36
HYPERLINK \l "_Toc219707814" 6.4.12 Derivation processes for block and partition indices PAGEREF _Toc219707814 \h 38
HYPERLINK \l "_Toc219707815" 6.4.12.1 Derivation process for 4x4 luma block indices PAGEREF _Toc219707815 \h 38
HYPERLINK \l "_Toc219707816" 6.4.12.2 Derivation process for 4x4 chroma block indices PAGEREF _Toc219707816 \h 38
HYPERLINK \l "_Toc219707817" 6.4.12.3 Derivation process for 8x8 luma block indices PAGEREF _Toc219707817 \h 38
HYPERLINK \l "_Toc219707818" 6.4.12.4 Derivation process for macroblock and sub-macroblock partition indices PAGEREF _Toc219707818 \h 38
HYPERLINK \l "_Toc219707819" 7 Syntax and semantics PAGEREF _Toc219707819 \h 39
HYPERLINK \l "_Toc219707820" 7.1 Method of specifying syntax in tabular form PAGEREF _Toc219707820 \h 39
HYPERLINK \l "_Toc219707821" 7.2 Specification of syntax functions, categories, and descriptors PAGEREF _Toc219707821 \h 40
HYPERLINK \l "_Toc219707822" 7.3 Syntax in tabular form PAGEREF _Toc219707822 \h 42
HYPERLINK \l "_Toc219707823" 7.3.1 NAL unit syntax PAGEREF _Toc219707823 \h 42
HYPERLINK \l "_Toc219707824" 7.3.2 Raw byte sequence payloads and RBSP trailing bits syntax PAGEREF _Toc219707824 \h 42
HYPERLINK \l "_Toc219707825" 7.3.2.1 Sequence parameter set RBSP syntax PAGEREF _Toc219707825 \h 42
HYPERLINK \l "_Toc219707826" 7.3.2.1.1 Sequence parameter set data syntax PAGEREF _Toc219707826 \h 43
HYPERLINK \l "_Toc219707827" 7.3.2.1.1.1 Scaling list syntax PAGEREF _Toc219707827 \h 44
HYPERLINK \l "_Toc219707828" 7.3.2.1.2 Sequence parameter set extension RBSP syntax PAGEREF _Toc219707828 \h 44
HYPERLINK \l "_Toc219707829" 7.3.2.2 Picture parameter set RBSP syntax PAGEREF _Toc219707829 \h 45
HYPERLINK \l "_Toc219707830" 7.3.2.3 Supplemental enhancement information RBSP syntax PAGEREF _Toc219707830 \h 46
HYPERLINK \l "_Toc219707831" 7.3.2.3.1 Supplemental enhancement information message syntax PAGEREF _Toc219707831 \h 46
HYPERLINK \l "_Toc219707832" 7.3.2.4 Access unit delimiter RBSP syntax PAGEREF _Toc219707832 \h 46
HYPERLINK \l "_Toc219707833" 7.3.2.5 End of sequence RBSP syntax PAGEREF _Toc219707833 \h 47
HYPERLINK \l "_Toc219707834" 7.3.2.6 End of stream RBSP syntax PAGEREF _Toc219707834 \h 47
HYPERLINK \l "_Toc219707835" 7.3.2.7 Filler data RBSP syntax PAGEREF _Toc219707835 \h 47
HYPERLINK \l "_Toc219707836" 7.3.2.8 Slice layer without partitioning RBSP syntax PAGEREF _Toc219707836 \h 47
HYPERLINK \l "_Toc219707837" 7.3.2.9 Slice data partition RBSP syntax PAGEREF _Toc219707837 \h 47
HYPERLINK \l "_Toc219707838" 7.3.2.9.1 Slice data partition A RBSP syntax PAGEREF _Toc219707838 \h 47
HYPERLINK \l "_Toc219707839" 7.3.2.9.2 Slice data partition B RBSP syntax PAGEREF _Toc219707839 \h 48
HYPERLINK \l "_Toc219707840" 7.3.2.9.3 Slice data partition C RBSP syntax PAGEREF _Toc219707840 \h 48
HYPERLINK \l "_Toc219707841" 7.3.2.10 RBSP slice trailing bits syntax PAGEREF _Toc219707841 \h 48
HYPERLINK \l "_Toc219707842" 7.3.2.11 RBSP trailing bits syntax PAGEREF _Toc219707842 \h 48
HYPERLINK \l "_Toc219707843" 7.3.3 Slice header syntax PAGEREF _Toc219707843 \h 49
HYPERLINK \l "_Toc219707844" 7.3.3.1 Reference picture list modification syntax PAGEREF _Toc219707844 \h 50
HYPERLINK \l "_Toc219707845" 7.3.3.2 Prediction weight table syntax PAGEREF _Toc219707845 \h 51
HYPERLINK \l "_Toc219707846" 7.3.3.3 Decoded reference picture marking syntax PAGEREF _Toc219707846 \h 52
HYPERLINK \l "_Toc219707847" 7.3.4 Slice data syntax PAGEREF _Toc219707847 \h 53
HYPERLINK \l "_Toc219707848" 7.3.5 Macroblock layer syntax PAGEREF _Toc219707848 \h 54
HYPERLINK \l "_Toc219707849" 7.3.5.1 Macroblock prediction syntax PAGEREF _Toc219707849 \h 55
HYPERLINK \l "_Toc219707850" 7.3.5.2 Sub-macroblock prediction syntax PAGEREF _Toc219707850 \h 56
HYPERLINK \l "_Toc219707851" 7.3.5.3 Residual data syntax PAGEREF _Toc219707851 \h 57
HYPERLINK \l "_Toc219707852" 7.3.5.3.1 Residual luma syntax PAGEREF _Toc219707852 \h 58
HYPERLINK \l "_Toc219707853" 7.3.5.3.2 Residual block CAVLC syntax PAGEREF _Toc219707853 \h 59
HYPERLINK \l "_Toc219707854" 7.3.5.3.3 Residual block CABAC syntax PAGEREF _Toc219707854 \h 60
HYPERLINK \l "_Toc219707855" 7.4 Semantics PAGEREF _Toc219707855 \h 60
HYPERLINK \l "_Toc219707856" 7.4.1 NAL unit semantics PAGEREF _Toc219707856 \h 61
HYPERLINK \l "_Toc219707857" 7.4.1.1 Encapsulation of an SODB within an RBSP (informative) PAGEREF _Toc219707857 \h 64
HYPERLINK \l "_Toc219707858" 7.4.1.2 Order of NAL units and association to coded pictures, access units, and video sequences PAGEREF _Toc219707858 \h 64
HYPERLINK \l "_Toc219707859" 7.4.1.2.1 Order of sequence and picture parameter set RBSPs and their activation PAGEREF _Toc219707859 \h 65
HYPERLINK \l "_Toc219707860" 7.4.1.2.2 Order of access units and association to coded video sequences PAGEREF _Toc219707860 \h 66
HYPERLINK \l "_Toc219707861" 7.4.1.2.3 Order of NAL units and coded pictures and association to access units PAGEREF _Toc219707861 \h 66
HYPERLINK \l "_Toc219707862" 7.4.1.2.4 Detection of the first VCL NAL unit of a primary coded picture PAGEREF _Toc219707862 \h 68
HYPERLINK \l "_Toc219707863" 7.4.1.2.5 Order of VCL NAL units and association to coded pictures PAGEREF _Toc219707863 \h 69
HYPERLINK \l "_Toc219707864" 7.4.2 Raw byte sequence payloads and RBSP trailing bits semantics PAGEREF _Toc219707864 \h 70
HYPERLINK \l "_Toc219707865" 7.4.2.1 Sequence parameter set RBSP semantics PAGEREF _Toc219707865 \h 70
HYPERLINK \l "_Toc219707866" 7.4.2.1.1 Sequence parameter set data semantics PAGEREF _Toc219707866 \h 70
HYPERLINK \l "_Toc219707867" 7.4.2.1.1.1 Scaling list semantics PAGEREF _Toc219707867 \h 76
HYPERLINK \l "_Toc219707868" 7.4.2.1.2 Sequence parameter set extension RBSP semantics PAGEREF _Toc219707868 \h 76
HYPERLINK \l "_Toc219707869" 7.4.2.2 Picture parameter set RBSP semantics PAGEREF _Toc219707869 \h 78
HYPERLINK \l "_Toc219707870" 7.4.2.3 Supplemental enhancement information RBSP semantics PAGEREF _Toc219707870 \h 81
HYPERLINK \l "_Toc219707871" 7.4.2.3.1 Supplemental enhancement information message semantics PAGEREF _Toc219707871 \h 81
HYPERLINK \l "_Toc219707872" 7.4.2.4 Access unit delimiter RBSP semantics PAGEREF _Toc219707872 \h 81
HYPERLINK \l "_Toc219707873" 7.4.2.5 End of sequence RBSP semantics PAGEREF _Toc219707873 \h 81
HYPERLINK \l "_Toc219707874" 7.4.2.6 End of stream RBSP semantics PAGEREF _Toc219707874 \h 81
HYPERLINK \l "_Toc219707875" 7.4.2.7 Filler data RBSP semantics PAGEREF _Toc219707875 \h 82
HYPERLINK \l "_Toc219707876" 7.4.2.8 Slice layer without partitioning RBSP semantics PAGEREF _Toc219707876 \h 82
HYPERLINK \l "_Toc219707877" 7.4.2.9 Slice data partition RBSP semantics PAGEREF _Toc219707877 \h 82
HYPERLINK \l "_Toc219707878" 7.4.2.9.1 Slice data partition A RBSP semantics PAGEREF _Toc219707878 \h 82
HYPERLINK \l "_Toc219707879" 7.4.2.9.2 Slice data partition B RBSP semantics PAGEREF _Toc219707879 \h 82
HYPERLINK \l "_Toc219707880" 7.4.2.9.3 Slice data partition C RBSP semantics PAGEREF _Toc219707880 \h 83
HYPERLINK \l "_Toc219707881" 7.4.2.10 RBSP slice trailing bits semantics PAGEREF _Toc219707881 \h 83
HYPERLINK \l "_Toc219707882" 7.4.2.11 RBSP trailing bits semantics PAGEREF _Toc219707882 \h 83
HYPERLINK \l "_Toc219707883" 7.4.3 Slice header semantics PAGEREF _Toc219707883 \h 83
HYPERLINK \l "_Toc219707884" 7.4.3.1 Reference picture list modification semantics PAGEREF _Toc219707884 \h 89
HYPERLINK \l "_Toc219707885" 7.4.3.2 Prediction weight table semantics PAGEREF _Toc219707885 \h 90
HYPERLINK \l "_Toc219707886" 7.4.3.3 Decoded reference picture marking semantics PAGEREF _Toc219707886 \h 91
HYPERLINK \l "_Toc219707887" 7.4.4 Slice data semantics PAGEREF _Toc219707887 \h 94
HYPERLINK \l "_Toc219707888" 7.4.5 Macroblock layer semantics PAGEREF _Toc219707888 \h 95
HYPERLINK \l "_Toc219707889" 7.4.5.1 Macroblock prediction semantics PAGEREF _Toc219707889 \h 103
HYPERLINK \l "_Toc219707890" 7.4.5.2 Sub-macroblock prediction semantics PAGEREF _Toc219707890 \h 104
HYPERLINK \l "_Toc219707891" 7.4.5.3 Residual data semantics PAGEREF _Toc219707891 \h 106
HYPERLINK \l "_Toc219707892" 7.4.5.3.1 Residual luma data semantics PAGEREF _Toc219707892 \h 106
HYPERLINK \l "_Toc219707893" 7.4.5.3.2 Residual block CAVLC semantics PAGEREF _Toc219707893 \h 107
HYPERLINK \l "_Toc219707894" 7.4.5.3.3 Residual block CABAC semantics PAGEREF _Toc219707894 \h 107
HYPERLINK \l "_Toc219707895" 8 Decoding process PAGEREF _Toc219707895 \h 108
HYPERLINK \l "_Toc219707896" 8.1 NAL unit decoding process PAGEREF _Toc219707896 \h 109
HYPERLINK \l "_Toc219707897" 8.2 Slice decoding process PAGEREF _Toc219707897 \h 110
HYPERLINK \l "_Toc219707898" 8.2.1 Decoding process for picture order count PAGEREF _Toc219707898 \h 110
HYPERLINK \l "_Toc219707899" 8.2.1.1 Decoding process for picture order count type 0 PAGEREF _Toc219707899 \h 111
HYPERLINK \l "_Toc219707900" 8.2.1.2 Decoding process for picture order count type 1 PAGEREF _Toc219707900 \h 112
HYPERLINK \l "_Toc219707901" 8.2.1.3 Decoding process for picture order count type 2 PAGEREF _Toc219707901 \h 113
HYPERLINK \l "_Toc219707902" 8.2.2 Decoding process for macroblock to slice group map PAGEREF _Toc219707902 \h 114
HYPERLINK \l "_Toc219707903" 8.2.2.1 Specification for interleaved slice group map type PAGEREF _Toc219707903 \h 115
HYPERLINK \l "_Toc219707904" 8.2.2.2 Specification for dispersed slice group map type PAGEREF _Toc219707904 \h 116
HYPERLINK \l "_Toc219707905" 8.2.2.3 Specification for foreground with left-over slice group map type PAGEREF _Toc219707905 \h 116
HYPERLINK \l "_Toc219707906" 8.2.2.4 Specification for box-out slice group map types PAGEREF _Toc219707906 \h 116
HYPERLINK \l "_Toc219707907" 8.2.2.5 Specification for raster scan slice group map types PAGEREF _Toc219707907 \h 117
HYPERLINK \l "_Toc219707908" 8.2.2.6 Specification for wipe slice group map types PAGEREF _Toc219707908 \h 117
HYPERLINK \l "_Toc219707909" 8.2.2.7 Specification for explicit slice group map type PAGEREF _Toc219707909 \h 117
HYPERLINK \l "_Toc219707910" 8.2.2.8 Specification for conversion of map unit to slice group map to macroblock to slice group map PAGEREF _Toc219707910 \h 117
HYPERLINK \l "_Toc219707911" 8.2.3 Decoding process for slice data partitions PAGEREF _Toc219707911 \h 118
HYPERLINK \l "_Toc219707912" 8.2.4 Decoding process for reference picture lists construction PAGEREF _Toc219707912 \h 118
HYPERLINK \l "_Toc219707913" 8.2.4.1 Decoding process for picture numbers PAGEREF _Toc219707913 \h 119
HYPERLINK \l "_Toc219707914" 8.2.4.2 Initialisation process for reference picture lists PAGEREF _Toc219707914 \h 120
HYPERLINK \l "_Toc219707915" 8.2.4.2.1 Initialisation process for the reference picture list for P and SP slices in frames PAGEREF _Toc219707915 \h 120
HYPERLINK \l "_Toc219707916" 8.2.4.2.2 Initialisation process for the reference picture list for P and SP slices in fields PAGEREF _Toc219707916 \h 120
HYPERLINK \l "_Toc219707917" 8.2.4.2.3 Initialisation process for reference picture lists for B slices in frames PAGEREF _Toc219707917 \h 121
HYPERLINK \l "_Toc219707918" 8.2.4.2.4 Initialisation process for reference picture lists for B slices in fields PAGEREF _Toc219707918 \h 121
HYPERLINK \l "_Toc219707919" 8.2.4.2.5 Initialisation process for reference picture lists in fields PAGEREF _Toc219707919 \h 122
HYPERLINK \l "_Toc219707920" 8.2.4.3 Modification process for reference picture lists PAGEREF _Toc219707920 \h 123
HYPERLINK \l "_Toc219707921" 8.2.4.3.1 Modification process of reference picture lists for short-term reference pictures PAGEREF _Toc219707921 \h 123
HYPERLINK \l "_Toc219707922" 8.2.4.3.2 Modification process of reference picture lists for long-term reference pictures PAGEREF _Toc219707922 \h 124
HYPERLINK \l "_Toc219707923" 8.2.5 Decoded reference picture marking process PAGEREF _Toc219707923 \h 125
HYPERLINK \l "_Toc219707924" 8.2.5.1 Sequence of operations for decoded reference picture marking process PAGEREF _Toc219707924 \h 125
HYPERLINK \l "_Toc219707925" 8.2.5.2 Decoding process for gaps in frame_num PAGEREF _Toc219707925 \h 126
HYPERLINK \l "_Toc219707926" 8.2.5.3 Sliding window decoded reference picture marking process PAGEREF _Toc219707926 \h 126
HYPERLINK \l "_Toc219707927" 8.2.5.4 Adaptive memory control decoded reference picture marking process PAGEREF _Toc219707927 \h 127
HYPERLINK \l "_Toc219707928" 8.2.5.4.1 Marking process of a short-term reference picture as "unused for reference" PAGEREF _Toc219707928 \h 127
HYPERLINK \l "_Toc219707929" 8.2.5.4.2 Marking process of a long-term reference picture as "unused for reference" PAGEREF _Toc219707929 \h 127
HYPERLINK \l "_Toc219707930" 8.2.5.4.3 Assignment process of a LongTermFrameIdx to a short-term reference picture PAGEREF _Toc219707930 \h 127
HYPERLINK \l "_Toc219707931" 8.2.5.4.4 Decoding process for MaxLongTermFrameIdx PAGEREF _Toc219707931 \h 128
HYPERLINK \l "_Toc219707932" 8.2.5.4.5 Marking process of all reference pictures as "unused for reference" and setting MaxLongTermFrameIdx to "no long-term frame indices" PAGEREF _Toc219707932 \h 128
HYPERLINK \l "_Toc219707933" 8.2.5.4.6 Process for assigning a long-term frame index to the current picture PAGEREF _Toc219707933 \h 128
HYPERLINK \l "_Toc219707934" 8.3 Intra prediction process PAGEREF _Toc219707934 \h 129
HYPERLINK \l "_Toc219707935" 8.3.1 Intra_4x4 prediction process for luma samples PAGEREF _Toc219707935 \h 129
HYPERLINK \l "_Toc219707936" 8.3.1.1 Derivation process for Intra4x4PredMode PAGEREF _Toc219707936 \h 130
HYPERLINK \l "_Toc219707937" 8.3.1.2 Intra_4x4 sample prediction PAGEREF _Toc219707937 \h 132
HYPERLINK \l "_Toc219707938" 8.3.1.2.1 Specification of Intra_4x4_Vertical prediction mode PAGEREF _Toc219707938 \h 133
HYPERLINK \l "_Toc219707939" 8.3.1.2.2 Specification of Intra_4x4_Horizontal prediction mode PAGEREF _Toc219707939 \h 133
HYPERLINK \l "_Toc219707940" 8.3.1.2.3 Specification of Intra_4x4_DC prediction mode PAGEREF _Toc219707940 \h 133
HYPERLINK \l "_Toc219707941" 8.3.1.2.4 Specification of Intra_4x4_Diagonal_Down_Left prediction mode PAGEREF _Toc219707941 \h 133
HYPERLINK \l "_Toc219707942" 8.3.1.2.5 Specification of Intra_4x4_Diagonal_Down_Right prediction mode PAGEREF _Toc219707942 \h 134
HYPERLINK \l "_Toc219707943" 8.3.1.2.6 Specification of Intra_4x4_Vertical_Right prediction mode PAGEREF _Toc219707943 \h 134
HYPERLINK \l "_Toc219707944" 8.3.1.2.7 Specification of Intra_4x4_Horizontal_Down prediction mode PAGEREF _Toc219707944 \h 135
HYPERLINK \l "_Toc219707945" 8.3.1.2.8 Specification of Intra_4x4_Vertical_Left prediction mode PAGEREF _Toc219707945 \h 135
HYPERLINK \l "_Toc219707946" 8.3.1.2.9 Specification of Intra_4x4_Horizontal_Up prediction mode PAGEREF _Toc219707946 \h 135
HYPERLINK \l "_Toc219707947" 8.3.2 Intra_8x8 prediction process for luma samples PAGEREF _Toc219707947 \h 136
HYPERLINK \l "_Toc219707948" 8.3.2.1 Derivation process for Intra8x8PredMode PAGEREF _Toc219707948 \h 136
HYPERLINK \l "_Toc219707949" 8.3.2.2 Intra_8x8 sample prediction PAGEREF _Toc219707949 \h 138
HYPERLINK \l "_Toc219707950" 8.3.2.2.1 Reference sample filtering process for Intra_8x8 sample prediction PAGEREF _Toc219707950 \h 139
HYPERLINK \l "_Toc219707951" 8.3.2.2.2 Specification of Intra_8x8_Vertical prediction mode PAGEREF _Toc219707951 \h 140
HYPERLINK \l "_Toc219707952" 8.3.2.2.3 Specification of Intra_8x8_Horizontal prediction mode PAGEREF _Toc219707952 \h 141
HYPERLINK \l "_Toc219707953" 8.3.2.2.4 Specification of Intra_8x8_DC prediction mode PAGEREF _Toc219707953 \h 141
HYPERLINK \l "_Toc219707954" 8.3.2.2.5 Specification of Intra_8x8_Diagonal_Down_Left prediction mode PAGEREF _Toc219707954 \h 141
HYPERLINK \l "_Toc219707955" 8.3.2.2.6 Specification of Intra_8x8_Diagonal_Down_Right prediction mode PAGEREF _Toc219707955 \h 142
HYPERLINK \l "_Toc219707956" 8.3.2.2.7 Specification of Intra_8x8_Vertical_Right prediction mode PAGEREF _Toc219707956 \h 142
HYPERLINK \l "_Toc219707957" 8.3.2.2.8 Specification of Intra_8x8_Horizontal_Down prediction mode PAGEREF _Toc219707957 \h 142
HYPERLINK \l "_Toc219707958" 8.3.2.2.9 Specification of Intra_8x8_Vertical_Left prediction mode PAGEREF _Toc219707958 \h 143
HYPERLINK \l "_Toc219707959" 8.3.2.2.10 Specification of Intra_8x8_Horizontal_Up prediction mode PAGEREF _Toc219707959 \h 143
HYPERLINK \l "_Toc219707960" 8.3.3 Intra_16x16 prediction process for luma samples PAGEREF _Toc219707960 \h 143
HYPERLINK \l "_Toc219707961" 8.3.3.1 Specification of Intra_16x16_Vertical prediction mode PAGEREF _Toc219707961 \h 144
HYPERLINK \l "_Toc219707962" 8.3.3.2 Specification of Intra_16x16_Horizontal prediction mode PAGEREF _Toc219707962 \h 145
HYPERLINK \l "_Toc219707963" 8.3.3.3 Specification of Intra_16x16_DC prediction mode PAGEREF _Toc219707963 \h 145
HYPERLINK \l "_Toc219707964" 8.3.3.4 Specification of Intra_16x16_Plane prediction mode PAGEREF _Toc219707964 \h 145
HYPERLINK \l "_Toc219707965" 8.3.4 Intra prediction process for chroma samples PAGEREF _Toc219707965 \h 146
HYPERLINK \l "_Toc219707966" 8.3.4.1 Specification of Intra_Chroma_DC prediction mode PAGEREF _Toc219707966 \h 147
HYPERLINK \l "_Toc219707967" 8.3.4.2 Specification of Intra_Chroma_Horizontal prediction mode PAGEREF _Toc219707967 \h 149
HYPERLINK \l "_Toc219707968" 8.3.4.3 Specification of Intra_Chroma_Vertical prediction mode PAGEREF _Toc219707968 \h 149
HYPERLINK \l "_Toc219707969" 8.3.4.4 Specification of Intra_Chroma_Plane prediction mode PAGEREF _Toc219707969 \h 149
HYPERLINK \l "_Toc219707970" 8.3.4.5 Intra prediction for chroma samples with ChromaArrayType equal to 3 PAGEREF _Toc219707970 \h 149
HYPERLINK \l "_Toc219707971" 8.3.5 Sample construction process for I_PCM macroblocks PAGEREF _Toc219707971 \h 150
HYPERLINK \l "_Toc219707972" 8.4 Inter prediction process PAGEREF _Toc219707972 \h 151
HYPERLINK \l "_Toc219707973" 8.4.1 Derivation process for motion vector components and reference indices PAGEREF _Toc219707973 \h 153
HYPERLINK \l "_Toc219707974" 8.4.1.1 Derivation process for luma motion vectors for skipped macroblocks in P and SP slices PAGEREF _Toc219707974 \h 154
HYPERLINK \l "_Toc219707975" 8.4.1.2 Derivation process for luma motion vectors for B_Skip, B_Direct_16x16, and B_Direct_8x8 PAGEREF _Toc219707975 \h 155
HYPERLINK \l "_Toc219707976" 8.4.1.2.1 Derivation process for the co-located 4x4 sub-macroblock partitions PAGEREF _Toc219707976 \h 155
HYPERLINK \l "_Toc219707977" 8.4.1.2.2 Derivation process for spatial direct luma motion vector and reference index prediction mode PAGEREF _Toc219707977 \h 158
HYPERLINK \l "_Toc219707978" 8.4.1.2.3 Derivation process for temporal direct luma motion vector and reference index prediction mode PAGEREF _Toc219707978 \h 159
HYPERLINK \l "_Toc219707979" 8.4.1.3 Derivation process for luma motion vector prediction PAGEREF _Toc219707979 \h 162
HYPERLINK \l "_Toc219707980" 8.4.1.3.1 Derivation process for median luma motion vector prediction PAGEREF _Toc219707980 \h 163
HYPERLINK \l "_Toc219707981" 8.4.1.3.2 Derivation process for motion data of neighbouring partitions PAGEREF _Toc219707981 \h 164
HYPERLINK \l "_Toc219707982" 8.4.1.4 Derivation process for chroma motion vectors PAGEREF _Toc219707982 \h 165
HYPERLINK \l "_Toc219707983" 8.4.2 Decoding process for Inter prediction samples PAGEREF _Toc219707983 \h 165
HYPERLINK \l "_Toc219707984" 8.4.2.1 Reference picture selection process PAGEREF _Toc219707984 \h 166
HYPERLINK \l "_Toc219707985" 8.4.2.2 Fractional sample interpolation process PAGEREF _Toc219707985 \h 167
HYPERLINK \l "_Toc219707986" 8.4.2.2.1 Luma sample interpolation process PAGEREF _Toc219707986 \h 168
HYPERLINK \l "_Toc219707987" 8.4.2.2.2 Chroma sample interpolation process PAGEREF _Toc219707987 \h 171
HYPERLINK \l "_Toc219707988" 8.4.2.3 Weighted sample prediction process PAGEREF _Toc219707988 \h 172
HYPERLINK \l "_Toc219707989" 8.4.2.3.1 Default weighted sample prediction process PAGEREF _Toc219707989 \h 173
HYPERLINK \l "_Toc219707990" 8.4.2.3.2 Weighted sample prediction process PAGEREF _Toc219707990 \h 173
HYPERLINK \l "_Toc219707991" 8.4.3 Derivation process for prediction weights PAGEREF _Toc219707991 \h 174
HYPERLINK \l "_Toc219707992" 8.5 Transform coefficient decoding process and picture construction process prior to deblocking filter process PAGEREF _Toc219707992 \h 176
HYPERLINK \l "_Toc219707993" 8.5.1 Specification of transform decoding process for 4x4 luma residual blocks PAGEREF _Toc219707993 \h 176
HYPERLINK \l "_Toc219707994" 8.5.2 Specification of transform decoding process for luma samples of Intra_16x16 macroblock prediction mode PAGEREF _Toc219707994 \h 177
HYPERLINK \l "_Toc219707995" 8.5.3 Specification of transform decoding process for 8x8 luma residual blocks PAGEREF _Toc219707995 \h 178
HYPERLINK \l "_Toc219707996" 8.5.4 Specification of transform decoding process for chroma samples PAGEREF _Toc219707996 \h 178
HYPERLINK \l "_Toc219707997" 8.5.5 Specification of transform decoding process for chroma samples with ChromaArrayType equal to 3 PAGEREF _Toc219707997 \h 180
HYPERLINK \l "_Toc219707998" 8.5.6 Inverse scanning process for 4x4 transform coefficients and scaling lists PAGEREF _Toc219707998 \h 181
HYPERLINK \l "_Toc219707999" 8.5.7 Inverse scanning process for 8x8 transform coefficients and scaling lists PAGEREF _Toc219707999 \h 182
HYPERLINK \l "_Toc219708000" 8.5.8 Derivation process for chroma quantisation parameters PAGEREF _Toc219708000 \h 184
HYPERLINK \l "_Toc219708001" 8.5.9 Derivation process for scaling functions PAGEREF _Toc219708001 \h 184
HYPERLINK \l "_Toc219708002" 8.5.10 Scaling and transformation process for DC transform coefficients for Intra_16x16 macroblock type PAGEREF _Toc219708002 \h 186
HYPERLINK \l "_Toc219708003" 8.5.11 Scaling and transformation process for chroma DC transform coefficients PAGEREF _Toc219708003 \h 187
HYPERLINK \l "_Toc219708004" 8.5.11.1 Transformation process for chroma DC transform coefficients PAGEREF _Toc219708004 \h 187
HYPERLINK \l "_Toc219708005" 8.5.11.2 Scaling process for chroma DC transform coefficients PAGEREF _Toc219708005 \h 188
HYPERLINK \l "_Toc219708006" 8.5.12 Scaling and transformation process for residual 4x4 blocks PAGEREF _Toc219708006 \h 188
HYPERLINK \l "_Toc219708007" 8.5.12.1 Scaling process for residual 4x4 blocks PAGEREF _Toc219708007 \h 189
HYPERLINK \l "_Toc219708008" 8.5.12.2 Transformation process for residual 4x4 blocks PAGEREF _Toc219708008 \h 190
HYPERLINK \l "_Toc219708009" 8.5.13 Scaling and transformation process for residual 8x8 blocks PAGEREF _Toc219708009 \h 191
HYPERLINK \l "_Toc219708010" 8.5.13.1 Scaling process for residual 8x8 blocks PAGEREF _Toc219708010 \h 192
HYPERLINK \l "_Toc219708011" 8.5.13.2 Transformation process for residual 8x8 blocks PAGEREF _Toc219708011 \h 192
HYPERLINK \l "_Toc219708012" 8.5.14 Picture construction process prior to deblocking filter process PAGEREF _Toc219708012 \h 195
HYPERLINK \l "_Toc219708013" 8.5.15 Intra residual transform-bypass decoding process PAGEREF _Toc219708013 \h 196
HYPERLINK \l "_Toc219708014" 8.6 Decoding process for P macroblocks in SP slices or SI macroblocks PAGEREF _Toc219708014 \h 197
HYPERLINK \l "_Toc219708015" 8.6.1 SP decoding process for non-switching pictures PAGEREF _Toc219708015 \h 197
HYPERLINK \l "_Toc219708016" 8.6.1.1 Luma transform coefficient decoding process PAGEREF _Toc219708016 \h 197
HYPERLINK \l "_Toc219708017" 8.6.1.2 Chroma transform coefficient decoding process PAGEREF _Toc219708017 \h 198
HYPERLINK \l "_Toc219708018" 8.6.2 SP and SI slice decoding process for switching pictures PAGEREF _Toc219708018 \h 200
HYPERLINK \l "_Toc219708019" 8.6.2.1 Luma transform coefficient decoding process PAGEREF _Toc219708019 \h 200
HYPERLINK \l "_Toc219708020" 8.6.2.2 Chroma transform coefficient decoding process PAGEREF _Toc219708020 \h 200
HYPERLINK \l "_Toc219708021" 8.7 Deblocking filter process PAGEREF _Toc219708021 \h 201
HYPERLINK \l "_Toc219708022" 8.7.1 Filtering process for block edges PAGEREF _Toc219708022 \h 206
HYPERLINK \l "_Toc219708023" 8.7.2 Filtering process for a set of samples across a horizontal or vertical block edge PAGEREF _Toc219708023 \h 207
HYPERLINK \l "_Toc219708024" 8.7.2.1 Derivation process for the luma content dependent boundary filtering strength PAGEREF _Toc219708024 \h 208
HYPERLINK \l "_Toc219708025" 8.7.2.2 Derivation process for the thresholds for each block edge PAGEREF _Toc219708025 \h 210
HYPERLINK \l "_Toc219708026" 8.7.2.3 Filtering process for edges with bS less than 4 PAGEREF _Toc219708026 \h 211
HYPERLINK \l "_Toc219708027" 8.7.2.4 Filtering process for edges for bS equal to 4 PAGEREF _Toc219708027 \h 213
HYPERLINK \l "_Toc219708028" 9 Parsing process PAGEREF _Toc219708028 \h 214
HYPERLINK \l "_Toc219708029" 9.1 Parsing process for Exp-Golomb codes PAGEREF _Toc219708029 \h 214
HYPERLINK \l "_Toc219708030" 9.1.1 Mapping process for signed Exp-Golomb codes PAGEREF _Toc219708030 \h 216
HYPERLINK \l "_Toc219708031" 9.1.2 Mapping process for coded block pattern PAGEREF _Toc219708031 \h 216
HYPERLINK \l "_Toc219708032" 9.2 CAVLC parsing process for transform coefficient levels PAGEREF _Toc219708032 \h 219
HYPERLINK \l "_Toc219708033" 9.2.1 Parsing process for total number of transform coefficient levels and trailing ones PAGEREF _Toc219708033 \h 220
HYPERLINK \l "_Toc219708034" 9.2.2 Parsing process for level information PAGEREF _Toc219708034 \h 223
HYPERLINK \l "_Toc219708035" 9.2.2.1 Parsing process for level_prefix PAGEREF _Toc219708035 \h 224
HYPERLINK \l "_Toc219708036" 9.2.3 Parsing process for run information PAGEREF _Toc219708036 \h 225
HYPERLINK \l "_Toc219708037" 9.2.4 Combining level and run information PAGEREF _Toc219708037 \h 228
HYPERLINK \l "_Toc219708038" 9.3 CABAC parsing process for slice data PAGEREF _Toc219708038 \h 228
HYPERLINK \l "_Toc219708039" 9.3.1 Initialisation process PAGEREF _Toc219708039 \h 229
HYPERLINK \l "_Toc219708040" 9.3.1.1 Initialisation process for context variables PAGEREF _Toc219708040 \h 230
HYPERLINK \l "_Toc219708041" 9.3.1.2 Initialisation process for the arithmetic decoding engine PAGEREF _Toc219708041 \h 253
HYPERLINK \l "_Toc219708042" 9.3.2 Binarization process PAGEREF _Toc219708042 \h 253
HYPERLINK \l "_Toc219708043" 9.3.2.1 Unary (U) binarization process PAGEREF _Toc219708043 \h 257
HYPERLINK \l "_Toc219708044" 9.3.2.2 Truncated unary (TU) binarization process PAGEREF _Toc219708044 \h 258
HYPERLINK \l "_Toc219708045" 9.3.2.3 Concatenated unary/ k-th order Exp-Golomb (UEGk) binarization process PAGEREF _Toc219708045 \h 258
HYPERLINK \l "_Toc219708046" 9.3.2.4 Fixed-length (FL) binarization process PAGEREF _Toc219708046 \h 259
HYPERLINK \l "_Toc219708047" 9.3.2.5 Binarization process for macroblock type and sub-macroblock type PAGEREF _Toc219708047 \h 259
HYPERLINK \l "_Toc219708048" 9.3.2.6 Binarization process for coded block pattern PAGEREF _Toc219708048 \h 262
HYPERLINK \l "_Toc219708049" 9.3.2.7 Binarization process for mb_qp_delta PAGEREF _Toc219708049 \h 262
HYPERLINK \l "_Toc219708050" 9.3.3 Decoding process flow PAGEREF _Toc219708050 \h 262
HYPERLINK \l "_Toc219708051" 9.3.3.1 Derivation process for ctxIdx PAGEREF _Toc219708051 \h 263
HYPERLINK \l "_Toc219708052" 9.3.3.1.1 Assignment process of ctxIdxInc using neighbouring syntax elements PAGEREF _Toc219708052 \h 265
HYPERLINK \l "_Toc219708053" 9.3.3.1.1.1 Derivation process of ctxIdxInc for the syntax element mb_skip_flag PAGEREF _Toc219708053 \h 265
HYPERLINK \l "_Toc219708054" 9.3.3.1.1.2 Derivation process of ctxIdxInc for the syntax element mb_field_decoding_flag PAGEREF _Toc219708054 \h 265
HYPERLINK \l "_Toc219708055" 9.3.3.1.1.3 Derivation process of ctxIdxInc for the syntax element mb_type PAGEREF _Toc219708055 \h 266
HYPERLINK \l "_Toc219708056" 9.3.3.1.1.4 Derivation process of ctxIdxInc for the syntax element coded_block_pattern PAGEREF _Toc219708056 \h 266
HYPERLINK \l "_Toc219708057" 9.3.3.1.1.5 Derivation process of ctxIdxInc for the syntax element mb_qp_delta PAGEREF _Toc219708057 \h 267
HYPERLINK \l "_Toc219708058" 9.3.3.1.1.6 Derivation process of ctxIdxInc for the syntax elements ref_idx_l0 and ref_idx_l1 PAGEREF _Toc219708058 \h 267
HYPERLINK \l "_Toc219708059" 9.3.3.1.1.7 Derivation process of ctxIdxInc for the syntax elements mvd_l0 and mvd_l1 PAGEREF _Toc219708059 \h 268
HYPERLINK \l "_Toc219708060" 9.3.3.1.1.8 Derivation process of ctxIdxInc for the syntax element intra_chroma_pred_mode PAGEREF _Toc219708060 \h 269
HYPERLINK \l "_Toc219708061" 9.3.3.1.1.9 Derivation process of ctxIdxInc for the syntax element coded_block_flag PAGEREF _Toc219708061 \h 270
HYPERLINK \l "_Toc219708062" 9.3.3.1.1.10 Derivation process of ctxIdxInc for the syntax element transform_size_8x8_flag PAGEREF _Toc219708062 \h 272
HYPERLINK \l "_Toc219708063" 9.3.3.1.2 Assignment process of ctxIdxInc using prior decoded bin values PAGEREF _Toc219708063 \h 273
HYPERLINK \l "_Toc219708064" 9.3.3.1.3 Assignment process of ctxIdxInc for syntax elements significant_coeff_flag, last_significant_coeff_flag, and coeff_abs_level_minus1 PAGEREF _Toc219708064 \h 273
HYPERLINK \l "_Toc219708065" 9.3.3.2 Arithmetic decoding process PAGEREF _Toc219708065 \h 276
HYPERLINK \l "_Toc219708066" 9.3.3.2.1 Arithmetic decoding process for a binary decision PAGEREF _Toc219708066 \h 277
HYPERLINK \l "_Toc219708067" 9.3.3.2.1.1 State transition process PAGEREF _Toc219708067 \h 278
HYPERLINK \l "_Toc219708068" 9.3.3.2.2 Renormalization process in the arithmetic decoding engine PAGEREF _Toc219708068 \h 280
HYPERLINK \l "_Toc219708069" 9.3.3.2.3 Bypass decoding process for binary decisions PAGEREF _Toc219708069 \h 281
HYPERLINK \l "_Toc219708070" 9.3.3.2.4 Decoding process for binary decisions before termination PAGEREF _Toc219708070 \h 281
HYPERLINK \l "_Toc219708071" 9.3.4 Arithmetic encoding process (informative) PAGEREF _Toc219708071 \h 282
HYPERLINK \l "_Toc219708072" 9.3.4.1 Initialisation process for the arithmetic encoding engine (informative) PAGEREF _Toc219708072 \h 282
HYPERLINK \l "_Toc219708073" 9.3.4.2 Encoding process for a binary decision (informative) PAGEREF _Toc219708073 \h 283
HYPERLINK \l "_Toc219708074" 9.3.4.3 Renormalization process in the arithmetic encoding engine (informative) PAGEREF _Toc219708074 \h 284
HYPERLINK \l "_Toc219708075" 9.3.4.4 Bypass encoding process for binary decisions (informative) PAGEREF _Toc219708075 \h 286
HYPERLINK \l "_Toc219708076" 9.3.4.5 Encoding process for a binary decision before termination (informative) PAGEREF _Toc219708076 \h 287
HYPERLINK \l "_Toc219708077" 9.3.4.6 Byte stuffing process (informative) PAGEREF _Toc219708077 \h 288
HYPERLINK \l "_Toc219708078" Annex A Profiles and levels PAGEREF _Toc219708078 \h 290
HYPERLINK \l "_Toc219708079" A.1 Requirements on video decoder capability PAGEREF _Toc219708079 \h 290
HYPERLINK \l "_Toc219708080" A.2 Profiles PAGEREF _Toc219708080 \h 290
HYPERLINK \l "_Toc219708081" A.2.1 Baseline profile PAGEREF _Toc219708081 \h 290
HYPERLINK \l "_Toc219708082" A.2.1.1 Constrained Baseline bitstreams and decoders PAGEREF _Toc219708082 \h 291
HYPERLINK \l "_Toc219708083" A.2.2 Main profile PAGEREF _Toc219708083 \h 291
HYPERLINK \l "_Toc219708084" A.2.3 Extended profile PAGEREF _Toc219708084 \h 291
HYPERLINK \l "_Toc219708085" A.2.4 High profile PAGEREF _Toc219708085 \h 292
HYPERLINK \l "_Toc219708086" A.2.5 High 10 profile PAGEREF _Toc219708086 \h 292
HYPERLINK \l "_Toc219708087" A.2.6 High 4:2:2 profile PAGEREF _Toc219708087 \h 292
HYPERLINK \l "_Toc219708088" A.2.7 High 4:4:4 Predictive profile PAGEREF _Toc219708088 \h 293
HYPERLINK \l "_Toc219708089" A.2.8 High 10 Intra profile PAGEREF _Toc219708089 \h 293
HYPERLINK \l "_Toc219708090" A.2.9 High 4:2:2 Intra profile PAGEREF _Toc219708090 \h 294
HYPERLINK \l "_Toc219708091" A.2.10 High 4:4:4 Intra profile PAGEREF _Toc219708091 \h 294
HYPERLINK \l "_Toc219708092" A.2.11 CAVLC 4:4:4 Intra profile PAGEREF _Toc219708092 \h 295
HYPERLINK \l "_Toc219708093" A.3 Levels PAGEREF _Toc219708093 \h 295
HYPERLINK \l "_Toc219708094" A.3.1 Level limits common to the Baseline, Main, and Extended profiles PAGEREF _Toc219708094 \h 295
HYPERLINK \l "_Toc219708095" A.3.2 Level limits common to the High, High 10, High 4:2:2, High 4:4:4 Predictive, High 10 Intra, High 4:2:2 Intra, High 4:4:4 Intra, and CAVLC 4:4:4 Intra profiles PAGEREF _Toc219708095 \h 298
HYPERLINK \l "_Toc219708096" A.3.3 Profile-specific level limits PAGEREF _Toc219708096 \h 299
HYPERLINK \l "_Toc219708097" A.3.3.1 Baseline profile level limits PAGEREF _Toc219708097 \h 301
HYPERLINK \l "_Toc219708098" A.3.3.2 Main, High, High 10, High 4:2:2, High 4:4:4 Predictive, High 10 Intra, High 4:2:2 Intra, High 4:4:4 Intra, and CAVLC 4:4:4 Intra profile level limits PAGEREF _Toc219708098 \h 302
HYPERLINK \l "_Toc219708099" A.3.3.3 Extended Profile level limits PAGEREF _Toc219708099 \h 303
HYPERLINK \l "_Toc219708100" A.3.4 Effect of level limits on frame rate (informative) PAGEREF _Toc219708100 \h 305
HYPERLINK \l "_Toc219708101" A.3.5 Effect of level limits on maximum DPB size in units of frames (informative) PAGEREF _Toc219708101 \h 307
HYPERLINK \l "_Toc219708102" Annex B Byte stream format PAGEREF _Toc219708102 \h 309
HYPERLINK \l "_Toc219708103" B.1 Byte stream NAL unit syntax and semantics PAGEREF _Toc219708103 \h 309
HYPERLINK \l "_Toc219708104" B.1.1 Byte stream NAL unit syntax PAGEREF _Toc219708104 \h 309
HYPERLINK \l "_Toc219708105" B.1.2 Byte stream NAL unit semantics PAGEREF _Toc219708105 \h 309
HYPERLINK \l "_Toc219708106" B.2 Byte stream NAL unit decoding process PAGEREF _Toc219708106 \h 310
HYPERLINK \l "_Toc219708107" B.3 Decoder byte-alignment recovery (informative) PAGEREF _Toc219708107 \h 310
HYPERLINK \l "_Toc219708108" Annex C Hypothetical reference decoder PAGEREF _Toc219708108 \h 311
HYPERLINK \l "_Toc219708109" C.1 Operation of coded picture buffer (CPB) PAGEREF _Toc219708109 \h 314
HYPERLINK \l "_Toc219708110" C.1.1 Timing of bitstream arrival PAGEREF _Toc219708110 \h 314
HYPERLINK \l "_Toc219708111" C.1.2 Timing of coded picture removal PAGEREF _Toc219708111 \h 315
HYPERLINK \l "_Toc219708112" C.2 Operation of the decoded picture buffer (DPB) PAGEREF _Toc219708112 \h 316
HYPERLINK \l "_Toc219708113" C.2.1 Decoding of gaps in frame_num and storage of "non-existing" frames PAGEREF _Toc219708113 \h 316
HYPERLINK \l "_Toc219708114" C.2.2 Picture decoding and output PAGEREF _Toc219708114 \h 316
HYPERLINK \l "_Toc219708115" C.2.3 Removal of pictures from the DPB before possible insertion of the current picture PAGEREF _Toc219708115 \h 317
HYPERLINK \l "_Toc219708116" C.2.4 Current decoded picture marking and storage PAGEREF _Toc219708116 \h 317
HYPERLINK \l "_Toc219708117" C.2.4.1 Marking and storage of a reference decoded picture into the DPB PAGEREF _Toc219708117 \h 317
HYPERLINK \l "_Toc219708118" C.2.4.2 Storage of a non-reference picture into the DPB PAGEREF _Toc219708118 \h 318
HYPERLINK \l "_Toc219708119" C.3 Bitstream conformance PAGEREF _Toc219708119 \h 318
HYPERLINK \l "_Toc219708120" C.4 Decoder conformance PAGEREF _Toc219708120 \h 319
HYPERLINK \l "_Toc219708121" C.4.1 Operation of the output order DPB PAGEREF _Toc219708121 \h 320
HYPERLINK \l "_Toc219708122" C.4.2 Decoding of gaps in frame_num and storage of "non-existing" pictures PAGEREF _Toc219708122 \h 320
HYPERLINK \l "_Toc219708123" C.4.3 Picture decoding PAGEREF _Toc219708123 \h 320
HYPERLINK \l "_Toc219708124" C.4.4 Removal of pictures from the DPB before possible insertion of the current picture PAGEREF _Toc219708124 \h 320
HYPERLINK \l "_Toc219708125" C.4.5 Current decoded picture marking and storage PAGEREF _Toc219708125 \h 321
HYPERLINK \l "_Toc219708126" C.4.5.1 Storage and marking of a reference decoded picture into the DPB PAGEREF _Toc219708126 \h 321
HYPERLINK \l "_Toc219708127" C.4.5.2 Storage and marking of a non-reference decoded picture into the DPB PAGEREF _Toc219708127 \h 322
HYPERLINK \l "_Toc219708128" C.4.5.3 "Bumping" process PAGEREF _Toc219708128 \h 322
HYPERLINK \l "_Toc219708129" Annex D Supplemental enhancement information PAGEREF _Toc219708129 \h 324
HYPERLINK \l "_Toc219708130" D.1 SEI payload syntax PAGEREF _Toc219708130 \h 325
HYPERLINK \l "_Toc219708131" D.1.1 Buffering period SEI message syntax PAGEREF _Toc219708131 \h 326
HYPERLINK \l "_Toc219708132" D.1.2 Picture timing SEI message syntax PAGEREF _Toc219708132 \h 327
HYPERLINK \l "_Toc219708133" D.1.3 Pan-scan rectangle SEI message syntax PAGEREF _Toc219708133 \h 328
HYPERLINK \l "_Toc219708134" D.1.4 Filler payload SEI message syntax PAGEREF _Toc219708134 \h 328
HYPERLINK \l "_Toc219708135" D.1.5 User data registered by ITU-T Rec. T.35 SEI message syntax PAGEREF _Toc219708135 \h 328
HYPERLINK \l "_Toc219708136" D.1.6 User data unregistered SEI message syntax PAGEREF _Toc219708136 \h 329
HYPERLINK \l "_Toc219708137" D.1.7 Recovery point SEI message syntax PAGEREF _Toc219708137 \h 329
HYPERLINK \l "_Toc219708138" D.1.8 Decoded reference picture marking repetition SEI message syntax PAGEREF _Toc219708138 \h 329
HYPERLINK \l "_Toc219708139" D.1.9 Spare picture SEI message syntax PAGEREF _Toc219708139 \h 330
HYPERLINK \l "_Toc219708140" D.1.10 Scene information SEI message syntax PAGEREF _Toc219708140 \h 330
HYPERLINK \l "_Toc219708141" D.1.11 Sub-sequence information SEI message syntax PAGEREF _Toc219708141 \h 331
HYPERLINK \l "_Toc219708142" D.1.12 Sub-sequence layer characteristics SEI message syntax PAGEREF _Toc219708142 \h 331
HYPERLINK \l "_Toc219708143" D.1.13 Sub-sequence characteristics SEI message syntax PAGEREF _Toc219708143 \h 331
HYPERLINK \l "_Toc219708144" D.1.14 Full-frame freeze SEI message syntax PAGEREF _Toc219708144 \h 332
HYPERLINK \l "_Toc219708145" D.1.15 Full-frame freeze release SEI message syntax PAGEREF _Toc219708145 \h 332
HYPERLINK \l "_Toc219708146" D.1.16 Full-frame snapshot SEI message syntax PAGEREF _Toc219708146 \h 332
HYPERLINK \l "_Toc219708147" D.1.17 Progressive refinement segment start SEI message syntax PAGEREF _Toc219708147 \h 332
HYPERLINK \l "_Toc219708148" D.1.18 Progressive refinement segment end SEI message syntax PAGEREF _Toc219708148 \h 332
HYPERLINK \l "_Toc219708149" D.1.19 Motion-constrained slice group set SEI message syntax PAGEREF _Toc219708149 \h 332
HYPERLINK \l "_Toc219708150" D.1.20 Film grain characteristics SEI message syntax PAGEREF _Toc219708150 \h 333
HYPERLINK \l "_Toc219708151" D.1.21 Deblocking filter display preference SEI message syntax PAGEREF _Toc219708151 \h 333
HYPERLINK \l "_Toc219708152" D.1.22 Stereo video information SEI message syntax PAGEREF _Toc219708152 \h 334
HYPERLINK \l "_Toc219708153" D.1.23 Post-filter hint SEI message syntax PAGEREF _Toc219708153 \h 334
HYPERLINK \l "_Toc219708154" D.1.24 Tone mapping information SEI message syntax PAGEREF _Toc219708154 \h 335
HYPERLINK \l "_Toc219708155" D.1.25 Reserved SEI message syntax PAGEREF _Toc219708155 \h 335
HYPERLINK \l "_Toc219708156" D.2 SEI payload semantics PAGEREF _Toc219708156 \h 335
HYPERLINK \l "_Toc219708157" D.2.1 Buffering period SEI message semantics PAGEREF _Toc219708157 \h 335
HYPERLINK \l "_Toc219708158" D.2.2 Picture timing SEI message semantics PAGEREF _Toc219708158 \h 336
HYPERLINK \l "_Toc219708159" D.2.3 Pan-scan rectangle SEI message semantics PAGEREF _Toc219708159 \h 341
HYPERLINK \l "_Toc219708160" D.2.4 Filler payload SEI message semantics PAGEREF _Toc219708160 \h 342
HYPERLINK \l "_Toc219708161" D.2.5 User data registered by ITU-T Rec. T.35 SEI message semantics PAGEREF _Toc219708161 \h 342
HYPERLINK \l "_Toc219708162" D.2.6 User data unregistered SEI message semantics PAGEREF _Toc219708162 \h 343
HYPERLINK \l "_Toc219708163" D.2.7 Recovery point SEI message semantics PAGEREF _Toc219708163 \h 343
HYPERLINK \l "_Toc219708164" D.2.8 Decoded reference picture marking repetition SEI message semantics PAGEREF _Toc219708164 \h 345
HYPERLINK \l "_Toc219708165" D.2.9 Spare picture SEI message semantics PAGEREF _Toc219708165 \h 345
HYPERLINK \l "_Toc219708166" D.2.10 Scene information SEI message semantics PAGEREF _Toc219708166 \h 347
HYPERLINK \l "_Toc219708167" D.2.11 Sub-sequence information SEI message semantics PAGEREF _Toc219708167 \h 348
HYPERLINK \l "_Toc219708168" D.2.12 Sub-sequence layer characteristics SEI message semantics PAGEREF _Toc219708168 \h 350
HYPERLINK \l "_Toc219708169" D.2.13 Sub-sequence characteristics SEI message semantics PAGEREF _Toc219708169 \h 351
HYPERLINK \l "_Toc219708170" D.2.14 Full-frame freeze SEI message semantics PAGEREF _Toc219708170 \h 352
HYPERLINK \l "_Toc219708171" D.2.15 Full-frame freeze release SEI message semantics PAGEREF _Toc219708171 \h 352
HYPERLINK \l "_Toc219708172" D.2.16 Full-frame snapshot SEI message semantics PAGEREF _Toc219708172 \h 352
HYPERLINK \l "_Toc219708173" D.2.17 Progressive refinement segment start SEI message semantics PAGEREF _Toc219708173 \h 353
HYPERLINK \l "_Toc219708174" D.2.18 Progressive refinement segment end SEI message semantics PAGEREF _Toc219708174 \h 353
HYPERLINK \l "_Toc219708175" D.2.19 Motion-constrained slice group set SEI message semantics PAGEREF _Toc219708175 \h 353
HYPERLINK \l "_Toc219708176" D.2.20 Film grain characteristics SEI message semantics PAGEREF _Toc219708176 \h 354
HYPERLINK \l "_Toc219708177" D.2.21 Deblocking filter display preference SEI message semantics PAGEREF _Toc219708177 \h 360
HYPERLINK \l "_Toc219708178" D.2.22 Stereo video information SEI message semantics PAGEREF _Toc219708178 \h 361
HYPERLINK \l "_Toc219708179" D.2.23 Post-filter hint SEI message semantics PAGEREF _Toc219708179 \h 362
HYPERLINK \l "_Toc219708180" D.2.24 Tone mapping information SEI message semantics PAGEREF _Toc219708180 \h 363
HYPERLINK \l "_Toc219708181" D.2.25 Reserved SEI message semantics PAGEREF _Toc219708181 \h 365
HYPERLINK \l "_Toc219708182" Annex E Video usability information PAGEREF _Toc219708182 \h 366
HYPERLINK \l "_Toc219708183" E.1 VUI syntax PAGEREF _Toc219708183 \h 367
HYPERLINK \l "_Toc219708184" E.1.1 VUI parameters syntax PAGEREF _Toc219708184 \h 367
HYPERLINK \l "_Toc219708185" E.1.2 HRD parameters syntax PAGEREF _Toc219708185 \h 368
HYPERLINK \l "_Toc219708186" E.2 VUI semantics PAGEREF _Toc219708186 \h 368
HYPERLINK \l "_Toc219708187" E.2.1 VUI parameters semantics PAGEREF _Toc219708187 \h 368
HYPERLINK \l "_Toc219708188" E.2.2 HRD parameters semantics PAGEREF _Toc219708188 \h 380
HYPERLINK \l "_Toc219708189" Annex G Scalable video coding PAGEREF _Toc219708189 \h 383
HYPERLINK \l "_Toc219708190" G.1 Scope PAGEREF _Toc219708190 \h 383
HYPERLINK \l "_Toc219708191" G.2 Normative References PAGEREF _Toc219708191 \h 383
HYPERLINK \l "_Toc219708192" G.3 Definitions PAGEREF _Toc219708192 \h 383
HYPERLINK \l "_Toc219708194" G.4 Abbreviations PAGEREF _Toc219708194 \h 387
HYPERLINK \l "_Toc219708195" G.5 Conventions PAGEREF _Toc219708195 \h 387
HYPERLINK \l "_Toc219708196" G.6 Source, coded, decoded and output data formats, scanning processes, neighbouring and reference layer relationships PAGEREF _Toc219708196 \h 387
HYPERLINK \l "_Toc219708197" G.6.1 Derivation process for reference layer macroblocks PAGEREF _Toc219708197 \h 387
HYPERLINK \l "_Toc219708198" G.6.1.1 Field-to-frame reference layer macroblock conversion process PAGEREF _Toc219708198 \h 389
HYPERLINK \l "_Toc219708199" G.6.1.2 Frame-to-field reference layer macroblock conversion process PAGEREF _Toc219708199 \h 390
HYPERLINK \l "_Toc219708200" G.6.2 Derivation process for reference layer partitions PAGEREF _Toc219708200 \h 390
HYPERLINK \l "_Toc219708201" G.6.3 Derivation process for reference layer sample locations in resampling PAGEREF _Toc219708201 \h 391
HYPERLINK \l "_Toc219708202" G.6.4 SVC derivation process for macroblock and sub-macroblock partition indices PAGEREF _Toc219708202 \h 394
HYPERLINK \l "_Toc219708203" G.7 Syntax and semantics PAGEREF _Toc219708203 \h 394
HYPERLINK \l "_Toc219708204" G.7.1 Method of specifying syntax in tabular form PAGEREF _Toc219708204 \h 394
HYPERLINK \l "_Toc219708205" G.7.2 Specification of syntax functions, categories, and descriptors PAGEREF _Toc219708205 \h 394
HYPERLINK \l "_Toc219708220" G.7.3 Syntax in tabular form PAGEREF _Toc219708220 \h 395
HYPERLINK \l "_Toc219708221" G.7.3.1 NAL unit syntax PAGEREF _Toc219708221 \h 395
HYPERLINK \l "_Toc219708222" G.7.3.1.1 NAL unit header SVC extension syntax PAGEREF _Toc219708222 \h 395
HYPERLINK \l "_Toc219708223" G.7.3.2 Raw byte sequence payloads and RBSP trailing bits syntax PAGEREF _Toc219708223 \h 395
HYPERLINK \l "_Toc219708224" G.7.3.2.1 Sequence parameter set RBSP syntax PAGEREF _Toc219708224 \h 395
HYPERLINK \l "_Toc219708225" G.7.3.2.1.1 Sequence parameter set data syntax PAGEREF _Toc219708225 \h 395
HYPERLINK \l "_Toc219708226" G.7.3.2.1.2 Sequence parameter set extension RBSP syntax PAGEREF _Toc219708226 \h 395
HYPERLINK \l "_Toc219708227" G.7.3.2.1.3 Subset sequence parameter set RBSP syntax PAGEREF _Toc219708227 \h 396
HYPERLINK \l "_Toc219708228" G.7.3.2.1.4 Sequence parameter set SVC extension syntax PAGEREF _Toc219708228 \h 396
HYPERLINK \l "_Toc219708229" G.7.3.2.2 Picture parameter set RBSP syntax PAGEREF _Toc219708229 \h 396
HYPERLINK \l "_Toc219708230" G.7.3.2.3 Supplemental enhancement information RBSP syntax PAGEREF _Toc219708230 \h 397
HYPERLINK \l "_Toc219708231" G.7.3.2.3.1 Supplemental enhancement information message syntax PAGEREF _Toc219708231 \h 397
HYPERLINK \l "_Toc219708232" G.7.3.2.4 Access unit delimiter RBSP syntax PAGEREF _Toc219708232 \h 397
HYPERLINK \l "_Toc219708233" G.7.3.2.5 End of sequence RBSP syntax PAGEREF _Toc219708233 \h 397
HYPERLINK \l "_Toc219708234" G.7.3.2.6 End of stream RBSP syntax PAGEREF _Toc219708234 \h 397
HYPERLINK \l "_Toc219708235" G.7.3.2.7 Filler data RBSP syntax PAGEREF _Toc219708235 \h 397
HYPERLINK \l "_Toc219708236" G.7.3.2.8 Slice layer without partitioning RBSP syntax PAGEREF _Toc219708236 \h 397
HYPERLINK \l "_Toc219708237" G.7.3.2.9 Slice data partition RBSP syntax PAGEREF _Toc219708237 \h 397
HYPERLINK \l "_Toc219708238" G.7.3.2.10 RBSP slice trailing bits syntax PAGEREF _Toc219708238 \h 397
HYPERLINK \l "_Toc219708239" G.7.3.2.11 RBSP trailing bits syntax PAGEREF _Toc219708239 \h 397
HYPERLINK \l "_Toc219708240" G.7.3.2.12 Prefix NAL unit RBSP syntax PAGEREF _Toc219708240 \h 397
HYPERLINK \l "_Toc219708241" G.7.3.2.13 Slice layer in scalable extension RBSP syntax PAGEREF _Toc219708241 \h 398
HYPERLINK \l "_Toc219708242" G.7.3.3 Slice header syntax PAGEREF _Toc219708242 \h 398
HYPERLINK \l "_Toc219708243" G.7.3.3.1 Reference picture list modification syntax PAGEREF _Toc219708243 \h 398
HYPERLINK \l "_Toc219708244" G.7.3.3.2 Prediction weight table syntax PAGEREF _Toc219708244 \h 398
HYPERLINK \l "_Toc219708245" G.7.3.3.3 Decoded reference picture marking syntax PAGEREF _Toc219708245 \h 398
HYPERLINK \l "_Toc219708246" G.7.3.3.4 Slice header in scalable extension syntax PAGEREF _Toc219708246 \h 399
HYPERLINK \l "_Toc219708247" G.7.3.3.5 Decoded reference base picture marking syntax PAGEREF _Toc219708247 \h 401
HYPERLINK \l "_Toc219708248" G.7.3.4 Slice data syntax PAGEREF _Toc219708248 \h 401
HYPERLINK \l "_Toc219708249" G.7.3.4.1 Slice data in scalable extension syntax PAGEREF _Toc219708249 \h 402
HYPERLINK \l "_Toc219708250" G.7.3.5 Macroblock layer syntax PAGEREF _Toc219708250 \h 402
HYPERLINK \l "_Toc219708251" G.7.3.5.1 Macroblock prediction syntax PAGEREF _Toc219708251 \h 403
HYPERLINK \l "_Toc219708252" G.7.3.5.2 Sub-macroblock prediction syntax PAGEREF _Toc219708252 \h 403
HYPERLINK \l "_Toc219708253" G.7.3.5.3 Residual data syntax PAGEREF _Toc219708253 \h 403
HYPERLINK \l "_Toc219708254" G.7.3.5.3.1 Residual luma syntax PAGEREF _Toc219708254 \h 403
HYPERLINK \l "_Toc219708255" G.7.3.5.3.2 Residual block CAVLC syntax PAGEREF _Toc219708255 \h 403
HYPERLINK \l "_Toc219708256" G.7.3.5.3.3 Residual block CABAC syntax PAGEREF _Toc219708256 \h 403
HYPERLINK \l "_Toc219708257" G.7.3.6 Macroblock layer in scalable extension syntax PAGEREF _Toc219708257 \h 404
HYPERLINK \l "_Toc219708258" G.7.3.6.1 Macroblock prediction in scalable extension syntax PAGEREF _Toc219708258 \h 406
HYPERLINK \l "_Toc219708259" G.7.3.6.2 Sub-macroblock prediction in scalable extension syntax PAGEREF _Toc219708259 \h 407
HYPERLINK \l "_Toc219708260" G.7.4 Semantics PAGEREF _Toc219708260 \h 407
HYPERLINK \l "_Toc219708261" G.7.4.1 NAL unit semantics PAGEREF _Toc219708261 \h 408
HYPERLINK \l "_Toc219708262" G.7.4.1.1 NAL unit header SVC extension semantics PAGEREF _Toc219708262 \h 408
HYPERLINK \l "_Toc219708263" G.7.4.1.2 Order of NAL units and association to coded pictures, access units, and video sequences PAGEREF _Toc219708263 \h 410
HYPERLINK \l "_Toc219708264" G.7.4.1.2.1 Order of SVC sequence parameter set RBSPs and picture parameter set RBSPs and their activation PAGEREF _Toc219708264 \h 410
HYPERLINK \l "_Toc219708265" G.7.4.1.2.2 Order of access units and association to coded video sequences PAGEREF _Toc219708265 \h 415
HYPERLINK \l "_Toc219708266" G.7.4.1.2.3 Order of NAL units and coded pictures and association to access units PAGEREF _Toc219708266 \h 415
HYPERLINK \l "_Toc219708267" G.7.4.1.2.4 Detection of the first VCL NAL unit of a primary coded picture PAGEREF _Toc219708267 \h 416
HYPERLINK \l "_Toc219708268" G.7.4.1.2.5 Order of VCL NAL units and association to coded pictures PAGEREF _Toc219708268 \h 416
HYPERLINK \l "_Toc219708269" G.7.4.2 Raw byte sequence payloads and RBSP trailing bits semantics PAGEREF _Toc219708269 \h 417
HYPERLINK \l "_Toc219708270" G.7.4.2.1 Sequence parameter set RBSP semantics PAGEREF _Toc219708270 \h 417
HYPERLINK \l "_Toc219708271" G.7.4.2.1.1 Sequence parameter set data semantics PAGEREF _Toc219708271 \h 417
HYPERLINK \l "_Toc219708272" G.7.4.2.1.2 Sequence parameter set extension RBSP semantics PAGEREF _Toc219708272 \h 418
HYPERLINK \l "_Toc219708273" G.7.4.2.1.3 Subset sequence parameter set RBSP semantics PAGEREF _Toc219708273 \h 418
HYPERLINK \l "_Toc219708274" G.7.4.2.1.4 Sequence parameter set SVC extension semantics PAGEREF _Toc219708274 \h 419
HYPERLINK \l "_Toc219708275" G.7.4.2.2 Picture parameter set RBSP semantics PAGEREF _Toc219708275 \h 420
HYPERLINK \l "_Toc219708276" G.7.4.2.3 Supplemental enhancement information RBSP semantics PAGEREF _Toc219708276 \h 420
HYPERLINK \l "_Toc219708277" G.7.4.2.3.1 Supplemental enhancement information message semantics PAGEREF _Toc219708277 \h 420
HYPERLINK \l "_Toc219708278" G.7.4.2.4 Access unit delimiter RBSP semantics PAGEREF _Toc219708278 \h 420
HYPERLINK \l "_Toc219708279" G.7.4.2.5 End of sequence RBSP semantics PAGEREF _Toc219708279 \h 420
HYPERLINK \l "_Toc219708280" G.7.4.2.6 End of stream RBSP semantics PAGEREF _Toc219708280 \h 420
HYPERLINK \l "_Toc219708281" G.7.4.2.7 Filler data RBSP semantics PAGEREF _Toc219708281 \h 420
HYPERLINK \l "_Toc219708282" G.7.4.2.8 Slice layer without partitioning RBSP semantics PAGEREF _Toc219708282 \h 421
HYPERLINK \l "_Toc219708283" G.7.4.2.9 Slice data partition RBSP semantics PAGEREF _Toc219708283 \h 421
HYPERLINK \l "_Toc219708284" G.7.4.2.10 RBSP slice trailing bits semantics PAGEREF _Toc219708284 \h 421
HYPERLINK \l "_Toc219708285" G.7.4.2.11 RBSP trailing bits semantics PAGEREF _Toc219708285 \h 421
HYPERLINK \l "_Toc219708286" G.7.4.2.12 Prefix NAL unit RBSP semantics PAGEREF _Toc219708286 \h 421
HYPERLINK \l "_Toc219708287" G.7.4.2.13 Slice layer in scalable extension RBSP semantics PAGEREF _Toc219708287 \h 422
HYPERLINK \l "_Toc219708288" G.7.4.3 Slice header semantics PAGEREF _Toc219708288 \h 422
HYPERLINK \l "_Toc219708289" G.7.4.3.1 Reference picture list modification semantics PAGEREF _Toc219708289 \h 422
HYPERLINK \l "_Toc219708290" G.7.4.3.2 Prediction weight table semantics PAGEREF _Toc219708290 \h 422
HYPERLINK \l "_Toc219708291" G.7.4.3.3 Decoded reference picture marking semantics PAGEREF _Toc219708291 \h 422
HYPERLINK \l "_Toc219708292" G.7.4.3.4 Slice header in scalable extension semantics PAGEREF _Toc219708292 \h 423
HYPERLINK \l "_Toc219708293" G.7.4.3.5 Decoded reference base picture marking semantics PAGEREF _Toc219708293 \h 433
HYPERLINK \l "_Toc219708296" G.7.4.4 Slice data semantics PAGEREF _Toc219708296 \h 435
HYPERLINK \l "_Toc219708297" G.7.4.4.1 Slice data in scalable extension semantics PAGEREF _Toc219708297 \h 435
HYPERLINK \l "_Toc219708298" G.7.4.5 Macroblock layer semantics PAGEREF _Toc219708298 \h 435
HYPERLINK \l "_Toc219708299" G.7.4.5.1 Macroblock prediction semantics PAGEREF _Toc219708299 \h 435
HYPERLINK \l "_Toc219708300" G.7.4.5.2 Sub-macroblock prediction semantics PAGEREF _Toc219708300 \h 436
HYPERLINK \l "_Toc219708301" G.7.4.5.3 Residual data semantics PAGEREF _Toc219708301 \h 436
HYPERLINK \l "_Toc219708302" G.7.4.5.3.1 Residual luma semantics PAGEREF _Toc219708302 \h 436
HYPERLINK \l "_Toc219708303" G.7.4.5.3.2 Residual block CAVLC semantics PAGEREF _Toc219708303 \h 436
HYPERLINK \l "_Toc219708304" G.7.4.5.3.3 Residual block CABAC semantics PAGEREF _Toc219708304 \h 436
HYPERLINK \l "_Toc219708305" G.7.4.6 Macroblock layer in scalable extension semantics PAGEREF _Toc219708305 \h 436
HYPERLINK \l "_Toc219708306" G.7.4.6.1 Macroblock prediction in scalable extension semantics PAGEREF _Toc219708306 \h 439
HYPERLINK \l "_Toc219708307" G.7.4.6.2 Sub-macroblock prediction in scalable extension semantics PAGEREF _Toc219708307 \h 439
HYPERLINK \l "_Toc219708308" G.8 SVC decoding process PAGEREF _Toc219708308 \h 439
HYPERLINK \l "_Toc219708309" G.8.1 SVC initialisation and decoding processes PAGEREF _Toc219708309 \h 441
HYPERLINK \l "_Toc219708310" G.8.1.1 Derivation process for the set of layer representations required for decoding PAGEREF _Toc219708310 \h 441
HYPERLINK \l "_Toc219708311" G.8.1.2 Array assignment, initialisation, and restructuring processes PAGEREF _Toc219708311 \h 441
HYPERLINK \l "_Toc219708312" G.8.1.2.1 Array assignment and initialisation process PAGEREF _Toc219708312 \h 441
HYPERLINK \l "_Toc219708313" G.8.1.2.2 Array restructuring process PAGEREF _Toc219708313 \h 443
HYPERLINK \l "_Toc219708314" G.8.1.3 Layer representation decoding processes PAGEREF _Toc219708314 \h 444
HYPERLINK \l "_Toc219708315" G.8.1.3.1 Base decoding process for layer representations without resolution change PAGEREF _Toc219708315 \h 444
HYPERLINK \l "_Toc219708316" G.8.1.3.2 Base decoding process for layer representations with resolution change PAGEREF _Toc219708316 \h 445
HYPERLINK \l "_Toc219708317" G.8.1.3.3 Target layer representation decoding process PAGEREF _Toc219708317 \h 446
HYPERLINK \l "_Toc219708318" G.8.1.4 Slice decoding processes PAGEREF _Toc219708318 \h 447
HYPERLINK \l "_Toc219708319" G.8.1.4.1 Base decoding process for slices without resolution change PAGEREF _Toc219708319 \h 447
HYPERLINK \l "_Toc219708320" G.8.1.4.2 Base decoding process for slices with resolution change PAGEREF _Toc219708320 \h 447
HYPERLINK \l "_Toc219708321" G.8.1.5 Macroblock initialisation and decoding processes PAGEREF _Toc219708321 \h 448
HYPERLINK \l "_Toc219708322" G.8.1.5.1 Macroblock initialisation process PAGEREF _Toc219708322 \h 448
HYPERLINK \l "_Toc219708323" G.8.1.5.1.1 Derivation process for macroblock type, sub-macroblock type, and inter-layer predictors for reference indices and motion vectors PAGEREF _Toc219708323 \h 449
HYPERLINK \l "_Toc219708324" G.8.1.5.1.2 Derivation process for quantisation parameters and transform type PAGEREF _Toc219708324 \h 450
HYPERLINK \l "_Toc219708325" G.8.1.5.2 Base decoding process for macroblocks in slices without resolution change PAGEREF _Toc219708325 \h 452
HYPERLINK \l "_Toc219708326" G.8.1.5.3 Base decoding process for macroblocks in slices with resolution change PAGEREF _Toc219708326 \h 453
HYPERLINK \l "_Toc219708327" G.8.1.5.4 Macroblock decoding process prior to decoding a layer representation without resolution change and tcoeff_level_prediction_flag equal to 0 PAGEREF _Toc219708327 \h 455
HYPERLINK \l "_Toc219708328" G.8.1.5.5 Macroblock decoding process prior to resolution change PAGEREF _Toc219708328 \h 455
HYPERLINK \l "_Toc219708329" G.8.1.5.6 Target macroblock decoding process PAGEREF _Toc219708329 \h 456
HYPERLINK \l "_Toc219708331" G.8.2 SVC reference picture lists construction and decoded reference picture marking process PAGEREF _Toc219708331 \h 458
HYPERLINK \l "_Toc219708332" G.8.2.1 SVC decoding process for picture order count PAGEREF _Toc219708332 \h 460
HYPERLINK \l "_Toc219708333" G.8.2.2 SVC decoding process for picture numbers PAGEREF _Toc219708333 \h 461
HYPERLINK \l "_Toc219708379" G.8.2.3 SVC decoding process for reference picture lists construction PAGEREF _Toc219708379 \h 464
HYPERLINK \l "_Toc219708380" G.8.2.4 SVC decoded reference picture marking process PAGEREF _Toc219708380 \h 465
HYPERLINK \l "_Toc219708381" G.8.2.4.1 SVC reference picture marking process for a dependency representation PAGEREF _Toc219708381 \h 465
HYPERLINK \l "_Toc219708382" G.8.2.4.2 SVC sliding window decoded reference picture marking process PAGEREF _Toc219708382 \h 468
HYPERLINK \l "_Toc219708383" G.8.2.4.3 SVC adaptive memory control reference base picture marking process PAGEREF _Toc219708383 \h 469
HYPERLINK \l "_Toc219708384" G.8.2.4.4 SVC adaptive memory control decoded reference picture marking process PAGEREF _Toc219708384 \h 470
HYPERLINK \l "_Toc219708385" G.8.2.5 SVC decoding process for gaps in frame_num PAGEREF _Toc219708385 \h 472
HYPERLINK \l "_Toc219708386" G.8.3 SVC intra decoding processes PAGEREF _Toc219708386 \h 472
HYPERLINK \l "_Toc219708387" G.8.3.1 SVC derivation process for intra prediction modes PAGEREF _Toc219708387 \h 472
HYPERLINK \l "_Toc219708388" G.8.3.1.1 SVC derivation process for Intra_4x4 prediction modes PAGEREF _Toc219708388 \h 473
HYPERLINK \l "_Toc219708389" G.8.3.1.2 SVC derivation process for Intra_8x8 prediction modes PAGEREF _Toc219708389 \h 474
HYPERLINK \l "_Toc219708390" G.8.3.2 SVC intra sample prediction and construction process PAGEREF _Toc219708390 \h 475
HYPERLINK \l "_Toc219708391" G.8.3.2.1 SVC intra prediction and construction process for luma samples or chroma samples with ChromaArrayType equal to 3 PAGEREF _Toc219708391 \h 477
HYPERLINK \l "_Toc219708392" G.8.3.2.1.1 SVC construction process for luma samples and chroma samples with ChromaArrayType equal to 3 of I_PCM macroblocks PAGEREF _Toc219708392 \h 478
HYPERLINK \l "_Toc219708393" G.8.3.2.1.2 SVC Intra_4x4 sample prediction and construction process PAGEREF _Toc219708393 \h 478
HYPERLINK \l "_Toc219708394" G.8.3.2.1.3 SVC Intra_8x8 sample prediction and construction process PAGEREF _Toc219708394 \h 479
HYPERLINK \l "_Toc219708395" G.8.3.2.1.4 SVC Intra_16x16 sample prediction and construction process PAGEREF _Toc219708395 \h 479
HYPERLINK \l "_Toc219708396" G.8.3.2.2 SVC intra prediction and construction process for chroma samples PAGEREF _Toc219708396 \h 480
HYPERLINK \l "_Toc219708397" G.8.3.2.2.1 SVC construction process for chroma samples of I_PCM macroblocks PAGEREF _Toc219708397 \h 481
HYPERLINK \l "_Toc219708398" G.8.3.2.2.2 SVC intra prediction and construction process for chroma samples with ChromaArrayType equal to 1 or 2 PAGEREF _Toc219708398 \h 481
HYPERLINK \l "_Toc219708399" G.8.4 SVC Inter prediction process PAGEREF _Toc219708399 \h 481
HYPERLINK \l "_Toc219708400" G.8.4.1 SVC derivation process for motion vector components and reference indices PAGEREF _Toc219708400 \h 481
HYPERLINK \l "_Toc219708401" G.8.4.1.1 SVC derivation process for luma motion vector components and reference indices of a macroblock or sub-macroblock partition PAGEREF _Toc219708401 \h 483
HYPERLINK \l "_Toc219708402" G.8.4.1.2 SVC derivation process for luma motion vectors and reference indices for B_Skip, B_Direct_16x16, and B_Direct_8x8 in NAL units with nal_unit_type equal to 20 PAGEREF _Toc219708402 \h 487
HYPERLINK \l "_Toc219708403" G.8.4.2 SVC decoding process for Inter prediction samples PAGEREF _Toc219708403 \h 488
HYPERLINK \l "_Toc219708404" G.8.4.2.1 SVC derivation process for prediction weights PAGEREF _Toc219708404 \h 491
HYPERLINK \l "_Toc219708405" G.8.4.2.2 Intra-inter prediction combination process PAGEREF _Toc219708405 \h 492
HYPERLINK \l "_Toc219708406" G.8.5 SVC transform coefficient decoding and sample array construction processes PAGEREF _Toc219708406 \h 493
HYPERLINK \l "_Toc219708407" G.8.5.1 Transform coefficient scaling and refinement process PAGEREF _Toc219708407 \h 493
HYPERLINK \l "_Toc219708408" G.8.5.1.1 Refinement process for luma transform coefficients or chroma transform coefficients with ChromaArrayType equal to 3 PAGEREF _Toc219708408 \h 493
HYPERLINK \l "_Toc219708409" G.8.5.1.1.1 Assignment process for luma transform coefficient values or chroma transform coefficient values with ChromaArrayType equal to 3 for I_PCM macroblocks PAGEREF _Toc219708409 \h 494
HYPERLINK \l "_Toc219708410" G.8.5.1.1.2 Refinement process for transform coefficients of residual 4x4 blocks PAGEREF _Toc219708410 \h 494
HYPERLINK \l "_Toc219708411" G.8.5.1.1.3 Refinement process for transform coefficients of residual 8x8 blocks PAGEREF _Toc219708411 \h 495
HYPERLINK \l "_Toc219708412" G.8.5.1.1.4 Refinement process for transform coefficients of Intra_16x16 macroblocks PAGEREF _Toc219708412 \h 496
HYPERLINK \l "_Toc219708413" G.8.5.1.2 Refinement process for chroma transform coefficients PAGEREF _Toc219708413 \h 498
HYPERLINK \l "_Toc219708414" G.8.5.1.2.1 Assignment process for chroma transform coefficient values for I_PCM macroblocks PAGEREF _Toc219708414 \h 498
HYPERLINK \l "_Toc219708415" G.8.5.1.2.2 Refinement process for chroma transform coefficients with ChromaArrayType equal to 1 or 2 PAGEREF _Toc219708415 \h 498
HYPERLINK \l "_Toc219708416" G.8.5.2 Transform coefficient level scaling process prior to transform coefficient refinement PAGEREF _Toc219708416 \h 500
HYPERLINK \l "_Toc219708417" G.8.5.3 Residual construction and accumulation process PAGEREF _Toc219708417 \h 501
HYPERLINK \l "_Toc219708418" G.8.5.3.1 Construction process for luma residuals or chroma residuals with ChromaArrayType equal to 3 PAGEREF _Toc219708418 \h 502
HYPERLINK \l "_Toc219708419" G.8.5.3.1.1 Construction process for luma residuals or chroma residuals with ChromaArrayType equal to 3 of I_PCM macroblocks PAGEREF _Toc219708419 \h 503
HYPERLINK \l "_Toc219708420" G.8.5.3.1.2 Construction process for residual 4x4 blocks PAGEREF _Toc219708420 \h 503
HYPERLINK \l "_Toc219708421" G.8.5.3.1.3 Construction process for residual 8x8 blocks PAGEREF _Toc219708421 \h 503
HYPERLINK \l "_Toc219708422" G.8.5.3.1.4 Construction process for residuals of Intra_16x16 macroblocks PAGEREF _Toc219708422 \h 504
HYPERLINK \l "_Toc219708423" G.8.5.3.2 Construction process for chroma residuals PAGEREF _Toc219708423 \h 504
HYPERLINK \l "_Toc219708424" G.8.5.3.2.1 Construction process for chroma residuals of I_PCM macroblocks PAGEREF _Toc219708424 \h 505
HYPERLINK \l "_Toc219708425" G.8.5.3.2.2 Construction process for chroma residuals with ChromaArrayType equal to 1 or 2 PAGEREF _Toc219708425 \h 505
HYPERLINK \l "_Toc219708426" G.8.5.4 Sample array accumulation process PAGEREF _Toc219708426 \h 506
HYPERLINK \l "_Toc219708427" G.8.5.4.1 Picture sample array construction process PAGEREF _Toc219708427 \h 507
HYPERLINK \l "_Toc219708428" G.8.5.4.2 Macroblock sample array extraction process PAGEREF _Toc219708428 \h 507
HYPERLINK \l "_Toc219708429" G.8.5.4.3 Picture sample array construction process for a colour component PAGEREF _Toc219708429 \h 507
HYPERLINK \l "_Toc219708430" G.8.5.4.4 Macroblock sample array extraction process for a colour component PAGEREF _Toc219708430 \h 508
HYPERLINK \l "_Toc219708431" G.8.5.5 Sample array re-initialisation process PAGEREF _Toc219708431 \h 508
HYPERLINK \l "_Toc219708432" G.8.6 Resampling processes for prediction data, intra samples, and residual samples PAGEREF _Toc219708432 \h 509
HYPERLINK \l "_Toc219708433" G.8.6.1 Derivation process for inter-layer predictors for macroblock type, sub-macroblock type, reference indices, and motion vectors PAGEREF _Toc219708433 \h 509
HYPERLINK \l "_Toc219708434" G.8.6.1.1 Derivation process for reference layer partition identifications PAGEREF _Toc219708434 \h 510
HYPERLINK \l "_Toc219708435" G.8.6.1.2 Derivation process for inter-layer predictors for reference indices and motion vectors PAGEREF _Toc219708435 \h 512
HYPERLINK \l "_Toc219708436" G.8.6.1.3 Derivation process for inter-layer predictors for P and B macroblock and sub-macroblock types PAGEREF _Toc219708436 \h 516
HYPERLINK \l "_Toc219708437" G.8.6.2 Resampling process for intra samples PAGEREF _Toc219708437 \h 518
HYPERLINK \l "_Toc219708438" G.8.6.2.1 Resampling process for intra samples of a macroblock colour component PAGEREF _Toc219708438 \h 519
HYPERLINK \l "_Toc219708439" G.8.6.2.2 Reference layer sample array construction process prior to intra resampling PAGEREF _Toc219708439 \h 521
HYPERLINK \l "_Toc219708440" G.8.6.2.2.1 Derivation process for reference layer slice and intra macroblock identifications PAGEREF _Toc219708440 \h 523
HYPERLINK \l "_Toc219708441" G.8.6.2.2.2 Construction process for not available sample values prior to intra resampling PAGEREF _Toc219708441 \h 524
HYPERLINK \l "_Toc219708442" G.8.6.2.3 Interpolation process for Intra_Base prediction PAGEREF _Toc219708442 \h 526
HYPERLINK \l "_Toc219708443" G.8.6.2.4 Vertical interpolation process for Intra_Base prediction PAGEREF _Toc219708443 \h 528
HYPERLINK \l "_Toc219708444" G.8.6.2.5 Derivation process for variables related to inter-layer intra prediction PAGEREF _Toc219708444 \h 529
HYPERLINK \l "_Toc219708445" G.8.6.3 Resampling process for residual samples PAGEREF _Toc219708445 \h 531
HYPERLINK \l "_Toc219708446" G.8.6.3.1 Resampling process for residual samples of a macroblock colour component PAGEREF _Toc219708446 \h 532
HYPERLINK \l "_Toc219708447" G.8.6.3.2 Reference layer sample array construction process prior to residual resampling PAGEREF _Toc219708447 \h 534
HYPERLINK \l "_Toc219708448" G.8.6.3.2.1 Derivation process for reference layer transform block identifications PAGEREF _Toc219708448 \h 535
HYPERLINK \l "_Toc219708449" G.8.6.3.3 Interpolation process for residual prediction PAGEREF _Toc219708449 \h 536
HYPERLINK \l "_Toc219708450" G.8.6.3.4 Vertical interpolation process for residual prediction PAGEREF _Toc219708450 \h 537
HYPERLINK \l "_Toc219708451" G.8.7 SVC deblocking filter processes PAGEREF _Toc219708451 \h 537
HYPERLINK \l "_Toc219708452" G.8.7.1 Deblocking filter process for Intra_Base prediction PAGEREF _Toc219708452 \h 538
HYPERLINK \l "_Toc219708453" G.8.7.2 Deblocking filter process for target representations PAGEREF _Toc219708453 \h 538
HYPERLINK \l "_Toc219708454" G.8.7.3 Derivation process for quantisation parameters used in the deblocking filter process PAGEREF _Toc219708454 \h 539
HYPERLINK \l "_Toc219708455" G.8.7.4 Macroblock deblocking filter process PAGEREF _Toc219708455 \h 540
HYPERLINK \l "_Toc219708456" G.8.7.4.1 SVC filtering process for block edges PAGEREF _Toc219708456 \h 544
HYPERLINK \l "_Toc219708457" G.8.7.4.2 SVC filtering process for a set of samples across a horizontal or vertical block edge PAGEREF _Toc219708457 \h 546
HYPERLINK \l "_Toc219708458" G.8.7.4.3 SVC derivation process for the luma content dependent boundary filtering strength PAGEREF _Toc219708458 \h 546
HYPERLINK \l "_Toc219708459" G.8.8 Specification of bitstream subsets PAGEREF _Toc219708459 \h 550
HYPERLINK \l "_Toc219708460" G.8.8.1 Sub-bitstream extraction process PAGEREF _Toc219708460 \h 550
HYPERLINK \l "_Toc219708461" G.8.8.2 Specification of the base layer bitstream PAGEREF _Toc219708461 \h 551
HYPERLINK \l "_Toc219708462" G.9 Parsing process PAGEREF _Toc219708462 \h 551
HYPERLINK \l "_Toc219708463" G.9.1 Alternative parsing process for coded block pattern PAGEREF _Toc219708463 \h 551
HYPERLINK \l "_Toc219708464" G.9.2 Alternative CAVLC parsing process for transform coefficient levels PAGEREF _Toc219708464 \h 552
HYPERLINK \l "_Toc219708465" G.9.2.1 Additional parsing process for total number of transform coefficient levels and trailing ones PAGEREF _Toc219708465 \h 553
HYPERLINK \l "_Toc219708466" G.9.2.2 Alternative parsing process for run information PAGEREF _Toc219708466 \h 555
HYPERLINK \l "_Toc219708467" G.9.3 Alternative CABAC parsing process for slice data in scalable extension PAGEREF _Toc219708467 \h 556
HYPERLINK \l "_Toc219708468" G.9.3.1 Initialisation process PAGEREF _Toc219708468 \h 556
HYPERLINK \l "_Toc219708469" G.9.3.2 Binarization process PAGEREF _Toc219708469 \h 557
HYPERLINK \l "_Toc219708470" G.9.3.3 Decoding process flow PAGEREF _Toc219708470 \h 558
HYPERLINK \l "_Toc219708471" G.9.3.3.1 Derivation process for ctxIdx PAGEREF _Toc219708471 \h 558
HYPERLINK \l "_Toc219708472" G.9.3.3.2 Assignment process of ctxIdxInc using neighbouring syntax elements PAGEREF _Toc219708472 \h 558
HYPERLINK \l "_Toc219708473" G.9.3.3.2.1 Derivation process of ctxIdxInc for the syntax element base_mode_flag PAGEREF _Toc219708473 \h 558
HYPERLINK \l "_Toc219708474" G.9.3.3.2.2 Derivation process of ctxIdxInc for the syntax element residual_prediction_flag PAGEREF _Toc219708474 \h 559
HYPERLINK \l "_Toc219708475" G.10 Profiles and levels PAGEREF _Toc219708475 \h 559
HYPERLINK \l "_Toc219708476" G.10.1 Profiles PAGEREF _Toc219708476 \h 559
HYPERLINK \l "_Toc219708477" G.10.1.1 Scalable Baseline profile PAGEREF _Toc219708477 \h 559
HYPERLINK \l "_Toc219708478" G.10.1.2 Scalable High profile PAGEREF _Toc219708478 \h 560
HYPERLINK \l "_Toc219708479" G.10.1.3 Scalable High Intra profile PAGEREF _Toc219708479 \h 561
HYPERLINK \l "_Toc219708480" G.10.2 Levels PAGEREF _Toc219708480 \h 562
HYPERLINK \l "_Toc219708481" G.10.2.1 Level limits common to Scalable Baseline, Scalable High, and Scalable High Intra profiles PAGEREF _Toc219708481 \h 562
HYPERLINK \l "_Toc219708482" G.10.2.2 Profile specific level limits PAGEREF _Toc219708482 \h 565
HYPERLINK \l "_Toc219708483" G.11 Byte stream format PAGEREF _Toc219708483 \h 567
HYPERLINK \l "_Toc219708484" G.12 Hypothetical reference decoder PAGEREF _Toc219708484 \h 567
HYPERLINK \l "_Toc219708485" G.13 Supplemental enhancement information PAGEREF _Toc219708485 \h 567
HYPERLINK \l "_Toc219708486" G.13.1 SEI payload syntax PAGEREF _Toc219708486 \h 568
HYPERLINK \l "_Toc219708487" G.13.1.1 Scalability information SEI message syntax PAGEREF _Toc219708487 \h 568
HYPERLINK \l "_Toc219708573" G.13.1.2 Sub-picture scalable layer SEI message syntax PAGEREF _Toc219708573 \h 571
HYPERLINK \l "_Toc219708574" G.13.1.3 Non-required layer representation SEI message syntax PAGEREF _Toc219708574 \h 571
HYPERLINK \l "_Toc219708575" G.13.1.4 Priority layer information SEI message syntax PAGEREF _Toc219708575 \h 572
HYPERLINK \l "_Toc219708576" G.13.1.5 Layers not present SEI message syntax PAGEREF _Toc219708576 \h 572
HYPERLINK \l "_Toc219708577" G.13.1.6 Layer dependency change SEI message syntax PAGEREF _Toc219708577 \h 572
HYPERLINK \l "_Toc219708578" G.13.1.7 Scalable nesting SEI message syntax PAGEREF _Toc219708578 \h 573
HYPERLINK \l "_Toc219708579" G.13.1.8 Base layer temporal HRD SEI message syntax PAGEREF _Toc219708579 \h 573
HYPERLINK \l "_Toc219708580" G.13.1.9 Quality layer integrity check SEI message syntax PAGEREF _Toc219708580 \h 574
HYPERLINK \l "_Toc219708581" G.13.1.10 Redundant picture property SEI message syntax PAGEREF _Toc219708581 \h 574
HYPERLINK \l "_Toc219708582" G.13.1.11 Temporal level zero dependency representation index SEI message syntax PAGEREF _Toc219708582 \h 574
HYPERLINK \l "_Toc219708583" G.13.1.12 Temporal level switching point SEI message syntax PAGEREF _Toc219708583 \h 575
HYPERLINK \l "_Toc219708584" G.13.2 SEI payload semantics PAGEREF _Toc219708584 \h 575
HYPERLINK \l "_Toc219708585" G.13.2.1 Scalability information SEI message semantics PAGEREF _Toc219708585 \h 576
HYPERLINK \l "_Toc219708601" G.13.2.2 Sub-picture scalable layer SEI message semantics PAGEREF _Toc219708601 \h 594
HYPERLINK \l "_Toc219708602" G.13.2.3 Non-required layer representation SEI message semantics PAGEREF _Toc219708602 \h 595
HYPERLINK \l "_Toc219708603" G.13.2.4 Priority layer information SEI message semantics PAGEREF _Toc219708603 \h 596
HYPERLINK \l "_Toc219708604" G.13.2.5 Layers not present SEI message semantics PAGEREF _Toc219708604 \h 596
HYPERLINK \l "_Toc219708605" G.13.2.6 Layer dependency change SEI message semantics PAGEREF _Toc219708605 \h 597
HYPERLINK \l "_Toc219708606" G.13.2.7 Scalable nesting SEI message semantics PAGEREF _Toc219708606 \h 598
HYPERLINK \l "_Toc219708607" G.13.2.8 Base layer temporal HRD SEI message semantics PAGEREF _Toc219708607 \h 600
HYPERLINK \l "_Toc219708608" G.13.2.9 Quality layer integrity check SEI message semantics PAGEREF _Toc219708608 \h 601
HYPERLINK \l "_Toc219708609" G.13.2.10 Redundant picture property SEI message semantics PAGEREF _Toc219708609 \h 601
HYPERLINK \l "_Toc219708610" G.13.2.11 Temporal level zero dependency representation index SEI message semantics PAGEREF _Toc219708610 \h 602
HYPERLINK \l "_Toc219708611" G.13.2.12 Temporal level switching point SEI message semantics PAGEREF _Toc219708611 \h 604
HYPERLINK \l "_Toc219708616" G.14 SVC video usability information extension PAGEREF _Toc219708616 \h 605
HYPERLINK \l "_Toc219708617" G.14.1 SVC VUI parameters extension syntax PAGEREF _Toc219708617 \h 606
HYPERLINK \l "_Toc219708618" G.14.2 SVC VUI parameters extension semantics PAGEREF _Toc219708618 \h 606
List of figures
TOC \h \z \c "Figure" HYPERLINK \l "_Toc220484749" Figure 61 – Nominal vertical and horizontal locations of 4:2:0 luma and chroma samples in a frame PAGEREF _Toc220484749 \h 21
HYPERLINK \l "_Toc220484750" Figure 62 – Nominal vertical and horizontal sampling locations of 4:2:0 samples in top and bottom fields PAGEREF _Toc220484750 \h 22
HYPERLINK \l "_Toc220484751" Figure 63 – Nominal vertical and horizontal locations of 4:2:2 luma and chroma samples in a frame PAGEREF _Toc220484751 \h 22
HYPERLINK \l "_Toc220484752" Figure 64 – Nominal vertical and horizontal sampling locations of 4:2:2 samples top and bottom fields PAGEREF _Toc220484752 \h 23
HYPERLINK \l "_Toc220484753" Figure 65 – Nominal vertical and horizontal locations of 4:4:4 luma and chroma samples in a frame PAGEREF _Toc220484753 \h 23
HYPERLINK \l "_Toc220484754" Figure 66 – Nominal vertical and horizontal sampling locations of 4:4:4 samples top and bottom fields PAGEREF _Toc220484754 \h 24
HYPERLINK \l "_Toc220484755" Figure 67 – A picture with 11 by 9 macroblocks that is partitioned into two slices PAGEREF _Toc220484755 \h 25
HYPERLINK \l "_Toc220484756" Figure 68 – Partitioning of the decoded frame into macroblock pairs PAGEREF _Toc220484756 \h 25
HYPERLINK \l "_Toc220484757" Figure 69 – Macroblock partitions, sub-macroblock partitions, macroblock partition scans, and sub-macroblock partition scans PAGEREF _Toc220484757 \h 27
HYPERLINK \l "_Toc220484758" Figure 610 – Scan for 4x4 luma blocks PAGEREF _Toc220484758 \h 28
HYPERLINK \l "_Toc220484759" Figure 611 – Scan for 8x8 luma blocks PAGEREF _Toc220484759 \h 28
HYPERLINK \l "_Toc220484760" Figure 612 – Neighbouring macroblocks for a given macroblock PAGEREF _Toc220484760 \h 29
HYPERLINK \l "_Toc220484761" Figure 613 – Neighbouring macroblocks for a given macroblock in MBAFF frames PAGEREF _Toc220484761 \h 30
HYPERLINK \l "_Toc220484762" Figure 614 – Determination of the neighbouring macroblock, blocks, and partitions (informative) PAGEREF _Toc220484762 \h 31
HYPERLINK \l "_Toc220484763" Figure 71 – Structure of an access unit not containing any NAL units with nal_unit_type equal to 0, 7, 8, or in the range of 12 to 18, inclusive, or in the range of 20 to 31, inclusive PAGEREF _Toc220484763 \h 68
HYPERLINK \l "_Toc220484764" Figure 81 – Intra_4x4 prediction mode directions (informative) PAGEREF _Toc220484764 \h 131
HYPERLINK \l "_Toc220484765" Figure 82 – Example for temporal direct-mode motion vector inference (informative) PAGEREF _Toc220484765 \h 162
HYPERLINK \l "_Toc220484766" Figure 83 – Directional segmentation prediction (informative) PAGEREF _Toc220484766 \h 163
HYPERLINK \l "_Toc220484767" Figure 84 – Integer samples (shaded blocks with upper-case letters) and fractional sample positions (un-shaded blocks with lower-case letters) for quarter sample luma interpolation PAGEREF _Toc220484767 \h 169
HYPERLINK \l "_Toc220484768" Figure 85 – Fractional sample position dependent variables in chroma interpolation and surrounding integer position samples A, B, C, and D PAGEREF _Toc220484768 \h 171
HYPERLINK \l "_Toc220484769" Figure 86 – Assignment of the indices of dcY to luma4x4BlkIdx PAGEREF _Toc220484769 \h 177
HYPERLINK \l "_Toc220484770" Figure 87 – Assignment of the indices of dcC to chroma4x4BlkIdx: (a) ChromaArrayType equal to 1, (b) ChromaArrayType equal to 2 PAGEREF _Toc220484770 \h 180
HYPERLINK \l "_Toc220484771" Figure 88 – 4x4 block scans. (a) Zig-zag scan. (b) Field scan (informative) PAGEREF _Toc220484771 \h 182
HYPERLINK \l "_Toc220484772" Figure 89 – 8x8 block scans. (a) 8x8 zig-zag scan. (b) 8x8 field scan (informative) PAGEREF _Toc220484772 \h 183
HYPERLINK \l "_Toc220484773" Figure 810 – Boundaries in a macroblock to be filtered PAGEREF _Toc220484773 \h 202
HYPERLINK \l "_Toc220484774" Figure 811 – Convention for describing samples across a 4x4 block horizontal or vertical boundary PAGEREF _Toc220484774 \h 206
HYPERLINK \l "_Toc220484775" Figure 91 – Illustration of CABAC parsing process for a syntax element SE (informative) PAGEREF _Toc220484775 \h 229
HYPERLINK \l "_Toc220484776" Figure 92 – Overview of the arithmetic decoding process for a single bin (informative) PAGEREF _Toc220484776 \h 277
HYPERLINK \l "_Toc220484777" Figure 93 – Flowchart for decoding a decision PAGEREF _Toc220484777 \h 278
HYPERLINK \l "_Toc220484778" Figure 94 – Flowchart of renormalization PAGEREF _Toc220484778 \h 280
HYPERLINK \l "_Toc220484779" Figure 95 – Flowchart of bypass decoding process PAGEREF _Toc220484779 \h 281
HYPERLINK \l "_Toc220484780" Figure 96 – Flowchart of decoding a decision before termination PAGEREF _Toc220484780 \h 282
HYPERLINK \l "_Toc220484781" Figure 97 – Flowchart for encoding a decision PAGEREF _Toc220484781 \h 284
HYPERLINK \l "_Toc220484782" Figure 98 – Flowchart of renormalization in the encoder PAGEREF _Toc220484782 \h 285
HYPERLINK \l "_Toc220484783" Figure 99 – Flowchart of PutBit(B) PAGEREF _Toc220484783 \h 286
HYPERLINK \l "_Toc220484784" Figure 910 – Flowchart of encoding bypass PAGEREF _Toc220484784 \h 287
HYPERLINK \l "_Toc220484785" Figure 911 – Flowchart of encoding a decision before termination PAGEREF _Toc220484785 \h 288
HYPERLINK \l "_Toc220484786" Figure 912 – Flowchart of flushing at termination PAGEREF _Toc220484786 \h 288
HYPERLINK \l "_Toc220484787" Figure C1 – Structure of byte streams and NAL unit streams for HRD conformance checks PAGEREF _Toc220484787 \h 311
HYPERLINK \l "_Toc220484788" Figure C2 – HRD buffer model PAGEREF _Toc220484788 \h 312
HYPERLINK \l "_Toc220484789" Figure E1 – Location of chroma samples for top and bottom fields for chroma_format_idc equal to 1 (4:2:0 chroma format) as a function of chroma_sample_loc_type_top_field and chroma_sample_loc_type_bottom_field PAGEREF _Toc220484789 \h 377
List of tables
TOC \h \z \c "Table" HYPERLINK \l "_Toc220484790" Table 51 – Operation precedence from highest (at top of table) to lowest (at bottom of table) PAGEREF _Toc220484790 \h 16
HYPERLINK \l "_Toc220484791" Table 61 – SubWidthC, and SubHeightC values derived from chroma_format_idc and separate_colour_plane_flag PAGEREF _Toc220484791 \h 20
HYPERLINK \l "_Toc220484792" Table 62 – Specification of input and output assignments for subclauses 6.4.10.1 to 6.4.10.7 PAGEREF _Toc220484792 \h 31
HYPERLINK \l "_Toc220484793" Table 63 – Specification of mbAddrN PAGEREF _Toc220484793 \h 36
HYPERLINK \l "_Toc220484794" Table 64 – Specification of mbAddrN and yM PAGEREF _Toc220484794 \h 37
HYPERLINK \l "_Toc220484795" Table 71 – NAL unit type codes, syntax element categories, and NAL unit type classes PAGEREF _Toc220484795 \h 62
HYPERLINK \l "_Toc220484796" Table 72 – Assignment of mnemonic names to scaling list indices and specification of fall-back rule PAGEREF _Toc220484796 \h 73
HYPERLINK \l "_Toc220484797" Table 73 – Specification of default scaling lists Default_4x4_Intra and Default_4x4_Inter PAGEREF _Toc220484797 \h 73
HYPERLINK \l "_Toc220484798" Table 74 – Specification of default scaling lists Default_8x8_Intra and Default_8x8_Inter PAGEREF _Toc220484798 \h 74
HYPERLINK \l "_Toc220484799" Table 75 – Meaning of primary_pic_type PAGEREF _Toc220484799 \h 81
HYPERLINK \l "_Toc220484800" Table 76 – Name association to slice_type PAGEREF _Toc220484800 \h 84
HYPERLINK \l "_Toc220484801" Table 77 – modification_of_pic_nums_idc operations for modification of reference picture lists PAGEREF _Toc220484801 \h 90
HYPERLINK \l "_Toc220484802" Table 78 – Interpretation of adaptive_ref_pic_marking_mode_flag PAGEREF _Toc220484802 \h 92
HYPERLINK \l "_Toc220484803" Table 79 – Memory management control operation (memory_management_control_operation) values PAGEREF _Toc220484803 \h 93
HYPERLINK \l "_Toc220484804" Table 710 – Allowed collective macroblock types for slice_type PAGEREF _Toc220484804 \h 95
HYPERLINK \l "_Toc220484805" Table 711 – Macroblock types for I slices PAGEREF _Toc220484805 \h 97
HYPERLINK \l "_Toc220484806" Table 712 – Macroblock type with value 0 for SI slices PAGEREF _Toc220484806 \h 98
HYPERLINK \l "_Toc220484807" Table 713 – Macroblock type values 0 to 4 for P and SP slices PAGEREF _Toc220484807 \h 99
HYPERLINK \l "_Toc220484808" Table 714 – Macroblock type values 0 to 22 for B slices PAGEREF _Toc220484808 \h 100
HYPERLINK \l "_Toc220484809" Table 715 – Specification of CodedBlockPatternChroma values PAGEREF _Toc220484809 \h 102
HYPERLINK \l "_Toc220484810" Table 716 – Relationship between intra_chroma_pred_mode and spatial prediction modes PAGEREF _Toc220484810 \h 103
HYPERLINK \l "_Toc220484811" Table 717 – Sub-macroblock types in P macroblocks PAGEREF _Toc220484811 \h 104
HYPERLINK \l "_Toc220484812" Table 718 – Sub-macroblock types in B macroblocks PAGEREF _Toc220484812 \h 105
HYPERLINK \l "_Toc220484813" Table 81 – Refined slice group map type PAGEREF _Toc220484813 \h 114
HYPERLINK \l "_Toc220484814" Table 82 – Specification of Intra4x4PredMode[ luma4x4BlkIdx ] and associated names PAGEREF _Toc220484814 \h 130
HYPERLINK \l "_Toc220484815" Table 83 – Specification of Intra8x8PredMode[ luma8x8BlkIdx ] and associated names PAGEREF _Toc220484815 \h 137
HYPERLINK \l "_Toc220484816" Table 84 – Specification of Intra16x16PredMode and associated names PAGEREF _Toc220484816 \h 144
HYPERLINK \l "_Toc220484817" Table 85 – Specification of Intra chroma prediction modes and associated names PAGEREF _Toc220484817 \h 147
HYPERLINK \l "_Toc220484818" Table 86 – Specification of the variable colPic PAGEREF _Toc220484818 \h 155
HYPERLINK \l "_Toc220484819" Table 87 – Specification of PicCodingStruct( X ) PAGEREF _Toc220484819 \h 156
HYPERLINK \l "_Toc220484820" Table 88 – Specification of mbAddrCol, yM, and vertMvScale PAGEREF _Toc220484820 \h 157
HYPERLINK \l "_Toc220484821" Table 89 – Assignment of prediction utilization flags PAGEREF _Toc220484821 \h 159
HYPERLINK \l "_Toc220484822" Table 810 – Derivation of the vertical component of the chroma vector in field coding mode PAGEREF _Toc220484822 \h 165
HYPERLINK \l "_Toc220484823" Table 811 – Differential full-sample luma locations PAGEREF _Toc220484823 \h 170
HYPERLINK \l "_Toc220484824" Table 812 – Assignment of the luma prediction sample predPartLXL[ xL, yL ] PAGEREF _Toc220484824 \h 171
HYPERLINK \l "_Toc220484825" Table 813 – Specification of mapping of idx to cij for zig-zag and field scan PAGEREF _Toc220484825 \h 182
HYPERLINK \l "_Toc220484826" Table 814 – Specification of mapping of idx to cij for 8x8 zig-zag and 8x8 field scan PAGEREF _Toc220484826 \h 183
HYPERLINK \l "_Toc220484827" Table 815 – Specification of QPC as a function of qPI PAGEREF _Toc220484827 \h 184
HYPERLINK \l "_Toc220484828" Table 816 – Derivation of offset dependent threshold variables (' and (' from indexA and indexB PAGEREF _Toc220484828 \h 210
HYPERLINK \l "_Toc220484829" Table 817 – Value of variable t'C0 as a function of indexA and bS PAGEREF _Toc220484829 \h 211
HYPERLINK \l "_Toc220484830" Table 91 – Bit strings with "prefix" and "suffix" bits and assignment to codeNum ranges (informative) PAGEREF _Toc220484830 \h 215
HYPERLINK \l "_Toc220484831" Table 92 – Exp-Golomb bit strings and codeNum in explicit form and used as ue(v) (informative) PAGEREF _Toc220484831 \h 215
HYPERLINK \l "_Toc220484832" Table 93 – Assignment of syntax element to codeNum for signed Exp-Golomb coded syntax elements se(v) PAGEREF _Toc220484832 \h 216
HYPERLINK \l "_Toc220484833" Table 94 – Assignment of codeNum to values of coded_block_pattern for macroblock prediction modes PAGEREF _Toc220484833 \h 217
HYPERLINK \l "_Toc220484834" Table 95 – coeff_token mapping to TotalCoeff( coeff_token ) and TrailingOnes( coeff_token ) PAGEREF _Toc220484834 \h 222
HYPERLINK \l "_Toc220484835" Table 96 – Codeword table for level_prefix (informative) PAGEREF _Toc220484835 \h 225
HYPERLINK \l "_Toc220484836" Table 97 – total_zeros tables for 4x4 blocks with tzVlcIndex 1 to 7 PAGEREF _Toc220484836 \h 226
HYPERLINK \l "_Toc220484837" Table 98 – total_zeros tables for 4x4 blocks with tzVlcIndex 8 to 15 PAGEREF _Toc220484837 \h 227
HYPERLINK \l "_Toc220484838" Table 99 – total_zeros tables for chroma DC 2x2 and 2x4 blocks PAGEREF _Toc220484838 \h 227
HYPERLINK \l "_Toc220484839" Table 910 – Tables for run_before PAGEREF _Toc220484839 \h 228
HYPERLINK \l "_Toc220484840" Table 911 – Association of ctxIdx and syntax elements for each slice type in the initialisation process PAGEREF _Toc220484840 \h 231
HYPERLINK \l "_Toc220484841" Table 912 – Values of variables m and n for ctxIdx from 0 to 10 PAGEREF _Toc220484841 \h 232
HYPERLINK \l "_Toc220484842" Table 913 – Values of variables m and n for ctxIdx from 11 to 23 PAGEREF _Toc220484842 \h 232
HYPERLINK \l "_Toc220484843" Table 914 – Values of variables m and n for ctxIdx from 24 to 39 PAGEREF _Toc220484843 \h 233
HYPERLINK \l "_Toc220484844" Table 915 – Values of variables m and n for ctxIdx from 40 to 53 PAGEREF _Toc220484844 \h 233
HYPERLINK \l "_Toc220484845" Table 916 – Values of variables m and n for ctxIdx from 54 to 59, and 399 to 401 PAGEREF _Toc220484845 \h 233
HYPERLINK \l "_Toc220484846" Table 917 – Values of variables m and n for ctxIdx from 60 to 69 PAGEREF _Toc220484846 \h 234
HYPERLINK \l "_Toc220484847" Table 918 – Values of variables m and n for ctxIdx from 70 to 104 PAGEREF _Toc220484847 \h 234
HYPERLINK \l "_Toc220484848" Table 919 – Values of variables m and n for ctxIdx from 105 to 165 PAGEREF _Toc220484848 \h 235
HYPERLINK \l "_Toc220484849" Table 920 – Values of variables m and n for ctxIdx from 166 to 226 PAGEREF _Toc220484849 \h 236
HYPERLINK \l "_Toc220484850" Table 921 – Values of variables m and n for ctxIdx from 227 to 275 PAGEREF _Toc220484850 \h 237
HYPERLINK \l "_Toc220484851" Table 922 – Values of variables m and n for ctxIdx from 277 to 337 PAGEREF _Toc220484851 \h 238
HYPERLINK \l "_Toc220484852" Table 923 – Values of variables m and n for ctxIdx from 338 to 398 PAGEREF _Toc220484852 \h 239
HYPERLINK \l "_Toc220484853" Table 924 – Values of variables m and n for ctxIdx from 402 to 459 PAGEREF _Toc220484853 \h 240
HYPERLINK \l "_Toc220484854" Table 925 – Values of variables m and n for ctxIdx from 460 to 483 PAGEREF _Toc220484854 \h 241
HYPERLINK \l "_Toc220484855" Table 926 – Values of variables m and n for ctxIdx from 484 to 571 PAGEREF _Toc220484855 \h 242
HYPERLINK \l "_Toc220484856" Table 927 – Values of variables m and n for ctxIdx from 572 to 659 PAGEREF _Toc220484856 \h 244
HYPERLINK \l "_Toc220484857" Table 928 – Values of variables m and n for ctxIdx from 660 to 717 PAGEREF _Toc220484857 \h 246
HYPERLINK \l "_Toc220484858" Table 929 – Values of variables m and n for ctxIdx from 718 to 775 PAGEREF _Toc220484858 \h 247
HYPERLINK \l "_Toc220484859" Table 930 – Values of variables m and n for ctxIdx from 776 to 863 PAGEREF _Toc220484859 \h 248
HYPERLINK \l "_Toc220484860" Table 931 – Values of variables m and n for ctxIdx from 864 to 951 PAGEREF _Toc220484860 \h 250
HYPERLINK \l "_Toc220484861" Table 932 – Values of variables m and n for ctxIdx from 952 to 1011 PAGEREF _Toc220484861 \h 252
HYPERLINK \l "_Toc220484862" Table 933 – Values of variables m and n for ctxIdx from 1012 to 1023 PAGEREF _Toc220484862 \h 253
HYPERLINK \l "_Toc220484863" Table 934 – Syntax elements and associated types of binarization, maxBinIdxCtx, and ctxIdxOffset PAGEREF _Toc220484863 \h 255
HYPERLINK \l "_Toc220484864" Table 935 – Bin string of the unary binarization (informative) PAGEREF _Toc220484864 \h 257
HYPERLINK \l "_Toc220484865" Table 936 – Binarization for macroblock types in I slices PAGEREF _Toc220484865 \h 260
HYPERLINK \l "_Toc220484866" Table 937 – Binarization for macroblock types in P, SP, and B slices PAGEREF _Toc220484866 \h 261
HYPERLINK \l "_Toc220484867" Table 938 – Binarization for sub-macroblock types in P, SP, and B slices PAGEREF _Toc220484867 \h 262
HYPERLINK \l "_Toc220484868" Table 939 – Assignment of ctxIdxInc to binIdx for all ctxIdxOffset values except those related to the syntax elements coded_block_flag, significant_coeff_flag, last_significant_coeff_flag, and coeff_abs_level_minus1 PAGEREF _Toc220484868 \h 264
HYPERLINK \l "_Toc220484869" Table 940 – Assignment of ctxIdxBlockCatOffset to ctxBlockCat for syntax elements coded_block_flag, significant_coeff_flag, last_significant_coeff_flag, and coeff_abs_level_minus1 PAGEREF _Toc220484869 \h 265
HYPERLINK \l "_Toc220484870" Table 941 – Specification of ctxIdxInc for specific values of ctxIdxOffset and binIdx PAGEREF _Toc220484870 \h 273
HYPERLINK \l "_Toc220484871" Table 942 – Specification of ctxBlockCat for the different blocks PAGEREF _Toc220484871 \h 274
HYPERLINK \l "_Toc220484872" Table 943 – Mapping of scanning position to ctxIdxInc for ctxBlockCat = = 5, 9, or 13 PAGEREF _Toc220484872 \h 275
HYPERLINK \l "_Toc220484873" Table 944 – Specification of rangeTabLPS depending on pStateIdx and qCodIRangeIdx PAGEREF _Toc220484873 \h 279
HYPERLINK \l "_Toc220484874" Table 945 – State transition table PAGEREF _Toc220484874 \h 280
HYPERLINK \l "_Toc220484875" Table A1 – Level limits PAGEREF _Toc220484875 \h 298
HYPERLINK \l "_Toc220484876" Table A2 – Specification of cpbBrVclFactor and cpbBrNalFactor PAGEREF _Toc220484876 \h 301
HYPERLINK \l "_Toc220484877" Table A3 – Baseline profile level limits PAGEREF _Toc220484877 \h 302
HYPERLINK \l "_Toc220484878" Table A4 – Main, High, High 10, High 4:2:2, High 4:4:4 Predictive, High 10 Intra, High 4:2:2 Intra, High 4:4:4 Intra, and CAVLC 4:4:4 Intra profile level limits PAGEREF _Toc220484878 \h 303
HYPERLINK \l "_Toc220484879" Table A5 – Extended profile level limits PAGEREF _Toc220484879 \h 304
HYPERLINK \l "_Toc220484880" Table A6 – Maximum frame rates (frames per second) for some example frame sizes PAGEREF _Toc220484880 \h 305
HYPERLINK \l "_Toc220484881" Table A7 – Maximum DPB size (frames) for some example frame sizes PAGEREF _Toc220484881 \h 307
HYPERLINK \l "_Toc220484882" Table D1 – Interpretation of pic_struct PAGEREF _Toc220484882 \h 338
HYPERLINK \l "_Toc220484883" Table D2 – Mapping of ct_type to source picture scan PAGEREF _Toc220484883 \h 339
HYPERLINK \l "_Toc220484884" Table D3 – Definition of counting_type values PAGEREF _Toc220484884 \h 340
HYPERLINK \l "_Toc220484885" Table D4 – scene_transition_type values PAGEREF _Toc220484885 \h 347
HYPERLINK \l "_Toc220484886" Table D5 – model_id values PAGEREF _Toc220484886 \h 355
HYPERLINK \l "_Toc220484887" Table D6 – blending_mode_id values PAGEREF _Toc220484887 \h 356
HYPERLINK \l "_Toc220484888" Table D7 – filter_hint_type values PAGEREF _Toc220484888 \h 363
HYPERLINK \l "_Toc220484889" Table E1 – Meaning of sample aspect ratio indicator PAGEREF _Toc220484889 \h 369
HYPERLINK \l "_Toc220484890" Table E2 – Meaning of video_format PAGEREF _Toc220484890 \h 370
HYPERLINK \l "_Toc220484891" Table E3 – Colour primaries PAGEREF _Toc220484891 \h 371
HYPERLINK \l "_Toc220484892" Table E4 – Transfer characteristics PAGEREF _Toc220484892 \h 372
HYPERLINK \l "_Toc220484893" Table E5 – Matrix coefficients PAGEREF _Toc220484893 \h 375
HYPERLINK \l "_Toc220484894" Table E6 – Divisor for computation of (tfi,dpb( n ) PAGEREF _Toc220484894 \h 378
HYPERLINK \l "_Toc220484895" Table G1 – Name association to slice_type for NAL units with nal_unit_type equal to 20. PAGEREF _Toc220484895 \h 425
HYPERLINK \l "_Toc220484896" Table G2 – Interpretation of adaptive_ref_base_pic_marking_mode_flag PAGEREF _Toc220484896 \h 434
HYPERLINK \l "_Toc220484897" Table G3 – Memory management base control operation (memory_management_base_control_operation) values PAGEREF _Toc220484897 \h 434
HYPERLINK \l "_Toc220484898" Table G4 – Allowed collective macroblock types for slice_type. PAGEREF _Toc220484898 \h 437
HYPERLINK \l "_Toc220484899" Table G5 – Inferred macroblock type I_BL for EI slices. PAGEREF _Toc220484899 \h 438
HYPERLINK \l "_Toc220484900" Table G6 – Scale values cS for transform coefficient level scaling PAGEREF _Toc220484900 \h 500
HYPERLINK \l "_Toc220484901" Table G7 – Macroblock type predictors mbTypeILPred PAGEREF _Toc220484901 \h 518
HYPERLINK \l "_Toc220484902" Table G8 – Sub-macroblock type predictors subMbTypeILPred[ mbPartIdx ] PAGEREF _Toc220484902 \h 518
HYPERLINK \l "_Toc220484903" Table G9 – 16-phase luma interpolation filter for resampling in Intra_Base prediction PAGEREF _Toc220484903 \h 527
HYPERLINK \l "_Toc220484904" Table G-10 – Mapping of ( nX, nY ) to coeffTokenIdx and vice versa PAGEREF _Toc220484904 \h 553
HYPERLINK \l "_Toc220484905" Table G11 – Association of ctxIdx and syntax elements for each slice type in the initialisation process PAGEREF _Toc220484905 \h 556
HYPERLINK \l "_Toc220484906" Table G12 – Values of variables m and n for ctxIdx from 1024 to 1026 PAGEREF _Toc220484906 \h 557
HYPERLINK \l "_Toc220484907" Table G13 – Values of variables m and n for ctxIdx from 1027 to 1030 PAGEREF _Toc220484907 \h 557
HYPERLINK \l "_Toc220484908" Table G14 – Syntax elements and associated types of binarization, maxBinIdxCtx, and ctxIdxOffset PAGEREF _Toc220484908 \h 557
HYPERLINK \l "_Toc220484909" Table G15 – Assignment of ctxIdxInc to binIdx for the ctxIdxOffset values related to the syntax elements base_mode_flag and residual_prediction_flag PAGEREF _Toc220484909 \h 558
HYPERLINK \l "_Toc220484910" Table G16 – Scalable Baseline profile level limits PAGEREF _Toc220484910 \h 567
HYPERLINK \l "_Toc220484911" Table G17 – Specification of cpbBrVclFactor and cpbBrNalFactor PAGEREF _Toc220484911 \h 567
Foreword
The International Telecommunication Union (ITU) is the United Nations specialized agency in the field of telecommunications. The ITU Telecommunication Standardization Sector (ITU-T) is a permanent organ of ITU. ITU-T is responsible for studying technical, operating and tariff questions and issuing Recommendations on them with a view to standardising telecommunications on a world-wide basis. The World Telecommunication Standardization Assembly (WTSA), which meets every four years, establishes the topics for study by the ITU-T study groups that, in turn, produce Recommendations on these topics. The approval of ITU-T Recommendations is covered by the procedure laid down in WTSA Resolution 1. In some areas of information technology that fall within ITU-T's purview, the necessary standards are prepared on a collaborative basis with ISO and IEC.
ISO (the International Organization for Standardization) and IEC (the International Electrotechnical Commission) form the specialised system for world-wide standardisation. National Bodies that are members of ISO and IEC participate in the development of International Standards through technical committees established by the respective organisation to deal with particular fields of technical activity. ISO and IEC technical committees collaborate in fields of mutual interest. Other international organisations, governmental and non-governmental, in liaison with ISO and IEC, also take part in the work. In the field of information technology, ISO and IEC have established a joint technical committee, ISO/IEC JTC 1. Draft International Standards adopted by the joint technical committee are circulated to national bodies for voting. Publication as an International Standard requires approval by at least 75% of the national bodies casting a vote.
This Recommendation | International Standard was prepared jointly by ITU-T SG 16 Q.6, also known as VCEG (Video Coding Experts Group), and by ISO/IEC JTC 1/SC 29/WG 11, also known as MPEG (Moving Picture Experts Group). VCEG was formed in 1997 to maintain prior ITU-T video coding standards and develop new video coding standard(s) appropriate for a wide range of conversational and non-conversational services. MPEG was formed in 1988 to establish standards for coding of moving pictures and associated audio for various applications such as digital storage media, distribution, and communication.
In this Recommendation | International Standard Annexes REF _Ref36826677 \r \h A through REF _Ref205176547 \r \h E and REF _Ref168473844 \r \h G contain normative requirements and are an integral part of this Recommendation | International Standard.
ITU-T Recommendation H.264
Advanced video coding for generic audiovisual services
Corrigendum 1
Introduction
This clause does not form an integral part of this Recommendation | International Standard.
Prologue
This subclause does not form an integral part of this Recommendation | International Standard.
As the costs for both processing power and memory have reduced, network support for coded video data has diversified, and advances in video coding technology have progressed, the need has arisen for an industry standard for compressed video representation with substantially increased coding efficiency and enhanced robustness to network environments. Toward these ends the ITU-T Video Coding Experts Group (VCEG) and the ISO/IEC Moving Picture Experts Group (MPEG) formed a Joint Video Team (JVT) in 2001 for development of a new Recommendation | International Standard.
Purpose
This subclause does not form an integral part of this Recommendation | International Standard.
This Recommendation | International Standard was developed in response to the growing need for higher compression of moving pictures for various applications such as videoconferencing, digital storage media, television broadcasting, internet streaming, and communication. It is also designed to enable the use of the coded video representation in a flexible manner for a wide variety of network environments. The use of this Recommendation | International Standard allows motion video to be manipulated as a form of computer data and to be stored on various storage media, transmitted and received over existing and future networks and distributed on existing and future broadcasting channels.
Applications
This subclause does not form an integral part of this Recommendation | International Standard.
This Recommendation | International Standard is designed to cover a broad range of applications for video content including but not limited to the following:
CATV Cable TV on optical networks, copper, etc.
DBS Direct broadcast satellite video services
DSL Digital subscriber line video services
DTTB Digital terrestrial television broadcasting
ISM Interactive storage media (optical disks, etc.)
MMM Multimedia mailing
MSPN Multimedia services over packet networks
RTC Real-time conversational services (videoconferencing, videophone, etc.)
RVS Remote video surveillance
SSM Serial storage media (digital VTR, etc.)
Publication and versions of this specification
This subclause does not form an integral part of this Recommendation | International Standard.
This specification has been jointly developed by ITUT Video Coding Experts Group (VCEG) and the ISO/IEC Moving Picture Experts Group. It is published as technically-aligned twin text in both organizations ITU-T and ISO/IEC.
ITUT Rec. H.264 | ISO/IEC 1449610 version 1 refers to the first approved version of this Recommendation | International Standard. Version 1 was approved by ITU-T on 30 May 2003. The first published version in ISO/IEC corresponded to version 1.
ITUT Rec. H.264 | ISO/IEC 1449610 version 2 refers to the integrated text containing the corrections specified in the first technical corrigendum. The first fully-published version in the ITU-T was version 2 as approved by ITU-T on 7 May 2004, due to the development of the corrigendum during the publication process. Version 2 was also published in integrated form by ISO/IEC.
ITUT Rec. H.264 | ISO/IEC 1449610 version 3 refers to the integrated text containing both the first technical corrigendum (2004) and the first amendment, which is referred to as the "Fidelity range extensions". Version 3 was approved by ITU-T on 1 March 2005.
ITUT Rec. H.264 | ISO/IEC 1449610 version 4 refers to the integrated text containing the first technical corrigendum (2004), the first amendment (the "Fidelity range extensions"), and an additional technical corrigendum (2005). Version 4 was approved by ITU-T on 13 September 2005. In both ITU-T and ISO/IEC, the next complete published version after version 2 was version 4.
ITUT Rec. H.264 | ISO/IEC 1449610 version 5 refers to the integrated version 4 text with its specification of the High 4:4:4 profile removed.
ITUT Rec. H.264 | ISO/IEC 1449610 version 6 refers to the integrated version 5 text after its amendment to support additional colour space indicators. In the ITU-T, the changes for versions 5 and 6 were approved on 13 June 2006 and were published as a single amendment.
ITUT Rec. H.264 | ISO/IEC 1449610 version 7 refers to the integrated version 6 text after its amendment to define five new profiles intended primarily for professional applications (the High 10 Intra, High 4:2:2 Intra, High 4:4:4 Intra, CAVLC 4:4:4 Intra, and High 4:4:4 Predictive profiles) and two new types of supplemental enhancement information (SEI) messages (the post-filter hint SEI message and the tone mapping information SEI message). Version 7 was approved by ITU-T on 6 April 2007.
ITUT Rec. H.264 | ISO/IEC 1449610 version 8 (the current specification) refers to the integrated version 7 text after its amendment to specify scalable video coding in three profiles (Scalable Baseline, Scalable High, and Scalable High Intra profiles). Version 8 was approved by the ITU-T on 22 November 2007.
ITUT Rec. H.264 | ISO/IEC 1449610 version 9 (the current Specification) refers to the integrated version 8 text after applying the corrections specified in a third technical corrigendum. Version 9 was approved by the ITU-T on 13 January 2009.
Profiles and levels
This subclause does not form an integral part of this Recommendation | International Standard.
This Recommendation | International Standard is designed to be generic in the sense that it serves a wide range of applications, bit rates, resolutions, qualities, and services. Applications should cover, among other things, digital storage media, television broadcasting and real-time communications. In the course of creating this Specification, various requirements from typical applications have been considered, necessary algorithmic elements have been developed, and these have been integrated into a single syntax. Hence, this Specification will facilitate video data interchange among different applications.
Considering the practicality of implementing the full syntax of this Specification, however, a limited number of subsets of the syntax are also stipulated by means of "profiles" and "levels". These and other related terms are formally defined in clause REF _Ref20133014 \r \h 3.
A "profile" is a subset of the entire bitstream syntax that is specified by this Recommendation | International Standard. Within the bounds imposed by the syntax of a given profile it is still possible to require a very large variation in the performance of encoders and decoders depending upon the values taken by syntax elements in the bitstream such as the specified size of the decoded pictures. In many applications, it is currently neither practical nor economic to implement a decoder capable of dealing with all hypothetical uses of the syntax within a particular profile.
In order to deal with this problem, "levels" are specified within each profile. A level is a specified set of constraints imposed on values of the syntax elements in the bitstream. These constraints may be simple limits on values. Alternatively they may take the form of constraints on arithmetic combinations of values (e.g., picture width multiplied by picture height multiplied by number of pictures decoded per second).
Coded video content conforming to this Recommendation | International Standard uses a common syntax. In order to achieve a subset of the complete syntax, flags, parameters, and other syntax elements are included in the bitstream that signal the presence or absence of syntactic elements that occur later in the bitstream.
Overview of the design characteristics
This subclause does not form an integral part of this Recommendation | International Standard.
The coded representation specified in the syntax is designed to enable a high compression capability for a desired image quality. With the exception of the transform bypass mode of operation for lossless coding in the High 4:4:4 Intra, CAVLC 4:4:4 Intra, and High 4:4:4 Predictive profiles, and the I_PCM mode of operation in all profiles, the algorithm is typically not lossless, as the exact source sample values are typically not preserved through the encoding and decoding processes. A number of techniques may be used to achieve highly efficient compression. Encoding algorithms (not specified in this Recommendation | International Standard) may select between inter and intra coding for block-shaped regions of each picture. Inter coding uses motion vectors for block-based inter prediction to exploit temporal statistical dependencies between different pictures. Intra coding uses various spatial prediction modes to exploit spatial statistical dependencies in the source signal for a single picture. Motion vectors and intra prediction modes may be specified for a variety of block sizes in the picture. The prediction residual is then further compressed using a transform to remove spatial correlation inside the transform block before it is quantised, producing an irreversible process that typically discards less important visual information while forming a close approximation to the source samples. Finally, the motion vectors or intra prediction modes are combined with the quantised transform coefficient information and encoded using either variable length codinges or arithmetic coding.
Scalable video coding is specified in Annex REF _Ref168473844 \r \h G of this specification allowing the construction of bitstreams that contain sub-bitstreams that conform to this specification. For temporal bitstream scalability, i.e., the presence of a sub-bitstream with a smaller temporal sampling rate than the bitstream, complete access units are removed from the bitstream when deriving the sub-bitstream. In this case, high-level syntax and inter prediction reference pictures in the bitstream are constructed accordingly. For spatial and quality bitstream scalability, i.e., the presence of a sub-bitstream with lower spatial resolution or quality than the bitstream, NAL units are removed from the bitstream when deriving the sub-bitstream. In this case, inter-layer prediction, i.e., the prediction of the higher spatial resolution or quality signal by data of the lower spatial resolution or quality signal, is typically used for efficient coding.
Otherwise, the coding algorithm as described in the previous paragraph is used.
Predictive coding
This subclause does not form an integral part of this Recommendation | International Standard.
Because of the conflicting requirements of random access and highly efficient compression, two main coding types are specified. Intra coding is done without reference to other pictures. Intra coding may provide access points to the coded sequence where decoding can begin and continue correctly, but typically also shows only moderate compression efficiency. Inter coding (predictive or bi-predictive) is more efficient using inter prediction of each block of sample values from some previously decoded picture selected by the encoder. In contrast to some other video coding standards, pictures coded using bi-predictive inter prediction may also be used as references for inter coding of other pictures.
The application of the three coding types to pictures in a sequence is flexible, and the order of the decoding process is generally not the same as the order of the source picture capture process in the encoder or the output order from the decoder for display. The choice is left to the encoder and will depend on the requirements of the application. The decoding order is specified such that the decoding of pictures that use inter-picture prediction follows later in decoding order than other pictures that are referenced in the decoding process.
Coding of progressive and interlaced video
This subclause does not form an integral part of this Recommendation | International Standard.
This Recommendation | International Standard specifies a syntax and decoding process for video that originated in either progressive-scan or interlaced-scan form, which may be mixed together in the same sequence. The two fields of an interlaced frame are separated in capture time while the two fields of a progressive frame share the same capture time. Each field may be coded separately or the two fields may be coded together as a frame. Progressive frames are typically coded as a frame. For interlaced video, the encoder can choose between frame coding and field coding. Frame coding or field coding can be adaptively selected on a picture-by-picture basis and also on a more localized basis within a coded frame. Frame coding is typically preferred when the video scene contains significant detail with limited motion. Field coding typically works better when there is fast picture-to-picture motion.
Picture partitioning into macroblocks and smaller partitions
This subclause does not form an integral part of this Recommendation | International Standard.
As in previous video coding Recommendations and International Standards, a macroblock, consisting of a 16x16 block of luma samples and two corresponding blocks of chroma samples, is used as the basic processing unit of the video decoding process.
A macroblock can be further partitioned for inter prediction. The selection of the size of inter prediction partitions is a result of a trade-off between the coding gain provided by using motion compensation with smaller blocks and the quantity of data needed to represent the data for motion compensation. In this Recommendation | International Standard the inter prediction process can form segmentations for motion representation as small as 4x4 luma samples in size, using motion vector accuracy of one-quarter of the luma sample grid spacing displacement. The process for inter prediction of a sample block can also involve the selection of the picture to be used as the reference picture from a number of stored previously-decoded pictures. Motion vectors are encoded differentially with respect to predicted values formed from nearby encoded motion vectors.
Typically, the encoder calculates appropriate motion vectors and other data elements represented in the video data stream. This motion estimation process in the encoder and the selection of whether to use inter prediction for the representation of each region of the video content is not specified in this Recommendation | International Standard.
Spatial redundancy reduction
This subclause does not form an integral part of this Recommendation | International Standard.
Both source pictures and prediction residuals have high spatial redundancy. This Recommendation | International Standard is based on the use of a block-based transform method for spatial redundancy removal. After inter prediction from previously-decoded samples in other pictures or spatial-based prediction from previously-decoded samples within the current picture, the resulting prediction residual is split into 4x4 blocks. These are converted into the transform domain where they are quantised. After quantisation many of the transform coefficients are zero or have low amplitude and can thus be represented with a small amount of encoded data. The processes of transformation and quantisation in the encoder are not specified in this Recommendation | International Standard.
How to read this specification
This subclause does not form an integral part of this Recommendation | International Standard.
It is suggested that the reader starts with clause REF _Ref20132958 \w \h 1 ( REF _Ref20132962 \h Scope) and moves on to clause REF _Ref20133032 \r \h 3 ( REF _Ref20133014 \h Definitions). Clause REF _Ref34468389 \r \h 6 should be read for the geometrical relationship of the source, input, and output of the decoder. Clause REF _Ref24431071 \r \h 7 ( REF _Ref24431071 \h Syntax and semantics) specifies the order to parse syntax elements from the bitstream. See subclauses REF _Ref33101620 \r \h 7.1- REF _Ref20133281 \r \h 7.3 for syntactical order and see subclause REF _Ref166905349 \r \h 7.4 for semantics; i.e., the scope, restrictions, and conditions that are imposed on the syntax elements. The actual parsing for most syntax elements is specified in clause REF _Ref24280994 \r \h 9 ( REF _Ref24280999 \h Parsing process). Finally, clause REF _Ref20133543 \r \h 8 ( REF _Ref20133547 \h Decoding process) specifies how the syntax elements are mapped into decoded samples. Throughout reading this specification, the reader should refer to clauses REF _Ref20133850 \r \h 2 ( REF _Ref20133916 \h Normative references), REF _Ref17564367 \r \h 4 ( REF _Ref17564367 \h Abbreviations), and REF _Ref20133768 \r \h 5 ( REF _Ref20133770 \h Conventions) as needed. Annexes REF _Ref36826677 \r \h A through REF _Ref205008165 \r \h E and REF _Ref168473844 \r \h G also form an integral part of this Recommendation | International Standard.
Annex REF _Ref36826677 \r \h A specifies eleven profiles (Baseline, Main, Extended, High, High 10, High 4:2:2, High 4:4:4 Predictive, High 10 Intra, High 4:2:2 Intra, High 4:4:4 Intra, and CAVLC 4:4:4 Intra), each being tailored to certain application domains, and defines the so-called levels of the profiles. Annex REF _Ref216787276 \r \h B specifies syntax and semantics of a byte stream format for delivery of coded video as an ordered stream of bytes. Annex REF _Ref36858705 \r \h C specifies the hypothetical reference decoder and its use to check bitstream and decoder conformance. Annex REF _Ref205008222 \r \h D specifies syntax and semantics for supplemental enhancement information message payloads. Finally, Annex REF _Ref205008231 \r \h E specifies syntax and semantics of the video usability information parameters of the sequence parameter set.
Annex REF _Ref168473844 \r \h \* MERGEFORMAT G specifies scalable video coding (SVC). The reader is referred to Annex REF _Ref168473844 \r \h \* MERGEFORMAT G for the entire decoding process for SVC, which is specified there with references being made to clauses REF _Ref20133850 \r \h 2- REF _Ref24280994 \r \h 9 and Annexes REF _Ref36826677 \r \h A- REF _Ref170805492 \r \h E. Subclause REF _Ref163545652 \r \h G.10 specifies three profiles for SVC (Scalable Baseline, Scalable High, and Scalable High Intra).
Throughout this specification, statements appearing with the preamble "NOTE -" are informative and are not an integral part of this Recommendation | International Standard.
Scope
This document specifies ITU-T Recommendation H.264 | ISO/IEC International Standard ISO/IEC 14496-10 Advanced video coding.
Normative references
The following Recommendations and International Standards contain provisions which, through reference in this text, constitute provisions of this Recommendation | International Standard. At the time of publication, the editions indicated were valid. All Recommendations and Standards are subject to revision, and parties to agreements based on this Recommendation | International Standard are encouraged to investigate the possibility of applying the most recent edition of the Recommendations and Standards listed below. Members of IEC and ISO maintain registers of currently valid International Standards. The Telecommunication Standardization Bureau of the ITU maintains a list of currently valid ITU-T Recommendations.
– ITU-T Recommendation T.35 (2000), Procedure for the allocation of ITU-T defined codes for non-standard facilities.
– ISO/IEC 11578:1996, Annex A, Universal Unique Identifier.
– ISO/CIE 10527:20071991, Colorimetric Observers.
Definitions
For the purposes of this Recommendation | International Standard, the following definitions apply:.
access unit: A set of NAL units that are consecutive in decoding order and always containing exactly one primary coded picture. In addition to the primary coded picture, an access unit may also contain one or more redundant coded pictures, one auxiliary coded picture, or other NAL units not containing slices or slice data partitions of a coded picture. The decoding of an access unit always results in a decoded picture.
AC transform coefficient: Any transform coefficient for which the frequency index in one or both dimensions is non-zero.
adaptive binary arithmetic decoding process: An entropy decoding process that derives the values of bins from a bitstream produced by an adaptive binary arithmetic encoding process.
adaptive binary arithmetic encoding process: An entropy encoding process, not normatively specified in this Recommendation | International Standard, that codes a sequence of bins and produces a bitstream that can be decoded using the adaptive binary arithmetic decoding process.
alpha blending: A process not specified by this Recommendation | International Standard, in which an auxiliary coded picture is used in combination with a primary coded picture and with other data not specified by this Recommendation | International Standard in the display process. In an alpha blending process, the samples of an auxiliary coded picture are interpreted as indications of the degree of opacity (or, equivalently, the degrees of transparency) associated with the corresponding luma samples of the primary coded picture.
arbitrary slice order (ASO): A decoding order of slices in which the macroblock address of the first macroblock of some slice of a slice group may be less than the macroblock address of the first macroblock of some other preceding slice of the same slice group or, in the case of a picture that is coded using three separate colour planes, some other preceding slice of the same slice group within the same colour plane, or in which the slices of a slice group of a picture may be interleaved with the slices of one or more other slice groups of the picture or, in the case of a picture that is coded using three separate colour planes, with the slices of one or more other slice groups within the same colour plane.
auxiliary coded picture: A picture that supplements the primary coded picture that may be used in combination with other data not specified by this Recommendation | International Standard in the display process. An auxiliary coded picture has the same syntactic and semantic restrictions as a monochrome redundant coded picture. An auxiliary coded picture must contain the same number of macroblocks as the primary coded picture. Auxiliary coded pictures have no normative effect on the decoding process. See also primary coded picture and redundant coded picture.
B slice: A slice that may be decoded using intra prediction or inter prediction using at most two motion vectors and reference indices to predict the sample values of each block.
bin: One bit of a bin string.
binarization: A set of bin strings for all possible values of a syntax element.
binarization process: A unique mapping process of all possible values of a syntax element onto a set of bin strings.
bin string: A string of bins. A bin string is an intermediate binary representation of values of syntax elements from the binarization of the syntax element.
bi-predictive slice: See B slice.
bitstream: A sequence of bits that forms the representation of coded pictures and associated data forming one or more coded video sequences. Bitstream is a collective term used to refer either to a NAL unit stream or a byte stream.
block: An MxN (M-column by N-row) array of samples, or an MxN array of transform coefficients.
bottom field: One of two fields that comprise a frame. Each row of a bottom field is spatially located immediately below a corresponding row of a top field.
bottom macroblock (of a macroblock pair): The macroblock within a macroblock pair that contains the samples in the bottom row of samples for the macroblock pair. For a field macroblock pair, the bottom macroblock represents the samples from the region of the bottom field of the frame that lie within the spatial region of the macroblock pair. For a frame macroblock pair, the bottom macroblock represents the samples of the frame that lie within the bottom half of the spatial region of the macroblock pair.
broken link: A location in a bitstream at which it is indicated that some subsequent pictures in decoding order may contain serious visual artefacts due to unspecified operations performed in the generation of the bitstream.
byte: A sequence of 8 bits, written and read with the most significant bit on the left and the least significant bit on the right. When represented in a sequence of data bits, the most significant bit of a byte is first.
byte-aligned: A position in a bitstream is byte-aligned when the position is an integer multiple of 8 bits from the position of the first bit in the bitstream. A bit or byte or syntax element is said to be byte-aligned when the position at which it appears in a bitstream is byte-aligned.
byte stream: An encapsulation of a NAL unit stream containing start code prefixes and NAL units as specified in Annex REF _Ref216787276 \r \h BB.
can: A term used to refer to behaviour that is allowed, but not necessarily required.
category: A number associated with each syntax element. The category is used to specify the allocation of syntax elements to NAL units for slice data partitioning. It may also be used in a manner determined by the application to refer to classes of syntax elements in a manner not specified in this Recommendation | International Standard.
chroma: An adjective specifying that a sample array or single sample is representing one of the two colour difference signals related to the primary colours. The symbols used for a chroma array or sample are Cb and Cr.
NOTE – The term chroma is used rather than the term chrominance in order to avoid the implication of the use of linear light transfer characteristics that is often associated with the term chrominance.
coded field: A coded representation of a field.
coded frame: A coded representation of a frame.
coded picture: A coded representation of a picture. A coded picture may be either a coded field or a coded frame. Coded picture is a collective term referring to a primary coded picture or a redundant coded picture, but not to both together.
coded picture buffer (CPB): A first-in first-out buffer containing access units in decoding order specified in the hypothetical reference decoder in Annex REF _Ref36858705 \r \h CC.
coded representation: A data element as represented in its coded form.
coded slice data partition NAL unit: A NAL unit containing a slice data partition.
coded slice NAL unit: A NAL unit containing a slice that is not a slice of an auxiliary coded picture.
coded video sequence: A sequence of access units that consists, in decoding order, of an IDR access unit followed by zero or more non-IDR access units including all subsequent access units up to but not including any subsequent IDR access unit.
component: An array or single sample from one of the three arrays (luma and two chroma) that make up a field or frame in 4:2:0, 4:2:2, or 4:4:4 colour format or the array or a single sample of the array that make up a field or frame in monochrome format.
complementary field pair: A collective term for a complementary reference field pair or a complementary non-reference field pair.
complementary non-reference field pair: Two non-reference fields that are in consecutive access units in decoding order as two coded fields of opposite parity where the first field is not already a paired field.
complementary reference field pair: Two reference fields that are in consecutive access units in decoding order as two coded fields and share the same value of the frame_num syntax element, where the second field in decoding order is not an IDR picture and does not include a memory_management_control_operation syntax element equal to 5.
context variable: A variable specified for the adaptive binary arithmetic decoding process of a bin by an equation containing recently decoded bins.
DC transform coefficient: A transform coefficient for which the frequency index is zero in all dimensions.
decoded picture: A decoded picture is derived by decoding a coded picture. A decoded picture is either a decoded frame, or a decoded field. A decoded field is either a decoded top field or a decoded bottom field.
decoded picture buffer (DPB): A buffer holding decoded pictures for reference, output reordering, or output delay specified for the hypothetical reference decoder in Annex REF _Ref36858705 \r \h CC.
decoder: An embodiment of a decoding process.
decoder under test (DUT): A decoder that is tested for conformance to this Recommendation | International Standard by operating the hypothetical stream scheduler to deliver a conforming bitstream to the decoder and to the hypothetical reference decoder and comparing the values and timing of the output of the two decoders.
decoding order: The order in which syntax elements are processed by the decoding process.
decoding process: The process specified in this Recommendation | International Standard that reads a bitstream and derives decoded pictures from it.
direct prediction: An inter prediction for a block for which no motion vector is decoded. Two direct prediction modes are specified that are referred to as spatial direct prediction and temporal prediction mode.
display process: A process not specified in this Recommendation | International Standard having, as its input, the cropped decoded pictures that are the output of the decoding process.
decoder under test (DUT): A decoder that is tested for conformance to this Recommendation | International Standard by operating the hypothetical stream scheduler to deliver a conforming bitstream to the decoder and to the hypothetical reference decoder and comparing the values and timing of the output of the two decoders.
emulation prevention byte: A byte equal to 0x03 that may be present within a NAL unit. The presence of emulation prevention bytes ensures that no sequence of consecutive byte-aligned bytes in the NAL unit contains a start code prefix.
encoder: An embodiment of an encoding process.
encoding process: A process, not specified in this Recommendation | International Standard, that produces a bitstream conforming to this Recommendation | International Standard.
field: An assembly of alternate rows of a frame. A frame is composed of two fields, a top field and a bottom field.
field macroblock: A macroblock containing samples from a single field. All macroblocks of a coded field are field macroblocks. When macroblock-adaptive frame/field decoding is in use, some macroblocks of a coded frame may be field macroblocks.
field macroblock pair: A macroblock pair decoded as two field macroblocks.
field scan: A specific sequential ordering of transform coefficients that differs from the zig-zag scan by scanning columns more rapidly than rows. Field scan is used for transform coefficients in field macroblocks.
flag: A variable that can take one of the two possible values 0 and 1.
frame: A frame contains an array of luma samples in monochrome format or an array of luma samples and two corresponding arrays of chroma samples in 4:2:0, 4:2:2, and 4:4:4 colour format. A frame consists of two fields, a top field and a bottom field.
frame macroblock: A macroblock representing samples from the two fields of a coded frame. When macroblock-adaptive frame/field decoding is not in use, all macroblocks of a coded frame are frame macroblocks. When macroblock-adaptive frame/field decoding is in use, some macroblocks of a coded frame may be frame macroblocks.
frame macroblock pair: A macroblock pair decoded as two frame macroblocks.
frequency index: A one-dimensional or two-dimensional index associated with a transform coefficient prior to an inverse transform part of the decoding process.
hypothetical reference decoder (HRD): A hypothetical decoder model that specifies constraints on the variability of conforming NAL unit streams or conforming byte streams that an encoding process may produce.
hypothetical stream scheduler (HSS): A hypothetical delivery mechanism for the timing and data flow of the input of a bitstream into the hypothetical reference decoder. The HSS is used for checking the conformance of a bitstream or a decoder.
I slice: A slice that is not an SI slice that is decoded using intra prediction only.
informative: A term used to refer to content provided in this Recommendation | International Standard that is not an integral part of this Recommendation | International Standard. Informative content does not establish any mandatory requirements for conformance to this Recommendation | International Standard.
instantaneous decoding refresh (IDR) access unit: An access unit in which the primary coded picture is an IDR picture.
instantaneous decoding refresh (IDR) picture: A coded picture in which all slices are I or SI slices that causes the decoding process to mark all reference pictures as "unused for reference" immediately after decoding the IDR picture. After the decoding of an IDR picture all following coded pictures in decoding order can be decoded without inter prediction from any picture decoded prior to the IDR picture. The first picture of each coded video sequence is an IDR picture.
inter coding: Coding of a block, macroblock, slice, or picture that uses inter prediction.
inter prediction: A prediction derived from decoded samples of reference pictures other than the current decoded picture.
interpretation sample value: A possibly-altered value corresponding to a decoded sample value of an auxiliary coded picture that may be generated for use in the display process. Interpretation sample values are not used in the decoding process and have no normative effect on the decoding process.
intra coding: Coding of a block, macroblock, slice, or picture that uses intra prediction.
intra prediction: A prediction derived from the decoded samples of the same decoded slice.
intra slice: See I slice.
inverse transform: A part of the decoding process by which a set of transform coefficients are converted into spatial-domain values, or by which a set of transform coefficients are converted into DC transform coefficients.
layer: One of a set of syntactical structures in a non-branching hierarchical relationship. Higher layers contain lower layers. The coding layers are the coded video sequence, picture, slice, and macroblock layers.
level: A defined set of constraints on the values that may be taken by the syntax elements and variables of this Recommendation | International Standard. The same set of levels is defined for all profiles, with most aspects of the definition of each level being in common across different profiles. Individual implementations may, within specified constraints, support a different level for each supported profile. In a different context, level is the value of a transform coefficient prior to scaling.
list 0 (list 1) motion vector: A motion vector associated with a reference index pointing into reference picture list 0 (list 1).
list 0 (list 1) prediction: Inter prediction of the content of a slice using a reference index pointing into reference picture list 0 (list 1).
luma: An adjective specifying that a sample array or single sample is representing the monochrome signal related to the primary colours. The symbol or subscript used for luma is Y or L.
NOTE – The term luma is used rather than the term luminance in order to avoid the implication of the use of linear light transfer characteristics that is often associated with the term luminance. The symbol L is sometimes used instead of the symbol Y to avoid confusion with the symbol y as used for vertical location.
macroblock: A 16x16 block of luma samples and two corresponding blocks of chroma samples of a picture that has three sample arrays, or a 16x16 block of samples of a monochrome picture or a picture that is coded using three separate colour planes. The division of a slice or a macroblock pair into macroblocks is a partitioning.
macroblock-adaptive frame/field decoding: A decoding process for coded frames in which some macroblocks may be decoded as frame macroblocks and others may be decoded as field macroblocks.
macroblock address: When macroblock-adaptive frame/field decoding is not in use, a macroblock address is the index of a macroblock in a macroblock raster scan of the picture starting with zero for the top-left macroblock in a picture. When macroblock-adaptive frame/field decoding is in use, the macroblock address of the top macroblock of a macroblock pair is two times the index of the macroblock pair in a macroblock pair raster scan of the picture, and the macroblock address of the bottom macroblock of a macroblock pair is the macroblock address of the corresponding top macroblock plus 1. The macroblock address of the top macroblock of each macroblock pair is an even number and the macroblock address of the bottom macroblock of each macroblock pair is an odd number.
macroblock location: The two-dimensional coordinates of a macroblock in a picture denoted by ( x, y ). For the top left macroblock of the picture ( x, y ) is equal to ( 0, 0 ). x is incremented by 1 for each macroblock column from left to right. When macroblock-adaptive frame/field decoding is not in use, y is incremented by 1 for each macroblock row from top to bottom. When macroblock-adaptive frame/field decoding is in use, y is incremented by 2 for each macroblock pair row from top to bottom, and is incremented by an additional 1 when a macroblock is a bottom macroblock.
macroblock pair: A pair of vertically contiguous macroblocks in a frame that is coupled for use in macroblock-adaptive frame/field decoding. The division of a slice into macroblock pairs is a partitioning.
macroblock partition: A block of luma samples and two corresponding blocks of chroma samples resulting from a partitioning of a macroblock for inter prediction for a picture that has three sample arrays or a block of luma samples resulting from a partitioning of a macroblock for inter prediction for a monochrome picture or a picture that is coded using three separate colour planes.
macroblock to slice group map: A means of mapping macroblocks of a picture into slice groups. The macroblock to slice group map consists of a list of numbers, one for each coded macroblock, specifying the slice group to which each coded macroblock belongs.
map unit to slice group map: A means of mapping slice group map units of a picture into slice groups. The map unit to slice group map consists of a list of numbers, one for each slice group map unit, specifying the slice group to which each coded slice group map unit belongs.
may: A term used to refer to behaviour that is allowed, but not necessarily required. In some places where the optional nature of the described behaviour is intended to be emphasized, the phrase "may or may not" is used to provide emphasis.
memory management control operation: Seven operations that control reference picture marking.
motion vector: A two-dimensional vector used for inter prediction that provides an offset from the coordinates in the decoded picture to the coordinates in a reference picture.
must: A term used in expressing an observation about a requirement or an implication of a requirement that is specified elsewhere in this Recommendation | International Standard. This term is used exclusively in an informative context.
NAL unit: A syntax structure containing an indication of the type of data to follow and bytes containing that data in the form of an RBSP interspersed as necessary with emulation prevention bytes.
NAL unit stream: A sequence of NAL units.
non-paired field: A collective term for a non-paired reference field or a non-paired non-reference field.
non-paired non-reference field: A decoded non-reference field that is not part of a complementary non-reference field pair.
non-paired reference field: A decoded reference field that is not part of a complementary reference field pair.
non-reference field: A field coded with nal_ref_idc equal to 0.
non-reference frame: A frame coded with nal_ref_idc equal to 0.
non-reference picture: A picture coded with nal_ref_idc equal to 0. A non-reference picture is not used for inter prediction of any other pictures.
note: A term used to prefix informative remarks. This term is used exclusively in an informative context.
opposite parity: The opposite parity of top is bottom, and vice versa.
output order: The order in which the decoded pictures are output from the decoded picture buffer.
P slice: A slice that is not an SP slice that may be decoded using intra prediction or inter prediction using at most one motion vector and reference index to predict the sample values of each block.
parameter: A syntax element of a sequence parameter set or a picture parameter set. Parameter is also used as part of the defined term quantisation parameter.
parity: The parity of a field can be top or bottom.
partitioning: The division of a set into subsets such that each element of the set is in exactly one of the subsets.
picture: A collective term for a field or a frame.
picture parameter set: A syntax structure containing syntax elements that apply to zero or more entire coded pictures as determined by the pic_parameter_set_id syntax element found in each slice header.
picture order count: A variable having a value that is non-decreasing with increasing picture position in output order relative to the previous IDR picture in decoding order or relative to the previous picture containing the memory management control operation that marks all reference pictures as "“unused for reference"”.
prediction: An embodiment of the prediction process.
prediction process: The use of a predictor to provide an estimate of the sample value or data element currently being decoded.
predictive slice: See P slice.
predictor: A combination of specified values or previously decoded sample values or data elements used in the decoding process of subsequent sample values or data elements.
primary coded picture: The coded representation of a picture to be used by the decoding process for a bitstream conforming to this Recommendation | International Standard. The primary coded picture contains all macroblocks of the picture. The only pictures that have a normative effect on the decoding process are primary coded pictures. See also redundant coded picture.
profile: A specified subset of the syntax of this Recommendation | International Standard.
quantisation parameter: A variable used by the decoding process for scaling of transform coefficient levels.
random access: The act of starting the decoding process for a bitstream at a point other than the beginning of the stream.
raster scan: A mapping of a rectangular two-dimensional pattern to a one-dimensional pattern such that the first entries in the one-dimensional pattern are from the first top row of the two-dimensional pattern scanned from left to right, followed similarly by the second, third, etc., rows of the pattern (going down) each scanned from left to right.
raw byte sequence payload (RBSP): A syntax structure containing an integer number of bytes that is encapsulated in a NAL unit. An RBSP is either empty or has the form of a string of data bits containing syntax elements followed by an RBSP stop bit and followed by zero or more subsequent bits equal to 0.
raw byte sequence payload (RBSP) stop bit: A bit equal to 1 present within a raw byte sequence payload (RBSP) after a string of data bits. The location of the end of the string of data bits within an RBSP can be identified by searching from the end of the RBSP for the RBSP stop bit, which is the last non-zero bit in the RBSP.
recovery point: A point in the bitstream at which the recovery of an exact or an approximate representation of the decoded pictures represented by the bitstream is achieved after a random access or broken link.
redundant coded picture: A coded representation of a picture or a part of a picture. The content of a redundant coded picture shall not be used by the decoding process for a bitstream conforming to this Recommendation | International Standard. A redundant coded picture is not required to contain all macroblocks in the primary coded picture. Redundant coded pictures have no normative effect on the decoding process. See also primary coded picture.
reference field: A reference field may be used for inter prediction when P, SP, and B slices of a coded field or field macroblocks of a coded frame are decoded. See also reference picture.
reference frame: A reference frame may be used for inter prediction when P, SP, and B slices of a coded frame are decoded. See also reference picture.
reference index: An index into a reference picture list.
reference picture: A picture with nal_ref_idc not equal to 0. A reference picture contains samples that may be used for inter prediction in the decoding process of subsequent pictures in decoding order.
reference picture list: A list of reference pictures that is used for inter prediction of a P, B, or SP slice. For the decoding process of a P or SP slice, there is one reference picture list. For the decoding process of a B slice, there are two reference picture lists.
reference picture list 0: A reference picture list used for inter prediction of a P, B, or SP slice. All inter prediction used for P and SP slices uses reference picture list 0. Reference picture list 0 is one of two reference picture lists used for inter prediction for a B slice, with the other being reference picture list 1.
reference picture list 1: A reference picture list used for inter prediction of a B slice. Reference picture list 1 is one of two lists of reference picture lists used for inter prediction for a B slice, with the other being reference picture list 0.
reference picture marking: Specifies, in the bitstream, how the decoded pictures are marked for inter prediction.
reserved: The term reserved, when used in the clauses specifying some values of a particular syntax element, are for future use by ITU-T | ISO/IEC. These values shall not be used in bitstreams conforming to this Recommendation | International Standard, but may be used in future extensions of this Recommendation | International Standard by ITUT | ISO/IEC.
residual: The decoded difference between a prediction of a sample or data element and its decoded value.
run: A number of consecutive data elements represented in the decoding process. In one context, the number of zero-valued transform coefficient levels preceding a non-zero transform coefficient level in the list of transform coefficient levels generated by a zig-zag scan or a field scan. In other contexts, run refers to a number of macroblocks.
sample aspect ratio: Specifies, for assisting the display process, which is not specified in this Recommendation | International Standard, the ratio between the intended horizontal distance between the columns and the intended vertical distance between the rows of the luma sample array in a frame. Sample aspect ratio is expressed as h:v, where h is horizontal width and v is vertical height (in arbitrary units of spatial distance).
scaling: The process of multiplying transform coefficient levels by a factor, resulting in transform coefficients.
sequence parameter set: A syntax structure containing syntax elements that apply to zero or more entire coded video sequences as determined by the content of a seq_parameter_set_id syntax element found in the picture parameter set referred to by the pic_parameter_set_id syntax element found in each slice header.
shall: A term used to express mandatory requirements for conformance to this Recommendation | International Standard. When used to express a mandatory constraint on the values of syntax elements or on the results obtained by operation of the specified decoding process, it is the responsibility of the encoder to ensure that the constraint is fulfilled. When used in reference to operations performed by the decoding process, any decoding process that produces identical results to the decoding process described herein conforms to the decoding process requirements of this Recommendation | International Standard.
should: A term used to refer to behaviour of an implementation that is encouraged to be followed under anticipated ordinary circumstances, but is not a mandatory requirement for conformance to this Recommendation | International Standard.
SI slice: A slice that is coded using intra prediction only and using quantisation of the prediction samples. An SI slice can be coded such that its decoded samples can be constructed identically to an SP slice.
skipped macroblock: A macroblock for which no data is coded other than an indication that the macroblock is to be decoded as "skipped". This indication may be common to several macroblocks.
slice: An integer number of macroblocks or macroblock pairs ordered consecutively in the raster scan within a particular slice group. For the primary coded picture, the division of each slice group into slices is a partitioning. Although a slice contains macroblocks or macroblock pairs that are consecutive in the raster scan within a slice group, these macroblocks or macroblock pairs are not necessarily consecutive in the raster scan within the picture. The macroblock addresses are derived from the first macroblock address in a slice (as represented in the slice header) and the macroblock to slice group map, and, when a picture is coded using three separate colour planes, a colour plane identifier.
slice data partition: A non-empty subset of the syntax elements of the slice data syntax structure for a slice. The syntax elements of a slice data partition are associated with the same category.
slice data partitioning: A method of partitioning selected syntax elements into syntax structures based on a category associated with each syntax element.
slice group: A subset of the macroblocks or macroblock pairs of a picture. The division of the picture into slice groups is a partitioning of the picture. The partitioning is specified by the macroblock to slice group map.
slice group map units: The units of the map unit to slice group map.
slice header: A part of a coded slice containing the data elements pertaining to the first or all macroblocks represented in the slice.
source: Term used to describe the video material or some of its attributes before encoding.
SP slice: A slice that may be coded using intra prediction or inter prediction with quantisation of the prediction samples using at most one motion vector and reference index to predict the sample values of each block. An SP slice can be coded such that its decoded samples can be constructed identically to another SP slice or an SI slice.
start code prefix: A unique sequence of three bytes equal to 0x000001 embedded in the byte stream as a prefix to each NAL unit. The location of a start code prefix can be used by a decoder to identify the beginning of a new NAL unit and the end of a previous NAL unit. Emulation of start code prefixes is prevented within NAL units by the inclusion of emulation prevention bytes.
string of data bits (SODB): A sequence of some number of bits representing syntax elements present within a raw byte sequence payload prior to the raw byte sequence payload stop bit. Within an SODB, the left-most bit is considered to be the first and most significant bit, and the right-most bit is considered to be the last and least significant bit.
sub-macroblock: One quarter of the samples of a macroblock, i.e., an 8x8 luma block and two corresponding chroma blocks of which one corner is located at a corner of the macroblock for a picture that has three sample arrays or an 8x8 luma block of which one corner is located at a corner of the macroblock for a monochrome picture or a picture that is coded using three separate colour planes.
sub-macroblock partition: A block of luma samples and two corresponding blocks of chroma samples resulting from a partitioning of a sub-macroblock for inter prediction for a picture that has three sample arrays or a block of luma samples resulting from a partitioning of a sub-macroblock for inter prediction for a monochrome picture or a picture that is coded using three separate colour planes.
switching I slice: See SI slice.
switching P slice: See SP slice.
syntax element: An element of data represented in the bitstream.
syntax structure: Zero or more syntax elements present together in the bitstream in a specified order.
top field: One of two fields that comprise a frame. Each row of a top field is spatially located immediately above the corresponding row of the bottom field.
top macroblock (of a macroblock pair): The macroblock within a macroblock pair that contains the samples in the top row of samples for the macroblock pair. For a field macroblock pair, the top macroblock represents the samples from the region of the top field of the frame that lie within the spatial region of the macroblock pair. For a frame macroblock pair, the top macroblock represents the samples of the frame that lie within the top half of the spatial region of the macroblock pair.
transform coefficient: A scalar quantity, considered to be in a frequency domain, that is associated with a particular one-dimensional or two-dimensional frequency index in an inverse transform part of the decoding process.
transform coefficient level: An integer quantity representing the value associated with a particular two-dimensional frequency index in the decoding process prior to scaling for computation of a transform coefficient value.
universal unique identifier (UUID): An identifier that is unique with respect to the space of all universal unique identifiers.
unspecified: The term unspecified, when used in the clauses specifying some values of a particular syntax element, indicates that the values have no specified meaning in this Recommendation | International Standard and will not have a specified meaning in the future as an integral part of this Recommendation | International Standard.
variable length coding (VLC): A reversible procedure for entropy coding that assigns shorter bit strings to symbols expected to be more frequent and longer bit strings to symbols expected to be less frequent.
VCL NAL unit: A collective term for coded slice NAL units and coded slice data partition NAL units.
zig-zag scan: A specific sequential ordering of transform coefficient levels from (approximately) the lowest spatial frequency to the highest. Zig-zag scan is used for transform coefficient levels in frame macroblocks.
Abbreviations
For the purposes of this Recommendation | International Standard, the following abbreviations apply:.
CABAC Context-based Adaptive Binary Arithmetic Coding
CAVLC Context-based Adaptive Variable Length Coding
CBR Constant Bit Rate
CPB Coded Picture Buffer
DPB Decoded Picture Buffer
DUT Decoder under test
FIFO First-In, First-Out
HRD Hypothetical Reference Decoder
HSS Hypothetical Stream Scheduler
IDR Instantaneous Decoding Refresh
LSB Least Significant Bit
MB Macroblock
MBAFF Macroblock-Adaptive Frame-Field Coding
MSB Most Significant Bit
NAL Network Abstraction Layer
RBSP Raw Byte Sequence Payload
SEI Supplemental Enhancement Information
SODB String Of Data Bits
SVC Scalable Video Coding
UUID Universal Unique Identifier
VBR Variable Bit Rate
VCL Video Coding Layer
VLC Variable Length Coding
VUI Video Usability Information
Conventions
NOTE – The mathematical operators used in this Specification are similar to those used in the C programming language. However, integer division and arithmetic shift operations are specifically defined. Numbering and counting conventions generally begin from 0.
Arithmetic operators
The following arithmetic operators are defined as follows:.
+ð Addition
" Subtraction (as a two-argument operator) or negation (as a unary prefix operator)
* Multiplication, including matrix multiplication
x y Exponentiation. Specifies x to the power of y. In other contexts, such notation is used for superscripting not intended for interpretation as exponentiation.
/ Integer division with truncation of the result toward zero. For example, 7/4 and "7/ "4 are truncated to 1 and "7/4 and 7/ "4 are truncated to "1.
¸ð Used to denote division in mathematical equations where no truncation or rounding is intended.
EMBED Equation.3 Used to denote division in mathematical equations where no truncation or rounding is intended.
EMBED Equation.3 The summation of f( i ) with i taking all integer values from x up to and including y.
x % y Modulus. Remainder of x divided by y, defined only for integers x and y with x >= 0 and y > 0.
When order of precedence is not indicated explicitly by use of parenthesis, the following rules apply:
– multiplication and division operations are considered to take place before addition and subtraction;
– multiplication and division operations in sequence are evaluated sequentially from left to right;
– addition and subtraction operations in sequence are evaluated sequentially from left to right.
Logical operators
The following logical operators are defined as follows:
x && y Boolean logical "and" of x and y.
x | | y Boolean logical "or" of x and y.
! Boolean logical "not".
x ? y : z If x is TRUE or not equal to 0, evaluates to the value of y; otherwise, evaluates to the value of z.
Relational operators
The following relational operators are defined as follows:
>ð Greater than.
>ð=ð Greater than or equal to.
<ð Less than.
<ð=ð Less than or equal to.
=ð =ð Equal to.
!=ð Not equal to.
When a relational operator is applied to a syntax element or variable that has been assigned the value "na" (not applicable), the value "na" is treated as a distinct value for the syntax element or variable. The value "na" is considered not to be equal to any other value.
Bit-wise operators
The following bit-wise operators are defined as follows:
& Bit-wise "and". When operating on integer arguments, operates on a two's complement representation of the integer value. When operating on a binary argument that contains fewer bits than another argument, the shorter argument is extended by adding more significant bits equal to 0.
| Bit-wise "or". When operating on integer arguments, operates on a two's complement representation of the integer value. When operating on a binary argument that contains fewer bits than another argument, the shorter argument is extended by adding more significant bits equal to 0.
^ Bit-wise "exclusive or". When operating on integer arguments, operates on a two's complement representation of the integer value. When operating on a binary argument that contains fewer bits than another argument, the shorter argument is extended by adding more significant bits equal to 0.
x >> y Arithmetic right shift of a two’s complement integer representation of x by y binary digits. This function is defined only for positive integer values of y. Bits shifted into the MSBs as a result of the right shift have a value equal to the MSB of x prior to the shift operation.
x << y Arithmetic left shift of a two’s complement integer representation of x by y binary digits. This function is defined only for positive integer values of y. Bits shifted into the LSBs as a result of the left shift have a value equal to 0.
Assignment operators
The following arithmetic operators are defined as follows:
=ð Assignment operator.
+ð +ð Increment, i.e., x+ð +ð is equivalent to x =ð x +ð 1; when used in an array index, evaluates to the value of the variable prior to the increment operation.
" " Decrement, i.e., x " " is equivalent to x =ð x " 1; when used in an array index, evaluates to the value of the variable prior to the decrement operation.
+= Increment by amount specified, i.e., x += 3 is equivalent to x = x + 3, and x += (-"3) is equivalent to x = x + (-"3).
"= Decrement by amount specified, i.e., x "= 3 is equivalent to x = x " 3, and x "= (-"3) is equivalent to x = x " (-"3).
Range notation
The following notation is used to specify a range of values:
x = y .. z x takes on integer values starting from y to z, inclusive, with x, y, and z being integer numbers.
Mathematical functions
The following mathematical functions are defined as follows:
Abs( x ) =ð EMBED Equation.3 ( STYLEREF 1 \s 5- SEQ Equation \r 1 \* ARABIC 1)
Ceil( x ) the smallest integer greater than or equal to x. ( STYLEREF 1 \s 5- SEQ Equation \* ARABIC 2)
Clip1Y( x ) = Clip3( 0, ( 1 << BitDepthY ) " 1, x ) ( STYLEREF 1 \s 5- SEQ Equation \* ARABIC 3)
Clip1C( x ) = Clip3( 0, ( 1 << BitDepthC ) " 1, x ) ( STYLEREF 1 \s 5- SEQ Equation \* ARABIC 4)
Clip3( x, y, z ) = EMBED Equation.3 ( STYLEREF 1 \s 5- SEQ Equation \* ARABIC 5)
Floor( x ) the greatest integer less than or equal to x. ( STYLEREF 1 \s 5- SEQ Equation \* ARABIC 6)
InverseRasterScan( a, b, c, d, e ) = EMBED Equation.3 ( STYLEREF 1 \s 5- SEQ Equation \* ARABIC 7)
Log2( x ) returns the base-2 logarithm of x. ( STYLEREF 1 \s 5- SEQ Equation \* ARABIC 8)
Log10( x ) returns the base-10 logarithm of x. ( STYLEREF 1 \s 5- SEQ Equation \* ARABIC 9)
Median( x, y, z ) = x + y + z " Min( x, Min( y, z ) ) " Max( x, Max( y, z ) ) ( STYLEREF 1 \s 5- SEQ Equation \* ARABIC 10)
Min( x, y ) = EMBED Equation.3 ( STYLEREF 1 \s 5- SEQ Equation \* ARABIC 11)
Max( x, y ) = EMBED Equation.3 ( STYLEREF 1 \s 5- SEQ Equation \* ARABIC 12)
Round( x ) = Sign( x ) * Floor( Abs( x ) + 0.5 ) ( STYLEREF 1 \s 5- SEQ Equation \* ARABIC 13)
Sign( x ) =ð EMBED Equation.3 ( STYLEREF 1 \s 5- SEQ Equation \* ARABIC 14)
Sqrt( x ) = EMBED Equation.3 ( STYLEREF 1 \s 5- SEQ Equation \* ARABIC 15)
Order of operation precedence
When order of precedence in an expression is not indicated explicitly by use of parenthesis, the following rules apply:
– operations of a higher precedence are evaluated before any operation of a lower precedence,
– operations of the same precedence are evaluated sequentially from left to right.
REF _Ref215994896 \h Table 51 specifies the precedence of operations from highest to lowest; a higher position in the table indicates a higher precedence.
NOTE – For those operators that are also used in the C programming language, the order of precedence used in this Specification is the same as used in the C programming language.
Table STYLEREF 1 \s 5 SEQ Table \* ARABIC \s 1 1 – Operation precedence from highest (at top of table) to lowest (at bottom of table)
operations (with operands x, y, and z)"x++", "x" """!x", ""x" (as a unary prefix operator)xy"x * y", "x / y", "x ¸ð y",ð ð" EMBED Equation.3 ", "x % y""x + y", "x " y" (as a two-argument operator), " EMBED Equation.3 ""x << y", "x >> y""x < y", "x <= y", "x > y", "x >= y""x = = y", "x != y""x & y""x | y""x && y""x | | y""x ? y : z""x = y", "x += y", "x "= y"
Variables, syntax elements, and tables
Syntax elements in the bitstream are represented in bold type. Each syntax element is described by its name (all lower case letters with underscore characters), its one or two syntax categories, and one or two descriptors for its method of coded representation. The decoding process behaves according to the value of the syntax element and to the values of previously decoded syntax elements. When a value of a syntax element is used in the syntax tables or the text, it appears in regular (i.e., not bold) type.
In some cases the syntax tables may use the values of other variables derived from syntax elements values. Such variables appear in the syntax tables, or text, named by a mixture of lower case and upper case letter and without any underscore characters. Variables starting with an upper case letter are derived for the decoding of the current syntax structure and all depending syntax structures. Variables starting with an upper case letter may be used in the decoding process for later syntax structures without mentioning the originating syntax structure of the variable. Variables starting with a lower case letter are only used within the subclause in which they are derived.
In some cases, "mnemonic" names for syntax element values or variable values are used interchangeably with their numerical values. Sometimes "mnemonic" names are used without any associated numerical values. The association of values and names is specified in the text. The names are constructed from one or more groups of letters separated by an underscore character. Each group starts with an upper case letter and may contain more upper case letters.
NOTE – The syntax is described in a manner that closely follows the C-language syntactic constructs.
Functions that specify properties of the current position in the bitstream are referred to as syntax functions. These functions are specified in subclause REF _Ref196969106 \r \h 7.2 and assume the existence of a bitstream pointer with an indication of the position of the next bit to be read by the decoding process from the bitstream. Syntax Ffunctions are described by their names, which are constructed as syntax element names and end, with left and right round parentheses including zero or more variable names (for definition) or values (for usage), separated by commas (if more than one variable).
Functions that are not syntax functions (including mathematical functions specified in subclause REF _Ref196969207 \r \h 5.7) are described by their names, which start with an upper case letter, contain a mixture of lower and upper case letters without any underscore character, and end with left and right parentheses including zero or more variable names (for definition) or values (for usage) separated by commas (if more than one variable).
A one-dimensional array is referred to as a list. A two-dimensional array is referred to as a matrix. Arrays can either be syntax elements or variables. Subscripts or square parentheses are used for the indexing of arrays. In reference to a visual depiction of a matrix, the first subscript is used as a row (vertical) index and the second subscript is used as a column (horizontal) index. The indexing order is reversed when using square parentheses rather than subscripts for indexing. Thus, an element of a matrix s at horizontal position x and vertical position y may be denoted either as s[ x, y ] or as syx.
Binary notation is indicated by enclosing the string of bit values by single quote marks. For example, '01000001' represents an eight-bit string having only its second and its last bits (counted from the most to the least significant bit) equal to 1.
Hexadecimal notation, indicated by prefixing the hexadecimal number by "0x", may be used instead of binary notation when the number of bits is an integer multiple of 4. For example, 0x41 represents an eight-bit string having only its second and its last bits (counted from the most to the least significant bit) equal to 1.
Numerical values not enclosed in single quotes and not prefixed by "0x" are decimal values.
A value equal to 0 represents a FALSE condition in a test statement. The value TRUE is represented by any other value different fromthan zero.
Text description of logical operations
In the text, a statement of logical operations as would be described in pseudo-code as
if( condition 0 ) statement 0else if ( condition 1 ) statement 1…else /* informative remark on remaining condition */ statement n
may be described in the following manner:
... as follows / ... the following applies.
– If condition 0, statement 0
– Otherwise, if condition 1, statement 1
– …
– Otherwise (informative remark on remaining condition), statement n
Each "If ... Otherwise, if ... Otherwise, ..." statement in the text is introduced with "... as follows" or "... the following applies" immediately followed by "If ... ". The last condition of the "If ... Otherwise, if ... Otherwise, ..." is always an "Otherwise, ...". Interleaved "If ... Otherwise, if ... Otherwise, ..." statements can be identified by matching "... as follows" or "... the following applies" with the ending "Otherwise, ...".
In the text, a statement of logical operations as would be described in pseudo-code as
if( condition 0a && condition 0b ) statement 0else if ( condition 1a | | condition 1b ) statement 1…else statement n
may be described in the following manner:
... as follows / ... the following applies.
– If all of the following conditions are true, statement 0
– condition 0a
– condition 0b
– Otherwise, if any of the following conditions are true, statement 1
– condition 1a
– condition 1b
– …
– Otherwise, statement n
In the text, a statement of logical operations as would be described in pseudo-code as
if( condition 0 ) statement 0if ( condition 1 ) statement 1
may be described in the following manner:
When condition 0, statement 0
When condition 1, statement 1
Processes
Processes are used to describe the decoding of syntax elements. A process has a separate specification and invoking. All syntax elements and upper case variables that pertain to the current syntax structure and depending syntax structures are available in the process specification and invoking. A process specification may also have a lower case variable explicitly specified as the input. Each process specification has explicitly specified an output. The output is a variable that can either be an upper case variable or a lower case variable.
When invoking a process, tThe assignment of variables is specified as follows.
– If the variables at the invoking and the process specification do not have the same name, the variables are explicitly assigned to lower case input or output variables of the process specification in case these do not have the same name.
– Otherwise (when the variables at the invoking and the process specification have the same name), assignment is implied.
In the specification of a process, a specific macroblock may be referred to by the variable name having a value equal to the address of the specific macroblock.
Source, coded, decoded and output data formats, scanning processes, and neighbouring relationships
Bitstream formats
This subclause specifies the relationship between the NAL unit stream and byte stream, either of which are referred to as the bitstream.
The bitstream can be in one of two formats: the NAL unit stream format or the byte stream format. The NAL unit stream format is conceptually the more "basic" type. It consists of a sequence of syntax structures called NAL units. This sequence is ordered in decoding order. There are constraints imposed on the decoding order (and contents) of the NAL units in the NAL unit stream.
The byte stream format can be constructed from the NAL unit stream format by ordering the NAL units in decoding order and prefixing each NAL unit with a start code prefix and zero or more zero-valued bytes to form a stream of bytes. The NAL unit stream format can be extracted from the byte stream format by searching for the location of the unique start code prefix pattern within this stream of bytes. Methods of framing the NAL units in a manner other than use of the byte stream format are outside the scope of this Recommendation | International Standard. The byte stream format is specified in Annex REF _Ref20134777 \r \h B REF _Ref216787276 \r \h B.
Source, decoded, and output picture formats
This subclause specifies the relationship between source and decoded frames and fields that is given via the bitstream.
The video source that is represented by the bitstream is a sequence of either or both frames or fields (called collectively pictures) in decoding order.
The source and decoded pictures (frames or fields) are each comprised of one or more sample arrays:
– Luma (Y) only (monochrome), with or without an auxiliary array.
– Luma and two Chroma (YCbCr or YCgCo), with or without an auxiliary array.
– Green, Blue and Red (GBR, also known as RGB), with or without an auxiliary array.
– Arrays representing other unspecified monochrome or tri-stimulus colour samplings (for example, YZX, also known as XYZ), with or without an auxiliary array.
For convenience of notation and terminology in this specification, the variables and terms associated with these arrays are referred to as luma (or L or Y) and chroma, where the two chroma arrays are referred to as Cb and Cr; regardless of the actual colour representation method in use. The actual colour representation method in use can be indicated in syntax that is specified in Annex REF _Ref205194156 \r \h EE. The (monochrome) auxiliary arrays, which may or may not be present as auxiliary pictures in a coded video sequence, are optional for decoding and can be used for such purposes as alpha blending.
The variables SubWidthC, and SubHeightC are specified in REF _Ref73853025 \h Table 61, depending on the chroma format sampling structure, which is specified through chroma_format_idc and separate_colour_plane_flag. An entry marked as "-" in REF _Ref73853025 \h Table 61 denotes an undefined value for SubWidthC or SubHeightC. Other values of chroma_format_idc, SubWidthC, and SubHeightC may be specified in the future by ITUT | ISO/IEC.
Table STYLEREF 1 \s 6 SEQ Table \* ARABIC \s 1 1 – SubWidthC, and SubHeightC values derived from chroma_format_idc and separate_colour_plane_flag
chroma_format_idcseparate_colour_plane_flagChroma FormatSubWidthCSubHeightC00monochrome-–-–104:2:022204:2:221304:4:411314:4:4--
In monochrome sampling there is only one sample array, which is nominally considered the luma array.
In 4:2:0 sampling, each of the two chroma arrays has half the height and half the width of the luma array.
In 4:2:2 sampling, each of the two chroma arrays has the same height and half the width of the luma array.
In 4:4:4 sampling, depending on the value of separate_colour_plane_flag, the following applies.
– If separate_colour_plane_flag is equal to 0, each of the two chroma arrays has the same height and width as the luma array.
– Otherwise (separate_colour_plane_flag is equal to 1), the three colour planes are separately processed as monochrome sampled pictures.
The width and height of the luma sample arrays are each an integer multiple of 16. In coded video sequences using 4:2:0 chroma sampling, the width and height of chroma sample arrays are each an integer multiple of 8. In coded video sequences using 4:2:2 sampling, the width of the chroma sample arrays is an integer multiple of 8 and the height is an integer multiple of 16. The height of a luma array that is coded as two separate fields or in macroblock-adaptive frame-field coding (see below) is an integer multiple of 32. In coded video sequences using 4:2:0 chroma sampling, the height of each chroma array that is coded as two separate fields or in macroblock-adaptive frame-field coding (see below) is an integer multiple of 16. The width or height of pictures output from the decoding process need not be an integer multiple of 16 and can be specified using a cropping rectangle.
The syntax for the luma and (when present) chroma arrays are ordered such when data for all three colour components is present, the data for the luma array is first, followed by any data for the Cb array, followed by any data for the Cr array, unless otherwise specified.
The width of fields coded referring to a specific sequence parameter set is the same as that of frames coded referring to the same sequence parameter set (see below). The height of fields coded referring to a specific sequence parameter set is half that of frames coded referring to the same sequence parameter set (see below).
The number of bits necessary for the representation of each of the samples in the luma and chroma arrays in a video sequence is in the range of 8 to 14, and the number of bits used in the luma array may differ from the number of bits used in the chroma arrays.
When the value of chroma_format_idc is equal to 1, the nominal vertical and horizontal relative locations of luma and chroma samples in frames are shown in REF _Ref73853697 \h Figure 61. Alternative chroma sample relative locations may be indicated in video usability information (see Annex REF _Ref205194226 \r \h EE).
Figure STYLEREF 1 \s 6 SEQ Figure \* ARABIC \s 1 1 – Nominal vertical and horizontal locations of 4:2:0 luma and chroma samples in a frame
A frame consists of two fields as described below. A coded picture may represent a coded frame or an individual coded field. A coded video sequence conforming to this Recommendation | International Standard may contain arbitrary combinations of coded frames and coded fields. The decoding process is also specified in a manner that allows smaller regions of a coded frame to be coded either as a frame or field region, by use of macroblock-adaptive frame-field coding.
Source and decoded fields are one of two types: top field or bottom field. When two fields are output at the same time, or are combined to be used as a reference frame (see below), the two fields (which shall be of opposite parity) are interleaved. The first (i.e., top), third, fifth, etc., rows of a decoded frame are the top field rows. The second, fourth, sixth, etc., rows of a decoded frame are the bottom field rows. A top field consists of only the top field rows of a decoded frame. When the top field or bottom field of a decoded frame is used as a reference field (see below) only the even rows (for a top field) or the odd rows (for a bottom field) of the decoded frame are used.
When the value of chroma_format_idc is equal to 1, the nominal vertical and horizontal relative locations of luma and chroma samples in top and bottom fields are shown in REF _Ref73853724 \h Figure 62. The nominal vertical sampling relative locations of the chroma samples in a top field are specified as shifted up by one-quarter luma sample height relative to the fieldsampling grid. The vertical sampling locations of the chroma samples in a bottom field are specified as shifted down by one-quarter luma sample height relative to the field-sampling grid. Alternative chroma sample relative locations may be indicated in the video usability information (see Annex REF _Ref205194226 \r \h EE).
NOTE – The shifting of the chroma samples is in order for these samples to align vertically to the usual location relative to the full-frame sampling grid as shown in REF _Ref73853697 \h Figure 61.
Figure STYLEREF 1 \s 6 SEQ Figure \* ARABIC \s 1 2 – Nominal vertical and horizontal sampling locations of 4:2:0 samples in top and bottom fields
When the value of chroma_format_idc is equal to 2, the chroma samples are co-sited with the corresponding luma samples and the nominal locations in a frame and in fields are as shown in Figures REF fig_6_3 \h 63 REF _Ref73853805 \h Figure 63 and REF fig_6_4 \h 64 REF _Ref73853812 \h Figure 64, respectively.
Figure STYLEREF 1 \s 6 SEQ Figure \* ARABIC \s 1 3 – Nominal vertical and horizontal locations of 4:2:2 luma and chroma samples in a frame
Figure STYLEREF 1 \s 6 SEQ Figure \* ARABIC \s 1 4 – Nominal vertical and horizontal sampling locations of 4:2:2 samples top and bottom fields
When the value of chroma_format_idc is equal to 3, all array samples are co-sited for all cases of frames and fields and the nominal locations in a frame and in fields are as shown in Figures REF fig_6_5 \h 65 REF _Ref73853834 \h Figure 65 and REF fig_6_6 \h 666-6, respectively.
Figure STYLEREF 1 \s 6 SEQ Figure \* ARABIC \s 1 5 – Nominal vertical and horizontal locations of 4:4:4 luma and chroma samples in a frame
Figure STYLEREF 1 \s 6 SEQ Figure \* ARABIC \s 1 6 – Nominal vertical and horizontal sampling locations of 4:4:4 samples top and bottom fields
The samples are processed in units of macroblocks. The luma array for each macroblock is 16 samples in both width and height. The variables MbWidthC and MbHeightC, which specify the width and height, respectively, of the chroma arrays for each macroblock, are derived as follows.
– If chroma_format_idc is equal to 0 (monochrome) or separate_colour_plane_flag is equal to 1, MbWidthC and MbHeightC are both equal to 0.
– Otherwise, MbWidthC and MbHeightC are derived as
MbWidthC = 16 / SubWidthC ( STYLEREF 1 \s 6- SEQ Equation \r 1 \* ARABIC 1)MbHeightC = 16 / SubHeightC ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 2)
Spatial subdivision of pictures and slices
This subclause specifies how a picture is partitioned into slices and macroblocks. Pictures are divided into slices. A slice is a sequence of macroblocks, or, when macroblock-adaptive frame/field decoding is in use, a sequence of macroblock pairs.
Each macroblock is comprised of one 16x16 luma array and, when the chroma sampling format is not equal to 4:0:0 and separate_colour_plane_flag is equal to 0, two corresponding chroma sample arrays. When separate_colour_plane_flag is equal to 1, each macroblock is comprised of one 16x16 luma or chroma sample array. When macroblock-adaptive frame/field decoding is not in use, each macroblock represents a spatial rectangular region of the picture. For example, a picture may be divided into two slices as shown in REF _Ref17564604 \h Figure 67.
When a picture is coded using three separate colour planes (separate_colour_plane_flag is equal to 1), a slice contains only macroblocks of one colour component being identified by the corresponding value of colour_plane_id, and each colour component array of a picture consists of slices having the same colour_plane_id value. Coded slices with different values of colour_plane_id within an access unit can be interleaved with each other under the constraint that for each value of colour_plane_id, the coded slice NAL units with that value colour_plane_id shall be in the order of increasing macroblock address for the first macroblock of each coded slice NAL unit.
NOTE – When separate_colour_plane_flag is equal to 0, each macroblock of a picture is contained in exactly one slice. When separate_colour_plane_flag is equal to 1, each macroblock of a colour component is contained in exactly one slice (i.e., information for each macroblock of a picture is containedpresent in exactly three slices and these three slices have different values of colour_plane_id).
Figure STYLEREF 1 \s 6 SEQ Figure \* ARABIC \s 1 7 – A picture with 11 by 9 macroblocks that is partitioned into two slices
When macroblock-adaptive frame/field decoding is in use, the picture is partitioned into slices containing an integer number of macroblock pairs as shown in REF _Ref20129704 \h Figure 68. Each macroblock pair consists of two macroblocks.
Figure STYLEREF 1 \s 6 SEQ Figure \* ARABIC \s 1 8 – Partitioning of the decoded frame into macroblock pairs
Inverse scanning processes and derivation processes for neighbours
This subclause specifies inverse scanning processes; i.e., the mapping of indices to locations, and derivation processes for neighbours.
Inverse macroblock scanning process
Input to this process is a macroblock address mbAddr.
Output of this process is the location ( x, y ) of the upper-left luma sample for the macroblock with address mbAddr relative to the upper-left sample of the picture.
The inverse macroblock scanning process is specified as follows.
– If MbaffFrameFlag is equal to 0,
x = InverseRasterScan( mbAddr, 16, 16, PicWidthInSamplesL, 0 ) ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 3)
y = InverseRasterScan( mbAddr, 16, 16, PicWidthInSamplesL, 1 ) ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 4)
– Otherwise (MbaffFrameFlag is equal to 1), the following applies.ordered steps are specified:
The luma location ( xO, yO ) is derived by
xO = InverseRasterScan( mbAddr / 2, 16, 32, PicWidthInSamplesL, 0 ) ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 5)
yO = InverseRasterScan( mbAddr / 2, 16, 32, PicWidthInSamplesL, 1 ) ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 6)
Depending on the current macroblock the following applies.
– If the current macroblock is a frame macroblock
x = xO ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 7)
y = yO + ( mbAddr % 2 ) * 16 ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 8)
– Otherwise (the current macroblock is a field macroblock),
x = xO ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 9)
y = yO + ( mbAddr % 2 ) ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 10)
Inverse macroblock partition and sub-macroblock partition scanning process
Macroblocks or sub-macroblocks may be partitioned, and the partitions are scanned for inter prediction as shown in REF _Ref30240592 \h Figure 69. The outer rectangles refer to the samples in a macroblock or sub-macroblock, respectively. The rectangles refer to the partitions. The number in each rectangle specifies the index of the inverse macroblock partition scan or inverse sub-macroblock partition scan.
The functions MbPartWidth( ), MbPartHeight( ), SubMbPartWidth( ), and SubMbPartHeight( ) describing the width and height of macroblock partitions and sub-macroblock partitions are specified in Tables REF tab_7_13 \h 713, REF tab_7_14 \h 714, REF tab_7_17 \h 717, and REF tab_7_18 \h 718 REF _Ref19417536 \h Table 713, REF _Ref19417750 \h Table 714, REF _Ref19417912 \h Table 717, and REF _Ref19417942 \h Table 718Tables 713, 714, 717, and 718. MbPartWidth( ) and MbPartHeight( ) are set to appropriate values for each macroblock, depending on the macroblock type. SubMbPartWidth( ) and SubMbPartHeight( ) are set to appropriate values for each sub-macroblock of a macroblock with mb_type equal to P_8x8, P_8x8ref0, or B_8x8, depending on the sub-macroblock type.
EMBED Word.Picture.8
Figure STYLEREF 1 \s 6 SEQ Figure \* ARABIC \s 1 9 – Macroblock partitions, sub-macroblock partitions, macroblock partition scans, and sub-macroblock partition scans
Inverse macroblock partition scanning process
Input to this process is the index of a macroblock partition mbPartIdx.
Output of this process is the location ( x, y ) of the upper-left luma sample for the macroblock partition mbPartIdx relative to the upper-left sample of the macroblock.
The inverse macroblock partition scanning process is specified by
x = InverseRasterScan( mbPartIdx, MbPartWidth( mb_type ), MbPartHeight( mb_type ), 16, 0 ) ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 11)
y = InverseRasterScan( mbPartIdx, MbPartWidth( mb_type ), MbPartHeight( mb_type ), 16, 1 ) ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC \* MERGEFORMAT 12)
Inverse sub-macroblock partition scanning process
Inputs to this process are the index of a macroblock partition mbPartIdx and the index of a sub-macroblock partition subMbPartIdx.
Output of this process is the location ( x, y ) of the upper-left luma sample for the sub-macroblock partition subMbPartIdx relative to the upper-left sample of the sub-macroblock.
The inverse sub-macroblock partition scanning process is specified as follows.
– If mb_type is equal to P_8x8, P_8x8ref0, or B_8x8,
x = InverseRasterScan( subMbPartIdx, SubMbPartWidth( sub_mb_type[ mbPartIdx ] ), SubMbPartHeight( sub_mb_type[ mbPartIdx ] ), 8, 0 ) ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 13)
y = InverseRasterScan( subMbPartIdx, SubMbPartWidth( sub_mb_type[ mbPartIdx ] ), SubMbPartHeight( sub_mb_type[ mbPartIdx ] ), 8, 1 ) ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 14)
– Otherwise (mb_type is not equal to P_8x8, P_8x8ref0, or B_8x8),
x = InverseRasterScan( subMbPartIdx, 4, 4, 8, 0 ) ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 15)
y = InverseRasterScan( subMbPartIdx, 4, 4, 8, 1 ) ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 16)
Inverse 4x4 luma block scanning process
Input to this process is the index of a 4x4 luma block luma4x4BlkIdx.
Output of this process is the location ( x, y ) of the upper-left luma sample for the 4x4 luma block with index luma4x4BlkIdx relative to the upper-left luma sample of the macroblock.
REF _Ref32831300 \h Figure 610 shows the scan for the 4x4 luma blocks.
EMBED Visio.Drawing.6
Figure STYLEREF 1 \s 6 SEQ Figure \* ARABIC \s 1 10 – Scan for 4x4 luma blocks
The inverse 4x4 luma block scanning process is specified by
x = InverseRasterScan( luma4x4BlkIdx / 4, 8, 8, 16, 0 ) + InverseRasterScan( luma4x4BlkIdx % 4, 4, 4, 8, 0 ) ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 17)
y = InverseRasterScan( luma4x4BlkIdx / 4, 8, 8, 16, 1 ) + InverseRasterScan( luma4x4BlkIdx % 4, 4, 4, 8, 1 ) ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 18)
Inverse 4x4 Cb or Cr block scanning process for ChromaArrayType equal to 3
This process is only invoked when ChromaArrayType is equal to 3.
The inverse 4x4 chroma block scanning process is identical to inverse 4x4 luma block scanning process as specified in subclause REF _Ref24282177 \r \h 6.4.3 when substituting the term “"luma”" with the term “"Cb”" or the term “"Cr”", and substituting the term “"luma4x4BlkIdx”" with the term “"cb4x4BlkIdx”" or the term “"cr4x4BlkIdx”" in all places in subclause REF _Ref24282177 \r \h 6.4.3.
Inverse 8x8 luma block scanning process
Input to this process is the index of an 8x8 luma block luma8x8BlkIdx.
Output of this process is the location ( x, y ) of the upper-left luma sample for the 8x8 luma block with index luma8x8BlkIdx relative to the upper-left luma sample of the macroblock.
REF _Ref81390771 \h Figure 611 shows the scan for the 8x8 luma blocks.
EMBED Visio.Drawing.6
Figure STYLEREF 1 \s 6 SEQ Figure \* ARABIC \s 1 11 – Scan for 8x8 luma blocks
The inverse 8x8 luma block scanning process is specified by
x = InverseRasterScan( luma8x8BlkIdx, 8, 8, 16, 0 ) ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 19)
y = InverseRasterScan( luma8x8BlkIdx, 8, 8, 16, 1 ) ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 20)
Inverse 8x8 Cb or Cr block scanning process for ChromaArrayType equal to 3
This process is only invoked when ChromaArrayType is equal to 3.
The inverse 8x8 chroma block scanning process is identical to inverse 8x8 luma block scanning process as specified in subclause REF _Ref81390772 \r \h 6.4.5 when substituting the term “"luma”" with the term “"Cb”" or the term “"Cr”", and substituting the term “"luma8x8BlkIdx”" with the term “"cb8x8BlkIdx”" or the term “"cr8x8BlkIdx”" in all places in subclause REF _Ref81390772 \r \h 6.4.5.
Derivation process of the availability for macroblock addresses
Input to this process is a macroblock address mbAddr.
Output of this process is the availability of the macroblock mbAddr.
NOTE – The meaning of availability is determined when this process is invoked.
The macroblock is marked as available, unless anyone of the following conditions is true in which case the macroblock is marked as not available:
– mbAddr < 0,
– mbAddr > CurrMbAddr,
– the macroblock with address mbAddr belongs to a different slice than the macroblock with address CurrMbAddr.
Derivation process for neighbouring macroblock addresses and their availability
This process can only be invoked when MbaffFrameFlag is equal to 0.
The outputs of this process are
– mbAddrA: the address and availability status of the macroblock to the left of the current macroblock,.
– mbAddrB: the address and availability status of the macroblock above the current macroblock,.
– mbAddrC: the address and availability status of the macroblock above-right of the current macroblock,.
– mbAddrD: the address and availability status of the macroblock above-left of the current macroblock.
REF _Ref29980960 \h Figure 612 shows the relative spatial locations of the macroblocks with mbAddrA, mbAddrB, mbAddrC, and mbAddrD relative to the current macroblock with CurrMbAddr.
mbAddrDmbAddrBmbAddrCmbAddrACurrMbAddrFigure STYLEREF 1 \s 6 SEQ Figure \* ARABIC \s 1 12 Neighbouring macroblocks for a given macroblock
Input to the process in subclause REF _Ref32840451 \r \h 6.4.7 is mbAddrA = CurrMbAddr " 1 and the output is whether the macroblock mbAddrA is available. In addition, mbAddrA is marked as not available when CurrMbAddr % PicWidthInMbs is equal to 0.
Input to the process in subclause REF _Ref32840451 \r \h 6.4.7 is mbAddrB = CurrMbAddr " PicWidthInMbs and the output is whether the macroblock mbAddrB is available.
Input to the process in subclause REF _Ref32840451 \r \h 6.4.7 is mbAddrC = CurrMbAddr " PicWidthInMbs + 1 and the output is whether the macroblock mbAddrC is available. In addition, mbAddrC is marked as not available when ( CurrMbAddr + 1 ) % PicWidthInMbs is equal to 0.
Input to the process in subclause REF _Ref32840451 \r \h 6.4.7 is mbAddrD = CurrMbAddr " PicWidthInMbs -" 1 and the output is whether the macroblock mbAddrD is available. In addition, mbAddrD is marked as not available when CurrMbAddr % PicWidthInMbs is equal to 0.
Derivation process for neighbouring macroblock addresses and their availability in MBAFF frames
This process can only be invoked when MbaffFrameFlag is equal to 1.
The outputs of this process are
– mbAddrA: the address and availability status of the top macroblock of the macroblock pair to the left of the current macroblock pair,.
– mbAddrB: the address and availability status of the top macroblock of the macroblock pair above the current macroblock pair,.
– mbAddrC: the address and availability status of the top macroblock of the macroblock pair above-right of the current macroblock pair.,
– mbAddrD: the address and availability status of the top macroblock of the macroblock pair above-left of the current macroblock pair.
REF _Ref29981123 \h Figure 613 shows the relative spatial locations of the macroblocks with mbAddrA, mbAddrB, mbAddrC, and mbAddrD relative to the current macroblock with CurrMbAddr.
mbAddrA, mbAddrB, mbAddrC, and mbAddrD have identical values regardless whether the current macroblock is the top or the bottom macroblock of a macroblock pair.
mbAddrDmbAddrBmbAddrCmbAddrACurrMbAddr orCurrMbAddrFigure STYLEREF 1 \s 6 SEQ Figure \* ARABIC \s 1 13 – Neighbouring macroblocks for a given macroblock in MBAFF frames
Input to the process in subclause REF _Ref32840451 \r \h 6.4.7 is mbAddrA = 2 * ( CurrMbAddr / 2 –" 1 ) and the output is whether the macroblock mbAddrA is available. In addition, mbAddrA is marked as not available when ( CurrMbAddr / 2 ) % PicWidthInMbs is equal to 0.
Input to the process in subclause REF _Ref32840451 \r \h 6.4.7 is mbAddrB = 2 * ( CurrMbAddr / 2 " PicWidthInMbs ) and the output is whether the macroblock mbAddrB is available.
Input to the process in subclause REF _Ref32840451 \r \h 6.4.7 is mbAddrC = 2 * ( CurrMbAddr / 2 " PicWidthInMbs + 1 ) and the output is whether the macroblock mbAddrC is available. In addition, mbAddrC is marked as not available when ( CurrMbAddr / 2 + 1) % PicWidthInMbs is equal to 0.
Input to the process in subclause REF _Ref32840451 \r \h 6.4.7 is mbAddrD = 2 * ( CurrMbAddr / 2 " PicWidthInMbs -" 1 ) and the output is whether the macroblock mbAddrD is available. In addition, mbAddrD is marked as not available when ( CurrMbAddr / 2 ) % PicWidthInMbs is equal to 0.
Derivation processes for neighbouring macroblocks, blocks, and partitions
Subclause REF _Ref30242982 \r \h 6.4.10.1 specifies the derivation process for neighbouring macroblocks.
Subclause REF _Ref32818442 \r \h 6.4.10.2 specifies the derivation process for neighbouring 8x8 luma blocks.
Subclause REF _Ref166858822 \r \h 6.4.10.3 specifies the derivation process for neighbouring 8x8 chroma blocks for ChromaArrayType equal to 3.
Subclause REF _Ref30243050 \r \h 6.4.10.4 specifies the derivation process for neighbouring 4x4 luma blocks.
Subclause REF _Ref30243063 \r \h 6.4.10.5 specifies the derivation process for neighbouring 4x4 chroma blocks.
Subclause REF _Ref166860299 \r \h 6.4.10.6 specifies the derivation process for neighbouring 4x4 chroma blocks for ChromaArrayType equal to 3.
Subclause REF _Ref32818497 \r \h 6.4.10.7 specifies the derivation process for neighbouring partitions.
REF _Ref32819062 \h Table 62 specifies the values for the difference of luma location ( xD, yD ) for the input and the replacement for N in mbAddrN, mbPartIdxN, subMbPartIdxN, luma8x8BlkIdxN, cb8x8BlkIdxN, cr8x8BlkIdxN, luma4x4BlkIdxN, cb4x4BlkIdxN, cr4x4BlkIdxN, and chroma4x4BlkIdxN for the output. These input and output assignments are used in subclauses REF _Ref30242982 \r \h 6.4.10.1 to REF _Ref32818497 \r \h 6.4.10.7. The variable predPartWidth is specified when REF _Ref32819062 \h Table 62 is referred to.
Table STYLEREF 1 \s 6 SEQ Table \* ARABIC \s 1 2 – Specification of input and output assignments for subclauses REF _Ref30242982 \r \h 6.4.10.1 to REF _Ref32818497 \r \h 6.4.10.7
NxDyDA-"10B0-"1CpredPartWidth-"1D-"1-"1
REF _Ref32822565 \h Figure 614 illustrates the relative location of the neighbouring macroblocks, blocks, or partitions A, B, C, and D to the current macroblock, partition, or block, when the current macroblock, partition, or block is in frame coding mode.
EMBED Visio.Drawing.6
Figure STYLEREF 1 \s 6 SEQ Figure \* ARABIC \s 1 14 – Determination of the neighbouring macroblock, blocks, and partitions (informative)
Derivation process for neighbouring macroblocks
Outputs of this process are
– mbAddrA: the address of the macroblock to the left of the current macroblock and its availability status, and
– mbAddrB: the address of the macroblock above the current macroblock and its availability status.
mbAddrN (with N being A or B) is derived as specified by the following ordered steps:.
– The difference of luma location ( xD, yD ) is set according to REF _Ref32819062 \h \* MERGEFORMAT Table 62.
– The derivation process for neighbouring locations as specified in subclause REF _Ref81126179 \r \h \* MERGEFORMAT 6.4.11 is invoked for luma locations with ( xN, yN ) equal to ( xD, yD ), and the output is assigned to mbAddrN.
Derivation process for neighbouring 8x8 luma block
Input to this process is an 8x8 luma block index luma8x8BlkIdx.
The luma8x8BlkIdx specifies the 8x8 luma blocks of a macroblock in a raster scan.
Outputs of this process are
– mbAddrA: either equal to CurrMbAddr or the address of the macroblock to the left of the current macroblock and its availability status,
– luma8x8BlkIdxA: the index of the 8x8 luma block to the left of the 8x8 block with index luma8x8BlkIdx and its availability status,
– mbAddrB: either equal to CurrMbAddr or the address of the macroblock above the current macroblock and its availability status,
– luma8x8BlkIdxB: the index of the 8x8 luma block above the 8x8 block with index luma8x8BlkIdx and its availability status.
mbAddrN and luma8x8BlkIdxN (with N being A or B) are derived as specified by the following ordered steps:.
– The difference of luma location ( xD, yD ) is set according to REF _Ref32819062 \h \* MERGEFORMAT Table 62.
– The luma location ( xN, yN ) is specified by
xN = ( luma8x8BlkIdx % 2 ) * 8 + xD ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 21)
yN = ( luma8x8BlkIdx / 2 ) * 8 + yD ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 22)
– The derivation process for neighbouring locations as specified in subclause REF _Ref81126179 \r \h 6.4.11 is invoked for luma locations with ( xN, yN ) as the input and the output is assigned to mbAddrN and ( xW, yW ).
– The variable luma8x8BlkIdxN is derived as follows.
– If mbAddrN is not available, luma8x8BlkIdxN is marked as not available.
– Otherwise (mbAddrN is available), the derivation process for 8x8 luma block indices as specified in subclause REF _Ref195428196 \r \h 6.4.12.3 is invoked with 8x8 luma block in the macroblock mbAddrN covering the luma location ( xW, yW ) as the input and the output is assigned to luma8x8BlkIdxN.
Derivation process for neighbouring 8x8 chroma blocks for ChromaArrayType equal to 3
This process is only invoked when ChromaArrayType is equal to 3.
The derivation process for neighbouring 8x8 chroma block is identical to the derivation process for neighbouring 8x8 luma block as specified in subclause REF _Ref32846444 \r \h 6.4.10.2 when substituting the term “"luma”" with the term “"Cb”" or the term “"Cr”", and substituting the term “"luma8x8BlkIdx”" with the term “"cb8x8BlkIdx”" or the term “"cr8x8BlkIdx”" in all places in subclause REF _Ref32846444 \r \h 6.4.10.2.
Derivation process for neighbouring 4x4 luma blocks
Input to this process is a 4x4 luma block index luma4x4BlkIdx.
Outputs of this process are
– mbAddrA: either equal to CurrMbAddr or the address of the macroblock to the left of the current macroblock and its availability status,
– luma4x4BlkIdxA: the index of the 4x4 luma block to the left of the 4x4 block with index luma4x4BlkIdx and its availability status,
– mbAddrB: either equal to CurrMbAddr or the address of the macroblock above the current macroblock and its availability status,
– luma4x4BlkIdxB: the index of the 4x4 luma block above the 4x4 block with index luma4x4BlkIdx and its availability status.
mbAddrN and luma4x4BlkIdxN (with N being A or B) are derived as specified by the following ordered steps:.
– The difference of luma location ( xD, yD ) is set according to REF _Ref32819062 \h \* MERGEFORMAT Table 62.
– The inverse 4x4 luma block scanning process as specified in subclause REF _Ref24282177 \r \h \* MERGEFORMAT 6.4.3 is invoked with luma4x4BlkIdx as the input and ( x, y ) as the output.
– The luma location ( xN, yN ) is specified by
xN = x + xD ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 23)
yN = y + yD ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 24)
– The derivation process for neighbouring locations as specified in subclause REF _Ref81126179 \r \h 6.4.11 is invoked for luma locations with ( xN, yN ) as the input and the output is assigned to mbAddrN and ( xW, yW ).
– The variable luma4x4BlkIdxN is derived as follows.
– If mbAddrN is not available, luma4x4BlkIdxN is marked as not available.
– Otherwise (mbAddrN is available), the derivation process for 4x4 luma block indices as specified in subclause REF _Ref195428194 \r \h 6.4.12.1 is invoked with 4x4 luma block in the macroblock mbAddrN covering the luma location ( xW, yW ) as the input and the output is assigned to luma4x4BlkIdxN.
Derivation process for neighbouring 4x4 chroma blocks
This subclause is only invoked when ChromaArrayType is equal to 1 or 2.
Input to this process is a 4x4 chroma block index chroma4x4BlkIdx.
Outputs of this process are
– mbAddrA (either equal to CurrMbAddr or the address of the macroblock to the left of the current macroblock) and its availability status,
– chroma4x4BlkIdxA (the index of the 4x4 chroma block to the left of the 4x4 chroma block with index chroma4x4BlkIdx) and its availability status,
– mbAddrB (either equal to CurrMbAddr or the address of the macroblock above the current macroblock) and its availability status,
– chroma4x4BlkIdxB (the index of the 4x4 chroma block above the 4x4 chroma block with index chroma4x4BlkIdx) and its availability status.
mbAddrN and chroma4x4BlkIdxN (with N being A or B) are derived as specified by the following ordered steps:.
– The difference of chroma location ( xD, yD ) is set according to REF _Ref32819062 \h \* MERGEFORMAT Table 62.
– The position ( x, y ) of the upper-left sample of the 4x4 chroma block with index chroma4x4BlkIdx is derived by
x = InverseRasterScan( chroma4x4BlkIdx, 4, 4, 8, 0 ) ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 25)
y = InverseRasterScan( chroma4x4BlkIdx, 4, 4, 8, 1 ) ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 26)
– The chroma location ( xN, yN ) is specified by
xN = x + xD ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 27)
yN = y + yD ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 28)
– The derivation process for neighbouring locations as specified in subclause REF _Ref81126179 \r \h \* MERGEFORMAT 6.4.11 is invoked for chroma locations with ( xN, yN ) as the input and the output is assigned to mbAddrN and ( xW, yW ).
– The variable chroma4x4BlkIdxN is derived as follows.
– If mbAddrN is not available, chroma4x4BlkIdxN is marked as not available.
– Otherwise (mbAddrN is available), the derivation process for 4x4 chroma block indices as specified in subclause REF _Ref195428198 \r \h 6.4.12.2 is invoked with 4x4 chroma block in the macroblock mbAddrN covering the chroma location ( xW, yW ) as the input and the output is assigned to chroma4x4BlkIdxN.
Derivation process for neighbouring 4x4 chroma blocks for ChromaArrayType equal to 3
This process is only invoked when ChromaArrayType is equal to 3.
The derivation process for neighbouring 4x4 chroma block in 4:4:4 chroma format is identical to the derivation process for neighbouring 4x4 luma block as specified in subclause REF _Ref30243050 \r \h 6.4.10.4 when substituting the term “"luma”" with the term “"Cb”" or the term “"Cr”", and substituting the term “"luma4x4BlkIdx”" with the term “"cb4x4BlkIdx”" or the term “"cr4x4BlkIdx”" in all places in subclause REF _Ref30243050 \r \h 6.4.10.4.
Derivation process for neighbouring partitions
Inputs to this process are
– a macroblock partition index mbPartIdx
– a current sub-macroblock type currSubMbType
– a sub-macroblock partition index subMbPartIdx
Outputs of this process are
– mbAddrA\mbPartIdxA\subMbPartIdxA: specifying the macroblock or sub-macroblock partition to the left of the current macroblock and its availability status, or the sub-macroblock partition CurrMbAddr\mbPartIdx\subMbPartIdx and its availability status,
– mbAddrB\mbPartIdxB\subMbPartIdxB: specifying the macroblock or sub-macroblock partition above the current macroblock and its availability status, or the sub-macroblock partition CurrMbAddr\mbPartIdx\subMbPartIdx and its availability status,
– mbAddrC\mbPartIdxC\subMbPartIdxC: specifying the macroblock or sub-macroblock partition to the right-above of the current macroblock and its availability status, or the sub-macroblock partition CurrMbAddr\mbPartIdx\subMbPartIdx and its availability status,
– mbAddrD\mbPartIdxD\subMbPartIdxD: specifying the macroblock or sub-macroblock partition to the left-above of the current macroblock and its availability status, or the sub-macroblock partition CurrMbAddr\mbPartIdx\subMbPartIdx and its availability status.
mbAddrN, mbPartIdxN, and subMbPartIdxN (with N being A, B, C, or D) are derived as specified by the following ordered steps:.
– The inverse macroblock partition scanning process as described in subclause REF _Ref32895890 \r \h 6.4.2.1 is invoked with mbPartIdx as the input and ( x, y ) as the output.
– The location of the upper-left luma sample inside a macroblock partition ( xS, yS ) is derived as follows.
–– If mb_type is equal to P_8x8, P_8x8ref0 or B_8x8, the inverse sub-macroblock partition scanning process as described in subclause REF _Ref32895891 \r \h 6.4.2.2 is invoked with subMbPartIdx as the input and ( xS, yS ) as the output.
–– Otherwise, ( xS, yS ) are set to ( 0, 0 ).
– The variable predPartWidth in REF _Ref32819062 \h Table 62 is specified as follows.
– If mb_type is equal to P_Skip, B_Skip, or B_Direct_16x16, predPartWidth = 16.
– Otherwise, if mb_type is equal to B_8x8, the following applies.
– If currSubMbType is equal to B_Direct_8x8, predPartWidth = 16.
NOTE 1 – When currSubMbType is equal to B_Direct_8x8 and direct_spatial_mv_pred_flag is equal to 1, the predicted motion vector is the predicted motion vector for the complete macroblock.
– Otherwise, predPartWidth = SubMbPartWidth( sub_mb_type[ mbPartIdx ] ).
– Otherwise, if mb_type is equal to P_8x8 or P_8x8ref0, predPartWidth = SubMbPartWidth( sub_mb_type[ mbPartIdx ] ).
– Otherwise, predPartWidth = MbPartWidth( mb_type ).
– The difference of luma location ( xD, yD ) is set according to REF _Ref32819062 \h Table 62.
– The neighbouring luma location ( xN, yN ) is specified by
xN = x + xS + xD ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 29)
yN = y + yS + yD ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 30)
– The derivation process for neighbouring locations as specified in subclause REF _Ref81126179 \r \h 6.4.11 is invoked for luma locations with ( xN, yN ) as the input and the output is assigned to mbAddrN and ( xW, yW ).
– Depending on mbAddrN, the following applies.
– If mbAddrN is not available, the macroblock or sub-macroblock partition –mbAddrN\mbPartIdxN\subMbPartIdxN is marked as not available.
– Otherwise (mbAddrN is available), the following ordered steps are specified:applies.
– Let mbTypeN be the syntax element mb_type of the macroblock with macroblock address mbAddrN and, when mbTypeN is equal to P_8x8, P_8x8ref0, or B_8x8, let subMbTypeN be the syntax element list sub_mb_type of the macroblock with macroblock address mbAddrN.
– The derivation process for macroblock and sub-macroblock partition indices as specified in subclause REF _Ref195429922 \r \h 6.4.12.4 is invoked with macroblock partition in the macroblock mbAddrN covering the luma location ( xW, yW ), the macroblock type mbTypeN, and, when mbTypeN is equal to P_8x8, P_8x8ref0, or B_8x8, the list of sub-macroblock types subMbTypeN as the inputs and the outputs are the macroblock partition index is assigned to mbPartIdxN and the sub-macroblock partition inside the macroblock partition mbPartIdxN covering the sample ( xW, yW ) in the macroblock mbAddrN is assigned to index subMbPartIdxN.
– When the partition given by mbPartIdxN and subMbPartIdxN is not yet decoded, the macroblock partition mbPartIdxN and the sub-macroblock partition subMbPartIdxN are marked as not available.
NOTE 2 – The latter condition is, for example, the case when mbPartIdx = 2, subMbPartIdx = 3, xD = 4, yD = "1, i.e., when neighbour C of the last 4x4 luma block of the third sub-macroblock is requested.
Derivation process for neighbouring locations
Input to this process is a luma or chroma location ( xN, yN ) expressed relative to the upper left corner of the current macroblock.
Outputs of this process are
– mbAddrN: either equal to CurrMbAddr or to the address of neighbouring macroblock that contains (xN, yN) and its availability status,
– ( xW, yW ): the location (xN, yN) expressed relative to the upper-left corner of the macroblock mbAddrN (rather than relative to the upper-left corner of the current macroblock).
Let maxW and maxH be variables specifying maximum values of the location components xN, xW, and yN, yW, respectively. maxW and maxH are derived as follows.
– If this process is invoked for neighbouring luma locations,
maxW = maxH = 16 ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 31)
– Otherwise (this process is invoked for neighbouring chroma locations),
maxW = MbWidthC ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 32)
maxH = MbHeightC ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 33)
Depending on the variable MbaffFrameFlag, the neighbouring locations are derived as follows.
– If MbaffFrameFlag is equal to 0, the specification for neighbouring locations in fields and non-MBAFF frames as described in subclause REF _Ref32897540 \r \h 6.4.11.1 is applied.
– Otherwise (MbaffFrameFlag is equal to 1), the specification for neighbouring locations in MBAFF frames as described in subclause REF _Ref32897541 \r \h 6.4.11.2 is applied.
Specification for neighbouring locations in fields and non-MBAFF frames
The specifications in this subclause are applied when MbaffFrameFlag is equal to 0.
The derivation process for neighbouring macroblock addresses and their availability in subclause REF _Ref26090568 \r \h 6.4.8 is invoked with mbAddrA, mbAddrB, mbAddrC, and mbAddrD as well as their availability status as the output.
REF _Ref32985902 \h Table 63 specifies mbAddrN depending on ( xN, yN ).
Table STYLEREF 1 \s 6 SEQ Table \* ARABIC \s 1 3 – Specification of mbAddrN
xNyNmbAddrN< 0< 0mbAddrD< 00 .. maxH -" 1mbAddrA0 .. maxW -" 1< 0mbAddrB0 .. maxW -" 10 .. maxH -" 1CurrMbAddr> maxW -" 1< 0mbAddrC> maxW -" 10 .. maxH -" 1not available> maxH -" 1not available
The neighbouring location ( xW, yW ) relative to the upper-left corner of the macroblock mbAddrN is derived as
xW = ( xN + maxW ) % maxW ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 34)
yW = ( yN + maxH ) % maxH ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 35)
Specification for neighbouring locations in MBAFF frames
The specifications in this subclause are applied when MbaffFrameFlag is equal to 1.
The derivation process for neighbouring macroblock addresses and their availability in subclause REF _Ref33112232 \r \h 6.4.9 is invoked with mbAddrA, mbAddrB, mbAddrC, and mbAddrD as well as their availability status as the output.
The variable currMbFrameFlag is derived as follows.
– If the macroblock with address CurrMbAddr is a frame macroblock, currMbFrameFlag is set equal to 1.
– Otherwise (the macroblock with address CurrMbAddr is a field macroblock), currMbFrameFlag is set equal to 0.
The variable mbIsTopMbFlag is derived as follows.
– If the macroblock with address CurrMbAddr is a top macroblock (i.e., CurrMbAddr % 2 is equal to 0), mbIsTopMbFlag is set equal to 1.
– Otherwise (the macroblock with address CurrMbAddr is a bottom macroblock, i.e., CurrMbAddr % 2 is equal to 1), mbIsTopMbFlag is set equal to 0.
REF _Ref33006054 \h Table 64 specifies the macroblock addresses mbAddrN and yM in two ordered steps:
Specification of a macroblock address mbAddrX depending on ( xN, yN ) and the following variables currMbFrameFlag and mbIsTopMbFlag:
– The variable currMbFrameFlag is derived as follows.
– If the macroblock with address CurrMbAddr is a frame macroblock, currMbFrameFlag is set equal to 1,
– Otherwise (the macroblock with address CurrMbAddr is a field macroblock), currMbFrameFlag is set equal to 0.
– The variable mbIsTopMbFlag is derived as follows.
– If the macroblock with address CurrMbAddr is a top macroblock (CurrMbAddr % 2 is equal to 0), mbIsTopMbFlag is set equal to 1;
– Otherwise (the macroblock with address CurrMbAddr is a bottom macroblock, CurrMbAddr % 2 is equal to 1), mbIsTopMbFlag is set equal to 0.
Depending on the availability of mbAddrX, the following applies.
– If mbAddrX is not available, mbAddrN is marked as not available.
– Otherwise (mbAddrX is available), mbAddrN is marked as available and REF _Ref33006054 \h Table 64 specifies mbAddrN and yM depending on ( xN, yN ), currMbFrameFlag, mbIsTopMbFlag, and the variable mbAddrXFrameFlag, which is derived as follows.
– If the macroblock mbAddrX is a frame macroblock, mbAddrXFrameFlag is set equal to 1.,
– Otherwise (the macroblock mbAddrX is a field macroblock), mbAddrXFrameFlag is set equal to 0.
Unspecified values (na) of the above flags in REF _Ref33006054 \h Table 64 indicate that the value of the corresponding flag is not relevant for the current table rows.
Table STYLEREF 1 \s 6 SEQ Table \* ARABIC \s 1 4 – Specification of mbAddrN and yM
xNyNcurrMbFrameFlagmbIsTopMbFlagmbAddrXmbAddrXFrameFlagadditional conditionmbAddrNyM< 0< 011mbAddrDmbAddrD + 1yN0mbAddrA1mbAddrAyN0mbAddrA + 1( yN + maxH ) >> 101mbAddrD1mbAddrD + 12*yN0mbAddrDyN0mbAddrDmbAddrD + 1yN< 00 .. maxH -" 111mbAddrA1mbAddrAyN0yN % 2 = = 0mbAddrAyN >> 1yN % 2 != 0mbAddrA + 1yN >> 10mbAddrA1mbAddrA + 1yN0yN % 2 = = 0mbAddrA( yN + maxH ) >> 1yN % 2 != 0mbAddrA + 1( yN + maxH ) >> 101mbAddrA1yN < ( maxH / 2 )mbAddrAyN <<1 yN >= ( maxH / 2 )mbAddrA + 1( yN <<1 ) -" maxH0mbAddrAyN0mbAddrA1yN < ( maxH / 2 )mbAddrA( yN <<1 ) + 1yN >= ( maxH / 2 )mbAddrA + 1( yN <<1 ) + 1 " maxH0mbAddrA + 1yN0 .. maxW " 1< 011mbAddrBmbAddrB + 1yN0CurrMbAddrCurrMbAddr -" 1yN01mbAddrB1mbAddrB + 12 * yN0mbAddrByN0mbAddrBmbAddrB + 1yN0 .. maxW " 10 .. maxH -" 1CurrMbAddrCurrMbAddryN> maxW " 1<011mbAddrCmbAddrC + 1yN0not availablenot availablena01mbAddrC1mbAddrC + 12 * yN0mbAddrCyN0mbAddrCmbAddrC + 1yN> maxW " 10 .. maxH -" 1not availablenot availablena> maxH -" 1not availablenot availablena
The neighbouring luma location ( xW, yW ) relative to the upper-left corner of the macroblock mbAddrN is derived as
xW = ( xN + maxW ) % maxW ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 36)
yW = ( yM + maxH ) % maxH ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 37)
Derivation processes for block and partition indices
Subclause REF _Ref195428194 \r \h 6.4.12.1 specifies the derivation process for 4x4 luma block indices.
Subclause REF _Ref195428198 \r \h 6.4.12.2 specifies the derivation process for 4x4 chroma block indices.
Subclause REF _Ref195428196 \r \h 6.4.12.3 specifies the derivation process for 8x8 luma block indices.
Subclause REF _Ref195429922 \r \h 6.4.12.4 specifies the derivation process for macroblock and sub-macroblock partition indices.
Derivation process for 4x4 luma block indices
Input to this process is a luma location ( xP, yP ) relative to the upper-left luma sample of a macroblock.
Output of this process is a 4x4 luma block index luma4x4BlkIdx.
The 4x4 luma block index luma4x4BlkIdx is derived by
luma4x4BlkIdx = 8 * ( y / 8 ) + 4 * ( x / 8 ) + 2 * ( ( y % 8 ) / 4 ) + ( ( x % 8 ) / 4 ) ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 38)
Derivation process for 4x4 chroma block indices
This subclause is only invoked when ChromaArrayType is equal to 1 or 2.
Input to this process is a chroma location ( xP, yP ) relative to the upper-left chroma sample of a macroblock.
Output of this process is a 4x4 chroma block index chroma4x4BlkIdx.
The 4x4 chroma block index chroma4x4BlkIdx is derived by
chroma4x4BlkIdx = 2 * ( y / 8 ) + ( x / 8 ) ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 39)
Derivation process for 8x8 luma block indices
Input to this process is a luma location ( xP, yP ) relative to the upper-left chroma sample of a macroblock.
Outputs of this process is an 8x8 luma block index luma8x8BlkIdx.
The 8x8 luma block index luma8x8BlkIdx is derived by
luma8x8BlkIdx = 2 * ( y / 8 ) + ( x / 8 ) ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 40)
Derivation process for macroblock and sub-macroblock partition indices
Inputs to this process are
– a luma location ( xP, yP ) relative to the upper-left luma sample of a macroblock,
– a macroblock type mbType,
– when mbType is equal to P_8x8, P_8x8ref0, or B_8x8, a list of sub-macroblock types subMbType with 4 elements.
Outputs of this process are
– a macroblock partition index mbPartIdx,
– a sub-macroblock partition index subMbPartIdx.
The macroblock partition index mbPartIdx is derived as follows.
– If mbType specifies an I macroblock type, mbPartIdx is set equal to 0.
– Otherwise (mbType does not specify an I macroblock type), mbPartIdx is derived by
mbPartIdx = 2 * ( yP / MbPartHeight( mbType ) ) + ( xP / MbPartWidth( mbType ) ) ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 41)
The sub-macroblock partition index subMbPartIdx is derived as follows.
– If mbType is not equal to P_8x8, P_8x8ref0, B_8x8, B_Skip, or B_Direct_16x16, subMbPartIdx is set equal to 0.
– Otherwise, if mbType is equal to B_Skip or B_Direct_16x16, subMbPartIdx is derived by
subMbPartIdx = 2 * ( ( yP % 8 ) / 4 ) + ( ( xP % 8 ) / 4 ) ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 42)
– Otherwise (mbType is equal to P_8x8, P_8x8ref0, or B_8x8), subMbPartIdx is derived by
subMbPartIdx = 2 * ( ( yP % 8 ) / SubMbPartHeight( subMbType[ mbPartIdx ] ) ) + ( ( xP % 8 ) / SubMbPartWidth( subMbType[ mbPartIdx ] ) ) ( STYLEREF 1 \s 6- SEQ Equation \* ARABIC 43)
Syntax and semantics
Method of specifying syntax in tabular form
The syntax tables specify a superset of the syntax of all allowed bitstreams. Additional constraints on the syntax may be specified, either directly or indirectly, in other clauses.
NOTE – An actual decoder should implement means for identifying entry points into the bitstream and means to identify and handle non-conforming bitstreams. The methods for identifying and handling errors and other such situations are not specified here.
The following table lists examples of pseudo code used to describe the syntax. When syntax_element appears, it specifies that a syntax element is parsed from the bitstream and the bitstream pointer is advanced to the next position beyond the syntax element in the bitstream parsing process.
CDescriptor/* A statement can be a syntax element with an associated syntax category and descriptor or can be an expression used to specify conditions for the existence, type, and quantity of syntax elements, as in the following two examples */syntax_element3ue(v)conditioning statement/* A group of statements enclosed in curly brackets is a compound statement and is treated functionally as a single statement. */{ statement statement …}/* A “"while”" structure specifies a test of whether a condition is true, and if true, specifies evaluation of a statement (or compound statement) repeatedly until the condition is no longer true */while( condition ) statement/* A “"do … while”" structure specifies evaluation of a statement once, followed by a test of whether a condition is true, and if true, specifies repeated evaluation of the statement until the condition is no longer true */do statementwhile( condition )/* An “"if … else”" structure specifies a test of whether a condition is true, and if the condition is true, specifies evaluation of a primary statement, otherwise, specifies evaluation of an alternative statement. The “"else”" part of the structure and the associated alternative statement is omitted if no alternative statement evaluation is needed */if( condition ) primary statementelse alternative statement/* A “"for”" structure specifies evaluation of an initial statement, followed by a test of a condition, and if the condition is true, specifies repeated evaluation of a primary statement followed by a subsequent statement until the condition is no longer true. */for( initial statement; condition; subsequent statement ) primary statement
Specification of syntax functions, categories, and descriptors
The functions presented here are used in the syntactical description. These functions assume the existence of a bitstream pointer with an indication of the position of the next bit to be read by the decoding process from the bitstream.
byte_aligned( ) is specified as follows.
– If the current position in the bitstream is on a byte boundary, i.e., the next bit in the bitstream is the first bit in a byte, the return value of byte_aligned( ) is equal to TRUE.
– Otherwise, the return value of byte_aligned( ) is equal to FALSE.
more_data_in_byte_stream( ), which is used only in the byte stream NAL unit syntax structure specified in Annex REF _Ref216787276 \r \h BB, is specified as follows.
– If more data follow in the byte stream, the return value of more_data_in_byte_stream( ) is equal to TRUE.
– Otherwise, the return value of more_data_in_byte_stream( ) is equal to FALSE.
more_rbsp_data( ) is specified as follows.
– If there is no more data in the RBSP, the return value of more_rbsp_data( ) is equal to FALSE.
– Otherwise, the RBSP data is searched for the last (least significant, right-most) bit equal to 1 that is present in the RBSP. Given the position of this bit, which is the first bit (rbsp_stop_one_bit) of the rbsp_trailing_bits( ) syntax structure, the following applies.
– If there is more data in an RBSP before the rbsp_trailing_bits( ) syntax structure, the return value of more_rbsp_data( ) is equal to TRUE.
– Otherwise, the return value of more_rbsp_data( ) is equal to FALSE.
The method for enabling determination of whether there is more data in the RBSP is specified by the application (or in Annex REF _Ref216787276 \r \h BB for applications that use the byte stream format).
more_rbsp_trailing_data( ) is specified as follows.
– If there is more data in an RBSP, the return value of more_rbsp_trailing_data( ) is equal to TRUE.
– Otherwise, the return value of more_rbsp_trailing_data( ) is equal to FALSE.
next_bits( n ) provides the next bits in the bitstream for comparison purposes, without advancing the bitstream pointer. Provides a look at the next n bits in the bitstream with n being its argument. When used within the byte stream as specified in Annex REF _Ref216787276 \r \h BB, next_bits( n ) returns a value of 0 if fewer than n bits remain within the byte stream.
read_bits( n ) reads the next n bits from the bitstream and advances the bitstream pointer by n bit positions. When n is equal to 0, read_bits( n ) is specified to return a value equal to 0 and to not advance the bitstream pointer.
Categories (labelled in the table as C) specify the partitioning of slice data into at most three slice data partitions. Slice data partition A contains all syntax elements of category 2. Slice data partition B contains all syntax elements of category 3. Slice data partition C contains all syntax elements of category 4. The meaning of other category values is not specified. For some syntax elements, two category values, separated by a vertical bar, are used. In these cases, the category value to be applied is further specified in the text. For syntax structures used within other syntax structures, the categories of all syntax elements found within the included syntax structure are listed, separated by a vertical bar. A syntax element or syntax structure with category marked as "All" is present within all syntax structures that include that syntax element or syntax structure. For syntax structures used within other syntax structures, a numeric category value provided in a syntax table at the location of the inclusion of a syntax structure containing a syntax element with category marked as "All" is considered to apply to the syntax elements with category "All".
The following descriptors specify the parsing process of each syntax element. For some syntax elements, two descriptors, separated by a vertical bar, are used. In these cases, the left descriptors apply when entropy_coding_mode_flag is equal to 0 and the right descriptor applies when entropy_coding_mode_flag is equal to 1.
– ae(v): context-adaptive arithmetic entropy-coded syntax element. The parsing process for this descriptor is specified in subclause REF _Ref29798517 \r \h \* MERGEFORMAT 9.3.
– b(8): byte having any pattern of bit string (8 bits). The parsing process for this descriptor is specified by the return value of the function read_bits( 8 ).
– ce(v): context-adaptive variable-length entropy-coded syntax element with the left bit first. The parsing process for this descriptor is specified in subclause REF _Ref33186826 \r \h \* MERGEFORMAT 9.2.
– f(n): fixed-pattern bit string using n bits written (from left to right) with the left bit first. The parsing process for this descriptor is specified by the return value of the function read_bits( n ).
– i(n): signed integer using n bits. When n is "v" in the syntax table, the number of bits varies in a manner dependent on the value of other syntax elements. The parsing process for this descriptor is specified by the return value of the function read_bits( n ) interpreted as a two’s complement integer representation with most significant bit written first.
– me(v): mapped Exp-Golomb-coded syntax element with the left bit first. The parsing process for this descriptor is specified in subclause REF _Ref24214767 \r \h \* MERGEFORMAT 9.1.
– se(v): signed integer Exp-Golomb-coded syntax element with the left bit first. The parsing process for this descriptor is specified in subclause REF _Ref24214767 \r \h \* MERGEFORMAT 9.1.
– te(v): truncated Exp-Golomb-coded syntax element with left bit first. The parsing process for this descriptor is specified in subclause REF _Ref24214767 \r \h \* MERGEFORMAT 9.1.
– u(n): unsigned integer using n bits. When n is "v" in the syntax table, the number of bits varies in a manner dependent on the value of other syntax elements. The parsing process for this descriptor is specified by the return value of the function read_bits( n ) interpreted as a binary representation of an unsigned integer with most significant bit written first.
– ue(v): unsigned integer Exp-Golomb-coded syntax element with the left bit first. The parsing process for this descriptor is specified in subclause REF _Ref24214767 \r \h \* MERGEFORMAT 9.1.
Syntax in tabular form
NAL unit syntax
nal_unit( NumBytesInNALunit ) {CDescriptor forbidden_zero_bitAllf(1) nal_ref_idcAllu(2) nal_unit_typeAllu(5) NumBytesInRBSP = 0 nalUnitHeaderBytes = 1 if( nal_unit_type = = 14 | | nal_unit_type = = 20 ) { nal_unit_header_svc_extension( ) /* specified in Annex REF _Ref168473844 \r \h G */All nalUnitHeaderBytes += 3 } for( i = nalUnitHeaderBytes; i < NumBytesInNALunit; i++ ) { if( i + 2 < NumBytesInNALunit && next_bits( 24 ) = = 0x000003 ) { rbsp_byte[ NumBytesInRBSP++ ]Allb(8) rbsp_byte[ NumBytesInRBSP++ ]Allb(8) i += 2 emulation_prevention_three_byte /* equal to 0x03 */Allf(8) } else rbsp_byte[ NumBytesInRBSP++ ]Allb(8) }}
Raw byte sequence payloads and RBSP trailing bits syntax
Sequence parameter set RBSP syntax
seq_parameter_set_rbsp( ) {CDescriptor seq_parameter_set_data( )0 rbsp_trailing_bits( )0}
Sequence parameter set data syntax
seq_parameter_set_data( ) {CDescriptor profile_idc0u(8) constraint_set0_flag0u(1) constraint_set1_flag0u(1) constraint_set2_flag0u(1) constraint_set3_flag0u(1) reserved_zero_4bits /* equal to 0 */0u(4) level_idc0u(8) seq_parameter_set_id0ue(v) if( profile_idc = = 100 | | profile_idc = = 110 | | profile_idc = = 122 | | profile_idc = = 244 | | profile_idc = = 44 | | profile_idc = = 83 | | profile_idc = = 86 ) { chroma_format_idc0ue(v) if( chroma_format_idc = = 3 ) separate_colour_plane_flag0u(1) bit_depth_luma_minus80ue(v) bit_depth_chroma_minus80ue(v) qpprime_y_zero_transform_bypass_flag0u(1) seq_scaling_matrix_present_flag0u(1) if( seq_scaling_matrix_present_flag ) for( i = 0; i < ( ( chroma_format_idc != 3 ) ? 8 : 12 ); i++ ) { seq_scaling_list_present_flag[ i ]0u(1) if( seq_scaling_list_present_flag[ i ] ) if( i < 6 ) scaling_list( ScalingList4x4[ i ], 16, UseDefaultScalingMatrix4x4Flag[ i ])0 else scaling_list( ScalingList8x8[ i " 6 ], 64, UseDefaultScalingMatrix8x8Flag[ i " 6 ] )0 } } log2_max_frame_num_minus40ue(v) pic_order_cnt_type0ue(v) if( pic_order_cnt_type = = 0 ) log2_max_pic_order_cnt_lsb_minus40ue(v) else if( pic_order_cnt_type = = 1 ) { delta_pic_order_always_zero_flag0u(1) offset_for_non_ref_pic0se(v) offset_for_top_to_bottom_field0se(v) num_ref_frames_in_pic_order_cnt_cycle0ue(v) for( i = 0; i < num_ref_frames_in_pic_order_cnt_cycle; i++ ) offset_for_ref_frame[ i ]0se(v) } max_num_ref_frames0ue(v) gaps_in_frame_num_value_allowed_flag0u(1) pic_width_in_mbs_minus10ue(v) pic_height_in_map_units_minus10ue(v) frame_mbs_only_flag0u(1) if( !frame_mbs_only_flag ) mb_adaptive_frame_field_flag0u(1) direct_8x8_inference_flag0u(1) frame_cropping_flag0u(1) if( frame_cropping_flag ) { frame_crop_left_offset0ue(v) frame_crop_right_offset0ue(v) frame_crop_top_offset0ue(v) frame_crop_bottom_offset0ue(v) } vui_parameters_present_flag0u(1) if( vui_parameters_present_flag ) vui_parameters( )0}
Scaling list syntax
scaling_list( scalingList, sizeOfScalingList, useDefaultScalingMatrixFlag ) {CDescriptor lastScale = 8 nextScale = 8 for( j = 0; j < sizeOfScalingList; j++ ) { if( nextScale != 0 ) { delta_scale0 | 1se(v) nextScale = ( lastScale + delta_scale + 256 ) % 256 useDefaultScalingMatrixFlag = ( j = = 0 && nextScale = = 0 ) } scalingList[ j ] = ( nextScale = = 0 ) ? lastScale : nextScale lastScale = scalingList[ j ] }}
Sequence parameter set extension RBSP syntax
seq_parameter_set_extension_rbsp( ) {CDescriptor seq_parameter_set_id10ue(v) aux_format_idc10ue(v) if( aux_format_idc != 0 ) { bit_depth_aux_minus810ue(v) alpha_incr_flag10u(1) alpha_opaque_value10u(v) alpha_transparent_value10u(v) } additional_extension_flag10u(1) rbsp_trailing_bits( )10}
Picture parameter set RBSP syntax
pic_parameter_set_rbsp( ) {CDescriptor pic_parameter_set_id1ue(v) seq_parameter_set_id1ue(v) entropy_coding_mode_flag1u(1) bottom_field_pic_order_in_frame_present_flag1u(1) num_slice_groups_minus11ue(v) if( num_slice_groups_minus1 > 0 ) { slice_group_map_type1ue(v) if( slice_group_map_type = = 0 ) for( iGroup = 0; iGroup <= num_slice_groups_minus1; iGroup++ ) run_length_minus1[ iGroup ]1ue(v) else if( slice_group_map_type = = 2 ) for( iGroup = 0; iGroup < num_slice_groups_minus1; iGroup++ ) { top_left[ iGroup ]1ue(v) bottom_right[ iGroup ]1ue(v) } else if( slice_group_map_type = = 3 | | slice_group_map_type = = 4 | | slice_group_map_type = = 5 ) { slice_group_change_direction_flag1u(1) slice_group_change_rate_minus11ue(v) } else if( slice_group_map_type = = 6 ) { pic_size_in_map_units_minus11ue(v) for( i = 0; i <= pic_size_in_map_units_minus1; i++ ) slice_group_id[ i ]1u(v) } } num_ref_idx_l0_default_active_minus11ue(v) num_ref_idx_l1_default_active_minus11ue(v) weighted_pred_flag1u(1) weighted_bipred_idc1u(2) pic_init_qp_minus26 /* relative to 26 */1se(v) pic_init_qs_minus26 /* relative to 26 */1se(v) chroma_qp_index_offset1se(v) deblocking_filter_control_present_flag1u(1) constrained_intra_pred_flag1u(1) redundant_pic_cnt_present_flag1u(1) if( more_rbsp_data( ) ) { transform_8x8_mode_flag1u(1) pic_scaling_matrix_present_flag1u(1) if( pic_scaling_matrix_present_flag ) for( i = 0; i < 6 + ( (chroma_format_idc != 3 ) ? 2 : 6 ) * transform_8x8_mode_flag; i++ ) { pic_scaling_list_present_flag[ i ]1u(1) if( pic_scaling_list_present_flag[ i ] ) if( i < 6 ) scaling_list( ScalingList4x4[ i ], 16, UseDefaultScalingMatrix4x4Flag[ i ] )1 else scaling_list( ScalingList8x8[ i –" 6 ], 64, UseDefaultScalingMatrix8x8Flag[ i " 6 ] )1 } second_chroma_qp_index_offset1se(v) } rbsp_trailing_bits( )1}
Supplemental enhancement information RBSP syntax
sei_rbsp( ) {CDescriptordosei_message( )5while( more_rbsp_data( ) )rbsp_trailing_bits( )5}
Supplemental enhancement information message syntax
sei_message( ) {CDescriptorpayloadType = 0while( next_bits( 8 ) = = 0xFF ) {ff_byte /* equal to 0xFF */5f(8)payloadType += 255}last_payload_type_byte5u(8)payloadType += last_payload_type_bytepayloadSize = 0while( next_bits( 8 ) = = 0xFF ) {ff_byte /* equal to 0xFF */5f(8)payloadSize += 255}last_payload_size_byte5u(8)payloadSize += last_payload_size_bytesei_payload( payloadType, payloadSize )5}
Access unit delimiter RBSP syntax
access_unit_delimiter_rbsp( ) {CDescriptor primary_pic_type6u(3) rbsp_trailing_bits( )6}
End of sequence RBSP syntax
end_of_seq_rbsp( ) {CDescriptor}
End of stream RBSP syntax
end_of_stream_rbsp( ) {CDescriptor}
Filler data RBSP syntax
filler_data_rbsp( ) {CDescriptor while( next_bits( 8 ) = = 0xFF ) ff_byte /* equal to 0xFF */9f(8) rbsp_trailing_bits( )9}
Slice layer without partitioning RBSP syntax
slice_layer_without_partitioning_rbsp( ) {CDescriptor slice_header( )2 slice_data( ) /* all categories of slice_data( ) syntax */2 | 3 | 4 rbsp_slice_trailing_bits( )2}
Slice data partition RBSP syntax
Slice data partition A RBSP syntax
slice_data_partition_a_layer_rbsp( ) {CDescriptor slice_header( )2 slice_idAllue(v) slice_data( ) /* only category 2 parts of slice_data( ) syntax */2 rbsp_slice_trailing_bits( )2}
Slice data partition B RBSP syntax
slice_data_partition_b_layer_rbsp( ) {CDescriptor slice_idAllue(v) if( separate_colour_plane_flag = = 1 ) colour_plane_idAllu(2) if( redundant_pic_cnt_present_flag ) redundant_pic_cntAllue(v) slice_data( ) /* only category 3 parts of slice_data( ) syntax */3 rbsp_slice_trailing_bits( )3}
Slice data partition C RBSP syntax
slice_data_partition_c_layer_rbsp( ) {CDescriptor slice_idAllue(v) if( separate_colour_plane_flag = = 1 ) colour_plane_idAllu(2) if( redundant_pic_cnt_present_flag ) redundant_pic_cntAllue(v) slice_data( ) /* only category 4 parts of slice_data( ) syntax */4 rbsp_slice_trailing_bits( )4}
RBSP slice trailing bits syntax
rbsp_slice_trailing_bits( ) {CDescriptor rbsp_trailing_bits( )All if( entropy_coding_mode_flag ) while( more_rbsp_trailing_data( ) ) cabac_zero_word /* equal to 0x0000 */Allf(16)}
RBSP trailing bits syntax
rbsp_trailing_bits( ) {CDescriptor rbsp_stop_one_bit /* equal to 1 */Allf(1) while( !byte_aligned( ) ) rbsp_alignment_zero_bit /* equal to 0 */Allf(1)}
Slice header syntax
slice_header( ) {CDescriptor first_mb_in_slice2ue(v) slice_type2ue(v) pic_parameter_set_id2ue(v) if( separate_colour_plane_flag = = 1 ) colour_plane_id2u(2) frame_num2u(v) if( !frame_mbs_only_flag ) { field_pic_flag2u(1) if( field_pic_flag ) bottom_field_flag2u(1) } if( nal_unit_type = = 5 ) idr_pic_id2ue(v) if( pic_order_cnt_type = = 0 ) { pic_order_cnt_lsb2u(v) if( bottom_field_pic_order_in_frame_present_flag && !field_pic_flag ) delta_pic_order_cnt_bottom2se(v) } if( pic_order_cnt_type = = 1 && !delta_pic_order_always_zero_flag ) { delta_pic_order_cnt[ 0 ]2se(v) if( bottom_field_pic_order_in_frame_present_flag && !field_pic_flag ) delta_pic_order_cnt[ 1 ]2se(v) } if( redundant_pic_cnt_present_flag ) redundant_pic_cnt2ue(v) if( slice_type = = B ) direct_spatial_mv_pred_flag2u(1) if( slice_type = = P | | slice_type = = SP | | slice_type = = B ) { num_ref_idx_active_override_flag2u(1) if( num_ref_idx_active_override_flag ) { num_ref_idx_l0_active_minus12ue(v) if( slice_type = = B ) num_ref_idx_l1_active_minus12ue(v) } } ref_pic_list_modificationreordering( )2 if( ( weighted_pred_flag && ( slice_type = = P | | slice_type = = SP ) ) | | ( weighted_bipred_idc = = 1 && slice_type = = B ) ) pred_weight_table( )2 if( nal_ref_idc != 0 ) dec_ref_pic_marking( )2 if( entropy_coding_mode_flag && slice_type != I && slice_type != SI ) cabac_init_idc2ue(v) slice_qp_delta2se(v) if( slice_type = = SP | | slice_type = = SI ) { if( slice_type = = SP ) sp_for_switch_flag2u(1) slice_qs_delta2se(v) } if( deblocking_filter_control_present_flag ) { disable_deblocking_filter_idc2ue(v) if( disable_deblocking_filter_idc != 1 ) { slice_alpha_c0_offset_div22se(v) slice_beta_offset_div22se(v) } } if( num_slice_groups_minus1 > 0 && slice_group_map_type >= 3 && slice_group_map_type <= 5) slice_group_change_cycle2u(v)}
Reference picture list reordering modification syntax
ref_pic_list_modificationreordering( ) {CDescriptor if( slice_type % 5 != 2 && slice_type % 5 != 4 ) { ref_pic_list_modificationreordering_flag_l02u(1) if( ref_pic_list_modificationreordering_flag_l0 ) do { reorderingmodification_of_pic_nums_idc2ue(v) if( modificationreordering_of_pic_nums_idc = = 0 | | modificationreordering_of_pic_nums_idc = = 1 ) abs_diff_pic_num_minus12ue(v) else if( modification reordering_of_pic_nums_idc = = 2 ) long_term_pic_num2ue(v) } while( modification reordering_of_pic_nums_idc != 3 ) } if( slice_type % 5 = = 1 ) { ref_pic_list_modificationreordering_flag_l12u(1) if( ref_pic_list_modificationreordering_flag_l1 ) do { modificationreordering_of_pic_nums_idc2ue(v) if( reorderingmodification_of_pic_nums_idc = = 0 | | reorderingmodification_of_pic_nums_idc = = 1 ) abs_diff_pic_num_minus12ue(v) else if( modification reordering_of_pic_nums_idc = = 2 ) long_term_pic_num2ue(v) } while( modification reordering_of_pic_nums_idc != 3 ) }}
Prediction weight table syntax
pred_weight_table( ) {CDescriptor luma_log2_weight_denom2ue(v) if( ChromaArrayType != 0 ) chroma_log2_weight_denom2ue(v) for( i = 0; i <= num_ref_idx_l0_active_minus1; i++ ) { luma_weight_l0_flag2u(1) if( luma_weight_l0_flag ) { luma_weight_l0[ i ]2se(v) luma_offset_l0[ i ]2se(v) } if ( ChromaArrayType != 0 ) { chroma_weight_l0_flag2u(1) if( chroma_weight_l0_flag ) for( j =0; j < 2; j++ ) { chroma_weight_l0[ i ][ j ]2se(v) chroma_offset_l0[ i ][ j ]2se(v) } } } if( slice_type % 5 = = 1 ) for( i = 0; i <= num_ref_idx_l1_active_minus1; i++ ) { luma_weight_l1_flag2u(1) if( luma_weight_l1_flag ) { luma_weight_l1[ i ]2se(v) luma_offset_l1[ i ]2se(v) } if( ChromaArrayType != 0 ) { chroma_weight_l1_flag2u(1) if( chroma_weight_l1_flag ) for( j = 0; j < 2; j++ ) { chroma_weight_l1[ i ][ j ]2se(v) chroma_offset_l1[ i ][ j ]2se(v) } } }}
Decoded reference picture marking syntax
dec_ref_pic_marking( ) {CDescriptor if( IdrPicFlag ) { no_output_of_prior_pics_flag2 | 5u(1) long_term_reference_flag2 | 5u(1) } else { adaptive_ref_pic_marking_mode_flag2 | 5u(1) if( adaptive_ref_pic_marking_mode_flag ) do { memory_management_control_operation2 | 5ue(v) if( memory_management_control_operation = = 1 | | memory_management_control_operation = = 3 ) difference_of_pic_nums_minus12 | 5ue(v) if(memory_management_control_operation = = 2 ) long_term_pic_num2 | 5ue(v) if( memory_management_control_operation = = 3 | | memory_management_control_operation = = 6 ) long_term_frame_idx2 | 5ue(v) if( memory_management_control_operation = = 4 ) max_long_term_frame_idx_plus12 | 5ue(v) } while( memory_management_control_operation != 0 ) }}
Slice data syntax
slice_data( ) {CDescriptor if( entropy_coding_mode_flag ) while( !byte_aligned( ) ) cabac_alignment_one_bit2f(1) CurrfirstMbAddr = first_mb_in_slice * ( 1 + MbaffFrameFlag ) CurrMbAddr = firstMbAddr moreDataFlag = 1 prevMbSkipped = 0 do { if( slice_type != I && slice_type != SI ) if( !entropy_coding_mode_flag ) { mb_skip_run2ue(v) prevMbSkipped = ( mb_skip_run > 0 ) for( i=0; i 0 ) moreDataFlag = more_rbsp_data( ) } else { mb_skip_flag2ae(v) moreDataFlag = !mb_skip_flag } if( moreDataFlag ) { if( MbaffFrameFlag && ( CurrMbAddr % 2 = = 0 | |
( CurrMbAddr % 2 = = 1 && prevMbSkipped ) ) ) mb_field_decoding_flag2u(1) | ae(v) macroblock_layer( )2 | 3 | 4 } if( !entropy_coding_mode_flag ) moreDataFlag = more_rbsp_data( ) else { if( slice_type != I && slice_type != SI ) prevMbSkipped = mb_skip_flag if( MbaffFrameFlag && CurrMbAddr % 2 = = 0 ) moreDataFlag = 1 else { end_of_slice_flag2ae(v) moreDataFlag = !end_of_slice_flag } } CurrMbAddr = NextMbAddress( CurrMbAddr ) } while( moreDataFlag )}
Macroblock layer syntax
macroblock_layer( ) {CDescriptor mb_type2ue(v) | ae(v) if( mb_type = = I_PCM ) { while( !byte_aligned( ) ) pcm_alignment_zero_bit3f(1) for( i = 0; i < 256; i++ ) pcm_sample_luma[ i ]3u(v) for( i = 0; i < 2 * MbWidthC * MbHeightC; i++ ) pcm_sample_chroma[ i ]3u(v) } else { noSubMbPartSizeLessThan8x8Flag = 1 if( mb_type != I_NxN &&
MbPartPredMode( mb_type, 0 ) != Intra_16x16 &&
NumMbPart( mb_type ) = = 4 ) { sub_mb_pred( mb_type )2 for( mbPartIdx = 0; mbPartIdx < 4; mbPartIdx++ ) if( sub_mb_type[ mbPartIdx ] != B_Direct_8x8 ) { if( NumSubMbPart( sub_mb_type[ mbPartIdx ] ) > 1 ) noSubMbPartSizeLessThan8x8Flag = 0 } else if( !direct_8x8_inference_flag ) noSubMbPartSizeLessThan8x8Flag = 0 } else { if( transform_8x8_mode_flag && mb_type = = I_NxN ) transform_size_8x8_flag2u(1) | ae(v) mb_pred( mb_type )2 } if( MbPartPredMode( mb_type, 0 ) != Intra_16x16 ) { coded_block_pattern2me(v) | ae(v) if( CodedBlockPatternLuma > 0 &&
transform_8x8_mode_flag && mb_type != I_NxN &&
noSubMbPartSizeLessThan8x8Flag &&
( mb_type != B_Direct_16x16 | | direct_8x8_inference_flag ) ) transform_size_8x8_flag2u(1) | ae(v) } if( CodedBlockPatternLuma > 0 | | CodedBlockPatternChroma > 0 | | MbPartPredMode( mb_type, 0 ) = = Intra_16x16 ) { mb_qp_delta2se(v) | ae(v) residual( 0, 0, 15 )3 | 4 } }}
Macroblock prediction syntax
mb_pred( mb_type ) {CDescriptor if( MbPartPredMode( mb_type, 0 ) = = Intra_4x4 | | MbPartPredMode( mb_type, 0 ) = = Intra_8x8 | | MbPartPredMode( mb_type, 0 ) = = Intra_16x16 ) { if( MbPartPredMode( mb_type, 0 ) = = Intra_4x4 ) for( luma4x4BlkIdx=0; luma4x4BlkIdx<16; luma4x4BlkIdx++ ) { prev_intra4x4_pred_mode_flag[ luma4x4BlkIdx ]2u(1) | ae(v) if( !prev_intra4x4_pred_mode_flag[ luma4x4BlkIdx ] ) rem_intra4x4_pred_mode[ luma4x4BlkIdx ]2u(3) | ae(v) } if( MbPartPredMode( mb_type, 0 ) = = Intra_8x8 ) for( luma8x8BlkIdx=0; luma8x8BlkIdx<4; luma8x8BlkIdx++ ) { prev_intra8x8_pred_mode_flag[ luma8x8BlkIdx ]2u(1) | ae(v) if( !prev_intra8x8_pred_mode_flag[ luma8x8BlkIdx ] ) rem_intra8x8_pred_mode[ luma8x8BlkIdx ]2u(3) | ae(v) } if( ChromaArrayType = = 1 | | ChromaArrayType = = 2 ) intra_chroma_pred_mode2ue(v) | ae(v) } else if( MbPartPredMode( mb_type, 0 ) != Direct ) { for( mbPartIdx = 0; mbPartIdx < NumMbPart( mb_type ); mbPartIdx++) if( ( num_ref_idx_l0_active_minus1 > 0 | | mb_field_decoding_flag != field_pic_flag ) && MbPartPredMode( mb_type, mbPartIdx ) != Pred_L1 ) ref_idx_l0[ mbPartIdx ]2te(v) | ae(v) for( mbPartIdx = 0; mbPartIdx < NumMbPart( mb_type ); mbPartIdx++) if( ( num_ref_idx_l1_active_minus1 > 0 | | mb_field_decoding_flag != field_pic_flag ) && MbPartPredMode( mb_type, mbPartIdx ) != Pred_L0 ) ref_idx_l1[ mbPartIdx ]2te(v) | ae(v) for( mbPartIdx = 0; mbPartIdx < NumMbPart( mb_type ); mbPartIdx++) if( MbPartPredMode ( mb_type, mbPartIdx ) != Pred_L1 ) for( compIdx = 0; compIdx < 2; compIdx++ ) mvd_l0[ mbPartIdx ][ 0 ][ compIdx ]2se(v) | ae(v) for( mbPartIdx = 0; mbPartIdx < NumMbPart( mb_type ); mbPartIdx++) if( MbPartPredMode( mb_type, mbPartIdx ) != Pred_L0 ) for( compIdx = 0; compIdx < 2; compIdx++ ) mvd_l1[ mbPartIdx ][ 0 ][ compIdx ]2se(v) | ae(v) }}
Sub-macroblock prediction syntax
sub_mb_pred( mb_type ) {CDescriptor for( mbPartIdx = 0; mbPartIdx < 4; mbPartIdx++ ) sub_mb_type[ mbPartIdx ]2ue(v) | ae(v) for( mbPartIdx = 0; mbPartIdx < 4; mbPartIdx++ ) if( ( num_ref_idx_l0_active_minus1 > 0 | | mb_field_decoding_flag != field_pic_flag ) && mb_type != P_8x8ref0 && sub_mb_type[ mbPartIdx ] != B_Direct_8x8 && SubMbPredMode( sub_mb_type[ mbPartIdx ] ) != Pred_L1 ) ref_idx_l0[ mbPartIdx ]2te(v) | ae(v) for( mbPartIdx = 0; mbPartIdx < 4; mbPartIdx++ ) if( ( num_ref_idx_l1_active_minus1 > 0 | | mb_field_decoding_flag != field_pic_flag ) && sub_mb_type[ mbPartIdx ] != B_Direct_8x8 && SubMbPredMode( sub_mb_type[ mbPartIdx ] ) != Pred_L0 ) ref_idx_l1[ mbPartIdx ]2te(v) | ae(v) for( mbPartIdx = 0; mbPartIdx < 4; mbPartIdx++ ) if( sub_mb_type[ mbPartIdx ] != B_Direct_8x8 && SubMbPredMode( sub_mb_type[ mbPartIdx ] ) != Pred_L1 ) for( subMbPartIdx = 0; subMbPartIdx < NumSubMbPart( sub_mb_type[ mbPartIdx ] ); subMbPartIdx++) for( compIdx = 0; compIdx < 2; compIdx++ ) mvd_l0[ mbPartIdx ][ subMbPartIdx ][ compIdx ]2se(v) | ae(v) for( mbPartIdx = 0; mbPartIdx < 4; mbPartIdx++ ) if( sub_mb_type[ mbPartIdx ] != B_Direct_8x8 && SubMbPredMode( sub_mb_type[ mbPartIdx ] ) != Pred_L0 ) for( subMbPartIdx = 0; subMbPartIdx < NumSubMbPart( sub_mb_type[ mbPartIdx ] ); subMbPartIdx++) for( compIdx = 0; compIdx < 2; compIdx++ ) mvd_l1[ mbPartIdx ][ subMbPartIdx ][ compIdx ]2se(v) | ae(v)}
Residual data syntax
residual( bmFlag, startIdx, endIdx ) {CDescriptor if( !entropy_coding_mode_flag ) residual_block = residual_block_cavlc else residual_block = residual_block_cabac residual_luma( i16x16DClevel, i16x16AClevel, level, level8x8, bmFlag, startIdx, endIdx )3 | 4 Intra16x16DCLevel = i16x16DClevel Intra16x16ACLevel = i16x16AClevel LumaLevel = level LumaLevel8x8 = level8x8 if( ChromaArrayType = = 1 | | ChromaArrayType = = 2 ) { NumC8x8 = 4 / ( SubWidthC * SubHeightC ) for( iCbCr = 0; iCbCr < 2; iCbCr++ ) if( ( CodedBlockPatternChroma & 3 ) && startIdx = = 0 ) /* chroma DC residual present */ residual_block( ChromaDCLevel[ iCbCr ], 0, 4 * NumC8x8 " 1, 4 * NumC8x8 )3 | 4 else for( i = 0; i < 4 * NumC8x8; i++ ) ChromaDCLevel[ iCbCr ][ i ] = 0 for( iCbCr = 0; iCbCr < 2; iCbCr++ ) for( i8x8 = 0; i8x8 < NumC8x8; i8x8++ ) for( i4x4 = 0; i4x4 < 4; i4x4++ ) if( ( CodedBlockPatternChroma & 2 ) && endIdx > 0 ) /* chroma AC residual present */ residual_block( ChromaACLevel[ iCbCr ][ i8x8*4+i4x4 ], max( 0, startIdx " 1 ), endIdx " 1, 15)3 | 4 else for( i = 0; i < 15; i++ ) ChromaACLevel[ iCbCr ][ i8x8*4+i4x4 ][ i ] = 0 } else if( ChromaArrayType = = 3 ) { residual_luma( i16x16DClevel, i16x16AClevel, level, level8x8, bmFlag, startIdx, endIdx )3 | 4 CbIntra16x16DCLevel = i16x16DClevel CbIntra16x16ACLevel = i16x16AClevel CbLevel = level CbLevel8x8 = level8x8 residual_luma( i16x16DClevel, i16x16AClevel, level, level8x8, bmFlag, startIdx, endIdx )3 | 4 CrIntra16x16DCLevel = i16x16DClevel CrIntra16x16ACLevel = i16x16AClevel CrLevel = level CrLevel8x8 = level8x8 }
Residual luma syntax
residual_luma( i16x16DClevel, i16x16AClevel, level, level8x8, bmFlag, startIdx, endIdx ) {CDescriptor if( !entropy_coding_mode_flag ) residual_block = residual_block_cavlc else residual_block = residual_block_cabac if( !bmFlag && startIdx = = 0 && MbPartPredMode( mb_type, 0 ) = = Intra_16x16 ) residual_block( i16x16DClevel, 0, 15, 16 )3 for( i8x8 = 0; i8x8 < 4; i8x8++ ) if( !transform_size_8x8_flag | | !entropy_coding_mode_flag ) for( i4x4 = 0; i4x4 < 4; i4x4++ ) { if( CodedBlockPatternLuma & ( 1 << i8x8 ) ) if( !bmFlag && endIdx > 0 && MbPartPredMode( mb_type, 0 ) = = Intra_16x16 ) residual_block( i16x16AClevel[i8x8*4+ i4x4], max( 0, startIdx –" 1 ), endIdx " 1, 15)3 else residual_block( level[ i8x8 * 4 + i4x4 ], startIdx, endIdx, 16)3 | 4 else if( !bmFlag && MbPartPredMode( mb_type, 0 ) = = Intra_16x16 ) for( i = 0; i < 15; i++ ) i16x16AClevel[ i8x8 * 4 + i4x4 ][ i ] = 0 else for( i = 0; i < 16; i++ ) level[ i8x8 * 4 + i4x4 ][ i ] = 0 if( !entropy_coding_mode_flag && transform_size_8x8_flag ) for( i = 0; i < 16; i++ ) level8x8[ i8x8 ][ 4 * i + i4x4 ] = level[ i8x8 * 4 + i4x4 ][ i ] } else if( CodedBlockPatternLuma & ( 1 << i8x8 ) ) residual_block( level8x8[ i8x8 ], 4 * startIdx, 4 * endIdx + 3, 64 )3 | 4 else for( i = 0; i < 64; i++ ) level8x8[ i8x8 ][ i ] = 0}
Residual block CAVLC syntax
residual_block_cavlc( coeffLevel, startIdx, endIdx, maxNumCoeff ) {CDescriptor for( i = 0; i < maxNumCoeff; i++ ) coeffLevel[ i ] = 0 coeff_token3 | 4ce(v) if( TotalCoeff( coeff_token ) > 0 ) { if( TotalCoeff( coeff_token ) > 10 && TrailingOnes( coeff_token ) < 3 ) suffixLength = 1 else suffixLength = 0 for( i = 0; i < TotalCoeff( coeff_token ); i++ ) if( i < TrailingOnes( coeff_token ) ) { trailing_ones_sign_flag3 | 4u(1) level[ i ] = 1 " 2 * trailing_ones_sign_flag } else { level_prefix3 | 4ce(v) levelCode = ( Min( 15, level_prefix ) << suffixLength ) if( suffixLength > 0 | | level_prefix >= 14 ) { level_suffix3 | 4u(v) levelCode += level_suffix } if( level_prefix > = 15 && suffixLength = = 0 ) levelCode += 15 if( level_prefix > = 16 ) levelCode += ( 1 << ( level_prefix " 3 ) ) " 4096 if( i = = TrailingOnes( coeff_token ) && TrailingOnes( coeff_token ) < 3 ) levelCode += 2 if( levelCode % 2 = = 0 ) level[ i ] = ( levelCode + 2 ) >> 1 else level[ i ] = ( "levelCode " 1 ) >> 1 if( suffixLength = = 0 ) suffixLength = 1 if( Abs( level[ i ] ) > ( 3 << ( suffixLength " 1 ) ) && suffixLength < 6 ) suffixLength++ } if( TotalCoeff( coeff_token ) < endIdx " startIdx + 1 ) { total_zeros3 | 4ce(v) zerosLeft = total_zeros } else zerosLeft = 0 for( i = 0; i < TotalCoeff( coeff_token ) " 1; i++ ) { if( zerosLeft > 0 ) { run_before3 | 4ce(v) run[ i ] = run_before } else run[ i ] = 0 zerosLeft = zerosLeft " run[ i ] } run[ TotalCoeff( coeff_token ) " 1 ] = zerosLeft coeffNum = "1 for( i = TotalCoeff( coeff_token ) " 1; i >= 0; i-" -" ) { coeffNum += run[ i ] + 1 coeffLevel[ startIdx + coeffNum ] = level[ i ] } }}
Residual block CABAC syntax
residual_block_cabac( coeffLevel, startIdx, endIdx, maxNumCoeff ) {CDescriptor if( maxNumCoeff = != 64 | | ( ChromaArrayType = = 3 ) ) ) coded_block_flag3 | 4ae(v) for( i = 0; i < maxNumCoeff; i++ ) coeffLevel[ i ] = 0 if( coded_block_flag ) { numCoeff = endIdx + 1 i = startIdx do { significant_coeff_flag[ i ]3 | 4ae(v) if( significant_coeff_flag[ i ] ) { last_significant_coeff_flag[ i ]3 | 4ae(v) if( last_significant_coeff_flag[ i ] ) numCoeff = i + 1 } i++ } while( i < numCoeff " 1 ) coeff_abs_level_minus1[ numCoeff " 1 ]3 | 4ae(v) coeff_sign_flag[ numCoeff " 1 ]3 | 4ae(v) coeffLevel[ numCoeff " 1 ] = ( coeff_abs_level_minus1[ numCoeff " 1 ] + 1 ) * ( 1 " 2 * coeff_sign_flag[ numCoeff " 1 ] ) for( i = numCoeff " 2; i >= 0; i-" -" ) if( significant_coeff_flag[ i ] ) { coeff_abs_level_minus1[ i ]3 | 4ae(v) coeff_sign_flag[ i ]3 | 4ae(v) coeffLevel[ i ] = ( coeff_abs_level_minus1[ i ] + 1 ) * ( 1 " 2 * coeff_sign_flag[ i ] ) } }}
Semantics
Semantics associated with the syntax structures and with the syntax elements within these structures are specified in this subclause. When the semantics of a syntax element are specified using a table or a set of tables, any values that are not specified in the table(s) shall not be present in the bitstream unless otherwise specified in this Recommendation | International Standard.
NAL unit semantics
NOTE 1 – The VCL is specified to efficiently represent the content of the video data. The NAL is specified to format that data and provide header information in a manner appropriate for conveyance on a variety of communication channels or storage media. All data are contained in NAL units, each of which contains an integer number of bytes. A NAL unit specifies a generic format for use in both packet-oriented and bitstream systems. The format of NAL units for both packet-oriented transport and byte stream is identical except that each NAL unit can be preceded by a start code prefix and extra padding bytes in the byte stream format.
NumBytesInNALunit specifies the size of the NAL unit in bytes. This value is required for decoding of the NAL unit. Some form of demarcation of NAL unit boundaries is necessary to enable inference of NumBytesInNALunit. One such demarcation method is specified in Annex REF _Ref216787276 \r \h BB for the byte stream format. Other methods of demarcation may be specified outside of this Recommendation | International Standard.
forbidden_zero_bit shall be equal to 0.
nal_ref_idc not equal to 0 specifies that the content of the NAL unit contains a sequence parameter set, a sequence parameter set extension, a subset sequence parameter set, a picture parameter set, a slice of a reference picture, a slice data partition of a reference picture, or a prefix NAL unit preceding a slice of a reference picture.
For coded video sequences conforming to one or more of the profiles specified in Annex REF _Ref36826677 \r \h A that are decoded using the decoding process specified in clauses REF _Ref20133850 \r \h 2- REF _Ref24280994 \r \h 9, nal_ref_idc equal to 0 for a NAL unit containing a slice or slice data partition indicates that the slice or slice data partition is part of a non-reference picture.
nal_ref_idc shall not be equal to 0 for sequence parameter set or sequence parameter set extension or subset sequence parameter set or picture parameter set NAL units. When nal_ref_idc is equal to 0 for one NAL unit with nal_unit_type in the range of 1 to 4, inclusive, of a particular picture, it shall be equal to 0 for all NAL units with nal_unit_type in the range of 1 to 4, inclusive, of the picture.
nal_ref_idc shall not be equal to 0 for NAL units with nal_unit_type equal to 5.
nal_ref_idc shall be equal to 0 for all NAL units having nal_unit_type equal to 6, 9, 10, 11, or 12.
nal_unit_type specifies the type of RBSP data structure contained in the NAL unit as specified in REF _Ref19417223 \h Table 71.
The column marked "C" in REF _Ref19417223 \h Table 71 lists the categories of the syntax elements that may be present in the NAL unit. In addition, syntax elements with syntax category "All" may be present, as determined by the syntax and semantics of the RBSP data structure. The presence or absence of any syntax elements of a particular listed category is determined from the syntax and semantics of the associated RBSP data structure. nal_unit_type shall not be equal to 3 or 4 unless at least one syntax element is present in the RBSP data structure having a syntax element category value equal to the value of nal_unit_type and not categorized as "All".
For coded video sequences conforming to one or more of the profiles specified in Annex REF _Ref36826677 \r \h A that are decoded using the decoding process specified in clauses REF _Ref20133850 \r \h 2- REF _Ref24280994 \r \h 9, VCL and non-VCL NAL units are specified in REF _Ref19417223 \h Table 71 in the column labelled "Annex REF _Ref36826677 \r \h A NAL unit type class". For coded video sequences conforming to one or more of the profiles specified in Annex REF _Ref168473844 \r \h G that are decoded using the decoding process specified in Annex REF _Ref168473844 \r \h G, VCL and non-VCL NAL units are specified in REF _Ref19417223 \h Table 71 in the column labelled "Annex REF _Ref168473844 \r \h G NAL unit type class". The entry "suffix dependent" for nal_unit_type equal to 14 is, specified as the followsing.
– If the NAL unit directly following in decoding order a NAL unit with nal_unit_type equal to 14 is a NAL unit with nal_unit_type equal to 1 or 5, the NAL unit with nal_unit_type equal to 14 is a VCL NAL unit.
– Otherwise, if the NAL unit directly following in decoding order a NAL unit with nal_unit_type equal to 14 is a NAL unit with nal_unit_type equal to 12, the NAL unit with nal_unit_type equal to 14 is a non-VCL NAL unit.
– Otherwise (the NAL unit directly following in decoding order a NAL unit with nal_unit_type equal to 14 is a NAL unit with nal_unit_type not equal to 1 or, 5, or 12), the NAL unit with nal_unit_type equal to 14 is a non-VCL NAL unit. and dDecoders that conform to this Recommendation | International Standard shall ignore (remove from the bitstream and discard) the NAL unit with nal_unit_type equal to 14 and the NAL unit directly following (in decoding order) the NAL unit with nal_unit_type equal to 14.
Table STYLEREF 1 \s 7 SEQ Table \* ARABIC \s 1 1 – NAL unit type codes, syntax element categories, and NAL unit type classes
nal_unit_typeContent of NAL unit and RBSP syntax structureCAnnex REF _Ref36826677 \r \h ANAL unittype classAnnex REF _Ref168473844 \r \h GNAL unittype class0Unspecifiednon-VCLnon-VCL1Coded slice of a non-IDR pictureslice_layer_without_partitioning_rbsp( )2, 3, 4VCLVCL2Coded slice data partition A slice_data_partition_a_layer_rbsp( )2VCLnot applicable3Coded slice data partition B slice_data_partition_b_layer_rbsp( )3VCLnot applicable4Coded slice data partition C slice_data_partition_c_layer_rbsp( )4VCLnot applicable5Coded slice of an IDR pictureslice_layer_without_partitioning_rbsp( )2, 3VCLVCL6Supplemental enhancement information (SEI)sei_rbsp( )5non-VCLnon-VCL7Sequence parameter setseq_parameter_set_rbsp( )0non-VCLnon-VCL8Picture parameter setpic_parameter_set_rbsp( )1non-VCLnon-VCL9Access unit delimiteraccess_unit_delimiter_rbsp( )6non-VCLnon-VCL10End of sequenceend_of_seq_rbsp( )7non-VCLnon-VCL11End of streamend_of_stream_rbsp( )8non-VCLnon-VCL12Filler datafiller_data_rbsp( )9non-VCLnon-VCL13Sequence parameter set extensionseq_parameter_set_extension_rbsp( )10non-VCLnon-VCL14Prefix NAL unit in scalable extensionprefix_nal_unit_rbsp( ) /* specified in Annex REF _Ref168473844 \r \h G */2non-VCLsuffix dependent15Subset sequence parameter setsubset_seq_parameter_set_rbsp( ) /* specified in Annex REF _Ref168473844 \r \h G */0non-VCLnon-VCL16..18Reservednon-VCLnon-VCL19Coded slice of an auxiliary coded picture without partitioningslice_layer_without_partitioning_rbsp( )2, 3, 4non-VCLnon-VCL20Coded slice in scalable extensionslice_layer_in_scalable_extension_rbsp( ) /* specified in Annex REF _Ref168473844 \r \h G */2, 3, 4non-VCLVCL21..23Reservednon-VCLnon-VCL24..31Unspecifiednon-VCLnon-VCL
NAL units having nal_unit_type equal to 13 or 19 may be discarded by decoders without affecting the decoding process for NAL units having nal_unit_type not equal to 13 or 19 and without affecting conformance to this Recommendation | International Standard.
NAL units having nal_unit_type equal to 14, 15, or 20 may be discarded by decoders without affecting the decoding process for NAL units having nal_unit_type not equal to 14, 15, or 20 and without affecting conformance to profiles specified in Annex REF _Ref36826677 \r \h A.
NAL units that use nal_unit_type equal to 0 or in the range of 24..31, inclusive, shall not affect the decoding process specified in this Recommendation | International Standard.
NOTE 2 – NAL unit types 0 and 24..31 may be used as determined by the application. No decoding process for these values of nal_unit_type is specified in this Recommendation | International Standard. Since different applications might use NAL unit types 0 and 24..31 for different purposes, particular care must be excercised in the design of encoders that generate NAL units with nal_unit_type equal to 0 or in the range of 24 to 31, inclusive, and in the design of decoders that interpret the content of NAL units with nal_unit_type equal to 0 or in the range of 24 to 31, inclusive.
Decoders shall ignore (remove from the bitstream and discard) the contents of all NAL units that use reserved values of nal_unit_type.
NOTE 3 – This requirement allows future definition of compatible extensions to this Recommendation | International Standard.
NOTE 4 – In previous editions of this Recommendation | International Standard, the NAL unit types 13..15 and 19..20 (or a subset of these NAL unit types) were reserved and no decoding process for NAL units having these values of nal_unit_type was specified. In later editions of this Recommendation | International Standard, currently reserved values of nal_unit_type might become non-reserved and a decoding process for these values of nal_unit_type might be specified. Encoders should take into consideration that the values of nal_unit_type that were reserved in previous editions of this Recommendation | International Standard might be ignored by decoders.
In the text, coded slice NAL unit collectively refers to a coded slice of a non-IDR picture NAL unit or to a coded slice of an IDR picture NAL unit. The variable IdrPicFlagfollowing flag is specified as
IdrPicFlag = ( ( nal_unit_type = = 5 ) ? 1 : 0 ) ( STYLEREF 1 \s 7- SEQ Equation \r 1 \* ARABIC 1)
When the value of nal_unit_type is equal to 5 for a NAL unit containing a slice of a particular picture, the picture shall not contain NAL units with nal_unit_type in the range of 1 to 4, inclusive. For coded video sequences conforming to one or more of the profiles specified in Annex REF _Ref36826677 \r \h A that are decoded using the decoding process specified in clauses REF _Ref20133850 \r \h 2- REF _Ref24280994 \r \h 9, such a picture is referred to as an IDR picture.
NOTE 5 4 – Slice data partitioning cannot be used for IDR pictures.
rbsp_byte[ i ] is the i-th byte of an RBSP. An RBSP is specified as an ordered sequence of bytes as follows.
The RBSP contains an SODB as follows.
– If the SODB is empty (i.e., zero bits in length), the RBSP is also empty.
– Otherwise, the RBSP contains the SODB as follows:.
1) The first byte of the RBSP contains the (most significant, left-most) eight bits of the SODB; the next byte of the RBSP shall contain the next eight bits of the SODB, etc., until fewer than eight bits of the SODB remain.
2) rbsp_trailing_bits( ) are present after the SODB as follows:
i) The first (most significant, left-most) bits of the final RBSP byte contains the remaining bits of the SODB, (if any).
ii) The next bit consists of a single rbsp_stop_one_bit equal to 1., and
iii) When the rbsp_stop_one_bit is not the last bit of a byte-aligned byte, one or more rbsp_alignment_zero_bit is present to result in byte alignment.
3) One or more cabac_zero_word 16-bit syntax elements equal to 0x0000 may be present in some RBSPs after the rbsp_trailing_bits( ) at the end of the RBSP.
Syntax structures having these RBSP properties are denoted in the syntax tables using an "_rbsp" suffix. These structures shall be carried within NAL units as the content of the rbsp_byte[ i ] data bytes. The association of the RBSP syntax structures to the NAL units shall be as specified in REF _Ref19417223 \h Table 71.
NOTE 6 5 – When the boundaries of the RBSP are known, the decoder can extract the SODB from the RBSP by concatenating the bits of the bytes of the RBSP and discarding the rbsp_stop_one_bit, which is the last (least significant, right-most) bit equal to 1, and discarding any following (less significant, farther to the right) bits that follow it, which are equal to 0. The data necessary for the decoding process is contained in the SODB part of the RBSP.
emulation_prevention_three_byte is a byte equal to 0x03. When an emulation_prevention_three_byte is present in the NAL unit, it shall be discarded by the decoding process.
The last byte of the NAL unit shall not be equal to 0x00.
Within the NAL unit, the following three-byte sequences shall not occur at any byte-aligned position:
– 0x000000
– 0x000001
– 0x000002
Within the NAL unit, any four-byte sequence that starts with 0x000003 other than the following sequences shall not occur at any byte-aligned position:
– 0x00000300
– 0x00000301
– 0x00000302
– 0x00000303
NOTE 7 6 – When nal_unit_type is equal to 0, particular care must be exercised in the design of encoders to avoid the presence of the above-listed three-byte and four-byte patterns at the beginning of the NAL unit syntax structure, as the syntax element emulation_prevention_three_byte cannot be the third byte of a NAL unit.
Encapsulation of an SODB within an RBSP (informative)
This subclause does not form an integral part of this Recommendation | International Standard.
The form of encapsulation of an SODB within an RBSP and the use of the emulation_prevention_three_byte for encapsulation of an RBSP within a NAL unit is specified for the following purposes:
– to prevent the emulation of start codes within NAL units while allowing any arbitrary SODB to be represented within a NAL unit,
– to enable identification of the end of the SODB within the NAL unit by searching the RBSP for the rbsp_stop_one_bit starting at the end of the RBSP, and
– to enable a NAL unit to have a size larger than that of the SODB under some circumstances (using one or more cabac_zero_word).
The encoder can produce a NAL unit from an RBSP by the following procedure:
The RBSP data is searched for byte-aligned bits of the following binary patterns:
'00000000 00000000 000000xx' (where xx represents any 2 bit pattern: 00, 01, 10, or 11),
and a byte equal to 0x03 is inserted to replace these bit patterns with the patterns:
'00000000 00000000 00000011 000000xx',
and finally, when the last byte of the RBSP data is equal to 0x00 (which can only occur when the RBSP ends in a cabac_zero_word), a final byte equal to 0x03 is appended to the end of the data. The last zero byte of a byte-aligned three-byte sequence 0x000000 in the RBSP (which is replaced by the four-byte sequence 0x00000300) is taken into account when searching the RBSP data for the next occurrence of byte-aligned bits with the binary patterns specified above.
The resulting sequence of bytes is then prefixed as follows.
– If nal_unit_type is not equal to 14 or 20, the sequence of bytes is prefixed with the first byte of the NAL unit containing the syntax elements forbidden_zero_bit, nal_ref_idc, and nal_unit_type, where nal_unit_type indicatesion of the type of RBSP data structure ithe NAL unit contains.
– Otherwise (nal_unit_type is equal to 14 or 20), the sequence of bytes is prefixed with the first four bytes of the NAL unit, where the first byte contains the syntax elements forbidden_zero_bit, nal_ref_idc, and nal_unit_type and the following three bytes contain the syntax structure nal_unit_header_svc_extension( ). The syntax element nal_unit_type in the first byte indicates the presence of the syntax structure nal_unit_header_svc_extension( ) in the following three bytes ands well as the type of RBSP data structure the NAL unit contains.
The process specified aboveis results in the construction of the entire NAL unit.
This process can allow any SODB to be represented in a NAL unit while ensuring that
– no byte-aligned start code prefix is emulated within the NAL unit, and
no sequence of 8 zero-valued bits followed by a start code prefix, regardless of byte-alignment, is emulated within the NAL unit.
Order of NAL units and association to coded pictures, access units, and video sequences
This subclause specifies constraints on the order of NAL units in the bitstream.
Any order of NAL units in the bitstream obeying these constraints is referred to in the text as the decoding order of NAL units. Within a NAL unit, the syntax in subclauses REF _Ref35660929 \r \h 7.3, REF _Ref35660950 \r \h D.1, and REF _Ref19432721 \r \h E.1 specifies the decoding order of syntax elements. Decoders conforming to this Recommendation | International Standard shall be capable of receiving NAL units and their syntax elements in decoding order.
Order of sequence and picture parameter set RBSPs and their activation
This subclause specifies the activation process of picture and sequence parameter sets for coded video sequences that conform to one or more of the profiles specified in Annex REF _Ref36826677 \r \h A that are decoded using the decoding process specified in clauses REF _Ref20133850 \r \h 2- REF _Ref24280994 \r \h 9.
NOTE 1 – The sequence and picture parameter set mechanism decouples the transmission of infrequently changing information from the transmission of coded macroblock data. Sequence and picture parameter sets may, in some applications, be conveyed "out-of-band" using a reliable transport mechanism.
A picture parameter set RBSP includes parameters that can be referred to by the coded slice NAL units or coded slice data partition A NAL units of one or more coded pictures. Each picture parameter set RBSP is initially considered not active at the start of the operation of the decoding process. At most one picture parameter set RBSP is considered active at any given moment during the operation of the decoding process, and the activation of any particular picture parameter set RBSP results in the deactivation of the previously-active picture parameter set RBSP (if any).
When a picture parameter set RBSP (with a particular value of pic_parameter_set_id) is not active and it is referred to by a coded slice NAL unit or coded slice data partition A NAL unit (using that value of pic_parameter_set_id), it is activated. This picture parameter set RBSP is called the active picture parameter set RBSP until it is deactivated by the activation of another picture parameter set RBSP. A picture parameter set RBSP, with that particular value of pic_parameter_set_id, shall be available to the decoding process prior to its activation.
Any picture parameter set NAL unit containing the value of pic_parameter_set_id for the active picture parameter set RBSP for a coded picture shall have the same content as that of the active picture parameter set RBSP for the coded picture unless it follows the last VCL NAL unit of thea coded picture and precedes the first VCL NAL unit of another coded picture.
A sequence parameter set RBSP includes parameters that can be referred to by one or more picture parameter set RBSPs or one or more SEI NAL units containing a buffering period SEI message. Each sequence parameter set RBSP is initially considered not active at the start of the operation of the decoding process. At most one sequence parameter set RBSP is considered active at any given moment during the operation of the decoding process, and the activation of any particular sequence parameter set RBSP results in the deactivation of the previously-active sequence parameter set RBSP (if any).
When a sequence parameter set RBSP (with a particular value of seq_parameter_set_id) is not already active and it is referred to by activation of a picture parameter set RBSP (using that value of seq_parameter_set_id) or is referred to by an SEI NAL unit containing a buffering period SEI message (using that value of seq_parameter_set_id), it is activated. This sequence parameter set RBSP is called the active sequence parameter set RBSP until it is deactivated by the activation of another sequence parameter set RBSP. A sequence parameter set RBSP, with that particular value of seq_parameter_set_id, shall be available to the decoding process prior to its activation. An activated sequence parameter set RBSP shall remain active for the entire coded video sequence.
NOTE 2 – Because an IDR access unit begins a new coded video sequence and an activated sequence parameter set RBSP must remain active for the entire coded video sequence, a sequence parameter set RBSP can only be activated by a buffering period SEI message when the buffering period SEI message is part of an IDR access unit.
Any sequence parameter set NAL unit containing the value of seq_parameter_set_id for the active sequence parameter set RBSP for a coded video sequence shall have the same content as that of the active sequence parameter set RBSP for the coded video sequence unless it follows the last access unit of thea coded video sequence and precedes the first VCL NAL unit and the first SEI NAL unit containing a buffering period SEI message (when present) of another coded video sequence.
NOTE 3 – If picture parameter set RBSP or sequence parameter set RBSP are conveyed within the bitstream, these constraints impose an order constraint on the NAL units that contain the picture parameter set RBSP or sequence parameter set RBSP, respectively. Otherwise (picture parameter set RBSP or sequence parameter set RBSP are conveyed by other means not specified in this Recommendation | International Standard), they must be available to the decoding process in a timely fashion such that these constraints are obeyed.
When present, a sequence parameter set extension RBSP includes parameters having a similar function to those of a sequence parameter set RBSP. For purposes of establishing constraints on the syntax elements of the sequence parameter set extension RBSP and for purposes of determining activation of a sequence parameter set extension RBSP, the sequence parameter set extension RBSP shall be considered part of the preceding sequence parameter set RBSP with the same value of seq_parameter_set_id. When a sequence parameter set RBSP is present that is not followed by a sequence parameter set extension RBSP with the same value of seq_parameter_set_id prior to the activation of the sequence parameter set RBSP, the sequence parameter set extension RBSP and its syntax elements shall be considered not present for the active sequence parameter set RBSP.
All constraints that are expressed on the relationship between the values of the syntax elements (and the values of variables derived from those syntax elements) in sequence parameter sets and picture parameter sets and other syntax elements are expressions of constraints that apply only to the active sequence parameter set and the active picture parameter set. If any sequence parameter set RBSP is present that is not activated in the bitstream, its syntax elements shall have values that would conform to the specified constraints if it were activated by reference in an otherwise-conforming bitstream. If any picture parameter set RBSP is present that is not ever activated in the bitstream, its syntax elements shall have values that would conform to the specified constraints if it were activated by reference in an otherwise-conforming bitstream.
During operation of the decoding process (see clause REF _Ref36115734 \r \h 8), the values of parameters of the active picture parameter set and the active sequence parameter set shall be considered in effect. For interpretation of SEI messages, the values of the parameters of the picture parameter set and sequence parameter set that are active for the operation of the decoding process for the VCL NAL units of the primary coded picture in the same access unit shall be considered in effect unless otherwise specified in the SEI message semantics.
Order of access units and association to coded video sequences
A bitstream conforming to this Recommendation | International Standard consists of one or more coded video sequences.
A coded video sequence consists of one or more access units. For coded video sequences that conform to one or more of the profiles specified in Annex REF _Ref36826677 \r \h A that are decoded using the decoding process specified in clauses REF _Ref20133850 \r \h 2- REF _Ref24280994 \r \h 9, the order of NAL units and coded pictures and their association to access units is described in subclause REF _Ref35694632 \r \h 7.4.1.2.3.
The first access unit of each coded video sequence is an IDR access unit. All subsequent access units in the coded video sequence are non-IDR access units.
The values of picture order count for the coded pictures in consecutive access units in decoding order containing non-reference pictures shall be non-decreasing.
When present, an access unit following an access unit that contains an end of sequence NAL unit shall be an IDR access unit.
When an SEI NAL unit contains data that pertain to more than one access unit (for example, when the SEI NAL unit has a coded video sequence as its scope), it shall be contained in the first access unit to which it applies.
When an end of stream NAL unit is present in an access unit, this access unit shall be the last access unit in the bitstream and the end of stream NAL unit shall be the last NAL unit in that access unit.
Order of NAL units and coded pictures and association to access units
This subclause specifies the order of NAL units and coded pictures and association to access unit for coded video sequences that conform to one or more of the profiles specified in Annex REF _Ref36826677 \r \h A that are decoded using the decoding process specified in clauses REF _Ref20133850 \r \h 2- REF _Ref24280994 \r \h 9.
An access unit consists of one primary coded picture, zero or more corresponding redundant coded pictures, and zero or more non-VCL NAL units. The association of VCL NAL units to primary or redundant coded pictures is described in subclause REF _Ref81363603 \r \h 7.4.1.2.5.
The first access unit in the bitstream starts with the first NAL unit of the bitstream.
The first of any of the following NAL units after the last VCL NAL unit of a primary coded picture specifies the start of a new access unit:.
– access unit delimiter NAL unit (when present),
– sequence parameter set NAL unit (when present),
– picture parameter set NAL unit (when present),
– SEI NAL unit (when present),
– NAL units with nal_unit_type in the range of 14 to 18, inclusive (when present),
– first VCL NAL unit of a primary coded picture (always present).
The constraints for the detection of the first VCL NAL unit of a primary coded picture are specified in subclause REF _Ref35694711 \r \h 7.4.1.2.4.
The following constraints shall be obeyed by the order of the coded pictures and non-VCL NAL units within an access unit:.
– When an access unit delimiter NAL unit is present, it shall be the first NAL unit. There shall be at most one access unit delimiter NAL unit in any access unit.
– When any SEI NAL units are present, they shall precede the primary coded picture.
– When an SEI NAL unit containing a buffering period SEI message is present, the buffering period SEI message shall be the first SEI message payload of the first SEI NAL unit in the access unit.
– The primary coded picture shall precede the corresponding redundant coded pictures.
– When redundant coded pictures are present, they shall be ordered in ascending order of the value of redundant_pic_cnt.
– When a sequence parameter set extension NAL unit is present, it shall be the next NAL unit after a sequence parameter set NAL unit having the same value of seq_parameter_set_id as in the sequence parameter set extension NAL unit.
– When one or more coded slice of an auxiliary coded picture without partitioning NAL units is present, they shall follow the primary coded picture and all redundant coded pictures (if any).
– When an end of sequence NAL unit is present, it shall follow the primary coded picture and all redundant coded pictures (if any) and all coded slice of an auxiliary coded picture without partitioning NAL units (if any).
– When an end of stream NAL unit is present, it shall be the last NAL unit.
– NAL units having nal_unit_type equal to 0, 12, or in the range of 20 to 31, inclusive, shall not precede the first VCL NAL unit of the primary coded picture.
NOTE 1 – Sequence parameter set NAL units or picture parameter set NAL units may be present in an access unit, but cannot follow the last VCL NAL unit of the primary coded picture within the access unit, as this condition would specify the start of a new access unit.
NOTE 2 – When a NAL unit having nal_unit_type equal to 7 or 8 is present in an access unit, it may or may not be referred to in the coded pictures of the access unit in which it is present, and may be referred to in coded pictures of subsequent access units.
The structure of access units not containing any NAL units with nal_unit_type equal to 0, 7, 8, or in the range of 12 to 18, inclusive, or in the range of 20 to 31, inclusive, is shown in REF _Ref35662825 \h Figure 71.
EMBED Visio.Drawing.11
Figure STYLEREF 1 \s 7 SEQ Figure \* ARABIC \s 1 1 – Structure of an access unit not containing any NAL units with nal_unit_type equal to 0, 7, 8, or in the range of 12 to 18, inclusive, or in the range of 20 to 31, inclusive
Detection of the first VCL NAL unit of a primary coded picture
This subclause specifies constraints on VCL NAL unit syntax that are sufficient to enable the detection of the first VCL NAL unit of each primary coded picture for coded video sequences that conform to one or more of the profiles specified in Annex REF _Ref36826677 \r \h A that are decoded using the decoding process specified in clauses REF _Ref20133850 \r \h 2- REF _Ref24280994 \r \h 9.
Any coded slice NAL unit or coded slice data partition A NAL unit of the primary coded picture of the current access unit shall be different from any coded slice NAL unit or coded slice data partition A NAL unit of the primary coded picture of the previous access unit in one or more of the following ways:.
– frame_num differs in value. The value of frame_num used to test this condition is the value of frame_num that appears in the syntax of the slice header, regardless of whether that value is inferred to have been equal to 0 for subsequent use in the decoding process due to the presence of memory_management_control_operation equal to 5.
NOTE 1 – A consequence of the above statement is that a primary coded picture having frame_num equal to 1 cannot contain a memory_management_control_operation equal to 5 unless some other condition listed below is fulfilled for the next primary coded picture that follows after it (if any).
– pic_parameter_set_id differs in value.
– field_pic_flag differs in value.
– bottom_field_flag is present in both and differs in value.
– nal_ref_idc differs in value with one of the nal_ref_idc values being equal to 0.
– pic_order_cnt_type is equal to 0 for both and either pic_order_cnt_lsb differs in value, or delta_pic_order_cnt_bottom differs in value.
– pic_order_cnt_type is equal to 1 for both and either delta_pic_order_cnt[ 0 ] differs in value, or delta_pic_order_cnt[ 1 ] differs in value.
– IdrPicFlag differs in value.
– IdrPicFlag is equal to 1 for both and idr_pic_id differs in value.
NOTE 2 – Some of the VCL NAL units in redundant coded pictures or some non-VCL NAL units (e.g., an access unit delimiter NAL unit) may also be used for the detection of the boundary between access units, and may therefore aid in the detection of the start of a new primary coded picture.
Order of VCL NAL units and association to coded pictures
This subclause specifies the order of VCL NAL units and association to coded pictures for coded video sequences that conform to one or more of the profiles specified in Annex REF _Ref36826677 \r \h A that are decoded using the decoding process specified in clauses REF _Ref20133850 \r \h 2- REF _Ref24280994 \r \h 9.
Each VCL NAL unit is part of a coded picture.
The order of the VCL NAL units within a coded IDR picture is constrained as follows.
– If arbitrary slice order is allowed as specified in Annex REF _Ref36826677 \r \h AA, coded slice of an IDR picture NAL units may have any order relative to each other.
– Otherwise (arbitrary slice order is not allowed), the following applies.
– If separate_colour_plane_flag is equal to 0, coded slice of an IDR picture NAL units of a slice group shall not be interleaved with coded slice of an IDR picture NAL units of another slice group and the order of coded slice of an IDR picture NAL units within a slice group shall be in the order of increasing macroblock address for the first macroblock of each coded slice of an IDR picture NAL unit of the particular slice group.
– Otherwise (separate_colour_plane_flag is equal to 1), coded slice of an IDR picture NAL units of a slice group for a particular value of colour_plane_id shall not be interleaved with coded slice of an IDR picture NAL units of another slice group with the same value of colour_plane_id and the order of coded slices of IDR picture NAL units within a slice group for a particular value of colour_plane_id shall be in the order of increasing macroblock address for the first macroblock of each coded slice of an IDR picture NAL unit of the particular slice group having the particular value of colour_plane_id.
NOTE 1 – When separate_colour_plane_flag is equal to 1, the relative ordering of coded slices having different values of colour_plane_id is not constrained.
The order of the VCL NAL units within a coded non-IDR picture is constrained as follows.
– If arbitrary slice order is allowed as specified in Annex REF _Ref36826677 \r \h AA, coded slice of a non-IDR picture NAL units or coded slice data partition A NAL units may have any order relative to each other. A coded slice data partition A NAL unit with a particular value of slice_id shall precede any present coded slice data partition B NAL unit with the same value of slice_id. A coded slice data partition A NAL unit with a particular value of slice_id shall precede any present coded slice data partition C NAL unit with the same value of slice_id. When a coded slice data partition B NAL unit with a particular value of slice_id is present, it shall precede any present coded slice data partition C NAL unit with the same value of slice_id.
– Otherwise (arbitrary slice order is not allowed), the following applies.
– If separate_colour_plane_flag is equal to 0, coded slice of a non-IDR picture NAL units or coded slice data partition NAL units of a slice group shall not be interleaved with coded slice of a non-IDR picture NAL units or coded slice data partition NAL units of another slice group and the order of coded slice of a non-IDR picture NAL units or coded slice data partition A NAL units within a slice group shall be in the order of increasing macroblock address for the first macroblock of each coded slice of a non-IDR picture NAL unit or coded slice data partition A NAL unit of the particular slice group. A coded slice data partition A NAL unit with a particular value of slice_id shall immediately precede any present coded slice data partition B NAL unit with the same value of slice_id. A coded slice data partition A NAL unit with a particular value of slice_id shall immediately precede any present coded slice data partition C NAL unit with the same value of slice_id, when a coded slice data partition B NAL unit with the same value of slice_id is not present. When a coded slice data partition B NAL unit with a particular value of slice_id is present, it shall immediately precede any present coded slice data partition C NAL unit with the same value of slice_id.
– Otherwise (separate_colour_plane_flag is equal to 1), coded slice of a non-IDR picture NAL units or coded slice data partition NAL units of a slice group for a particular value of colour_plane_id shall not be interleaved with coded slice of a non-IDR picture NAL units or coded slice data partition NAL units of another slice group with the same value of colour_plane_id and the order of coded slice of a non-IDR picture NAL units or coded slice data partition A NAL units within a slice group for particular value of colour_plane_id shall be in the order of increasing macroblock address for the first macroblock of each coded slice of a non-IDR picture NAL unit or coded slice data partition A NAL unit of the particular slice group having the particular value of colour_plane_id. A coded slice data partition A NAL unit associated with a particular value of slice_id and colour_plane_id shall immediately precede any present coded slice data partition B NAL unit with the same value of slice_id and colour_plane_id. A coded slice data partition A NAL unit associated with a particular value of slice_id and colour_plane_id shall immediately precede any present coded slice data partition C NAL unit with the same value of slice_id and colour_plane_id, when a coded slice data partition B NAL unit with the same value of slice_id and colour_plane_id is not present. When a coded slice data partition B NAL unit with a particular value of slice_id and colour_plane_id is present, it shall immediately precede any present coded slice data partition C NAL unit with the same value of slice_id and colour_plane_id.
NOTE 2 – When separate_colour_plane_flag is equal to 1, the relative ordering of coded slices having different values of colour_plane_id is not constrained.
NAL units having nal_unit_type equal to 12 may be present in the access unit but shall not precede the first VCL NAL unit of the primary coded picture within the access unit.
NAL units having nal_unit_type equal to 0 or in the range of 24 to 31, inclusive, which are unspecified, may be present in the access unit but shall not precede the first VCL NAL unit of the primary coded picture within the access unit.
NAL units having nal_unit_type in the range of 20 to 23, inclusive, shall not precede the first VCL NAL unit of the primary coded picture within the access unit.
Raw byte sequence payloads and RBSP trailing bits semantics
Sequence parameter set RBSP semantics
Sequence parameter set data semantics
profile_idc and level_idc indicate the profile and level to which the coded video sequence conforms.
constraint_set0_flag equal to 1 indicates that the coded video sequence obeys all constraints specified in subclause REF _Ref215990769 \r \h A.2.1 REF _Ref35859099 \r \h A.2.1. constraint_set0_flag equal to 0 indicates that the coded video sequence may or may not obey all constraints specified in subclause REF _Ref215990769 \r \h A.2.1 REF _Ref35859099 \r \h A.2.1.
constraint_set1_flag equal to 1 indicates that the coded video sequence obeys all constraints specified in subclause REF _Ref205305909 \r \h A.2.2 REF _Ref81364177 \r \h A.2.2. constraint_set1_flag equal to 0 indicates that the coded video sequence may or may not obey all constraints specified in subclause REF _Ref205305909 \r \h A.2.2 REF _Ref81364177 \r \h A.2.2.
constraint_set2_flag equal to 1 indicates that the coded video sequence obeys all constraints specified in subclause REF _Ref35859104 \r \h A.2.3. constraint_set2_flag equal to 0 indicates that the coded video sequence may or may not obey all constraints specified in subclause REF _Ref35859104 \r \h A.2.3.
NOTE 1 – When one or more than one of constraint_set0_flag, constraint_set1_flag, or constraint_set2_flag are equal to 1, the coded video sequence must obey the constraints of all of the indicated subclauses of subclause REF _Ref35859317 \r \h A.2. When profile_idc is equal to 44, 100, 110, 122, or 244, the values of constraint_set0_flag, constraint_set1_flag, and constraint_set2_flag must all be equal to 0.
constraint_set3_flag is specified asindicates the followsing.
– If profile_idc is equal to 66, 77, or 88 and level_idc is equal to 11, constraint_set3_flag equal to 1 indicates that the coded video sequence obeys all constraints specified in Annex REF _Ref36826677 \r \h A for level 1b and constraint_set3_flag equal to 0 indicates that the coded video sequence may or may not obey all constraints specified in Annex REF _Ref36826677 \r \h A for level 1b.
– Otherwise, if profile_idc is equal to 100 or 110, constraint_set3_flag equal to 1 indicates that the coded video sequence obeys all constraints specified in Annex REF _Ref36826677 \r \h AA for the High 10 Intra profile, and constraint_set3_flag equal to 0 indicates that the coded video sequence may or may not obey these corresponding constraints.
– Otherwise, if profile_idc is equal to 122, constraint_set3_flag equal to 1 indicates that the coded video sequence obeys all constraints specified in Annex REF _Ref36826677 \r \h AA for the High 4:2:2 Intra profile, and constraint_set3_flag equal to 0 indicates that the coded video sequence may or may not obey these corresponding constraints.
– Otherwise, if profile_idc is equal to 44, constraint_set3_flag shall be equal to 1. When profile_idc is equal to 44, the value of 0 for constraint_set3_flag is forbidden.
– Otherwise, if profile_idc is equal to 244, constraint_set3_flag equal to 1 indicates that the coded video sequence obeys all constraints specified in Annex REF _Ref36826677 \r \h AA for the High 4:4:4 Intra profile, and constraint_set3_flag equal to 0 indicates that the coded video sequence may or may not obey these corresponding constraints.
– Otherwise (profile_idc is equal to 66, 77, or 88 and level_idc is not equal to 11), the value of 1 for constraint_set3_flag is reserved for future use by ITUT | ISO/IEC. constraint_set3_flag shall be equal to 0 for coded video sequences with profile_idc equal to 66, 77, or 88 and level_idc not equal to 11 in bitstreams conforming to this Recommendation | International Standard. Decoders conforming to this Recommendation | International Standard shall ignore the value of constraint_set3_flag when profile_idc is equal to 66, 77, or 88 and level_idc is not equal to 11.
reserved_zero_4bits shall be equal to 0. Other values of reserved_zero_4bits may be specified in the future by ITUT | ISO/IEC. Decoders shall ignore the value of reserved_zero_4bits.
seq_parameter_set_id identifies the sequence parameter set that is referred to by the picture parameter set. The value of seq_parameter_set_id shall be in the range of 0 to 31, inclusive.
NOTE 2 – When feasible, encoders should use distinct values of seq_parameter_set_id when the values of other sequence parameter set syntax elements differ rather than changing the values of the syntax elements associated with a specific value of seq_parameter_set_id.
chroma_format_idc specifies the chroma sampling relative to the luma sampling as specified in subclause REF _Ref81058824 \r \h 6.2. The value of chroma_format_idc shall be in the range of 0 to 3, inclusive. When chroma_format_idc is not present, it shall be inferred to be equal to 1 (4:2:0 chroma format).
separate_colour_plane_flag equal to 1 specifies that the three colour components of the 4:4:4 chroma format are coded separately. separate_colour_plane_flag equal to 0 specifies that the colour components are not coded separately. When separate_colour_plane_flag is not present, it shall be inferred to be equal to 0. When separate_colour_plane_flag is equal to 1, the primary coded picture consists of three separate components, each of which consists of coded samples of one colour plane (Y, Cb or Cr) that each use the monochrome coding syntax. In this case, each colour plane is associated with a specific colour_plane_id value.
NOTE 3 – There is no dependency in decoding processes between the colour planes having different colour_plane_id values. For example, the decoding process of a monochrome picture with one value of colour_plane_id does not use any data from monochrome pictures having different values of colour_plane_id for inter prediction.
Depending on the value of separate_colour_plane_flag, the value of the variable ChromaArrayType is assigned as follows.
– If separate_colour_plane_flag is equal to 0, ChromaArrayType is set equal to chroma_format_idc.
– Otherwise (separate_colour_plane_flag is equal to 1), ChromaArrayType is set equal to 0.
bit_depth_luma_minus8 specifies the bit depth of the samples of the luma array and the value of the luma quantisation parameter range offset QpBdOffsetY, as specified by
BitDepthY = 8 + bit_depth_luma_minus8 ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 2)
QpBdOffsetY = 6 * bit_depth_luma_minus8 ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 3)
When bit_depth_luma_minus8 is not present, it shall be inferred to be equal to 0. bit_depth_luma_minus8 shall be in the range of 0 to 6, inclusive.
bit_depth_chroma_minus8 specifies the bit depth of the samples of the chroma arrays and the value of the chroma quantisation parameter range offset QpBdOffsetC, as specified by
BitDepthC = 8 + bit_depth_chroma_minus8 ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 4)
QpBdOffsetC = 6 * ( bit_depth_chroma_minus8 + residual_colour_transform_flag ) ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 5)
When bit_depth_chroma_minus8 is not present, it shall be inferred to be equal to 0. bit_depth_chroma_minus8 shall be in the range of 0 to 6, inclusive.
NOTE 4 – The value of bit_depth_chroma_minus8 is not used in the decoding process when ChromaArrayType is equal to 0. In particular, when separate_colour_plane_flag is equal to 1, each colour plane is decoded as a distinct monochrome picture using the luma component decoding process (except for the selection of scaling matrices) and the luma bit depth is used for all three colour components.
The variable RawMbBits is derived as
RawMbBits = 256 * BitDepthY + 2 * MbWidthC * MbHeightC * BitDepthC ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 6)
qpprime_y_zero_transform_bypass_flag equal to 1 specifies that, when QP'Y is equal to 0, a transform bypass operation for the transform coefficient decoding process and picture construction process prior to deblocking filter process as specified in subclause REF _Ref81058842 \r \h 8.5 shall be applied. qpprime_y_zero_transform_bypass_flag equal to 0 specifies that the transform coefficient decoding process and picture construction process prior to deblocking filter process shall not use the transform bypass operation. When qpprime_y_zero_transform_bypass_flag is not present, it shall be inferred to be equal to 0.
seq_scaling_matrix_present_flag equal to 1 specifies that the flags seq_scaling_list_present_flag[ i ] for i = 0..7 or i = 0..11 are present. seq_scaling_matrix_present_flag equal to 0 specifies that these flags are not present and the sequence-level scaling list specified by Flat_4x4_16 shall be inferred for i = 0..5 and the sequence-level scaling list specified by Flat_8x8_16 shall be inferred for i = 6..11. When seq_scaling_matrix_present_flag is not present, it shall be inferred to be equal to 0.
The scaling lists Flat_4x4_16 and Flat_8x8_16 are specified as follows:
Flat_4x4_16[ ki ] = 16, with ik = 0..15, ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 7)
Flat_8x8_16[ ik ] = 16, with ik = 0..63. ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 8)
seq_scaling_list_present_flag[ i ] equal to 1 specifies that the syntax structure for scaling list i is present in the sequence parameter set. seq_scaling_list_present_flag[ i ] equal to 0 specifies that the syntax structure for scaling list i is not present in the sequence parameter set and the scaling list fall-back rule set A specified in REF _Ref81058611 \h Table 72 shall be used to infer the sequence-level scaling list for index i.
Table STYLEREF 1 \s 7 SEQ Table \* ARABIC \s 1 2 – Assignment of mnemonic names to scaling list indices and specification of fall-back rule
Value of scaling list indexMnemonic nameBlock sizeMB prediction typeComponentScaling list fall-back rule set AScaling list fall-back rule set BDefaultscaling list0Sl_4x4_Intra_Y4x4IntraYdefaultscaling listsequence-levelscaling listDefault_4x4_Intra1Sl_4x4_Intra_Cb4x4IntraCbscaling listfor i = 0scaling listfor i = 0Default_4x4_Intra2Sl_4x4_Intra_Cr4x4IntraCrscaling listfor i = 1scaling listfor i = 1Default_4x4_Intra3Sl_4x4_Inter_Y4x4InterYdefaultscaling listsequence-levelscaling listDefault_4x4_Inter4Sl_4x4_Inter_Cb4x4InterCbscaling listfor i = 3scaling listfor i = 3Default_4x4_Inter5Sl_4x4_Inter_Cr4x4InterCrscaling listfor i = 4scaling listfor i = 4Default_4x4_Inter6Sl_8x8_Intra_Y8x8IntraYdefaultscaling listsequence-levelscaling listDefault_8x8_Intra7Sl_8x8_Inter_Y8x8InterYdefaultscaling listsequence-levelscaling listDefault_8x8_Inter8Sl_8x8_Intra_Cb8x8IntraCbscaling listfor i = 6scaling listfor i = 6Default_8x8_Intra9Sl_8x8_Inter_Cb8x8InterCbscaling listfor i = 7scaling listfor i = 7Default_8x8_Inter10Sl_8x8_Intra_Cr8x8IntraCrscaling listfor i = 8scaling listfor i = 8Default_8x8_Intra11Sl_8x8_Inter_Cr8x8InterCrscaling listfor i = 9scaling listfor i = 9Default_8x8_Inter
REF _Ref82535363 \h Table 73 specifies the default scaling lists Default_4x4_Intra and Default_4x4_Inter. REF _Ref82535622 \h Table 74 specifies the default scaling lists Default_8x8_Intra and Default_8x8_Inter.
Table STYLEREF 1 \s 7 SEQ Table \* ARABIC \s 1 3 – Specification of default scaling lists Default_4x4_Intra and Default_4x4_Inter
idx0123456789101112131415Default_4x4_Intra[ idx ]6131320202028282828323232373742Default_4x4_Inter[ idx ]10141420202024242424272727303034
Table STYLEREF 1 \s 7 SEQ Table \* ARABIC \s 1 4 – Specification of default scaling lists Default_8x8_Intra and Default_8x8_Inter
idx0123456789101112131415Default_8x8_Intra[ idx ]6101013111316161616181818181823Default_8x8_Inter[ idx ]9131315131517171717191919191921 REF _Ref82535622 \h Table 74 (continued) – Specification of default scaling lists Default_8x8_Intra and Default_8x8_Inter
idx16171819202122232425262728293031Default_8x8_Intra[ idx ]23232323232525252525252527272727Default_8x8_Inter[ idx ]21212121212222222222222224242424 REF _Ref82535622 \h Table 74 (continued) – Specification of default scaling lists Default_8x8_Intra and Default_8x8_Inter
idx32333435363738394041424344454647Default_8x8_Intra[ idx ]27272727292929292929293131313131Default_8x8_Inter[ idx ]24242424252525252525252727272727 REF _Ref82535622 \h Table 74 (concluded) – Specification of default scaling lists Default_8x8_Intra and Default_8x8_Inter
idx48495051525354555657585960616263Default_8x8_Intra[ idx ]31333333333336363636383838404042Default_8x8_Inter[ idx ]27282828282830303030323232333335
log2_max_frame_num_minus4 specifies the value of the variable MaxFrameNum that is used in frame_num related derivations as follows:
MaxFrameNum = 2( log2_max_frame_num_minus4 + 4 ) ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 9)
The value of log2_max_frame_num_minus4 shall be in the range of 0 to 12, inclusive.
pic_order_cnt_type specifies the method to decode picture order count (as specified in subclause REF _Ref19428535 \r \h \* MERGEFORMAT 8.2.1). The value of pic_order_cnt_type shall be in the range of 0 to 2, inclusive.
pic_order_cnt_type shall not be equal to 2 in a coded video sequence that contains any of the following:
– an access unit containing a non-reference frame followed immediately by an access unit containing a non-reference picture,;
– two access units each containing a field with the two fields together forming a complementary non-reference field pair followed immediately by an access unit containing a non-reference picture,;
– an access unit containing a non-reference field followed immediately by an access unit containing another non-reference picture that does not form a complementary non-reference field pair with the first of the two access units.
log2_max_pic_order_cnt_lsb_minus4 specifies the value of the variable MaxPicOrderCntLsb that is used in the decoding process for picture order count as specified in subclause REF _Ref33085279 \r \h 8.2.1 as follows:
MaxPicOrderCntLsb = 2( log2_max_pic_order_cnt_lsb_minus4 + 4 ) ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 10)
The value of log2_max_pic_order_cnt_lsb_minus4 shall be in the range of 0 to 12, inclusive.
delta_pic_order_always_zero_flag equal to 1 specifies that delta_pic_order_cnt[ 0 ] and delta_pic_order_cnt[ 1 ] are not present in the slice headers of the sequence and shall be inferred to be equal to 0. delta_pic_order_always_zero_flag equal to 0 specifies that delta_pic_order_cnt[ 0 ] is present in the slice headers of the sequence and delta_pic_order_cnt[ 1 ] may be present in the slice headers of the sequence.
offset_for_non_ref_pic is used to calculate the picture order count of a non-reference picture as specified in subclause REF _Ref30320332 \r \h 8.2.1. The value of offset_for_non_ref_pic shall be in the range of -"231 to 231 -" 1, inclusive.
offset_for_top_to_bottom_field is used to calculate the picture order count of a bottom field as specified in subclause REF _Ref30320332 \r \h 8.2.1. The value of offset_for_top_to_bottom_field shall be in the range of -"231 to 231 -" 1, inclusive.
num_ref_frames_in_pic_order_cnt_cycle is used in the decoding process for picture order count as specified in subclause REF _Ref30320332 \r \h 8.2.1. The value of num_ref_frames_in_pic_order_cnt_cycle shall be in the range of 0 to 255, inclusive.
offset_for_ref_frame[ i ] is an element of a list of num_ref_frames_in_pic_order_cnt_cycle values used in the decoding process for picture order count as specified in subclause REF _Ref30320332 \r \h 8.2.1. The value of offset_for_ref_frame[ i ] shall be in the range of -"231 to 231 -" 1, inclusive.
When pic_order_cnt_type is equal to 1, the variable ExpectedDeltaPerPicOrderCntCycle is derived by
ExpectedDeltaPerPicOrderCntCycle = 0for( i = 0; i < num_ref_frames_in_pic_order_cnt_cycle; i++ ) ExpectedDeltaPerPicOrderCntCycle += offset_for_ref_frame[ i ] ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 11)
max_num_ref_frames specifies the maximum number of short-term and long-term reference frames, complementary reference field pairs, and non-paired reference fields that may be used by the decoding process for inter prediction of any picture in the sequence. max_num_ref_frames also determines the size of the sliding window operation as specified in subclause REF _Ref31522176 \r \h 8.2.5.3. The value of max_num_ref_frames shall be in the range of 0 to MaxDpbFramesSize (as specified in subclause REF _Ref36741716 \r \h A.3.1 or REF _Ref81377819 \r \h A.3.2), inclusive.
gaps_in_frame_num_value_allowed_flag specifies the allowed values of frame_num as specified in subclause REF _Ref29724216 \r \h 7.4.3 and the decoding process in case of an inferred gap between values of frame_num as specified in subclause REF _Ref31614329 \r \h 8.2.5.2.
pic_width_in_mbs_minus1 plus 1 specifies the width of each decoded picture in units of macroblocks.
The variable for the picture width in units of macroblocks is derived as follows
PicWidthInMbs = pic_width_in_mbs_minus1 + 1 ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 12)
The variable for picture width for the luma component is derived as follows
PicWidthInSamplesL = PicWidthInMbs * 16 ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 13)
The variable for picture width for the chroma components is derived as follows
PicWidthInSamplesC = PicWidthInMbs * MbWidthC ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 14)
pic_height_in_map_units_minus1 plus 1 specifies the height in slice group map units of a decoded frame or field.
The variables PicHeightInMapUnits and PicSizeInMapUnits are derived as follows
PicHeightInMapUnits = pic_height_in_map_units_minus1 + 1 ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 15)
PicSizeInMapUnits = PicWidthInMbs * PicHeightInMapUnits ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 16)
frame_mbs_only_flag equal to 0 specifies that coded pictures of the coded video sequence may either be coded fields or coded frames. frame_mbs_only_flag equal to 1 specifies that every coded picture of the coded video sequence is a coded frame containing only frame macroblocks.
The allowed range of values for pic_width_in_mbs_minus1, pic_height_in_map_units_minus1, and frame_mbs_only_flag is specified by constraints in Annex REF _Ref36826677 \r \h AA.
Depending on frame_mbs_only_flag, semantics are assigned to pic_height_in_map_units_minus1 as follows.
– If frame_mbs_only_flag is equal to 0, pic_height_in_map_units_minus1 plus 1 is the height of a field in units of macroblocks.
– Otherwise (frame_mbs_only_flag is equal to 1), pic_height_in_map_units_minus1 plus 1 is the height of a frame in units of macroblocks.
The variable FrameHeightInMbs is derived as follows
FrameHeightInMbs = ( 2 –" frame_mbs_only_flag ) * PicHeightInMapUnits ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 17)
mb_adaptive_frame_field_flag equal to 0 specifies no switching between frame and field macroblocks within a picture. mb_adaptive_frame_field_flag equal to 1 specifies the possible use of switching between frame and field macroblocks within frames. When mb_adaptive_frame_field_flag is not present, it shall be inferred to be equal to 0.
direct_8x8_inference_flag specifies the method used in the derivation process for luma motion vectors for B_Skip, B_Direct_16x16 and B_Direct_8x8 as specified in subclause REF _Ref32808271 \r \h 8.4.1.2. When frame_mbs_only_flag is equal to 0, direct_8x8_inference_flag shall be equal to 1.
frame_cropping_flag equal to 1 specifies that the frame cropping offset parameters follow next in the sequence parameter set. frame_cropping_flag equal to 0 specifies that the frame cropping offset parameters are not present.
frame_crop_left_offset, frame_crop_right_offset, frame_crop_top_offset, frame_crop_bottom_offset specify the samples of the pictures in the coded video sequence that are output from the decoding process, in terms of a rectangular region specified in frame coordinates for output.
The variables CropUnitX and CropUnitY are derived as follows.:
If ChromaArrayType is equal to 0, CropUnitX and CropUnitY are derived as
CropUnitX = 1 ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 18)CropUnitY = 2 " frame_mbs_only_flag ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 19)
Otherwise (ChromaArrayType is equal to 1, 2, or 3), CropUnitX and CropUnitY are derived as
CropUnitX = SubWidthC ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 20)CropUnitY = SubHeightC * ( 2 " frame_mbs_only_flag ) ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 21)
The frame cropping rectangle contains luma samples with horizontal frame coordinates from CropUnitX * frame_crop_left_offset to PicWidthInSamplesL " ( CropUnitX * frame_crop_right_offset + 1 ) and vertical frame coordinates from CropUnitY * frame_crop_top_offset to ( 16 * FrameHeightInMbs ) " ( CropUnitY * frame_crop_bottom_offset + 1 ), inclusive. The value of frame_crop_left_offset shall be in the range of 0 to ( PicWidthInSamplesL / CropUnitX ) " ( frame_crop_right_offset + 1 ), inclusive; and the value of frame_crop_top_offset shall be in the range of 0 to ( 16 * FrameHeightInMbs / CropUnitY ) " ( frame_crop_bottom_offset + 1 ), inclusive.
When frame_cropping_flag is equal to 0, the values of frame_crop_left_offset, frame_crop_right_offset, frame_crop_top_offset, and frame_crop_bottom_offset shall be inferred to be equal to 0.
When ChromaArrayType is not equal to 0, the corresponding specified samples of the two chroma arrays are the samples having frame coordinates ( x / SubWidthC, y / SubHeightC ), where ( x, y ) are the frame coordinates of the specified luma samples.
For decoded fields, the specified samples of the decoded field are the samples that fall within the rectangle specified in frame coordinates.
vui_parameters_present_flag equal to 1 specifies that the vui_parameters( ) syntax structure as specified in Annex REF _Ref205194226 \r \h EE is present. vui_parameters_present_flag equal to 0 specifies that the vui_parameters( ) syntax structure as specified in Annex REF _Ref205194226 \r \h EE is not present.
Scaling list semantics
delta_scale is used to derive the j-th element of the scaling list for j in the range of 0 to sizeOfScalingList " 1, inclusive. The value of delta_scale shall be in the range of "128 to +127, inclusive.
When useDefaultScalingMatrixFlag is derived to be equal to 1, the scaling list shall be inferred to be equal to the default scaling list as specified in REF _Ref81058611 \h Table 72.
Sequence parameter set extension RBSP semantics
seq_parameter_set_id identifies the sequence parameter set associated with the sequence parameter set extension. The value of seq_parameter_set_id shall be in the range of 0 to 31, inclusive.
aux_format_idc equal to 0 indicates that there are no auxiliary coded pictures in the coded video sequence. aux_format_idc equal to 1 indicates that exactly one auxiliary coded picture is present in each access unit of the coded video sequence, and that for alpha blending purposes the decoded samples of the associated primary coded picture in each access unit should be multiplied by the interpretation sample values of the auxiliary coded picture in the access unit in the display process after output from the decoding process. aux_format_idc equal to 2 indicates that exactly one auxiliary coded picture exists in each access unit of the coded video sequence, and that for alpha blending purposes the decoded samples of the associated primary coded picture in each access unit should not be multiplied by the interpretation sample values of the auxiliary coded picture in the access unit in the display process after output from the decoding process. aux_format_idc equal to 3 indicates that exactly one auxiliary coded picture exists in each access unit of the coded video sequence, and that the usage of the auxiliary coded pictures is unspecified. The value of aux_format_idc shall be in the range of 0 to 3, inclusive. Values greater than 3 for aux_format_idc are reserved to indicate the presence of exactly one auxiliary coded picture in each access unit of the coded video sequence for purposes to be specified in the future by ITUT | ISO/IEC. When aux_format_idc is not present, it shall be inferred to be equal to 0.
NOTE 1 – Decoders conforming to this Recommendation | International Standard are not required to decode auxiliary coded pictures.
bit_depth_aux_minus8 specifies the bit depth of the samples of the sample array of the auxiliary coded picture. bit_depth_aux_minus8 shall be in the range of 0 to 4, inclusive.
alpha_incr_flag equal to 0 indicates that the interpretation sample value for each decoded auxiliary coded picture sample value is equal to the decoded auxiliary coded picture sample value for purposes of alpha blending. alpha_incr_flag equal to 1 indicates that, for purposes of alpha blending, after decoding the auxiliary coded picture samples, any auxiliary coded picture sample value that is greater than Min(alpha_opaque_value, alpha_transparent_value) should be increased by one to obtain the interpretation sample value for the auxiliary coded picture sample, and any auxiliary coded picture sample value that is less than or equal to Min(alpha_opaque_value, alpha_transparent_value) should be used without alteration as the interpretation sample value for the decoded auxiliary coded picture sample value.
alpha_opaque_value specifies the interpretation sample value of an auxiliary coded picture sample for which the associated luma and chroma samples of the same access unit are considered opaque for purposes of alpha blending. The number of bits used for the representation of the alpha_opaque_value syntax element is bit_depth_aux_minus8 + 9 bits.
alpha_transparent_value specifies the interpretation sample value of an auxiliary coded picture sample for which the associated luma and chroma samples of the same access unit are considered transparent for purposes of alpha blending. The number of bits used for the representation of the alpha_transparent_value syntax element is bit_depth_aux_minus8 + 9 bits.
When alpha_incr_flag is equal to 1, alpha_transparent_value shall not be equal to alpha_opaque_value and Log2( Abs( alpha_opaque_value " alpha_transparent_value ) ) shall have an integer value. A value of alpha_transparent_value that is equal to alpha_opaque_value indicates that the auxiliary coded picture is not intended for alpha blending purposes.
NOTE 2 – For alpha blending purposes, alpha_opaque_value may be greater than alpha_transparent_value, or it may be less than alpha_transparent_value. Interpretation sample values should be clipped to the range of alpha_opaque_value to alpha_transparent_value, inclusive.
The decoding of the sequence parameter set extension and the decoding of auxiliary coded pictures is not required for conformance with this Recommendation | International Standard.
The syntax of each coded slice of an auxiliary coded picture shall obey the same constraints as a coded slice of a redundant picture, with the following differences of constraints:.
– The following applies iIn regard to whether the primary coded picture is an IDR picture, the following applies.
– If the primary coded picture is an IDR picture, the auxiliary coded slice syntax shall correspond to that of a slice having nal_unit_type equal to 5 (a slice of an IDR picture).;
– Otherwise (the primary coded picture is not an IDR picture), the auxiliary coded slice syntax shall correspond to that of a slice having nal_unit_type equal to 1 (a slice of a non-IDR picture).
– The slices of an auxiliary coded picture (when present) shall contain all macroblocks corresponding to those of the primary coded picture.
– redundant_pic_cnt shall be equal to 0 in all auxiliary coded slices.
The (optional) decoding process for the decoding of auxiliary coded pictures is the same as if the auxiliary coded pictures were primary coded pictures in a separate coded video stream that differs from the primary coded pictures in the current coded video stream in the following ways:.
– The IDR or non-IDR status of each auxiliary coded picture shall be inferred to be the same as the IDR or non-IDR status of the primary picture in the same access unit, rather than being inferred from the value of nal_unit_typeref_idc.
– The value of chroma_format_idc and the value of ChromaArrayType shall be inferred to be equal to 0 for the decoding of the auxiliary coded pictures.
– The value of bit_depth_luma_minus8 shall be inferred to be equal to bit_depth_aux_minus8 for the decoding of the auxiliary coded pictures.
NOTE 3 – Alpha blending composition is normally performed with a background picture B, a foreground picture F, and a decoded auxiliary coded picture A, all of the same size. Assume for purposes of example illustration that the chroma resolution of B and F have been upsampled to the same resolution as the luma. Denote corresponding samples of B, F and A by b, f and a, respectively. Denote luma and chroma samples by subscripts Y, Cb and Cr.
Define the variables alphaRange, alphaFwt and alphaBwt as follows:
alphaRange = Abs( alpha_opaque_value -" alpha_transparent_value )
alphaFwt = Abs( a -" alpha_transparent_value )
alphaBwt = Abs( a -" alpha_opaque_value )
Then, in alpha blending composition, samples d of the displayed picture D may be calculated as
dY = ( alphaFwt * fY + alphaBwt * bY + alphaRange / 2 ) / alphaRange
dCbB = ( alphaFwt * fCbB + alphaBwt * bCbB + alphaRange / 2 ) / alphaRange
dCrR = ( alphaFwt * fCrR + alphaBwt * bCrR + alphaRange / 2 ) / alphaRange
The samples of pictures D, F and B could also represent red, green, and blue component values (see subclause REF _Ref81059190 \r \h E.2.1). Here we have assumed Y, Cb and Cr component values. Each component, e.g., Y, is assumed for purposes of example illustration above to have the same bit depth in each of the pictures D, F and B. However, different components, e.g., Y and Cb, need not have the same bit depth in this example.
When aux_format_idc is equal to 1, F would be the decoded picture obtained from the decoded luma and chroma, and A would be the decoded picture obtained from the decoded auxiliary coded picture. In this case, the indicated example alpha blending composition involves multiplying the samples of F by factors obtained from the samples of A.
A picture format that is useful for editing or direct viewing, and that is commonly used, is called pre-multiplied-black video. If the foreground picture was F, then the pre-multiplied-black video S is given by
sY = ( alphaFwt * fY ) / alphaRange
sCbB = ( alphaFwt * fCbB ) / alphaRange
sCrR = ( alphaFwt * fCrR ) / alphaRange
Pre-multiplied-black video has the characteristic that the picture S will appear correct if displayed against a black background. For a non-black background B, the composition of the displayed picture D may be calculated as
dY = sY + ( alphaBwt * bY + alphaRange / 2 ) / alphaRange
dCbB = sCbB + ( alphaBwt * bCbB + alphaRange / 2 ) / alphaRange
dCrR = sCrR + ( alphaBwt * bCrR + alphaRange / 2 ) / alphaRange
When aux_format_idc is equal to 2, S would be the decoded picture obtained from the decoded luma and chroma, and A would again be the decoded picture obtained from the decoded auxiliary coded picture. In this case, alpha blending composition does not involve multiplication of the samples of S by factors obtained from the samples of A.
additional_extension_flag equal to 0 indicates that no additional data follows within the sequence parameter set extension syntax structure prior to the RBSP trailing bits. The value of additional_extension_flag shall be equal to 0. The value of 1 for additional_extension_flag is reserved for future use by ITUT | ISO/IEC. Decoders that conform to this Recommendation | International Standard shall ignore all data that follows the value of 1 for additional_extension_flag in a sequence parameter set extension NAL unit.
Picture parameter set RBSP semantics
pic_parameter_set_id identifies the picture parameter set that is referred to in the slice header. The value of pic_parameter_set_id shall be in the range of 0 to 255, inclusive.
seq_parameter_set_id refers to the active sequence parameter set. The value of seq_parameter_set_id shall be in the range of 0 to 31, inclusive.
entropy_coding_mode_flag selects the entropy decoding method to be applied for the syntax elements for which two descriptors appear in the syntax tables as follows.
– If entropy_coding_mode_flag is equal to 0, the method specified by the left descriptor in the syntax table is applied (Exp-Golomb coded, see subclause REF _Ref24429957 \r \h 9.1 or CAVLC, see subclause REF _Ref33186826 \r \h 9.2).
– Otherwise (entropy_coding_mode_flag is equal to 1), the method specified by the right descriptor in the syntax table is applied (CABAC, see subclause REF _Ref29813187 \r \h 9.3).
bottom_field_pic_order_in_frame_present_flag equal to 1 specifies that the picture order count related syntax elements delta_pic_order_cnt_bottom (forwhen pic_order_cnt_type is equal to 0) or delta_pic_order_cnt[ 1 ] (forwhen pic_order_cnt_type is equal to 1), which are related to picture order counts for the bottom field of a coded frame, are present in the slice headers for coded frames as specified in subclause REF _Ref30320556 \r \h 7.3.3. bottom_field_pic_order_in_frame_present_flag equal to 0 specifies that the picture order count related syntax elements delta_pic_order_cnt_bottom and delta_pic_order_cnt[ 1 ] are not present in the slice headers.
num_slice_groups_minus1 plus 1 specifies the number of slice groups for a picture. When num_slice_groups_minus1 is equal to 0, all slices of the picture belong to the same slice group. The allowed range of num_slice_groups_minus1 is specified in Annex REF _Ref36826677 \r \h AA.
slice_group_map_type specifies how the mapping of slice group map units to slice groups is coded. The value of slice_group_map_type shall be in the range of 0 to 6, inclusive.
slice_group_map_type equal to 0 specifies interleaved slice groups.
slice_group_map_type equal to 1 specifies a dispersed slice group mapping.
slice_group_map_type equal to 2 specifies one or more “"foreground”" slice groups and a “"leftover”" slice group.
slice_group_map_type values equal to 3, 4, and 5 specify changing slice groups. When num_slice_groups_minus1 is not equal to 1, slice_group_map_type shall not be equal to 3, 4, or 5.
slice_group_map_type equal to 6 specifies an explicit assignment of a slice group to each slice group map unit.
Slice group map units are specified as follows.
– If frame_mbs_only_flag is equal to 0 and mb_adaptive_frame_field_flag is equal to 1 and the coded picture is a frame, the slice group map units are macroblock pair units.
– Otherwise, if frame_mbs_only_flag is equal to 1 or thea coded picture is a field, the slice group map units are units of macroblocks.
– Otherwise (frame_mbs_only_flag is equal to 0 and mb_adaptive_frame_field_flag is equal to 0 and the coded picture is a frame), the slice group map units are units of two macroblocks that are vertically contiguous as in a frame macroblock pair of an MBAFF frame.
run_length_minus1[ i ] is used to specify the number of consecutive slice group map units to be assigned to the i-th slice group in raster scan order of slice group map units. The value of run_length_minus1[ i ] shall be in the range of 0 to PicSizeInMapUnits -" 1, inclusive.
top_left[ i ] and bottom_right[ i ] specify the top-left and bottom-right corners of a rectangle, respectively. top_left[ i ] and bottom_right[ i ] are slice group map unit positions in a raster scan of the picture for the slice group map units. For each rectangle i, all of the following constraints shall be obeyed by the values of the syntax elements top_left[ i ] and bottom_right[ i ]:
– top_left[ i ] shall be less than or equal to bottom_right[ i ] and bottom_right[ i ] shall be less than PicSizeInMapUnits.
– ( top_left[ i ] % PicWidthInMbs ) shall be less than or equal to the value of ( bottom_right[ i ] % PicWidthInMbs ).
slice_group_change_direction_flag is used with slice_group_map_type to specify the refined map type when slice_group_map_type is 3, 4, or 5.
slice_group_change_rate_minus1 is used to specify the variable SliceGroupChangeRate. SliceGroupChangeRate specifies the multiple in number of slice group map units by which the size of a slice group can change from one picture to the next. The value of slice_group_change_rate_minus1 shall be in the range of 0 to PicSizeInMapUnits –" 1, inclusive. The SliceGroupChangeRate variable is specified as follows:
SliceGroupChangeRate = slice_group_change_rate_minus1 + 1 ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 22)
pic_size_in_map_units_minus1 is used to specify the number of slice group map units in the picture. pic_size_in_map_units_minus1 shall be equal to PicSizeInMapUnits -" 1.
slice_group_id[ i ] identifies a slice group of the i-th slice group map unit in raster scan order. The lengthsize of the slice_group_id[ i ] syntax element is Ceil( Log2( num_slice_groups_minus1 + 1 ) ) bits. The value of slice_group_id[ i ] shall be in the range of 0 to num_slice_groups_minus1, inclusive.
num_ref_idx_l0_default_active_minus1 specifies how num_ref_idx_l0_active_minus1 is inferred for P, SP, and B slices with num_ref_idx_active_override_flag equal to 0.the maximum reference index for reference picture list 0 that shall be used to decode each slice of the picture in which list 0 prediction is used when num_ref_idx_active_override_flag is equal to 0 for the slice. When MbaffFrameFlag is equal to 1, num_ref_idx_l0_active_minus1 is the maximum index value for the decoding of frame macroblocks and 2 * num_ref_idx_l0_active_minus1 + 1 is the maximum index value for the decoding of field macroblocks. The value of num_ref_idx_l0_default_active_minus1 shall be in the range of 0 to 31, inclusive.
num_ref_idx_l1_default_active_minus1 specifies how num_ref_idx_l1_active_minus1 is inferred for B slices with num_ref_idx_active_override_flag equal to 0. The value of num_ref_idx_l1_default_active_minus1 shall be in the range of 0 to 31, inclusivehas the same semantics as num_ref_idx_l0_active_minus1 with l0 and list 0 replaced by l1 and list 1, respectively.
weighted_pred_flag equal to 0 specifies that the default weighted prediction shall not be applied to P and SP slices. weighted_pred_flag equal to 1 specifies that explicit weighted prediction shall be applied to P and SP slices.
weighted_bipred_idc equal to 0 specifies that the default weighted prediction shall be applied to B slices. weighted_bipred_idc equal to 1 specifies that explicit weighted prediction shall be applied to B slices. weighted_bipred_idc equal to 2 specifies that implicit weighted prediction shall be applied to B slices. The value of weighted_bipred_idc shall be in the range of 0 to 2, inclusive.
pic_init_qp_minus26 specifies the initial value minus 26 of SliceQPY for each slice. The initial value is modified at the slice layer when a non-zero value of slice_qp_delta is decoded, and is modified further when a non-zero value of mb_qp_delta is decoded at the macroblock layer. The value of pic_init_qp_minus26 shall be in the range of "(26 + QpBdOffsetY ) to +25, inclusive.
pic_init_qs_minus26 specifies the initial value minus 26 of SliceQSY for all macroblocks in SP or SI slices. The initial value is modified at the slice layer when a non-zero value of slice_qs_delta is decoded. The value of pic_init_qs_minus26 shall be in the range of -"26 to +25, inclusive.
chroma_qp_index_offset specifies the offset that shall be added to QPY and QSY for addressing the table of QPC values for the Cb chroma component. The value of chroma_qp_index_offset shall be in the range of -"12 to +12, inclusive.
deblocking_filter_control_present_flag equal to 1 specifies that a set of syntax elements controlling the characteristics of the deblocking filter is present in the slice header. deblocking_filter_control_present_flag equal to 0 specifies that the set of syntax elements controlling the characteristics of the deblocking filter is not present in the slice headers and their inferred values are in effect.
constrained_intra_pred_flag equal to 0 specifies that intra prediction allows usage of residual data and decoded samples of neighbouring macroblocks coded using Inter macroblock prediction modes for the prediction of macroblocks coded using Intra macroblock prediction modes. constrained_intra_pred_flag equal to 1 specifies constrained intra prediction, in which case prediction of macroblocks coded using Intra macroblock prediction modes only uses residual data and decoded samples from I or SI macroblock types.
redundant_pic_cnt_present_flag equal to 0 specifies that the redundant_pic_cnt syntax element is not present in slice headers, coded slice data partitions B NAL units, and coded slice data partitions C NAL units that refer (either directly or by association with a corresponding coded slice data partition A NAL unit) to the picture parameter set. redundant_pic_cnt_present_flag equal to 1 specifies that the redundant_pic_cnt syntax element is present in all slice headers, coded slice data partitions B NAL units, and coded slice data partitions C NAL units that refer (either directly or by association with a corresponding coded slice data partition A NAL unit) to the picture parameter set.
transform_8x8_mode_flag equal to 1 specifies that the 8x8 transform decoding process may be in use (see subclause REF _Ref81059569 \r \h 8.5). transform_8x8_mode_flag equal to 0 specifies that the 8x8 transform decoding process is not in use. When transform_8x8_mode_flag is not present, it shall be inferred to be 0.
pic_scaling_matrix_present_flag equal to 1 specifies that parameters are present to modify the scaling lists specified in the sequence parameter set. pic_scaling_matrix_present_flag equal to 0 specifies that the scaling lists used for the picture shall be inferred to be equal to those specified by the sequence parameter set. When pic_scaling_matrix_present_flag is not present, it shall be inferred to be equal to 0.
pic_scaling_list_present_flag[ i ] equal to 1 specifies that the scaling list syntax structure is present to specify the scaling list for index i. pic_scaling_list_present_flag[ i ] equal to 0 specifies that the syntax structure for scaling list i is not present in the picture parameter set and that depending on the value of seq_scaling_matrix_present_flag, the following applies.
– If seq_scaling_matrix_present_flag is equal to 0, the scaling list fall-back rule set A as specified in REF _Ref81058611 \h Table 72 shall be used to derive the picture-level scaling list for index i.
– Otherwise (seq_scaling_matrix_present_flag is equal to 1), the scaling list fall-back rule set B as specified in REF _Ref81058611 \h Table 72 shall be used to derive the picture-level scaling list for index i.
second_chroma_qp_index_offset specifies the offset that shall be added to QPY and QSY for addressing the table of QPC values for the Cr chroma component. The value of second_chroma_qp_index_offset shall be in the range of "12 to +12, inclusive.
When second_chroma_qp_index_offset is not present, it shall be inferred to be equal to chroma_qp_index_offset.
NOTE When ChromaArrayType is equal to 0, the values of bit_depth_chroma_minus8, chroma_qp_index_offset and second_chroma_qp_index_offset are not used in the decoding process. In particular, when separate_colour_plane_flag is equal to 1, each colour plane is decoded as a distinct monochrome picture using the luma component decoding process (except for the selection of scaling matrices), including the application of the luma quantisation parameter derivation process without application of an offset for the decoding of the pictures having colour_plane_id not equal to 0.
Supplemental enhancement information RBSP semantics
Supplemental Enhancement Information (SEI) contains information that is not necessary to decode the samples of coded pictures from VCL NAL units.
Supplemental enhancement information message semantics
An SEI RBSPNAL unit contains one or more SEI messages. Each SEI message consists of the variables specifying the type payloadType and size payloadSize of the SEI payload. SEI payloads are specified in Annex REF _Ref205008222 \r \h DD. The derived SEI payload size payloadSize is specified in bytes and shall be equal to the number of RBSP bytes in the SEI payload.
NOTE – Since the payload size of an SEI message is specified in RBSP bytes, the syntax elements emulation_prevention_three_byte that might be present in the NAL unit byte sequence containing the SEI message are not taken into account for specifying the size payloadSize of an SEI payload.
ff_byte is a byte equal to 0xFF identifying a need for a longer representation of the syntax structure that it is used within.
last_payload_type_byte is the last byte of the payload type of an SEI message.
last_payload_size_byte is the last byte of the payload size of an SEI message.
Access unit delimiter RBSP semantics
The access unit delimiter may be used to indicate the type of slices present in a primary coded picture and to simplify the detection of the boundary between access units. There is no normative decoding process associated with the access unit delimiter.
primary_pic_type indicates that the slice_type values for all slices of the primary coded picture are members of the set listed in REF _Ref19417281 \h Table 75 for the given value of primary_pic_type.
Table STYLEREF 1 \s 7 SEQ Table \* ARABIC \s 1 5 – Meaning of primary_pic_type
primary_pic_typeslice_type values that may be present in the primary coded picture02, 710, 2, 5, 720, 1, 2, 5, 6, 734, 943, 4, 8, 952, 4, 7, 960, 2, 3, 4, 5, 7, 8, 970, 1, 2, 3, 4, 5, 6, 7, 8, 9
End of sequence RBSP semantics
The end of sequence RBSP specifies that the next subsequent access unit in the bitstream in decoding order (if any) shall be an IDR access unit. The syntax content of the SODB and RBSP for the end of sequence RBSP are empty. No normative decoding process is specified for an end of sequence RBSP.
End of stream RBSP semantics
The end of stream RBSP indicates that no additional NAL units shall be present in the bitstream that are subsequent to the end of stream RBSP in decoding order. The syntax content of the SODB and RBSP for the end of stream RBSP are empty. No normative decoding process is specified for an end of stream RBSP.
NOTE – When an end of stream NAL unit is present, the bitstream is considered to end (for purposes of the scope of this Recommendation | International Standard). In some system environments, another bitstream may follow after the bitstream that has ended, either immediately or at some time thereafter, possibly within the same communication channel. Under such circumstances, the scope of this Recommendation | International Standard applies only to the processing of each of these individual bitstreams. No requirements are specified herein regarding the transition between such bitstreams (e.g., in regard to timing, buffering operation, etc.).
Filler data RBSP semantics
The filler data RBSP contains bytes whose value shall be equal to 0xFF. No normative decoding process is specified for a filler data RBSP.
ff_byte is a byte equal to 0xFF.
Slice layer without partitioning RBSP semantics
The slice layer without partitioning RBSP consists of a slice header and slice data.
Slice data partition RBSP semantics
Slice data partition A RBSP semantics
When slice data partitioning is in use, the coded data for a single slice is divided into three separate partitions. Slice data Ppartition A contains all syntax elements of category 2.
Category 2 syntax elements include all syntax elements in the slice header and slice data syntax structures other than the syntax elements in the residual( ) syntax structure.
slice_id identifies the slice associated with the slice data partition. The value of slice_id is constrained as follows.
– If separate_colour_plane_flag is equal to 0, the following applies.
– If arbitrary slice order is not allowed as specified in Annex REF _Ref36826677 \r \h AA, the first slice of a coded picture, in decoding order, shall have slice_id equal to 0 and the value of slice_id shall be incremented by one for each subsequent slice of the coded picture in decoding order.
– Otherwise (arbitrary slice order is allowed), each slice shall have a unique slice_id value within the set of slices of the coded picture.
– Otherwise (separate_colour_plane_flag is equal to 1), the following applies.
– If arbitrary slice order is not allowed as specified in Annex REF _Ref36826677 \r \h AA, the first slice of a coded picture having each value of colour_plane_id, in decoding order, shall have slice_id equal to 0 and the value of slice_id shall be incremented by one for each subsequent slice of the coded picture having the same value of colour_plane_id, in decoding order.
– Otherwise (arbitrary slice order is allowed) each slice shall have a unique slice_id value within each set of slices of the coded picture that have the same value of colour_plane_id.
The range of slice_id is specified as follows.
– If MbaffFrameFlag is equal to 0, slice_id shall be in the range of 0 to PicSizeInMbs " 1, inclusive.
Otherwise (MbaffFrameFlag is equal to 1), slice_id shall be in the range of 0 to PicSizeInMbs / 2 " 1, inclusive.
Slice data partition B RBSP semantics
When slice data partitioning is in use, the coded data for a single slice is divided into one to three separate partitions. Slice data partition B contains all syntax elements of category 3.
Category 3 syntax elements include all syntax elements in the residual( ) syntax structure and in syntax structures used within that syntax structure for collective macroblock types I and SI as specified in REF _Ref81060083 \h Table 710.
slice_id has the same semantics as specified in subclause REF _Ref32807385 \r \h 7.4.2.9.1.
colour_plane_id specifies the colour plane associated with the current slice RBSP when separate_colour_plane_flag is equal to 1. The value of colour_plane_id shall be in the range of 0 to 2, inclusive. colour_plane_id equal to 0, 1, and 2 correspond to the Y, Cb, and Cr planes, respectively.
NOTE – There is no dependency between the decoding processes of pictures having different values of colour_plane_id.
redundant_pic_cnt shall be equal to 0 for coded slices and coded slice data partitions belonging to the primary coded picture. The redundant_pic_cnt shall be greater than 0 for coded slices and coded slice data partitions in redundant coded pictures. When redundant_pic_cnt is not present, its value shall be inferred to be equal to 0. The value of redundant_pic_cnt shall be in the range of 0 to 127, inclusive.
The presence of a slice data partition B RBSP is specified as follows.
– If the syntax elements of a slice data partition A RBSP indicate the presence of any syntax elements of category 3 in the slice data for a slice, a slice data partition B RBSP shall be present having the same value of slice_id and redundant_pic_cnt as in the slice data partition A RBSP.
– Otherwise (the syntax elements of a slice data partition A RBSP do not indicate the presence of any syntax elements of category 3 in the slice data for a slice), no slice data partition B RBSP shall be present having the same value of slice_id and redundant_pic_cnt as in the slice data partition A RBSP.
Slice data partition C RBSP semantics
When slice data partitioning is in use, the coded data for a single slice is divided into three separate partitions. Slice data partition C contains all syntax elements of category 4.
Category 4 syntax elements include all syntax elements in the residual( ) syntax structure and in syntax structures used within that syntax structure for collective macroblock types P and B as specified in REF _Ref81060083 \h Table 710.
slice_id has the same semantics as specified in subclause REF _Ref32807385 \r \h 7.4.2.9.1.
colour_plane_id has the same semantics as specified in subclause REF _Ref32807498 \r \h 7.4.2.9.2.
redundant_pic_cnt has the same semantics as specified in subclause REF _Ref32807498 \r \h 7.4.2.9.2.
The presence of a slice data partition C RBSP is specified as follows.
– If the syntax elements of a slice data partition A RBSP indicate the presence of any syntax elements of category 4 in the slice data for a slice, a slice data partition C RBSP shall be present having the same value of slice_id and redundant_pic_cnt as in the slice data partition A RBSP.
– Otherwise (the syntax elements of a slice data partition A RBSP do not indicate the presence of any syntax elements of category 4 in the slice data for a slice), no slice data partition C RBSP shall be present having the same value of slice_id and redundant_pic_cnt as in the slice data partition A RBSP.
RBSP slice trailing bits semantics
cabac_zero_word is a byte-aligned sequence of two bytes equal to 0x0000.
Let NumBytesInVclNALunits be the sum of the values of NumBytesInNALunit for all VCL NAL units of a coded picture.
Let BinCountsInNALunits be the number of times that the parsing process function DecodeBin( ), specified in subclause REF _Ref24877878 \r \h 9.3.3.2, is invoked to decode the contents of all VCL NAL units of a coded picture. When entropy_coding_mode_flag is equal to 1, BinCountsInNALunits shall not exceed ( 32 ÷ 3 ) * NumBytesInVclNALunits + ( RawMbBits * PicSizeInMbs ) ( 32.
NOTE – The constraint on the maximum number of bins resulting from decoding the contents of the slice layer NAL units can be met by inserting a number of cabac_zero_word syntax elements to increase the value of NumBytesInVclNALunits. Each cabac_zero_word is represented in a NAL unit by the three-byte sequence 0x000003 (as a result of the constraints on NAL unit contents that result in requiring inclusion of an emulation_prevention_three_byte for each cabac_zero_word).
RBSP trailing bits semantics
rbsp_stop_one_bit shall be equal to 1.
rbsp_alignment_zero_bit shall be equal to 0.
Slice header semantics
When present, the value of the slice header syntax elements pic_parameter_set_id, frame_num, field_pic_flag, bottom_field_flag, idr_pic_id, pic_order_cnt_lsb, delta_pic_order_cnt_bottom, delta_pic_order_cnt[ 0 ], delta_pic_order_cnt[ 1 ], sp_for_switch_flag, and slice_group_change_cycle shall be the same in all slice headers of a coded picture.
first_mb_in_slice specifies the address of the first macroblock in the slice. When arbitrary slice order is not allowed as specified in Annex REF _Ref36826677 \r \h AA, the value of first_mb_in_slice is constrained as follows.
– If separate_colour_plane_flag is equal to 0, the value of first_mb_in_slice shall not be less than the value of first_mb_in_slice for any other slice of the current picture that precedes the current slice in decoding order.
– Otherwise (separate_colour_plane_flag is equal to 1), the value of first_mb_in_slice shall not be less than the value of first_mb_in_slice for any other slice of the current picture that precedes the current slice in decoding order and has the same value of colour_plane_id.
The first macroblock address of the slice is derived as follows.
– If MbaffFrameFlag is equal to 0, first_mb_in_slice is the macroblock address of the first macroblock in the slice, and first_mb_in_slice shall be in the range of 0 to PicSizeInMbs –" 1, inclusive.
Otherwise (MbaffFrameFlag is equal to 1), first_mb_in_slice * 2 is the macroblock address of the first macroblock in the slice, which is the top macroblock of the first macroblock pair in the slice, and first_mb_in_slice shall be in the range of 0 to PicSizeInMbs / 2 " 1, inclusive.
slice_type specifies the coding type of the slice according to REF _Ref29813246 \h \* MERGEFORMAT Table 76.
Table STYLEREF 1 \s 7 SEQ Table \* ARABIC \s 1 6 Name association to slice_type
slice_typeName of slice_type0P (P slice)1B (B slice)2I (I slice)3SP (SP slice)4SI (SI slice)5P (P slice)6B (B slice)7I (I slice)8SP (SP slice)9SI (SI slice)
slice_type values in the range 5..9 specify, in addition to the coding type of the current slice, that all other slices of the current coded picture shall have a value of slice_type equal to the current value of slice_type or equal to the current value of slice_type –" 5.
When nal_unit_type is equal to 5 (IDR picture), slice_type shall be equal to 2, 4, 7, or 9.
When max_num_ref_frames is equal to 0, slice_type shall be equal to 2, 4, 7, or 9.
pic_parameter_set_id specifies the picture parameter set in use. The value of pic_parameter_set_id shall be in the range of 0 to 255, inclusive.
colour_plane_id specifies the colour plane associated with the current slice RBSP when separate_colour_plane_flag is equal to 1. The value of colour_plane_id shall be in the range of 0 to 2, inclusive. colour_plane_id equal to 0, 1, and 2 correspond to the Y, Cb, and Cr planes, respectively.
NOTE 1 – There is no dependency between the decoding processes of pictures having different values of colour_plane_id.
frame_num is used as an identifier for pictures and shall be represented by log2_max_frame_num_minus4 + 4 bits in the bitstream. frame_num is constrained as follows:
The variable PrevRefFrameNum is derived as follows.
– If the current picture is an IDR picture, PrevRefFrameNum is set equal to 0.
– Otherwise (the current picture is not an IDR picture), PrevRefFrameNum is set as follows.
– If the decoding process for gaps in frame_num specified in subclause REF _Ref31614329 \r \h 8.2.5.2 was invoked by the decoding process for an access unit that contained a non-reference picture that followed the previous access unit in decoding order that contained a reference picture, PrevRefFrameNum is set equal to the value of frame_num for the last of the "non-existing" reference frames inferred by the decoding process for gaps in frame_num specified in subclause REF _Ref31614329 \r \h 8.2.5.2.
– Otherwise, PrevRefFrameNum is set equal to the value of frame_num for the previous access unit in decoding order that contained a reference picture.
The value of frame_num is constrained as follows.
– If the current picture is an IDR picture, frame_num shall be equal to 0.
– Otherwise (the current picture is not an IDR picture), referring to the primary coded picture in the previous access unit in decoding order that contains a reference picture as the preceding reference picture, the value of frame_num for the current picture shall not be equal to PrevRefFrameNum unless all of the following three conditions are true:.
– tThe current picture and the preceding reference picture belong to consecutive access units in decoding order.
– tThe current picture and the preceding reference picture are reference fields having opposite parity.
– oOne or more of the following conditions is true:
– tThe preceding reference picture is an IDR picture,
– tThe preceding reference picture includes a memory_management_control_operation syntax element equal to 5,
NOTE 2 – When the preceding reference picture includes a memory_management_control_operation syntax element equal to 5, PrevRefFrameNum is equal to 0.
– tThere is a primary coded picture that precedes the preceding reference picture and the primary coded picture that precedes the preceding reference picture does not have frame_num equal to PrevRefFrameNum,
– tThere is a primary coded picture that precedes the preceding reference picture and the primary coded picture that precedes the preceding reference picture is not a reference picture.
When the value of frame_num is not equal to PrevRefFrameNum, it is a requirement of bitstream conformance that the following constraints shall be obeyed:applies.
– There shall not be any previous field or frame in decoding order that is currently marked as "used for short-term reference" that has a value of frame_num equal to any value taken on by the variable UnusedShortTermFrameNum in the following:
UnusedShortTermFrameNum = ( PrevRefFrameNum + 1 ) % MaxFrameNumwhile( UnusedShortTermFrameNum != frame_num ) ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 23) UnusedShortTermFrameNum = ( UnusedShortTermFrameNum + 1 ) % MaxFrameNum
– The value of frame_num is constrained as follows.
– If gaps_in_frame_num_value_allowed_flag is equal to 0, the value of frame_num for the current picture shall be equal to ( PrevRefFrameNum + 1 ) % MaxFrameNum.
– Otherwise (gaps_in_frame_num_value_allowed_flag is equal to 1), the following applies.
– If frame_num is greater than PrevRefFrameNum, there shall not be any non-reference pictures in the bitstream that follow the previous reference picture and precede the current picture in decoding order in which either of the following conditions is true:.
– The value of frame_num for the non-reference picture is less than PrevRefFrameNum,.
– The value of frame_num for the non-reference picture is greater than the value of frame_num for the current picture.
– Otherwise (frame_num is less than PrevRefFrameNum), there shall not be any non-reference pictures in the bitstream that follow the previous reference picture and precede the current picture in decoding order in which both of the following conditions are true:.
– The value of frame_num for the non-reference picture is less than PrevRefFrameNum,.
– The value of frame_num for the non-reference picture is greater than the value of frame_num for the current picture.
A picture including a memory_management_control_operation equal to 5 shall have frame_num constraints as described above and, after the decoding of the current picture and the processing of the memory management control operations, the picture shall be inferred to have had frame_num equal to 0 for all subsequent use in the decoding process, except as specified in subclause REF _Ref58252101 \r \h 7.4.1.2.4.
NOTE 3 – When the primary coded picture is not an IDR picture and does not contain memory_management_control_operation syntax element equal to 5, the value of frame_num of a corresponding redundant coded picture is the same as the value of frame_num in the primary coded picture. Alternatively, the redundant coded picture includes a memory_management_control_operation syntax element equal to 5 and the corresponding primary coded picture is an IDR picture.
field_pic_flag equal to 1 specifies that the slice is a slice of a coded field. field_pic_flag equal to 0 specifies that the slice is a slice of a coded frame. When field_pic_flag is not present it shall be inferred to be equal to 0.
The variable MbaffFrameFlag is derived as follows.
MbaffFrameFlag = ( mb_adaptive_frame_field_flag && !field_pic_flag ) ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 24)
The variable for the picture height in units of macroblocks is derived as follows
PicHeightInMbs = FrameHeightInMbs / ( 1 + field_pic_flag ) ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 25)
The variable for picture height for the luma component is derived as follows
PicHeightInSamplesL = PicHeightInMbs * 16 ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 26)
The variable for picture height for the chroma component is derived as follows
PicHeightInSamplesC = PicHeightInMbs * MbHeightC ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 27)
The variable PicSizeInMbs for the current picture is derived asaccording to:
PicSizeInMbs = PicWidthInMbs * PicHeightInMbs ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 28)
The variable MaxPicNum is derived as follows.
– If field_pic_flag is equal to 0, MaxPicNum is set equal to MaxFrameNum.
– Otherwise (field_pic_flag is equal to 1), MaxPicNum is set equal to 2*MaxFrameNum.
The variable CurrPicNum is derived as follows.
– If field_pic_flag is equal to 0, CurrPicNum is set equal to frame_num.
– Otherwise (field_pic_flag is equal to 1), CurrPicNum is set equal to 2 * frame_num + 1.
bottom_field_flag equal to 1 specifies that the slice is part of a coded bottom field. bottom_field_flag equal to 0 specifies that the picture is a coded top field. When this syntax element is not present for the current slice, it shall be inferred to be equal to 0.
idr_pic_id identifies an IDR picture. The values of idr_pic_id in all the slices of an IDR picture shall remain unchanged. When two consecutive access units in decoding order are both IDR access units, the value of idr_pic_id in the slices of the first such IDR access unit shall differ from the idr_pic_id in the second such IDR access unit. The value of idr_pic_id shall be in the range of 0 to 65535, inclusive.
pic_order_cnt_lsb specifies the picture order count modulo MaxPicOrderCntLsb for the top field of a coded frame or for a coded field. The lengthsize of the pic_order_cnt_lsb syntax element is log2_max_pic_order_cnt_lsb_minus4 + 4 bits. The value of the pic_order_cnt_lsb shall be in the range of 0 to MaxPicOrderCntLsb " 1, inclusive.
delta_pic_order_cnt_bottom specifies the picture order count difference between the bottom field and the top field of a coded frame as follows.
If the current picture includes a memory_management_control_operation equal to 5, the value of delta_pic_order_cnt_bottom shall be in the range of ( 1 " MaxPicOrderCntLsb ) to 231 " 1, inclusive.
Otherwise (the current picture does not include a memory_management_control_operation equal to 5), the value of delta_pic_order_cnt_bottom shall be in the range of "231 to 231 " 1, inclusive.
When this syntax element is not present in the bitstream for the current slice, it shall be inferred to be equal to 0.
delta_pic_order_cnt[ 0 ] specifies the picture order count difference from the expected picture order count for the top field of a coded frame or for a coded field as specified in subclause REF _Ref19429280 \r \h 8.2.1. The value of delta_pic_order_cnt[ 0 ] shall be in the range of -"231 to 231 " 1, inclusive. When this syntax element is not present in the bitstream for the current slice, it shall be inferred to be equal to 0.
delta_pic_order_cnt[ 1 ] specifies the picture order count difference from the expected picture order count for the bottom field of a coded frame specified in subclause REF _Ref19429280 \r \h 8.2.1. The value of delta_pic_order_cnt[ 1 ] shall be in the range of -"231 to 231 -" 1, inclusive. When this syntax element is not present in the bitstream for the current slice, it shall be inferred to be equal to 0.
redundant_pic_cnt shall be equal to 0 for slices and slice data partitions belonging to the primary coded picture. The value of redundant_pic_cnt shall be greater than 0 for coded slices or coded slice data partitions of a redundant coded picture. When redundant_pic_cnt is not present in the bitstream, its value shall be inferred to be equal to 0. The value of redundant_pic_cnt shall be in the range of 0 to 127, inclusive.
NOTE 4 – Any area of the decoded primary picture and the corresponding area that would result from application of the decoding process specified in clause REF _Ref41631640 \r \h 8 for any redundant picture in the same access unit should be visually similar in appearance.
The value of pic_parameter_set_id in a coded slice or coded slice data partition of a redundant coded picture shall be such that the value of bottom_field_pic_order_in_frame_present_flagpic_order_present_flag in the picture parameter set in use in a redundant coded picture is equal to the value of bottom_field_pic_order_in_frame_present_flagpic_order_present_flag in the picture parameter set in use in the corresponding primary coded picture.
When present in the primary coded picture and any redundant coded picture, the following syntax elements shall have the same value: field_pic_flag, bottom_field_flag, and idr_pic_id.
When the value of nal_ref_idc in one VCL NAL unit of an access unit is equal to 0, the value of nal_ref_idc in all other VCL NAL units of the same access unit shall be equal to 0.
NOTE 5 – The above constraint also has the following implications. If the value of nal_ref_idc for the VCL NAL units of the primary coded picture is equal to 0, the value of nal_ref_idc for the VCL NAL units of any corresponding redundant coded picture are equal to 0; otherwise (the value of nal_ref_idc for the VCL NAL units of the primary coded picture is greater than 0), the value of nal_ref_idc for the VCL NAL units of any corresponding redundant coded picture are also greater than 0.
The marking status of reference pictures and the value of frame_num after the decoded reference picture marking process as specified in subclause REF _Ref31080465 \r \h 8.2.5 is invoked for the primary coded picture or any redundant coded picture of the same access unit shall be identical regardless whether the primary coded picture or any redundant coded picture (instead of the primary coded picture) of the access unit would be decoded.
NOTE 6 – The above constraint also has the following implications.
If a primary coded picture is not an IDR picture, the contents of the dec_ref_pic_marking( ) syntax structure must be identical in all slice headers of the primary coded picture and all redundant coded pictures corresponding to the primary coded picture.
Otherwise (a primary coded picture is an IDR picture), the following applies.
When the primary coded picture is an IDR picture and If a redundant coded picture corresponding to the primary coded picture is an IDR picture, the contents of the dec_ref_pic_marking( ) syntax structure must be identical in all slice headers of the primary coded picture and the redundant coded picture corresponding to the primary coded picture.
When the primary coded picture is an IDR picture and Otherwise (a redundant coded picture corresponding to the primary coded picture is not an IDR picture), all slice headers of the redundant picture must contain a dec_ref_pic_marking syntax( ) structure including a memory_management_control_operation syntax element equal to 5, and the following applies.
– If the value of long_term_reference_flag in the primary coded picture is equal to 0, the dec_ref_pic_marking syntax structure of the redundant coded picture must not include a memory_management_control_operation syntax element equal to 6.
– Otherwise (the value of long_term_reference_flag in the primary coded picture is equal to 1), the dec_ref_pic_marking syntax structure of the redundant coded picture must include memory_management_control_operation syntax elements equal to 5, 4, and 6 in decoding order, and the value of max_long_term_frame_idx_plus1 must be equal to 1, and the value of long_term_frame_idx must be equal to 0.
The values of TopFieldOrderCnt and BottomFieldOrderCnt (if applicable) that result after completion of the decoding process for any redundant coded picture or the primary coded picture of the same access unit shall be identical regardless whether the primary coded picture or any redundant coded picture (instead of the primary coded picture) of the access unit would be decoded.
There is no required decoding process for a coded slice or coded slice data partition of a redundant coded picture. When the redundant_pic_cnt in the slice header of a coded slice is greater than 0, the decoder may discard the coded slice. However, a coded slice or coded slice data partition of any redundant coded picture shall obey the same constraints as a coded slice or coded slice data partition of a primary picture.
NOTE 7 – When some of the samples in the decoded primary picture cannot be correctly decoded due to errors or losses in transmission of the sequence and a coded redundant slice can be correctly decoded, the decoder should replace the samples of the decoded primary picture with the corresponding samples of the decoded redundant slice. When more than one redundant slice covers the relevant region of the primary picture, the redundant slice having the lowest value of redundant_pic_cnt should be used.
Redundant slices and slice data partitions having the same value of redundant_pic_cnt belong to the same redundant picture. Decoded slices within the same redundant picture need not cover the entire picture area and shall not overlap.
direct_spatial_mv_pred_flag specifies the method used in the decoding process to derive motion vectors and reference indices for inter prediction as follows.
– If direct_spatial_mv_pred_flag is equal to 1, the derivation process for luma motion vectors for B_Skip, B_Direct_16x16, and B_Direct_8x8 in subclause REF _Ref32808271 \r \h 8.4.1.2 shall use spatial direct mode prediction as specified in subclause REF _Ref32741335 \r \h 8.4.1.2.2.
– Otherwise (direct_spatial_mv_pred_flag is equal to 0), the derivation process for luma motion vectors for B_Skip, B_Direct_16x16, and B_Direct_8x8 in subclause REF _Ref32808271 \r \h 8.4.1.2 shall use temporal direct mode prediction as specified in subclause REF _Ref23667460 \r \h 8.4.1.2.3.
num_ref_idx_active_override_flag equal to 1 specifies that the syntax element num_ref_idx_l0_active_minus1 is present for P, SP, and B slices and that the syntax element num_ref_idx_l1_active_minus1 is present for B slices. 0 specifies that the values of the syntax elements num_ref_idx_l0_active_minus1 and num_ref_idx_l1_active_minus1 specified in the referred picture parameter set are in effect. num_ref_idx_active_override_flag equal to 1 specifies that the num_ref_idx_l0_active_minus1 and num_ref_idx_l1_active_minus1 specified in the referred picture parameter set are overridden for the current slice (and only for the current slice) by the following values in the slice header. num_ref_idx_active_override_flag equal to 0 specifies that the syntax elements num_ref_idx_l0_active_minus1 and num_ref_idx_l1_active_minus1 are not present.
When the current slice is a P, SP, or B slice and field_pic_flag is equal to 0 and the value of num_ref_idx_l0_default_active_minus1 in the picture parameter set exceeds 15, num_ref_idx_active_override_flag shall be equal to 1.
When the current slice is a B slice and field_pic_flag is equal to 0 and the value of num_ref_idx_l1_default_active_minus1 in the picture parameter set exceeds 15, num_ref_idx_active_override_flag shall be equal to 1.
num_ref_idx_l0_active_minus1 specifies the maximum reference index for reference picture list 0 that shall be used to decode the slice.
When the current slice is a P, SP, or B slice and num_ref_idx_l0_active_minus1 is not present, num_ref_idx_l0_active_minus1 shall be inferred to be equal to num_ref_idx_l0_default_active_minus1.
The range of num_ref_idx_l0_active_minus1 is specified as follows.
– If field_pic_flag is equal to 0, num_ref_idx_l0_active_minus1 shall be in the range of 0 to 15, inclusive. When MbaffFrameFlag is equal to 1, num_ref_idx_l0_active_minus1 is the maximum index value for the decoding of frame macroblocks and 2 * num_ref_idx_l0_active_minus1 + 1 is the maximum index value for the decoding of field macroblocks.
– Otherwise (field_pic_flag is equal to 1), num_ref_idx_l0_active_minus1 shall be in the range of 0 to 31, inclusive.
num_ref_idx_l1_active_minus1 specifies the maximum reference index for reference picture list 1 that shall be used to decode the slice.
When the current slice is a B slice and num_ref_idx_l1_active_minus1 is not present, num_ref_idx_l1_active_minus1 shall be inferred to be equal to num_ref_idx_l1_default_active_minus1.
The range of num_ref_idx_l1_active_minus1 is constrained as specified in has the same semantics foras num_ref_idx_l0_active_minus1 with l0 and list 0 replaced by l1 and list 1, respectively.
cabac_init_idc specifies the index for determining the initialisation table used in the initialisation process for context variables. The value of cabac_init_idc shall be in the range of 0 to 2, inclusive.
slice_qp_delta specifies the initial value of QPY to be used for all the macroblocks in the slice until modified by the value of mb_qp_delta in the macroblock layer. The initial QPY quantisation parameter for the slice is computed as:
SliceQPY = 26 + pic_init_qp_minus26 + slice_qp_delta ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 29)
The value of slice_qp_delta shall be limited such that SliceQPY is in the range of -"QpBdOffsetY to +51, inclusive.
sp_for_switch_flag specifies the decoding process to be used to decode P macroblocks in an SP slice as follows.
– If sp_for_switch_flag is equal to 0, the P macroblocks in the SP slice shall be decoded using the SP decoding process for non-switching pictures as specified in subclause REF _Ref32808389 \r \h 8.6.1.
– Otherwise (sp_for_switch_flag is equal to 1), the P macroblocks in the SP slice shall be decoded using the SP and SI decoding process for switching pictures as specified in subclause REF _Ref32808391 \r \h 8.6.2.
slice_qs_delta specifies the value of QSY for all the macroblocks in SP and SI slices. The QSY quantisation parameter for the slice is computed as:
QSY = 26 + pic_init_qs_minus26 + slice_qs_delta ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 30)
The value of slice_qs_delta shall be limited such that QSY is in the range of 0 to 51, inclusive. This value of QSY is used for the decoding of all macroblocks in SI slices with mb_type equal to SI and all macroblocks in SP slices that are codedwith in an Inter macroblock prediction mode equal to inter.
disable_deblocking_filter_idc specifies whether the operation of the deblocking filter shall be disabled across some block edges of the slice and specifies for which edges the filtering is disabled. When disable_deblocking_filter_idc is not present in the slice header, the value of disable_deblocking_filter_idc shall be inferred to be equal to 0.
The value of disable_deblocking_filter_idc shall be in the range of 0 to 2, inclusive.
slice_alpha_c0_offset_div2 specifies the offset used in accessing the ± and tC0 deblocking filter tables for filtering operations controlled by the macroblocks within the slice. From this value, the offset that shall be applied when addressing these tables shall be computed as:
FilterOffsetA = slice_alpha_c0_offset_div2 << 1 ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 31)
The value of slice_alpha_c0_offset_div2 shall be in the range of -"6 to +6, inclusive. When slice_alpha_c0_offset_div2 is not present in the slice header, the value of slice_alpha_c0_offset_div2 shall be inferred to be equal to 0.
slice_beta_offset_div2 specifies the offset used in accessing the ² deblocking filter table for filtering operations controlled by the macroblocks within the slice. From this value, the offset that is applied when addressing the ² table of the deblocking filter shall be computed as:
FilterOffsetB = slice_beta_offset_div2 << 1 ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 32)
The value of slice_beta_offset_div2 shall be in the range of -"6 to +6, inclusive. When slice_beta_offset_div2 is not present in the slice header the value of slice_beta_offset_div2 shall be inferred to be equal to 0.
slice_group_change_cycle is used to derive the number of slice group map units in slice group 0 when slice_group_map_type is equal to 3, 4, or 5, as specified by
MapUnitsInSliceGroup0 = Min( slice_group_change_cycle * SliceGroupChangeRate, PicSizeInMapUnits ) ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 33)
The value of slice_group_change_cycle is represented in the bitstream by the following number of bits
Ceil( Log2( PicSizeInMapUnits ( SliceGroupChangeRate + 1 ) ) ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 34)
The value of slice_group_change_cycle shall be in the range of 0 to Ceil( PicSizeInMapUnits(SliceGroupChangeRate ), inclusive.
Reference picture list reordering modification semantics
The syntax elements modificationreordering_of_pic_nums_idc, abs_diff_pic_num_minus1, and long_term_pic_num specify the change from the initial reference picture lists to the reference picture lists to be used for decoding the slice.
ref_pic_list_reorderingmodification_flag_l0 equal to 1 specifies that the syntax element reorderingmodification_of_pic_nums_idc is present for specifying reference picture list 0. ref_pic_list_modificationreordering_flag_l0 equal to 0 specifies that this syntax element is not present.
When ref_pic_list_modificationreordering_flag_l0 is equal to 1, the number of times that modificationreordering_of_pic_nums_idc is not equal to 3 following ref_pic_list_modificationreordering_flag_l0 shall not exceed num_ref_idx_l0_active_minus1 + 1.
When RefPicList0[ num_ref_idx_l0_active_minus1 ] in the initial reference picture list produced as specified in subclause REF _Ref31614179 \r \h 8.2.4.2 is equal to "no reference picture", ref_pic_list_modificationreordering_flag_l0 shall be equal to 1 and modificationreordering_of_pic_nums_idc shall not be equal to 3 until RefPicList0[ num_ref_idx_l0_active_minus1 ] in the reordered modified list produced as specified in subclause REF _Ref31093198 \r \h 8.2.4.3 is not equal to "no reference picture".
ref_pic_list_reorderingmodification_flag_l1 equal to 1 specifies that the syntax element modificationreordering_of_pic_nums_idc is present for specifying reference picture list 1. ref_pic_list_modificationreordering_flag_l1 equal to 0 specifies that this syntax element is not present.
When ref_pic_list_modificationreordering_flag_l1 is equal to 1, the number of times that modificationreordering_of_pic_nums_idc is not equal to 3 following ref_pic_list_modificationreordering_flag_l1 shall not exceed num_ref_idx_l1_active_minus1 + 1.
When decoding a slice with slice_type equal to 1 or 6 and RefPicList1[ num_ref_idx_l1_active_minus1 ] in the initial reference picture list produced as specified in subclause REF _Ref31614179 \r \h 8.2.4.2 is equal to "no reference picture", ref_pic_list_modificationreordering_flag_l1 shall be equal to 1 and modificationreordering_of_pic_nums_idc shall not be equal to 3 until RefPicList1[ num_ref_idx_l1_active_minus1 ] in the reordered modified list produced as specified in subclause REF _Ref31093198 \r \h 8.2.4.3 is not equal to "no reference picture".
reorderingmodification_of_pic_nums_idc together with abs_diff_pic_num_minus1 or long_term_pic_num specifies which of the reference pictures are re-mapped. The values of modificationreordering_of_pic_nums_idc are specified in REF _Ref19417368 \h Table 77. The value of the first modificationreordering_of_pic_nums_idc that follows immediately after ref_pic_list_modificationreordering_flag_l0 or ref_pic_list_modificationreordering_flag_l1 shall not be equal to 3.
Table STYLEREF 1 \s 7 SEQ Table \* ARABIC \s 1 7 – reorderingmodification_of_pic_nums_idc operations for reordering modification of reference picture lists
reorderingmodification_of_pic_nums_idcReordering modification specified0abs_diff_pic_num_minus1 is present and corresponds to a difference to subtract from a picture number prediction value1abs_diff_pic_num_minus1 is present and corresponds to a difference to add to a picture number prediction value2long_term_pic_num is present and specifies the long-term picture number for a reference picture3End loop for reordering modification of the initial reference picture list
abs_diff_pic_num_minus1 plus 1 specifies the absolute difference between the picture number of the picture being moved to the current index in the list and the picture number prediction value. abs_diff_pic_num_minus1 shall be in the range of 0 to MaxPicNum –" 1. The allowed values of abs_diff_pic_num_minus1 are further restricted as specified in subclause REF _Ref31614059 \r \h 8.2.4.3.1.
long_term_pic_num specifies the long-term picture number of the picture being moved to the current index in the list. When decoding a coded frame, long_term_pic_num shall be equal to a LongTermPicNum assigned to one of the reference frames or complementary reference field pairs marked as "used for long-term reference". When decoding a coded field, long_term_pic_num shall be equal to a LongTermPicNum assigned to one of the reference fields marked as "used for long-term reference".
Prediction weight table semantics
luma_log2_weight_denom is the base 2 logarithm of the denominator for all luma weighting factors. The value of luma_log2_weight_denom shall be in the range of 0 to 7, inclusive.
chroma_log2_weight_denom is the base 2 logarithm of the denominator for all chroma weighting factors. The value of chroma_log2_weight_denom shall be in the range of 0 to 7, inclusive.
luma_weight_l0_flag equal to 1 specifies that weighting factors for the luma component of list 0 prediction are present. luma_weight_l0_flag equal to 0 specifies that these weighting factors are not present.
luma_weight_l0[ i ] is the weighting factor applied to the luma prediction value for list 0 prediction using RefPicList0[ i ]. When luma_weight_l0_flag is equal to 1, the value of luma_weight_l0[ i ] shall be in the range of "128 to 127, inclusive. When luma_weight_l0_flag is equal to 0, luma_weight_l0[ i ] shall be inferred to be equal to 2luma_log2_weight_denom for RefPicList0[ i ].
luma_offset_l0[ i ] is the additive offset applied to the luma prediction value for list 0 prediction using RefPicList0[ i ]. The value of luma_offset_l0[ i ] shall be in the range of –"128 to 127, inclusive. When luma_weight_l0_flag is equal to 0, luma_offset_l0[ i ] shall be inferred as equal to 0 for RefPicList0[ i ].
chroma_weight_l0_flag equal to 1 specifies that weighting factors for the chroma prediction values of list 0 prediction are present. chroma_weight_l0_flag equal to 0 specifies that these weighting factors are not present.
chroma_weight_l0[ i ][ j ] is the weighting factor applied to the chroma prediction values for list 0 prediction using RefPicList0[ i ] with j equal to 0 for Cb and j equal to 1 for Cr. When chroma_weight_l0_flag is equal to 1, the value of chroma_weight_l0[ i ][ j ] shall be in the range of –"128 to 127, inclusive. When chroma_weight_l0_flag is equal to 0, chroma_weight_l0[ i ][ j ] shall be inferred to be equal to 2chroma_log2_weight_denom for RefPicList0[ i ].
chroma_offset_l0[ i ][ j ] is the additive offset applied to the chroma prediction values for list 0 prediction using RefPicList0[ i ] with j equal to 0 for Cb and j equal to 1 for Cr. The value of chroma_offset_l0[ i ][ j ] shall be in the range of -"128 to 127, inclusive. When chroma_weight_l0_flag is equal to 0, chroma_offset_l0[ i ][ j ] shall be inferred to be equal to 0 for RefPicList0[ i ].
luma_weight_l1_flag, luma_weight_l1, luma_offset_l1, chroma_weight_l1_flag, chroma_weight_l1, chroma_offset_l1 have the same semantics as luma_weight_l0_flag, luma_weight_l0, luma_offset_l0, chroma_weight_l0_flag, chroma_weight_l0, chroma_offset_l0, respectively, with l0, list 0, and List0 replaced by l1, list 1, and List1, respectively.
Decoded reference picture marking semantics
The syntax elements no_output_of_prior_pics_flag, long_term_reference_flag, adaptive_ref_pic_marking_mode_flag, memory_management_control_operation, difference_of_pic_nums_minus1, long_term_frame_idx, long_term_pic_num, and max_long_term_frame_idx_plus1 specify marking of the reference pictures.
The marking of a reference picture can be "unused for reference", "used for short-term reference", or "used for long-term reference", but only one among these three. When a reference picture is referred to as being marked as "used for reference", this collectively refers to the picture being marked as "used for short-term reference" or "used for long-term reference" (but not both). A reference picture that is marked as "used for short-term reference" is referred to as a short-term reference picture. A reference picture that is marked as "used for long-term reference" is referred to as a long-term reference picture.
The syntax element adaptive_ref_pic_marking_mode_flag and the content of the decoded reference picture marking syntax structure shall be identical the same infor all coded slice headers of athe primary coded picture. When one or more redundant coded pictures are present, the content of the decoded reference picture marking syntax structure shall be the same in all slice headers of a redundant coded picture with a particular value of redundant_pic_cnt.
NOTE 1 – It is not required that the content of the decoded reference picture marking syntax structure in a redundant coded picture with a particular value of redundant_pic_cnt is identical to the content of the decoded reference picture marking syntax structure in the corresponding primary coded picture or a redundant coded picture with a different value of redundant_pic_cnt. However, as specified in subclause REF _Ref29724216 \r \h 7.4.3, the content of the decoded reference picture marking syntax structure in a redundant coded picture is constrained in the way that the marking status of reference pictures and the value of frame_num after the decoded reference picture marking process in subclause REF _Ref31080465 \r \h 8.2.5 shallmust be identical regardless whether the primary coded picture or any redundant coded picture of the access unit would be decoded.
The syntax category of the decoded reference picture marking syntax structure shall be inferred as follows.
– If the decoded reference picture marking syntax structure is in a slice header, the syntax category of the decoded reference picture marking syntax structure shall beis inferred to be equal to 2.
– Otherwise (the decoded reference picture marking syntax structure is in a decoded reference picture marking repetition SEI message as specified in Annex REF _Ref41737026 \r \h D), the syntax category of the decoded reference picture marking syntax structure shall beis inferred to be equal to 5.
no_output_of_prior_pics_flag specifies how the previously-decoded pictures in the decoded picture buffer are treated after decoding of an IDR picture. See Annex REF _Ref36858705 \r \h CC. When the IDR picture is the first IDR picture in the bitstream, the value of no_output_of_prior_pics_flag has no effect on the decoding process. When the IDR picture is not the first IDR picture in the bitstream and the value of PicWidthInMbs, FrameHeightInMbs, or max_dec_frame_buffering derived from the active sequence parameter set is different from the value of PicWidthInMbs, FrameHeightInMbs, or max_dec_frame_buffering derived from the sequence parameter set active for the preceding picture, no_output_of_prior_pics_flag equal to 1 may (but should not) be inferred by the decoder, regardless of the actual value of no_output_of_prior_pics_flag.
long_term_reference_flag equal to 0 specifies that the MaxLongTermFrameIdx variable is set equal to “"no long-term frame indices”" and that the IDR picture is marked as “"used for short-term reference”". long_term_reference_flag equal to 1 specifies that the MaxLongTermFrameIdx variable is set equal to 0 and that the current IDR picture is marked “"used for long-term reference”" and is assigned LongTermFrameIdx equal to 0. When max_num_ref_frames is equal to 0, long_term_reference_flag shall be equal to 0.
adaptive_ref_pic_marking_mode_flag selects the reference picture marking mode of the currently decoded picture as specified in REF _Ref19417382 \h Table 78. adaptive_ref_pic_marking_mode_flag shall be equal to 1 when the number of frames, complementary field pairs, and non-paired fields that are currently marked as "used for long-term reference" is equal to Max( max_num_ref_frames, 1 ).
Table STYLEREF 1 \s 7 SEQ Table \* ARABIC \s 1 8 – Interpretation of adaptive_ref_pic_marking_mode_flag
adaptive_ref_pic_marking_mode_flagReference picture marking mode specified0Sliding window reference picture marking mode: A marking mode providing a first-in first-out mechanism for short-term reference pictures.1Adaptive reference picture marking mode: A reference picture marking mode providing syntax elements to specify marking of reference pictures as “"unused for reference”" and to assign long-term frame indices.
memory_management_control_operation specifies a control operation to be applied to affect the reference picture marking. The memory_management_control_operation syntax element is followed by data necessary for the operation specified by the value of memory_management_control_operation. The values and control operations associated with memory_management_control_operation are specified in REF _Ref81299889 \h Table 79. The memory_management_control_operation syntax elements are processed by the decoding process in the order in which they appear in the slice header, and the semantics constraints expressed for each memory_management_control_operation apply at the specific position in that order at which that individual memory_management_control_operation is processed.
For interpretation of memory_management_control_operation, the term reference picture is interpreted as follows.
– If the current picture is a frame, the term reference picture refers either to a reference frame or a complementary reference field pair.
– Otherwise (the current picture is a field), the term reference picture refers either to a reference field or a field of a reference frame.
memory_management_control_operation shall not be equal to 1 in a slice header unless the specified reference picture is marked as "used for short-term reference" when the memory_management_control_operation is processed by the decoding process.
memory_management_control_operation shall not be equal to 2 in a slice header unless the specified long-term picture number refers to a reference picture that is marked as "used for long-term reference" when the memory_management_control_operation is processed by the decoding process.
memory_management_control_operation shall not be equal to 3 in a slice header unless the specified reference picture is marked as "used for short-term reference" when the memory_management_control_operation is processed by the decoding process.
memory_management_control_operation shall not be equal to 3 or 6 if the value of the variable MaxLongTermFrameIdx is equal to "no long-term frame indices" when the memory_management_control_operation is processed by the decoding process.
Not more than one memory_management_control_operation equal to 4 shall be present in a slice header.
Not more than one memory_management_control_operation equal to 5 shall be present in a slice header.
Not more than one memory_management_control_operation equal to 6 shall be present in a slice header.
memory_management_control_operation shall not be equal to 5 in a slice header unless no memory_management_control_operation in the range of 1 to 3 is present in the same decoded reference picture marking syntax structure.
A memory_management_control_operation equal to 5 shall not follow a memory_management_control_operation equal to 6 in the same slice header.
When a memory_management_control_operation equal to 6 is present, any memory_management_control_operation equal to 2, 3, or 4 that follows the memory_management_control_operation equal to 6 within the same slice header shall not specify the current picture to be marked as "unused for reference".
NOTE 2 1 – These constraints prohibit any combination of multiple memory_management_control_operation syntax elements that would specify the current picture to be marked as "unused for reference". However, some other combinations of memory_management_control_operation syntax elements are permitted that may affect the marking status of other reference pictures more than once in the same slice header. In particular, it is permitted for a memory_management_control_operation equal to 3 that specifies a long-term frame index to be assigned to a particular short-term reference picture to be followed in the same slice header by a memory_management_control_operation equal to 2, 3, 4 or 6 that specifies the same reference picture to subsequently be marked as "unused for reference".
Table STYLEREF 1 \s 7 SEQ Table \* ARABIC \s 1 9 – Memory management control operation (memory_management_control_operation) values
memory_management_control_operationMemory Management Control Operation0End memory_management_control_operation syntax element loop1Mark a short-term reference picture as“"unused for reference”"2Mark a long-term reference picture as“"unused for reference”"3Mark a short-term reference picture as"used for long-term reference" and assign a long-term frame index to it4Specify the maximum long-term frame index and mark all long-term reference pictures having long-term frame indices greater than the maximum value as "unused for reference"5Mark all reference pictures as"unused for reference" and set the MaxLongTermFrameIdx variable to"no long-term frame indices"6Mark the current picture as"used for long-term reference" and assign a long-term frame index to it
When decoding a field and a memory_management_control_operation command equal to 3 is present that assigns a long-term frame index to a field that is part of a short-term reference frame or part of a short-term complementary reference field pair, another memory_management_control_operation command (equal to 3 or 6) to assign the same long-term frame index to the other field of the same frame or complementary reference field pair shall be present in the same decoded reference picture marking syntax structure.
NOTE 3 2 – The above requirement must be fulfilled even when the field referred to by the memory_management_control_operation equal to 3 is subsequently marked as "unused for reference" (for example when a memory_management_control_operation equal to 2 is present in the same slice header that causes the field to be marked as "unused for reference").
NOTE 4 – The above requirement has the following implications:
– When a memory_management_control_operation equal to 3 is present that assigns a long-term frame index to a field that is part of a reference frame or complementary reference field pair with both fields marked as "used for short-term reference" (when processing the memory_management_control_operation equal to 3), another memory_management_control_operation equal to 3 must also be present in the same decoded reference picture marking syntax structure that assigns the same longterm frame index to the other field of the reference frame or complementary reference field pair.
– When the current picture is the second field (in decoding order) of a complementary reference field pair and a memory_management_control_operation equal to 3 is present in the decoded reference picture marking syntax structure of the current picture that assigns a long-term frame index to the first field (in decoding order) of the complementary reference field pair, a memory_management_control_operation equal to 6 must be present in the same decoded reference picture marking syntax structure that assigns the same long-term frame index to the second field of the complementary reference field pair.
When the first field (in decoding order) of a complementary reference field pair includeds a long_term_reference_flag equal to 1 or a memory_management_control_operation command equal to 6, the decoded reference picture marking syntax structure for the secondother field of the complementary reference field pair shall contain a memory_management_control_operation command equal to 6 that assigns the same long-term frame index to the secondother field.
NOTE 54 3 – The above requirement must be fulfilled even when the first field of the complementary reference field pair is subsequently marked as "unused for reference" (for example, when a memory_management_control_operation equal to 2 is present in the slice header of the second field that causes the first field to be marked as "unused for reference").
When the second field (in decoding order) of a complementary reference field pair includes a memory_management_control_operation command equal to 6 that assigns a long-term frame index to this field and the first field of the complementary reference field pair is marked as "used for short-term reference" when the memory_management_control_operation command equal to 6 is processed by the decoding process, the decoded reference picture marking syntax structure of that second field shall contain either a memory_management_control_operation command equal to 1 that marks the first field of the complementary field pair as "unused for reference" or a memory_management_control_operation command equal to 3 that marks the first field of the complementary field pair as "used for long-term reference" and assigns the same long-term frame index to the first field.
NOTE 65 – The above constraints specify that when both fields of a frame or a complementary field pair are marked as "used for reference" after processing all memory_management_control_operation commands of the decoded reference picture marking syntax structure, either both fields shallmust be marked as "used for short-term reference" or both fields shallmust be marked as "used for long-term reference". When both fields are marked as "used for long-term reference", the same value of long-term frame index shallmust be assigned to both fields.
difference_of_pic_nums_minus1 is used (with memory_management_control_operation equal to 3 or 1) to assign a long-term frame index to a short-term reference picture or to mark a short-term reference picture as “"unused for reference”". When the associated memory_management_control_operation is processed by the decoding process, the resulting picture number derived from difference_of_pic_nums_minus1 shall be a picture number assigned to one of the reference pictures marked as "used for reference" and not previously assigned to a long-term frame index.
The resulting picture number is constrained as follows.
– If field_pic_flag is equal to 0, the resulting picture number shall be one of the set of picture numbers assigned to reference frames or complementary reference field pairs.
NOTE 76 4 – When field_pic_flag is equal to 0, the resulting picture number must be a picture number assigned to a complementary reference field pair in which both fields are marked as "used for reference" or a frame in which both fields are marked as "used for reference". In particular, when field_pic_flag is equal to 0, the marking of a non-paired field or a frame in which a single field is marked as "used for reference" cannot be affected by a memory_management_control_operation equal to 1.
– Otherwise (field_pic_flag is equal to 1), the resulting picture number shall be one of the set of picture numbers assigned to reference fields.
long_term_pic_num is used (with memory_management_control_operation equal to 2) to mark a long-term reference picture as "unused for reference". When the associated memory_management_control_operation is processed by the decoding process, long_term_pic_num shall be equal to a long-term picture number assigned to one of the reference pictures that is currently marked as "used for long-term reference".
The resulting long-term picture number is constrained as follows.
– If field_pic_flag is equal to 0, the resulting long-term picture number shall be one of the set of long-term picture numbers assigned to reference frames or complementary reference field pairs.
NOTE 87 5 – When field_pic_flag is equal to 0, the resulting long-term picture number must be a long-term picture number assigned to a complementary reference field pair in which both fields are marked as "used for reference" or a frame in which both fields are marked as "used for reference". In particular, when field_pic_flag is equal to 0, the marking of a non-paired field or a frame in which a single field is marked as "used for reference" cannot be affected by a memory_management_control_operation equal to 2.
– Otherwise (field_pic_flag is equal to 1), the resulting long-term picture number shall be one of the set of long-term picture numbers assigned to reference fields.
long_term_frame_idx is used (with memory_management_control_operation equal to 3 or 6) to assign a long-term frame index to a picture. When the associated memory_management_control_operation is processed by the decoding process, the value of long_term_frame_idx shall be in the range of 0 to MaxLongTermFrameIdx, inclusive.
max_long_term_frame_idx_plus1 minus 1 specifies the maximum value of long-term frame index allowed for long-term reference pictures (until receipt of another value of max_long_term_frame_idx_plus1). The value of max_long_term_frame_idx_plus1 shall be in the range of 0 to max_num_ref_frames, inclusive.
Slice data semantics
cabac_alignment_one_bit is a bit equal to 1.
mb_skip_run specifies the number of consecutive skipped macroblocks for which, when decoding a P or SP slice, mb_type shall be inferred to be P_Skip and the macroblock type is collectively referred to as a P macroblock type, or for which, when decoding a B slice, mb_type shall be inferred to be B_Skip and the macroblock type is collectively referred to as a B macroblock type. The value of mb_skip_run shall be in the range of 0 to PicSizeInMbs –" CurrMbAddr, inclusive.
mb_skip_flag equal to 1 specifies that for the current macroblock, when decoding a P or SP slice, mb_type shall be inferred to be P_Skip and the macroblock type is collectively referred to as P macroblock type, or for which, when decoding a B slice, mb_type shall be inferred to be B_Skip and the macroblock type is collectively referred to as B macroblock type. mb_skip_flag equal to 0 specifies that the current macroblock is not skipped.
mb_field_decoding_flag equal to 0 specifies that the current macroblock pair is a frame macroblock pair. mb_field_decoding_flag equal to 1 specifies that the macroblock pair is a field macroblock pair. Both macroblocks of a frame macroblock pair are referred to in the text as frame macroblocks, whereas both macroblocks of a field macroblock pair are referred to in the text as field macroblocks.
When MbaffFrameFlag is equal to 0 (mb_field_decoding_flag is always not present), mb_field_decoding_flag is inferred to be equal to field_pic_flag.
When MbaffFrameFlag is equal to 1 and mb_field_decoding_flag is not present for both the top and the bottomeither macroblock of a macroblock pair, the value of mb_field_decoding_flag is shall be inferred derived as follows.
NOTE – When MbaffFrameFlag is equal to 1 and mb_field_decoding_flag is not present for the top macroblock of a macroblock pair (because the top macroblock is skipped), a decoder must wait until mb_field_decoding_flag for the bottom macroblock is read (when the bottom macroblock is not skipped) or the value of mb_field_decoding_flag is inferred as specified in the following (when the bottom macroblock is also skipped) before it starts the decoding process for the top macroblock.
– If there is a neighbouring macroblock pair immediately to the left of the current macroblock pair in the same slice, the value of mb_field_decoding_flag shall beis inferred to be equal to the value of mb_field_decoding_flag for the neighbouring macroblock pair immediately to the left of the current macroblock pair,
– Otherwise, if there is no neighbouring macroblock pair immediately to the left of the current macroblock pair in the same slice and there is a neighbouring macroblock pair immediately above the current macroblock pair in the same slice, the value of mb_field_decoding_flag shall beis inferred to be equal to the value of mb_field_decoding_flag for the neighbouring macroblock pair immediately above the current macroblock pair,
– Otherwise (there is no neighbouring macroblock pair either immediately to the left or immediately above the current macroblock pair in the same slice), the value of mb_field_decoding_flag shall beis inferred to be equal to 0.
NOTE – When MbaffFrameFlag is equal to 1 and mb_field_decoding_flag is not present for the top macroblock of a macroblock pair (because the top macroblock is skipped), a decoder must wait until mb_field_decoding_flag for the bottom macroblock is read (when the bottom macroblock is not skipped) or the value of mb_field_decoding_flag is inferred as specified above (when the bottom macroblock is also skipped) before it starts the decoding process for the top macroblock.
end_of_slice_flag equal to 0 specifies that another macroblock is following in the slice. end_of_slice_flag equal to 1 specifies the end of the slice and that no further macroblock follows.
The function NextMbAddress( ) used in the slice data syntax table is specified in subclause REF _Ref33888034 \r \h 8.2.2.
Macroblock layer semantics
mb_type specifies the macroblock type. The semantics of mb_type depend on the slice type.
Tables and semantics are specified for the various macroblock types for I, SI, P, SP, and B slices. Each table presents the value of mb_type, the name of mb_type, the number of macroblock partitions used (given by the NumMbPart( mb_type ) function), the prediction mode of the macroblock (when it is not partitioned) or the first partition (given by the MbPartPredMode( mb_type, 0 ) function) and the prediction mode of the second partition (given by the MbPartPredMode( mb_type, 1 ) function). When a value is not applicable it is designated by “"na”". In the text, the value of mb_type may be referred to as the macroblock type, the value of MbPartPredMode( ) may be referred to in the text by "macroblock (partition) prediction mode", and a value X of MbPartPredMode( ) may be referred to in the text by "X macroblock (partition) prediction mode" or as “"X prediction macroblocks”".
REF _Ref81060083 \h Table 710 shows the allowed collective macroblock types for each slice_type.
NOTE 1 – There are some macroblock types with Pred_L0 macroblock (partition) prediction mode(s) that are classified as B macroblock types.
Table STYLEREF 1 \s 7 SEQ Table \* ARABIC \s 1 10 – Allowed collective macroblock types for slice_type
slice_typeallowed collective macroblock typesI (slice)I (see REF _Ref81060145 \h Table 711) (macroblock types)P (slice)P (see REF _Ref19417536 \h Table 713) and I (see REF _Ref81060145 \h Table 711) (macroblock types)B (slice)B (see REF _Ref19417750 \h Table 714) and I (see REF _Ref81060145 \h Table 711) (macroblock types)SI (slice)SI (see REF _Ref19417524 \h Table 712) and I (see REF _Ref81060145 \h Table 711) (macroblock types)SP (slice)P (see REF _Ref19417536 \h Table 713) and I (see REF _Ref81060145 \h Table 711) (macroblock types)
transform_size_8x8_flag equal to 1 specifies that for the current macroblock the transform coefficient decoding process and picture construction process prior to deblocking filter process for residual 8x8 blocks shall be invoked for luma samples, and when ChromaArrayType = = 3 also for Cb and Cr samples. transform_size_8x8_flag equal to 0 specifies that for the current macroblock the transform coefficient decoding process and picture construction process prior to deblocking filter process for residual 4x4 blocks shall be invoked for luma samples, and when ChromaArrayType = = 3 also for Cb and Cr samples. When transform_size_8x8_flag is not present in the bitstream, it shall be inferred to be equal to 0.
NOTE 2 – When the current macroblock prediction mode MbPartPredMode( mb_type, 0 ) is equal to Intra_16x16, transform_size_8x8_flag is not present in the bitstream and then inferred to be equal to 0.
When sub_mb_type[ mbPartIdx ] (see subclause REF _Ref19429414 \r \h 7.4.5.2) is present in the bitstream for all 8x8 blocks indexed by mbPartIdx = 0..3, the variable noSubMbPartSizeLessThan8x8Flag indicates whether for each of the four 8x8 blocks the corresponding SubMbPartWidth( sub_mb_type[ mbPartIdx ] ) and SubMbPartHeight( sub_mb_type[ mbPartIdx ] ) are both equal to 8.
NOTE 3 – When noSubMbPartSizeLessThan8x8Flag is equal to 0 and the current macroblock type is not equal to I_NxN, transform_size_8x8_flag is not present in the bitstream and then inferred to be equal to 0.
Macroblock types that may be collectively referred to as I macroblock types are specified in REF _Ref81060145 \h Table 711.
The macroblock types for I slices are all I macroblock types.
Table STYLEREF 1 \s 7 SEQ Table \* ARABIC \s 1 11 – Macroblock types for I slices
mb_typeName of mb_typetransform_size_8x8_flagMbPartPredMode( mb_type, 0 )Intra16x16PredModeCodedBlockPatternChromaCodedBlockPatternLuma0I_NxN0Intra_4x4naEquation REF CPBlumaChroma_Eqn \h \* MERGEFORMAT 7-35Equation REF CPBlumaChroma_Eqn \h \* MERGEFORMAT 7-350I_NxN1Intra_8x8naEquation REF CPBlumaChroma_Eqn \h \* MERGEFORMAT 7-35Equation REF CPBlumaChroma_Eqn \h \* MERGEFORMAT 7-351I_16x16_0_0_0naIntra_16x160002I_16x16_1_0_0naIntra_16x161003I_16x16_2_0_0naIntra_16x162004I_16x16_3_0_0naIntra_16x163005I_16x16_0_1_0naIntra_16x160106I_16x16_1_1_0naIntra_16x161107I_16x16_2_1_0naIntra_16x162108I_16x16_3_1_0naIntra_16x163109I_16x16_0_2_0naIntra_16x1602010I_16x16_1_2_0naIntra_16x1612011I_16x16_2_2_0naIntra_16x1622012I_16x16_3_2_0naIntra_16x1632013I_16x16_0_0_1naIntra_16x16001514I_16x16_1_0_1naIntra_16x16101515I_16x16_2_0_1naIntra_16x16201516I_16x16_3_0_1naIntra_16x16301517I_16x16_0_1_1naIntra_16x16011518I_16x16_1_1_1naIntra_16x16111519I_16x16_2_1_1naIntra_16x16211520I_16x16_3_1_1naIntra_16x16311521I_16x16_0_2_1naIntra_16x16021522I_16x16_1_2_1naIntra_16x16121523I_16x16_2_2_1naIntra_16x16221524I_16x16_3_2_1naIntra_16x16321525I_PCMnanananana
The following semantics are assigned to the macroblock types in REF _Ref81060145 \h Table 711:.
– I_NxN: A mnemonic name for mb_type equal to 0 with MbPartPredMode( mb_type, 0 ) equal to Intra_4x4 or Intra_8x8.
– I_16x16_0_0_0, I_16x16_1_0_0, I_16x16_2_0_0, I_16x16_3_0_0, I_16x16_0_1_0, I_16x16_1_1_0, I_16x16_2_1_0, I_16x16_3_1_0, I_16x16_0_2_0, I_16x16_1_2_0, I_16x16_2_2_0, I_16x16_3_2_0, I_16x16_0_0_1, I_16x16_1_0_1, I_16x16_2_0_1, I_16x16_3_0_1, I_16x16_0_1_1, I_16x16_1_1_1, I_16x16_2_1_1, I_16x16_3_1_1, I_16x16_0_2_1, I_16x16_1_2_1, I_16x16_2_2_1, I_16x16_3_2_1: the macroblock is coded as an Intra_16x16 prediction mode macroblock.
To each Intra_16x16 prediction macroblock, an Intra16x16PredMode is assigned, which specifies the Intra_16x16 prediction mode, and values of CodedBlockPatternLuma and CodedBlockPatternChroma are assigned as specified in REF _Ref81060145 \h Table 711.
Intra_4x4 specifies the macroblock prediction mode and specifies that the Intra_4x4 prediction process is invoked as specified in subclause REF _Ref24628320 \r \h 8.3.1. Intra_4x4 is an Intra macroblock prediction mode.
Intra_8x8 specifies the macroblock prediction mode and specifies that the Intra_8x8 prediction process is invoked as specified in subclause REF _Ref81134057 \r \h 8.3.2. Intra_8x8 is an Intra macroblock prediction mode.
Intra_16x16 specifies the macroblock prediction mode and specifies that the Intra_16x16 prediction process is invoked as specified in subclause REF _Ref26701754 \r \h 8.3.3. Intra_16x16 is an Intra macroblock prediction mode.
For a macroblock coded with mb_type equal to I_PCM, the Intra macroblock prediction mode shall be inferred.
A macroblock type that may be referred to as SI macroblock type is specified in REF _Ref19417524 \h Table 712.
The macroblock types for SI slices are specified in Tables REF tab_7_12 \h 712 REF _Ref19417524 \h Table 712 and REF tab_7_11 \h 711 REF _Ref81060145 \h Table 7117-11. The mb_type value 0 is specified in REF _Ref19417524 \h Table 712 and the mb_type values 1 to 26 are specified in REF _Ref81060145 \h Table 711, indexed by subtracting 1 from the value of mb_type.
Table STYLEREF 1 \s 7 SEQ Table \* ARABIC \s 1 12 – Macroblock type with value 0 for SI slices
mb_typeName of mb_typeMbPartPredMode( mb_type, 0 )Intra16x16PredModeCodedBlockPatternChromaCodedBlockPatternLuma0SIIntra_4x4naEquation REF CPBlumaChroma_Eqn \h \* MERGEFORMAT 7-35Equation REF CPBlumaChroma_Eqn \h \* MERGEFORMAT 7-35
The following semantics are assigned to the macroblock type in REF _Ref19417524 \h Table 712:.
– The SI macroblock is coded as Intra_4x4 prediction macroblock.
Macroblock types that may be collectively referred to as P macroblock types are specified in REF _Ref19417536 \h Table 713.
The macroblock types for P and SP slices are specified in Tables REF tab_7_13 \h 713 REF _Ref19417536 \h Table 713 and REF tab_7_11 \h 711 REF _Ref81060145 \h Table 7117-11. mb_type values 0 to 4 are specified in REF _Ref19417536 \h Table 713 and mb_type values 5 to 30 are specified in REF _Ref81060145 \h Table 711, indexed by subtracting 5 from the value of mb_type.
Table STYLEREF 1 \s 7 SEQ Table \* ARABIC \s 1 13 – Macroblock type values 0 to 4 for P and SP slices
mb_typeName of mb_typeNumMbPart( mb_type )MbPartPredMode( mb_type, 0 )MbPartPredMode( mb_type, 1 )MbPartWidth( mb_type )MbPartHeight( mb_type )0P_L0_16x161Pred_L0na16161P_L0_L0_16x82Pred_L0Pred_L01682P_L0_L0_8x162Pred_L0Pred_L08163P_8x84nana884P_8x8ref04nana88inferredP_Skip1Pred_L0na1616
The following semantics are assigned to the macroblock types in REF _Ref19417536 \h Table 713:.
– P_L0_16x16: the samples of the macroblock are predicted with one luma macroblock partition of size 16x16 luma samples and associated chroma samples.
– P_L0_L0_MxN, with MxN being replaced by 16x8 or 8x16: the samples of the macroblock are predicted using two luma partitions of size MxN equal to 16x8, or two luma partitions of size MxN equal to 8x16, and associated chroma samples, respectively.
– P_8x8: for each sub-macroblock an additional syntax element (sub_mb_type[ mbPartIdx ] with mbPartIdx being the macroblock partition index for the corresponding sub-macroblock) is present in the bitstream that specifies the type of the corresponding sub-macroblock (see subclause REF _Ref19429414 \r \h 7.4.5.2).
– P_8x8ref0: has the same semantics as P_8x8 but no syntax element for the reference index (ref_idx_l0[ mbPartIdx ] with mbPartIdx = 0..3) is present in the bitstream and ref_idx_l0[ mbPartIdx ] shall be inferred to be equal to 0 for all sub-macroblocks of the macroblock (with indices mbPartIdx = equal to 0..3).
– P_Skip: no further data is present for the macroblock in the bitstream.
The following semantics are assigned to the macroblock prediction modes (for macroblocks that are not partitioned) and macroblock partition prediction modes (for macroblocks that are partitioned) specified by (MbPartPredMode( )) in REF _Ref19417536 \h Table 713.:
– Pred_L0: specifies that the inter Inter prediction process is invoked using list 0 prediction. Pred_L0 is an Inter macroblock prediction mode (for macroblocks that are not partitioned) and an Inter macroblock partition prediction mode (for macroblocks that are partitioned).
When mb_type is equal to any of the values specified in REF _Ref19417536 \h Table 713, the macroblock is coded in an Inter macroblock prediction mode.
Macroblock types that may be collectively referred to as B macroblock types are specified in REF _Ref19417750 \h Table 714.
The macroblock types for B slices are specified in Tables REF tab_7_14 \h 714 REF _Ref19417750 \h Table 714 and REF tab_7_11 \h 711 REF _Ref81060145 \h Table 7117-11. The mb_type values 0 to 22 are specified in REF _Ref19417750 \h Table 714 and the mb_type values 23 to 48 are specified in REF _Ref81060145 \h Table 711, indexed by subtracting 23 from the value of mb_type.
Table STYLEREF 1 \s 7 SEQ Table \* ARABIC \s 1 14 – Macroblock type values 0 to 22 for B slices
mb_typeName of mb_typeNumMbPart( mb_type )MbPartPredMode( mb_type, 0 )MbPartPredMode( mb_type, 1 )MbPartWidth( mb_type )MbPartHeight( mb_type )0B_Direct_16x16naDirectna881B_L0_16x161Pred_L0na16162B_L1_16x161Pred_L1na16163B_Bi_16x161BiPredna16164B_L0_L0_16x82Pred_L0Pred_L01685B_L0_L0_8x162Pred_L0Pred_L08166B_L1_L1_16x82Pred_L1Pred_L11687B_L1_L1_8x162Pred_L1Pred_L18168B_L0_L1_16x82Pred_L0Pred_L11689B_L0_L1_8x162Pred_L0Pred_L181610B_L1_L0_16x82Pred_L1Pred_L016811B_L1_L0_8x162Pred_L1Pred_L081612B_L0_Bi_16x82Pred_L0BiPred16813B_L0_Bi_8x162Pred_L0BiPred81614B_L1_Bi_16x82Pred_L1BiPred16815B_L1_Bi_8x162Pred_L1BiPred81616B_Bi_L0_16x82BiPredPred_L016817B_Bi_L0_8x162BiPredPred_L081618B_Bi_L1_16x82BiPredPred_L116819B_Bi_L1_8x162BiPredPred_L181620B_Bi_Bi_16x82BiPredBiPred16821B_Bi_Bi_8x162BiPredBiPred81622B_8x84nana88inferredB_SkipnaDirectna88
The following semantics are assigned to the macroblock types in REF _Ref19417750 \h Table 714:
– B_Direct_16x16: no motion vector differences or reference indices are present for the macroblock in the bitstream. The functions MbPartWidth( B_Direct_16x16 ), and MbPartHeight( B_Direct_16x16 ) are used in the derivation process for motion vectors and reference frame indices in subclause REF _Ref32720804 \r \h 8.4.1 for direct mode prediction.
– B_X_16x16 with X being replaced by L0, L1, or Bi: the samples of the macroblock are predicted with one luma macroblock partition of size 16x16 luma samples and associated chroma samples. For a macroblock with type B_X_16x16 with X being replaced by either L0 or L1, one motion vector difference and one reference index is present in the bitstream for the macroblock. For a macroblock with type B_X_16x16 with X being replaced by Bi, two motion vector differences and two reference indices are present in the bitstream for the macroblock.
– B_X0_X1_MxN, with X0, X1 referring to the first and second macroblock partition and being replaced by L0, L1, or Bi, and MxN being replaced by 16x8 or 8x16: the samples of the macroblock are predicted using two luma partitions of size MxN equal to 16x8, or two luma partitions of size MxN equal to 8x16, and associated chroma samples, respectively. For a macroblock partition X0 or X1 with X0 or X1 being replaced by either L0 or L1, one motion vector difference and one reference index is present in the bitstream. For a macroblock partition X0 or X1 with X0 or X1 being replaced by Bi, two motion vector differences and two reference indices are present in the bitstream for the macroblock partition.
– B_8x8: for each sub-macroblock an additional syntax element (sub_mb_type[ mbPartIdx ] with mbPartIdx being the macroblock partition index for the corresponding sub-macroblock) is present in the bitstream that specifies the type of the corresponding sub-macroblock (see subclause REF _Ref19429414 \r \h 7.4.5.2).
– B_Skip: no further data is present for the macroblock in the bitstream. The functions MbPartWidth( B_Skip ), and MbPartHeight( B_Skip ) are used in the derivation process for motion vectors and reference frame indices in subclause REF _Ref32720804 \r \h 8.4.1 for direct mode prediction.
The following semantics are assigned to the macroblock prediction modes (for macroblocks that are not partitioned) and macroblock partition prediction modes (for macroblocks that are partitioned) specified by (MbPartPredMode( )) in REF _Ref19417750 \h Table 714:.
– Direct: no motion vector differences or reference indices are present for the macroblock (in case of B_Skip or B_Direct_16x16) in the bitstream. Direct is an Inter macroblock prediction mode (for macroblocks that are not partitioned) and an Inter macroblock partition prediction mode (for macroblocks that are partitioned, see REF _Ref19417942 \h Table 718).
– Pred_L0: thesee semantics specified for REF _Ref19417536 \h Table 713 apply.
– Pred_L1: specifies that the Inter prediction process is invoked using list 1 prediction. Pred_L1 is an Inter macroblock prediction mode (for macroblocks that are not partitioned) and an Inter macroblock partition prediction mode (for macroblocks that are partitioned).
– BiPred: specifies that the Inter prediction process is invoked using list 0 and list 1 prediction. BiPred is an Inter macroblock prediction mode (for macroblocks that are not partitioned) and an Inter macroblock partition prediction mode (for macroblocks that are partitioned).
When mb_type is equal to any of the values specified in REF _Ref19417750 \h Table 714, the macroblock is coded in an Inter macroblock prediction mode.
pcm_alignment_zero_bit is a bit equal to 0.
pcm_sample_luma[ i ] is a sample value. The first pcm_sample_luma[ i ] values represent luma sample values in the raster scan within the macroblock. The number of bits used to represent each of these samples is BitDepthY. When profile_idc is not equal to 66, 77, or 8844, 100, 110, 122, or 244, pcm_sample_luma[ i ] shall not be equal to 0.
pcm_sample_chroma[ i ] is a sample value. The first MbWidthC * MbHeightC pcm_sample_chroma[ i ] values represent Cb sample values in the raster scan within the macroblock and the remaining MbWidthC * MbHeightC pcm_sample_chroma[ i ] values represent Cr sample values in the raster scan within the macroblock. The number of bits used to represent each of these samples is BitDepthC. When profile_idc is not equal to 66, 77, or 8844, 100, 110, 122, or 244, pcm_sample_chroma[ i ] shall not be equal to 0.
coded_block_pattern specifies which of the four 8x8 luma blocks and associated chroma blocks of a macroblock may contain non-zero transform coefficient levels. When coded_block_pattern is present in the bitstream, the variables CodedBlockPatternLuma and CodedBlockPatternChroma are derived as follows.
CodedBlockPatternLuma = coded_block_pattern % 16CodedBlockPatternChroma = coded_block_pattern / 16 ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 35)
When the macroblock type is not equal to I_PCM, the following applies.
– If the macroblock prediction mode is equal Intra_16x16, the following applies.
– If ChromaArrayType is not equal to 3, the value of CodedBlockPatternLuma specifiesdistinguishes between the following cases.
– If CodedBlockPatternLuma is equal to 0, all AC transform coefficient levels of the luma component of the macroblock are equal to 0 for all 16 of the 4x4 blocks in the 16x16 luma block.
– Otherwise (CodedBlockPatternLuma is not equal to 0), CodedBlockPatternLuma is equal to 15, at least one of the AC transform coefficient levels of the luma component of the macroblock shall be non-zero, and the AC transform coefficient levels are scanned for all 16 of the 4x4 blocks in the 16x16 block.
– Otherwise (ChromaArrayType is equal to 3), the value of CodedBlockPatternLuma specifiesdistinguishes between the following cases.
– If CodedBlockPatternLuma is equal to 0, all AC transform coefficient levels of the luma, Cb, and Cr components of the macroblock are equal to 0 for all 16 of the 4x4 blocks in the luma, Cb, and Cr components of the macroblock.
– Otherwise (CodedBlockPatternLuma is not equal to 0), CodedBlockPatternLuma is equal to 15, at least one of the AC transform coefficient levels of the luma, Cb, or Cr components of the macroblock shall be non-zero, and the AC transform coefficient levels are scanned for all 16 of the 4x4 blocks in the luma Cb, and Cr components of the macroblock.
– Otherwise (the macroblock prediction mode is not equal to Intra_16x16), coded_block_pattern is present in the bitstream, and the following applies.
– If ChromaArrayType is not equal to 3, each of the four LSBs of CodedBlockPatternLuma distinguishesspecifies, for one of the four 8x8 luma blocks of the macroblock, between the following cases.
– If the corresponding bit of CodedBlockPatternLuma is equal to 0, all transform coefficient levels of the luma transform blocks in the 8x8 luma block are equal to zero.
– Otherwise (the corresponding bit of CodedBlockPatternLuma is equal to 1), one or more transform coefficient levels of one or more of the luma transform blocks in the 8x8 luma block shall be non-zero valued and the transform coefficient levels of the corresponding transform blocks are scanned.
– Otherwise (ChromaArrayType is equal to 3), each of the four LSBs of CodedBlockPatternLuma distinguishesspecifies, for one of the four 8x8 luma blocks of the macroblock, between the following cases.
– If the corresponding bit of CodedBlockPatternLuma is equal to 0, all transform coefficient levels of the luma, Cb, and Cr transform blocks in the 8x8 luma block are equal to zero.
– Otherwise (the corresponding bit of CodedBlockPatternLuma is equal to 1), one or more transform coefficient levels of one or more of the luma, Cb, or Cr transform blocks in the 8x8 luma block shall be non-zero valued and the transform coefficient levels of the corresponding transform blocks are scanned.
When the macroblock type is not equal to I_PCM, CodedBlockPatternChroma is interpreted as follows.
– If ChromaArrayType is not equal to 0 or 3, CodedBlockPatternChroma is specified in REF _Ref31022277 \h Table 715.
– Otherwise (ChromaArrayType is equal to 0 or 3), the bitstream shall not contain data that results in a derived value of CodedBlockPatternChroma that is not equal to 0.
Table STYLEREF 1 \s 7 SEQ Table \* ARABIC \s 1 15 – Specification of CodedBlockPatternChroma values
CodedBlockPatternChromaDescription0All chroma transform coefficient levels are equal to 0.1One or more chroma DC transform coefficient levels shall be non-zero valued. All chroma AC transform coefficient levels are equal to 0.2Zero or more chroma DC transform coefficient levels are non-zero valued. One or more chroma AC transform coefficient levels shall be non-zero valued.
mb_qp_delta can change the value of QPY in the macroblock layer. The decoded value of mb_qp_delta shall be in the range of "( 26 + QpBdOffsetY / 2) to +( 25 + QpBdOffsetY / 2 ), inclusive. mb_qp_delta shall be inferred to be equal to 0 when it is not present for any macroblock (including P_Skip and B_Skip macroblock types).
The value of QPY is derived as
QPY = ( ( QPY,PREV + mb_qp_delta + 52 + 2 * QpBdOffsetY ) % ( 52 + QpBdOffsetY ) ) -" QpBdOffsetY ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 36)
where QPY,PREV is the luma quantisation parameter, QPY, of the previous macroblock in decoding order in the current slice. For the first macroblock in the slice QPY,PREV is initially set equal to SliceQPY derived in Equation REF QPYatSliceLevel_Eqn \h 7-29 at the start of each slice.
The value of QP'Y is derived as
QP'Y = QPY + QpBdOffsetY ( STYLEREF 1 \s 7- SEQ Equation \* ARABIC 37)
The variable TransformBypassModeFlag is derived as follows.
– If qpprime_y_zero_transform_bypass_flag is equal to 1 and QP'Y is equal to 0, TransformBypassModeFlag is set equal to 1.
– Otherwise (qpprime_y_zero_transform_bypass_flag is equal to 0 or QP'Y is not equal to 0), TransformBypassModeFlag is set equal to 0.
Macroblock prediction semantics
All samples of the macroblock are predicted. The prediction modes are derived using the following syntax elements.
prev_intra4x4_pred_mode_flag[ luma4x4BlkIdx ] and rem_intra4x4_pred_mode[ luma4x4BlkIdx ] specify the Intra_4x4 prediction of the 4x4 luma block with index luma4x4BlkIdx = 0..15. When ChromaArrayType is equal to 3, prev_intra4x4_pred_mode_flag[ luma4x4BlkIdx ] and rem_intra4x4_pred_mode[ luma4x4BlkIdx ] also specify the Intra_4x4 prediction of the 4x4 Cb block with luma4x4BlkIdx equal to cb4x4BlkIdx for cb4x4BlkIdx = 0..15 and the Intra_4x4 prediction of the 4x4 Cr block with luma4x4BlkIdx equal to cr4x4BlkIdx for cr4x4BlkIdx = 0..15.
prev_intra8x8_pred_mode_flag[ luma8x8BlkIdx ] and rem_intra8x8_pred_mode[ luma8x8BlkIdx ] specify the Intra_8x8 prediction of the 8x8 luma block with index luma8x8BlkIdx = 0..3. When ChromaArrayType is equal to 3, prev_intra8x8_pred_mode_flag[ luma8x8BlkIdx ] and rem_intra8x8_pred_mode[ luma8x8BlkIdx ] also specify the Intra_8x8 prediction of the 8x8 Cb block with luma8x8BlkIdx equal to cb8x8BlkIdx for cb8x8BlkIdx = 0..3 and the Intra_8x8 prediction of the 8x8 Cr block with index luma8x8BlkIdx equal to cr8x8BlkIdx for cr8x8BlkIdx = 0..3.
intra_chroma_pred_mode specifies, when ChromaArrayType is equal to 1 or 2, the type of spatial prediction used for chroma in macroblocks using Intra_4x4, Intra_8x8, or Intra_16x16 prediction, as shown in REF _Ref19417894 \h Table 716. The value of intra_chroma_pred_mode shall be in the range of 0 to 3, inclusive.
Table STYLEREF 1 \s 7 SEQ Table \* ARABIC \s 1 16 – Relationship between intra_chroma_pred_mode and spatial prediction modes
intra_chroma_pred_modeIntra Chroma Prediction Mode0DC1Horizontal2Vertical3Plane
ref_idx_l0[ mbPartIdx ] when present, specifies the index in reference picture list 0 of the reference picture to be used for prediction.
The range of ref_idx_l0[ mbPartIdx ], the index in list 0 of the reference picture, and, if applicable, the parity of the field within the reference picture used for prediction are specified as follows.
– If MbaffFrameFlag is equal to 0 or mb_field_decoding_flag is equal to 0, the value of ref_idx_l0[ mbPartIdx ] shall be in the range of 0 to num_ref_idx_l0_active_minus1, inclusive.
– Otherwise (MbaffFrameFlag is equal to 1 and mb_field_decoding_flag is equal to 1), the value of ref_idx_l0[ mbPartIdx ] shall be in the range of 0 to 2 * num_ref_idx_l0_active_minus1 + 1, inclusive.
When only one reference picture is used for inter prediction, the values of ref_idx_l0[ mbPartIdx ] shall be inferred to be equal to 0.
ref_idx_l1[ mbPartIdx ] has the same semantics as ref_idx_l0, with l0 and list 0 replaced by l1 and list 1, respectively.
mvd_l0[ mbPartIdx ][ 0 ][ compIdx ] specifies the difference between a vector component to be used and its prediction. The index mbPartIdx specifies to which macroblock partition mvd_l0 is assigned. The partitioning of the macroblock is specified by mb_type. The horizontal motion vector component difference is decoded first in decoding order and is assigned CcompIdx = 0. The vertical motion vector component is decoded second in decoding order and is assigned CcompIdx = 1. The range of the components of mvd_l0[ mbPartIdx ][ 0 ][ compIdx ] is specified by constraints on the motion vector variable values derived from it as specified in Annex REF _Ref36826677 \r \h AA.
mvd_l1[ mbPartIdx ][ 0 ][ compIdx ] has the same semantics as mvd_l0, with l0 and L0 replaced by l1 and L1, respectively.
Sub-macroblock prediction semantics
sub_mb_type[ mbPartIdx ] specifies the sub-macroblock types.
Tables and semantics are specified for the various sub-macroblock types for P, and B macroblock types. Each table presents the value of sub_mb_type[ mbPartIdx ], the name of sub_mb_type[ mbPartIdx ], the number of sub-macroblock partitions used (given by the NumSubMbPart( sub_mb_type[ mbPartIdx ] ) function), and the prediction mode of the sub-macroblock (given by the SubMbPredMode( sub_mb_type[ mbPartIdx ] ) function). In the text, the value of sub_mb_type[ mbPartIdx ] may be referred to by “"sub-macroblock type”". In the text, the value of SubMbPredMode( ) may be referred to by “"sub-macroblock prediction mode”" or "macroblock partition prediction mode".
The interpretation of sub_mb_type[ mbPartIdx ] for P macroblock types is specified in REF _Ref19417912 \h Table 717, where the row for "inferred" specifies values inferred when sub_mb_type[ mbPartIdx ] is not present.
Table STYLEREF 1 \s 7 SEQ Table \* ARABIC \s 1 17 – Sub-macroblock types in P macroblocks
sub_mb_type[ mbPartIdx ]Name of sub_mb_type[ mbPartIdx ]NumSubMbPart( sub_mb_type[ mbPartIdx ] )SubMbPredMode( sub_mb_type[ mbPartIdx ] )SubMbPartWidth( sub_mb_type[ mbPartIdx ] )SubMbPartHeight( sub_mb_type[ mbPartIdx ] )inferrednanananana0P_L0_8x81Pred_L0881P_L0_8x42Pred_L0842P_L0_4x82Pred_L0483P_L0_4x44Pred_L044
The following semantics are assigned to the sub-macroblock types in REF _Ref19417912 \h Table 717:.
P_L0_MxN, with MxN being replaced by 8x8, 8x4, 4x8, or 4x4: the samples of the sub-macroblock are predicted using one luma partition of size MxN equal to 8x8, two luma partitions of size MxN equal to 8x4, or two luma partitions of size MxN equal to 4x8, or four luma partitions of size MxN equal to 4x4, and associated chroma samples, respectively.
The following semantics are assigned to the sub-macroblock prediction modes (or macroblock partition prediction modes) (specified by SubMbPredMode( )) in REF _Ref19417912 \h Table 717:.
– Pred_L0: see semantics for REF _Ref19417536 \h Table 713.
The interpretation of sub_mb_type[ mbPartIdx ] for B macroblock types is specified in REF _Ref19417942 \h Table 718, where the row for "inferred" specifies values inferred when sub_mb_type[ mbPartIdx ] is not present, and the inferred value "mb_type" specifies that the name of sub_mb_type[ mbPartIdx ] is the same as the name of mb_type for this case.
Table STYLEREF 1 \s 7 SEQ Table \* ARABIC \s 1 18 – Sub-macroblock types in B macroblocks
sub_mb_type[ mbPartIdx ]Name of sub_mb_type[ mbPartIdx ]NumSubMbPart( sub_mb_type[ mbPartIdx ] )SubMbPredMode( sub_mb_type[ mbPartIdx ] )SubMbPartWidth( sub_mb_type[ mbPartIdx ] )SubMbPartHeight( sub_mb_type[ mbPartIdx ] )inferredmb_type4Direct440B_Direct_8x84Direct441B_L0_8x81Pred_L0882B_L1_8x81Pred_L1883B_Bi_8x81BiPred884B_L0_8x42Pred_L0845B_L0_4x82Pred_L0486B_L1_8x42Pred_L1847B_L1_4x82Pred_L1488B_Bi_8x42BiPred849B_Bi_4x82BiPred4810B_L0_4x44Pred_L04411B_L1_4x44Pred_L14412B_Bi_4x44BiPred44
The following semantics are assigned to the sub-macroblock types in REF _Ref19417942 \h Table 718:
– B_Skip and B_Direct_16x16: no motion vector differences or reference indices are present for the sub-macroblock in the bitstream. The functions SubMbPartWidth( ) and SubMbPartHeight( ) are used in the derivation process for motion vectors and reference frame indices in subclause REF _Ref32720804 \r \h 8.4.1 for direct mode prediction.
– B_Direct_8x8: no motion vector differences or reference indices are present for the sub-macroblock in the bitstream. The functions SubMbPartWidth( B_Direct_8x8 ) and SubMbPartHeight( B_Direct_8x8 ) are used in the derivation process for motion vectors and reference frame indices in subclause REF _Ref32720804 \r \h \* MERGEFORMAT 8.4.1 for direct mode prediction.
– B_X_MxN, with X being replaced by L0, L1, or Bi, and MxN being replaced by 8x8, 8x4, 4x8 or 4x4: the samples of the sub-macroblock are predicted using one luma partition of size MxN equal to 8x8, or the samples of the sub-macroblock are predicted using two luma partitions of size MxN equal to 8x4, or the samples of the sub-macroblock are predicted using two luma partitions of size MxN equal to 4x8, or the samples of the sub-macroblock are predicted using four luma partitions of size MxN equal to 4x4, and associated chroma samples, respectively. All sub-macroblock partitions share the same reference index. For an MxN sub-macroblock partition in a sub-macroblock with sub_mb_type[ mbPartIdx ] being B_X_MxN with X being replaced by either L0 or L1, one motion vector difference is present in the bitstream. For an MxN sub-macroblock partition in a sub-macroblock with sub_mb_type[ mbPartIdx ] being B_Bi_MxN, two motion vector difference are present in the bitstream.
The following semantics are assigned to the sub-macroblock prediction modes (or macroblock partition prediction modes) specified by (SubMbPredMode( )) in REF _Ref19417942 \h Table 718:.
– Direct: see semantics for REF _Ref19417750 \h Table 714.
– Pred_L0: see semantics for REF _Ref19417536 \h \* MERGEFORMAT Table 713.
– Pred_L1: see semantics for REF _Ref19417750 \h \* MERGEFORMAT Table 714.
– BiPred: see semantics for REF _Ref19417750 \h \* MERGEFORMAT Table 714.
ref_idx_l0[ mbPartIdx ] has the same semantics as ref_idx_l0 in subclause REF _Ref216787851 \r \h 7.4.5.1 REF _Ref32926364 \r \h 7.4.5.1.
ref_idx_l1[ mbPartIdx ] has the same semantics as ref_idx_l1 in subclause REF _Ref216787851 \r \h 7.4.5.1 REF _Ref32926364 \r \h 7.4.5.1.
mvd_l0[ mbPartIdx ][ subMbPartIdx ][ compIdx ] has the same semantics as mvd_l0 in subclause REF _Ref32926364 \r \h 7.4.5.1 REF _Ref216787851 \r \h 7.4.5.1, except that it is applied to the sub-macroblock partition index with subMbPartIdx. The indices mbPartIdx and subMbPartIdx specify to which macroblock partition and sub-macroblock partition mvd_l0 is assigned.
mvd_l1[ mbPartIdx ][ subMbPartIdx ][ compIdx ] has the same semantics as mvd_l1 in subclause REF _Ref216787851 \r \h 7.4.5.1 REF _Ref32926364 \r \h 7.4.5.1.
Residual data semantics
The syntax structure residual_block( ), which is used for parsing the transform coefficient levels, is assigned as follows.
– If entropy_coding_mode_flag is equal to 0, residual_block is set equal to residual_block_cavlc, which is used for parsing the syntax elements for transform coefficient levels.
– Otherwise (entropy_coding_mode_flag is equal to 1), residual_block is set equal to residual_block_cabac, which is used for parsing the syntax elements for transform coefficient levels.
The syntax structure residual_luma( i16x16DClevel, i16x16AClevel, level, level8x8 ) is used with the variables in brackets being its output and being assigned as follows.
Intra16x16DCLevel is set equal to i16x16DClevel, Intra16x16ACLevel is set equal to i16x16AClevel, LumaLevel is set equal to level, and LumaLevel8x8 is set equal to level8x8.
When ChromaArrayType is equal to 1 or 2, the following applies:.
– For each chroma component, indexed by iCbCr = 0..1, the DC transform coefficient levels of the 4 * NumC8x8 4x4 chroma blocks are parsed into the iCbCr-th list ChromaDCLevel[ iCbCr ].
– For each of the 4x4 chroma blocks, indexed by i4x4 = 0..3 and i8x8 = 0..NumC8x8 ( 1, of each chroma component, indexed by iCbCr = 0..1, the 15 AC transform coefficient levels are parsed into the (i8x8*4 + i4x4)-th list of the iCbCr-th chroma component ChromaACLevel[ iCbCr ][ i8x8*4 + i4x4 ].
When ChromaArrayType is equal to 3, the following applies:.
– The syntax structure residual_luma( i16x16DClevel, i16x16AClevel, level, level8x8 ) is used for the Cb component with the variables in brackets being its output and being assigned as follows. CbIntra16x16DCLevel is set equal to i16x16DClevel, CbIntra16x16ACLevel is set equal to i16x16AClevel, CbLevel is set equal to level, and CbLevel8x8 is set equal to level8x8.
– The syntax structure residual_luma( i16x16DClevel, i16x16AClevel, level, level8x8 ) is used for the Cr component with the variables in brackets being its output and being assigned as follows. CrIntra16x16DCLevel is set equal to i16x16DClevel, CrIntra16x16ACLevel is set equal to i16x16AClevel, CrLevel is set equal to level, and CrLevel8x8 is set equal to level8x8.
Residual luma data semantics
Output of this syntax structure are the variables i16x16DClevel, i16x16AClevel, level, and level8x8.
The syntax structure residual_block( ), which is used for parsing the transform coefficient levels, is assigned as follows.
– If entropy_coding_mode_flag is equal to 0, residual_block is set equal to residual_block_cavlc, which is used for parsing the syntax elements for transform coefficient levels.
– Otherwise (entropy_coding_mode_flag is equal to 1), residual_block is set equal to residual_block_cabac, which is used for parsing the syntax elements for transform coefficient levels.
Depending on mb_type, the syntax structure residual_block( coeffLevel, maxNumCoeff ) is used with the arguments coeffLevel, which is a list containing the maxNumCoeff transform coefficient levels that are parsed in residual_block( ) and maxNumCoeff as follows.
Depending on MbPartPredMode( mb_type, 0 ), the following applies.
– If MbPartPredMode( mb_type, 0 ) is equal to Intra_16x16, the transform coefficient levels are parsed into the list i16x16DClevel and into the 16 lists i16x16AClevel[ i ]. i16x16DClevel contains the 16 transform coefficient levels of the DC transform coefficient levels for each 4x4 luma block. For each of the 16 4x4 luma blocks indexed by i = 0..15, the 15 AC transform coefficients levels of the i-th block are parsed into the i-th list i16x16AClevel[ i ].
– Otherwise (MbPartPredMode( mb_type, 0 ) is not equal to Intra_16x16), the following applies.
– If transform_size_8x8_flag is equal to 0, for each of the 16 4x4 luma blocks indexed by i = 0..15, the 16 transform coefficient levels of the i-th block are parsed into the i-th list level[ i ].
– Otherwise (transform_size_8x8_flag is equal to 1), for each of the 4 8x8 luma blocks indexed by i8x8 = 0..3, the following applies.
– If entropy_coding_mode_flag is equal to 0, first for each of the 4 4x4 luma blocks indexed by i4x4 = 0..3, the 16 transform coefficient levels of the i4x4-th block are parsed into the (i8x8 * 4 + i4x4)-th list level[ i8x8 * 4 + i4x4 ]. Then, the 64 transform coefficient levels of the i8x8-th 8x8 luma block which are indexed by 4 * i + i4x4, where i = 0..15 and i4x4 = 0..3, are derived as level8x8[ i8x8 ][ 4 * i + i4x4 ] = level[ i8x8 * 4 + i4x4 ][ i ].
NOTE – The 4x4 luma blocks with luma4x4BlkIdx = i8x8 * 4 + i4x4 containing every fourth transform coefficient level of the corresponding i8x8-th 8x8 luma block with offset i4x4 are assumed to represent spatial locations given by the inverse 4x4 luma block scanning process in subclause 6.4.3.
– Otherwise (entropy_coding_mode_flag is equal to 1), the 64 transform coefficient levels of the i8x8-th block are parsed into the i8x8-th list level8x8[ i8x8 ].
Residual block CAVLC semantics
The function TotalCoeff( coeff_token ) that is used in subclause REF _Ref166905480 \r \h 7.3.5.3.2 returns the number of non-zero transform coefficient levels derived from coeff_token.
The function TrailingOnes( coeff_token ) that is used in subclause REF _Ref166905480 \r \h 7.3.5.3.2 returns the trailing ones derived from coeff_token.
coeff_token specifies the total number of non-zero transform coefficient levels and the number of trailing one transform coefficient levels in a transform coefficient level scan. A trailing one transform coefficient level is one of up to three consecutive non-zero transform coefficient levels having an absolute value equal to 1 at the end of a scan of non-zero transform coefficient levels. The range of coeff_token is specified in subclause REF _Ref33184825 \r \h 9.2.1.
trailing_ones_sign_flag specifies the sign of a trailing one transform coefficient level as follows.
– If trailing_ones_sign_flag is equal to 0, the corresponding transform coefficient level is decoded as +1.
Otherwise (trailing_ones_sign_flag equal to 1), the corresponding transform coefficient level is decoded as -"1.
level_prefix and level_suffix specify the value of a non-zero transform coefficient level. The range of level_prefix and level_suffix is specified in subclause REF _Ref31515681 \r \h 9.2.2.
total_zeros specifies the total number of zero-valued transform coefficient levels that are located before the position of the last non-zero transform coefficient level in a scan of transform coefficient levels. The range of total_zeros is specified in subclause REF _Ref33184828 \r \h 9.2.3.
run_before specifies the number of consecutive transform coefficient levels in the scan with zero value before a non-zero valued transform coefficient level. The range of run_before is specified in subclause REF _Ref33184828 \r \h 9.2.3.
coeffLevel contains maxNumCoeff transform coefficient levels for the current list of transform coefficient levels.
Residual block CABAC semantics
coded_block_flag specifies whether the transform block contains non-zero transform coefficient levels as follows.
– If coded_block_flag is equal to 0, the transform block contains no non-zero transform coefficient levels.
– Otherwise (coded_block_flag is equal to 1), the transform block contains at least one non-zero transform coefficient level.
When coded_block_flag is not present, it is shall be inferred to be equal to 1.
significant_coeff_flag[ i ] specifies whether the transform coefficient level at scanning position i is non-zero as follows.
– If significant_coeff_flag[ i ] is equal to 0, the transform coefficient level at scanning position i is set equal to 0;
– Otherwise (significant_coeff_flag[ i ] is equal to 1), the transform coefficient level at scanning position i has a non-zero value.
last_significant_coeff_flag[ i ] specifies for the scanning position i whether there are non-zero transform coefficient levels for subsequent scanning positions i + 1 to maxNumCoeff –" 1 as follows.
If last_significant_coeff_flag[ i ] is equal to 1, all following transform coefficient levels (in scanning order) of the block have value equal to 0.
Otherwise (last_significant_coeff_flag[ i ] is equal to 0), there are further non-zero transform coefficient levels along the scanning path.
coeff_abs_level_minus1[ i ] is the absolute value of a transform coefficient level minus 1. The value of coeff_abs_level_minus1 is constrained by the limits in subclause REF _Ref81126553 \r \h 8.5.
coeff_sign_flag[ i ] specifies the sign of a transform coefficient level as follows.
– If coeff_sign_flag is equal to 0, the corresponding transform coefficient level has a positive value.
– Otherwise (coeff_sign_flag is equal to 1), the corresponding transform coefficient level has a negative value.
coeffLevel contains maxNumCoeff transform coefficient levels for the current list of transform coefficient levels.
Decoding process
Outputs of this process are decoded samples of the current picture (sometimes referred to by the variable CurrPic).
Depending on the value of chroma_format_idc, the number of sample arrays of the current picture is as follows.
– If chroma_format_idc is equal to 0, the current picture consists of 1 sample array SL.
– Otherwise (chroma_format_idc is not equal to 0), the current picture consists of 3 sample arrays SL, SCb, SCr.
This clause describes the decoding process, given syntax elements and upper-case variables from clause REF _Ref24431071 \r \h 7.
The decoding process is specified such that all decoders shall produce numerically identical results. Any decoding process that produces identical results to the process described here conforms to the decoding process requirements of this Recommendation | International Standard.
Each picture referred to in this clause is a complete primary coded picture or part of a primary coded picture. Each slice referred to in this clause is a slice of a primary coded picture. Each slice data partition referred to in this clause is a slice data partition of a primary coded picture.
Depending on the value of separate_colour_plane_flag, the decoding process is structured as follows.
– If separate_colour_plane_flag is equal to 0, the decoding process is invoked a single time with the current picture being the output.
– Otherwise (separate_colour_plane_flag is equal to 1), the decoding process is invoked three times. Inputs to the decoding process are all NAL units of the primary coded picture with identical value of colour_plane_id. The decoding process of NAL units with a particular value of colour_plane_id is specified as if only a coded video sequence with monochrome colour format with that particular value of colour_plane_id would be present in the bitstream. The output of each of the three decoding processes is assigned to the 3 sample arrays of the current picture with the NAL units with colour_plane_id equal to 0 being assigned to SL, the NAL units with colour_plane_id equal to 1 being assigned to SCb, and the NAL units with colour_plane_id equal to 2 being assigned to SCr.
NOTE –- The variable ChromaArrayType is derived as 0 when separate_colour_plane_flag is equal to 1 and chroma_format_idc is equal to 3. In the decoding process, the value of this variable is evaluated resulting in operations identical to that of monochrome pictures with chroma_format_idc being equal to 0.
An overview of the decoding process is given as follows:.
– The decoding of NAL units is specified in subclause REF _Ref24436508 \r \h 8.1.
– The processes in subclause REF _Ref24436509 \r \h \* MERGEFORMAT 8.2 specify decoding processes using syntax elements in the slice layer and above:.
– Variables and functions relating to picture order count are derived in subclause REF _Ref36860709 \r \h 8.2.1. (only needed to be invoked for one slice of a picture)
– Variables and functions relating to the macroblock to slice group map are derived in subclause REF _Ref36860713 \r \h \* MERGEFORMAT 8.2.2. (only needed to be invoked for one slice of a picture)
– The method of combining the various slice data partitions when slice data partitioning is used is described in subclause REF _Ref36860716 \r \h \* MERGEFORMAT 8.2.3.
– When the frame_num of the current picture is not equal to PrevRefFrameNum and is not equal to ( PrevRefFrameNum + 1 ) % MaxFrameNum, the decoding process for gaps in frame_num is performed according to subclause REF _Ref31614329 \r \h \* MERGEFORMAT 8.2.5.2 prior to the decoding of any slices of the current picture.
– At the beginning of the decoding process for each P, SP, or B slice, the decoding process for reference picture lists construction specified in subclause REF _Ref36860719 \r \h \* MERGEFORMAT 8.2.4 is invokedperformed for derivation of reference picture list 0 (RefPicList0), and when decoding a B slice, reference picture list 1 (RefPicList1).
– When the current picture is a reference picture and after all slices of the current picture have been decoded, the decoded reference picture marking process in subclause REF _Ref31080465 \r \h \* MERGEFORMAT 8.2.5 specifies how the current picture is used in the decoding process of inter prediction in later decoded pictures.
– The processes in subclauses REF _Ref81364253 \r \h 8.3, REF _Ref24436511 \r \h 8.4, REF _Ref81058842 \r \h 8.5, REF _Ref32838078 \r \h 8.6, and REF _Ref35357247 \r \h 8.7 specify decoding processes using syntax elements in the macroblock layer and above.
– The intra prediction process for I and SI macroblocks, except for I_PCM macroblocks as specified in subclause REF _Ref81364253 \r \h \* MERGEFORMAT 8.3, has intra prediction samples as its output. For I_PCM macroblocks subclause REF _Ref81364253 \r \h \* MERGEFORMAT 8.3 directly specifies a picture construction process. The output are the constructed samples prior to the deblocking filter process.
– The inter prediction process for P and B macroblocks is specified in subclause REF _Ref24436511 \r \h \* MERGEFORMAT 8.4 with inter prediction samples being the output.
– The transform coefficient decoding process and picture construction process prior to deblocking filter process are specified in subclause REF _Ref81058842 \r \h \* MERGEFORMAT 8.5. That process derives samples for I and B macroblocks and for P macroblocks in P slices. The output are constructed samples prior to the deblocking filter process.
– The decoding process for P macroblocks in SP slices or SI macroblocks is specified in subclause REF _Ref32838078 \r \h \* MERGEFORMAT 8.6. That process derives samples for P macroblocks in SP slices and for SI macroblocks. The output are constructed samples prior to the deblocking filter process.
– The constructed samples prior to the deblocking filter process that are next to the edges of blocks and macroblocks are processed by a deblocking filter as specified in subclause REF _Ref35357247 \r \h \* MERGEFORMAT 8.7 with the output being the decoded samples.
NAL unit decoding process
Inputs to this process are NAL units.
Outputs of this process are the RBSP syntax structures encapsulated within the NAL units.
The decoding process for each NAL unit extracts the RBSP syntax structure from the NAL unit and then operates the decoding processes specified for the RBSP syntax structure in the NAL unit as follows.
Subclause REF _Ref24436509 \w \h 8.2 describes the decoding process for NAL units with nal_unit_type equal to 1 through 5.
Subclauses REF _Ref81364253 \r \h 8.3 describes the decoding process for a macroblock or part of a macroblock coded in NAL units with nal_unit_type equal to 1, 2, and 5.
Subclause REF _Ref24436511 \w \h 8.4 describes the decoding process for a macroblock or part of a macroblock coded in NAL units with nal_unit_type equal to 1 and 2.
Subclause REF _Ref81058842 \r \h 8.5 describes the decoding process for a macroblock or part of a macroblock coded in NAL units with nal_unit_type equal to 1 and 3 to 5.
Subclause REF _Ref32838078 \r \h 8.6 describes the decoding process for a macroblock or part of a macroblock coded in NAL units with nal_unit_type equal to 1 and 3 to 5.
Subclause REF _Ref35357247 \r \h 8.7 describes the decoding process for a macroblock or part of a macroblock coded in NAL units with nal_unit_type equal to 1 to 5.
NAL units with nal_unit_type equal to 7 and 8 contain sequence parameter sets and picture parameter sets, respectively. Picture parameter sets are used in the decoding processes of other NAL units as determined by reference to a picture parameter set within the slice headers of each picture. Sequence parameter sets are used in the decoding processes of other NAL units as determined by reference to a sequence parameter set within the picture parameter sets of each sequence.
No normative decoding process is specified for NAL units with nal_unit_type equal to 6, 9, 10, 11, and 12.
Slice decoding process
Decoding process for picture order count
Outputs of this process are TopFieldOrderCnt (if applicable) and BottomFieldOrderCnt (if applicable).
Picture order counts are used to determine initial picture orderings for reference pictures in the decoding of B slices (see subclauses REF _Ref23056292 \r \h 8.2.4.2.3 and REF _Ref35357283 \r \h 8.2.4.2.4), to determine co-located pictures (see subclause REF _Ref81457268 \r \h 8.4.1.2.1) for deriving motion parameters in temporal or spatial direct mode, to represent picture order differences between frames or fields for motion vector derivation in temporal direct mode (see subclause REF _Ref23667460 \r \h 8.4.1.2.3), for implicit mode weighted prediction in B slices (see subclause REF _Ref30322871 \r \h 8.4.2.3.2), and for decoder conformance checking (see subclause REF _Ref34233092 \r \h C.4).
Picture order count information is derived for every frame, field (whether decoded from a coded field or as a part of a decoded frame), or complementary field pair as follows:
– Each coded frame is associated with two picture order counts, called TopFieldOrderCnt and BottomFieldOrderCnt for its top field and bottom field, respectively.
– Each coded field is associated with a picture order count, called TopFieldOrderCnt for a coded top field and BottomFieldOrderCnt for a bottom field.
– Each complementary field pair is associated with two picture order counts, which are the TopFieldOrderCnt for its coded top field and the BottomFieldOrderCnt for its coded bottom field, respectively.
TopFieldOrderCnt and BottomFieldOrderCnt indicate the picture order of the corresponding top field or bottom field relative to the first output field of the previous IDR picture or the previous reference picture including a memory_management_control_operation equal to 5 in decoding order.
TopFieldOrderCnt and BottomFieldOrderCnt are derived by invoking one of the decoding processes for picture order count type 0, 1, and 2 in subclauses REF _Ref42333339 \r \h 8.2.1.1, REF _Ref35338603 \r \h 8.2.1.2, and REF _Ref35338606 \r \h 8.2.1.3, respectively. When the current picture includes a memory_ management_ control_ operation equal to 5, after the decoding of the current picture, tempPicOrderCnt is set equal to PicOrderCnt( CurrPic ), TopFieldOrderCnt of the current picture (if any) is set equal to TopFieldOrderCnt " tempPicOrderCnt, and BottomFieldOrderCnt of the current picture (if any) is set equal to BottomFieldOrderCnt " tempPicOrderCnt.
NOTE 1 When the decoding process for a picture currPic that includes a memory_management_control_operation equal to 5 refers to the values of TopFieldOrderCnt (if applicable) or BottomFieldOrderCnt (if applicable) for theis picture currPic (this includinges references to the function PicOrderCnt( ) with the picture currPic as the argument and references to the function DiffPicOrderCnt( ) with one of the arguments being currPic), the values of TopFieldOrderCnt (if applicable) and BottomFieldOrderCnt (if applicable) that are derived as specified in subclauses REF _Ref42333339 \r \h 8.2.1.1, REF _Ref35338603 \r \h 8.2.1.2, and REF _Ref35338606 \r \h 8.2.1.3 for theis picture currPic are used. When the decoding process for a picture refers to the values TopFieldPicOrderCnt (if applicable) or BottomFieldOrderCnt (if applicable) of the previous picture prevMmco5Pic in decoding order that includes a memory_management_control_operation equal to 5 (including references via the functions PicOrderCnt( ) or DiffPicOrderCnt( )), the values of TopFieldOrderCnt (if applicable) and BottomFieldOrderCnt (if applicable) that are used for the picture prevMmco5Pic are the values after the modification specified in the paragraph above (which resultings in TopFieldPicOrderCnt and/or BottomFieldPicOrderCnt equal to 0).
The bitstream shall not contain data that results in Min( TopFieldOrderCnt, BottomFieldOrderCnt ) not equal to 0 for a coded IDR frame, TopFieldOrderCnt not equal to 0 for a coded IDR top field, or BottomFieldOrderCnt not equal to 0 for a coded IDR bottom field. Thus, at least one of TopFieldOrderCnt and BottomFieldOrderCnt shall be equal to 0 for the fields of a coded IDR frame.
When the current picture is not an IDR picture, the following applies.
– Consider the list variable listD containing as elements the TopFieldOrderCnt and BottomFieldOrderCnt values associated with the list of pictures including all of the following
– tThe first picture in the list is the previous picture of any of the following types:
– an IDR picture,
– a picture containing a memory_management_control_operation equal to 5.
– tThe following additional pictures:.
– If pic_order_cnt_type is equal to 0, all other pictures that follow in decoding order after the first picture in the list and are not "non-existing" frames inferred by the decoding process for gaps in frame_num specified in subclause REF _Ref31614329 \r \h 8.2.5.2 and either precede the current picture in decoding order or are the current picture. When pic_order_cnt_type is equal to 0 and the current picture is not a "non-existing" frame inferred by the decoding process for gaps in frame_num specified in subclause REF _Ref31614329 \r \h 8.2.5.2, the current picture is included in listD prior to the invoking of the decoded reference picture marking process.
– Otherwise (pic_order_cnt_type is not equal to 0), all other pictures that follow in decoding order after the first picture in the list and either precede the current picture in decoding order or are the current picture. When pic_order_cnt_type is not equal to 0, the current picture is included in listD prior to the invoking of the decoded reference picture marking process.
– Consider the list variable listO which contains the elements of listD sorted in ascending order. listO shall not contain any of the following:.
– a pair of TopFieldOrderCnt and BottomFieldOrderCnt for a frame or complementary field pair that are not at consecutive positions in listO,.
– a TopFieldOrderCnt that has a value equal to another TopFieldOrderCnt,.
– a BottomFieldOrderCnt that has a value equal to another BottomFieldOrderCnt.,
– a BottomFieldOrderCnt that has a value equal to a TopFieldOrderCnt unless the BottomFieldOrderCnt and TopFieldOrderCnt belong to the same coded frame or complementary field pair.
The bitstream shall not contain data that results in values of TopFieldOrderCnt, BottomFieldOrderCnt, PicOrderCntMsb, or FrameNumOffset used in the decoding process as specified in subclauses REF _Ref42333339 \r \h 8.2.1.1 to REF _Ref35357326 \r \h 8.2.1.3 that exceed the range of values from -"231 to 231 -" 1, inclusive.
The function PicOrderCnt( picX ) is specified as follows:
if( picX is a frame or a complementary field pair ) PicOrderCnt( picX ) = Min( TopFieldOrderCnt, BottomFieldOrderCnt ) of the frame or complementary field pair picXelse if( picX is a top field ) PicOrderCnt( picX ) = TopFieldOrderCnt of field picX ( STYLEREF 1 \s 8- SEQ Equation \r 1 \* ARABIC 1)else if( picX is a bottom field ) PicOrderCnt( picX ) = BottomFieldOrderCnt of field picX
Then DiffPicOrderCnt( picA, picB ) is specified as follows:
DiffPicOrderCnt( picA, picB ) = PicOrderCnt( picA ) -" PicOrderCnt( picB ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 2)
The bitstream shall not contain data that results in values of DiffPicOrderCnt( picA, picB ) used in the decoding process that exceed the range of -"215 to 215 " 1, inclusive.
NOTE 2 1 – Let X be the current picture and Y and Z be two other pictures in the same sequence, Y and Z are considered to be in the same output order direction from X when both DiffPicOrderCnt( X, Y ) and DiffPicOrderCnt( X, Z ) are positive or both are negative.
NOTE 3 2 – Many encodersapplications assign TopFieldOrderCnt and BottomFieldOrderCntPicOrderCnt( X ) proportional to the sampling time of the corresponding fieldpicture X (which is either a coded field or a field of a coded frame) relative to the sampling time of the first output field of the previousan IDR picture or the previous reference picture (in decoding order) that includesing a memory_management_control_operation equal to 5 in decoding order.
When the current picture includes a memory_management_control_operation equal to 5, PicOrderCnt( CurrPic ) shall be greater than PicOrderCnt( any other picture in listD ).
Decoding process for picture order count type 0
This process is invoked when pic_order_cnt_type is equal to 0.
Input to this process is PicOrderCntMsb of the previous reference picture in decoding order as specified in this subclause.
Outputs of this process are either or both TopFieldOrderCnt or BottomFieldOrderCnt.
The variables prevPicOrderCntMsb and prevPicOrderCntLsb are derived as follows.
– If the current picture is an IDR picture, prevPicOrderCntMsb is set equal to 0 and prevPicOrderCntLsb is set equal to 0.
– Otherwise (the current picture is not an IDR picture), the following applies.
– If the previous reference picture in decoding order included a memory_management_control_operation equal to 5, the following applies.
– If the previous reference picture in decoding order is not a bottom field, prevPicOrderCntMsb is set equal to 0 and prevPicOrderCntLsb is set equal to the value of TopFieldOrderCnt for the previous reference picture in decoding order.
– Otherwise (the previous reference picture in decoding order is a bottom field), prevPicOrderCntMsb is set equal to 0 and prevPicOrderCntLsb is set equal to 0.
– Otherwise (the previous reference picture in decoding order did not include a memory_management_control_operation equal to 5), prevPicOrderCntMsb is set equal to PicOrderCntMsb of the previous reference picture in decoding order and prevPicOrderCntLsb is set equal to the value of pic_order_cnt_lsb of the previous reference picture in decoding order.
PicOrderCntMsb of the current picture is derived as followsspecified by the following pseudo-code:
if( ( pic_order_cnt_lsb < prevPicOrderCntLsb ) && ( ( prevPicOrderCntLsb " pic_order_cnt_lsb ) >= ( MaxPicOrderCntLsb / 2 ) ) ) PicOrderCntMsb = prevPicOrderCntMsb + MaxPicOrderCntLsb ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 3)else if( ( pic_order_cnt_lsb > prevPicOrderCntLsb ) && ( ( pic_order_cnt_lsb " prevPicOrderCntLsb ) > ( MaxPicOrderCntLsb / 2 ) ) ) PicOrderCntMsb = prevPicOrderCntMsb " MaxPicOrderCntLsbelse PicOrderCntMsb = prevPicOrderCntMsb
When the current picture is not a bottom field, TopFieldOrderCnt is derived as follows:
if( !field_pic_flag | | !bottom_field_flag ) TopFieldOrderCnt = PicOrderCntMsb + pic_order_cnt_lsb ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 4)
When the current picture is not a top field, BottomFieldOrderCnt is derived as specified by the following pseudo-codefollows:
if( !field_pic_flag ) BottomFieldOrderCnt = TopFieldOrderCnt + delta_pic_order_cnt_bottomelse if( bottom_field_flag ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 5) BottomFieldOrderCnt = PicOrderCntMsb + pic_order_cnt_lsb
Decoding process for picture order count type 1
This process is invoked when pic_order_cnt_type is equal to 1.
Input to this process is FrameNumOffset of the previous picture in decoding order as specified in this subclause.
Outputs of this process are either or both TopFieldOrderCnt or BottomFieldOrderCnt.
The values of TopFieldOrderCnt and BottomFieldOrderCnt are derived as specified in this subclause. Let prevFrameNum be equal to the frame_num of the previous picture in decoding order.
When the current picture is not an IDR picture, the variable prevFrameNumOffset is derived as follows.
– If the previous picture in decoding order included a memory_management_control_operation equal to 5, prevFrameNumOffset is set equal to 0.
– Otherwise (the previous picture in decoding order did not include a memory_management_control_operation equal to 5), prevFrameNumOffset is set equal to the value of FrameNumOffset of the previous picture in decoding order.
NOTE – When gaps_in_frame_num_value_allowed_flag is equal to 1, the previous picture in decoding order may be a "non-existing" frame inferred by the decoding process for gaps in frame_num specified in subclause REF _Ref31614329 \r \h 8.2.5.2.
The derivation proceeds in the following ordered steps.
The variable FrameNumOffset is derived as specified by the following pseudo-codefollows:
if( IdrPicFlag = = 1 ) FrameNumOffset = 0else if( prevFrameNum > frame_num ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 6) FrameNumOffset = prevFrameNumOffset + MaxFrameNumelse FrameNumOffset = prevFrameNumOffset
The variable absFrameNum is derived as specified by the following pseudo-codefollows:
if( num_ref_frames_in_pic_order_cnt_cycle != 0 ) absFrameNum = FrameNumOffset + frame_numelse ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 7) absFrameNum = 0if( nal_ref_idc = = 0 && absFrameNum > 0 ) absFrameNum = absFrameNum –" 1
When absFrameNum > 0, picOrderCntCycleCnt and frameNumInPicOrderCntCycle are derived as follows:
if( absFrameNum > 0 ) { picOrderCntCycleCnt = ( absFrameNum " 1 ) / num_ref_frames_in_pic_order_cnt_cycle frameNumInPicOrderCntCycle = ( absFrameNum " 1 ) % num_ref_frames_in_pic_order_cnt_cycle ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 8)}
The variable expectedDeltaPerPicOrderCntCycle is derived as follows:
expectedDeltaPerPicOrderCntCycle = 0for( i = 0; i < num_ref_frames_in_pic_order_cnt_cycle; i++ ) expectedDeltaPerPicOrderCntCycle += offset_for_ref_frame[ i ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 9)
The variable expectedPicOrderCnt is derived as specified by the following pseudo-codefollows:
if( absFrameNum > 0 ){ expectedPicOrderCnt = picOrderCntCycleCnt * eExpectedDeltaPerPicOrderCntCycle for( i = 0; i <= frameNumInPicOrderCntCycle; i++ ) expectedPicOrderCnt = expectedPicOrderCnt + offset_for_ref_frame[ i ]} else expectedPicOrderCnt = 0if( nal_ref_idc = = 0 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 9) expectedPicOrderCnt = expectedPicOrderCnt + offset_for_non_ref_pic
The variables TopFieldOrderCnt or BottomFieldOrderCnt are derived as specified by the following pseudo-codefollows:
if( !field_pic_flag ) { TopFieldOrderCnt = expectedPicOrderCnt + delta_pic_order_cnt[ 0 ] BottomFieldOrderCnt = TopFieldOrderCnt + offset_for_top_to_bottom_field + delta_pic_order_cnt[ 1 ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 10)} else if( !bottom_field_flag ) TopFieldOrderCnt = expectedPicOrderCnt + delta_pic_order_cnt[ 0 ]else BottomFieldOrderCnt = expectedPicOrderCnt + offset_for_top_to_bottom_field + delta_pic_order_cnt[ 0 ]
Decoding process for picture order count type 2
This process is invoked when pic_order_cnt_type is equal to 2.
Outputs of this process are either or both TopFieldOrderCnt or BottomFieldOrderCnt.
Let prevFrameNum be equal to the frame_num of the previous picture in decoding order.
When the current picture is not an IDR picture, the variable prevFrameNumOffset is derived as follows.
– If the previous picture in decoding order included a memory_management_control_operation equal to 5, prevFrameNumOffset is set equal to 0.
– Otherwise (the previous picture in decoding order did not include a memory_management_control_operation equal to 5), prevFrameNumOffset is set equal to the value of FrameNumOffset of the previous picture in decoding order.
NOTE 1 – When gaps_in_frame_num_value_allowed_flag is equal to 1, the previous picture in decoding order may be a "non-existing" frame inferred by the decoding process for gaps in frame_num specified in subclause REF _Ref31614329 \r \h 8.2.5.2.
The variable FrameNumOffset is derived as specified by the following pseudo-codefollows:.
if( IdrPicFlag = = 1 ) FrameNumOffset = 0else if( prevFrameNum > frame_num ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 11) FrameNumOffset = prevFrameNumOffset + MaxFrameNumelse FrameNumOffset = prevFrameNumOffset
The variable tempPicOrderCnt is derived as specified by the following pseudo-codefollows:
if( IdrPicFlag = = 1 ) tempPicOrderCnt = 0else if( nal_ref_idc = = 0 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 12) tempPicOrderCnt = 2 * ( FrameNumOffset + frame_num ) " 1else tempPicOrderCnt = 2 * ( FrameNumOffset + frame_num )
The variables TopFieldOrderCnt or BottomFieldOrderCnt are derived as specified by the following pseudo-codefollows:
if( !field_pic_flag ) { TopFieldOrderCnt = tempPicOrderCnt BottomFieldOrderCnt = tempPicOrderCnt ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 13)} else if( bottom_field_flag ) BottomFieldOrderCnt = tempPicOrderCntelse TopFieldOrderCnt = tempPicOrderCnt
NOTE 2 – Picture order count type 2 cannot be used in a coded video sequence that contains consecutive non-reference pictures that would result in more than one of these pictures having the same value of TopFieldOrderCnt or more than one of these pictures having the same value of BottomFieldOrderCnt.
NOTE 3 – Picture order count type 2 results in an output order that is the same as the decoding order.
Decoding process for macroblock to slice group map
Inputs to this process are the active picture parameter set and the slice header of the slice to be decoded.
Output of this process is a macroblock to slice group map MbToSliceGroupMap.
This process is invoked at the start of every slice.
NOTE – The output of this process is equal for all slices of a picture.
When num_slice_groups_minus1 is equal to 1 and slice_group_map_type is equal to 3, 4, or 5, slice groups 0 and 1 have a size and shape determined by slice_group_change_direction_flag as shown in REF _Ref33875385 \h Table 81 and specified in subclauses REF _Ref19429983 \r \h 8.2.2.4 to REF _Ref33869005 \r \h 8.2.2.6.
Table STYLEREF 1 \s 8 SEQ Table \* ARABIC \s 1 1 – Refined slice group map type
slice_group_map_typeslice_group_change_direction_flagrefined slice group map type30Box-out clockwise31Box-out counter-clockwise40Raster scan41Reverse raster scan50Wipe right51Wipe left
In such a case, MapUnitsInSliceGroup0 slice group map units in the specified growth order are allocated for slice group 0 and the remaining PicSizeInMapUnits –" MapUnitsInSliceGroup0 slice group map units of the picture are allocated for slice group 1.
When num_slice_groups_minus1 is equal to 1 and slice_group_map_type is equal to 4 or 5, the variable sizeOfUpperLeftGroup is defined as follows:
sizeOfUpperLeftGroup = ( slice_group_change_direction_flag ? ( PicSizeInMapUnits " MapUnitsInSliceGroup0 ) : MapUnitsInSliceGroup0 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 14)
The variable mapUnitToSliceGroupMap is derived as follows.
If num_slice_groups_minus1 is equal to 0, the map unit to slice group map is generated for all i ranging from 0 to PicSizeInMapUnits " 1, inclusive, as specified by:
mapUnitToSliceGroupMap[ i ] = 0 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 15)
– Otherwise (num_slice_groups_minus1 is not equal to 0), mapUnitToSliceGroupMap is derived as follows.
– If slice_group_map_type is equal to 0, the derivation of mapUnitToSliceGroupMap as specified in subclause REF _Ref33427438 \r \h 8.2.2.1 applies.
– Otherwise, if slice_group_map_type is equal to 1, the derivation of mapUnitToSliceGroupMap as specified in subclause REF _Ref33427452 \r \h 8.2.2.2 applies.
– Otherwise, if slice_group_map_type is equal to 2, the derivation of mapUnitToSliceGroupMap as specified in subclause REF _Ref33430080 \r \h 8.2.2.3 applies.
– Otherwise, if slice_group_map_type is equal to 3, the derivation of mapUnitToSliceGroupMap as specified in subclause REF _Ref33433090 \r \h 8.2.2.4 applies.
– Otherwise, if slice_group_map_type is equal to 4, the derivation of mapUnitToSliceGroupMap as specified in subclause REF _Ref33433081 \r \h 8.2.2.5 applies.
– Otherwise, if slice_group_map_type is equal to 5, the derivation of mapUnitToSliceGroupMap as specified in subclause REF _Ref33869005 \r \h 8.2.2.6 applies.
– Otherwise (slice_group_map_type is equal to 6), the derivation of mapUnitToSliceGroupMap as specified in subclause REF _Ref33869009 \r \h 8.2.2.7 applies.
After derivation of the mapUnitToSliceGroupMap, the process specified in subclause REF _Ref33430125 \r \h 8.2.2.8 is invoked to convert the map unit to slice group map mapUnitToSliceGroupMap to the macroblock to slice group map MbToSliceGroupMap. After derivation of the macroblock to slice group map as specified in subclause REF _Ref33430125 \r \h 8.2.2.8, the function NextMbAddress( n ) is defined as the value of the variable nextMbAddress derived as specified by the following pseudo-code:
i = n + 1while( i < PicSizeInMbs && MbToSliceGroupMap[ i ] != MbToSliceGroupMap[ n ] ) i++;nextMbAddress = i ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 16)
Specification for interleaved slice group map type
The specifications in this subclause apply when slice_group_map_type is equal to 0.
The map unit to slice group map is generated as specified by the following pseudo-code:
i = 0do for( iGroup = 0; iGroup <= num_slice_groups_minus1 && i < PicSizeInMapUnits; i += run_length_minus1[ iGroup++ ] + 1 ) for( j = 0; j <= run_length_minus1[ iGroup ] && i + j < PicSizeInMapUnits; j++ ) mapUnitToSliceGroupMap[ i + j ] = iGroup ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 17)while( i < PicSizeInMapUnits )
Specification for dispersed slice group map type
The specifications in this subclause apply when slice_group_map_type is equal to 1.
The map unit to slice group map is generated as specified by the following pseudo-code:
for( i = 0; i < PicSizeInMapUnits; i++ ) mapUnitToSliceGroupMap[ i ] = ( ( i % PicWidthInMbs ) + ( ( ( i / PicWidthInMbs ) * ( num_slice_groups_minus1 + 1 ) ) / 2 ) ) % ( num_slice_groups_minus1 + 1 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 18)
Specification for foreground with left-over slice group map type
The specifications in this subclause apply when slice_group_map_type is equal to 2.
The map unit to slice group map is generated as specified by the following pseudo-code:
for( i = 0; i < PicSizeInMapUnits; i++ ) mapUnitToSliceGroupMap[ i ] = num_slice_groups_minus1for( iGroup = num_slice_groups_minus1 –" 1; iGroup >= 0; iGroup-" -" ) { yTopLeft = top_left[ iGroup ] / PicWidthInMbs xTopLeft = top_left[ iGroup ] % PicWidthInMbs yBottomRight = bottom_right[ iGroup ] / PicWidthInMbs xBottomRight = bottom_right[ iGroup ] % PicWidthInMbs for( y = yTopLeft; y <= yBottomRight; y++ ) for( x = xTopLeft; x <= xBottomRight; x++ ) mapUnitToSliceGroupMap[ y * PicWidthInMbs + x ] = iGroup ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 19)}
NOTE – The rectangles may overlap. Slice group 0 contains the macroblocks that are within the rectangle specified by top_left[ 0 ] and bottom_right[ 0 ]. A slice group having slice group ID greater than 0 and less than num_slice_groups_minus1 contains the macroblocks that are within the specified rectangle for that slice group that are not within the rectangle specified for any slice group having a smaller slice group ID. The slice group with slice group ID equal to num_slice_groups_minus1 contains the macroblocks that are not in the other slice groups.
Specification for box-out slice group map types
The specifications in this subclause apply when slice_group_map_type is equal to 3.
The map unit to slice group map is generated as specified by:
for( i = 0; i < PicSizeInMapUnits; i++ ) mapUnitToSliceGroupMap[ i ] = 1x = ( PicWidthInMbs " slice_group_change_direction_flag ) / 2y = ( PicHeightInMapUnits " slice_group_change_direction_flag ) / 2( leftBound, topBound ) = ( x, y )( rightBound, bottomBound ) = ( x, y )( xDir, yDir ) = ( slice_group_change_direction_flag " 1, slice_group_change_direction_flag )for( k = 0; k < MapUnitsInSliceGroup0; k += mapUnitVacant ) { mapUnitVacant = ( mapUnitToSliceGroupMap[ y * PicWidthInMbs + x ] = = 1 ) if( mapUnitVacant ) mapUnitToSliceGroupMap[ y * PicWidthInMbs + x ] = 0 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 20) if( xDir = = –"1 && x = = leftBound ) { leftBound = Max( leftBound " 1, 0 ) x = leftBound ( xDir, yDir ) = ( 0, 2 * slice_group_change_direction_flag " 1 ) } else if( xDir = = 1 && x = = rightBound ) { rightBound = Min( rightBound + 1, PicWidthInMbs " 1 ) x = rightBound ( xDir, yDir ) = ( 0, 1 " 2 * slice_group_change_direction_flag ) } else if( yDir = = "1 && y = = topBound ) { topBound = Max( topBound " 1, 0 ) y = topBound ( xDir, yDir ) = ( 1 " 2 * slice_group_change_direction_flag, 0 ) } else if( yDir = = 1 && y = = bottomBound ) { bottomBound = Min( bottomBound + 1, PicHeightInMapUnits " 1 ) y = bottomBound ( xDir, yDir ) = ( 2 * slice_group_change_direction_flag " 1, 0 ) } else ( x, y ) = ( x + xDir, y + yDir )}
Specification for raster scan slice group map types
The specifications in this subclause apply when slice_group_map_type is equal to 4.
The map unit to slice group map is generated as specified by:
for( i = 0; i < PicSizeInMapUnits; i++ ) if( i < sizeOfUpperLeftGroup ) mapUnitToSliceGroupMap[ i ] = slice_group_change_direction_flag else ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 21) mapUnitToSliceGroupMap[ i ] = 1 –" slice_group_change_direction_flag
Specification for wipe slice group map types
The specifications in this subclause apply when slice_group_map_type is equal to 5.
The map unit to slice group map is generated as specified by:
k = 0;for( j = 0; j < PicWidthInMbs; j++ ) for( i = 0; i < PicHeightInMapUnits; i++ ) if( k++ < sizeOfUpperLeftGroup ) mapUnitToSliceGroupMap[ i * PicWidthInMbs + j ] = slice_group_change_direction_flag else ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 22) mapUnitToSliceGroupMap[ i * PicWidthInMbs + j ] = 1 –" slice_group_change_direction_flag
Specification for explicit slice group map type
The specifications in this subclause apply when slice_group_map_type is equal to 6.
The map unit to slice group map is generated as specified by:
mapUnitToSliceGroupMap[ i ] = slice_group_id[ i ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 23)
for all i ranging from 0 to PicSizeInMapUnits " 1, inclusive.
Specification for conversion of map unit to slice group map to macroblock to slice group map
For each value of i ranging from 0 to PicSizeInMbs " 1, inclusive, the macroblock to slice group map is specified as follows.
If frame_mbs_only_flag is equal to 1 or field_pic_flag is equal to 1, the macroblock to slice group map is specified by:
MbToSliceGroupMap[ i ] = mapUnitToSliceGroupMap[ i ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 24)
– Otherwise, if MbaffFrameFlag is equal to 1, the macroblock to slice group map is specified by:
MbToSliceGroupMap[ i ] = mapUnitToSliceGroupMap[ i / 2 ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 25)
– Otherwise (frame_mbs_only_flag is equal to 0 and mb_adaptive_frame_field_flag is equal to 0 and field_pic_flag is equal to 0), the macroblock to slice group map is specified by:
MbToSliceGroupMap[ i ] = mapUnitToSliceGroupMap[ ( i / ( 2 * PicWidthInMbs ) ) * PicWidthInMbs + ( i % PicWidthInMbs ) ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 26)
Decoding process for slice data partitionsing
Inputs to this process are
– a slice data partition A layer RBSP,
– when syntax elements of category 3 are present in the slice data, a slice data partition B layer RBSP having the same slice_id as in the slice data partition A layer RBSP, and
– when syntax elements of category 4 are present in the slice data, a slice data partition C layer RBSP having the same slice_id as in the slice data partition A layer RBSP.
NOTE 1 – The slice data partition B layer RBSP and slice data partition C layer RBSP need not be present.
Output of this process is a coded slice.
When slice data partitioning is not used, coded slices are represented by a slice layer without partitioning RBSP that contains a slice header followed by a slice data syntax structure that contains all the syntax elements of categories 2, 3, and 4 (see category column in subclause REF _Ref20133281 \r \h 7.3) of the macroblock data for the macroblocks of the slice.
When slice data partitioning is used, the macroblock data of a slice is partitioned into one to three partitions contained in separate NAL units. Partition A contains a slice data partition A header, and all syntax elements of category 2. Partition B, when present, contains a slice data partition B header and all syntax elements of category 3. Partition C, when present, contains a slice data partition C header and all syntax elements of category 4.
When slice data partitioning is used, the syntax elements of each category are parsed from a separate NAL unit, which need not be present when no symbols of the respective category exist. The decoding process shall process the slice data partitions of a coded slice in a manner equivalent to processing a corresponding slice layer without partitioning RBSP by extracting each syntax element from the slice data partition in which the syntax element appears depending on the slice data partition assignment in the syntax tables in subclause REF _Ref20133281 \r \h 7.3.
NOTE 2 – Syntax elements of category 3 are relevant to the decoding of residual data of I and SI macroblock types. Syntax elements of category 4 are relevant to the decoding of residual data of P and B macroblock types. Category 2 encompasses all other syntax elements related to the decoding of macroblocks, and their information is often denoted as header information. The slice data partition A header contains all the syntax elements of the slice header, and additionally a slice_id that are used to associate the slice data partitions B and C with the slice data partition A. The slice data partition B and C headers contain the slice_id syntax element that establishes their association with the slice data partition A of the slice.
Decoding process for reference picture lists construction
This process is invoked at the beginning of the decoding process forof each P, SP, or B slice.
Decoded reference pictures are marked as "used for short-term reference" or "used for long-term reference" as specified by the bitstream and specified in subclause REF _Ref31080465 \r \h 8.2.5. Short-term reference pictures are identified by the value of frame_num. Long-term reference pictures are assigned a long-term frame index as specified by the bitstream and specified in subclause REF _Ref31080465 \r \h 8.2.5.
Subclause REF _Ref26832915 \r \h 8.2.4.1 is invoked to specify
– the assignment of variables FrameNum, FrameNumWrap, and PicNum to each of the short-term reference pictures, and
– the assignment of variable LongTermPicNum to each of the long-term reference pictures.
Reference pictures are addressed through reference indices as specified in subclause REF _Ref31083043 \r \h 8.4.2.1. A reference index is an index into a reference picture list. When decoding a P or SP slice, there is a single reference picture list RefPicList0. When decoding a B slice, there is a second independent reference picture list RefPicList1 in addition to RefPicList0.
At the beginning of the decoding process forof each slice, reference picture list RefPicList0, and for B slices RefPicList1, are derived as specified by the following ordered steps:.
– An initial reference picture list RefPicList0 and for B slices RefPicList1 are derived as specified in subclause REF _Ref31614179 \r \h 8.2.4.2.
– When ref_pic_list_modification_flag_l0 is equal to 1 or, when decoding a B slice, ref_pic_list_modification_flag_l1 is equal to 1, Tthe initial reference picture list RefPicList0 and for B slices RefPicList1 are modified as specified in subclause REF _Ref31093198 \r \h \* MERGEFORMAT 8.2.4.3.
NOTE – The reordering modification process for reference picture lists specified in subclause REF _Ref31093198 \r \h \* MERGEFORMAT 8.2.4.3 allows the contents of RefPicList0 and for B slices RefPicList1 to be modified in a flexible fashion. In particular, it is possible for a picture that is currently marked "used for reference" to be inserted into RefPicList0 and for B slices RefPicList1 even when the picture is not in the initial reference picture list derived as specified in subclause REF _Ref31614179 \r \h 8.2.4.2.
The number of entries in the modified reference picture list RefPicList0 is num_ref_idx_l0_active_minus1 + 1, and for B slices the number of entries in the modified reference picture list RefPicList1 is num_ref_idx_l1_active_minus1 + 1. A reference picture may appear at more than one index in the modified reference picture lists RefPicList0 or RefPicList1.
Decoding process for picture numbers
This process is invoked when the decoding process for reference picture lists construction specified in subclause REF _Ref36860719 \r \h 8.2.4 or the decoded reference picture marking process specified in subclause REF _Ref31093157 \r \h 8.2.5 is invoked.
The variables FrameNum, FrameNumWrap, PicNum, LongTermFrameIdx, and LongTermPicNum are used for the initialisation process for reference picture lists in subclause REF _Ref31614215 \r \h 8.2.4.2, the modification process for reference picture lists in subclause REF _Ref31093202 \r \h 8.2.4.3, and for the decoded reference picture marking process in subclause REF _Ref31093157 \r \h 8.2.5.
To each short-term reference picture the variables FrameNum and FrameNumWrap are assigned as follows. First, FrameNum is set equal to the syntax element frame_num that has been decoded in the slice header(s) of the corresponding short-term reference picture. Then the variable FrameNumWrap is derived as
if( FrameNum > frame_num ) FrameNumWrap = FrameNum " MaxFrameNum ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 27)else FrameNumWrap = FrameNum
where the value of frame_num used in Equation REF FrameNumWrap_Eqn \h 8-27 is the frame_num in the slice header(s) for the current picture.
Each long-term reference picture has an associated value of LongTermFrameIdx (that was assigned to it as specified in subclause REF _Ref31093157 \r \h 8.2.5).
To each short-term reference picture a variable PicNum is assigned, and to each long-term reference picture a variable LongTermPicNum is assigned. The values of these variables depend on the value of field_pic_flag and bottom_field_flag for the current picture and they are set as follows.
– If field_pic_flag is equal to 0, the following applies.ordered steps are specified:
– For each short-term reference frame or complementary reference field pair:
PicNum = FrameNumWrap ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 28)
– For each long-term reference frame or long-term complementary reference field pair:
LongTermPicNum = LongTermFrameIdx ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 29)
NOTE – When decoding a frame the value of MbaffFrameFlag has no influence on the derivations in subclauses REF _Ref31614235 \r \h \* MERGEFORMAT 8.2.4.2, REF _Ref31093202 \r \h \* MERGEFORMAT 8.2.4.3, and REF _Ref31093157 \r \h \* MERGEFORMAT 8.2.5.
– Otherwise (field_pic_flag is equal to 1), the following applies.ordered steps are specified:
– For each short-term reference field the following applies.
– If the reference field has the same parity as the current field
PicNum = 2 * FrameNumWrap + 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 30)
– Otherwise (the reference field has the opposite parity of the current field),
PicNum = 2 * FrameNumWrap ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 31)
– For each long-term reference field the following applies.
– If the reference field has the same parity as the current field
LongTermPicNum = 2 * LongTermFrameIdx + 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 32)
– Otherwise (the reference field has the opposite parity of the current field),
LongTermPicNum = 2 * LongTermFrameIdx ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 33)
Initialisation process for reference picture lists
This initialisation process is invoked when decoding a P, SP, or B slice header.
RefPicList0 and RefPicList1 have initial entries as specified in subclauses REF _Ref31086001 \r \h 8.2.4.2.1 through REF _Ref81364370 \r \h 8.2.4.2.5.
When the number of entries in the initial RefPicList0 or RefPicList1 produced as specified in subclauses REF _Ref31086001 \r \h 8.2.4.2.1 through REF _Ref81364370 \r \h 8.2.4.2.5 is greater than num_ref_idx_l0_active_minus1 + 1 or num_ref_idx_l1_active_minus1 + 1, respectively, the extra entries past position num_ref_idx_l0_active_minus1 or num_ref_idx_l1_active_minus1 are discarded from the initial reference picture list.
When the number of entries in the initial RefPicList0 or RefPicList1 produced as specified in subclauses REF _Ref31086001 \r \h 8.2.4.2.1 through REF _Ref81364370 \r \h 8.2.4.2.5 is less than num_ref_idx_l0_active_minus1 + 1 or num_ref_idx_l1_active_minus1 + 1, respectively, the remaining entries in the initial reference picture list are set equal to "no reference picture".
Initialisation process for the reference picture list for P and SP slices in frames
This initialisation process is invoked when decoding a P or SP slice in a coded frame.
When this process is invoked, there shall be at least one reference frame or complementary reference field pair that is currently marked as "used for reference" (i.e., as "used for short-term reference" or "used for long-term reference") and is not marked as "non-existing".
The reference picture list RefPicList0 is ordered so that short-term reference frames and short-term complementary reference field pairs have lower indices than long-term reference frames and long-term complementary reference field pairs.
The short-term reference frames and complementary reference field pairs are ordered starting with the frame or complementary field pair with the highest PicNum value and proceeding through in descending order to the frame or complementary field pair with the lowest PicNum value.
The long-term reference frames and complementary reference field pairs are ordered starting with the frame or complementary field pair with the lowest LongTermPicNum value and proceeding through in ascending order to the frame or complementary field pair with the highest LongTermPicNum value.
NOTE – A non-paired reference field is not used for inter prediction for decoding a frame, regardless of the value of MbaffFrameFlag.
For example, when three reference frames are marked as "used for short-term reference" with PicNum equal to 300, 302, and 303 and two reference frames are marked as "used for long-term reference" with LongTermPicNum equal to 0 and 3, the initial index order is:
– RefPicList0[0] is set equal to the short-term reference picture with PicNum = 303,
– RefPicList0[1] is set equal to the short-term reference picture with PicNum = 302,
– RefPicList0[2] is set equal to the short-term reference picture with PicNum = 300,
– RefPicList0[3] is set equal to the long-term reference picture with LongTermPicNum = 0, and
– RefPicList0[4] is set equal to the long-term reference picture with LongTermPicNum = 3.
Initialisation process for the reference picture list for P and SP slices in fields
This initialisation process is invoked when decoding a P or SP slice in a coded field.
When this process is invoked, there shall be at least one reference field (which can be a field of a reference frame) that is currently marked as "used for reference" (i.e., as "used for short-term reference" or "used for long-term reference") and is not marked as "non-existing".
Each field included in the reference picture list RefPicList0 has a separate index in the reference picture list RefPicList0.
NOTE – When decoding a field, there are effectively at least twice as many pictures available for referencing as there would be when decoding a frame at the same position in decoding order.
Two ordered lists of reference frames, refFrameList0ShortTerm and refFrameList0LongTerm, are derived as follows. For purposes of the formation of this list of frames, decoded reference frames, complementary reference field pairs, non-paired reference fields and reference frames in which a single field is marked "used for short-term reference" or "used for long-term reference" are all considered reference frames.
– All frames having one or more fields marked "used for short-term reference" are included in the list of short-term reference frames refFrameList0ShortTerm. When the current field is the second field (in decoding order) of a complementary reference field pair and the first field is marked as "used for short-term reference", the first field is included in the list of short-term reference frames refFrameList0ShortTerm. refFrameList0ShortTerm is ordered starting with the reference frame with the highest FrameNumWrap value and proceeding through in descending order to the reference frame with the lowest FrameNumWrap value.
– All frames having one or more fields marked "used for long-term reference" are included in the list of long-term reference frames refFrameList0LongTerm. When the current field is the second field (in decoding order) of a complementary reference field pair and the first field is marked as "used for long-term reference, the first field is included in the list of long-term reference frames refFrameList0LongTerm. refFrameList0LongTerm is ordered starting with the reference frame with the lowest LongTermFrameIdx value and proceeding through in ascending order to the reference frame with the highest LongTermFrameIdx value.
The process specified in subclause REF _Ref81364370 \r \h 8.2.4.2.5 is invoked with refFrameList0ShortTerm and refFrameList0LongTerm given as input and the output is assigned to RefPicList0.
Initialisation process for reference picture lists for B slices in frames
This initialisation process is invoked when decoding a B slice in a coded frame.
For purposes of the formation of the reference picture lists RefPicList0 and RefPicList1 the term reference entry refers in the following to decoded reference frames or complementary reference field pairs.
When this process is invoked, there shall be at least one reference entry that is currently marked as "used for reference" (i.e., as "used for short-term reference" or "used for long-term reference") and is not marked as "non-existing".
For B slices, the order of short-term reference entries in the reference picture lists RefPicList0 and RefPicList1 depends on output order, as given by PicOrderCnt( ). When pic_order_cnt_type is equal to 0, reference pictures that are marked as "non-existing" as specified in subclause REF _Ref31614329 \r \h 8.2.5.2 are not included in either RefPicList0 or RefPicList1.
NOTE 1 – When gaps_in_frame_num_value_allowed_flag is equal to 1, encoders should use reference picture list reordering modification to ensure proper operation of the decoding process (particularly when pic_order_cnt_type is equal to 0, in which case PicOrderCnt( ) is not inferred for "non-existing" frames).
The reference picture list RefPicList0 is ordered such that short-term reference entries have lower indices than long-term reference entries. It is ordered as follows:.
– Let entryShortTerm be a variable ranging over all reference entries that are currently marked as "used for short-term reference". When some values of entryShortTerm are present having PicOrderCnt( entryShortTerm ) less than PicOrderCnt( CurrPic ), these values of entryShortTerm are placed at the beginning of refPicList0 in descending order of PicOrderCnt( entryShortTerm ). All of the remaining values of entryShortTerm (when present) are then appended to refPicList0 in ascending order of PicOrderCnt( entryShortTerm ).
– The long-term reference entries are ordered starting with the long-term reference entry that has the lowest LongTermPicNum value and proceeding through in ascending order to the long-term reference entry that has the highest LongTermPicNum value.
The reference picture list RefPicList1 is ordered so that short-term reference entries have lower indices than long-term reference entries. It is ordered as follows:.
– Let entryShortTerm be a variable ranging over all reference entries that are currently marked as "used for short-term reference". When some values of entryShortTerm are present having PicOrderCnt( entryShortTerm ) greater than PicOrderCnt( CurrPic ), these values of entryShortTerm are placed at the beginning of refPicList1 in ascending order of PicOrderCnt( entryShortTerm ). All of the remaining values of entryShortTerm (when present) are then appended to refPicList1 in descending order of PicOrderCnt( entryShortTerm ).
– Long-term reference entries are ordered starting with the long-term reference frame or complementary reference field pair that has the lowest LongTermPicNum value and proceeding through in ascending order to the long-term reference entry that has the highest LongTermPicNum value.
– When the reference picture list RefPicList1 has more than one entry and RefPicList1 is identical to the reference picture list RefPicList0, the first two entries RefPicList1[ 0 ] and RefPicList1[ 1 ] are switched.
NOTE 2 – A non-paired reference field is not used for inter prediction of frames (independent of the value of MbaffFrameFlag).
Initialisation process for reference picture lists for B slices in fields
This initialisation process is invoked when decoding a B slice in a coded field.
When this process is invoked, there shall be at least one reference field (which can be a field of a reference frame) that is currently marked as "used for reference" (i.e., as "used for short-term reference" or "used for long-term reference") and is not marked as "non-existing".
When decoding a field, each field of a stored reference frame is identified as a separate reference picture with a unique index. The order of short-term reference pictures in the reference picture lists RefPicList0 and RefPicList1 depend on output order, as given by PicOrderCnt( ). When pic_order_cnt_type is equal to 0, reference pictures that are marked as "non-existing" as specified in subclause REF _Ref31614329 \r \h 8.2.5.2 are not included in either RefPicList0 or RefPicList1.
NOTE 1 – When gaps_in_frame_num_value_allowed_flag is equal to 1, encoders should use reference picture list reordering modification to ensure proper operation of the decoding process (particularly when pic_order_cnt_type is equal to 0, in which case PicOrderCnt( ) is not inferred for "non-existing" frames).
NOTE 2 – When decoding a field, there are effectively at least twice as many pictures available for referencing as there would be when decoding a frame at the same position in decoding order.
Three ordered lists of reference frames, refFrameList0ShortTerm, refFrameList1ShortTerm and refFrameListLongTerm, are derived as follows. For purposes of the formation of these lists of frames the term reference entry refers in the following to decoded reference frames, complementary reference field pairs, or non-paired reference fields. When pic_order_cnt_type is equal to 0, the term reference entry does not refer to frames that are marked as "non-existing" as specified in subclause REF _Ref31614329 \r \h 8.2.5.2.
– Let entryShortTerm be a variable ranging over all reference entries that are currently marked as "used for short-term reference". When some values of entryShortTerm are present having PicOrderCnt( entryShortTerm ) less than or equal to PicOrderCnt( CurrPic ), these values of entryShortTerm are placed at the beginning of refFrameList0ShortTerm in descending order of PicOrderCnt( entryShortTerm ). All of the remaining values of entryShortTerm (when present) are then appended to refFrameList0ShortTerm in ascending order of PicOrderCnt( entryShortTerm ).
NOTE 3 – When the current field follows in decoding order a coded field fldPrev with which together it forms a complementary reference field pair, fldPrev is included into the list refFrameList0ShortTerm using PicOrderCnt( fldPrev ) and the ordering method described in the previous sentence is applied.
– Let entryShortTerm be a variable ranging over all reference entries that are currently marked as "used for short-term reference". When some values of entryShortTerm are present having PicOrderCnt( entryShortTerm ) greater than PicOrderCnt( CurrPic ), these values of entryShortTerm are placed at the beginning of refFrameList1ShortTerm in ascending order of PicOrderCnt( entryShortTerm ). All of the remaining values of entryShortTerm (when present) are then appended to refFrameList1ShortTerm in descending order of PicOrderCnt( entryShortTerm ).
NOTE 4 – When the current field follows in decoding order a coded field fldPrev with which together it forms a complementary reference field pair, fldPrev is included into the list refFrameList1ShortTerm using PicOrderCnt( fldPrev ) and the ordering method described in the previous sentence is applied.
– refFrameListLongTerm is ordered starting with the reference entry having the lowest LongTermFrameIdx value and proceeding through in ascending order to the reference entry having highest LongTermFrameIdx value.
NOTE 5 – When the complementary field of the current picture is the second field of a complementary field pair and the first field of the complementary field pair is marked as "used for long-term reference", the first field it is included into the list refFrameListLongTerm. A reference entry in which only one field is marked as “"used for long-term reference”" is included into the list refFrameListLongTerm.
The process specified in subclause REF _Ref81364370 \r \h 8.2.4.2.5 is invoked with refFrameList0ShortTerm and refFrameListLongTerm given as input and the output is assigned to RefPicList0.
The process specified in subclause REF _Ref81364370 \r \h 8.2.4.2.5 is invoked with refFrameList1ShortTerm and refFrameListLongTerm given as input and the output is assigned to RefPicList1.
When the reference picture list RefPicList1 has more than one entry and RefPicList1 is identical to the reference picture list RefPicList0, the first two entries RefPicList1[0] and RefPicList1[1] are switched.
Initialisation process for reference picture lists in fields
Inputs of this process are the reference frame lists refFrameListXShortTerm (with X may be 0 or 1) and refFrameListLongTerm.
The reference picture list RefPicListX is a list ordered such that short-term reference fields have lower indices than long-term reference fields. Given the reference frame lists refFrameListXShortTerm and refFrameListLongTerm, it is derived as specified by the followsing ordered steps:.
– Short-term reference fields are ordered by selecting reference fields from the ordered list of frames refFrameListXShortTerm by alternating between fields of differing parity, starting with a field that has the same parity as the current field (when present). When one field of a reference frame was not decoded or is not marked as “"used for short-term reference”", the missing field is ignored and instead the next available stored reference field of the chosen parity from the ordered list of frames refFrameListXShortTerm is inserted into RefPicListX. When there are no more short-term reference fields of the alternate parity in the ordered list of frames refFrameListXShortTerm, the next not yet indexed fields of the available parity are inserted into RefPicListX in the order in which they occur in the ordered list of frames refFrameListXShortTerm.
– Long-term reference fields are ordered by selecting reference fields from the ordered list of frames refFrameListLongTerm by alternating between fields of differing parity, starting with a field that has the same parity as the current field (when present). When one field of a reference frame was not decoded or is not marked as “"used for long-term reference”", the missing field is ignored and instead the next available stored reference field of the chosen parity from the ordered list of frames refFrameListLongTerm is inserted into RefPicListX. When there are no more long-term reference fields of the alternate parity in the ordered list of frames refFrameListLongTerm, the next not yet indexed fields of the available parity are inserted into RefPicListX in the order in which they occur in the ordered list of frames refFrameListLongTerm.
Reordering Modification process for reference picture lists
When ref_pic_list_reorderingmodification_flag_l0 is equal to 1, the following applies:.
– Let refIdxL0 be an index into the reference picture list RefPicList0. It is initially set equal to 0.
– The corresponding syntax elements reorderingmodification_of_pic_nums_idc are processed in the order they occur in the bitstream. For each of these syntax elements, the following applies.
– If modificationreordering_of_pic_nums_idc is equal to 0 or equal to 1, the process specified in subclause REF _Ref31614059 \r \h 8.2.4.3.1 is invoked with refIdxL0 as input, and the output is assigned to refIdxL0.
– Otherwise, if modificationreordering_of_pic_nums_idc is equal to 2, the process specified in subclause REF _Ref31614079 \r \h 8.2.4.3.2 is invoked with refIdxL0 as input, and the output is assigned to refIdxL0.
– Otherwise (modificationreordering_of_pic_nums_idc is equal to 3), the reordering modification process for reference picture list RefPicList0 is finished.
When the current slice is a B slice and ref_pic_list_modificationreordering_flag_l1 is equal to 1, the following applies:.
– Let refIdxL1 be an index into the reference picture list RefPicList1. It is initially set equal to 0.
– The corresponding syntax elements modificationreordering_of_pic_nums_idc are processed in the order they occur in the bitstream. For each of these syntax elements, the following applies.
– If modificationreordering_of_pic_nums_idc is equal to 0 or equal to 1, the process specified in subclause REF _Ref31614094 \r \h \* MERGEFORMAT 8.2.4.3.1 is invoked with refIdxL1 as input, and the output is assigned to refIdxL1.
– Otherwise, if modificationreordering_of_pic_nums_idc is equal to 2, the process specified in subclause REF _Ref31614107 \r \h \* MERGEFORMAT 8.2.4.3.2 is invoked with refIdxL1 as input, and the output is assigned to refIdxL1.
– Otherwise (modificationreordering_of_pic_nums_idc is equal to 3), the modificationreordering process for reference picture list RefPicList1 is finished.
Reordering Modification process of reference picture lists for short-term reference pictures
Input to this process is an index refIdxLX (with X being 0 or 1).
Output of this process is an incremented index refIdxLX.
The variable picNumLXNoWrap is derived as follows.
– If modificationreordering_of_pic_nums_idc is equal to 0,
if( picNumLXPred " ( abs_diff_pic_num_minus1 + 1 ) < 0 ) picNumLXNoWrap = picNumLXPred " ( abs_diff_pic_num_minus1 + 1 ) + MaxPicNum ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 34)else picNumLXNoWrap = picNumLXPred " ( abs_diff_pic_num_minus1 + 1 )
Otherwise (modificationreordering_of_pic_nums_idc is equal to 1),
if( picNumLXPred + ( abs_diff_pic_num_minus1 + 1 ) >= MaxPicNum ) picNumLXNoWrap = picNumLXPred + ( abs_diff_pic_num_minus1 + 1 ) " MaxPicNum ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 35)else picNumLXNoWrap = picNumLXPred + ( abs_diff_pic_num_minus1 + 1 )
picNumLXPred is the prediction value for the variable picNumLXNoWrap. When the process specified in this subclause is invoked the first time for a slice (that is, for the first occurrence of modificationreordering_of_pic_nums_idc equal to 0 or 1 in the ref_pic_list_modificationreordering( ) syntax), picNumL0Pred and picNumL1Pred are initially set equal to CurrPicNum. After each assignment of picNumLXNoWrap, the value of picNumLXNoWrap is assigned to picNumLXPred.
The variable picNumLX is derived as specified by the following pseudo-codefollows:
if( picNumLXNoWrap > CurrPicNum ) picNumLX = picNumLXNoWrap " MaxPicNum ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 36)else picNumLX = picNumLXNoWrap
picNumLX shall be equal to the PicNum of a reference picture that is marked as “"used for short-term reference”" and shall not be equal to the PicNum of a short-term reference picture that is marked as "non-existing".
The following procedure is conducted to place the picture with short-term picture number picNumLX into the index position refIdxLX, shift the position of any other remaining pictures to later in the list, and increment the value of refIdxLX.
for( cIdx = num_ref_idx_lX_active_minus1 + 1; cIdx > refIdxLX; cIdx-" -" ) RefPicListX[ cIdx ] = RefPicListX[ cIdx " 1]RefPicListX[ refIdxLX++ ] = short-term reference picture with PicNum equal to picNumLXnIdx = refIdxLXfor( cIdx = refIdxLX; cIdx <= num_ref_idx_lX_active_minus1 + 1; cIdx++ ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 37) if( PicNumF( RefPicListX[ cIdx ] ) != picNumLX ) RefPicListX[ nIdx++ ] = RefPicListX[ cIdx ]
where the function PicNumF( RefPicListX[ cIdx ] ) is derived as follows.:
– If the picture RefPicListX[ cIdx ] is marked as "used for short-term reference", PicNumF( RefPicListX[ cIdx ] ) is the PicNum of the picture RefPicListX[ cIdx ].
– Otherwise (the picture RefPicListX[ cIdx ] is not marked as "used for short-term reference"), PicNumF( RefPicListX[ cIdx ] ) is equal to MaxPicNum.
NOTE 1 – A value of MaxPicNum can never be equal to picNumLX.
NOTE 2 – Within this pseudo-code procedure, the length of the list RefPicListX is temporarily made one element longer than the length needed for the final list. After the execution of this procedure, only elements 0 through num_ref_idx_lX_active_minus1 of the list need to be retained.
Reordering Modification process of reference picture lists for long-term reference pictures
Input to this process is an index refIdxLX (with X being 0 or 1).
Output of this process is an incremented index refIdxLX.
The following procedure is conducted to place the picture with long-term picture number long_term_pic_num into the index position refIdxLX, shift the position of any other remaining pictures to later in the list, and increment the value of refIdxLX.
for( cIdx = num_ref_idx_lX_active_minus1 + 1; cIdx > refIdxLX; cIdx-" -" ) RefPicListX[ cIdx ] = RefPicListX[ cIdx " 1]RefPicListX[ refIdxLX++ ] = long-term reference picture with LongTermPicNum equal to long_term_pic_numnIdx = refIdxLXfor( cIdx = refIdxLX; cIdx <= num_ref_idx_lX_active_minus1 + 1; cIdx++ ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 38) if( LongTermPicNumF( RefPicListX[ cIdx ] ) != long_term_pic_num ) RefPicListX[ nIdx++ ] = RefPicListX[ cIdx ]
where the function LongTermPicNumF( RefPicListX[ cIdx ] ) is derived as follows.:
– If the picture RefPicListX[ cIdx ] is marked as "used for long-term reference", LongTermPicNumF( RefPicListX[ cIdx ] ) is the LongTermPicNum of the picture RefPicListX[ cIdx ].
– Otherwise (the picture RefPicListX[ cIdx ] is not marked as "used for long-term reference"), LongTermPicNumF( RefPicListX[ cIdx ] ) is equal to 2 * ( MaxLongTermFrameIdx + 1 ).
NOTE 1 – A value of 2 * ( MaxLongTermFrameIdx + 1 ) can never be equal to long_term_pic_num.
NOTE 2 – Within this pseudo-code procedure, the length of the list RefPicListX is temporarily made one element longer than the length needed for the final list. After the execution of this procedure, only elements 0 through num_ref_idx_lX_active_minus1 of the list need to be retained.
Decoded reference picture marking process
This process is invoked for decoded pictures when nal_ref_idc is not equal to 0.
NOTE – The decoding process for gaps in frame_num that is specified in subclause REF _Ref31614329 \r \h 8.2.5.2 may also be invoked when nal_ref_idc is equal to 0, as specified in clause REF _Ref70758137 \r \h 8.
A decoded picture with nal_ref_idc not equal to 0, referred to as a reference picture, is marked as “"used for short-term reference”" or "used for long-term reference". For a decoded reference frame, both of its fields are marked the same as the frame. For a complementary reference field pair, the pair is marked the same as both of its fields. A picture that is marked as "used for short-term reference" is identified by its FrameNum and, when it is a field, by its parity. A picture that is marked as "used for long-term reference" is identified by its LongTermFrameIdx and, when it is a field, by its parity.
Frames or complementary field pairs marked as “"used for short-term reference”" or as "used for long-term reference" can be used as a reference for inter prediction when decoding a frame until the frame, the complementary field pair, or one of its constituent fields is marked as “"unused for reference”". A field marked as “"used for short-term reference”" or as "used for long-term reference" can be used as a reference for inter prediction when decoding a field until marked as “"unused for reference”".
A picture can be marked as "unused for reference" by the sliding window reference picture marking process, a first-in, first-out mechanism specified in subclause REF _Ref31547778 \r \h 8.2.5.3 or by the adaptive memory control reference picture marking process, a customised adaptive marking operation specified in subclause REF _Ref31547788 \r \h 8.2.5.4.
A short-term reference picture is identified for use in the decoding process by its variables FrameNum and FrameNumWrap and its picture number PicNum, and a long-term reference picture is identified for use in the decoding process by its long-term picture number LongTermPicNum. When the current picture is not an IDR picture, subclause REF _Ref26832915 \r \h 8.2.4.1 is invoked to specify the assignment of the variables FrameNum, FrameNumWrap, PicNum and LongTermPicNum.
Sequence of operations for decoded reference picture marking process
Decoded reference picture marking proceeds in the following ordered steps:.
All slices of the current picture are decoded.
Depending on whether the current picture is an IDR picture, the following applies.
– If the current picture is an IDR picture, the following applies.ordered steps are specified:
– All reference pictures are marked as "unused for reference"
– Depending on long_term_reference_flag, the following applies.
– If long_term_reference_flag is equal to 0, the IDR picture is marked as "used for short-term reference" and MaxLongTermFrameIdx is set equal to “"no long-term frame indices”".
– Otherwise (long_term_reference_flag is equal to 1), the IDR picture is marked as "used for long-term reference", the LongTermFrameIdx for the IDR picture is set equal to 0, and MaxLongTermFrameIdx is set equal to 0.
– Otherwise (the current picture is not an IDR picture), the following applies.
– If adaptive_ref_pic_marking_mode_flag is equal to 0, the process specified in subclause REF _Ref31522176 \r \h \* MERGEFORMAT 8.2.5.3 is invoked.
– Otherwise (adaptive_ref_pic_marking_mode_flag is equal to 1), the process specified in subclause REF _Ref31522236 \r \h 8.2.5.4 is invoked.
When the current picture is not an IDR picture and it was not marked as "used for long-term reference" by memory_management_control_operation equal to 6, it is marked as "used for short-term reference".
It is a requirement of bitstream conformance that, Aafter marking the current decoded reference picture, the total number of frames with at least one field marked as “"used for reference”", plus the number of complementary field pairs with at least one field marked as “"used for reference”", plus the number of non-paired fields marked as “"used for reference”" shall not be greater than Max( max_num_ref_frames, 1 ).
Decoding process for gaps in frame_num
This process is invoked when frame_num is not equal to PrevRefFrameNum and is not equal to ( PrevRefFrameNum + 1 ) % MaxFrameNum.
NOTE 1 – Although this process is specified as a subclause within subclause REF _Ref31080465 \r \h 8.2.5 (which defines a process that is invoked only when nal_ref_idc is not equal to 0), this process may also be invoked when nal_ref_idc is equal to 0 (as specified in clause REF _Ref70757751 \r \h 8). The reasons for the location of this subclause within the structure of this Recommendation | International Standard are historical.
NOTE 2 – This process can only be invoked for a conforming bitstream when gaps_in_frame_num_value_allowed_flag is equal to 1. When gaps_in_frame_num_value_allowed_flag is equal to 0 and frame_num is not equal to PrevRefFrameNum and is not equal to ( PrevRefFrameNum + 1 ) % MaxFrameNum, the decoding process should infer an unintentional loss of pictures.
When this process is invoked, a set of values of frame_num pertaining to “"non-existing”" pictures is derived as all values taken on by UnusedShortTermFrameNum in Equation REF UnusedSTFN_Eqn \h 7-23 except the value of frame_num for the current picture.
The decoding process generates and marks a frame for each of the values of frame_num pertaining to “"non-existing”" pictures, in the order in which the values of UnusedShortTermFrameNum are generated by Equation REF UnusedSTFN_Eqn \h 7-23, using the “"sliding window”" picture marking process as specified in subclause REF _Ref31522176 \r \h 8.2.5.3. The generated frames are also marked as “"non-existing”" and “"used for short-term reference”". The sample values of the generated frames may be set to any value.
The following constraints shall be obeyed:.
– The bitstream shall not contain data that results in the derivation of a co-located picture colPic that is marked as "non-existing" in any invocation of the derivation process for the co-located 4x4 sub-macroblock partitions specified in subclause REF _Ref81457268 \r \h 8.4.1.2.1.
– The bitstream shall not contain data that results in the derivation of a reference picture that is marked as "non-existing" in any invocation of the reference picture selection process specified in subclause REF _Ref197061667 \r \h 8.4.2.1.
– The bitstream shall not contain data that results in a variable picNumLX that is equal to the PicNum of a picture marked as "non-existing" in any invocation of the modification process for reference picture lists for short-term reference pictures specified in subclause REF _Ref31614059 \r \h 8.2.4.3.1.
– The bitstream shall not contain data that results in a variable picNumLX that is equal to the PicNum of a picture marked as "non-existing" in any invocation of the assignment process of a LongTermFrameIdx to a short-term reference picture specified in subclause REF _Ref32810014 \r \h 8.2.5.4.3.
NOTE 3 – The above constraints specify that frames that are marked as "non-existing" by the process specified in this subclause bitstream shallmust not be referenced contain data that results in a reference to these generated frames which are marked as “non-existing” in the inter prediction process (subclause REF _Ref24436511 \r \h 8.4, including the derivation process for co-located 4x4 sub-macroblock partitions in subclause REF _Ref81457268 \r \h 8.4.1.2.1), a reference to these frames in the reordering modification commands for reference picture lists for short-term reference pictures (subclause REF _Ref31614059 \r \h 8.2.4.3.1), or or a reference to these frames in the assignment process of a LongTermFrameIdx to a short-term reference picture (subclause REF _Ref32810014 \r \h 8.2.5.4.3).
When pic_order_cnt_type is not equal to 0, TopFieldOrderCnt and BottomFieldOrderCnt are derived for each of the "non-existing" frames by invoking the decoding process for picture order count in subclause REF _Ref59275470 \r \h 8.2.1. When invoking the process in subclause REF _Ref59275470 \r \h 8.2.1 for a particular "non-existing" frame, the current picture is considered to be a picture considered having frame_num inferred to be equal to UnusedShortTermFrameNum, nal_ref_idc inferred to be not equal to 0, nal_unit_type inferred to be not equal to 5, IdrPicFlag inferred to be equal to 0, field_pic_flag inferred to be equal to 0, adaptive_ref_pic_marking_mode_flag inferred to be equal to 0, delta_pic_order_cnt[ 0 ] (if needed) inferred to be equal to 0, and delta_pic_order_cnt[ 1 ] (if needed) inferred to be equal to 0.
NOTE 4 3 – The decoding process should infer an unintentional picture loss when any of these values of frame_num pertaining to “"non-existing”" pictures is referred to in the inter prediction process (subclause REF _Ref24436511 \r \h 8.4, including the derivation process for the co-located 4x4 sub-macroblock partitions in subclause REF _Ref81457268 \r \h 8.4.1.2.1), is referred to in the reordering modification commands for reference picture lists for short-term reference pictures (subclause REF _Ref31614059 \r \h 8.2.4.3.1), or is referred to in the assignment process of a LongTermFrameIdx to a short-term reference picture (subclause REF _Ref32810014 \r \h 8.2.5.4.3). The decoding process should not infer an unintentional picture loss when a memory management control operation not equal to 3 is applied to a frame marked as “"non-existing”".
Sliding window decoded reference picture marking process
This process is invoked when adaptive_ref_pic_marking_mode_flag is equal to 0.
Depending on the properties of the current picture as specified below, the following applies.
– If the current picture is a coded field that is the second field in decoding order of a complementary reference field pair, and the first field has been marked as “"used for short-term reference”", the current picture and the complementary reference field pair areis also marked as “"used for short-term reference”".
– Otherwise, the following applies:.
– Let numShortTerm be the total number of reference frames, complementary reference field pairs and non-paired reference fields for which at least one field is marked as “"used for short-term reference”". Let numLongTerm be the total number of reference frames, complementary reference field pairs and non-paired reference fields for which at least one field is marked as “"used for long-term reference”".
– When numShortTerm + numLongTerm is equal to Max( max_num_ref_frames, 1 ), the condition that numShortTerm is greater than 0 shall be fulfilled, and the short-term reference frame, complementary reference field pair or non-paired reference field that has the smallest value of FrameNumWrap is marked as “"unused for reference”". When it is a frame or a complementary field pair, both of its fields are also marked as “"unused for reference”".
Adaptive memory control decoded reference picture marking process
This process is invoked when adaptive_ref_pic_marking_mode_flag is equal to 1.
The memory_management_control_operation commands with values of 1 to 6 are processed in the order they occur in the bitstream after the current picture has been decoded. For each of these memory_management_control_operation commands, one of the processes specified in subclauses REF _Ref22879762 \r \h 8.2.5.4.1 to REF _Ref31518523 \r \h 8.2.5.4.6 is invoked depending on the value of memory_management_control_operation. The memory_management_control_operation command with value of 0 specifies the end of memory_management_control_operation commands.
Memory management control operations are applied to pictures as follows.
– If field_pic_flag is equal to 0, memory_management_control_operation commands are applied to the frames or complementary reference field pairs specified.
– Otherwise (field_pic_flag is equal to 1), memory_management_control_operation commands are applied to the individual reference fields specified.
Marking process of a short-term reference picture as “"unused for reference”"
This process is invoked when memory_management_control_operation is equal to 1.
Let picNumX be specified by
picNumX = CurrPicNum " ( difference_of_pic_nums_minus1 + 1 ). ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 39)
Depending on field_pic_flag the value of picNumX is used to mark a short-term reference picture as “"unused for reference”" as follows.
– If field_pic_flag is equal to 0, the short-term reference frame or short-term complementary reference field pair specified by picNumX and both of its fields are marked as “"unused for reference”".
– Otherwise (field_pic_flag is equal to 1), the short-term reference field specified by picNumX is marked as “"unused for reference”". When that reference field is part of a reference frame or a complementary reference field pair, the frame or complementary field pair is also marked as "unused for reference", but the marking of the other field is not changed.
Marking process of a long-term reference picture as “"unused for reference”"
This process is invoked when memory_management_control_operation is equal to 2.
Depending on field_pic_flag the value of LongTermPicNum is used to mark a long-term reference picture as “"unused for reference”" as follows.
– If field_pic_flag is equal to 0, the long-term reference frame or long-term complementary reference field pair having LongTermPicNum equal to long_term_pic_num and both of its fields are marked as “"unused for reference”".
– Otherwise (field_pic_flag is equal to 1), the long-term reference field specified by LongTermPicNum equal to long_term_pic_num is marked as “"unused for reference”". When that reference field is part of a reference frame or a complementary reference field pair, the frame or complementary field pair is also marked as "unused for reference", but the marking of the other field is not changed.
Assignment process of a LongTermFrameIdx to a short-term reference picture
This process is invoked when memory_management_control_operation is equal to 3.
Given the syntax element difference_of_pic_nums_minus1, the variable picNumX is obtained as specified in subclause REF _Ref22879762 \r \h 8.2.5.4.1. picNumX shall refer to a frame or complementary reference field pair or non-paired reference field marked as "used for short-term reference" and not marked as "non-existing".
When LongTermFrameIdx equal to long_term_frame_idx is already assigned to a long-term reference frame or a long-term complementary reference field pair, that frame or complementary field pair and both of its fields are marked as "unused for reference". When LongTermFrameIdx is already assigned to a non-paired reference field, and thate reference field is not part of athe complementary field pair that includesof the picture specified by picNumX, that field is marked as “"unused for reference”".
Depending on field_pic_flag the value of LongTermFrameIdx is used to mark a picture from "used for short-term reference" to "used for long-term reference" as follows.
– If field_pic_flag is equal to 0, the marking of the short-term reference frame or short-term complementary reference field pair specified by picNumX and both of its fields are changed from "used for short-term reference" to "used for long-term reference" and assigned LongTermFrameIdx equal to long_term_frame_idx.
– Otherwise (field_pic_flag is equal to 1), the marking of the short-term reference field specified by picNumX is changed from "used for short-term reference" to "used for long-term reference" and assigned LongTermFrameIdx equal to long_term_frame_idx. When the field is part of a reference frame or a complementary reference field pair, and the other field of the same reference frame or complementary reference field pair is also marked as "used for long-term reference", the reference frame or complementary reference field pair is also marked as "used for long-term reference" and assigned LongTermFrameIdx equal to long_term_frame_idx.
Decoding process for MaxLongTermFrameIdx
This process is invoked when memory_management_control_operation is equal to 4.
All pictures for which LongTermFrameIdx is greater than max_long_term_frame_idx_plus1 –" 1 and that are marked as "used for long-term reference" are marked as "unused for reference ".
The variable MaxLongTermFrameIdx is derived as follows.
If max_long_term_frame_idx_plus1 is equal to 0, MaxLongTermFrameIdx is set equal to "no long-term frame indices ".
Otherwise (max_long_term_frame_idx_plus1 is greater than 0), MaxLongTermFrameIdx is set equal to max_long_term_frame_idx_plus1 " 1.
NOTE The memory_management_control_operation command equal to 4 can be used to mark long-term reference pictures as “"unused for reference”". The frequency of transmitting max_long_term_frame_idx_plus1 is not specified by this Recommendation | International Standard. However, the encoder should send a memory_management_control_operation command equal to 4 upon receiving an error message, such as an intra refresh request message.
Marking process of all reference pictures as “"unused for reference”" and setting MaxLongTermFrameIdx to “"no long-term frame indices”"
This process is invoked when memory_management_control_operation is equal to 5.
All reference pictures are marked as “"unused for reference”" and the variable MaxLongTermFrameIdx is set equal to “"no long-term frame indices”".
Process for assigning a long-term frame index to the current picture
This process is invoked when memory_management_control_operation is equal to 6.
When a variable LongTermFrameIdx equal to long_term_frame_idx is already assigned to a long-term reference frame or a long-term complementary reference field pair, that frame or complementary field pair and both of its fields are marked as "unused for reference". When LongTermFrameIdx is already assigned to a non-paired reference field, and thate reference field is not part of athe complementary field pair that includesof the current picture, that field is marked as “"unused for reference”".
The current picture is marked as "used for long-term reference" and assigned LongTermFrameIdx equal to long_term_frame_idx.
When field_pic_flag is equal to 0, both its fields are also marked as "used for long-term reference" and assigned LongTermFrameIdx equal to long_term_frame_idx.
When field_pic_flag is equal to 1 and the current picture is the second field (in decoding order) of a complementary reference field pair, and the first field of the complementary reference field pair is also currently marked as "used for long-term reference"), the complementary reference field pair is also marked as "used for long-term reference" and assigned LongTermFrameIdx equal to long_term_frame_idx.
After marking the current decoded reference picture, the total number of frames with at least one field marked as “"used for reference”", plus the number of complementary field pairs with at least one field marked as “"used for reference”", plus the number of non-paired fields marked as “"used for reference”" shall not be greater than Max( max_num_ref_frames, 1 ).
NOTE – Under some circumstances, the above statement may impose a constraint on the order in which a memory_management_control_operation syntax element equal to 6 can appear in the decoded reference picture marking syntax relative to a memory_management_control_operation syntax element equal to 1, 2, 3, or 4.
Intra prediction process
This process is invoked for I and SI macroblock types.
Inputs to this process are constructed samples prior to the deblocking filter process and, for Intra_NxN prediction modes (where NxN is equal to 4x4 or 8x8), the values of IntraNxNPredMode from neighbouring macroblocks.
Outputs of this process are specified as follows.
– If the macroblock prediction mode is Intra_4x4 or Intra_8x8, the outputs are constructed luma samples prior to the deblocking filter process and (when ChromaArrayType is not equal to 0) chroma prediction samples of the macroblock predC, where C is equal to Cb and Cr.
– Otherwise, if mb_type is not equal to I_PCM, the outputs are luma prediction samples of the macroblock predL and (when ChromaArrayType is not equal to 0) chroma prediction samples of the macroblock predC, where C is equal to Cb and Cr.
– Otherwise (mb_type is equal to I_PCM), the outputs are constructed luma and (when ChromaArrayType is not equal to 0) chroma samples prior to the deblocking filter process.
The variable MvCnt is set equal to 0.
Depending on the value of mb_type the following applies.
– If mb_type is equal to I_PCM, the sample construction process for I_PCM macroblocks as specified in subclause REF _Ref36866539 \r \h 8.3.5 is invoked.
– Otherwise (mb_type is not equal to I_PCM), the following applies:.
– The decoding processes for Intra prediction modes are described for the luma component as follows.
– If the macroblock prediction mode is equal to Intra_4x4, the Intra_4x4 prediction process for luma samples as specified in subclause REF _Ref26701748 \r \h 8.3.1 is invoked.
– Otherwise, if the macroblock prediction mode is equal to Intra_8x8, the Intra_8x8 prediction process as specified in subclause REF _Ref81134057 \r \h 8.3.2 is invoked.
– Otherwise (the macroblock prediction mode is equal to Intra_16x16), the Intra_16x16 prediction process as specified in subclause REF _Ref26701754 \r \h 8.3.3 is invoked with S'L as the input and the outputs are luma prediction samples of the macroblock predL.
– When ChromaArrayType is not equal to 0, the Intra prediction process for chroma samples as specified in subclause REF _Ref26701756 \r \h 8.3.4 is invoked with S'Cb, and S'Cr as the inputs and the outputs are chroma prediction samples of the macroblock predCb and predCr.
Samples used in the Intra prediction process are the sample values prior to alteration by any deblocking filter operation.
Intra_4x4 prediction process for luma samples
This process is invoked when the macroblock prediction mode is equal to Intra_4x4.
Inputs to this process are the values of Intra4x4PredMode (if available) or Intra8x8PredMode (if available) from neighbouring macroblocks or macroblock pairs.
The luma component of a macroblock consists of 16 blocks of 4x4 luma samples. These blocks are inverse scanned using the 4x4 luma block inverse scanning process as specified in subclause REF _Ref24282177 \r \h 6.4.3.
For all 4x4 luma blocks of the luma component of a macroblock with luma4x4BlkIdx = 0..15, the derivation process for the Intra4x4PredMode as specified in subclause REF _Ref24109191 \r \h \* MERGEFORMAT 8.3.1.1 is invoked with luma4x4BlkIdx as well as Intra4x4PredMode and Intra8x8PredMode that are previously (in decoding order) derived for adjacent macroblocks as the input and the variable Intra4x4PredMode[ luma4x4BlkIdx ] as the output.
For each luma block of 4x4 samples indexed using luma4x4BlkIdx = 0..15, the following ordered steps are specified:
The Intra_4x4 sample prediction process in subclause REF _Ref31454315 \r \h 8.3.1.2 is invoked with luma4x4BlkIdx and the array S'L containing constructed luma samples prior to the deblocking filter process from adjacent luma blocks as the inputs and the outputs are the Intra_4x4 luma prediction samples pred4x4L[ x, y ] with x, y = 0..3.
The position of the upper-left sample of a 4x4 luma block with index luma4x4BlkIdx inside the current macroblock is derived by invoking the inverse 4x4 luma block scanning process in subclause REF _Ref24282177 \r \h \* MERGEFORMAT 6.4.3 with luma4x4BlkIdx as the input and the output being assigned to ( xO, yO ).
The values of the prediction samples predL[ xO + x, yO + y ] with and x, y = 0..3 are derived by.
predL[ xO + x, yO + y ] = pred4x4L[ x, y ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 40)
The transform coefficient decoding process and picture construction process prior to deblocking filter process in subclause REF _Ref81058842 \r \h 8.5 is invoked with predL and luma4x4BlkIdx as the input and the constructed samples for the current 4x4 luma block S'’L as the output.
Derivation process for the Intra4x4PredMode
Inputs to this process are the index of the 4x4 luma block luma4x4BlkIdx and variable arrays Intra4x4PredMode (if available) and Intra8x8PredMode (if available) that are previously (in decoding order) derived for adjacent macroblocks.
Output of this process is the variable Intra4x4PredMode[ luma4x4BlkIdx ].
REF _Ref24112218 \h Table 82 specifies the values for Intra4x4PredMode[ luma4x4BlkIdx ] and the associated names.
Table STYLEREF 1 \s 8 SEQ Table \* ARABIC \s 1 2 – Specification of Intra4x4PredMode[ luma4x4BlkIdx ] and associated names
Intra4x4PredMode[ luma4x4BlkIdx ]Name of Intra4x4PredMode[ luma4x4BlkIdx ]0Intra_4x4_Vertical (prediction mode)1Intra_4x4_Horizontal (prediction mode)2Intra_4x4_DC (prediction mode)3Intra_4x4_Diagonal_Down_Left (prediction mode)4Intra_4x4_Diagonal_Down_Right (prediction mode)5Intra_4x4_Vertical_Right (prediction mode)6Intra_4x4_Horizontal_Down (prediction mode)7Intra_4x4_Vertical_Left (prediction mode)8Intra_4x4_Horizontal_Up (prediction mode)Intra4x4PredMode[ luma4x4BlkIdx ] labelled 0, 1, 3, 4, 5, 6, 7, and 8 represent directions of predictions as illustrated in REF _Ref24283181 \h Figure 81.
Figure STYLEREF 1 \s 8 SEQ Figure \* ARABIC \s 1 1 – Intra_4x4 prediction mode directions (informative)
Intra4x4PredMode[ luma4x4BlkIdx ] is derived as specified by the following ordered steps:.
– The process specified in subclause REF _Ref32825543 \r \h 6.4.10.4 is invoked with luma4x4BlkIdx given as input and the output is assigned to mbAddrA, luma4x4BlkIdxA, mbAddrB, and luma4x4BlkIdxB.
– The variable dcPredModePredictedFlag is derived as follows.
– If any of the following conditions are true, dcPredModePredictedFlag is set equal to 1
– the macroblock with address mbAddrA is not available
– the macroblock with address mbAddrB is not available
– the macroblock with address mbAddrA is available and coded in an Inter macroblock prediction mode and constrained_intra_pred_flag is equal to 1
– the macroblock with address mbAddrB is available and coded in an Inter macroblock prediction mode and constrained_intra_pred_flag is equal to 1
– Otherwise, dcPredModePredictedFlag is set equal to 0.
– For N being either replaced by A or B, the variables intraMxMPredModeN are derived as follows.
– If dcPredModePredictedFlag is equal to 1 or the macroblock with address mbAddrN is not coded in Intra_4x4 or Intra_8x8 macroblock prediction mode, intraMxMPredModeN is set equal to 2 (Intra_4x4_DC prediction mode).
– Otherwise (dcPredModePredictedFlag is equal to 0 and (the macroblock with address mbAddrN is coded in Intra_4x4 macroblock prediction mode or the macroblock with address mbAddrN is coded in Intra_8x8 macroblock prediction mode)), the following applies.
– If the macroblock with address mbAddrN is coded in Intra_4x4 macroblock prediction mode, intraMxMPredModeN is set equal to Intra4x4PredMode[ luma4x4BlkIdxN ], where Intra4x4PredMode is the variable array assigned to the macroblock mbAddrN.
– Otherwise (the macroblock with address mbAddrN is coded in Intra_8x8 macroblock prediction mode), intraMxMPredModeN is set equal to Intra8x8PredMode[ luma4x4BlkIdxN >> 2 ], where Intra8x8PredMode is the variable array assigned to the macroblock mbAddrN.
– Intra4x4PredMode[ luma4x4BlkIdx ] is derived by applying the following procedure:.
predIntra4x4PredMode = Min( intraMxMPredModeA, intraMxMPredModeB )if( prev_intra4x4_pred_mode_flag[ luma4x4BlkIdx ] ) Intra4x4PredMode[ luma4x4BlkIdx ] = predIntra4x4PredModeelse ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 41) if( rem_intra4x4_pred_mode[ luma4x4BlkIdx ] < predIntra4x4PredMode ) Intra4x4PredMode[ luma4x4BlkIdx ] = rem_intra4x4_pred_mode[ luma4x4BlkIdx ] else Intra4x4PredMode[ luma4x4BlkIdx ] = rem_intra4x4_pred_mode[ luma4x4BlkIdx ] + 1
Intra_4x4 sample prediction
This process is invoked for each 4x4 luma block of a macroblock with macroblock prediction mode equal to Intra_4x4 followed by the transform decoding process and picture construction process prior to deblocking for each 4x4 luma block.
Inputs to this process are
– the index of a 4x4 luma block luma4x4BlkIdx,
– an (PicWidthInSamplesL)x(PicHeightInSamplesL) array cSL containing constructed luma samples prior to the deblocking filter process of neighbouring macroblocks.
Output of this process are the prediction samples pred4x4L[ x, y ], with x, y = 0..3, for the 4x4 luma block with index luma4x4BlkIdx.
The position of the upper-left sample of a 4x4 luma block with index luma4x4BlkIdx inside the current macroblock is derived by invoking the inverse 4x4 luma block scanning process in subclause REF _Ref24282177 \r \h \* MERGEFORMAT 6.4.3 with luma4x4BlkIdx as the input and the output being assigned to ( xO, yO ).
The 13 neighbouring samples p[ x, y ] that are constructed luma samples prior to the deblocking filter process, with x = "1, y = -"1..3 and x = 0..7, y = -"1, are derived as specified by the following ordered steps:.
The luma location ( xN, yN ) is specified by
xN = xO + x ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 42)
yN = yO + y ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 43)
The derivation process for neighbouring locations in subclause REF _Ref81126179 \r \h 6.4.11 is invoked for luma locations with ( xN, yN ) as input and mbAddrN and ( xW, yW ) as output.
Each sample p[ x, y ] with x = "1, y = -"1..3 and x = 0..7, y = -"1 is derived as follows.
If any of the following conditions is true, the sample p[ x, y ] is marked as "not available for Intra_4x4 prediction "
mbAddrN is not available,
the macroblock mbAddrN is coded in an Inter macroblock prediction mode and constrained_intra_pred_flag is equal to 1,.
– the macroblock mbAddrN has mb_type equal to SI and constrained_intra_pred_flag is equal to 1 and the current macroblock does not have mb_type equal to SI,.
– x is greater than 3 and luma4x4BlkIdx is equal to 3 or 11.
– Otherwise, the sample p[ x, y ] is marked as “"available for Intra_4x4 prediction”" and the value of the sample p[ x, y ] is derived as specified by the following ordered steps:.
– The location of the upper-left luma sample of the macroblock mbAddrN is derived by invoking the inverse macroblock scanning process in subclause REF _Ref32839806 \r \h 6.4.1 with mbAddrN as the input and the output is assigned to ( xM, yM ).
– Depending on the variable MbaffFrameFlag and the macroblock mbAddrN, the sample value p[ x, y ] is derived as follows.
– If MbaffFrameFlag is equal to 1 and the macroblock mbAddrN is a field macroblock,
p[ x, y ] = cSL[ xM + xW, yM + 2 * yW ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 44)
Otherwise (MbaffFrameFlag is equal to 0 or the macroblock mbAddrN is a frame macroblock),
p[ x, y ] = cSL[ xM + xW, yM + yW ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 45)
When samples p[ x, -"1 ], with x = 4..7, are marked as "not available for Intra_4x4 prediction, " and the sample p[ 3, -"1 ] is marked as "available for Intra_4x4 prediction, " the sample value of p[ 3, -"1 ] is substituted for sample values p[ x, "1 ], with x = 4..7, and samples p[ x, -"1 ], with x = 4..7, are marked as "available for Intra_4x4 prediction”".
NOTE – Each block is assumed to be constructed into a picture array prior to decoding of the next block.
Depending on Intra4x4PredMode[ luma4x4BlkIdx ], one of the Intra_4x4 prediction modes specified in subclauses REF _Ref24284056 \r \h 8.3.1.2.1 to REF _Ref24284059 \r \h 8.3.1.2.9 is invoked.
Specification of Intra_4x4_Vertical prediction mode
This Intra_4x4 prediction mode is invoked when Intra4x4PredMode[ luma4x4BlkIdx ] is equal to 0.
This mode shall be used only when the samples p[ x, -"1 ] with x = 0..3 are marked as "available for Intra_4x4 prediction ".
The values of the prediction samples pred4x4L[ x, y ], with x, y = 0..3, are derived by
pred4x4L[ x, y ] = p[ x, -"1 ], with x, y = 0..3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 46)
Specification of Intra_4x4_Horizontal prediction mode
This Intra_4x4 prediction mode is invoked when Intra4x4PredMode[ luma4x4BlkIdx ] is equal to 1.
This mode shall be used only when the samples p[ -"1, y ], with y = 0..3, are marked as "available for Intra_4x4 prediction ".
The values of the prediction samples pred4x4L[ x, y ], with x, y = 0..3, are derived by
pred4x4L[ x, y ] = p[ -"1, y ], with x,y = 0..3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 47)
Specification of Intra_4x4_DC prediction mode
This Intra_4x4 prediction mode is invoked when Intra4x4PredMode[ luma4x4BlkIdx ] is equal to 2.
The values of the prediction samples pred4x4L[ x, y ], with x, y = 0..3, are derived as follows.
– If all samples p[ x, -"1 ], with x = 0..3, and p[ -"1, y ], with y = 0..3, are marked as "available for Intra_4x4 prediction ", the values of the prediction samples pred4x4L[ x, y ], with x, y = 0..3, are derived by
pred4x4L[ x, y ] = ( p[ 0, -"1 ] + p[ 1, -"1 ] + p[ 2, -"1 ] + p[ 3, -"1 ] + p[ -"1, 0 ] + p[ -"1, 1 ] + p[ -"1, 2 ] + p[ -"1, 3 ] + 4 ) >> 3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 48)
Otherwise, if any samples p[ x, -"1 ], with x = 0..3, are marked as "not available for Intra_4x4 prediction " and all samples p[ -"1, y ], with y = 0..3, are marked as "available for Intra_4x4 prediction ", the values of the prediction samples pred4x4L[ x, y ], with x, y = 0..3, are derived by
pred4x4L[ x, y ] = ( p[ -"1, 0 ] + p[ -"1, 1 ] + p[ -"1, 2 ] + p[ -"1, 3 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 49)
Otherwise, if any samples p[ -"1, y ], with y = 0..3, are marked as "not available for Intra_4x4 prediction " and all samples p[ x, -"1 ], with x = 0 .. 3, are marked as "available for Intra_4x4 prediction ", the values of the prediction samples pred4x4L[ x, y ], with x, y = 0 .. 3, are derived by
pred4x4L[ x, y ] = ( p[ 0, -"1 ] + p[ 1, -"1 ] + p[ 2, -"1 ] + p[ 3, -"1 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 50)
Otherwise (some samples p[ x, -"1 ], with x = 0..3, and some samples p[ -"1, y ], with y = 0..3, are marked as "not available for Intra_4x4 prediction "), the values of the prediction samples pred4x4L[ x, y ], with x, y = 0..3, are derived by
pred4x4L[ x, y ] = ( 1 << ( BitDepthY " 1 ) ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 51)
NOTE A 4x4 luma block can always be predicted using this mode.
Specification of Intra_4x4_Diagonal_Down_Left prediction mode
This Intra_4x4 prediction mode is invoked when Intra4x4PredMode[ luma4x4BlkIdx ] is equal to 3.
This mode shall be used only when the samples p[ x, -"1 ] with x = 0..7 are marked as "available for Intra_4x4 prediction ".
The values of the prediction samples pred4x4L[ x, y ], with x, y = 0..3, are derived as follows.
If x is equal to 3 and y is equal to 3,
pred4x4L[ x, y ] = ( p[ 6, -"1 ] + 3 * p[ 7, -"1 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 52)
Otherwise (x is not equal to 3 or y is not equal to 3),
pred4x4L[ x, y ] = ( p[ x + y, -"1 ] + 2 * p[ x + y + 1, -"1 ] + p[ x + y + 2, -"1 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 53)
Specification of Intra_4x4_Diagonal_Down_Right prediction mode
This Intra_4x4 prediction mode is invoked when Intra4x4PredMode[ luma4x4BlkIdx ] is equal to 4.
This mode shall be used only when the samples p[ x, -"1 ] with x = 0..3 and p[ -"1, y ] with y = -"1..3 are marked as "available for Intra_4x4 prediction ".
The values of the prediction samples pred4x4L[ x, y ], with x, y = 0..3, are derived as follows.
If x is greater than y,
pred4x4L[ x, y ] = ( p[ x -" y -" 2, -"1] + 2 * p[ x -" y -" 1, -"1 ] + p[ x -" y, -"1 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 54)
Otherwise if x is less than y,
pred4x4L[ x, y ] = ( p[ -"1, y -" x -" 2 ] + 2 * p[ -"1, y -" x -" 1 ] + p[ -"1, y -" x ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 55)
Otherwise (x is equal to y),
pred4x4L[ x, y ] = ( p[ 0, -"1 ] + 2 * p[ -"1, -"1 ] + p[ -"1, 0 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 56)
Specification of Intra_4x4_Vertical_Right prediction mode
This Intra_4x4 prediction mode is invoked when Intra4x4PredMode[ luma4x4BlkIdx ] is equal to 5.
This mode shall be used only when the samples p[ x, -"1 ] with x = 0..3 and p[ -"1, y ] with y = -"1..3 are marked as "available for Intra_4x4 prediction ".
Let the variable zVR be set equal to 2 * x " y.
The values of the prediction samples pred4x4L[ x, y ], with x, y = 0..3, are derived as follows.
If zVR is equal to 0, 2, 4, or 6,
pred4x4L[ x, y ] = ( p[ x -" ( y >> 1 ) -" 1, -"1 ] + p[ x -" ( y >> 1 ), -"1 ] + 1 ) >> 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 57)
Otherwise, if zVR is equal to 1, 3, or 5,
pred4x4L[ x, y ] = ( p[ x -" ( y >> 1 ) -" 2, -"1] + 2 * p[ x -" ( y >> 1 ) -" 1, -"1 ] + p[ x -" ( y >> 1 ), -"1 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 58)
Otherwise, if zVR is equal to -"1,
pred4x4L[ x, y ] = ( p[ -"1, 0 ] + 2 * p[ -"1, -"1 ] + p[ 0, -"1 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 59)
Otherwise (zVR is equal to -"2 or -"3),
pred4x4L[ x, y ] = ( p[ -"1, y -" 1 ] + 2 * p[ -"1, y -" 2 ] + p[ -"1, y -" 3 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 60)
Specification of Intra_4x4_Horizontal_Down prediction mode
This Intra_4x4 prediction mode is invoked when Intra4x4PredMode[ luma4x4BlkIdx ] is equal to 6.
This mode shall be used only when the samples p[ x, -"1 ] with x = 0..3 and p[ -"1, y ] with y = -"1..3 are marked as "available for Intra_4x4 prediction ".
Let the variable zHD be set equal to 2 * y " x.
The values of the prediction samples pred4x4L[ x, y ], with x, y = 0..3, are derived as follows.
If zHD is equal to 0, 2, 4, or 6,
pred4x4L[ x, y ] = ( p[ -"1, y -" ( x >> 1 ) -" 1 ] + p[ -"1, y -" ( x >> 1 ) ] + 1 ) >> 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 61)
Otherwise, if zHD is equal to 1, 3, or 5,
pred4x4L[ x, y ] = ( p[ -"1, y -" ( x >> 1 ) -" 2 ] + 2 * p[ -"1, y -" ( x >> 1 ) -" 1 ] + p[ -"1, y -" ( x >> 1 ) ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 62)
Otherwise, if zHD is equal to -"1,
pred4x4L[ x, y ] = ( p[ -"1, 0 ] + 2 * p[ -"1, -"1 ] + p[ 0, -"1 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 63)
Otherwise (zHD is equal to -"2 or -"3),
pred4x4L[ x, y ] = ( p[ x -" 1, -"1 ] + 2 * p[ x -" 2, -"1 ] + p[ x -" 3, -"1 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 64)
Specification of Intra_4x4_Vertical_Left prediction mode
This Intra_4x4 prediction mode is invoked when Intra4x4PredMode[ luma4x4BlkIdx ] is equal to 7.
This mode shall be used only when the samples p[ x, -"1 ] with x = 0..7 are marked as "available for Intra_4x4 prediction ".
The values of the prediction samples pred4x4L[ x, y ], with x, y = 0..3, are derived as follows.
If y is equal to 0 or 2,
pred4x4L[ x, y ] = ( p[ x + ( y >> 1 ), -"1 ] + p[ x + ( y >> 1 ) + 1, -"1 ] + 1) >> 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 65)
Otherwise (y is equal to 1 or 3),
pred4x4L[ x, y ] = ( p[ x + ( y >> 1 ), -"1 ] + 2 * p[ x + ( y >> 1 ) + 1, -"1 ] + p[ x + ( y >> 1 ) + 2, -"1 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 66)
Specification of Intra_4x4_Horizontal_Up prediction mode
This Intra_4x4 prediction mode is invoked when Intra4x4PredMode[ luma4x4BlkIdx ] is equal to 8.
This mode shall be used only when the samples p[ -"1, y ] with y = 0..3 are marked as "available for Intra_4x4 prediction ".
Let the variable zHU be set equal to x + 2 * y.
The values of the prediction samples pred4x4L[ x, y ], with x, y = 0..3, are derived as follows.:
If zHU is equal to 0, 2, or 4
pred4x4L[ x, y ] = ( p[ -"1, y + ( x >> 1 ) ] + p[ -"1, y + ( x >> 1 ) + 1 ] + 1 ) >> 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 67)
Otherwise, if zHU is equal to 1 or 3
pred4x4L[ x, y ] = ( p[ -"1, y + ( x >> 1 ) ] + 2 * p[ -"1, y + ( x >> 1 ) + 1 ] + p[ -"1, y + ( x >> 1 ) + 2 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 68)
Otherwise, if zHU is equal to 5,
pred4x4L[ x, y ] = ( p[ -"1, 2 ] + 3 * p[ -"1, 3 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 69)
Otherwise (zHU is greater than 5),
pred4x4L[ x, y ] = p[ -"1, 3 ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 70)
Intra_8x8 prediction process for luma samples
This process is invoked when the macroblock prediction mode is equal to Intra_8x8.
Inputs to this process are the values of Intra4x4PredMode (if available) or Intra8x8PredMode (if available) from the neighbouring macroblocks or macroblock pairs.
Outputs of this process are 8x8 luma sample arrays as part of the 16x16 luma array of prediction samples of the macroblock predL.
The luma component of a macroblock consists of 4 blocks of 8x8 luma samples. These blocks are inverse scanned using the inverse 8x8 luma block scanning process as specified in subclause REF _Ref81390772 \r \h 6.4.5.
For all 8x8 luma blocks of the luma component of a macroblock with luma8x8BlkIdx = 0..3, the derivation process for Intra8x8PredMode as specified in subclause REF _Ref81133891 \r \h 8.3.2.1 is invoked with luma8x8BlkIdx as well as Intra4x4PredMode and Intra8x8PredMode that are previously (in decoding order) derived for adjacent macroblocks as the input and the variable Intra8x8PredMode[ luma8x8BlkIdx ] as the output.
For each luma block of 8x8 samples indexed using luma8x8BlkIdx = 0..3, the following applies.ordered steps are specified:
The Intra_8x8 sample prediction process in subclause REF _Ref81133974 \r \h 8.3.2.2 is invoked with luma8x8BlkIdx and the array S'L containing constructed samples prior to the deblocking filter process from adjacent luma blocks as the input and the output are the Intra_8x8 luma prediction samples pred8x8L[ x, y ] with x, y = 0..7.
The position of the upper-left sample of an 8x8 luma block with index luma8x8BlkIdx inside the current macroblock is derived by invoking the inverse 8x8 luma block scanning process in subclause REF _Ref81390773 \r \h 6.4.5 with luma8x8BlkIdx as the input and the output being assigned to ( xO, yO ).
The values of the prediction samples predL[ xO + x, yO + y ] with and x, y = 0..7 are derived by.
predL[ xO + x, yO + y ] = pred8x8L[ x, y ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 71)
The transform coefficient decoding process and picture construction process prior to deblocking filter process in subclause REF _Ref81121131 \r \h 8.5 is invoked with predL and luma8x8BlkIdx as the input and the constructed samples for the current 8x8 luma block S'’L as the output.
Derivation process for Intra8x8PredMode
Inputs to this process are the index of the 8x8 luma block luma8x8BlkIdx and variable arrays Intra4x4PredMode (if available) and Intra8x8PredMode (if available) that are previously (in decoding order) derived for adjacent macroblocks.
Output of this process is the variable Intra8x8PredMode[ luma8x8BlkIdx ].
REF _Ref81124936 \h Table 83 specifies the values for Intra8x8PredMode[ luma8x8BlkIdx ] and the associated mnemonic names.
Table STYLEREF 1 \s 8 SEQ Table \* ARABIC \s 1 3 – Specification of Intra8x8PredMode[ luma8x8BlkIdx ] and associated names
Intra8x8PredMode[ luma8x8BlkIdx ]Name of Intra8x8PredMode[ luma8x8BlkIdx ]0Intra_8x8_Vertical (prediction mode)1Intra_8x8_Horizontal (prediction mode)2Intra_8x8_DC (prediction mode)3Intra_8x8_Diagonal_Down_Left (prediction mode)4Intra_8x8_Diagonal_Down_Right (prediction mode)5Intra_8x8_Vertical_Right (prediction mode)6Intra_8x8_Horizontal_Down (prediction mode)7Intra_8x8_Vertical_Left (prediction mode)8Intra_8x8_Horizontal_Up (prediction mode)
Intra8x8PredMode[ luma8x8BlkIdx ] is derived as specified by the following ordered steps:.
The process specified in subclause REF _Ref32846444 \r \h 6.4.10.2 is invoked with luma8x8BlkIdx given as input and the output is assigned to mbAddrA, luma8x8BlkIdxA, mbAddrB, and luma8x8BlkIdxB.
The variable dcPredModePredictedFlag is derived as follows.
– If any of the following conditions are true, dcPredModePredictedFlag is set equal to 1:
– the macroblock with address mbAddrA is not available,
– the macroblock with address mbAddrB is not available,
– the macroblock with address mbAddrA is available and coded in an Inter macroblock prediction mode and constrained_intra_pred_flag is equal to 1,
– the macroblock with address mbAddrB is available and coded in an Inter macroblock prediction mode and constrained_intra_pred_flag is equal to 1.
– Otherwise, dcPredModePredictedFlag is set equal to 0.
For N being either replaced by A or B, the variables intraMxMPredModeN are derived as follows.
– If dcPredModePredictedFlag is equal to 1 or (the macroblock with address mbAddrN is not coded in Intra_4x4 macroblock prediction mode and the macroblock with address mbAddrN is not coded in or Intra_8x8 macroblock prediction mode), intraMxMPredModeN is set equal to 2 (Intra_8x8_DC prediction mode).
– Otherwise (dcPredModePredictedFlag is equal to 0 and (the macroblock with address mbAddrN is coded in Intra_4x4 macroblock prediction mode or the macroblock with address mbAddrN is coded in Intra_8x8 macroblock prediction mode)), the following applies.
– If the macroblock with address mbAddrN is coded in Intra_8x8 macroblock prediction mode, intraMxMPredModeN is set equal to Intra8x8PredMode[ luma8x8BlkIdxN ], where Intra8x8PredMode is the variable array assigned to the macroblock mbAddrN.
– Otherwise (the macroblock with address mbAddrN is coded in Intra_4x4 macroblock prediction mode), intraMxMPredModeN is derived by the following procedure, where Intra4x4PredMode is the variable array assigned to the macroblock mbAddrN.
intraMxMPredModeN = Intra4x4PredMode[ luma8x8BlkIdxN * 4 + n ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 72)
where the variable n is derived as follows
– If N is equal to A, depending on the variable MbaffFrameFlag, the variable luma8x8BlkIdx, the current macroblock, and the macroblock mbAddrN, the following applies.
– If MbaffFrameFlag is equal to 1, the current macroblock is a frame coded macroblock, the macroblock mbAddrN is a field coded macroblock, and luma8x8BlkIdx is equal to 2, n is set equal to 3.
– Otherwise (MbaffFrameFlag is equal to 0 or the current macroblock is a field coded macroblock or the macroblock mbAddrN is a frame coded macroblock or luma8x8BlkIdx is not equal to 2), n is set equal to 1.
– Otherwise (N is equal to B), n is set equal to 2.
Finally, given intraMxMPredModeA and intraMxMPredModeB, the variable Intra8x8PredMode[ luma8x8BlkIdx ] is derived by applying the following procedure.
predIntra8x8PredMode = Min( intraMxMPredModeA, intraMxMPredModeB )if( prev_intra8x8_pred_mode_flag[ luma8x8BlkIdx ] ) Intra8x8PredMode[ luma8x8BlkIdx ] = predIntra8x8PredModeelse ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 73) if( rem_intra8x8_pred_mode[ luma8x8BlkIdx ] < predIntra8x8PredMode ) Intra8x8PredMode[ luma8x8BlkIdx ] = rem_intra8x8_pred_mode[ luma8x8BlkIdx ] else Intra8x8PredMode[ luma8x8BlkIdx ] = rem_intra8x8_pred_mode[ luma8x8BlkIdx ] + 1
Intra_8x8 sample prediction
This process is invoked for each 8x8 luma block of a macroblock with macroblock prediction mode equal to Intra_8x8 followed by the transform decoding process and picture construction process prior to deblocking for each 8x8 luma block.
Inputs to this process are
– the index of an 8x8 luma block luma8x8BlkIdx,.
– an (PicWidthInSamplesL)x(PicHeightInSamplesL) array cSL containing constructed luma samples prior to the deblocking filter process of neighbouring macroblocks.
Output of this process are the prediction samples pred8x8L[ x, y ], with x, y = 0..7, for the 8x8 luma block with index luma8x8BlkIdx.
The position of the upper-left sample of an 8x8 luma block with index luma8x8BlkIdx inside the current macroblock is derived by invoking the inverse 8x8 luma block scanning process in subclause REF _Ref81390773 \r \h 6.4.5 with luma8x8BlkIdx as the input and the output being assigned to ( xO, yO ).
The 25 neighbouring samples p[ x, y ] that are constructed luma samples prior to the deblocking filter process, with x = "1, y = "1..7 and x = 0..15, y = "1, are derived as specified by the following ordered steps:.
The luma location ( xN, yN ) is specified by
xN = xO + x ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 74)
yN = yO + y ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 75)
The derivation process for neighbouring locations in subclause REF _Ref81126179 \r \h 6.4.11 is invoked for luma locations with ( xN, yN ) as input and mbAddrN and ( xW, yW ) as output.
Each sample p[ x, y ] with x = "1, y = "1..7 and x = 0..15, y = "1 is derived as follows.
– If any of the following conditions is true, the sample p[ x, y ] is marked as “"not available for Intra_8x8 prediction”":
– mbAddrN is not available,
– the macroblock mbAddrN is coded in an Inter macroblock prediction mode and constrained_intra_pred_flag is equal to 1.,
– Otherwise, the sample p[ x, y ] is marked as “"available for Intra_8x8 prediction”" and the sample value p[ x, y ] is derived as specified by the following ordered steps:.
– The location of the upper-left luma sample of the macroblock mbAddrN is derived by invoking the inverse macroblock scanning process in subclause REF _Ref32839806 \r \h 6.4.1 with mbAddrN as the input and the output is assigned to ( xM, yM ).
– Depending on the variable MbaffFrameFlag and the macroblock mbAddrN, the sample value p[ x, y ] is derived as follows.
– If MbaffFrameFlag is equal to 1 and the macroblock mbAddrN is a field macroblock,
p[ x, y ] = cSL[ xM + xW, yM + 2 * yW ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 76)
– Otherwise (MbaffFrameFlag is equal to 0 or the macroblock mbAddrN is a frame macroblock),
p[ x, y ] = cSL[ xM + xW, yM + yW ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 77)
When samples p[ x, "1 ], with x = 8..15, are marked as "not available for Intra_8x8 prediction, " and the sample p[ 7, "1 ] is marked as "available for Intra_8x8 prediction, " the sample value of p[ 7, "1 ] is substituted for sample values p[ x, "1 ], with x = 8..15, and samples p[ x, "1 ], with x = 8..15, are marked as "available for Intra_8x8 prediction”".
NOTE – Each block is assumed to be constructed into a picture array prior to decoding of the next block.
The reference sample filtering process for Intra_8x8 sample prediction in subclause REF _Ref81375703 \r \h 8.3.2.2.1 is invoked with the samples p[ x, y ] with x = "1, y = "1..7 and x = 0..15, y = "1 (if available) as input and p'[ x, y ] with x = "1, y = "1..7 and x = 0..15, y = "1 as output.
Depending on Intra8x8PredMode[ luma8x8BlkIdx ], one of the Intra_8x8 prediction modes specified in subclauses REF _Ref81134374 \r \h 8.3.2.2.2 to REF _Ref81134382 \r \h 8.3.2.2.10 is invoked.
Reference sample filtering process for Intra_8x8 sample prediction
Inputs to this process are the reference samples p[ x, y ] with x = "1, y = "1..7 and x = 0..15, y = "1 (if available) for Intra_8x8 sample prediction.
Outputs of this process are the filtered reference samples p'[ x, y ] with x = "1, y = "1..7 and x = 0..15, y = "1 for Intra_8x8 sample prediction.
When all samples p[ x, "1 ] with x = 0..157 are marked as "available for Intra_8x8 prediction ", the following applies:.
The value of p'[ 0, "1 ] is derived as follows.
If p[ "1, "1 ] is marked as "available for Intra_8x8 prediction ", p'[ 0, "1 ] is derived by
p'[ 0, "1 ] = ( p[ "1, "1 ] + 2 * p[ 0, "1 ] + p[ 1, "1 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 78)
Otherwise (p[ "1, "1 ] is marked as "not available for Intra_8x8 prediction "), p'[ 0, "1 ] is derived by
p'[ 0, "1 ] = ( 3 * p[ 0, "1 ] + p[ 1, "1 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 79)
The values of p'[ x, "1 ], with x = 1..14,7 are derived by
p'[ x, "1 ] = ( p[ x " 1, "1 ] + 2 * p[ x, "1 ] + p[ x+1, "1 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 80)
When all samples p[ x, 1 ] with x = 7..15 are marked as “available for Intra_8x8 prediction”, the following applies.
The values of p'[ x, 1 ], with x = 8..14 are derived by
p'[ x, 1 ] = ( p[ x1, 1 ] + 2 * p[ x, 1 ] + p[ x+1, 1 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 82)
The value of p'[ 15, "1 ] is derived by
p'[ 15, "1 ] = ( p[ 14, "1 ] + 3 * p[ 15, "1 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 81)
When the sample p[ "1, "1 ] is marked as "available for Intra_8x8 prediction ", the value of p'[ "1, "1 ] is derived as follows.
If the sample p[ 0, "1 ] is marked as "not available for Intra_8x8 prediction " or the sample p[ "1, 0 ] is marked as "not available for Intra_8x8 prediction ", the following applies.
If the sample p[ 0, "1 ] is marked as "available for Intra_8x8 prediction ", p'[ "1, "1 ] is derived by
p'[ "1, "1 ] = ( 3 * p[ "1, "1 ] + p[ 0, "1 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 82)
Otherwise, if (the sample p[ 0, "1 ] is marked as "not available for Intra_8x8 prediction " and the sample p[ "1, 0 ] is marked as "available for Intra_8x8 prediction "), p'[ "1, "1 ] is derived by
p'[ "1, "1 ] = ( 3 * p[ "1, "1 ] + p[ "1, 0 ] + 2) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 83)
Otherwise (the sample p[ 0, "1 ] is marked as "not available for Intra_8x8 prediction" and the sample p[ "1, 0 ] is marked as "not available for Intra_8x8 prediction"), p'[ "1, "1 ] is set equal to p[ "1, "1 ].
NOTE When both samples p[ 0, "1 ] and p[ "1, 0 ] are marked as "not available for Intra_8x8 prediction", the derived sample p'[ "1, "1 ] is not used in the intra prediction process.
Otherwise (the sample p[ 0, "1 ] is marked as "available for Intra_8x8 prediction " and the sample p[ "1, 0 ] is marked as "available for Intra_8x8 prediction "), p'[ "1, "1 ] is derived by
p'[ "1, "1 ] = ( p[ 0, "1 ] + 2 * p[ "1, "1 ] + p[ "1, 0 ] + 2) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 84)
When all samples p[ "1, y ] with y = 0..7 are marked as "available for Intra_8x8 prediction ", the following applies:.
The value of p'[ "1, 0 ] is derived as follows.
If p[ "1, "1 ] is marked as "available for Intra_8x8 prediction ", p'[ "1, 0 ] is derived by
p'[ "1, 0 ] = ( p[ "1, "1 ] + 2 * p[ "1, 0 ] + p[ "1, 1 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 85)
Otherwise (if p[ "1, "1 ] is marked as "not available for Intra_8x8 prediction "), p'[ "1, 0 ] is derived by
p'[ "1, 0 ] = ( 3 * p[ "1, 0 ] + p[ "1, 1 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 86)
The values of p'[ "1, y ], with y = 1..6, are derived by
p'[ "1, y ] = ( p[ "1, y " 1 ] + 2 * p[ "1, y ] + p[ "1, y+1 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 87)
The value of p'[ "1, 7 ] is derived by
p'[ "1, 7 ] = ( p[ "1, 6 ] + 3 * p[ "1, 7 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 88)
Specification of Intra_8x8_Vertical prediction mode
This Intra_8x8 prediction mode is invoked when Intra8x8PredMode[ luma8x8BlkIdx ] is equal to 0.
This mode shall be used only when the samples p[ x, "1 ] with x = 0..7 are marked as "available for Intra_8x8 prediction ".
The values of the prediction samples pred8x8L[ x, y ], with x, y = 0..7, are derived by
pred8x8L[ x, y ] = p'[ x, "1 ], with x, y = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 89)
Specification of Intra_8x8_Horizontal prediction mode
This Intra_8x8 prediction mode is invoked when Intra8x8PredMode[ luma8x8BlkIdx ] is equal to 1.
This mode shall be used only when the samples p[ "1, y ], with y = 0..7, are marked as "available for Intra_8x8 prediction ".
The values of the prediction samples pred8x8L[ x, y ], with x, y = 0..7, are derived by
pred8x8L[ x, y ] = p'[ "1, y ], with x, y = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 90)
Specification of Intra_8x8_DC prediction mode
This Intra_8x8 prediction mode is invoked when Intra8x8PredMode[ luma8x8BlkIdx ] is equal to 2.
The values of the prediction samples pred8x8L[ x, y ], with x, y = 0..7, are derived as follows.
– If all samples p[ x, "1 ], with x = 0..7, and p[ "1, y ], with y = 0..7, are marked as "available for Intra_8x8 prediction, " the values of the prediction samples pred8x8L[ x, y ], with x, y = 0..7, are derived by
EMBED Equation.3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 91)
Otherwise, if any samples p[ x, "1 ], with x = 0..7, are marked as "not available for Intra_8x8 prediction " and all samples p[ "1, y ], with y = 0..7, are marked as "available for Intra_8x8 prediction ", the values of the prediction samples pred8x8L[ x, y ], with x, y = 0..7, are derived by
EMBED Equation.3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 92)
Otherwise, if any samples p[ "1, y ], with y = 0..7, are marked as "not available for Intra_8x8 prediction " and all samples p[ x, "1 ], with x = 0..7, are marked as "available for Intra_8x8 prediction ", the values of the prediction samples pred8x8L[ x, y ], with x, y = 0..7, are derived by
EMBED Equation.3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 93)
Otherwise (some samples p[ x, "1 ], with x = 0..7, and some samples p[ "1, y ], with y = 0..7, are marked as "not available for Intra_8x8 prediction "), the values of the prediction samples pred8x8L[ x, y ], with x, y = 0..7, are derived by
pred8x8L[ x, y ] = ( 1 << ( BitDepthY " 1 ) ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 94)
NOTE An 8x8 luma block can always be predicted using this mode.
Specification of Intra_8x8_Diagonal_Down_Left prediction mode
This Intra_8x8 prediction mode is invoked when Intra8x8PredMode[ luma8x8BlkIdx ] is equal to 3.
This mode shall be used only when the samples p[ x, "1 ] with x = 0..15 are marked as "available for Intra_8x8 prediction ".
The values of the prediction samples pred8x8L[ x, y ], with x, y = 0..7, are derived as follows.
If x is equal to 7 and y is equal to 7,
pred8x8L[ x, y ] = ( p'[ 14, "1 ] + 3 * p'[15, "1 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 95)
Otherwise (x is not equal to 7 or y is not equal to 7),
pred8x8L[ x, y ] = ( p'[ x + y, "1 ] + 2 * p'[ x + y + 1, "1 ] + p'[ x + y + 2, "1 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 96)
Specification of Intra_8x8_Diagonal_Down_Right prediction mode
This Intra_8x8 prediction mode is invoked when Intra8x8PredMode[ luma8x8BlkIdx ] is equal to 4.
This mode shall be used only when the samples p[ x, "1 ] with x = 0..7 and p[ "1, y ] with y = "1..7 are marked as "available for Intra_8x8 prediction ".
The values of the prediction samples pred8x8L[ x, y ], with x, y = 0..7, are derived as follows.
If x is greater than y,
pred8x8L[ x, y ] = ( p'[ x -" y -" 2, "1] + 2 * p'[ x -" y -" 1, "1 ] + p'[ x -" y, "1 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 97)
Otherwise if x is less than y,
pred8x8L[ x, y ] = ( p'[ "1, y -" x -" 2 ] + 2 * p'[ "1, y -" x -" 1 ] + p'[ "1, y -" x ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 98)
Otherwise (x is equal to y),
pred8x8L[ x, y ] = ( p'[ 0, "1 ] + 2 * p'[ "1, "1 ] + p'[ "1, 0 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 99)
Specification of Intra_8x8_Vertical_Right prediction mode
This Intra_8x8 prediction mode is invoked when Intra8x8PredMode[ luma8x8BlkIdx ] is equal to 5.
This mode shall be used only when the samples p[ x, "1 ] with x = 0..7 and p[ "1, y ] with y = "1..7 are marked as "available for Intra_8x8 prediction ".
Let the variable zVR be set equal to 2 * x " y.
The values of the prediction samples pred8x8L[ x, y ], with x, y = 0..7, are derived as follows.
If zVR is equal to 0, 2, 4, 6, 8, 10, 12, or 14
pred8x8L[ x, y ] = ( p'[ x -" ( y >> 1 ) -" 1, "1 ] + p'[ x -" ( y >> 1 ), "1 ] + 1 ) >> 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 100)
Otherwise, if zVR is equal to 1, 3, 5, 7, 9, 11, or 13
pred8x8L[ x, y ] = ( p'[ x -" ( y >> 1 ) -" 2, "1] + 2 * p'[ x -" ( y >> 1 ) -" 1, "1 ] + p'[ x -" ( y >> 1 ), "1 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 101)
Otherwise, if zVR is equal to "1,
pred8x8L[ x, y ] = ( p'[ "1, 0 ] + 2 * p'[ "1, "1 ] + p'[ 0, "1 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 102)
Otherwise (zVR is equal to "2, "3, "4, "5, "6, or "7),
pred8x8L[ x, y ] = ( p'[ "1, y -" 2*x -" 1 ] + 2 * p'[ "1, y -" 2*x -" 2 ] + p'[ "1, y -" 2*x -" 3 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 103)
Specification of Intra_8x8_Horizontal_Down prediction mode
This Intra_8x8 prediction mode is invoked when Intra8x8PredMode[ luma8x8BlkIdx ] is equal to 6.
This mode shall be used only when the samples p[ x, "1 ] with x = 0..7 and p[ "1, y ] with y = "1..7 are marked as "available for Intra_8x8 prediction ".
Let the variable zHD be set equal to 2 * y " x.
The values of the prediction samples pred8x8L[ x, y ], with x, y = 0..7, are derived as follows.
If zHD is equal to 0, 2, 4, 6, 8, 10, 12, or 14
pred8x8L[ x, y ] = ( p'[ "1, y -" ( x >> 1 ) -" 1 ] + p'[ "1, y -" ( x >> 1 ) ] + 1 ) >> 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 104)
Otherwise, if zHD is equal to 1, 3, 5, 7, 9, 11, or 13
pred8x8L[ x, y ] = ( p'[ "1, y -" ( x >> 1 ) -" 2 ] + 2 * p'[ "1, y -" ( x >> 1 ) -" 1 ] + p'[ "1, y -" ( x >> 1 ) ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 105)
Otherwise, if zHD is equal to "1,
pred8x8L[ x, y ] = ( p'[ "1, 0 ] + 2 * p'[ "1, "1 ] + p'[ 0, "1 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 106)
Otherwise (zHD is equal to "2, "3, "4, "5, "6, "7),
pred8x8L[ x, y ] = ( p'[ x -" 2*y -" 1, "1 ] + 2 * p'[ x -" 2*y -" 2, "1 ] + p'[ x -" 2*y -" 3, "1 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 107)
Specification of Intra_8x8_Vertical_Left prediction mode
This Intra_8x8 prediction mode is invoked when Intra8x8PredMode[ luma8x8BlkIdx ] is equal to 7.
This mode shall be used only when the samples p[ x, "1 ] with x = 0..15 are marked as "available for Intra_8x8 prediction ".
The values of the prediction samples pred8x8L[ x, y ], with x, y = 0..7, are derived as follows.
If y is equal to 0, 2, 4 or 6
pred8x8L[ x, y ] = ( p'[ x + ( y >> 1 ), "1 ] + p'[ x + ( y >> 1 ) + 1, "1 ] + 1) >> 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 108)
Otherwise (y is equal to 1, 3, 5, 7),
pred8x8L[ x, y ] = ( p'[ x + ( y >> 1 ), "1 ] + 2 * p'[ x + ( y >> 1 ) + 1, "1 ] + p'[ x + ( y >> 1 ) + 2, "1 ] + 2 ) >>2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 109)
Specification of Intra_8x8_Horizontal_Up prediction mode
This Intra_8x8 prediction mode is invoked when Intra8x8PredMode[ luma8x8BlkIdx ] is equal to 8.
This mode shall be used only when the samples p[ "1, y ] with y = 0..7 are marked as "available for Intra_8x8 prediction ".
Let the variable zHU be set equal to x + 2 * y.
The values of the prediction samples pred8x8L[ x, y ], with x, y = 0..7, are derived as follows:.
If zHU is equal to 0, 2, 4, 6, 8, 10, or 12
pred8x8L[ x, y ] = ( p'[ "1, y + ( x >> 1 ) ] + p'[ "1, y + ( x >> 1 ) + 1 ] + 1 ) >> 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 110)
Otherwise, if zHU is equal to 1, 3, 5, 7, 9, or 11
pred8x8L[ x, y ] = ( p'[ "1, y + ( x >> 1 ) ] + 2 * p'[ "1, y + ( x >> 1 ) + 1 ] + p'[ "1, y + ( x >> 1 ) + 2 ] + 2 ) >>2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 111)
Otherwise, if zHU is equal to 13,
pred8x8L[ x, y ] = ( p'[ "1, 6 ] + 3 * p'[ "1, 7 ] + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 112)
Otherwise (zHU is greater than 13),
pred8x8L[ x, y ] = p'[ "1, 7 ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 113)
Intra_16x16 prediction process for luma samples
This process is invoked when the macroblock prediction mode is equal to Intra_16x16. It specifies how the Intra prediction luma samples for the current macroblock are derived.
Input to this process is a (PicWidthInSamplesL)x(PicHeightInSamplesL) array cSL containing constructed luma samples prior to the deblocking filter process of neighbouring macroblocks
Outputs of this process are Intra prediction luma samples for the current macroblock predL[ x, y ].
The 33 neighbouring samples p[ x, y ] that are constructed luma samples prior to the deblocking filter process, with x = "1, y = -"1..15 and with x = 0..15, y = -"1, are derived as specified by the following ordered steps:.
The derivation process for neighbouring locations in subclause REF _Ref81126179 \r \h 6.4.11 is invoked for luma locations with ( x, y ) assigned to ( xN, yN ) as input and mbAddrN and ( xW, yW ) as output.
Each sample p[ x, y ] with x = -"1, y = -"1..15 and with x = 0..15, y = -"1 is derived as follows.
If any of the following conditions is true, the sample p[ x, y ] is marked as "not available for Intra_16x16 prediction”":
– mbAddrN is not available,
– the macroblock mbAddrN is coded in an Inter macroblock prediction mode and constrained_intra_pred_flag is equal to 1,.
– the macroblock mbAddrN has mb_type equal to SI and constrained_intra_pred_flag is equal to 1.
– Otherwise, the sample p[ x, y ] is marked as “"available for Intra_16x16 prediction”" and the value of the sample p[ x, y ] is derived as specified by the following ordered steps:.
– The location of the upper-left luma sample of the macroblock mbAddrN is derived by invoking the inverse macroblock scanning process in subclause REF _Ref32839806 \r \h 6.4.1 with mbAddrN as the input and the output is assigned to ( xM, yM ).
– Depending on the variable MbaffFrameFlag and the macroblock mbAddrN, the sample value p[ x, y ] is derived as follows.
– If MbaffFrameFlag is equal to 1 and the macroblock mbAddrN is a field macroblock,
p[ x, y ] = cSL[ xM + xW, yM + 2 * yW ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 114)
– Otherwise (MbaffFrameFlag is equal to 0 or the macroblock mbAddrN is a frame macroblock),
p[ x, y ] = cSL[ xM + xW, yM + yW ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 115)
Let predL[ x, y ] with x, y = 0..15 denote the prediction samples for the 16x16 luma block samples.
Intra_16x16 prediction modes are specified in REF _Ref26706263 \h Table 84.
Table STYLEREF 1 \s 8 SEQ Table \* ARABIC \s 1 4 – Specification of Intra16x16PredMode and associated names
Intra16x16PredModeName of Intra16x16PredMode0Intra_16x16_Vertical (prediction mode)1Intra_16x16_Horizontal (prediction mode)2Intra_16x16_DC (prediction mode)3Intra_16x16_Plane (prediction mode)Depending on Intra16x16PredMode, one of the Intra_16x16 prediction modes specified in subclauses REF _Ref26698380 \r \h 8.3.3.1 to REF _Ref26698383 \r \h 8.3.3.4 is invoked.
Specification of Intra_16x16_Vertical prediction mode
This Intra_16x16 prediction mode shall be used only when the samples p[ x, -"1 ] with x = 0..15 are marked as "available for Intra_16x16 prediction ".
The values of the prediction samples predL[ x, y ], with x, y = 0..15, are derived by
predL[ x, y ] = p[ x, -"1 ], with x, y = 0..15 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 116)
Specification of Intra_16x16_Horizontal prediction mode
This Intra_16x16 prediction mode shall be used only when the samples p[-"1, y] with y = 0..15 are marked as "available for Intra_16x16 prediction ".
The values of the prediction samples predL[ x, y ], with x, y = 0..15, are derived by
predL[ x, y ] = p[ -"1, y ], with x, y = 0..15 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 117)
Specification of Intra_16x16_DC prediction mode
This Intra_16x16 prediction mode operates, depending on whether the neighbouring samples are marked as "available for Intra_16x16 prediction ", as follows.
If all neighbouring samples p[ x, -"1 ], with x = 0..15, and p[ -"1, y ], with y = 0..15, are marked as "available for Intra_16x16 prediction ", the prediction for all luma samples in the macroblock is given by:
predL[ x, y ] = EMBED Equation.3, with x, y = 0..15 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 118)
Otherwise, if any of the neighbouring samples p[ x, -"1 ], with x = 0..15, are marked as "not available for Intra_16x16 prediction" and all of the neighbouring samples p[ -"1, y ], with y = 0..15, are marked as "available for Intra_16x16 prediction ", the prediction for all luma samples in the macroblock is given by:
predL[ x, y ] = EMBED Equation.3 , with x, y = 0..15 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 119)
Otherwise, if any of the neighbouring samples p[ -"1, y ], with y = 0..15, are marked as "not available for Intra_16x16 prediction" and all of the neighbouring samples p[ x, -"1 ], with x = 0..15, are marked as "available for Intra_16x16 prediction ", the prediction for all luma samples in the macroblock is given by:
predL[ x, y ] = EMBED Equation.3, with x, y = 0..15 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 120)
Otherwise (some of the neighbouring samples p[ x, -"1 ], with x = 0..15, and some of the neighbouring samples p[ "1, y ], with y = 0..15, are marked as "not available for Intra_16x16 prediction "), the prediction for all luma samples in the macroblock is given by:
predL[ x, y ] = ( 1 << ( BitDepthY " 1 ) ), with x, y = 0..15 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 121)
Specification of Intra_16x16_Plane prediction mode
This Intra_16x16 prediction mode shall be used only when the samples p[ x, -"1 ] with x = -"1..15 and p[ -"1, y ] with y = 0..15 are marked as "available for Intra_16x16 prediction ".
The values of the prediction samples predL[ x, y ], with x, y = 0..15, are derived by
predL[ x, y ] = Clip1Y( ( a + b * ( x -" 7 ) + c * ( y -" 7 ) + 16 ) >> 5 ), with x, y = 0..15, ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 122)
where:
a = 16 * ( p[ -"1, 15 ] + p[ 15, -"1 ] ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 123)
b = ( 5 * H + 32 ) >> 6 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 124)
c = ( 5 * V + 32 ) >> 6 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 125)
and H and V are specified asin Equations REF HforIntraPred_Eqn \h 8-128 and REF VforIntraPred_Eqn \h 8-129.
EMBED Equation.3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 126)
EMBED Equation.3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 127)
Intra prediction process for chroma samples
This process is invoked for I and SI macroblock types. It specifies how the Intra prediction chroma samples for the current macroblock are derived.
Inputs to this process are two (PicWidthInSamplesC)x(PicHeightInSamplesC) arrays cSCb and cSCr containing constructed chroma samples prior to the deblocking filter process of neighbouring macroblocks
Outputs of this process are Intra prediction chroma samples for the current macroblock predCb[ x, y ] and predCr[ x, y ].
Depending on the value of ChromaArrayType, the following applies.
– If ChromaArrayType is equal to 3, the Intra prediction chroma samples for the current macroblock predCb[ x, y ] and predCr[ x, y ] are derived using the Intra prediction process for chroma samples with ChromaArrayType equal to 3 as specified in subclause REF _Ref166969171 \r \h 8.3.4.5.
– Otherwise (ChromaArrayType is equal to 1 or 2), the following text specifies the Intra prediction chroma samples for the current macroblock predCb[ x, y ] and predCr[ x, y ].
Both chroma blocks (Cb and Cr) of the macroblock use the same prediction mode. The prediction mode is applied to each of the chroma blocks separately. The process specified in this subclause is invoked for each chroma block. In the remainder of this subclause, chroma block refers to one of the two chroma blocks and the subscript C is used as a replacement of the subscript Cb or Cr.
The neighbouring samples p[ x, y ] that are constructed chroma samples prior to the deblocking filter process, with x = "1, y = "1..MbHeightC " 1 and with x = 0..MbWidthC " 1, y = "1, are derived as specified by the following ordered steps:.
The derivation process for neighbouring locations in subclause REF _Ref81126179 \r \h 6.4.11 is invoked for chroma locations with ( x, y ) assigned to ( xN, yN ) as input and mbAddrN and ( xW, yW ) as output.
Each sample p[ x, y ] is derived as follows.
– If any of the following conditions is true, the sample p[ x, y ] is marked as “"not available for Intra chroma prediction”":
– mbAddrN is not available,
– the macroblock mbAddrN is coded in an Inter macroblock prediction mode and constrained_intra_pred_flag is equal to 1,.
– the macroblock mbAddrN has mb_type equal to SI and constrained_intra_pred_flag is equal to 1 and the current macroblock does not have mb_type equal to SI.
– Otherwise, the sample p[ x, y ] is marked as “"available for Intra chroma prediction”" and the value of the sample p[ x, y ] is derived as specified by the following ordered steps:.
– The location of the upper-left luma sample of the macroblock mbAddrN is derived by invoking the inverse macroblock scanning process in subclause REF _Ref32839806 \r \h 6.4.1 with mbAddrN as the input and the output is assigned to ( xL, yL ).
– The location ( xM, yM ) of the upper-left chroma sample of the macroblock mbAddr is derived by
xM = ( xL >> 4 ) * MbWidthC ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 128)yM = ( ( yL >> 4 )* MbHeightC ) + ( yL % 2 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 129)
– Depending on the variable MbaffFrameFlag and the macroblock mbAddrN, the sample value p[ x, y ] is derived as follows.
– If MbaffFrameFlag is equal to 1 and the macroblock mbAddrN is a field macroblock,
p[ x, y ] = cSC[ xM + xW, yM + 2 * yW ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 130)
– Otherwise (MbaffFrameFlag is equal to 0 or the macroblock mbAddrN is a frame macroblock),
p[ x, y ] = cSC[ xM + xW, yM + yW ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 131)
Let predC[ x, y ] with x = 0..MbWidthC " 1, y = 0..MbHeightC " 1 denote the prediction samples for the chroma block samples.
Intra chroma prediction modes are specified in REF _Ref26699636 \h Table 85.
Table STYLEREF 1 \s 8 SEQ Table \* ARABIC \s 1 5 Specification of Intra chroma prediction modes and associated names
intra_chroma_pred_modeName of intra_chroma_pred_mode0Intra_Chroma_DC (prediction mode)1Intra_Chroma_Horizontal (prediction mode)2Intra_Chroma_Vertical (prediction mode)3Intra_Chroma_Plane (prediction mode)
Depending on intra_chroma_pred_mode, one of the Intra chroma prediction modes specified in subclauses REF _Ref26699782 \r \h 8.3.4.1 to REF _Ref34468570 \r \h 8.3.4.4 is invoked.
Specification of Intra_Chroma_DC prediction mode
This Intra chroma prediction mode is invoked when intra_chroma_pred_mode is equal to 0.
For each chroma block of 4x4 samples indexed by chroma4x4BlkIdx = 0..( 1 << ( ChromaArrayType + 1 ) ) " 1, the following applies.
The position of the upper-left sample of a 4x4 chroma block with index chroma4x4BlkIdx is derived as
xO = InverseRasterScan( chroma4x4BlkIdx, 4, 4, 8, 0 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 132)
yO = InverseRasterScan( chroma4x4BlkIdx, 4, 4, 8, 1 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 133)
– Depending on the values of xO and yO, the following applies.
– If ( xO, yO ) is equal to ( 0, 0 ) or xO and yO are greater than 0, the values of the prediction samples predC[ x + xO, y + yO ] with x, y = 0..3 are derived as follows.
– If all samples p[ x + xO, "1 ], with x = 0..3, and p[ "1, y +yO ], with y = 0..3, are marked as "available for Intra chroma prediction ", the values of the prediction samples predC[ x + xO, y + yO ], with x, y = 0..3, are derived as
EMBED Equation.3 , with x, y = 0..3. ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 134)
Otherwise, if any samples p[ x + xO, "1 ], with x = 0..3, are marked as "not available for Intra chroma prediction " and all samples p[ "1, y +yO ], with y = 0..3, are marked as “"available for Intra chroma prediction”", the values of the prediction samples predC[ x + xO, y + yO ], with x, y = 0..3, are derived as
EMBED Equation.3 , with x, y = 0..3. ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 135)
– Otherwise, if any samples p[ "1, y +yO ], with y = 0..3, are marked as "not available for Intra chroma prediction " and all samples p[ x + xO, "1 ], with x = 0..3, are marked as "available for Intra chroma prediction ", the values of the prediction samples predC[ x + xO, y + yO ], with x, y = 0..3, are derived as
EMBED Equation.3 , with x, y = 0..3. ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 136)
Otherwise (some samples p[ x + xO, "1 ], with x = 0..3, and some samples p[ "1, y +yO ], with y = 0..3, are marked as "not available for Intra chroma prediction "), the values of the prediction samples predC[ x + xO, y + yO ], with x, y = 0..3, are derived as
predC[ x + xO, y + yO ] = ( 1 << ( BitDepthC " 1 ) ), with x, y = 0..3. ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 137)
Otherwise, if xO is greater than 0 and yO is equal to 0, the values of the prediction samples predC[ x + xO, y + yO ] with x, y = 0..3 are derived as follows.
If all samples p[ x + xO, "1 ], with x = 0..3, are marked as "available for Intra chroma prediction ", the values of the prediction samples predC[ x + xO, y + yO ], with x, y = 0..3, are derived as
EMBED Equation.3 , with x, y = 0..3. ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 138)
Otherwise, if all samples p[ "1, y +yO ], with y = 0..3, are marked as “"available for Intra chroma prediction”", the values of the prediction samples predC[ x + xO, y + yO ], with x, y = 0..3, are derived as
EMBED Equation.3 , with x, y = 0..3. ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 139)
– Otherwise (some samples p[ x + xO, "1 ], with x = 0..3, and some samples p[ "1, y +yO ], with y = 0..3, are marked as "not available for Intra chroma prediction "), the values of the prediction samples predC[ x + xO, y + yO ], with x, y = 0..3, are derived as
predC[ x + xO, y + yO ] = ( 1 << ( BitDepthC " 1 ) ), with x, y = 0..3. ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 140)
Otherwise (xO is equal to 0 and yO is greater than 0), the values of the prediction samples predC[ x + xO, y + yO ] with x, y = 0..3 are derived as follows.
If all samples p[ "1, y +yO ], with y = 0..3, are marked as "available for Intra chroma prediction ", the values of the prediction samples predC[ x + xO, y + yO ], with x, y = 0..3, are derived as
EMBED Equation.3 , with x, y = 0..3. ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 141)
Otherwise, if all samples p[ x + xO, "1 ], with x = 0..3, are marked as "available for Intra chroma prediction ", the values of the prediction samples predC[ x + xO, y + yO ], with x, y = 0..3, are derived as
EMBED Equation.3 , with x, y = 0..3. ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 142)
Otherwise (some samples p[ x + xO, "1 ], with x = 0..3, and some samples p[ "1, y +yO ], with y = 0..3, are marked as "not available for Intra chroma prediction "), the values of the prediction samples predC[ x + xO, y + yO ], with x, y = 0..3, are derived as
predC[ x + xO, y + yO ] = ( 1 << ( BitDepthC " 1 ) ), with x, y = 0..3. ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 143)
Specification of Intra_Chroma_Horizontal prediction mode
This Intra chroma prediction mode is invoked when intra_chroma_pred_mode is equal to 1.
This mode shall be used only when the samples p[ "1, y ] with y = 0..MbHeightC " 1 are marked as "available for Intra chroma prediction".
The values of the prediction samples predC[ x, y ] are derived as follows.
predC[ x, y ] = p[ "1, y ], with x = 0..MbWidthC " 1 and y = 0..MbHeightC " 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 144)
Specification of Intra_Chroma_Vertical prediction mode
This Intra chroma prediction mode is invoked when intra_chroma_pred_mode is equal to 2.
This mode shall be used only when the samples p[ x, "1 ] with x = 0..MbWidthC " 1 are marked as "available for Intra chroma prediction".
The values of the prediction samples predC[ x, y ] are derived as follows.
predC[ x, y ] = p[ x, "1 ], with x = 0..MbWidthC " 1 and y = 0..MbHeightC " 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 145)
Specification of Intra_Chroma_Plane prediction mode
This Intra chroma prediction mode is invoked when intra_chroma_pred_mode is equal to 3.
This mode shall be used only when the samples p[ x, "1 ], with x = 0..MbWidthC " 1 and p[ "1, y ], with y = "1..MbHeightC " 1 are marked as "available for Intra chroma prediction".
The values of the prediction samples predC[ x, y ] are derived as follows.
Let the variable xCF be set equal to 4 * ( ( ChromaArrayType = = 3 ) ? 4 : 0 ) and let the variable yCF be set equal to 4 * ( ( ChromaArrayType != 1 ) ? 4 : 0 ).
The values of the prediction samples predC[ x, y ] are derived by
predC[ x, y ] = Clip1C( ( a + b * ( x –" 3 " xCF ) + c * ( y " 3 " yCF ) + 16 ) >> 5 ), with x = 0..MbWidthC " 1 and y = 0..MbHeightC " 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 146)
where:
a = 16 * ( p[ "1, MbHeightC " 1 ] + p[ MbWidthC " 1, "1 ] ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 147)
b = ( ( 34 " 29 * ( ChromaArrayType = = 3 ) ) * H + 32 ) >> 6 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 148)
c = ( ( 34 " 29 * ( ChromaArrayType != 1 ) ) * V + 32 ) >> 6 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 149)
and H and V are specified as
EMBED Equation.3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 150)
EMBED Equation.3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 151)
Intra prediction for chroma samples with ChromaArrayType equal to 3
This process is invoked when ChromaArrayType is equal to 3. This process is invoked for I and SI macroblock types. It specifies how the Intra prediction chroma samples for the current macroblock are derived when ChromaArrayType is equal to 3.
Inputs to this process are constructed samples prior to the deblocking filter process from neighbouring Cb and Cr blocks and for Intra_NxN (where NxN is equal to 4x4 or 8x8) prediction mode, the associated values of IntraNxNPredMode from neighbouring macroblocks.
Outputs of this process are the Intra prediction samples of the Cb and Cr components of the macroblock or in case of the Intra_NxN prediction process, the outputs are NxN Cb sample arrays as part of the 16x16 Cb array of prediction samples of the macroblock, and NxN Cb sample arrays as part of the 16x16 Cb array of prediction samples of the macroblock.
Each Cb, Cr, and luma block with the same block index of the macroblock use the same prediction mode. The prediction mode is applied to each of the Cb and Cr blocks separately. The process specified in this subclause is invoked for each Cb and Cr block.
Depending on the macroblock prediction mode, the following applies.
– If the macroblock prediction mode is equal to Intra_4x4, the following applies.
– The same process described in subclause REF _Ref26701748 \r \h 8.3.1 is also applied to Cb or Cr samples, substituting luma with Cb or Cr, substituting luma4x4BlkIdx with cb4x4BlkIdx or cr4x4BlkIdx, substituting pred4x4L with pred4x4Cb or pred4x4Cr, and substituting BitDepthY with BitDepthC.
– The output variable Intra4x4PredMode[luma4x4BlkIdx] from the process described in subclause REF _Ref24109191 \r \h 8.3.1.1 is also used for the 4x4 Cb or 4x4 Cr blocks with index luma4x4BlkIdx equal to index cb4x4BlkIdx or cr4x4BlkIdx.
– The process to derive prediction Cb or Cr samples is identical to the process described in subclause REF _Ref31454315 \r \h 8.3.1.2 and its subsequent subclauses when substituting luma with Cb or Cr, substituting pred4x4L with pred4x4Cb or pred4x4Cr, and substituting BitDepthY with BitDepthC.
– Otherwise, if the macroblock prediction mode is equal to Intra_8x8, the following applies.
– The same process described in subclause REF _Ref81134057 \r \h 8.3.2 is also applied to Cb or Cr samples, substituting luma with Cb or Cr, substituting luma8x8BlkIdx with cb8x8BlkIdx or cr8x8BlkIdx, substituting pred8x8L with pred8x8Cb or pred8x8Cr, and substituting BitDepthY with BitDepthC.
– The output variable Intra8x8PredMode[luma8x8BlkIdx] from the process described in subclause REF _Ref81133891 \r \h 8.3.2.1 is used for the 8x8 Cb or 8x8 Cr blocks with index luma8x8BlkIdx equal to index cb8x8BlkIdx or cr8x8BlkIdx.
– The process to derive prediction Cb or Cr samples is identical to the process described in subclause REF _Ref81133974 \r \h 8.3.2.2 and its subsequent subclauses when substituting luma with Cb or Cr, substituting pred8x8L with pred8x8Cb or pred8x8Cr, and substituting BitDepthY with BitDepthC.
– Otherwise (, if the macroblock prediction mode is equal to Intra_16x16), the following applies.
– The same process described in subclause REF _Ref26701754 \r \h 8.3.3 and in the subsequent subclause REF _Ref26698380 \r \h 8.3.3.1 to REF _Ref26698383 \r \h 8.3.3.4 is also applied to Cb or Cr samples, substituting luma with Cb or Cr, substituting predL with predCb or predCr, and substituting BitDepthY with BitDepthC.
Sample construction process for I_PCM macroblocks
This process is invoked when mb_type is equal to I_PCM.
The variable dy is derived as follows.
– If MbaffFrameFlag is equal to 1 and the current macroblock is a field macroblock, dy is set equal to 2.
– Otherwise (MbaffFrameFlag is equal to 0 or the current macroblock is a frame macroblock), dy is set equal to 1.
The position of the upper-left luma sample of the current macroblock is derived by invoking the inverse macroblock scanning process in subclause REF _Ref32839806 \r \h \* MERGEFORMAT 6.4.1 with CurrMbAddr as input and the output being assigned to ( xP, yP ).
The constructed luma samples prior to the deblocking process are generated as specified by:
for( i = 0; i < 256; i++ ) S'L[ xP + ( i % 16 ), yP + dy * ( i / 16 ) ) ] = pcm_sample_luma[ i ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 152)
When ChromaArrayType is not equal to 0, the constructed chroma samples prior to the deblocking process are generated as specified by:
for( i = 0; i < MbWidthC * MbHeightC; i++ ) { S'Cb[ ( xP / SubWidthC ) + ( i % MbWidthC ), ( ( yP + SubHeightC –" 1 ) / SubHeightC ) + dy * ( i / MbWidthC ) ] = pcm_sample_chroma[ i ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 153) S'Cr[ ( xP / SubWidthC ) + ( i % MbWidthC ), ( ( yP + SubHeightC " 1 ) / SubHeightC ) + dy * ( i / MbWidthC ) ] = pcm_sample_chroma[ i + MbWidthC * MbHeightC ]}
Inter prediction process
This process is invoked when decoding P and B macroblock types.
Outputs of this process are Inter prediction samples for the current macroblock that are a 16x16 array predL of luma samples and when ChromaArrayType is not equal to 0 two (MbWidthC)x(MbHeightC) arrays predCb and predCr of chroma samples, one for each of the chroma components Cb and Cr.
The partitioning of a macroblock is specified by mb_type. Each macroblock partition is referred to by mbPartIdx. When the macroblock partitioning consists of partitions that are equal to sub-macroblocks, each sub-macroblock can be further partitioned into sub-macroblock partitions as specified by sub_mb_type[ mbPartIdx ]. Each sub-macroblock partition is referred to by subMbPartIdx. When the macroblock partitioning does not consist of sub-macroblocks, subMbPartIdx is set equal to 0.
The following steps are specified for each macroblock partition or for each sub-macroblock partition.
The functions MbPartWidth( ), MbPartHeight( ), SubMbPartWidth( ), and SubMbPartHeight( ) describing the width and height of macroblock partitions and sub-macroblock partitions are specified in Tables REF tab_7_13 \h 713, REF tab_7_14 \h 714, REF tab_7_17 \h 717, and REF tab_7_18 \h 718 REF _Ref29979788 \h Table 713, 7-14, 7-17, and 7-18.
The range of the macroblock partition index mbPartIdx is derived as follows.
– If mb_type is equal to B_Skip or B_Direct_16x16, mbPartIdx proceeds over values 0..3.
Otherwise (mb_type is not equal to B_Skip or B_Direct_16x16), mbPartIdx proceeds over values 0..NumMbPart( mb_type ) " 1.
For each value of mbPartIdx, the variables partWidth and partHeight for each macroblock partition or sub-macroblock partition in the macroblock are derived as follows.
– If mb_type is not equal to P_8x8, P_8x8ref0, B_Skip, B_Direct_16x16, or B_8x8, subMbPartIdx is set equal to 0, and partWidth and partHeight are derived as
partWidth = MbPartWidth( mb_type ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 154)
partHeight = MbPartHeight( mb_type ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 155)
– Otherwise, if mb_type is equal to P_8x8 or P_8x8ref0, or mb_type is equal to B_8x8 and sub_mb_type[ mbPartIdx ] is not equal to B_Direct_8x8, subMbPartIdx proceeds over values 0..NumSubMbPart( sub_mb_type[ mbPartIdx ] ) " 1, and partWidth and partHeight are derived as
partWidth = SubMbPartWidth( sub_mb_type[ mbPartIdx ] ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 156)
partHeight = SubMbPartHeight( sub_mb_type[ mbPartIdx ] ). ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 157)
– Otherwise (mb_type is equal to B_Skip or B_Direct_16x16, or mb_type is equal to B_8x8 and sub_mb_type[ mbPartIdx ] is equal to B_Direct_8x8), subMbPartIdx proceeds over values 0..3, and partWidth and partHeight are derived as
partWidth = 4 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 158)
partHeight = 4 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 159)
When ChromaArrayType is not equal to 0, the variables partWidthC and partHeightC are derived as
partWidthC = partWidth / SubWidthC ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 160)partHeightC = partHeight / SubHeightC ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 161)
Let the variable MvCnt be initially set equal to 0 before any invocation of subclause REF _Ref32720804 \r \h 8.4.1 for the macroblock.
The Inter prediction process for a macroblock partition mbPartIdx and a sub-macroblock partition subMbPartIdx consists of the following ordered steps
Derivation process for motion vector components and reference indices as specified in subclause REF _Ref32720804 \r \h 8.4.1.
Inputs to this process are
– a macroblock partition mbPartIdx,
– a sub-macroblock partition subMbPartIdx.
Outputs of this process are
– luma motion vectors mvL0 and mvL1 and when ChromaArrayType is not equal to 0, the chroma motion vectors mvCL0 and mvCL1
– reference indices refIdxL0 and refIdxL1
– prediction list utilization flags predFlagL0 and predFlagL1
– the sub-macroblock partition motion vector count subMvCnt.
The variable MvCnt is incremented by subMvCnt.
Derivation process for prediction weights as specified in subclause REF _Ref168732811 \r \h 8.4.3.
Inputs to this process are
– reference indices refIdxL0 and refIdxL1
– prediction list utilization flags predFlagL0 and predFlagL1
Outputs of this process are
– variables for weighted prediction logWDC, w0C, w1C, o0C, o1C with C being replaced by L and, when ChromaArrayType is not equal to 0, Cb and Cr.
Decoding process for Inter prediction samples as specified in subclause REF _Ref28156226 \r \h 8.4.2.
Inputs to this process are
– a macroblock partition mbPartIdx,
– a sub-macroblock partition subMbPartIdx.
– variables specifying partition width and height for luma and chroma (if available), partWidth, partHeight, partWidthC (if available), and partHeightC (if available)
– luma motion vectors mvL0 and mvL1 and when ChromaArrayType is not equal to 0, the chroma motion vectors mvCL0 and mvCL1
– reference indices refIdxL0 and refIdxL1
– prediction list utilization flags predFlagL0 and predFlagL1
– variables for weighted prediction logWDC, w0C, w1C, o0C, o1C with C being replaced by L and, when ChromaArrayType is not equal to 0, Cb and Cr
Outputs of this process are
– inter prediction samples (pred); which are a (partWidth)x(partHeight) array predPartL of prediction luma samples and when ChromaArrayType is not equal to 0 two (partWidthC)x(partHeightC) arrays predPartCr, and predPartCb of prediction chroma samples, one for each of the chroma components Cb and Cr.
For use in derivation processes of variables invoked later in the decoding process, the following assignments are made:
MvL0[ mbPartIdx ][ subMbPartIdx ] = mvL0 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 162)
MvL1[ mbPartIdx ][ subMbPartIdx ] = mvL1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 163)
RefIdxL0[ mbPartIdx ] = refIdxL0 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 164)
RefIdxL1[ mbPartIdx ] = refIdxL1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 165)
PredFlagL0[ mbPartIdx ] = predFlagL0 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 166)
PredFlagL1[ mbPartIdx ] = predFlagL1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 167)
The location of the upper-left sample of the macroblock partition relative to the upper-left sample of the macroblock is derived by invoking the inverse macroblock partition scanning process as described in subclause REF _Ref32895890 \r \h 6.4.2.1 with mbPartIdx as the input and ( xP, yP ) as the output.
The location of the upper-left sample of the sub-macroblock sub-partition relative to the upper-left sample of the macroblock partition is derived by invoking the inverse sub-macroblock partition scanning process as described in subclause REF _Ref32895891 \r \h 6.4.2.2 with subMbPartIdx as the input and ( xS, yS ) as the output.
The macroblock prediction is formed by placing the macroblockpartition or sub-macroblock partition prediction samples in their correct relative positions in the macroblock, as follows.
The variable predL[ xP + xS + x, yP + yS + y ] with x = 0 .. partWidth " 1, y = 0 .. partHeight " 1 is derived by
predL[ xP + xS + x, yP + yS + y ] = predPartL[ x, y ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 168)
When ChromaArrayType is not equal to 0, the variable predC with x = 0..partWidthC " 1, y = 0..partHeightC " 1, and C in predC and predPartC being replaced by Cb or Cr is derived by
predC[ xP / SubWidthC + xS / SubWidthC + x, yP / SubHeightC + yS / SubHeightC + y ] = predPartC[ x, y ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 169)
Derivation process for motion vector components and reference indices
Inputs to this process are
– a macroblock partition mbPartIdx,
– a sub-macroblock partition subMbPartIdx.
Outputs of this process are
– luma motion vectors mvL0 and mvL1 and when ChromaArrayType is not equal to 0, the chroma motion vectors mvCL0 and mvCL1,
– reference indices refIdxL0 and refIdxL1,
– prediction list utilization flags predFlagL0 and predFlagL1,
– a sub-partition macroblock motion vector count variable subMvCnt.
For the derivation of the variables mvL0 and mvL1 as well as refIdxL0 and refIdxL1, the following applies.
– If mb_type is equal to P_Skip, the derivation process for luma motion vectors for skipped macroblocks in P and SP slices in subclause REF _Ref26699325 \r \h \* MERGEFORMAT 8.4.1.1 is invoked with the output being the luma motion vectors mvL0 and reference indices refIdxL0, and predFlagL0 is set equal to 1. mvL1 and refIdxL1 are marked as not available and predFlagL1 is set equal to 0. The sub-partition motion vector count variable subMvCnt is set equal to 1.
– Otherwise, if mb_type is equal to B_Skip or B_Direct_16x16 or sub_mb_type[ mbPartIdx ] is equal to B_Direct_8x8, the derivation process for luma motion vectors for B_Skip, B_Direct_16x16, and B_Direct_8x8 in B slices in subclause REF _Ref24429899 \r \h \* MERGEFORMAT 8.4.1.2 is invoked with mbPartIdx and subMbPartIdx as the input and the output being the luma motion vectors mvL0, mvL1, the reference indices refIdxL0, refIdxL1, the sub-partition motion vector count variable subMvCnt, and the prediction utilization flags predFlagL0 and predFlagL1.
– Otherwise, for X being replaced by either 0 or 1 in the variables predFlagLX, mvLX, refIdxLX, and in Pred_LX and in the syntax elements ref_idx_lX and mvd_lX, the following applies.
The variables refIdxLX and predFlagLX are derived as follows.
– If MbPartPredMode( mb_type, mbPartIdx ) or SubMbPredMode( sub_mb_type[ mbPartIdx ] ) is equal to Pred_LX or to BiPred,
refIdxLX = ref_idx_lX[ mbPartIdx ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 170)
predFlagLX = 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 171)
– Otherwise, the variables refIdxLX and predFlagLX are specified by
refIdxLX = -"1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 172)
predFlagLX = 0 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 173)
The motion vector count variable subMvCnt for sub-partition motion vector count is set equal to predFlagL0 + predFlagL1.
The variable currSubMbType is derived as follows.
– If the macroblock type is equal to B_8x8, currSubMbType is set equal to sub_mb_type[ mbPartIdx ].
– Otherwise (the macroblock type is not equal to B_8x8), currSubMbType is set equal to "na".
When predFlagLX is equal to 1, the derivation process for luma motion vector prediction in subclause REF _Ref27823186 \r \h 8.4.1.3 is invoked with mbPartIdx subMbPartIdx, refIdxLX, and currSubMbType as the inputs and the output being mvpLX. The luma motion vectors are derived by
mvLX[ 0 ] = mvpLX[ 0 ] + mvd_lX[ mbPartIdx ][ subMbPartIdx ][ 0 ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 174)
mvLX[ 1 ] = mvpLX[ 1 ] + mvd_lX[ mbPartIdx ][ subMbPartIdx ][ 1 ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 175)
When ChromaArrayType is not equal to 0 and predFlagLX (with X being either 0 or 1) is equal to 1, the derivation process for chroma motion vectors in subclause REF _Ref27827244 \r \h 8.4.1.4 is invoked with mvLX and refIdxLX as input and the output being mvCLX.
Derivation process for luma motion vectors for skipped macroblocks in P and SP slices
This process is invoked when mb_type is equal to P_Skip.
Outputs of this process are the motion vector mvL0 and the reference index refIdxL0.
The reference index refIdxL0 for a skipped macroblock is derived as follows.
refIdxL0 = 0. ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 176)
For the derivation of the motion vector mvL0 of a P_Skip macroblock type, the following applies.ordered steps are specified:
– The process specified in subclause REF _Ref32903132 \r \h 8.4.1.3.2 is invoked with mbPartIdx set equal to 0, subMbPartIdx set equal to 0, currSubMbType set equal to "na", and listSuffixFlag set equal to 0 as input and the output is assigned to mbAddrA, mbAddrB, mvL0A, mvL0B, refIdxL0A, and refIdxL0B.
– The variable mvL0 is specified as follows.
– If any of the following conditions are true, both components of the motion vector mvL0 are set equal to 0:.
– mbAddrA is not available,
– mbAddrB is not available,
– refIdxL0A is equal to 0 and both components of mvL0A are equal to 0,
– refIdxL0B is equal to 0 and both components of mvL0B are equal to 0.
– Otherwise, the derivation process for luma motion vector prediction as specified in subclause REF _Ref27823186 \r \h 8.4.1.3 is invoked with mbPartIdx = 0, subMbPartIdx = 0, refIdxL0, and currSubMbType = "na" as inputs and the output is assigned to mvL0.
NOTE – The output is directly assigned to mvL0, since the predictor is equal to the actual motion vector.
Derivation process for luma motion vectors for B_Skip, B_Direct_16x16, and B_Direct_8x8
This process is invoked when mb_type is equal to B_Skip or B_Direct_16x16, or sub_mb_type[ mbPartIdx ] is equal to B_Direct_8x8.
Inputs to this process are mbPartIdx and subMbPartIdx.
Outputs of this process are the reference indices refIdxL0, refIdxL1, the motion vectors mvL0 and mvL1, the sub-partition motion vector count variable subMvCnt, and the prediction list utilization flags, predFlagL0 and predFlagL1.
The derivation process depends on the value of direct_spatial_mv_pred_flag, which is present in the bitstream in the slice header syntax as specified in subclause REF _Ref30320556 \r \h 7.3.3, and is specified as follows.
– If direct_spatial_mv_pred_flag is equal to 1, the mode in which the outputs of this process are derived is referred to as spatial direct prediction mode.
– Otherwise (direct_spatial_mv_pred_flag is equal to 0), mode in which the outputs of this process are derived is referred to as temporal direct prediction mode.
Both spatial and temporal direct prediction mode use the co-located motion vectors and reference indices as specified in subclause REF _Ref81457268 \r \h 8.4.1.2.1.
The motion vectors and reference indices are derived as follows.
– If spatial direct prediction mode is used, the direct motion vector and reference index prediction mode specified in subclause REF _Ref32741335 \r \h 8.4.1.2.2 is used, with subMvCnt being an output.
– Otherwise (temporal direct prediction mode is used), the direct motion vector and reference index prediction mode specified in subclause REF _Ref23667460 \r \h 8.4.1.2.3 is used and the variable subMvCnt is derived as follows.
– If subMbPartIdx is equal to 0, subMvCnt is set equal to 2.
– Otherwise (subMbPartIdx is not equal to 0), subMvCnt is set equal to 0.
Derivation process for the co-located 4x4 sub-macroblock partitions
Inputs to this process are mbPartIdx and subMbPartIdx.
Outputs of this process are the picture colPic, the co-located macroblock mbAddrCol, the motion vector mvCol, the reference index refIdxCol, and the variable vertMvScale (which can be One_To_One, Frm_To_Fld or Fld_To_Frm).
When RefPicList1[ 0 ] is a frame or a complementary field pair, let firstRefPicL1Top and firstRefPicL1Bottom be the top and bottom fields of RefPicList1[ 0 ], respectively, and let the following variables be specified as
topAbsDiffPOC = Abs( DiffPicOrderCnt( firstRefPicL1Top, CurrPic ) ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 177)
bottomAbsDiffPOC = Abs( DiffPicOrderCnt( firstRefPicL1Bottom, CurrPic ) ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 178)
The variable colPic specifies the picture that contains the co-located macroblock as specified in REF _Ref32667291 \h Table 86.
Table STYLEREF 1 \s 8 SEQ Table \* ARABIC \s 1 6 – Specification of the variable colPic
field_pic_flagRefPicList1[ 0 ] is …mb_field_decoding_flagadditional conditioncolPic1a field of a decoded framethe frame containing RefPicList1[ 0 ]a decoded fieldRefPicList1[ 0 ]0a decoded frameRefPicList1[ 0 ]a complementary field pair0topAbsDiffPOC < bottomAbsDiffPOCfirstRefPicL1ToptopAbsDiffPOC >= bottomAbsDiffPOCfirstRefPicL1Bottom1( CurrMbAddr & 1 ) = = 0firstRefPicL1Top( CurrMbAddr & 1 ) != 0firstRefPicL1BottomNOTE – The picture order count values of a complementary field pair marked as "used for long-term reference" have an impact on the decoding process when the current picture is a coded frame, the current macroblock is a frame macroblock, and the complementary field pair marked as "used for long-term reference" is the first picture in reference list 1.
When direct_8x8_inference_flag is equal to 1, subMbPartIdx is set as follows.
subMbPartIdx = mbPartIdx ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 181)
Let PicCodingStruct( X ) be a function with the argument X being either CurrPic or colPic. It is specified in REF _Ref32668751 \h Table 87.
Table STYLEREF 1 \s 8 SEQ Table \* ARABIC \s 1 7 – Specification of PicCodingStruct( X )
X is coded with field_pic_flag equal to …mb_adaptive_frame_field_flagPicCodingStruct( X )1FLD00FRM01AFRM
The variable luma4x4BlkIdx is derived as follows.
– If direct_8x8_inference_flag is equal to 0, luma4x4BlkIdx is set equal to (4 * mbPartIdx + subMbPartIdx).
– Otherwise (direct_8x8_inference_flag is equal to 1), luma4x4BlkIdx is set equal to (5 * mbPartIdx).
With luma4x4BlkIdx = mbPartIdx * 4 + subMbPartIdx, tThe inverse 4x4 luma block scanning process as specified in subclause REF _Ref24282177 \r \h 6.4.3 is invoked with luma4x4BlkIdx as the input and ( x, y ) assigned to ( xCol, yCol ) as the output.
REF _Ref32811376 \h Table 88 specifies the co-located macroblock address mbAddrCol, yM, and the variable vertMvScale in two steps:
Specification of a macroblock address mbAddrX depending on PicCodingStruct( CurrPic ), and PicCodingStruct( colPic ).
NOTE – It is not possible for CurrPic and colPic picture coding types to be either (FRM, AFRM) or (AFRM, FRM) because these picture coding types must be separated by an IDR picture.
Specification of mbAddrCol, yM, and vertMvScale depending on mb_field_decoding_flag and the variable fieldDecodingFlagX, which is derived as follows.
– If the macroblock mbAddrX in the picture colPic is a field macroblock, fieldDecodingFlagX is set equal to 1
– Otherwise (the macroblock mbAddrX in the picture colPic is a frame macroblock), fieldDecodingFlagX is set equal to 0.
Unspecified values in REF _Ref32811376 \h Table 88 indicate that the value of the corresponding variable is not relevant for the current table row.
mbAddrCol is set equal to CurrMbAddr or to one of the following values.
mbAddrCol1 = 2 * PicWidthInMbs * ( CurrMbAddr / PicWidthInMbs ) + ( CurrMbAddr % PicWidthInMbs ) + PicWidthInMbs * ( yCol / 8 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 179)
mbAddrCol2 = 2 * CurrMbAddr + ( yCol / 8 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 180)
mbAddrCol3 = 2 * CurrMbAddr + bottom_field_flag ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 181)
mbAddrCol4 = PicWidthInMbs * ( CurrMbAddr / ( 2 * PicWidthInMbs ) ) + ( CurrMbAddr % PicWidthInMbs ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 182)
mbAddrCol5 = CurrMbAddr / 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 183)
mbAddrCol6 = 2 * ( CurrMbAddr / 2 ) + ( ( topAbsDiffPOC < bottomAbsDiffPOC ) ? 0 : 1 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 184)
mbAddrCol7 = 2 * ( CurrMbAddr / 2 ) + ( yCol / 8 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 185)
Table STYLEREF 1 \s 8 SEQ Table \* ARABIC \s 1 8 – Specification of mbAddrCol, yM, and vertMvScale
PicCodingStruct( CurrPic )PicCodingStruct( colPic )mbAddrXmb_field_decoding_flagfieldDecodingFlagXmbAddrColyMvertMvScaleFLDFLDCurrMbAddryColOne_To_OneFRMmbAddrCol1( 2 * yCol ) % 16Frm_To_FldAFRM2*CurrMbAddr0mbAddrCol2( 2 * yCol ) % 16Frm_To_Fld1mbAddrCol3yColOne_To_OneFRMFLDmbAddrCol48 * ( (CurrMbAddr / PicWidthInMbs ) % 2) + 4 * ( yCol / 8 )Fld_To_FrmFRMCurrMbAddryColOne_To_OneAFRMFLD0mbAddrCol58 * ( CurrMbAddr % 2 ) +4 * ( yCol / 8 )Fld_To_Frm1mbAddrCol5yColOne_To_OneAFRMCurrMbAddr00CurrMbAddryColOne_To_One1mbAddrCol68 * ( CurrMbAddr % 2 ) + 4 * ( yCol / 8 )Fld_To_FrmCurrMbAddr10mbAddrCol7( 2 * yCol ) % 16Frm_To_Fld1CurrMbAddryColOne_To_One
Let mbTypeCol be the syntax element mb_type of the macroblock with address mbAddrCol inside the picture colPic and, when mbTypeCol is equal to P_8x8, P_8x8ref0, or B_8x8, let subMbTypeCol be the syntax element list sub_mb_type of the macroblock with address mbAddrCol inside the picture colPic.
Let mbPartIdxCol be the macroblock partition index of the co-located partition and subMbPartIdxCol the sub-macroblock partition index of the co-located sub-macroblock partition. The derivation process for macroblock and sub-macroblock partition indices as specified in subclause REF _Ref195429922 \r \h 6.4.12.4 is invoked with the luma location ( xCol, yM ), the macroblock type mbTypeCol, and, when mbTypeCol is equal to P_8x8, P_8x8ref0, or B_8x8, the list of sub-macroblock types subMbTypeCol as the inputs and the outputs are the macroblock partition index mbPartIdxCol and the sub-macroblock partition index subMbPartIdxCol.The partition in the macroblock mbAddrCol inside the picture colPic covering the sample ( xCol, yM ) is assigned to mbPartIdxCol and the sub-macroblock partition inside the partition mbPartIdxCol covering the sample ( xCol, yM ) in the macroblock mbAddrCol inside the picture colPic is assigned to subMbPartIdxCol.
The prediction utilization flags predFlagL0Col and predFlagL1Col are set equal to PredFlagL0[ mbPartIdxCol ] and PredFlagL1[ mbPartIdxCol ], respectively, which are the prediction utilization flags that have been assigned to the macroblock partition mbAddrCol\mbPartIdxCol inside the picture colPic.
The motion vector mvCol and the reference index refIdxCol are derived as follows.
– If the macroblock mbAddrCol is coded in an Intra macroblock prediction mode or both prediction utilization flags, predFlagL0Col and predFlagL1Col are equal to 0, both components of mvCol are set equal to 0 and refIdxCol is set equal to "1.
Otherwise (the macroblock mbAddrCol is not coded in an Intra macroblock prediction mode), the prediction utilization flags predFlagL0Col and predFlagL1Col are set equal to PredFlagL0[ mbPartIdxCol ] and PredFlagL1[ mbPartIdxCol ], respectively, which are the prediction utilization flags that have been assigned to the macroblock partition mbAddrCol\mbPartIdxCol inside the picture colPic, and the following applies.
– If predFlagL0Col is equal to 1, the motion vector mvCol and the reference index refIdxCol are set equal to MvL0[ mbPartIdxCol ][ subMbPartIdxCol ] and RefIdxL0[ mbPartIdxCol ], respectively, which are the motion vector mvL0 and the reference index refIdxL0 that have been assigned to the (sub-)macroblock partition mbAddrCol\mbPartIdxCol\subMbPartIdxCol inside the picture colPic.
– Otherwise (predFlagL0Col is equal to 0 and predFlagL1Col is equal to 1), the motion vector mvCol and the reference index refIdxCol are set equal to MvL1[ mbPartIdxCol ][ subMbPartIdxCol ] and RefIdxL1[ mbPartIdxCol ], respectively, which are the motion vector mvL1 and the reference index refIdxL1 that have been assigned to the (sub-)macroblock partition mbAddrCol\mbPartIdxCol\subMbPartIdxCol inside the picture colPic.
Derivation process for spatial direct luma motion vector and reference index prediction mode
This process is invoked when direct_spatial_mv_pred_flag is equal to 1 and any of the following conditions is true:.
– mb_type is equal to B_Skip ,
– mb_type is equal to B_Direct_16x16,
– sub_mb_type[ mbPartIdx ] is equal to B_Direct_8x8.
Inputs to this process are mbPartIdx, subMbPartIdx.
Outputs of this process are the reference indices refIdxL0, refIdxL1, the motion vectors mvL0 and mvL1, the sub-partition motion vector count variable subMvCnt, and the prediction list utilization flags, predFlagL0 and predFlagL1.
The reference indices refIdxL0 and refIdxL1 and the variable directZeroPredictionFlag are derived by applying the following ordered steps.
Let the variable currSubMbType be set equal to sub_mb_type[ mbPartIdx ].
The process specified in subclause REF _Ref32903132 \r \h 8.4.1.3.2 is invoked with mbPartIdx = 0, subMbPartIdx = 0, currSubMbType, and listSuffixFlag = 0 as inputs and the output is assigned to the motion vectors mvL0N and the reference indices refIdxL0N with N being replaced by A, B, or C.
The process specified in subclause REF _Ref32903132 \r \h 8.4.1.3.2 is invoked with mbPartIdx = 0, subMbPartIdx = 0, currSubMbType, and listSuffixFlag = 1 as inputs and the output is assigned to the motion vectors mvL1N and the reference indices refIdxL1N with N being replaced by A, B, or C.
NOTE 1 – The motion vectors mvL0N, mvL1N and the reference indices refIdxL0N, refIdxL1N are identical for all 4x4 sub-macroblock partitions of a macroblock.
The reference indices refIdxL0, refIdxL1, and directZeroPredictionFlag are derived by
refIdxL0 = MinPositive( refIdxL0A, MinPositive( refIdxL0B, refIdxL0C ) ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 186)refIdxL1 = MinPositive( refIdxL1A, MinPositive( refIdxL1B, refIdxL1C ) ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 187)directZeroPredictionFlag = 0 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 188)
where
EMBED Equation.3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 189)
When both reference indices refIdxL0 and refIdxL1 are less than 0,
refIdxL0 = 0 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 190)refIdxL1 = 0 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 191)directZeroPredictionFlag = 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 192)
The process specified in subclause REF _Ref81457268 \r \h 8.4.1.2.1 is invoked with mbPartIdx, subMbPartIdx given as input and the output is assigned to refIdxCol and mvCol.
The variable colZeroFlag is derived as follows.
– If all of the following conditions are true, colZeroFlag is set equal to 1:.
– RefPicList1[ 0 ] is currently marked as "used for short-term reference",.
– refIdxCol is equal to 0,
– both motion vector components mvCol[ 0 ] and mvCol[ 1 ] lie in the range of -"1 to 1 in units specified as follows.
If the co-located macroblock is a frame macroblock, the units of mvCol[ 0 ] and mvCol[ 1 ] are units of quarter luma frame samples.
Otherwise (the co-located macroblock is a field macroblock), the units of mvCol[ 0 ] and mvCol[ 1 ] are units of quarter luma field samples.
NOTE 2 – For purposes of determining the condition above, the value mvCol[ 1 ] is not scaled to use the units of a motion vector for the current macroblock in cases when the current macroblock is a frame macroblock and the co-located macroblock is a field macroblock or when the current macroblock is a field macroblock and the co-located macroblock is a frame macroblock. This aspect differs from the use of mvCol[ 1 ] in the temporal direct mode as specified in subclause REF _Ref23667460 \r \h 8.4.1.2.3, which applies scaling to the motion vector of the co-located macroblock to use the same units as the units of a motion vector for the current macroblock, using Equation REF FrmToFld_scale_Eqn \h \* MERGEFORMAT 8-195 or Equation REF FldToFrm_scale_Eqn \h \* MERGEFORMAT 8-196 in these cases.
– Otherwise, colZeroFlag is set equal to 0.
The motion vectors mvLX (with X being 0 or 1) are derived as follows.
– If any of the following conditions is true, both components of the motion vector mvLX are set equal to 0:.
– directZeroPredictionFlag is equal to 1,
– refIdxLX is less than 0,
– refIdxLX is equal to 0 and colZeroFlag is equal to 1.
– Otherwise, the process specified in subclause REF _Ref27823186 \r \h 8.4.1.3 is invoked with mbPartIdx = 0, subMbPartIdx = 0, refIdxLX, and currSubMbType as inputs and the output is assigned to mvLX.
NOTE 3 – The motion vector mvLX returned from subclause REF _Ref27823186 \r \h 8.4.1.3 is identical for all 4x4 sub-macroblock partitions of a macroblock for which the process is invoked.
The prediction utilization flags predFlagL0 and predFlagL1 are derived as specified using REF _Ref32399809 \h Table 89.
Table STYLEREF 1 \s 8 SEQ Table \* ARABIC \s 1 9 – Assignment of prediction utilization flags
refIdxL0refIdxL1predFlagL0predFlagL1>= 0>= 011>= 0< 010< 0>= 001
The variable subMvCnt is derived as follows.
– If subMbPartIdx is not equal to 0, subMvCnt is set equal to 0.
– Otherwise (subMbPartIdx is equal to 0), subMvCnt is set equal to predFlagL0 + predFLagL1.
Derivation process for temporal direct luma motion vector and reference index prediction mode
This process is invoked when direct_spatial_mv_pred_flag is equal to 0 and any of the following conditions is true:.
– mb_type is equal to B_Skip,
– mb_type is equal to B_Direct_16x16,
– sub_mb_type[ mbPartIdx ] is equal to B_Direct_8x8.
Inputs to this process are mbPartIdx and subMbPartIdx.
Outputs of this process are the motion vectors mvL0 and mvL1, the reference indices refIdxL0 and refIdxL1, and the prediction list utilization flags, predFlagL0 and predFlagL1.
The process specified in subclause REF _Ref81457268 \r \h 8.4.1.2.1 is invoked with mbPartIdx, subMbPartIdx given as input and the output is assigned to colPic, mbAddrCol, mvCol, refIdxCol, and vertMvScale.
The reference indices refIdxL0 and refIdxL1 are derived as follows.
refIdxL0 = ( ( refIdxCol < 0 ) ? 0 : MapColToList0( refIdxCol ) ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 193)
refIdxL1 = 0 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 194)
NOTE 1 – If the current macroblock is a field macroblock, refIdxL0 and refIdxL1 index a list of fields; otherwise (the current macroblock is a frame macroblock), refIdxL0 and refIdxL1 index a list of frames or complementary reference field pairs.
Let refPicCol be a frame, a field, or a complementary field pair that was referred by the reference index refIdxCol when decoding the co-located macroblock mbAddrCol inside the picture colPic. The function MapColToList0( refIdxCol ) is specified as follows.
– If vertMvScale is equal to One_To_One, the following applies.
– If field_pic_flag is equal to 0 and the current macroblock is a field macroblock, the following applies.
– Let refIdxL0Frm be the lowest valued reference index in the current reference picture list RefPicList0 that references the frame or complementary field pair that contains the field refPicCol. RefPicList0 shall contain a frame or complementary field pair that contains the field refPicCol. The return value of MapColToList0( ) is specified as follows.
– If the field referred to by refIdxCol has the same parity as the current macroblock, MapColToList0( refIdxCol ) returns the reference index ( refIdxL0Frm << 1 ).
– Otherwise (the field referred by refIdxCol has the opposite parity of the current macroblock), MapColToList0( refIdxCol) returns the reference index ( ( refIdxL0Frm << 1 ) + 1 ).
– Otherwise (field_pic_flag is equal to 1 or the current macroblock is a frame macroblock), MapColToList0( refIdxCol ) returns the lowest valued reference index refIdxL0 in the current reference picture list RefPicList0 that references refPicCol. RefPicList0 shall contain refPicCol.
– Otherwise, if vertMvScale is equal to Frm_To_Fld, the following applies.
– If field_pic_flag is equal to 0, let refIdxL0Frm be the lowest valued reference index in the current reference picture list RefPicList0 that references refPicCol. MapColToList0( refIdxCol ) returns the reference index ( refIdxL0Frm << 1 ). RefPicList0 shall contain refPicCol.
– Otherwise (field_pic_flag is equal to 1), MapColToList0( refIdxCol ) returns the lowest valued reference index refIdxL0 in the current reference picture list RefPicList0 that references the field of refPicCol with the same parity as the current picture CurrPic. RefPicList0 shall contain the field of refPicCol with the same parity as the current picture CurrPic.
– Otherwise (vertMvScale is equal to Fld_To_Frm), MapColToList0( refIdxCol ) returns the lowest valued reference index refIdxL0 in the current reference picture list RefPicList0 that references the frame or complementary field pair that contains refPicCol. RefPicList0 shall contain a frame or complementary field pair that contains the field refPicCol.
NOTE 2 – A decoded reference picture that was marked as "used for short-term reference" when it was referenced in the decoding process of the picture containing the co-located macroblock may have been modified to be marked as "used for long-term reference" before being used for reference for inter prediction using the direct prediction mode for the current macroblock.
Depending on the value of vertMvScale the vertical component of mvCol is modified as follows.
– If vertMvScale is equal to Frm_To_Fld
mvCol[ 1 ] = mvCol[ 1 ] / 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 195)
– Otherwise, if vertMvScale is equal to Fld_To_Frm
mvCol[ 1 ] = mvCol[ 1 ] * 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 196)
– Otherwise (vertMvScale is equal to One_To_One), mvCol[ 1 ] remains unchanged.
The variables currPicOrField, pic0, and pic1, are derived as follows.
– If field_pic_flag is equal to 0 and the current macroblock is a field macroblock, the following applies:.
– currPicOrField is the field of the current picture CurrPic that has the same parity as the current macroblock.
– pic1 is the field of RefPicList1[ 0 ] that has the same parity as the current macroblock.
– The variable pic0 is derived as follows.
– If refIdxL0 % 2 is equal to 0, pic0 is the field of RefPicList0[ refIdxL0 / 2 ] that has the same parity as the current macroblock.
– Otherwise (refIdxL0 % 2 is not equal to 0), pic0 is the field of RefPicList0[ refIdxL0 / 2 ] that has the opposite parity of the current macroblock.
– Otherwise (field_pic_flag is equal to 1 or the current macroblock is a frame macroblock), currPicOrField is the current picture CurrPic, pic1 is the decoded reference picture RefPicList1[ 0 ], and pic0 is the decoded reference picture RefPicList0[ refIdxL0 ].
The two motion vectors mvL0 and mvL1 for each 4x4 sub-macroblock partition of the current macroblock are derived as follows.:
NOTE 3 – It is often the case that many of the 4x4 sub-macroblock partitions share the same motion vectors and reference pictures. In these cases, temporal direct mode motion compensation can calculate the inter prediction sample values in larger units than 4x4 luma sample blocks. For example, when direct_8x8_inference_flag is equal to 1, at least each 8x8 luma sample quadrant of the macroblock shares the same motion vectors and reference pictures.
– If the reference index refIdxL0 refers to a long-term reference picture, or DiffPicOrderCnt( pic1, pic0 ) is equal to 0, the motion vectors mvL0, mvL1 for the direct mode partition are derived by
mvL0 = mvCol ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 197)
mvL1 = 0 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 198)
– Otherwise, the motion vectors mvL0, mvL1 are derived as scaled versions of the motion vector mvCol of the co-located sub-macroblock partition as specified below (see REF _Ref32400574 \h Figure 82)
tx = ( 16 384 + Abs( td / 2 ) ) / td ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 199)
DistScaleFactor = Clip3( -1024, 1023, ( tb * tx + 32 ) >> 6 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 200)
mvL0 = ( DistScaleFactor * mvCol + 128 ) >> 8 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 201)
mvL1 = mvL0 –" mvCol ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 202)
where tb and td are derived as follows.
tb = Clip3( -128, 127, DiffPicOrderCnt( currPicOrField, pic0 ) ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 203)
td = Clip3( -128, 127, DiffPicOrderCnt( pic1, pic0 ) ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 204)
NOTE 4 – mvL0 and mvL1 cannot exceed the ranges specified in Annex REF _Ref36826677 \r \h AA.
The prediction utilization flags predFlagL0 and predFlagL1 are both set equal to 1.
REF _Ref32400574 \h Figure 82 illustrates the temporal direct-mode motion vector inference when the current picture is temporally between the reference picture from reference picture list 0 and the reference picture from reference picture list 1.
EMBED Unknown
Figure STYLEREF 1 \s 8 SEQ Figure \* ARABIC \s 1 2 – Example for temporal direct-mode motion vector inference (informative)
Derivation process for luma motion vector prediction
Inputs to this process are
– the macroblock partition index mbPartIdx,
– the sub-macroblock partition index subMbPartIdx,
– the reference index of the current partition refIdxLX (with X being 0 or 1),
– the variable currSubMbType.
Output of this process is the prediction mvpLX of the motion vector mvLX (with X being 0 or 1).
The derivation process for the neighbouring blocks for motion data in subclause REF _Ref32903132 \r \h 8.4.1.3.2 is invoked with mbPartIdx, subMbPartIdx, currSubMbType, and listSuffixFlag = X (with X being 0 or 1 for refIdxLX being refIdxL0 or refIdxL1, respectively) as the input and with mbAddrN\mbPartIdxN\subMbPartIdxN, reference indices refIdxLXN and the motion vectors mvLXN with N being replaced by A, B, or C as the output.
The derivation process for median luma motion vector prediction in subclause REF _Ref28079017 \r \h \* MERGEFORMAT 8.4.1.3.1 is invoked with mbAddrN\mbPartIdxN\subMbPartIdxN, mvLXN, refIdxLXN with N being replaced by A, B, or C and refIdxLX as the input and mvpLX as the output, unless one of the following is true.The motion vector predictor mvpLX is derived as follows.
– If MbPartWidth( mb_type ) is equal to 16, MbPartHeight( mb_type ) is equal to 8, mbPartIdx is equal to 0, and refIdxLXB is equal to refIdxLX, the motion vector predictor mvpLX is derived by
mvpLX = mvLXB ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 205)
– Otherwise, if MbPartWidth( mb_type ) is equal to 16, MbPartHeight( mb_type ) is equal to 8, mbPartIdx is equal to 1, and refIdxLXA is equal to refIdxLX, the motion vector predictor mvpLX is derived by
mvpLX = mvLXA ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 206)
– Otherwise, if MbPartWidth( mb_type ) is equal to 8, MbPartHeight( mb_type ) is equal to 16, mbPartIdx is equal to 0, and refIdxLXA is equal to refIdxLX, the motion vector predictor mvpLX is derived by
mvpLX = mvLXA ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 207)
– Otherwise, if MbPartWidth( mb_type ) is equal to 8, MbPartHeight( mb_type ) is equal to 16, mbPartIdx is equal to 1, and refIdxLXC is equal to refIdxLX, the motion vector predictor mvpLX is derived by
mvpLX = mvLXC ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 208)
– Otherwise, the derivation process for median luma motion vector prediction in subclause REF _Ref28079017 \r \h \* MERGEFORMAT 8.4.1.3.1 is invoked with mbAddrN\mbPartIdxN\subMbPartIdxN, mvLXN, refIdxLXN with N being replaced by A, B, or C, and refIdxLX as the inputs and the output is assigned to the motion vector predictor mvpLX.
REF _Ref27827459 \h Figure 83 illustrates the non-median prediction as specified in equations REF eqn_directional_mvpred_first \h 8-205 to REF eqn_directional_mvpred_last \h 8-208the four bulleted items above.
Figure STYLEREF 1 \s 8 SEQ Figure \* ARABIC \s 1 3 – Directional segmentation prediction (informative)
Derivation process for median luma motion vector prediction
Inputs to this process are
– the neighbouring partitions mbAddrN\mbPartIdxN\subMbPartIdxN (with N being replaced by A, B, or C),
– the motion vectors mvLXN (with N being replaced by A, B, or C) of the neighbouring partitions,
– the reference indices refIdxLXN (with N being replaced by A, B, or C) of the neighbouring partitions, and
– the reference index refIdxLX of the current partition.
Output of this process is the motion vector prediction mvpLX.
The variable mvpLX is derived as specified by the following ordered steps:
– When both partitions mbAddrB\mbPartIdxB\subMbPartIdxB and mbAddrC\mbPartIdxC\subMbPartIdxC are not available and mbAddrA\mbPartIdxA\subMbPartIdxA is available,
mvLXB = mvLXA ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 209)
mvLXC = mvLXA ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 210)
refIdxLXB = refIdxLXA ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 211)
refIdxLXC = refIdxLXA ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 212)
– Depending on reference indices refIdxLXA, refIdxLXB, or refIdxLXC, the following applies.
– If one and only one of the reference indices refIdxLXA, refIdxLXB, or refIdxLXC is equal to the reference index refIdxLX of the current partition, the following applies. Let refIdxLXN be the reference index that is equal to refIdxLX, the motion vector mvLXN is assigned to the motion vector prediction mvpLX:
mvpLX = mvLXN ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 213)
– Otherwise, each component of the motion vector prediction mvpLX is given by the median of the corresponding vector components of the motion vector mvLXA, mvLXB, and mvLXC:
mvpLX[ 0 ] = Median( mvLXA[ 0 ], mvLXB[ 0 ], mvLXC[ 0 ] ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 214)
mvpLX[ 1 ] = Median( mvLXA[ 1 ], mvLXB[ 1 ], mvLXC[ 1 ] ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 215)
Derivation process for motion data of neighbouring partitions
Inputs to this process are
– the macroblock partition index mbPartIdx,
– the sub-macroblock partition index subMbPartIdx,
– the current sub-macroblock type currSubMbType,
– the list suffix flag listSuffixFlag.
Outputs of this process are (with N being replaced by A, B, or C)
– mbAddrN\mbPartIdxN\subMbPartIdxN specifying neighbouring partitions,
– the motion vectors mvLXN of the neighbouring partitions, and
– the reference indices refIdxLXN of the neighbouring partitions.
Variable names that include the string "LX" are interpreted with the X being equal to listSuffixFlag.
The partitions mbAddrN\mbPartIdxN\subMbPartIdxN with N being either A, B, or C are derived in the following ordered steps:.
Let mbAddrD\mbPartIdxD\subMbPartIdxD be variables specifying an additional neighbouring partition.
The process in subclause REF _Ref32832564 \r \h 6.4.10.7 is invoked with mbPartIdx, currSubMbType, and subMbPartIdx as input and the output is assigned to mbAddrN\mbPartIdxN\subMbPartIdxN with N being replaced by A, B, C, or D.
When the partition mbAddrC\mbPartIdxC\subMbPartIdxC is not available, the following applies
mbAddrC = mbAddrD ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 216)
mbPartIdxC = mbPartIdxD ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 217)
subMbPartIdxC = subMbPartIdxD ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 218)
The motion vectors mvLXN and reference indices refIdxLXN (with N being A, B, or C) are derived as follows.
– If the macroblock partition or sub-macroblock partition mbAddrN\mbPartIdxN\subMbPartIdxN is not available or mbAddrN is coded in an Intra macroblock prediction mode or predFlagLX of mbAddrN\mbPartIdxN\subMbPartIdxN is equal to 0, both components of mvLXN are set equal to 0 and refIdxLXN is set equal to "1.
Otherwise, the following applies.ordered steps are specified:
– The motion vector mvLXN and reference index refIdxLXN are set equal to MvLX[ mbPartIdxN ][ subMbPartIdxN ] and RefIdxLX[ mbPartIdxN ], respectively, which are the motion vector mvLX and reference index refIdxLX that have been assigned to the (sub-)macroblock partition mbAddrN\mbPartIdxN\subMbPartIdxN.
– The variables mvLXN[ 1 ] and refIdxLXN are further processed as follows.
– If the current macroblock is a field macroblock and the macroblock mbAddrN is a frame macroblock
mvLXN[ 1 ] = mvLXN[ 1 ] / 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 219)
refIdxLXN = refIdxLXN * 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 220)
– Otherwise, if the current macroblock is a frame macroblock and the macroblock mbAddrN is a field macroblock
mvLXN[ 1 ] = mvLXN[ 1 ] * 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 221)
refIdxLXN = refIdxLXN / 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 222)
– Otherwise, the vertical motion vector component mvLXN[ 1 ] and the reference index refIdxLXN remain unchanged.
Derivation process for chroma motion vectors
This process is only invoked when ChromaArrayType is not equal to 0.
Inputs to this process are a luma motion vector mvLX and a reference index refIdxLX.
Output of this process is a chroma motion vector mvCLX.
A chroma motion vector is derived from the corresponding luma motion vector.
The precision of the chroma motion vector components is 1 ÷ ( 4 * SubWidthC ) horizontally and 1 ÷ ( 4 * SubHeightC ) vertically.
NOTE – For example, when using the 4:2:0 chroma format, since the units of luma motion vectors are one-quarter luma sample units and chroma has half horizontal and vertical resolution compared to luma, the units of chroma motion vectors are one-eighth chroma sample units, i.e., a value of 1 for the chroma motion vector refers to a one-eighth chroma sample displacement. For example, when the luma vector applies to 8x16 luma samples, the corresponding chroma vector in 4:2:0 chroma format applies to 4x8 chroma samples and when the luma vector applies to 4x4 luma samples, the corresponding chroma vector in 4:2:0 chroma format applies to 2x2 chroma samples.
For the derivation of the motion vector mvCLX, the following applies.
– If ChromaArrayType is not equal to 1 or the current macroblock is a frame macroblock, the horizontal and vertical components of the chroma motion vector mvCLX are derived as
mvCLX[ 0 ] = mvLX[ 0 ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 223)mvCLX[ 1 ] = mvLX[ 1 ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 224)
– Otherwise (ChromaArrayType is equal to 1 and the current macroblock is a field macroblock), only the horizontal component of the chroma motion vector mvCLX[ 0 ] is derived using Equation REF mvCLX0_Eqn \h 8-223. The vertical component of the chroma motion vector mvCLX[ 1 ] is dependent on the parity of the current field or the current macroblock and the reference picture, which is referred by the reference index refIdxLX. mvCLX[ 1 ] is derived from mvLX[ 1 ] according to REF _Ref29630149 \h Table 810.
Table STYLEREF 1 \s 8 SEQ Table \* ARABIC \s 1 10 – Derivation of the vertical component of the chroma vector in field coding mode
Parity conditionsmvCLX[ 1 ]Reference picture (refIdxLX)Current field (picture/macroblock)Top fieldBottom fieldmvLX[ 1 ] + 2Bottom fieldTop fieldmvLX[ 1 ] –" 2OtherwisemvLX[ 1 ]
Decoding process for Inter prediction samples
Inputs to this process are
a macroblock partition mbPartIdx,
a sub-macroblock partition subMbPartIdx,.
variables specifying partition width and height for luma and chroma (if available), partWidth, partHeight, partWidthC (if available) and partHeightC (if available),
– luma motion vectors mvL0 and mvL1 and when ChromaArrayType is not equal to 0 chroma motion vectors mvCL0 and mvCL1,
– reference indices refIdxL0 and refIdxL1,
– prediction list utilization flags, predFlagL0 and predFlagL1,
– variables for weighted prediction logWDC, w0C, w1C, o0C, o1C with C being replaced by L and, when ChromaArrayType is not equal to 0, Cb and Cr.
Outputs of this process are
– the Inter prediction samples predPart, which are a (partWidth)x(partHeight) array predPartL of prediction luma samples, and when ChromaArrayType is not equal to 0 two (partWidthC)x(partHeightC) arrays predPartCb, predPartCr of prediction chroma samples, one for each of the chroma components Cb and Cr.
Let predPartL0L and predPartL1L be (partWidth)x(partHeight) arrays of predicted luma sample values and when ChromaArrayType is not equal to 0 predPartL0Cb, predPartL1Cb, predPartL0Cr, and predPartL1Cr be (partWidthC)x(partHeightC) arrays of predicted chroma sample values.
For LX being replaced by either L0 or L1 in the variables predFlagLX, RefPicListX, refIdxLX, refPicLX, predPartLX, the following is specified.
When predFlagLX is equal to 1, the following applies.
– The reference picture consisting of an ordered two-dimensional array refPicLXL of luma samples and when ChromaArrayType is not equal to 0 two ordered two-dimensional arrays refPicLXCb and refPicLXCr of chroma samples is derived by invoking the process specified in subclause REF _Ref26805996 \r \h \* MERGEFORMAT 8.4.2.1 with refIdxLX and RefPicListX given as input.
– The array predPartLXL and when ChromaArrayType is not equal to 0 the arrays predPartLXCb and predPartLXCr are derived by invoking the process specified in subclause REF _Ref36872221 \r \h \* MERGEFORMAT 8.4.2.2 with the current partition specified by mbPartIdx\subMbPartIdx, the motion vectors mvLX, mvCLX (if available), and the reference arrays with refPicLXL, refPicLXCb (if available), and refPicLXCr (if available) given as input.
For C being replaced by L, Cb (if available), or Cr (if available), the array predPartC of the prediction samples of component C is derived by invoking the process specified in subclause REF _Ref26806810 \r \h 8.4.2.3 with the current partition specified by mbPartIdx and subMbPartIdx, the prediction utilization flags predFlagL0 and predFlagL1, the arrays predPartL0C and predPartL1C, and the variables for weighted prediction logWDC, w0C, w1C, o0C, o1C given as input.
Reference picture selection process
Input to this process is a reference index refIdxLX.
Output of this process is a reference picture consisting of a two-dimensional array of luma samples refPicLXL and, when ChromaArrayType is not equal to 0, two two-dimensional arrays of chroma samples refPicLXCb and refPicLXCr.
Depending on field_pic_flag, the reference picture list RefPicListX (which has been derived as specified in subclause REF _Ref32617174 \r \h 8.2.4) consists of the following.
– If field_pic_flag is equal to 1, each entry of RefPicListX is a reference field or a field of a reference frame.
– Otherwise (field_pic_flag is equal to 0), each entry of RefPicListX is a reference frame or a complementary reference field pair.
For the derivation of the reference picture, the following applies.
– If field_pic_flag is equal to 1, the reference field or field of a reference frame RefPicListX[ refIdxLX ] is the output. The output reference field or field of a reference frame consists of a (PicWidthInSamplesL)x(PicHeightInSamplesL) array of luma samples refPicLXL and, when ChromaArrayType is not equal to 0, two (PicWidthInSamplesC)x(PicHeightInSamplesC) arrays of chroma samples refPicLXCb and refPicLXCr.
– Otherwise (field_pic_flag is equal to 0), the following applies.
– If the current macroblock is a frame macroblock, the reference frame or complementary reference field pair RefPicListX[ refIdxLX ] is the output. The output reference frame or complementary reference field pair consists of a (PicWidthInSamplesL)x(PicHeightInSamplesL) array of luma samples refPicLXL and, when ChromaArrayType is not equal to 0, two (PicWidthInSamplesC)x(PicHeightInSamplesC) arrays of chroma samples refPicLXCb and refPicLXCr.
– Otherwise (the current macroblock is a field macroblock), the following applies.ordered steps are specified:
– Let refFrame be the reference frame or complementary reference field pair RefPicListX[ refIdxLX / 2 ].
– The field of refFrame is selected as follows.
– If refIdxLX % 2 is equal to 0, the field of refFrame that has the same parity as the current macroblock is the output.
– Otherwise (refIdxLX % 2 is equal to 1), the field of refFrame that has the opposite parity as the current macroblock is the output.
– The output reference field or field of a reference frame consists of a (PicWidthInSamplesL)x(PicHeightInSamplesL / 2) array of luma samples refPicLXL and, when ChromaArrayType is not equal to 0, two (PicWidthInSamplesC)x(PicHeightInSamplesC / 2) arrays of chroma samples refPicLXCb and refPicLXCr.
Depending on separate_colour_plane_flag, the following applies.
– If separate_colour_plane_flag is equal to 0, the reference picture sample arrays refPicLXL, refPicLXCb (if available), and refPicLXCr (if available) correspond to decoded sample arrays SL, SCb (if available), SCr (if available) derived in subclause REF _Ref35357247 \r \h 8.7 for a previously-decoded reference field or reference frame or complementary reference field pair or field of a reference frame.
– Otherwise (separate_colour_plane_flag is equal to 1), the following applies.
– If colour_plane_id is equal to 0, the reference picture sample array refPicLXL corresponds to the decoded sample array SL derived in subclause REF _Ref35357247 \r \h 8.7 for a previously-decoded reference field or reference frame or complementary reference field pair or field of a reference frame.
– Otherwise, if colour_plane_id is equal to 1, the reference picture sample array refPicLXL corresponds to the decoded sample array SCb derived in subclause REF _Ref35357247 \r \h 8.7 for a previously-decoded reference field or reference frame or complementary reference field pair or field of a reference frame.
– Otherwise (colour_plane_id is equal to 2), the reference picture sample array refPicLXL corresponds to the decoded sample array SCr derived in subclause REF _Ref35357247 \r \h 8.7 for a previously-decoded reference field or reference frame or complementary reference field pair or field of a reference frame.
Fractional sample interpolation process
Inputs to this process are
– the current partition given by its partition index mbPartIdx and its sub-macroblock partition index subMbPartIdx,
– the width and height partWidth, partHeight of this partition in luma-sample units,
– a luma motion vector mvLX given in quarter-luma-sample units,
– when ChromaArrayType is not equal to 0, a chroma motion vector mvCLX with a precision of one-((4*SubWidthC)-th chroma-sample units horizontally and one-(4*SubHeightC)-th chroma-sample units vertically, and
– the selected reference picture sample arrays refPicLXL, and when ChromaArrayType is not equal to 0, refPicLXCb, and refPicLXCr.
Outputs of this process are
– a (partWidth)x(partHeight) array predPartLXL of prediction luma sample values, and
– when ChromaArrayType is not equal to 0, two (partWidthC)x(partHeightC) arrays predPartLXCb, and predPartLXCr of prediction chroma sample values.
Let ( xAL, yAL ) be the location given in full-sample units of the upper-left luma sample of the current partition given by mbPartIdx\subMbPartIdx relative to the upper-left luma sample location of the given two-dimensional array of luma samples.
Let ( xIntL, yIntL ) be a luma location given in full-sample units and ( xFracL, yFracL ) be an offset given in quarter-sample units. These variables are used only inside this subclause for specifying general fractional-sample locations inside the reference sample arrays refPicLXL, refPicLXCb (if available), and refPicLXCr (if available).
For each luma sample location (0 <= xL < partWidth, 0 <= yL < partHeight) inside the prediction luma sample array predPartLXL, the corresponding prediction luma sample value predPartLXL[ xL, yL ] is derived as specified by the following ordered steps:
– The variables xIntL, yIntL, xFracL, and yFracL are derived by
xIntL = xAL + ( mvLX[ 0 ] >> 2 ) + xL ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 225)yIntL = yAL + ( mvLX[ 1 ] >> 2 ) + yL ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 226)
xFracL = mvLX[ 0 ] & 3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 227)yFracL = mvLX[ 1 ] & 3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 228)
– The prediction luma sample value predPartLXL[ xL, yL ] is derived by invoking the process specified in subclause REF _Ref26803604 \r \h 8.4.2.2.1 with ( xIntL, yIntL ), ( xFracL, yFracL ) and refPicLXL given as input.
When ChromaArrayType is not equal to 0, the following applies.
Let ( xIntC, yIntC ) be a chroma location given in full-sample units and ( xFracC, yFracC ) be an offset given in one-((4*SubWidthC)-th chroma-sample units horizontally and one-(4*SubHeightC)-th chroma-sample units vertically. These variables are used only inside this subclause for specifying general fractional-sample locations inside the reference sample arrays refPicLXCb, and refPicLXCr.
For each chroma sample location (0 <= xC < partWidthC, 0 <= yC < partHeightC) inside the prediction chroma sample arrays predPartLXCb and predPartLXCr, the corresponding prediction chroma sample values predPartLXCb[ xC, yC ] and predPartLXCr[ xC, yC ] are derived as specified by the following ordered steps:
– Depending on ChromaArrayType, the variables xIntC, yIntC, xFracC, and yFracC are derived as follows.
– If ChromaArrayType is equal to 1,
xIntC = ( xAL / SubWidthC ) + ( mvCLX[ 0 ] >> 3 ) + xC ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 229)yIntC = ( yAL / SubHeightC ) + ( mvCLX[ 1 ] >> 3 ) + yC ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 230)
xFracC = mvCLX[ 0 ] & 7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 231)yFracC = mvCLX[ 1 ] & 7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 232)
– Otherwise, if ChromaArrayType is equal to 2,
xIntC = ( xAL / SubWidthC ) + ( mvCLX[ 0 ] >> 3 ) + xC ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 233)yIntC = ( yAL / SubHeightC ) + ( mvCLX[ 1 ] >> 2 ) + yC ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 234)
xFracC = mvCLX[ 0 ] & 7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 235)yFracC = ( mvCLX[ 1 ] & 3 ) << 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 236)
– Otherwise (ChromaArrayType is equal to 3),
xIntC = xAL + ( mvLX[ 0 ] >> 2 ) + xC ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 237)yIntC = yAL + ( mvLX[ 1 ] >> 2 ) + yC ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 238)
xFracC = ( mvCX[ 0 ] & 3 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 239)yFracC = ( mvCX[ 1 ] & 3 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 240)
– Depending on ChromaArrayType, the following applies.
– If ChromaArrayType is not equal to 3, the following applies.
– The prediction sample value predPartLXCb[ xC, yC ] is derived by invoking the process specified in subclause REF _Ref26807447 \r \h 8.4.2.2.2 with ( xIntC, yIntC ), ( xFracC, yFracC ) and refPicLXCb given as input.
– The prediction sample value predPartLXCr[ xC, yC ] is derived by invoking the process specified in subclause REF _Ref26807447 \r \h 8.4.2.2.2 with ( xIntC, yIntC ), ( xFracC, yFracC ) and refPicLXCr given as input.
– Otherwise (ChromaArrayType is equal to 3), the following applies.
– The prediction sample value predPartLXCb[ xC, yC ] is derived by invoking the process specified in subclause REF _Ref166971490 \r \h 8.4.2.2.1 with ( xIntC, yIntC ), ( xFracC, yFracC ) and refPicLXCb given as input.
– The prediction sample value predPartLXCr[ xC, yC ] is derived by invoking the process specified in subclause REF _Ref166971490 \r \h 8.4.2.2.1 with ( xIntC, yIntC ), ( xFracC, yFracC ) and refPicLXCr given as input.
Luma sample interpolation process
Inputs to this process are
– a luma location in full-sample units ( xIntL, yIntL ),
– a luma location offset in fractional-sample units ( xFracL, yFracL ), and
– the luma sample array of the selected reference picture refPicLXL.
Output of this process is a predicted luma sample value predPartLXL[ xL, yL ].
EMBED Unknown
Figure STYLEREF 1 \s 8 SEQ Figure \* ARABIC \s 1 4 – Integer samples (shaded blocks with upper-case letters) and fractional sample positions (un-shaded blocks with lower-case letters) for quarter sample luma interpolation
The variable refPicHeightEffectiveL, which is the height of the effective reference picture luma array, is derived as follows.
– If MbaffFrameFlag is equal to 0 or mb_field_decoding_flag is equal to 0, refPicHeightEffectiveL is set equal to PicHeightInSamplesL.
– Otherwise (MbaffFrameFlag is equal to 1 and mb_field_decoding_flag is equal to 1), refPicHeightEffectiveL is set equal to PicHeightInSamplesL / 2.
In REF _Ref26799308 \h Figure 84, the positions labelled with upper-case letters within shaded blocks represent luma samples at full-sample locations inside the given two-dimensional array refPicLXL of luma samples. These samples may be used for generating the predicted luma sample value predPartLXL[ xL, yL ]. The locations ( xZL, yZL ) for each of the corresponding luma samples Z, where Z may be A, B, C, D, E, F, G, H, I, J, K, L, M, N, P, Q, R, S, T, or U, inside the given array refPicLXL of luma samples are derived as follows:
xZL = Clip3( 0, PicWidthInSamplesL –" 1, xIntL + xDZL ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 241)yZL = Clip3( 0, refPicHeightEffectiveL " 1, yIntL + yDZL ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 242)
REF _Ref26796742 \h Table 811 specifies ( xDZL, yDZL ) for different replacements of Z.
Table STYLEREF 1 \s 8 SEQ Table \* ARABIC \s 1 11 Differential full-sample luma locations
ZABCDEFGHIJKLMNPQRSTUxDZL0101-"2-"10123-"2-"101230101yDZL-"2-"2-"1-"10000001111112233
Given the luma samples ‘A’ to ‘U’ at full-sample locations ( xAL, yAL ) to ( xUL, yUL ), the luma samples ‘a’ to ‘s’ at fractional sample positions are derived by the following rules. The luma prediction values at half sample positions are derived by applying a 6-tap filter with tap values ( 1, -"5, 20, 20, -"5, 1 ). The luma prediction values at quarter sample positions are derived by averaging samples at full and half sample positions. The process for each fractional position is described below.
The samples at half sample positions labelled b are derived by first calculating intermediate values denoted as b1 by applying the 6-tap filter to the nearest integer position samples in the horizontal direction. The samples at half sample positions labelled h are derived by first calculating intermediate values denoted as h1 by applying the 6-tap filter to the nearest integer position samples in the vertical direction:
b1 = ( E –" 5 * F + 20 * G + 20 * H " 5 * I + J ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 243)h1 = ( A " 5 * C + 20 * G + 20 * M " 5 * R + T ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 244)
The final prediction values b and h are derived using:
b = Clip1Y( ( b1 + 16 ) >> 5 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 245)h = Clip1Y( ( h1 + 16 ) >> 5 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 246)
– The samples at half sample position labelled as j are derived by first calculating intermediate value denoted as j1 by applying the 6-tap filter to the intermediate values of the closest half sample positions in either the horizontal or vertical direction because these yield an equal result:.
j1 = cc –" 5 * dd + 20 * h1 + 20 * m1 " 5 * ee + ff, or ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 247)j1 = aa " 5 * bb + 20 * b1 + 20 * s1 " 5 * gg + hh ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 248)
where intermediate values denoted as aa, bb, gg, s1 and hh are derived by applying the 6-tap filter horizontally in the same manner as the derivation of b1 and intermediate values denoted as cc, dd, ee, m1 and ff are derived by applying the 6-tap filter vertically in the same manner as the derivation of h1. The final prediction value j are derived using:
j = Clip1Y( ( j1 + 512 ) >> 10 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 249)
– The final prediction values s and m are derived from s1 and m1 in the same manner as the derivation of b and h, as given by:
s = Clip1Y( ( s1 + 16 ) >> 5 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 250)m = Clip1Y( ( m1 + 16 ) >> 5 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 251)
– The samples at quarter sample positions labelled as a, c, d, n, f, i, k, and q are derived by averaging with upward rounding of the two nearest samples at integer and half sample positions using:
a = ( G + b + 1 ) >> 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 252)c = ( H + b + 1 ) >> 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 253)d = ( G + h + 1 ) >> 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 254)n = ( M + h + 1 ) >> 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 255)f = ( b + j + 1 ) >> 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 256)i = ( h + j + 1 ) >> 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 257)k = ( j + m + 1 ) >> 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 258)q = ( j + s + 1 ) >> 1. ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 259)
– The samples at quarter sample positions labelled as e, g, p, and r are derived by averaging with upward rounding of the two nearest samples at half sample positions in the diagonal direction using
e = ( b + h + 1 ) >> 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 260)g = ( b + m + 1 ) >> 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 261)p = ( h + s + 1 ) >> 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 262)r = ( m + s + 1 ) >> 1. ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 263)
The luma location offset in fractional-sample units ( xFracL, yFracL ) specifies which of the generated luma samples at full-sample and fractional-sample locations is assigned to the predicted luma sample value predPartLXL[ xL, yL ]. This assignment is done according to REF _Ref26798745 \h Table 812. The value of predPartLXL[ xL, yL ] is the output.
Table STYLEREF 1 \s 8 SEQ Table \* ARABIC \s 1 12 – Assignment of the luma prediction sample predPartLXL[ xL, yL ]
xFracL0000111122223333yFracL0123012301230123predPartLXL[ xL, yL ]Gdhnaeipbfjqcgkr
Chroma sample interpolation process
This process is only invoked when ChromaArrayType is equal to 1 or 2.
Inputs to this process are
– a chroma location in full-sample units ( xIntC, yIntC ),
– a chroma location offset in fractional-sample units ( xFracC, yFracC ), and
– chroma component samples from the selected reference picture refPicLXC.
Output of this process is a predicted chroma sample value predPartLXC[ xC, yC ].
In REF _Ref17563633 \h Figure 85, the positions labelled with A, B, C, and D represent chroma samples at full-sample locations inside the given two-dimensional array refPicLXC of chroma samples.
EMBED Visio.Drawing.6
Figure STYLEREF 1 \s 8 SEQ Figure \* ARABIC \s 1 5 – Fractional sample position dependent variables in chroma interpolation and surrounding integer position samples A, B, C, and D
The variable refPicHeightEffectiveC, which is the height of the effective reference picture chroma array, is derived as follows.
– If MbaffFrameFlag is equal to 0 or mb_field_decoding_flag is equal to 0, refPicHeightEffectiveC is set equal to PicHeightInSamplesC.
– Otherwise (MbaffFrameFlag is equal to 1 and mb_field_decoding_flag is equal to 1), refPicHeightEffectiveC is set equal to PicHeightInSamplesC / 2.
The sample coordinates specified in Equations REF xAc_Eqn \h 8-264 through REF yDc_Eqn \h 8-271 are used for generating the predicted chroma sample value predPartLXC[ xC, yC ].
xAC = Clip3( 0, PicWidthInSamplesC " 1, xIntC ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 264)xBC = Clip3( 0, PicWidthInSamplesC " 1, xIntC + 1 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 265)xCC = Clip3( 0, PicWidthInSamplesC " 1, xIntC ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 266)xDC = Clip3( 0, PicWidthInSamplesC " 1, xIntC + 1 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 267)
yAC = Clip3( 0, refPicHeightEffectiveC " 1, yIntC ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 268)yBC = Clip3( 0, refPicHeightEffectiveC " 1, yIntC ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 269)yCC = Clip3( 0, refPicHeightEffectiveC " 1, yIntC + 1 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 270)yDC = Clip3( 0, refPicHeightEffectiveC " 1, yIntC + 1 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 271)
Given the chroma samples A, B, C, and D at full-sample locations specified in Equations REF xAc_Eqn \h 8-264 through REF yDc_Eqn \h 8-271, the predicted chroma sample value predPartLXC[ xC, yC ] is derived as follows:
predPartLXC[ xC, yC ] = ( ( 8 " xFracC ) * ( 8 " yFracC ) * A + xFracC * ( 8 " yFracC ) * B + ( 8 " xFracC ) * yFracC * C + xFracC * yFracC * D + 32 ) >> 6 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 272)
Weighted sample prediction process
Inputs to this process are
– mbPartIdx: the current partition given by the partition index,
– subMbPartIdx: the sub-macroblock partition index,
– predFlagL0 and predFlagL1: prediction list utilization flags,
– predPartLXL: a (partWidth)x(partHeight) array of prediction luma samples (with LX being replaced by L0 or L1 depending on predFlagL0 and predFlagL1),
– when ChromaArrayType is not equal to 0, predPartLXCb and predPartLXCr: (partWidthC)x(partHeightC) arrays of prediction chroma samples, one for each of the chroma components Cb and Cr (with LX being replaced by L0 or L1 depending on predFlagL0 and predFlagL1),
– variables for weighted prediction logWDC, w0C, w1C, o0C, o1C with C being replaced by L and, when ChromaArrayType is not equal to 0, Cb and Cr.
Outputs of this process are
– predPartL: a (partWidth)x(partHeight) array of prediction luma samples and ,
– when ChromaArrayType is not equal to 0, predPartCb, and predPartCr: (partWidthC)x(partHeightC) arrays of prediction chroma samples, one for each of the chroma components Cb and Cr.
For macroblocks or partitions with predFlagL0 equal to 1 in P and SP slices, the following applies.
– If weighted_pred_flag is equal to 0, the default weighted sample prediction process as described in subclause REF _Ref36814483 \r \h \* MERGEFORMAT 8.4.2.3.1 is invoked with the same inputs and outputs as the process described in this subclause.
– Otherwise (weighted_pred_flag is equal to 1), the explicit weighted sample prediction process as described in subclause REF _Ref23667613 \r \h \* MERGEFORMAT 8.4.2.3.2 is invoked with the same inputs and outputs as the process described in this subclause.
For macroblocks or partitions with predFlagL0 or predFlagL1 equal to 1 in B slices, the following applies.
– If weighted_bipred_idc is equal to 0, the default weighted sample prediction process as described in subclause REF _Ref36814483 \r \h 8.4.2.3.1 is invoked with the same inputs and outputs as the process described in this subclause.
– Otherwise, if weighted_bipred_idc is equal to 1, the explicit weighted sample prediction process as described in subclause REF _Ref23667613 \r \h \* MERGEFORMAT 8.4.2.3.2 is invoked, for macroblocks or partitions with predFlagL0 or predFlagL1 equal to 1 with the same inputs and outputs as the process described in this subclause.
– Otherwise (weighted_bipred_idc is equal to 2), the following applies.
– If predFlagL0 is equal to 1 and predFlagL1 is equal to 1, the implicit weighted sample prediction process as described in subclause REF _Ref23667613 \r \h 8.4.2.3.2 is invoked with the same inputs and outputs as the process described in this subclause.
– Otherwise (predFlagL0 or predFlagL1 are equal to 1 but not both), the default weighted sample prediction process as described in subclause REF _Ref36814483 \r \h 8.4.2.3.1 is invoked with the same inputs and outputs as the process described in this subclause.
Default weighted sample prediction process
Input to this process are the same as specified in subclause REF _Ref36716710 \r \h 8.4.2.3.
Output of this process are the same as specified in subclause REF _Ref36716710 \r \h 8.4.2.3.
Depending on the available component for which the prediction block is derived, the following applies.
– If the luma sample prediction values predPartL[ x, y ] are derived, the following applies with C set equal to L, x set equal to 0 .. partWidth " 1, and y set equal to 0 .. partHeight " 1.
Otherwise, if the chroma Cb component sample prediction values predPartCb[ x, y ] are derived, the following applies with C set equal to Cb, x set equal to 0 .. partWidthC " 1, and y set equal to 0 .. partHeightC " 1.
Otherwise (the chroma Cr component sample prediction values predPartCr[ x, y ] are derived), the following applies with C set equal to Cr, x set equal to 0 .. partWidthC " 1, and y set equal to 0 .. partHeightC " 1.
The prediction sample values are derived as follows.
– If predFlagL0 is equal to 1 and predFlagL1 is equal to 0,
predPartC[ x, y ] = predPartL0C[ x, y ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 273)
– Otherwise, if predFlagL0 is equal to 0 and predFlagL1 is equal to 1,
predPartC[ x, y ]= predPartL1C[ x, y ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 274)
– Otherwise (predFlagL0 and predFlagL1 are equal to 1),
predPartC[ x, y ] = ( predPartL0C[ x, y ] + predPartL1C[ x, y ] + 1 ) >> 1. ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 275)
Weighted sample prediction process
Inputs to this process are the same as specified in subclause REF _Ref36716710 \r \h 8.4.2.3.
Outputs of this process are the same as specified in subclause REF _Ref36716710 \r \h 8.4.2.3.
Depending on the available component for which the prediction block is derived, the following applies.
– If the luma sample prediction values predPartL[ x, y ] are derived, the following applies with C set equal to L, x set equal to 0 .. partWidth " 1, and y set equal to 0 .. partHeight " 1, and Clip1( ) being substituted with Clip1Y( ).
Otherwise, if the chroma Cb component sample prediction values predPartCb[ x, y ] are derived, the following applies with C set equal to Cb, x set equal to 0 .. partWidthC " 1, and y set equal to 0 .. partHeightC " 1, and Clip1( ) being substituted with Clip1C( ).
Otherwise (the chroma Cr component sample prediction values predPartCr[ x, y ] are derived), the following applies with C set equal to Cr, x set equal to 0 .. partWidthC " 1, and y set equal to 0 .. partHeightC " 1, and Clip1( ) being substituted with Clip1C( ).
The prediction sample values are derived as follows.
If the predFlagL0 is equal to 1 and predFlagL1 is equal to 0, the final predicted sample values predPartC[ x, y ] are derived by
if( logWDC >= 1 ) predPartC[ x, y ] = Clip1C( ( ( predPartL0C[ x, y ] * w0C + 2logWDC -" 1 ) >> logWDC ) + o0C ) else ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 276) predPartC[ x, y ] = Clip1C( predPartL0C[ x, y ] * w0C + o0C )
– Otherwise, if the predFlagL0 is equal to 0 and predFlagL1 is equal to 1, the final predicted sample values predPartC[ x, y ] are derived by
if( logWDC >= 1 ) predPartC[ x, y ] = Clip1C( ( ( predPartL1C[ x, y ] * w1C + 2logWDC -" 1 ) >> logWDC ) + o1C ) else ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 277) predPartC[ x, y ] = Clip1C( predPartL1C[ x, y ] * w1C + o1C )
Otherwise (both predFlagL0 and predFlagL1 are equal to 1), the final predicted sample values predPartC[ x, y ] are derived by
predPartC[ x, y ] = Clip1C( ( ( predPartL0C[ x, y ] * w0C + predPartL1C[ x, y ] * w1C + 2logWDC ) >> ( logWDC + 1 ) ) + ( ( o0C + o1C + 1 ) >> 1 ) ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 278)
Derivation process for prediction weights
Inputs to this process are
– the reference indices refIdxL0 and refIdxL1,
– the prediction utilization flags predFlagL0 and predFlagL1.
Outputs of this process are
– variables for weighted prediction logWDC, w0C, w1C, o0C, o1C with C being replaced by L and, when ChromaArrayType is not equal to 0, Cb and Cr.
For C being replaced by L and, when ChromaArrayType is not equal to 0, Cb and Cr, the variables logWDC, w0C, w1C, o0C, o1C are derived as follows.
– If weighted_bipred_idc is equal to 2 and the (slice_type % 5) is equal to 1, implicit mode weighted prediction is used as follows:.
logWDC = 5 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 279)
o0C = 0 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 280)
o1C = 0 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 281)
and w0C and w1C are derived as specified in the following ordered steps:.
– The variables currPicOrField, pic0, and pic1 are derived as follows.:
– If field_pic_flag is equal to 0 and the current macroblock is a field macroblock, the following applies:.
– currPicOrField is the field of the current picture CurrPic that has the same parity as the current macroblock.
– The variable pic0 is derived as follows.
– If refIdxL0 % 2 is equal to 0, pic0 is the field of RefPicList0[ refIdxL0 / 2 ] that has the same parity as the current macroblock.
– Otherwise (refIdxL0 % 2 is not equal to 0), pic0 is the field of RefPicList0[ refIdxL0 / 2 ] that has the opposite parity of the current macroblock.
– The variable pic1 is derived as follows.
– If refIdxL1 % 2 is equal to 0, pic1 is the field of RefPicList1[ refIdxL1 / 2 ] that has the same parity as the current macroblock.
– Otherwise (refIdxL1 % 2 is not equal to 0), pic1 is the field of RefPicList1[ refIdxL1 / 2 ] that has the opposite parity of the current macroblock.
– Otherwise (field_pic_flag is equal to 1 or the current macroblock is a frame macroblock), currPicOrField is the current picture CurrPic, pic1 is RefPicList1[ refIdxL1 ], and pic0 is RefPicList0[ refIdxL0 ].
– The variables tb, td, tx, and DistScaleFactor are derived from the values of currPicOrField, pic0, pic1 using Equations REF tb_Eqn \h 8-203, REF td_Eqn \h 8-204, REF Xfactor_Eqn \h 8-199, and REF DistScaleFactor_Eqn \h 8-200, respectively.
The variables w0C and w1C are derived as follows.
If DiffPicOrderCnt( pic1, pic0 ) is equal to 0 or one or both of pic1 and pic0 is marked as "used for long-term reference" or ( DistScaleFactor >> 2 ) < -"64 or ( DistScaleFactor >> 2 ) > 128, w0C and w1C are derived as
w0C = 32 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 282)
w1C = 32 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 283)
Otherwise, w0C and w1C are derived as
w0C = 64 " (DistScaleFactor >> 2) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 284)
w1C = DistScaleFactor >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 285)
– Otherwise (weighted_pred_flag is equal to 1 in slices with (slice_type % 5) equal to 0 or 3 or weighted_bipred_idc equal to 1 in slices with (slice_type % 5) equal to 1), explicit mode weighted prediction is used as follows. specified by the following ordered steps:
– The variables refIdxL0WP and refIdxL1WP are derived as follows.
– If MbaffFrameFlag is equal to 1 and the current macroblock is a field macroblock
refIdxL0WP = refIdxL0 >> 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 286)
refIdxL1WP = refIdxL1 >> 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 287)
– Otherwise (MbaffFrameFlag is equal to 0 or the current macroblock is a frame macroblock),
refIdxL0WP = refIdxL0 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 288)
refIdxL1WP = refIdxL1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 289)
– The variables logWDC, w0C, w1C, o0C, and o1C are derived as follows.
– If C is equal to L for luma samples
logWDC = luma_log2_weight_denom ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 290)
w0C = luma_weight_l0[ refIdxL0WP ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 291)
w1C = luma_weight_l1[ refIdxL1WP ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 292)
o0C = luma_offset_l0[ refIdxL0WP ] * ( 1 << ( BitDepthY –" 8 ) ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 293)
o1C = luma_offset_l1[ refIdxL1WP ] * ( 1 << ( BitDepthY " 8 ) ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 294)
Otherwise (C is equal to Cb or Cr for chroma samples, with iCbCr = 0 for Cb, iCbCr = 1 for Cr),
logWDC = chroma_log2_weight_denom ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 295)
w0C = chroma_weight_l0[ refIdxL0WP ][ iCbCr ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 296)
w1C = chroma_weight_l1[ refIdxL1WP ][ iCbCr ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 297)
o0C = chroma_offset_l0[ refIdxL0WP ][ iCbCr ] * ( 1 << ( BitDepthC –" 8 ) ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 298)
o1C = chroma_offset_l1[ refIdxL1WP ][ iCbCr ] * ( 1 << ( BitDepthC " 8 ) ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 299)
When explicit mode weighted prediction is used and predFlagL0 and predFlagL1 are equal to 1, the following constraint shall be obeyed for C equal to L and, when ChromaArrayType is not equal to 0, Cb and Cr
-"128 <= w0C + w1C <= ( ( logWDC = = 7 ) ? 127 : 128 ) ( STYLEREF 1 \s 8 SEQ Equation \* ARABIC 300)
NOTE For implicit mode weighted prediction, weights w0C and w1C are each guaranteed to be in the range of -"64..128 and the constraint expressed in Equation REF ExplicitWPconstraint_Eqn \h \* MERGEFORMAT 8300, although not explicitly imposed, will always be met. For explicit mode weighted prediction with logWDC equal to 7, when one of the two weights w0C or w1C is inferred to be equal to 128 (as a consequence of luma_weight_l0_flag, luma_weight_l1_flag, chroma_weight_l0_flag, or chroma_weight_l1_flag equal to 0), the other weight (w1C or w0C) must have a negative value in order for the constraint expressed in Equation REF ExplicitWPconstraint_Eqn \h \* MERGEFORMAT 8300 to hold (and therefore the other flag luma_weight_l0_flag, luma_weight_l1_flag, chroma_weight_l0_flag, or chroma_weight_l1_flag must be equal to 1).
Transform coefficient decoding process and picture construction process prior to deblocking filter process
Inputs to this process are Intra16x16DCLevel (if available), Intra16x16ACLevel (if available), CbIntra16x16DCLevel (if available), CbIntra16x16ACLevel (if available), CrIntra16x16DCLevel (if available), CrIntra16x16ACLevel (if available), LumaLevel (if available), LumaLevel8x8 (if available), ChromaDCLevel (if available), ChromaACLevel (if available), CbLevel (if available), CrLevel (if available), CbLevel8x8 (if available), CrLevel8x8 (if available), and available Inter or Intra prediction sample arrays for the current macroblock for the applicable components predL, predCb, or predCr.
NOTE 1 – When decoding a macroblock in Intra_4x4 (or Intra_8x8) macroblock prediction mode, the luma component of the macroblock prediction array may not be complete, since for each 4x4 (or 8x8) luma block, the Intra_4x4 (or Intra_8x8) prediction process for luma samples as specified in subclause REF _Ref26701748 \r \h \* MERGEFORMAT 8.3.1 (or REF _Ref81134057 \r \h 8.3.2) and the process specified in this subclause are iterated. When ChromaArrayType is equal to 3, the Cb and Cr component of the macroblock prediction array may not be complete for the same reason.
Outputs of this process are the constructed sample arrays prior to the deblocking filter process for the applicable components S’'L, S’'Cb, or S’'Cr.
NOTE 2 – When decoding a macroblock in Intra_4x4 (or Intra_8x8) macroblock prediction mode, the luma component of the macroblock constructed sample arrays prior to the deblocking filter process may not be complete, since for each 4x4 (or 8x8) luma block, the Intra_4x4 (or Intra_8x8) prediction process for luma samples as specified in subclause REF _Ref26701748 \r \h \* MERGEFORMAT 8.3.1 (or REF _Ref81134057 \r \h 8.3.2) and the process specified in this subclause are iterated. When ChromaArrayType is equal to 3, the Cb and Cr component of the macroblock constructed sample arrays prior to the deblocking filter process may not be complete for the same reason.
This subclause specifies transform coefficient decoding and picture construction prior to the deblocking filter process.
When the current macroblock is coded as P_Skip or B_Skip, all values of LumaLevel, LumaLevel8x8, CbLevel, CbLevel8x8, CrLevel, CrLevel8x8, ChromaDCLevel, ChromaACLevel are set equal to 0 for the current macroblock.
Specification of transform decoding process for 4x4 luma residual blocks
This specification applies when transform_size_8x8_flag is equal to 0.
When the current macroblock prediction mode is not equal to Intra_16x16, the variable LumaLevel contains the levels for the luma transform coefficients. For a 4x4 luma block indexed by luma4x4BlkIdx = 0..15, the following ordered steps are specified:.
The inverse scanning process for 4x4 transform coefficients and scaling lists scanning process as specifieddescribed in subclause REF _Ref32724207 \r \h 8.5.6 is invoked with LumaLevel[ luma4x4BlkIdx ] as the input and the two-dimensional array c as the output.
The scaling and transformation process for residual 4x4 blocks as specified in subclause REF _Ref81306858 \r \h 8.5.12 is invoked with c as the input and r as the output.
When TransformBypassModeFlag is equal to 1qpprime_y_zero_transform_bypass_flag is equal to 1, QP'Y is equal to 0, the macroblock prediction mode is equal to Intra_4x4, and Intra4x4PredMode[ luma4x4BlkIdx ] is equal to 0 or 1, the intra residual transform-bypass decoding process as specified in subclause REF _Ref167088642 \r \h 8.5.15 is invoked with nW set equal to 4, nH set equal to 4, horPredFlag set equal to Intra4x4PredMode[ luma4x4BlkIdx ], and the 4x4 array r as the inputs, and the output is a modified version of the 4x4 array r.
The position of the upper-left sample of a 4x4 luma block with index luma4x4BlkIdx inside the macroblock is derived by invoking the inverse 4x4 luma block scanning process in subclause REF _Ref24282177 \r \h \* MERGEFORMAT 6.4.3 with luma4x4BlkIdx as the input and the output being assigned to ( xO, yO ).
The 4x4 array u with elements uij for i, j = 0..3 is derived as
uij = Clip1Y( predL[ xO + j, yO + i ] + rij ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 301)
When TransformBypassModeFlag is equal to 1qpprime_y_zero_transform_bypass_flag is equal to 1 and QP'Y is equal to 0, the bitstream shall not contain data that result in a value of uij as computed by Equation REF AddAndClip_Eqn \h 8-301 that is not equal to predL[ xO + j, yO + i ] + rij.
The picture construction process prior to deblocking filter process in subclause REF _Ref42316823 \r \h 8.5.14 is invoked with u and luma4x4BlkIdx as the inputs.
Specification of transform decoding process for luma samples of Intra_16x16 macroblock prediction mode
When the current macroblock prediction mode is equal to Intra_16x16, the variables Intra16x16DCLevel and Intra16x16ACLevel contain the levels for the luma transform coefficients. The transform coefficient decoding proceeds in the following ordered steps:
The 4x4 luma DC transform coefficients of all 4x4 luma blocks of the macroblock are decoded.
The inverse scanning process for 4x4 transform coefficients and scaling lists scanning process as specifieddescribed in subclause REF _Ref32724207 \r \h 8.5.6 is invoked with Intra16x16DCLevel as the input and the two-dimensional array c as the output.
The scaling and transformation process for luma DC transform coefficients for Intra_16x16 macroblock type as specified in subclause REF _Ref19430748 \r \h 8.5.10 is invoked with BitDepthY, QP'Y, and c as the input and dcY as the output.
The 16x16 array rMb is derived by processing the 4x4 luma blocks indexed by luma4x4BlkIdx = 0..15, and for each 4x4 luma block, the following ordered steps are specified:.
The variable lumaList, which is a list of 16 entries, is derived. The first entry of lumaList is the corresponding value from the array dcY. REF _Ref32831916 \h \* MERGEFORMAT Figure 86 shows the assignment of the indices of the array dcY to the luma4x4BlkIdx. The two numbers in the small squares refer to indices i and j in dcYij, and the numbers in large squares refer to luma4x4BlkIdx.
EMBED Visio.Drawing.6
Figure STYLEREF 1 \s 8 SEQ Figure \* ARABIC \s 1 6 – Assignment of the indices of dcY to luma4x4BlkIdx
The elements in lumaList with index k = 1..15 are specified as
lumaList[ k ] = Intra16x16ACLevel[ luma4x4BlkIdx ][ k -" 1 ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 302)
The inverse scanning process for 4x4 transform coefficients and scaling lists scanning process as specifieddescribed in subclause REF _Ref32724207 \r \h \* MERGEFORMAT 8.5.6 is invoked with lumaList as the input and the two-dimensional array c as the output.
The scaling and transformation process for residual 4x4 blocks as specified in subclause REF _Ref81306858 \r \h 8.5.12 is invoked with c as the input and r as the output.
The position of the upper-left sample of a 4x4 luma block with index luma4x4BlkIdx inside the macroblock is derived by invoking the inverse 4x4 luma block scanning process in subclause REF _Ref24282177 \r \h \* MERGEFORMAT 6.4.3 with luma4x4BlkIdx as the input and the output being assigned to ( xO, yO ).
The elements rMb[ x, y ] of the 16x16 array rMb with x = xO..xO + 3 and y = yO..yO + 3 are derived by
rMb[ xO + j, yO + i ] = rij ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 303)
When TransformBypassModeFlag is equal to 1qpprime_y_zero_transform_bypass_flag is equal to 1, QP'Y is equal to 0, and Intra16x16PredMode is equal to 0 or 1, the intra residual transform-bypass decoding process as specified in subclause REF _Ref167088642 \r \h 8.5.15 is invoked with nW set equal to 16, nH set equal to 16, horPredFlag set equal to Intra16x16PredMode, and the 16x16 array rMb as the inputs, and the output is a modified version of the 16x16 array rMb.
The 16x16 array u with elements uij for i, j = 0..15 is derived as
uij = Clip1Y( predL[ j, i ] + rMb[ j, i ] ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 304)
When TransformBypassModeFlag is equal to 1qpprime_y_zero_transform_bypass_flag is equal to 1 and QP'Y is equal to 0, the bitstream shall not contain data that result in a value of uij as computed by Equation REF AddAndClipIntra16x16_Eqn \h 8-304 that is not equal to predL[ j, i ] + rMb[ j, i ].
The picture construction process prior to deblocking filter process in subclause REF _Ref42316823 \r \h 8.5.14 is invoked with u as the input.
Specification of transform decoding process for 8x8 luma residual blocks
This specification applies when transform_size_8x8_flag is equal to 1.
The variable LumaLevel8x8[ luma8x8BlkIdx ] with luma8x8BlkIdx = 0..3 contains the levels for the luma transform coefficients for the luma 8x8 block with index luma8x8BlkIdx.
For an 8x8 luma block indexed by luma8x8BlkIdx = 0..3, the following ordered steps are specified:.
The inverse scanning process for 8x8 luma transform coefficients and scaling lists as described specified in subclause REF _Ref81309056 \r \h 8.5.7 is invoked with LumaLevel8x8[ luma8x8BlkIdx ] as the input and the two-dimensional array c as the output.
The scaling and transformation process for residual 8x8 blocks as specified in subclause REF _Ref81471592 \r \h 8.5.13 is invoked with c as the input and r as the output.
When TransformBypassModeFlag is equal to 1qpprime_y_zero_transform_bypass_flag is equal to 1, QP'Y is equal to 0, the macroblock prediction mode is equal to Intra_8x8, and Intra8x8PredMode[ luma8x8BlkIdx ] is equal to 0 or 1, the intra residual transform-bypass decoding process as specified in subclause REF _Ref167088642 \r \h 8.5.15 is invoked with nW set equal to 8, nH set equal to 8, horPredFlag set equal to Intra8x8PredMode[ luma8x8BlkIdx ], and the 8x8 array r as the inputs, and the output is a modified version of the 8x8 array r.
The position of the upper-left sample of an 8x8 luma block with index luma8x8BlkIdx inside the macroblock is derived by invoking the inverse 8x8 luma block scanning process in subclause REF _Ref81390795 \r \h 6.4.5 with luma8x8BlkIdx as the input and the output being assigned to ( xO, yO ).
The 8x8 array u with elements uij for i, j = 0..7 is derived as
uij = Clip1Y( predL[ xO + j, yO + i ] + rij ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 305)
When TransformBypassModeFlag is equal to 1qpprime_y_zero_transform_bypass_flag is equal to 1 and QP'Y is equal to 0, the bitstream shall not contain data that result in a value of uij as computed by Equation REF AddAndClip8x8_Eqn \h 8-305 that is not equal to predL[ xO + j, yO + i ] + rij.
The picture construction process prior to deblocking filter process in subclause REF _Ref42316823 \r \h 8.5.14 is invoked with u and luma8x8BlkIdx as the inputs.
Specification of transform decoding process for chroma samples
This process is invoked for each chroma component Cb and Cr separately when ChromaArrayType is not equal to 0.
Depending on ChromaArrayType, the following applies.
– If ChromaArrayType is equal to 3, the transform decoding process for chroma samples with ChromaArrayType equal to 3 as specified in subclause REF _Ref167088777 \r \h 8.5.5 is invoked.
– Otherwise (ChromaArrayType is not equal to 3), the following text specifies the transform decoding process for chroma samples.
For each chroma component, the variables ChromaDCLevel[ iCbCr ] and ChromaACLevel[ iCbCr ], with iCbCr set equal to 0 for Cb and iCbCr set equal to 1 for Cr, contain the levels for both components of the chroma transform coefficients.
Let the variable numChroma4x4Blks be set equal to (MbWidthC / 4) * (MbHeightC / 4).
For each chroma component, the transform decoding proceeds separately in the following ordered steps:
The numChroma4x4Blks chroma DC transform coefficients of the 4x4 chroma blocks of the component indexed by iCbCr of the macroblock are decoded as specified in the following ordered steps:.
Depending on the variable ChromaArrayType, the following applies.
If ChromaArrayType is equal to 1, the 2x2 array c is derived using the inverse raster scanning process applied to ChromaDCLevel as follows
EMBED Equation.3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 306)
Otherwise (ChromaArrayType is equal to 2), the 2x4 array c is derived using the inverse raster scanning process applied to ChromaDCLevel as follows
EMBED Equation.3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 307)
The scaling and transformation process for chroma DC transform coefficients as specified in subclause REF _Ref81306561 \r \h 8.5.11 is invoked with c as the input and dcC as the output.
The (MbWidthC)x(MbHeightC) array rMb is derived by processing the 4x4 chroma blocks indexed by chroma4x4BlkIdx = 0..numChroma4x4Blks " 1 of the component indexed by iCbCr, and for each 4x4 chroma block, the following ordered steps are specified:.
The variable chromaList, which is a list of 16 entries, is derived. The first entry of chromaList is the corresponding value from the array dcC. REF _Ref81306633 \h Figure 87 shows the assignment of the indices of the array dcC to the chroma4x4BlkIdx. The two numbers in the small squares refer to indices i and j in dcCij, and the numbers in large squares refer to chroma4x4BlkIdx.
EMBED Visio.Drawing.6 EMBED Visio.Drawing.6 a b
Figure STYLEREF 1 \s 8 SEQ Figure \* ARABIC \s 1 7 – Assignment of the indices of dcC to chroma4x4BlkIdx: (a) ChromaArrayType equal to 1, (b) ChromaArrayType equal to 2
The elements in chromaList with index k = 1..15 are specified as
chromaList[ k ] = ChromaACLevel[ chroma4x4BlkIdx ][ k " 1 ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 308)
The inverse scanning process for 4x4 transform coefficients and scaling lists as specified in subclause REF _Ref81218515 \r \h 8.5.6 REF _Ref81306561 \r \h 8.5.10 is invoked with chromaList as the input and the two-dimensional array c as the output.
The scaling and transformation process for residual 4x4 blocks as specified in subclause REF _Ref81306861 \r \h 8.5.12 is invoked with c as the input and r as the output.
The position of the upper-left sample of a 4x4 chroma block with index chroma4x4BlkIdx inside the macroblock is derived by
xO = InverseRasterScan( chroma4x4BlkIdx, 4, 4, 8, 0 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 309)
yO = InverseRasterScan( chroma4x4BlkIdx, 4, 4, 8, 1 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 310)
The elements rMb[ x, y ] of the (MbWidthC)x(MbHeightC) array rMb with x = xO..xO + 3 and y = yO..yO + 3 are derived by
rMb[ xO + j, yO + i ] = rij ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 311)
When TransformBypassModeFlag is equal to 1qpprime_y_zero_transform_bypass_flag is equal to 1, QP'Y is equal to 0, the macroblock prediction mode is equal to Intra_4x4, Intra_8x8, or Intra_16x16, and intra_chroma_pred_mode is equal to 1 or 2, the intra residual transform-bypass decoding process as specified in subclause REF _Ref167088642 \r \h 8.5.15 is invoked with nW set equal to MbWidthC, nH set equal to MbHeightC, horPredFlag set equal to (intra_chroma_pred_mode –" 1), and the (MbWidthC)x(MbHeightC) array rMb as the inputs, and the output is a modified version of the (MbWidthC)x(MbHeightC) array rMb.
The (MbWidthC)x(MbHeightC) array u with elements uij for i = 0..MbHeight " 1 and j = 0..MbWidth " 1 is derived as
uij = Clip1C( predC[ j, i ] + rMb[ j, i ] ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 312)
When TransformBypassModeFlag is equal to 1qpprime_y_zero_transform_bypass_flag is equal to 1 and QP'Y is equal to 0, the bitstream shall not contain data that result in a value of uij as computed by Equation REF AddAndClipChroma_Eqn \h 8-312 that is not equal to predC[ j, i ] + rMb[ j, i ].
The picture construction process prior to deblocking filter process in subclause REF _Ref42316823 \r \h 8.5.14 is invoked with u as the input.
Specification of transform decoding process for chroma samples with ChromaArrayType equal to 3
This process is invoked for each chroma component Cb and Cr separately when ChromaArrayType is equal to 3.
Depending on the macroblock prediction mode and transform_size_8x8_flag, the following applies.
– If the macroblock prediction mode is equal to Intra_16x16, the transform decoding process for Cb or Cr residual blocks shall be identical to the process described in subclause REF _Ref167015207 \r \h 8.5.2 when substituting luma with Cb or Cr, substituting Intra16x16DCLevel with CbIntra16x16DCLevel or CrIntra16x16DCLevel, substituting Intra16x16ACLevel with CbIntra16x16ACLevel or CrIntra16x16ACLevel, and substituting predL with predCb or predCr, substituting luma4x4BlkIdx with cb4x4BlkIdx or cr4x4BlkIdx, substituting lumaList with CbList or CrList, substituting BitDepthY with BitDepthC, substituting QP'Y with QP'C, and substituting Clip1Y with Clip1C. During the scaling of 4x4 block transform coefficient levels that is specified in subclause REF _Ref168803841 \r \h 8.5.12.1, which is invoked as part of the process specified in subclause REF _Ref167015207 \r \h 8.5.2, the input 4x4 array c is treated as relating to a luma residual block coded using an Intra_16x16 macroblock prediction mode.
– Otherwise, if transform_size_8x8_flag is equal to 1, the transform decoding process for 8x8 Cb or 8x8 Cr residual blocks shall be identical to the process described in subclause REF _Ref167015217 \r \h 8.5.3 when substituting luma with Cb or Cr, substituting LumaLevel8x8 with CbLevel8x8 or CrLevel8x8, substituting predL with predCb or predCr, substituting luma8x8BlkIdx with cb8x8BlkIdx or cr8x8BlkIdx, and substituting Clip1Y with Clip1C.
– Otherwise (the macroblock prediction mode is not equal to Intra_16x16 and transform_size_8x8_flag is equal to 0), the transform decoding process for 4x4 Cb or 4x4 Cr residual blocks shall be identical to the process described in subclause REF _Ref50195965 \r \h 8.5.1 when substituting luma with Cb or Cr, substituting LumaLevel with CbLevel or CrLevel, substituting predL with predCb or predCr, substituting luma4x4BlkIdx with cb4x4BlkIdx or cr4x4BlkIdx, and substituting Clip1Y with Clip1C. During the scaling of 4x4 block transform coefficient levels that is specified within subclause REF _Ref168803841 \r \h 8.5.12.1 REF _Ref170525392 \r \h 8.5.11, which is invoked as part of the process specified in subclause REF _Ref50195965 \r \h 8.5.1, the input 4x4 array c is treated as not relating to a luma residual block not coded using an Intra_16x16 macroblock prediction mode and not relating to a chroma residual block.
Inverse scanning process for 4x4 transform coefficients and scaling lists
Input to this process is a list of 16 values.
Output of this process is a variable c containing a two-dimensional array of 4x4 values. In the case of transform coefficients, these 4x4 values represent levels assigned to locations in the transform block. In the case of applying the inverse scanning process to a scaling list, the output variable c contains a two-dimensional array representing a 4x4 scaling matrix.
When this subclause is invoked with a list of transform coefficient levels as the input, The inverse scanning process for transform coefficients maps the sequence of transform coefficient levels is mapped to the transform coefficient level positions. REF _Ref32825610 \h Table 813 specifies the two mappings: inverse zig-zag scan and inverse field scan. The inverse zig-zag scan is used for transform coefficients in frame macroblocks and the inverse field scan is used for transform coefficients in field macroblocks.
When this subclause is invoked with a scaling list as the input, The inverse scanning process for scaling lists maps the sequence of scaling list entries is mapped to the positions in the corresponding scaling matrix. For this mapping, the inverse zig-zag scan is used.
REF _Ref17563700 \h Figure 88 illustrates the scans.
Figure STYLEREF 1 \s 8 SEQ Figure \* ARABIC \s 1 8 – 4x4 block scans. (a) Zig-zag scan. (b) Field scan (informative)
REF _Ref32825610 \h Table 813 provides the mapping from the index idx of input list of 16 elements to indices i and j of the two-dimensional array c.
Table STYLEREF 1 \s 8 SEQ Table \* ARABIC \s 1 13 – Specification of mapping of idx to cij for zig-zag and field scan
idx0123456789101112131415zig-zagc00c01c10c20c11c02c03c12c21c30c31c22c13c23c32c33fieldc00c10c01c20c30c11c21c31c02c12c22c32c03c13c23c33
Inverse scanning process for 8x8 transform coefficients and scaling lists
Input to this process is a list of 64 values.
Output of this process is a variable c containing a two-dimensional array of 8x8 values. In the case of transform coefficients, these 8x8 values represent levels assigned to locations in the transform block. In the case of applying the inverse scanning process to a scaling list, the output variable c contains a two-dimensional array representing an 8x8 scaling matrix.
When The inverse scanning process for transform coefficientsthis subclause is invoked with a list of transform coefficient levels as the input, the maps the sequence of transform coefficient levels is mapped to the transform coefficient level positions. REF _Ref81307781 \h Table 814 specifies the two mappings: inverse 8x8 zig-zag scan and inverse 8x8 field scan. The inverse 8x8 zig-zag scan is used for transform coefficient levels in frame macroblocks and the inverse 8x8 field scan is used for transform coefficient levels in field macroblocks.
When this subclause is The inverse scanning process invoked with afor scaling list as the inputs, maps the sequence of scaling list entries is mapped to the positions in the corresponding scaling matrix. For this mapping, the inverse zig-zag scan is used.
REF _Ref81307844 \h Figure 89 illustrates the scans.
EMBED Visio.Drawing.6 EMBED Visio.Drawing.6
a b
Figure STYLEREF 1 \s 8 SEQ Figure \* ARABIC \s 1 9 – 8x8 block scans. (a) 8x8 zig-zag scan. (b) 8x8 field scan (informative)
REF _Ref81307781 \h Table 814 provides the mapping from the index idx of the input list of 64 elements to indices i and j of the two-dimensional array c.
Table STYLEREF 1 \s 8 SEQ Table \* ARABIC \s 1 14 – Specification of mapping of idx to cij for 8x8 zig-zag and 8x8 field scan
idx0123456789101112131415zig-zagc00c01c10c20c11c02c03c12c21c30c40c31c22c13c04c05fieldc00c10c20c01c11c30c40c21c02c31c50c60c70c41c12c03 REF _Ref81307781 \h Table 814 (continued) – Specification of mapping of idx to cij for 8x8 zig-zag and 8x8 field scan
idx16171819202122232425262728293031zig-zagc14c23c32c41c50c60c51c42c33c24c15c06c07c16c25c34fieldc22c51c61c71c32c13c04c23c42c52c62c72c33c14c05c24 REF _Ref81307781 \h Table 814 (continued) – Specification of mapping of idx to cij for 8x8 zig-zag and 8x8 field scan
idx32333435363738394041424344454647zig-zagc43c52c61c70c71c62c53c44c35c26c17c27c36c45c54c63fieldc43c53c63c73c34c15c06c25c44c54c64c74c35c16c26c45 REF _Ref81307781 \h Table 814 (concluded) – Specification of mapping of idx to cij for 8x8 zig-zag and 8x8 field scan
idx48495051525354555657585960616263zig-zagc72c73c64c55c46c37c47c56c65c74c75c66c57c67c76c77fieldc55c65c75c36c07c17c46c56c66c76c27c37c47c57c67c77
Derivation process for the chroma quantisation parameters and scaling function
Outputs of this process are:
– QPC: the chroma quantisation parameter for each chroma component Cb and Cr,
– QSC: the additional chroma quantisation parameter for each chroma component Cb and Cr required for decoding SP and SI slices (if applicable).
NOTE 1 – QP quantisation parameter values QPY and QSY are always in the range of –"QpBdOffsetY to 51, inclusive. QP quantisation parameter values QPC and QSC are always in the range of "QpBdOffsetC to 3951, inclusive.
The value of QPC for a chroma component is determined from the current value of QPY and the value of chroma_qp_index_offset (for Cb) or second_chroma_qp_index_offset (for Cr).
NOTE 2 – The scaling equations are specified such that the equivalent transform coefficient level scaling factor doubles for every increment of 6 in QPY. Thus, there is an increase in the factor used for scaling of approximately 12 % for each increase of 1 in the value of QPY.
The value of QPC for each chroma component is determined as specified in REF _Ref81308924 \h Table 815 based on the index denoted as qPI.
The variable qPOffset for each chroma component is derived as follows.
– If the chroma component is the Cb component, qPOffset is specified as
qPOffset = chroma_qp_index_offset ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 313)
– Otherwise (the chroma component is the Cr component), qPOffset is specified as
qPOffset = second_chroma_qp_index_offset ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 314)
The value of qPI for each chroma component is derived as
qPI = Clip3( –"QpBdOffsetC, 51, QPY + qPOffset ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 315)
The value of QP'C for the chroma components is derived as
QP'C = QPC + QpBdOffsetC ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 316)
Table STYLEREF 1 \s 8 SEQ Table \* ARABIC \s 1 15 – Specification of QPC as a function of qPI
qPI<3030313233343536373839404142434445464748495051QPC= qPI29303132323334343535363637373738383839393939
When the current slice is an SP or SI slice, QSC is derived using the above process, substituting QPY with QSY and QPC with QSC.
Derivation process for scaling functions
Outputs of this process are
– LevelScale4x4: the scaling factor for 4x4 block transform luma or chroma coefficient levels,
– LevelScale8x8: the scaling factor for 8x8 block transform luma or chroma coefficient levels.
The 4x4 matrix weightScale( i, j ) is specified as follows.
– The variable mbIsInterFlag is derived as follows.
– If the current macroblock is coded using Inter macroblock prediction modes, mbIsInterFlag is set equal to 1.
– Otherwise (the current macroblock is coded using Intra macroblock prediction modes), mbIsInterFlag is set equal to 0.
– The variable iYCbCr derived as follows.
– If separate_colour_plane_flag is equal to 1, iYCbCr is set equal to colour_plane_id.
– Otherwise (separate_colour_plane_flag is equal to 0), the following applies.
– If the scaling function LevelScale4x4 or LevelScale8x8 is derived for input array c relates to a luma residual block, iYCbCr is set equal to 0.
– Otherwise, if the scaling function LevelScale4x4 or LevelScale8x8 is derived for input array c relates to a chroma residual block and the chroma component is equal to Cb, iYCbCr is set equal to 1.
– Otherwise (the scaling function LevelScale4x4 or LevelScale8x8 is derived for input array c relates to a chroma residual block and the chroma component is equal to Cr), iYCbCr is set equal to 2.
– The inverse scanning process for 4x4 transform coefficients and scaling lists as specified in subclause REF _Ref81309031 \r \h 8.5.6 is invoked with ScalingList4x4[ iYCbCr + ( (mbIsInterFlag = = 1 ) ? 3 : 0 )] as the input and the output is assigned to the 4x4 matrix weightScale4x4.
LevelScale4x4( m, i, j ) is specified by
LevelScale4x4( m, i, j ) = weightScale4x4( i, j ) * normAdjust4x4( m, i, j ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 317)
where
EMBED Equation.3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 318)
where the first and second subscripts of v are row and column indices, respectively, of the matrix specified as:
EMBED Equation.3 . ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 319)
The 8x8 matrix weightScale8x8( i, j ) is specified as follows.
– The variable mbIsInterFlag is derived as follows.
– If the current macroblock is coded using Inter macroblock prediction modes, mbIsInterFlag is set equal to 1.
– Otherwise (the current macroblock is coded using Intra macroblock prediction modes), mbIsInterFlag is set equal to 0.
– The variable iYCbCr derived as follows.
– If separate_colour_plane_flag is equal to 1, iYCbCr is set equal to colour_plane_id.
– Otherwise (separate_colour_plane_flag is equal to 0), the following applies.
– If the input array c relates to a luma residual block, iYCbCr is set equal to 0.
– Otherwise, if the input array c relates to a chroma residual block and the chroma component is equal to Cb, iYCbCr is set equal to 1.
– Otherwise (the input array c relates to a chroma residual block and the chroma component is equal to Cr), iYCbCr is set equal to 2.
– The inverse scanning process for 8x8 transform coefficients and scaling lists as specified in subclause REF _Ref81309056 \r \h 8.5.7 is invoked with ScalingList8x8[ mbIsInterFlag ] as the input and the output is assigned to the 8x8 matrix weightScale8x8.
LevelScale8x8( m, i, j ) is specified by
LevelScale8x8( m, i, j ) = weightScale8x8( i, j ) * normAdjust8x8( m, i, j ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 320)
where
EMBED Equation.3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 321)
where the first and second subscripts of v are row and column indices, respectively, of the matrix specified as:
EMBED Equation.3. ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 322)
Scaling and transformation process for DC transform coefficients for Intra_16x16 macroblock type
Inputs to this process are
– the variables bitDepth and qP,
– transform coefficient level values for DC transform coefficients of Intra_16x16 macroblocks as a 4x4 array c with elements cij, where i and j form a two-dimensional frequency index.
Outputs of this process are 16 scaled DC values for 4x4 blocks of Intra_16x16 macroblocks as a 4x4 array dcY with elements dcYij.
Depending on the values of TransformBypassModeFlagqpprime_y_zero_transform_bypass_flag and QP'Y, the following applies.
– If TransformBypassModeFlag is equal to 1qpprime_y_zero_transform_bypass_flag is equal to 1 and QP'Y is equal to 0, the output dcY is derived as
dcYij = cij with i, j = 0..3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 323)
– Otherwise (TransformBypassModeFlag is equal to 0qpprime_y_zero_transform_bypass_flag is equal to 0 or QP'Y is not equal to 0), the following text of this process specifies the output.
The inverse transform for the 4x4 luma DC transform coefficients is specified by:
EMBED Equation.3. ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 324)
The bitstream shall not contain data that results in any element fij of f with i, j = 0..3 that exceeds the range of integer values from "2(7 + bitDepth) to 2(7 + bitDepth) " 1, inclusive.
After the inverse transform, the scaling is performed as follows.
If qP is greater than or equal to 36, the scaled result is derived as
dcYij = ( fij * LevelScale4x4( qP % 6, 0, 0 ) ) << ( qP / 6 " 6 ), with i, j = 0...3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 325)
Otherwise (qP is less than 36), the scaled result is derived as
dcYij = ( fij * LevelScale4x4( qP % 6, 0, 0 ) + ( 1 << ( 5 " qP / 6) ) ) >> ( 6 " qP / 6 ), with i, j = 0...3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 326)
The bitstream shall not contain data that results in any element dcYij of dcY with i, j = 0..3 that exceeds the range of integer values from "2(7 + bitDepth) to 2(7 + bitDepth) " 1, inclusive.
NOTE 1 When entropy_coding_mode_flag is equal to 0 and qP is less than 10 and profile_idc is equal to 66, 77, or 88, the range of values that can be represented for the elements cij of c is not sufficient to represent the full range of values of the elements dcYij of dcY that could be necessary to form a close approximation of the content of any possible source picture by use of the Intra_16x16 macroblock type.
NOTE 2 – Since the range limit imposed on the elements dcYij of dcY is imposed after the right shift in Equation REF TcoefDCsmallQPluma_Eqn \h \* MERGEFORMAT 8-326, a larger range of values must be supported in the decoder prior to the right shift.
Scaling and transformation process for chroma DC transform coefficients
This process is only invoked when ChromaArrayType is equal to 1 or 2.
Inputs to this process are transform coefficient level values for chroma DC transform coefficients of one chroma component of the macroblock as an (MbWidthC / 4)x(MbHeightC / 4) array c with elements cij, where i and j form a two-dimensional frequency index.
Outputs of this process are the scaled DC values as an (MbWidthC / 4)x(MbHeightC / 4) array dcC with elements dcCij.
The variables bitDepth and qP are set equal to BitDepthC and QP'C, respectively.
Depending on the values of TransformBypassModeFlagqpprime_y_zero_transform_bypass_flag and QP'Y, the following applies.
– If TransformBypassModeFlag is equal to 1qpprime_y_zero_transform_bypass_flag is equal to 1 and QP'Y is equal to 0, the output dcC is derived as
dcCij = cij with i = 0..( MbWidthC / 4 ) ( 1 and j = 0..( MbHeightC / 4 ) ( 1. ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 327)
– Otherwise (TransformBypassModeFlag is equal to 0qpprime_y_zero_transform_bypass_flag is equal to 0 or QP'Y is not equal to 0), the following applies.ordered steps are specified:
– The transformation process for chroma DC transform coefficients as specified in subclause REF _Ref168802235 \r \h 8.5.11.1 is invoked with bitDepth and c as the inputs and the output is assigned to the (MbWidthC / 4)x(MbHeightC / 4) array f of chroma DC values with elements fij.
– The scaling process for chroma DC transform coefficients as specified in subclause REF _Ref168802237 \r \h 8.5.11.2 is invoked with bitDepth, qP, and f as the inputs and the output is assigned to the (MbWidthC / 4)x(MbHeightC / 4) array dcY of scaled chroma DC values with elements dcYij.
Transformation process for chroma DC transform coefficients
Inputs of this process are transform coefficient level values for chroma DC transform coefficients of one chroma component of the macroblock as an (MbWidthC / 4)x(MbHeightC / 4) array c with elements cij, where i and j form a two-dimensional frequency index.
Outputs of this process are the DC values as an (MbWidthC / 4)x(MbHeightC / 4) array f with elements fij.
Depending on the variable ChromaArrayType, the inverse transform is specified as follows.
– If ChromaArrayType is equal to 1, the inverse transform for the 2x2 chroma DC transform coefficients is specified as
EMBED Equation.3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 328)
– Otherwise, (ChromaArrayType is equal to 2), the inverse transform for the 2x4 chroma DC transform coefficients is specified as
EMBED Equation.3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 329)
Scaling process for chroma DC transform coefficients
Inputs of this process are
– the variables bitDepth and qP
– DC values as an (MbWidthC / 4)x(MbHeightC / 4) array f with elements fij
Outputs of this process are scaled DC values as an (MbWidthC / 4)x(MbHeightC / 4) array dcC with elements dcCij.
The bitstream shall not contain data that results in any element fij of f with i, j = 0..3 that exceeds the range of integer values from "2(7 + bitDepth) to 2(7 + bitDepth) " 1, inclusive.
Scaling is performed depending on the variable ChromaArrayType as follows.
– If ChromaArrayType is equal to 1, the scaled result is derived as
EMBED Equation.3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 330)
– Otherwise (ChromaArrayType is equal to 2), the following applies.ordered steps are specified:
The variable qPDC is derived as
qPDC = qP + 3 ( STYLEREF 1 \s 8 SEQ Equation \* ARABIC 331)
Depending on the value of qPDC, the following applies.
– If qPDC is greater than or equal to 36, the scaled result is derived as
EMBED Equation.3 with i = 0..3, j = 0, 1 ( STYLEREF 1 \s 8 SEQ Equation \* ARABIC 332)
– Otherwise (qPDC is less than 36), the scaled result is derived as
EMBED Equation.3 ( STYLEREF 1 \s 8 SEQ Equation \* ARABIC 333)
The bitstream shall not contain data that results in any element dcCij of dcC with i, j = 0..3 that exceeds the range of integer values from –"2(7 + bitDepth) to 2(7 + bitDepth) " 1, inclusive.
NOTE 1 When entropy_coding_mode_flag is equal to 0 and qP is less than 4 and profile_idc is equal to 66, 77, or 88, the range of values that can be represented for the elements cij of c in subclause REF _Ref168802235 \r \h 8.5.11.1 may not be sufficient to represent the full range of values of the elements dcCij of dcC that could be necessary to form a close approximation of the content of any possible source picture.
NOTE 2 – Since the range limit imposed on the elements dcCij of dcC is imposed after the right shift in Equation REF TcoefDCsmallQPchroma1_Eqn \h \* MERGEFORMAT 8-330 or REF TcoefDCsmallQPchroma2_Eqn \h \* MERGEFORMAT 8333, a larger range of values must be supported in the decoder prior to the right shift.
Scaling and transformation process for residual 4x4 blocks
Input to this process is a 4x4 array c with elements cij which is either an array relating to a residual block of the luma component or an array relating to a residual block of a chroma component.
Outputs of this process are residual sample values as 4x4 array r with elements rij.
The variable bitDepth is derived as follows.
– If the input array c relates to a luma residual block, bitDepth is set equal to BitDepthY.
– Otherwise (the input array c relates to a chroma residual block), bitDepth is set equal to BitDepthC.
The variable sMbFlag is derived as follows.
– If mb_type is equal to SI or the macroblock prediction mode is equal to Inter in an SP slice, sMbFlag is set equal to 1,
– Otherwise (mb_type not equal to SI and the macroblock prediction mode is not equal to Inter in an SP slice), sMbFlag is set equal to 0.
The variable qP is derived as follows.
– If the input array c relates to a luma residual block and sMbFlag is equal to 0
qP = QP'Y ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 334)
– Otherwise, if the input array c relates to a luma residual block and sMbFlag is equal to 1
qP = QSY ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 335)
– Otherwise, if the input array c relates to a chroma residual block and sMbFlag is equal to 0
qP = QP'C ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 336)
– Otherwise (the input array c relates to a chroma residual block and sMbFlag is equal to 1),
qP = QSC ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 337)
Depending on the values of TransformBypassModeFlagqpprime_y_zero_transform_bypass_flag and QP'Y, the following applies.
– If TransformBypassModeFlag is equal to 1qpprime_y_zero_transform_bypass_flag is equal to 1 and QP'Y is equal to 0, the output r is derived as
rij = cij with i, j = 0..3 ( STYLEREF 1 \s 8 SEQ Equation \* ARABIC 338)
– Otherwise (TransformBypassModeFlag is equal to 0qpprime_y_zero_transform_bypass_flag is equal to 0 or QP'Y is not equal to 0), the following applies. ordered steps are specified:
– The scaling process for residual 4x4 blocks as specified in subclause REF _Ref168803841 \r \h 8.5.12.1 is invoked with bitDepth, qP, and c as the inputs and the output is assigned to the 4x4 array d of scaled transform coefficients with elements dij.
– The transformation process for residual 4x4 blocks as specified in subclause REF _Ref168803843 \r \h 8.5.12.2 is invoked with bitDepth and d as the inputs and the output is assigned to the 4x4 array r of residual sample values with elements rij.
Scaling process for residual 4x4 blocks
Inputs of this process are
– the variables bitDepth and qP,
– a 4x4 array c with elements cij which is either an array relating to a residual block of luma component or an array relating to a residual block of a chroma component.
Output of this process is a 4x4 array of scaled transform coefficients d with elements dij.
The bitstream shall not contain data that results in any element cij of c with i, j = 0..3 that exceeds the range of integer values from "2(7 + bitDepth) to 2(7 + bitDepth) " 1, inclusive.
Scaling of 4x4 block transform coefficient levels cij proceeds as follows.
If all of the following conditions are true:
i is equal to 0,
j is equal to 0,
– c relates to a luma residual block coded using Intra_16x16 macroblock prediction mode or c relates to a chroma residual block.
the variable d00 is derived by
d00 = c00 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 339)
– Otherwise, the following applies.
– If qP is greater than or equal to 24, the scaled result is derived as follows
dij = ( cij * LevelScale4x4( qP % 6, i, j) ) << ( qP / 6 –" 4), with i, j = 0..3 except as noted above ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 340)
Otherwise (qP is less than 24), the scaled result is derived as follows
EMBED Equation.3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 341)
The bitstream shall not contain data that results in any element dij of d with i, j = 0..3 that exceeds the range of integer values from "2(7 + bitDepth) to 2(7 + bitDepth) " 1, inclusive.
Transformation process for residual 4x4 blocks
Inputs of this process are
– the variable bitDepth
– a 4x4 array of scaled transform coefficients d with elements dij
Outputs of this process are residual sample values as 4x4 array r with elements rij.
The bitstream shall not contain data that results in any element dij of d with i, j = 0..3 that exceeds the range of integer values from –"2(7 + bitDepth) to 2(7 + bitDepth) " 1, inclusive.
The transform process shall convert the block of scaled transform coefficients to a block of output samples in a manner mathematically equivalent to the following.
First, each (horizontal) row of scaled transform coefficients is transformed using a one-dimensional inverse transform as follows.
A set of intermediate values is computed as follows.
ei0 = di0 + di2, with i = 0..3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 342)
ei1 = di0 " di2, with i = 0..3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 343)
ei2 = ( di1 >> 1 ) " di3, with i = 0..3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 344)
ei3 = di1 + ( di3 >> 1 ), with i = 0..3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 345)
The bitstream shall not contain data that results in any element eij of e with i, j = 0..3 that exceeds the range of integer values from "2(7 + bitDepth) to 2(7 + bitDepth) " 1, inclusive.
Then, the transformed result is computed from these intermediate values as follows.
fi0 = ei0 + ei3, with i = 0..3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 346)
fi1 = ei1 + ei2, with i = 0..3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 347)
fi2 = ei1 " ei2, with i = 0..3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 348)
fi3 = ei0 " ei3, with i = 0..3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 349)
The bitstream shall not contain data that results in any element fij of f with i, j = 0..3 that exceeds the range of integer values from "2(7 + bitDepth) to 2(7 + bitDepth) " 1, inclusive.
Then, each (vertical) column of the resulting matrix is transformed using the same one-dimensional inverse transform as follows.
A set of intermediate values is computed as follows.
g0j = f0j + f2j, with j = 0..3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 350)
g1j = f0j " f2j, with j = 0..3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 351)
g2j = ( f1j >> 1 ) " f3j, with j = 0..3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 352)
g3j = f1j + ( f3j >> 1 ), with j = 0..3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 353)
The bitstream shall not contain data that results in any element gij of g with i, j = 0..3 that exceeds the range of integer values from –"2(7 + bitDepth) to 2(7 + bitDepth) " 1, inclusive.
Then, the transformed result is computed from these intermediate values as follows.
h0j = g0j + g3j, with j = 0..3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 354)
h1j = g1j + g2j, with j = 0..3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 355)
h2j = g1j " g2j, with j = 0..3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 356)
h3j = g0j " g3j, with j = 0..3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 357)
The bitstream shall not contain data that results in any element hij of h with i, j = 0..3 that exceeds the range of integer values from "2(7 + bitDepth) to 2(7 + bitDepth) " 33, inclusive.
After performing both the one-dimensional horizontal and the one-dimensional vertical inverse transforms to produce an array of transformed samples, the final constructed residual sample values is derived as
EMBED Equation.3 with i, j = 0..3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 358)
Scaling and transformation process for residual 8x8 blocks
Input to this process is an 8x8 array c with elements cij which is either an array relating to an 8x8 residual block of the luma component or, when ChromaArrayType is equal to 3, an array relating to an 8x8 residual block of a chroma component.
NOTE 1 – When separate_colour_plane_flag is equal to 1, all residual blocks are considered to be associated with the luma component for purposes of the decoding process of each coded picture (prior to the final assignment of the decoded picture to a particular luma or chroma picture array according to the value of colour_plane_id).
Outputs of this process are residual sample values as 8x8 array r with elements rij.
The variables bitDepth and qP are derived as follows.
– If the input array c relates to a luma residual block, bitDepth is set equal to BitDepthY and QP is set equal to QP'Y.
– Otherwise (the input array c relates to a chroma residual block), bitDepth is set equal to BitDepthC and QP is set equal to QP'C.
NOTE 2 – When separate_colour_plane_flag is equal to 1, all residual blocks are considered to be associated with the luma component for purposes of the decoding process of each colour component of a picture.
Depending on the values of TransformBypassModeFlagqpprime_y_zero_transform_bypass_flag and QP'Y, the following applies.
– If TransformBypassModeFlag is equal to 1qpprime_y_zero_transform_bypass_flag is equal to 1 and QP'Y is equal to 0, the output r is derived as
rij = cij with i, j = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 359)
– Otherwise (TransformBypassModeFlag is equal to 0qpprime_y_zero_transform_bypass_flag is equal to 0 or QP'Y is not equal to 0), the following applies.ordered steps are specified:
– The scaling process for residual 8x8 blocks as specified in subclause REF _Ref168805486 \r \h 8.5.13.1 is invoked with bitDepth, qP, and c as the inputs and the output is assigned to the 8x8 array d of scaled transform coefficients with elements dij.
– The transformation process for residual 8x8 blocks as specified in subclause REF _Ref168805488 \r \h 8.5.13.2 is invoked with bitDepth and d as the inputs and the output is assigned to the 8x8 array r of residual sample values with elements rij.
Scaling process for residual 8x8 blocks
Inputs of this process are
– the variables bitDepth and qP,
– an 8x8 array c with elements cij which is either an array relating to a residual block of luma component or an array relating to a residual block of a chroma component.
Output of this process is an 8x8 array of scaled transform coefficients d with elements dij.
The bitstream shall not contain data that results in any element cij of c with i, j = 0..7 that exceeds the range of integer values from –"2(7 + bitDepth) to 2(7 + bitDepth) " 1, inclusive.
The scaling process for 8x8 block transform coefficient levels cij proceeds as follows.
If qP is greater than or equal to 36, the scaled result is derived as
dij = (cij * LevelScale8x8( qP % 6, i, j) ) << ( qP / 6 " 6), with i, j = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 360)
Otherwise (qP is less than 36), the scaled result is derived as
dij = (cij * LevelScale8x8( qP % 6, i, j) ) + 25 "QP'Y/6) >> ( 6 " qP /6), with i, j = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 361)
The bitstream shall not contain data that results in any element dij of d with i, j = 0..7 that exceeds the range of integer values from "2(7 + bitDepth) to 2(7 + bitDepth) " 1, inclusive.
Transformation process for residual 8x8 blocks
Inputs of this process are
– the variable bitDepth,
– an 8x8 array of scaled transform coefficients d with elements dij.
Outputs of this process are residual sample values as 8x8 array r with elements rij.
The bitstream shall not contain data that results in any element dij of d with i, j = 0..7 that exceeds the range of integer values from –"2(7 + bitDepth) to 2(7 + bitDepth) " 1, inclusive.
The transform process shall convert the block of scaled transform coefficients to a block of output samples in a manner mathematically equivalent to the following.
First, each (horizontal) row of scaled transform coefficients is transformed using a one-dimensional inverse transform as follows.
A set of intermediate values eij is derived by
ei0 = di0 + di4, with i = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 362)
ei1 = " di3 + di5 " di7 " (di7 >> 1), with i = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 363)
ei2 = di0 " di4, with i = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 364)
ei3 = di1 + di7 " di3 " (di3 >> 1), with i = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 365)
ei4 = ( di2 >> 1 ) " di6, with i = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 366)
ei5 = " di1 + di7 + di5 + (di5 >> 1), with i = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 367)
ei6 = di2 + ( di6 >> 1 ), with i = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 368)
ei7 = di3 + di5 + di1 + (di1 >> 1), with i = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 369)
– A second set of intermediate results fij is computed from the intermediate values eij as
fi0 = ei0 + ei6, with i = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 370)
fi1 = ei1 + (ei7 >> 2), with i = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 371)
fi2 = ei2 + ei4, with i = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 372)
fi3 = ei3 + (ei5 >> 2), with i = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 373)
fi4 = ei2 " ei4, with i = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 374)
fi5 = (ei3 >> 2) " ei5, with i = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 375)
fi6 = ei0 " ei6, with i = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 376)
fi7 = ei7 " (ei1 >> 2), with i = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 377)
Then, the transformed result gij is computed from these intermediate values fij as
gi0 = fi0 + fi7, with i = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 378)
gi1 = fi2 + fi5, with i = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 379)
gi2 = fi4 + fi3, with i = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 380)
gi3 = fi6 + fi1, with i = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 381)
gi4 = fi6 –" fi1, with i = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 382)
gi5 = fi4 " fi3, with i = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 383)
gi6 = fi2 " fi5, with i = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 384)
gi7 = fi0 " fi7, with i = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 385)
Then, each (vertical) column of the resulting matrix is transformed using the same one-dimensional inverse transform as follows.
A set of intermediate values hij is computed from the horizontally transformed value gij as
h0j = g0j + g4j, with j = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 386)
h1j = " g3j + g5j " g7j " (g7j >> 1), with j = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 387)
h2j = g0j " g4j, with j = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 388)
h3j = g1j + g7j " g3j " (g3j >> 1), with j = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 389)
h4j = ( g2j >> 1 ) " g6j, with j = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 390)
h5j = " g1j + g7j + g5j + (g5j >> 1), with j = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 391)
h6j = g2j + ( g6j >> 1 ), with j = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 392)
h7j = g3j + g5j + g1j + (g1j >> 1), with j = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 393)
– A second set of intermediate results kij is computed from the intermediate values hij as
k0j = h0j + h6j, with j = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 394)
k1j = h1j + (h7j >> 2), with j = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 395)
k2j = h2j + h4j, with j = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 396)
k3j = h3j + (h5j >> 2), with j = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 397)
k4j = h2j " h4j, with j = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 398)
k5j = (h3j >> 2) " h5j, with j = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 399)
k6j = h0j " h6j, with j = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 400)
k7j = h7j " (h1j >> 2), with j = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 401)
Then, the transformed result mij is computed from these intermediate values kij as
m0j = k0j + k7j, with j = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 402)
m1j = k2j + k5j, with j = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 403)
m2j = k4j + k3j, with j = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 404)
m3j = k6j + k1j, with j = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 405)
m4j = k6j –" k1j, with j = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 406)
m5j = k4j " k3j, with j = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 407)
m6j = k2j " k5j, with j = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 408)
m7j = k0j " k7j, with j = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 409)
The bitstream shall not contain data that results in any element eij, fij, gij, hij, or kij for i and j in the range of 0..7, inclusive, that exceeds the range of integer values from "2(7 + bitDepth) to 2(7 + bitDepth) " 1, inclusive.
The bitstream shall not contain data that results in any element mij for i and j in the range of 0..7, inclusive, that exceeds the range of integer values from "2(7 + bitDepth) to 2(7 + bitDepth) " 33, inclusive.
After performing both the one-dimensional horizontal and the one-dimensional vertical inverse transforms to produce an array of transformed samples, the final constructed residual sample values are derived as
rij = ( mij + 25 ) >> 6 with i, j = 0..7 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 410)
Picture construction process prior to deblocking filter process
Inputs to this process are
– a sample array u with elements uij which is a 16x16 luma block or an (MbWidthC)x(MbHeightC) chroma block or a 4x4 luma block or a 4x4 chroma block or an 8x8 luma block or, when ChromaArrayType is equal to 3, an 8x8 chroma block,
– when u is not a 16x16 luma block or an (MbWidthC)x(MbHeightC) chroma block, a block index luma4x4BlkIdx or chroma4x4BlkIdx or luma8x8BlkIdx or cb4x4BlkIdx or cr4x4BlkIdx or cb8x8BlkIdx or cr8x8BlkIdx.
The position of the upper-left luma sample of the current macroblock is derived by invoking the inverse macroblock scanning process in subclause REF _Ref32839806 \r \h \* MERGEFORMAT 6.4.1 with CurrMbAddr as input and the output being assigned to ( xP, yP ).
When u is a luma block, for each sample uij of the luma block, the following applies.ordered steps are specified:
Depending on the size of the block u, the following applies.
– If u is a 16x16 luma block, the position ( xO, yO ) of the upper-left sample of the 16x16 luma block inside the macroblock is set equal to ( 0, 0 ) and the variable nE is set equal to 16.
– Otherwise, if u is an 4x4 luma block, the position of the upper-left sample of the 4x4 luma block with index luma4x4BlkIdx inside the macroblock is derived by invoking the inverse 4x4 luma block scanning process in subclause REF _Ref24282177 \r \h \* MERGEFORMAT 6.4.3 with luma4x4BlkIdx as the input and the output being assigned to ( xO, yO ), and the variable nE is set equal to 4.
– Otherwise (u is an 8x8 luma block), the position of the upper-left sample of the 8x8 luma block with index luma8x8BlkIdx inside the macroblock is derived by invoking the inverse 8x8 luma block scanning process in subclause REF _Ref81390795 \r \h 6.4.5 with luma8x8BlkIdx as the input and the output being assigned to ( xO, yO ), and the variable nE is set equal to 8.
Depending on the variable MbaffFrameFlag and the current macroblock, the following applies.
– If MbaffFrameFlag is equal to 1 and the current macroblock is a field macroblock
S'L[ xP + xO + j, yP + 2 * ( yO + i ) ] = uij with i, j = 0..nE ( 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 411)
– Otherwise (MbaffFrameFlag is equal to 0 or the current macroblock is a frame macroblock),
S'L[ xP + xO + j, yP + yO + i ] = uij with i, j = 0..nE ( 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 412)
When u is a chroma block, for each sample uij of the chroma block, the following applies.ordered steps are specified:
The subscript C in the variable S'C is replaced with Cb for the Cb chroma component and with Cr for the Cr chroma component.
Depending on the size of the block u, the following applies.
– If u is an (MbWidthC)x(MbHeightC) Cb or Cr block, the variable nW is set equal to MbWidthC, the variable nH is set equal to MbHeightC, and the position ( xO, yO ) of the upper-left sample of the (nW)x(nH) Cb or Cr block inside the macroblock is set equal to ( 0, 0 ).
– Otherwise, if u is a 4x4 Cb or Cr block, the variables nW and nH are set equal to 4 and, depending on the variable ChromaArrayType, the position of the upper-left sample of a 4x4 Cb or Cr block with index chroma4x4BlkIdx inside the macroblock is derived as follows.
– If ChromaArrayType is equal to 1 or 2, the following applies.
xO = InverseRasterScan( chroma4x4BlkIdx, 4, 4, 8, 0 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 413)
yO = InverseRasterScan( chroma4x4BlkIdx, 4, 4, 8, 1 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 414)
– Otherwise (ChromaArrayType is equal to 3), the position of the upper-left sample of the 4x4 Cb block with index cb4x4BlkIdx or the 4x4 Cr block with index cr4x4BlkIdx inside the macroblock is derived by invoking the inverse 4x4 Cb or Cr block scanning process in subclause REF _Ref167088463 \r \h 6.4.4 with cb4x4BlkIdx or cr4x4BlkIdx as the input and the output being assigned to ( xO, yO ).
– Otherwise (u is an 8x8 Cb or Cr block when ChromaArrayType is equal to 3), the variables nW and nH are set equal to 8 and the position of the upper-left sample of the 8x8 Cb block with index cb8x8BlkIdx or the Cr block with index cr8x8BlkIdx inside the macroblock is derived by invoking the inverse 8x8 Cb or Cr block scanning process in subclause REF _Ref167088506 \r \h 6.4.6 with cb8x8BlkIdx or cr8x8BlkIdx as the input and the output being assigned to ( xO, yO ).
Depending on the variable MbaffFrameFlag and the current macroblock, the following applies.
– If MbaffFrameFlag is equal to 1 and the current macroblock is a field macroblock
S'C[ ( xP / subWidthC ) + xO + j, ( ( yP + SubHeightC " 1 ) / SubHeightC ) + 2 * ( yO + i ) ] = uij with i = 0..nH " 1 and j = 0..nW " 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 415)
Otherwise (MbaffFrameFlag is equal to 0 or the current macroblock is a frame macroblock),
S'C[ ( xP/ subWidthC ) + xO + j, ( yP / SubHeightC ) + yO + i ] = uij with i = 0..nH " 1 and j = 0..nW " 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 416)
Intra residual transform-bypass decoding process
This process is invoked when TransformBypassModeFlag is equal to 1qpprime_y_zero_transform_bypass_flag is equal to 1, QP'Y is equal to 0, the macroblock prediction mode is equal to Intra_4x4, Intra_8x8, or Intra_16x16, and the applicable intra prediction mode is equal to the vertical or horizontal mode. The process for the Cb and Cr components is applied in the same way as for the luma (L or Y) component.
Inputs to this process are
– two variables nW and nH,
– a variable horPredFlag,
– an (nW)x(nH) array r with elements rij which is either an array relating to a residual transform-bypass block of the luma component or an array relating to a residual transform-bypass block of the Cb and Cr component.
Output of this process is a modified version of the (nW)x(nH) array r with elements rij containing the result of the intra residual transform-bypass decoding process.
Let f be a temporary (nW)x(nH) array with elements fij, which are derived by
fij = rij with i = 0..nH –" 1 and j = 0..nW " 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 417)
Depending on horPredFlag, the following applies.
If horPredFlag is equal to 0, the modified array r is derived by.
EMBED Equation.3 with i = 0..nH " 1 and j = 0..nW " 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 418)
Otherwise (horPredFlag is equal to 1), the modified array r is derived by
EMBED Equation.3 with i = 0..nH " 1 and j = 0..nW " 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 419)
Decoding process for P macroblocks in SP slices or SI macroblocks
This process is invoked when decoding P macroblock types in an SP slice type or an SI macroblock type in SI slices.
Inputs to this process are the prediction residual transform coefficient levels and the predicted samples for the current macroblock.
Outputs of this process are the decoded samples of the current macroblock prior to the deblocking filter process.
This subclause specifies the transform coefficient decoding process and picture construction process for P macroblock types in SP slices and SI macroblock type in SI slices.
NOTE – SP slices make use of Inter predictive coding to exploit temporal redundancy in the sequence, in a similar manner to P slice coding. Unlike P slice coding, however, SP slice coding allows identical reconstruction of a slice even when different reference pictures are being used. SI slices make use of spatial prediction, in a similar manner to I slices. SI slice coding allows identical reconstruction to a corresponding SP slice. The properties of SP and SI slices aid in providing functionalities for bitstream switching, splicing, random access, fast-forward, fast reverse, and error resilience/recovery.
An SP slice consists of macroblocks coded either as I macroblock types or P macroblock types.
An SI slice consists of macroblocks coded either as I macroblock types or SI macroblock type.
The transform coefficient decoding process and picture construction process prior to deblocking filter process for I macroblock types in SI slices is invoked as specified in subclause REF _Ref81058842 \r \h 8.5. SI macroblock type is decoded as described below.
When the current macroblock is coded as P_Skip, all values of LumaLevel, ChromaDCLevel, ChromaACLevel are set equal to 0 for the current macroblock.
SP decoding process for non-switching pictures
This process is invoked, when decoding P macroblock types in SP slices in which sp_for_switch_flag is equal to 0.
Inputs to this process are Inter prediction samples for the current macroblock from subclause REF _Ref24436511 \r \h 8.4 and the prediction residual transform coefficient levels.
Outputs of this process are the decoded samples of the current macroblock prior to the deblocking filter process.
This subclause applies to all macroblocks in SP slices in which sp_for_switch_flag is equal to 0, except those with macroblock prediction mode equal to Intra_4x4 or Intra_16x16. It does not apply to SI slices.
Luma transform coefficient decoding process
Inputs to this process are Inter prediction luma samples for the current macroblock predL from subclause REF _Ref24436511 \r \h \* MERGEFORMAT 8.4 and the prediction residual transform coefficient levels, LumaLevel, and the index of the 4x4 luma block luma4x4BlkIdx.
The position of the upper-left sample of the 4x4 luma block with index luma4x4BlkIdx inside the current macroblock is derived by invoking the inverse 4x4 luma block scanning process in subclause REF _Ref24282177 \r \h \* MERGEFORMAT 6.4.3 with luma4x4BlkIdx as the input and the output being assigned to ( x, y ).
Let the variable p be a 4x4 array of prediction samples with element pij being derived as follows.
pij = predL[ x + j, y + i ] with i, j = 0..3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 420)
The variable p is transformed producing transform coefficients cp according to:
EMBED Equation.3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 421)
The inverse scanning process for 4x4 transform coefficients and scaling lists scanning process as described specified in subclause REF _Ref32724207 \r \h 8.5.6 is invoked with LumaLevel[ luma4x4BlkIdx ] as the input and the two-dimensional array cr with elements cijr as the output.
The prediction residual transform coefficients cr are scaled using quantisation parameter QPY, and added to the transform coefficients of the prediction block cp with i, j = 0..3 as follows:.
cijs = cijp + ( ( ( cijr * LevelScale4x4( QPY % 6, i, j ) * Aij ) << ( QPY / 6 ) ) >> 10 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 422)
where LevelScale4x4( m, i, j ) is specified in Equation REF LevelScale_Eqn \h 8-317, and where Aij is specified as:
EMBED Equation.3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 423)
The function LevelScale2( m, i, j ), used in the formulas below, is specified as:
EMBED Equation.3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 424)
where the first and second subscripts of w are row and column indices, respectively, of the matrix specified as:
EMBED Equation.3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 425)
The resulting sum, cs, is quantised with a quantisation parameter QSY and with i, j = 0..3 as follows:.
cij = Sign( cijs ) * ( ( Abs( cijs ) * LevelScale2( QSY % 6, i, j ) + ( 1 << ( 14 + QSY / 6 ) ) ) >> ( 15 + QSY / 6 ) ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 426)
The scaling and transformation process for residual 4x4 blocks as specified in subclause REF _Ref81306858 \r \h 8.5.12 is invoked with c as the input and r as the output.
The 4x4 array u with elements uij is derived byas follows.
uij = Clip1Y( rij ) with i, j = 0..3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 427)
The picture construction process prior to deblocking filter process in subclause REF _Ref42316823 \r \h 8.5.14 is invoked with luma4x4BlkIdx and u as the inputs.
Chroma transform coefficient decoding process
Inputs to this process are Inter prediction chroma samples for the current macroblock from subclause REF _Ref24436511 \r \h \* MERGEFORMAT 8.4 and the prediction residual transform coefficient levels, ChromaDCLevel and ChromaACLevel.
This process is invoked twice: once for the Cb component and once for the Cr component. The component is referred to by replacing C with Cb for the Cb component and C with Cr for the Cr component. Let iCbCr select the current chroma component.
For each 4x4 block of the current chroma component indexed using chroma4x4BlkIdx with chroma4x4BlkIdx equal to 0..3, the following applies.ordered steps are specified:
– The position of the upper-left sample of a 4x4 chroma block with index chroma4x4BlkIdx inside the macroblock is derived as follows.
x = InverseRasterScan( chroma4x4BlkIdx, 4, 4, 8, 0 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 428)
y = InverseRasterScan( chroma4x4BlkIdx, 4, 4, 8, 1 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 429)
– Let p be a 4x4 array of prediction samples with elements pij being derived as follows.
pij = predC[ x + j, y + i ] with i, j = 0..3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 430)
– The 4x4 array p is transformed producing transform coefficients cp( chroma4x4BlkIdx ) using Equation REF CpredForwardTransform_Eqn \h \* MERGEFORMAT 8-421.
– The variable chromaList, which is a list of 16 entries, is derived. chromaList[ 0 ] is set equal to 0. chromaList[ k ] with index k = 1..15 are specified as follows:.
chromaList[ k ] = ChromaACLevel[ iCbCr ][ chroma4x4BlkIdx ][ k -" 1 ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 431)
The inverse scanning process for 4x4 transform coefficients and scaling lists scanning process as specifieddescribed in subclause REF _Ref32724207 \r \h \* MERGEFORMAT 8.5.6 is invoked with chromaList as the input and the 4x4 array cr as the output.
– The prediction residual transform coefficients cr are scaled using quantisation parameter QPC, and added to the transform coefficients of the prediction block cp with i, j = 0..3 except for the combination i = 0, j = 0 as follows:.
cijs = cijp( chroma4x4BlkIdx ) + ( ( ( cijr * LevelScale4x4( QPC % 6, i, j ) * Aij ) << ( QPC / 6 ) ) >> 10 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 432)
– The resulting sum, cs, is quantised with a quantisation parameter QSC and with i, j = 0..3 except for the combination i = 0, j = 0 as follows. The derivation of c00( chroma4x4BlkIdx ) is described below in this subclause.
cij( chroma4x4BlkIdx ) = ( Sign( cijs ) * ( Abs( cijs ) * LevelScale2( QSC % 6, i, j ) + ( 1 << ( 14 + QSC / 6 ) ) ) ) >> ( 15 + QSC / 6 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 433)
– The scaling and transformation process for residual 4x4 blocks as specified in subclause REF _Ref81306858 \r \h 8.5.12 is invoked with c( chroma4x4BlkIdx ) as the input and r as the output.
– The 4x4 array u with elements uij is derived byas follows.
uij = Clip1C( rij ) with i, j = 0..3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 434)
– The picture construction process prior to deblocking filter process in subclause REF _Ref42316823 \r \h 8.5.14 is invoked with chroma4x4BlkIdx and u as the inputs.
The derivation of the DC transform coefficient level c00( chroma4x4BlkIdx ) is specified as follows. The DC transform coefficients of the 4 prediction chroma 4x4 blocks of the current component of the macroblock are assembled into a 2x2 matrix with elements c00p(chroma4x4BlkIdx) and a 2x2 transform is applied to the DC transform coefficients as follows:
EMBED Equation.3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 435)
The chroma DC prediction residual transform coefficient levels, ChromaDCLevel[ iCbCr ][ k ] with k = 0..3 are scaled using quantisation parameter QP, and added to the prediction DC transform coefficients as follows:.
dcijs = dcijp + ( ( ( ChromaDCLevel[ iCbCr ][ j * 2 + i ] * LevelScale4x4( QPC % 6, 0, 0) * A00 ) << ( QPC / 6 ) ) >> 9 ) with i, j = 0, 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 436)
The 2x2 array dcs, is quantised using the quantisation parameter QSC as follows:.
dcijr = ( Sign( dcijs ) * ( Abs( dcijs ) * LevelScale2( QSC % 6, 0, 0) + ( 1 << ( 15 + QSC / 6 ) ) ) ) >> ( 16 + QSC / 6 ) with i, j = 0, 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 437)
The 2x2 array f with elements fij and i, j = 0..1 is derived as follows.
EMBED Equation.3. ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 438)
Scaling of the elements fij of f is performed as follows:.
c00( j * 2 + i ) = ( ( fij * LevelScale4x4( QSC % 6, 0, 0 ) ) << ( QSC / 6 ) ) >> 5 with i, j = 0, 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 439)
SP and SI slice decoding process for switching pictures
This process is invoked, when decoding P macroblock types in SP slices in which sp_for_switch_flag is equal to 1 and when decoding SI macroblock type in SI slices.
Inputs to this process are the prediction residual transform coefficient levels and the prediction sample arrays predL, predCb and predCr for the current macroblock.
Luma transform coefficient decoding process
Inputs to this process are prediction luma samples predL and the luma prediction residual transform coefficient levels, LumaLevel.
The 4x4 array p with elements pij with i, j = 0..3 is derived as in subclause REF _Ref35173154 \r \h 8.6.1.1, is transformed according to Equation REF CpredForwardTransform_Eqn \h \* MERGEFORMAT 8-421 to produce transform coefficients cp. These transform coefficients are then quantised with the quantisation parameter QSY, as follows:
cijs = Sign( cijp ) * ( ( Abs( cijp ) * LevelScale2( QSY % 6, i, j ) + ( 1 << ( 14 + QSY / 6 ) ) ) >> ( 15 + QSY / 6 ) ) with i, j = 0..3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 440)
The inverse scanning process for 4x4 transform coefficients and scaling lists scanning process as described specified in subclause REF _Ref32724207 \r \h 8.5.6 is invoked with LumaLevel[ luma4x4BlkIdx ] as the input and the two-dimensional array cr with elements cijr as the output.
The 4x4 array c with elements cij with i, j = 0..3 is derived byas follows.
cij = cijr + cijs with i, j = 0..3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 441)
The scaling and transformation process for residual 4x4 blocks as specified in subclause REF _Ref81306858 \r \h 8.5.12 is invoked with c as the input and r as the output.
The 4x4 array u with elements uij is derived byas follows.
uij = Clip1Y( rij ) with i, j = 0..3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 442)
The picture construction process prior to deblocking filter process in subclause REF _Ref42316823 \r \h 8.5.14 is invoked with luma4x4BlkIdx and u as the inputs.
Chroma transform coefficient decoding process
Inputs to this process are predicted chroma samples for the current macroblock from subclause REF _Ref24436511 \r \h \* MERGEFORMAT 8.4 and the prediction residual transform coefficient levels, ChromaDCLevel and ChromaACLevel.
This process is invoked twice: once for the Cb component and once for the Cr component. The component is referred to by replacing C with Cb for the Cb component and C with Cr for the Cr component. Let iCbCr select the current chroma component.
For each 4x4 block of the current chroma component indexed using chroma4x4BlkIdx with chroma4x4BlkIdx equal to 0..3, the following applies.ordered steps are specified:
The 4x4 array p with elements pij with i, j = 0..3 is derived as in subclause REF _Ref35509487 \r \h 8.6.1.2, is transformed according to Equation REF CpredForwardTransform_Eqn \h \* MERGEFORMAT 8-421 to produce transform coefficients cp( chroma4x4BlkIdx ). These transform coefficients are then quantised with the quantisation parameter QSC, with i, j = 0..3 except for the combination i = 0, j = 0 as follows. The processing of c00p( chroma4x4BlkIdx ) is described below in this subclause.
cijs = ( Sign( cijp( chroma4x4BlkIdx ) ) * ( Abs( cijp( chroma4x4BlkIdx ) ) * LevelScale2( QSC % 6, i, j ) + ( 1 << ( 14 + QSC / 6 ) ) ) ) >> ( 15 + QSC / 6) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 443)
– The variable chromaList, which is a list of 16 entries, is derived. chromaList[ 0 ] is set equal to 0. chromaList[ k ] with index k = 1..15 are specified as follows:.
chromaList[ k ] = ChromaACLevel[ iCbCr ][ chroma4x4BlkIdx ][ k -" 1 ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 444)
The inverse scanning process for 4x4 transform coefficients and scaling lists scanning process as described specified in subclause REF _Ref32724207 \r \h \* MERGEFORMAT 8.5.6 is invoked with chromaList as the input and the two-dimensional array cr( chroma4x4BlkIdx ) with elements cijr( chroma4x4BlkIdx ) as the output.
– The 4x4 array c( chroma4x4BlkIdx ) with elements cij( chroma4x4BlkIdx ) with i, j = 0..3 except for the combination i = 0, j = 0 is derived as follows. The derivation of c00( chroma4x4BlkIdx ) is described below.
cij( chroma4x4BlkIdx ) = cijr( chroma4x4BlkIdx ) + cijs ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 445)
– The scaling and transformation process for residual 4x4 blocks as specified in subclause REF _Ref81306858 \r \h \* MERGEFORMAT 8.5.12 is invoked with c( chroma4x4BlkIdx ) as the input and r as the output.
– The 4x4 array u with elements uij is derived byas follows.
uij = Clip1C( rij ) with i, j = 0..3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 446)
– The picture construction process prior to deblocking filter process in subclause REF _Ref42316823 \r \h 8.5.14 is invoked with chroma4x4BlkIdx and u as the inputs.
The derivation of the DC transform coefficient level c00( chroma4x4BlkIdx ) is specified as follows. The DC transform coefficients of the 4 prediction 4x4 chroma blocks of the current component of the macroblock, c00p( chroma4x4BlkIdx ), are assembled into a 2x2 matrix, and a 2x2 transform is applied to the DC transform coefficients of these blocks according to Equation REF dcp_Eqn \h 8-435 resulting in DC transform coefficients dcijp.
These DC transform coefficients are then quantised with the quantisation parameter QSC, as given by:
dcijs = ( Sign( dcijp ) * ( Abs( dcijp ) * LevelScale2( QSC % 6, 0, 0 ) + ( 1 << ( 15 + QSC / 6 ) ) ) ) >> ( 16 + QSC / 6 ) with i, j = 0, 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 447)
The parsed chroma DC prediction residual transform coefficients, ChromaDCLevel[ iCbCr ][ k ] with k = 0..3 are added to these quantised DC transform coefficients of the prediction block, as given by:
dcijr = dcijs + ChromaDCLevel[ iCbCr ][ j * 2 + i ] with i, j = 0, 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 448)
The 2x2 array f with elements fij and i, j = 0..1 is derived using Equation REF fMatDeriv_Eqn \h 8-438.
The 2x2 array f with elements fij and i, j = 0..1 is copied as follows:.
c00( j * 2 + i ) = fij with i, j = 0, 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 449)
Deblocking filter process
A conditional filtering process is specified in this subclause that is an integral part of the decoding process which shall be applied by decoders conforming to the Baseline, Extended, Main, High, High 10, High 4:2:2, and High 4:4:4 Predictive profiles. For decoders conforming to the High 10 Intra, High 4:2:2 Intra, High 4:4:4 Intra, and CAVLC 4:4:4 Intra profiles, the filtering process specified in this subclause, or one similar to it, should be applied but is not required.
The conditional filtering process is applied to all NxN (where N = 4 or N = 8 for luma, N = 4 for chroma when ChromaArrayType is equal to 1 or 2, and N = 4 or N = 8 for chroma when ChromaArrayType is equal to 3) block edges of a picture, except edges at the boundary of the picture and any edges for which the deblocking filter process is disabled by disable_deblocking_filter_idc, as specified below. This filtering process is performed on a macroblock basis after the completion of the picture construction process prior to deblocking filter process (as specified in subclauses REF _Ref81058842 \r \h 8.5 and REF _Ref32838078 \r \h 8.6) for the entire decoded picture, with all macroblocks in a picture processed in order of increasing macroblock addresses.
NOTE 1 – Prior to the operation of the deblocking filter process for each macroblock, the deblocked samples of the macroblock or macroblock pair above (if any) and the macroblock or macroblock pair to the left (if any) of the current macroblock are always available because the deblocking filter process is performed after the completion of the picture construction process prior to deblocking filter process for the entire decoded picture. However, for purposes of determining which edges are to be filtered when disable_deblocking_filter_idc is equal to 2, macroblocks in different slices are considered not available during specified steps of the operation of the deblocking filter process.
The deblocking filter process is invoked for the luma and chroma components separately. For each macroblock and each component, vertical edges are filtered first, starting with the edge on the left-hand side of the macroblock proceeding through the edges towards the right-hand side of the macroblock in their geometrical order, and then horizontal edges are filtered, starting with the edge on the top of the macroblock proceeding through the edges towards the bottom of the macroblock in their geometrical order. REF _Ref36564716 \h Figure 810 shows edges of a macroblock which can be interpreted as luma or chroma edges.
When interpreting the edges in REF _Ref36564716 \h Figure 810 as luma edges, depending on the transform_size_8x8_flag, the following applies.
– If transform_size_8x8_flag is equal to 0, both types, the solid bold and dashed bold luma edges are filtered.
– Otherwise (transform_size_8x8_flag is equal to 1), only the solid bold luma edges are filtered.
When interpreting the edges in REF _Ref36564716 \h Figure 810 as chroma edges, depending on ChromaArrayType, the following applies.
– If ChromaArrayType is equal to 1 (4:2:0 format), only the solid bold chroma edges are filtered.
– Otherwise, if ChromaArrayType is equal to 2 (4:2:2 format), the solid bold vertical chroma edges are filtered and both types, the solid bold and dashed bold horizontal chroma edges are filtered.
– Otherwise, if ChromaArrayType is equal to 3 (4:4:4 format), the following applies.
– If transform_size_8x8_flag is equal to 0, both types, the solid bold and dashed bold chroma edges are filtered.
– Otherwise (transform_size_8x8_flag is equal to 1), only the solid bold chroma edges are filtered.
– Otherwise (ChromaArrayType is equal to 0), no chroma edges are filtered.
EMBED Visio.Drawing.6
Figure STYLEREF 1 \s 8 SEQ Figure \* ARABIC \s 1 10 Boundaries in a macroblock to be filtered
For the current macroblock address CurrMbAddr proceeding over values 0..PicSizeInMbs " 1, the following applies.ordered steps are specified:
The derivation process for neighbouring macroblocks specified in subclause REF _Ref30242982 \r \h 6.4.10.1 is invoked and the output is assigned to mbAddrA and mbAddrB.
The variables fieldModeMbInFrameFlag, filterInternalEdgesFlag, filterLeftMbEdgeFlag and filterTopMbEdgeFlag are derived as specified by the followsing ordered steps:.
– The variable fieldModeMbInFrameFlag is derived as follows.
– If MbaffFrameFlag is equal to 1 and mb_field_decoding_flag is equal to 1any of the following conditions is true, fieldModeMbInFrameFlag is set equal to 1.
– field_pic_flag is equal to 1
– MbaffFrameFlag is equal to 1 and the macroblock CurrMbAddr is a field macroblock
– Otherwise (MbaffFrameFlag is equal to 0 or mb_field_decoding_flag is equal to 0), fieldModeMbInFrameFlag is set equal to 0.
– The variable filterInternalEdgesFlag is derived as follows.
– If disable_deblocking_filter_idc for the slice that contains the macroblock CurrMbAddr is equal to 1, the variable filterInternalEdgesFlag is set equal to 0.;
– Otherwise (disable_deblocking_filter_idc for the slice that contains the macroblock CurrMbAddr is not equal to 1), the variable filterInternalEdgesFlag is set equal to 1.
– The variable filterLeftMbEdgeFlag is derived as follows.
– If any of the following conditions is true, the variable filterLeftMbEdgeFlag is set equal to 0:.
– MbaffFrameFlag is equal to 0 and CurrMbAddr % PicWidthInMbs is equal to 0,.
– MbaffFrameFlag is equal to 1 and ( CurrMbAddr >> 1 ) % PicWidthInMbs is equal to 0,
– disable_deblocking_filter_idc for the slice that contains the macroblock CurrMbAddr is equal to 1,
– disable_deblocking_filter_idc for the slice that contains the macroblock CurrMbAddr is equal to 2 and the macroblock mbAddrA is not available.
– Otherwise, the variable filterLeftMbEdgeFlag is set equal to 1.
– The variable filterTopMbEdgeFlag is derived as follows.
– If any of the following conditions is true, the variable filterTopMbEdgeFlag is set equal to 0:.
– MbaffFrameFlag is equal to 0 and CurrMbAddr is less than PicWidthInMbs,.
– MbaffFrameFlag is equal to 1, ( CurrMbAddr >> 1 ) is less than PicWidthInMbs, and the macroblock CurrMbAddr is a field macroblock,.
– MbaffFrameFlag is equal to 1, ( CurrMbAddr >> 1 ) is less than PicWidthInMbs, the macroblock CurrMbAddr is a frame macroblock, and CurrMbAddr % 2 is equal to 0,.
– disable_deblocking_filter_idc for the slice that contains the macroblock CurrMbAddr is equal to 1,
– disable_deblocking_filter_idc for the slice that contains the macroblock CurrMbAddr is equal to 2 and the macroblock mbAddrB is not available.
– Otherwise, the variable filterTopMbEdgeFlag is set equal to 1.
Given the variables fieldModeMbInFrameFlag, filterInternalEdgesFlag, filterLeftMbEdgeFlag and filterTopMbEdgeFlag the deblocking filtering is controlled as follows.
– When filterLeftMbEdgeFlag is equal to 1, the filtering of the left vertical luma edge is filtered by invoking specified as follows.
– Tthe process specified in subclause REF _Ref36442362 \r \h 8.7.1 is invoked with chromaEdgeFlag = 0, verticalEdgeFlag = 1, fieldModeInFrameFilteringFlag = fieldModeMbInFrameFlag, and (xEk, yEk) = (0, k) with k = 0..15 as the inputs and S'L as the output.
– When filterInternalEdgesFlag is equal to 1, the filtering of the internal vertical luma edges is specified by theas following ordered steps:.
– When transform_size_8x8_flag is equal to 0, the process specified in subclause REF _Ref36442362 \r \h 8.7.1 is invoked with chromaEdgeFlag = 0, verticalEdgeFlag = 1, fieldModeInFrameFilteringFlag = fieldModeMbInFrameFlag, and (xEk, yEk) = (4, k) with k = 0..15 as the inputs and S'L as the output.
– The process specified in subclause REF _Ref36442362 \r \h 8.7.1 is invoked with chromaEdgeFlag = 0, verticalEdgeFlag = 1, fieldModeInFrameFilteringFlag = fieldModeMbInFrameFlag, and (xEk, yEk) = (8, k) with k = 0..15 as the inputs and S'L as the output.
– When transform_size_8x8_flag is equal to 0, the process specified in subclause REF _Ref36442362 \r \h 8.7.1 is invoked with chromaEdgeFlag = 0, verticalEdgeFlag = 1, fieldModeInFrameFilteringFlag = fieldModeMbInFrameFlag, and (xEk, yEk) = (12, k) with k = 0..15 as the inputs and S'L as the output.
– When filterTopMbEdgeFlag is equal to 1, the filtering of the top horizontal luma edge is specified as follows.
– If MbaffFrameFlag is equal to 1, (CurrMbAddr % 2) is equal to 0, CurrMbAddr is greater than or equal to 2 * PicWidthInMbs, the macroblock CurrMbAddr is a frame macroblock, and the macroblock (CurrMbAddr " 2 * PicWidthInMbs + 1) is a field macroblock, the following applies.ordered steps are specified:
The process specified in subclause REF _Ref36442362 \r \h 8.7.1 is invoked with chromaEdgeFlag = 0, verticalEdgeFlag = 0, fieldModeInFrameFilteringFlag = 1, and (xEk, yEk) = (k, 0) with k = 0..15 as the inputs and S'L as the output.
– The process specified in subclause REF _Ref36442362 \r \h 8.7.1 is invoked with chromaEdgeFlag = 0, verticalEdgeFlag = 0, fieldModeInFrameFilteringFlag = 1, and (xEk, yEk) = (k, 1) with k = 0..15 as the inputs and S'L as the output.
– Otherwise, the process specified in subclause REF _Ref36442362 \r \h 8.7.1 is invoked with chromaEdgeFlag = 0, verticalEdgeFlag = 0, fieldModeInFrameFilteringFlag = fieldModeMbInFrameFlag, and (xEk, yEk) = (k, 0) with k = 0..15 as the inputs and S'L as the output.
– When filterInternalEdgesFlag is equal to 1, the filtering of the internal horizontal luma edges is specified byas the following ordered steps:.
– When transform_size_8x8_flag is equal to 0, the process specified in subclause REF _Ref36442362 \r \h 8.7.1 is invoked with chromaEdgeFlag = 0, verticalEdgeFlag = 0, fieldModeInFrameFilteringFlag = fieldModeMbInFrameFlag, and (xEk, yEk) = (k, 4) with k = 0..15 as the inputs and S'L as the output.
– The process specified in subclause REF _Ref36442362 \r \h 8.7.1 is invoked with chromaEdgeFlag = 0, verticalEdgeFlag = 0, fieldModeInFrameFilteringFlag = fieldModeMbInFrameFlag, and (xEk, yEk) = (k, 8) with k = 0..15 as the inputs and S'L as the output.
– When transform_size_8x8_flag is equal to 0, the process specified in subclause REF _Ref36442362 \r \h 8.7.1 is invoked with chromaEdgeFlag = 0, verticalEdgeFlag = 0, fieldModeInFrameFilteringFlag = fieldModeMbInFrameFlag, and (xEk, yEk) = (k, 12) with k = 0..15 as the inputs and S'L as the output.
– When ChromaArrayType is not equal to 0, for the filtering of both chroma components, with iCbCr = 0 for Cb and iCbCr = 1 for Cr, the following applies.ordered steps are specified:
– When filterLeftMbEdgeFlag is equal to 1, the filtering of the left vertical chroma edge is filtered by invoking specified as follows.
– Tthe process specified in subclause REF _Ref36442362 \r \h 8.7.1 is invoked with chromaEdgeFlag = 1, iCbCr, verticalEdgeFlag = 1, fieldModeInFrameFilteringFlag = fieldModeMbInFrameFlag, and (xEk, yEk) = (0, k) with k = 0..MbHeightC " 1 as the inputs and S'C with C being replaced by Cb for iCbCr = 0 and C being replaced by Cr for iCbCr = 1 as the output.
When filterInternalEdgesFlag is equal to 1, the filtering of the internal vertical chroma edge is specified by theas following ordered steps:.
– When ChromaArrayType is not equal to 3 or transform_size_8x8_flag is equal to 0, the process specified in subclause REF _Ref36442362 \r \h 8.7.1 is invoked with chromaEdgeFlag = 1, iCbCr, verticalEdgeFlag = 1, fieldModeInFrameFilteringFlag = fieldModeMbInFrameFlag, and (xEk, yEk) = (4, k) with k = 0..MbHeightC " 1 as the inputs and S'C with C being replaced by Cb for iCbCr = 0 and C being replaced by Cr for iCbCr = 1 as the output.
When ChromaArrayType is equal to 3, the process specified in subclause REF _Ref36442362 \r \h 8.7.1 is invoked with chromaEdgeFlag = 1, iCbCr, verticalEdgeFlag = 1, fieldModeInFrameFilteringFlag = fieldModeMbInFrameFlag, and (xEk, yEk) = (8, k) with k = 0..MbHeightC " 1 as the inputs and S'C with C being replaced by Cb for iCbCr = 0 and C being replaced by Cr for iCbCr = 1 as the output.
– When ChromaArrayType is equal to 3 andor transform_size_8x8_flag is equal to 0, the process specified in subclause REF _Ref36442362 \r \h 8.7.1 is invoked with chromaEdgeFlag = 1, iCbCr, verticalEdgeFlag = 1, fieldModeInFrameFilteringFlag = fieldModeMbInFrameFlag, and (xEk, yEk) = (12, k) with k = 0..MbHeightC " 1 as the inputs and S'C with C being replaced by Cb for iCbCr = 0 and C being replaced by Cr for iCbCr = 1 as the output.
When filterTopMbEdgeFlag is equal to 1, the filtering of the top horizontal chroma edge is specified as follows.
If MbaffFrameFlag is equal to 1, (CurrMbAddr % 2) is equal to 0, CurrMbAddr is greater than or equal to 2 * PicWidthInMbs, the macroblock CurrMbAddr is a frame macroblock, and the macroblock (CurrMbAddr " 2 * PicWidthInMbs + 1) is a field macroblock, the following ordered steps are specified:applies.
The process specified in subclause REF _Ref36442362 \r \h 8.7.1 is invoked with chromaEdgeFlag = 1, iCbCr, verticalEdgeFlag = 0, fieldModeInFrameFilteringFlag = 1, and (xEk, yEk) = (k, 0) with k = 0..MbWidthC " 1 as the inputs and S'C with C being replaced by Cb for iCbCr = 0 and C being replaced by Cr for iCbCr = 1 as the output.
– The process specified in subclause REF _Ref36442362 \r \h 8.7.1 is invoked with chromaEdgeFlag = 1, iCbCr, verticalEdgeFlag = 0, fieldModeInFrameFilteringFlag = 1, and (xEk, yEk) = (k, 1) with k = 0..MbWidthC " 1 as the inputs and S'C with C being replaced by Cb for iCbCr = 0 and C being replaced by Cr for iCbCr = 1 as the output.
Otherwise, the process specified in subclause REF _Ref36442362 \r \h 8.7.1 is invoked with chromaEdgeFlag = 1, iCbCr, verticalEdgeFlag = 0, fieldModeInFrameFilteringFlag = fieldModeMbInFrameFlag, and (xEk, yEk) = (k, 0) with k = 0..MbWidthC " 1 as the inputs and S'C with C being replaced by Cb for iCbCr = 0 and C being replaced by Cr for iCbCr = 1 as the output.
When filterInternalEdgesFlag is equal to 1, the filtering of the internal horizontal chroma edge is specified by theas following ordered steps:.
– When ChromaArrayType is not equal to 3 or transform_size_8x8_flag is equal to 0, the process specified in subclause REF _Ref36442362 \r \h 8.7.1 is invoked with chromaEdgeFlag = 1, iCbCr, verticalEdgeFlag = 0, fieldModeInFrameFilteringFlag = fieldModeMbInFrameFlag, and (xEk, yEk) = (k, 4) with k = 0..MbWidthC " 1 as the inputs and S'C with C being replaced by Cb for iCbCr = 0 and C being replaced by Cr for iCbCr = 1 as the output.
When ChromaArrayType is not equal to 1, the process specified in subclause REF _Ref36442362 \r \h 8.7.1 is invoked with chromaEdgeFlag = 1, iCbCr, verticalEdgeFlag = 0, fieldModeInFrameFilteringFlag = fieldModeMbInFrameFlag, and (xEk, yEk) = (k, 8) with k = 0..MbWidthC " 1 as the inputs and S'C with C being replaced by Cb for iCbCr = 0 and C being replaced by Cr for iCbCr = 1 as the output.
– When ChromaArrayType is equal to 2, the process specified in subclause REF _Ref36442362 \r \h 8.7.1 is invoked with chromaEdgeFlag = 1, iCbCr, verticalEdgeFlag = 0, fieldModeInFrameFilteringFlag = fieldModeMbInFrameFlag, and (xEk, yEk) = (k, 12) with k = 0..MbWidthC " 1 as the inputs and S'C with C being replaced by Cb for iCbCr = 0 and C being replaced by Cr for iCbCr = 1 as the output.
When ChromaArrayType is equal to 3 andor transform_size_8x8_flag is equal to 0, the process specified in subclause REF _Ref36442362 \r \h 8.7.1 is invoked with chromaEdgeFlag = 1, iCbCr, verticalEdgeFlag = 0, fieldModeInFrameFilteringFlag = fieldModeMbInFrameFlag, and (xEk, yEk) = (k, 12) with k = 0..MbWidthC " 1 as the inputs and S 'C with C being replaced by Cb for iCbCr = 0 and C being replaced by Cr for iCbCr = 1 as the output.
NOTE 2 – When field mode filtering (fieldModeInFrameFilteringFlag is equal to 1) is applied across the top horizontal edges of a frame macroblock, this vertical filtering across the top or bottom macroblock boundary may involve some samples that extend across an internal block edge that is also filtered internally in frame mode.
NOTE 3 – For example, in 4:2:0 chroma format when transform_size_8x8_flag is equal to 0, the following applies. 3 horizontal luma edges, 1 horizontal chroma edge for Cb, and 1 horizontal chroma edge for Cr are filtered that are internal to a macroblock. When field mode filtering (fieldModeInFrameFilteringFlag is equal to 1) is applied to the top edges of a frame macroblock, 2 horizontal luma, 2 horizontal chroma edges for Cb, and 2 horizontal chroma edges for Cr between the frame macroblock and the above macroblock pair are filtered using field mode filtering, for a total of up to 5 horizontal luma edges, 3 horizontal chroma edges for Cb, and 3 horizontal chroma edges for Cr filtered that are considered to be controlled by the frame macroblock. In all other cases, at most 4 horizontal luma, 2 horizontal chroma edges for Cb, and 2 horizontal chroma edges for Cr are filtered that are considered to be controlled by a particular macroblock.
Depending on separate_colour_plane_flag the following applies.
– If separate_colour_plane_flag is equal to 0, the arrays S’'L, S’'Cb, S’'Cr are assigned to the arrays SL, SCb, SCr (which represent the decoded picture), respectively.
– Otherwise (separate_colour_plane_flag is equal to 1), the following applies.
– If colour_plane_id is equal to 0, the arrays S’'L is assigned to the array SL (which represent the luma component of the decoded picture).
– Otherwise, if colour_plane_id is equal to 1, the arrays S’'L is assigned to the array SCb (which represents the Cb component of the decoded picture).
– Otherwise (colour_plane_id is equal to 2), the arrays S’'L is assigned to the array SCr (which represents the Cr component of the decoded picture).
Filtering process for block edges
Inputs to this process are chromaEdgeFlag, the chroma component index iCbCr (when chromaEdgeFlag is equal to 1), verticalEdgeFlag, fieldModeInFrameFilteringFlag, and a set of nE sample locations (xEk, yEk), with k = 0..nE " 1, expressed relative to the upper left corner of the macroblock CurrMbAddr. The set of sample locations (xEk, yEk) represent the sample locations immediately to the right of a vertical edge (when verticalEdgeFlag is equal to 1) or immediately below a horizontal edge (when verticalEdgeFlag is equal to 0).
The variable nE is derived as follows.
– If chromaEdgeFlag is equal to 0, nE is set equal to 16.
– Otherwise (chromaEdgeFlag is equal to 1), nE is set equal to ( verticalEdgeFlag = = 1 ) ? MbHeightC : MbWidthC.
Let s' be a variable specifying a luma or chroma sample array. s' is, be derived as follows.
– If chromaEdgeFlag is equal to 0, s' represents the luma sample array S'L of the current picture.
– Otherwise, if chromaEdgeFlag is equal to 1 and iCbCr is equal to 0, s' represents the chroma sample array S'Cb of the chroma component Cb of the current picture.
– Otherwise (chromaEdgeFlag is equal to 1 and iCbCr is equal to 1), s'’ represents the chroma sample array S'Cr of the chroma component Cr of the current picture.
The variable dy is set equal to (1 + fieldModeInFrameFilteringFlag)derived as follows.
– If fieldModeFilteringFlag is equal to 1 and MbaffFrameFlag is equal to 1, dy is set equal to 2.
– Otherwise (fieldModeFilteringFlag is equal to 0 or MbaffFrameFlag is equal to 0), dy is set equal to 1.
The position of the upper-left luma sample of the macroblock CurrMbAddr is derived by invoking the inverse macroblock scanning process in subclause REF _Ref32839806 \r \h \* MERGEFORMAT 6.4.1 with mbAddr = CurrMbAddr as input and the output being assigned to ( xI, yI ).
The variables xP and yP are derived as follows.
– If chromaEdgeFlag is equal to 0, xP is set equal to xI and yP is set equal to yI.
– Otherwise (chromaEdgeFlag is equal to 1), xP is set equal to xI / SubWidthC and yP is set equal to (yI + SubHeightC " 1) / SubHeightC.
p3p2p1p0q0q1q2q3Figure STYLEREF 1 \s 8 SEQ Figure \* ARABIC \s 1 11 Convention for describing samples across a 4x4 block horizontal or vertical boundary
For each sample location ( xEk, yEk ), k = 0 .. (nE " 1), the following applies.ordered steps are specified:
The filtering process is applied to a set of eight samples across a 4x4 block horizontal or vertical edge denoted as pi and qi with i = 0..3 as shown in REF _Ref36565297 \h Figure 811 with the edge lying between p0 and q0. pi and qi with i = 0..3 are specified as follows.
– If verticalEdgeFlag is equal to 1,
qi = s’'[ xP + xEk + i, yP + dy * yEk ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 450)
pi = s’'[ xP + xEk –" i " 1, yP + dy * yEk ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 451)
Otherwise (verticalEdgeFlag is equal to 0),
qi = s '[ xP + xEk, yP + dy * ( yEk + i ) " (yEk % 2 ) ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 452)
pi = s '[ xP + xEk, yP + dy * ( yEk " i " 1 ) " (yEk % 2 ) ] ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 453)
The process specified in subclause REF _Ref36438971 \r \h 8.7.2 is invoked with the sample values pi and qi (i = 0..3), chromaEdgeFlag, and verticalEdgeFlag, and fieldModeFilteringFlag as the inputs, and the output is assigned to the filtered result sample values p'i and q'i with i = 0..2.
– The input sample values pi and qi with i = 0..2 are replaced by the corresponding filtered result sample values p'i and q'i with i = 0..2 inside the sample array s’' as follows.
– If verticalEdgeFlag is equal to 1,
s’'[ xP + xEk + i, yP + dy * yEk ] = q'i ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 454)
s’'[ xP + xEk –" i " 1, yP + dy * yEk ] = p'i ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 455)
Otherwise (verticalEdgeFlag is equal to 0),
s '[ xP + xEk, yP + dy * ( yEk + i ) " ( yEk % 2 ) ] = q'i ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 456)
s '[ xP + xEk, yP + dy * ( yEk " i " 1 ) " ( yEk % 2 ) ] = p'i ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 457)
Filtering process for a set of samples across a horizontal or vertical block edge
Inputs to this process are the input sample values pi and qi with i in the range of 0..3 of a single set of samples across an edge that is to be filtered, chromaEdgeFlag, and verticalEdgeFlag, and fieldModeFilteringFlag.
Outputs of this process are the filtered result sample values p'i and q'i with i in the range of 0..2.
The content dependent boundary filtering strength variable bS is derived as follows.
– If chromaEdgeFlag is equal to 0, the derivation process for the content dependent boundary filtering strength specified in subclause REF _Ref36386895 \r \h \* MERGEFORMAT 8.7.2.1 is invoked with p0, q0, and verticalEdgeFlag as input, and the output is assigned to bS.
– Otherwise (chromaEdgeFlag is equal to 1), the bS used for filtering a set of samples of a horizontal or vertical chroma edge is set equal to the value of bS for filtering the set of samples of a horizontal or vertical luma edge, respectively, that contains the luma sample at location ( SubWidthC * x, SubHeightC * y ) inside the luma array of the same field, where ( x, y ) is the location of the chroma sample q0 inside the chroma array for that field.
Let filterOffsetA and filterOffsetB be the values of FilterOffsetA and FilterOffsetB as specified in subclause REF _Ref29724216 \r \h 7.4.3 for the slice that contains the macroblock containing sample q0.
Let qPp and qPq be variables specifying quantisation parameter values for the macroblocks containing the samples p0 and q0, respectively. The variables qPz (with z being replaced by p or q) are derived as follows.
– If chromaEdgeFlag is equal to 0, the following applies.
– If the macroblock containing the sample z0 is an I_PCM macroblock, qPz is set to 0.
– Otherwise (the macroblock containing the sample z0 is not an I_PCM macroblock), qPz is set to the value of QPY of the macroblock containing the sample z0.
– Otherwise (chromaEdgeFlag is equal to 1), the following applies.
– If the macroblock containing the sample z0 is an I_PCM macroblock, qPz is set equal set to the value of QPC that corresponds to a value of 0 for QPY as specified in subclause REF _Ref81383623 \r \h 8.5.8.
– Otherwise (the macroblock containing the sample z0 is not an I_PCM macroblock), qPz is set equal to the value of QPC that corresponds to the value QPY of the macroblock containing the sample z0 as specified in subclause REF _Ref81383623 \r \h 8.5.8.
The process specified in subclause REF _Ref36387916 \r \h 8.7.2.2 is invoked with p0, q0, p1, q1, chromaEdgeFlag, bS, filterOffsetA, filterOffsetB, qPp, and qPq as inputs, and the outputs are assigned to filterSamplesFlag, indexA, (, and (.
The variable chromaStyleFilteringFlag is set by
chromaStyleFilteringFlag = chromaEdgeFlag && ( ChromaArrayType != 3 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 458)
Depending on the variable filterSamplesFlag, the following applies.
– If filterSamplesFlag is equal to 1, the following applies.
– If bS is less than 4, the process specified in subclause REF _Ref36565298 \r \h 8.7.2.3 is invoked with pi and qi (i = 0..2), chromaEdgeFlag, chromaStyleFilteringFlag, bS, (, and indexA given as input, and the output is assigned to p'i and q'i (i = 0..2).
– Otherwise (bS is equal to 4), the process specified in subclause REF _Ref36388670 \r \h 8.7.2.4 is invoked with pi and qi (i = 0..3), chromaEdgeFlag, chromaStyleFilteringFlag, (, and ( given as input, and the output is assigned to p'i and q'i (i = 0..2).
– Otherwise (filterSamplesFlag is equal to 0), the filtered result samples p'i and q'i (i = 0..2) are replaced by the corresponding input samples pi and qi:
for i = 0..2, p'i = pi ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 459)
for i = 0..2, q'i = qi ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 460)
Derivation process for the luma content dependent boundary filtering strength
Inputs to this process are the input sample values p0 and q0 of a single set of samples across an edge that is to be filtered and verticalEdgeFlag.
Output of this process is the variable bS.
Let the variable mixedModeEdgeFlag be derived as follows.
– If MbaffFrameFlag is equal to 1 and the samples p0 and q0 are in different macroblock pairs, one of which is a field macroblock pair and the other is a frame macroblock pair, mixedModeEdgeFlag is set equal to 1.
– Otherwise, mixedModeEdgeFlag is set equal to 0.
The variable bS is derived as follows.
– If the block edge is also a macroblock edge and any of the following conditions are true, a value of bS equal to 4 is the output:
– the samples p0 and q0 are both in frame macroblocks and either or both of the samples p0 or q0 is in a macroblock coded using an Intra macroblock prediction mode,
– the samples p0 and q0 are both in frame macroblocks and either or both of the samples p0 or q0 is in a macroblock that is in a slice with slice_type equal to SP or SI,
– MbaffFrameFlag is equal to 1 or field_pic_flag is equal to 1, and verticalEdgeFlag is equal to 1, and either or both of the samples p0 or q0 is in a macroblock coded using an Intra macroblock prediction mode,
– MbaffFrameFlag is equal to 1 or field_pic_flag is equal to 1, and verticalEdgeFlag is equal to 1, and either or both of the samples p0 or q0 is in a macroblock that is in a slice with slice_type equal to SP or SI.
– Otherwise, if any of the following conditions are true, a value of bS equal to 3 is the output:
– mixedModeEdgeFlag is equal to 0 and either or both of the samples p0 or q0 is in a macroblock coded using an Intra macroblock prediction mode,
– mixedModeEdgeFlag is equal to 0 and either or both of the samples p0 or q0 is in a macroblock that is in a slice with slice_type equal to SP or SI,
– mixedModeEdgeFlag is equal to 1, verticalEdgeFlag is equal to 0, and either or both of the samples p0 or q0 is in a macroblock coded using an Intra macroblock prediction mode,
– mixedModeEdgeFlag is equal to 1, verticalEdgeFlag is equal to 0, and either or both of the samples p0 or q0 is in a macroblock that is in a slice with slice_type equal to SP or SI.
– Otherwise, if any of the following conditions is true, a value of bS equal to 2 is the output:
– transform_size_8x8_flag is equal to 1 for the macroblock containing the sample p0 and the 8x8 luma transform block associated with the 8x8 luma block containing the sample p0 contains non-zero transform coefficient levels,
– transform_size_8x8_flag is equal to 0 for the macroblock containing the sample p0 and the 4x4 luma transform block associated with the 4x4 luma block containing the sample p0 contains non-zero transform coefficient levels,
– transform_size_8x8_flag is equal to 1 for the macroblock containing the sample q0 and the 8x8 luma transform block associated with the 8x8 luma block containing the sample q0 contains non-zero transform coefficient levels,
– transform_size_8x8_flag is equal to 0 for the macroblock containing the sample q0 and the 4x4 luma transform block associated with the 4x4 luma block containing the sample q0 contains non-zero transform coefficient levels. – the luma block containing sample p0 or the luma block containing sample q0 contains non-zero transform coefficient levels
– Otherwise, if any of the following conditions are true, a value of bS equal to 1 is the output:
– mixedModeEdgeFlag is equal to 1,
– mixedModeEdgeFlag is equal to 0 and for the prediction of the macroblock/sub-macroblock partition containing the sample p0 different reference pictures or a different number of motion vectors are used than for the prediction of the macroblock/sub-macroblock partition containing the sample q0,.
NOTE 1 – The determination of whether the reference pictures used for the two macroblock/sub-macroblock partitions are the same or different is based only on which pictures are referenced, without regard to whether a prediction is formed using an index into reference picture list 0 or an index into reference picture list 1, and also without regard to whether the index position within a reference picture list is different.
– mixedModeEdgeFlag is equal to 0 and one motion vector is used to predict the macroblock/sub-macroblock partition containing the sample p0 and one motion vector is used to predict the macroblock/sub-macroblock partition containing the sample q0 and the absolute difference between the horizontal or vertical component of the motion vectors used is greater than or equal to 4 in units of quarter luma frame samples,.
– mixedModeEdgeFlag is equal to 0 and two motion vectors and two different reference pictures are used to predict the macroblock/sub-macroblock partition containing the sample p0 and two motion vectors for the same two reference pictures are used to predict the macroblock/sub-macroblock partition containing the sample q0 and the absolute difference between the horizontal or vertical component of the two motion vectors used in the prediction of the two macroblock/sub-macroblock partitions for the same reference picture is greater than or equal to 4 in units of quarter luma frame samples,.
– mixedModeEdgeFlag is equal to 0 and two motion vectors for the same reference picture are used to predict the macroblock/sub-macroblock partition containing the sample p0 and two motion vectors for the same reference picture are used to predict the macroblock/sub-macroblock partition containing the sample q0 and both of the following conditions are true:
– The absolute difference between the horizontal or vertical component of list 0 motion vectors used in the prediction of the two macroblock/sub-macroblock partitions is greater than or equal to 4 in quarter luma frame samples or the absolute difference between the horizontal or vertical component of the list 1 motion vectors used in the prediction of the two macroblock/sub-macroblock partitions is greater than or equal to 4 in units of quarter luma frame samples,.
– The absolute difference between the horizontal or vertical component of list 0 motion vector used in the prediction of the macroblock/sub-macroblock partition containing the sample p0 and the list 1 motion vector used in the prediction of the macroblock/sub-macroblock partition containing the sample q0 is greater than or equal to 4 in units of quarter luma frame samples or the absolute difference between the horizontal or vertical component of the list 1 motion vector used in the prediction of the macroblock/sub-macroblock partition containing the sample p0 and list 0 motion vector used in the prediction of the macroblock/sub-macroblock partition containing the sample q0 is greater than or equal to 4 in units of quarter luma frame samples.
NOTE 2 – A vertical difference of 4 in units of quarter luma frame samples is a difference of 2 in units of quarter luma field samples
– Otherwise, a value of bS equal to 0 is the output.
Derivation process for the thresholds for each block edge
Inputs to this process are
– the input sample values p0, q0, p1 and q1 of a single set of samples across an edge that is to be filtered,
– the variables chromaEdgeFlag and bS, for the set of input samples, as specified in REF _Ref36438971 \r \h 8.7.2,
– the variables filterOffsetA, filterOffsetB, qPp, and qPq.
Outputs of this process are the variable filterSamplesFlag, which indicates whether the input samples are filtered, the value of indexA, and the values of the threshold variables ( and (.
Let qPav be a variable specifying an average quantisation parameter. It is derived as follows.
qPav = ( qPp + qPq + 1 ) >> 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 461)
NOTE – In SP and SI slices, qPav is derived in the same way as in other slice types. QSY from Equation REF QSY_Eqn \h \* MERGEFORMAT 7-30 is not used in the deblocking filter.
Let indexA be a variable that is used to access the ( table ( REF _Ref36565300 \h Table 816) as well as the tC0 table ( REF _Ref205322818 \h Table 817 REF _Ref36565301 \h Table 817), which is used in filtering of edges with bS less than 4 as specified in subclause REF _Ref36565303 \r \h 8.7.2.3, and let indexB be a variable that is used to access the ( table ( REF _Ref36565300 \h Table 816). The variables indexA and indexB are derived as follows.
indexA = Clip3( 0, 51, qPav + filterOffsetA ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 462)
indexB = Clip3( 0, 51, qPav + filterOffsetB ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 463)
The variables (' and (' depending on the values of indexA and indexB are specified in REF _Ref36565300 \h Table 816. Depending on chromaEdgeFlag, the corresponding threshold variables ( and ( are derived as follows.
– If chromaEdgeFlag is equal to 0,
( = (' * (1 << ( BitDepthY –" 8 ) ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 464)
² = ²' * (1 << ( BitDepthY " 8 ) ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 465)
Otherwise (chromaEdgeFlag is equal to 1),
( = (' * (1 << ( BitDepthC " 8 ) ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 466)
² = ²' * (1 << ( BitDepthC " 8 ) ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 467)
The variable filterSamplesFlag is derived by
filterSamplesFlag = ( bS != 0 && Abs( p0 " q0 ) < ( && Abs( p1 " p0 ) < ( && Abs( q1 " q0 ) < ( ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 468)
Table STYLEREF 1 \s 8 SEQ Table \* ARABIC \s 1 16 Derivation of offset dependent threshold variables (' and (' from indexA and indexB
indexA (for (') or indexB (for (') 012345678910111213141516171819202122232425('00000000000000004456789101213('00000000000000002223333444 REF _Ref36565300 \h Table 816 (concluded) – Derivation of indexA and indexB from offset dependent threshold variables (' and ('
indexA (for (') or indexB (for (')2627282930313233343536373839404142434445464748495051('15172022252832364045505663718090101113127144162182203226255255('66778899101011111212131314141515161617171818
Filtering process for edges with bS less than 4
Inputs to this process are the input sample values pi and qi (i = 0..2) of a single set of samples across an edge that is to be filtered, chromaEdgeFlag, chromaStyleFilteringFlag, bS, (, and indexA, for the set of input samples, as specified in REF _Ref36438971 \r \h 8.7.2.
Outputs of this process are the filtered result sample values p'i and q'i (i = 0..2) for the set of input sample values.
Depending on the values of indexA and bS, the variable t'C0 is specified in REF _Ref205322818 \h Table 817 REF _Ref36565301 \h Table 817. Depending on chromaEdgeFlag, the corresponding threshold variable tC0 is derived as follows.
– If chromaEdgeFlag is equal to 0,
tC0 = t'C0 * (1 << ( BitDepthY –" 8 ) ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 469)
Otherwise (chromaEdgeFlag is equal to 1),
tC0 = t'C0 * (1 << ( BitDepthC " 8 ) ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 470)
Table STYLEREF 1 \s 8 SEQ Table \* ARABIC \s 1 17 – Value of variable t'C0 as a function of indexA and bS
indexA012345678910111213141516171819202122232425bS = 100000000000000000000000111bS = 200000000000000000000011111bS = 3 00000000000000000111111111 REF _Ref205322818 \h Table 817 REF _Ref36565301 \h Table 817 (concluded) – Value of variable t'C0 as a function of indexA and bS
indexA2627282930313233343536373839404142434445464748495051bS = 111111112222333444566789101113bS = 211111222233344556788101112131517bS = 3 12222333444566789101113141618202325
The threshold variables ap and aq are derived by
ap = Abs( p2 –" p0 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 471)aq = Abs( q2 " q0 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 472)
The threshold variable tC is determined as follows.
If chromaStyleFilteringFlag is equal to 0,
tC = tC0 + ( ( ap < ( ) ? 1 : 0 ) + ( ( aq < ( ) ? 1 : 0 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 473)
– Otherwise (chromaStyleFilteringFlag is equal to 1),
tC = tC0 + 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 474)
Let Clip1( ) be a function that is replaced by Clip1Y( ) when chromaEdgeFlagStyleFiltering is equal to 0 and by Clip1C( ) when chromaEdgeFlagStyleFIltering is equal to 1.
The filtered result samples p'0 and q'0 are derived by
( = Clip3( –"tC, tC, ( ( ( ( q0 " p0 ) << 2 ) + ( p1 " q1 ) + 4 ) >> 3 ) ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 475)
p'0 = Clip1( p0 + ( ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 476)
q'0 = Clip1( q0 " ( ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 477)
where the threshold tC is determined as follows.
– If chromaStyleFiltering is equal to 0,
tC = tC0 + ( ( ap < ( ) ? 1 : 0 ) + ( ( aq < ( ) ? 1 : 0 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 474)
– Otherwise (chromaStyleFiltering is equal to 1),
tC = tC0 + 1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 475)
Depending on the values of indexA and bS the variable t'C0 is specified in REF _Ref36565301 \h Table 817. Depending on chromaEdgeFlag, the corresponding threshold variable tC0 is derived as follows.
– If chromaEdgeFlag is equal to 0,
tC0 = t'C0 * (1 << ( BitDepthY – 8 ) ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 476)
– Otherwise (chromaEdgeFlag is equal to 1),
tC0 = t'C0 * (1 << ( BitDepthC – 8 ) ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 477)
Let ap and aq be two threshold variables specified by
ap = Abs( p2 – p0 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 478)
aq = Abs( q2 – q0 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 479)
The filtered result sample p'1 is derived as follows
If chromaStyleFilteringFlag is equal to 0 and ap is less than (,
p'1 = p1 + Clip3( "tC0, tC0, ( p2 + ( ( p0 + q0 + 1 ) >> 1 ) " ( p1 << 1 ) ) >> 1 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 478)
– Otherwise (chromaStyleFilteringFlag is equal to 1 or ap is greater than or equal to (),
p'1 = p1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 479)
The filtered result sample q'1 is derived as follows
– If chromaStyleFilteringFlag is equal to 0 and aq is less than (,
q'1 = q1 + Clip3( –"tC0, tC0, ( q2 + ( ( p0 + q0 + 1 ) >> 1 ) " ( q1 << 1 ) ) >> 1 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 480)
Otherwise (chromaStyleFilteringFlag is equal to 1 or aq is greater than or equal to (),
q'1 = q1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 481)
The filtered result samples p'2 and q'2 are always set equal to the input samples p2 and q2:
p'2 = p2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 482)
q'2 = q2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 483)
Table STYLEREF 1 \s 8 SEQ Table \* ARABIC \s 1 17 – Value of variable t'C0 as a function of indexA and bS
indexA012345678910111213141516171819202122232425bS = 100000000000000000000000111bS = 200000000000000000000011111bS = 3 00000000000000000111111111 REF _Ref36565301 \h Table 817 (concluded) – Value of variable t'C0 as a function of indexA and bS
indexA2627282930313233343536373839404142434445464748495051bS = 111111112222333444566789101113bS = 211111222233344556788101112131517bS = 3 12222333444566789101113141618202325
Filtering process for edges for bS equal to 4
Inputs to this process are the input sample values pi and qi (i = 0..3) of a single set of samples across an edge that is to be filtered, chromaEdgeFlag, chromaStyleFilteringFlag, and the values of the threshold variables ( and ( for the set of samples, as specified in subclause REF _Ref36438971 \r \h 8.7.2.
Outputs of this process are the filtered result sample values p'i and q'i (i = 0..2) for the set of input sample values.
Let ap and aq be two threshold variables as specified in Equations REF apDeblFilt_Eqn \h 8-471 and REF aqDeblFilt_Eqn \h 8-472, respectively, in subclause REF _Ref36565595 \r \h 8.7.2.3.
The filtered result samples p'i (i = 0..2) are derived as follows.
– If chromaStyleFilteringFlag is equal to 0 and the following condition holds,
ap < ( && Abs( p0 –" q0 ) < ( ( ( >> 2 ) + 2 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 484)
then the variables p'0, p'1, and p'2 are derived by
p'0 = ( p2 + 2*p1 + 2*p0 + 2*q0 + q1 + 4 ) >> 3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 485)
p'1 = ( p2 + p1 + p0 + q0 + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 486)
p'2 = ( 2*p3 + 3*p2 + p1 + p0 + q0 + 4 ) >> 3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 487)
– Otherwise (chromaStyleFilteringFlag is equal to 1 or the condition in Equation REF chromaCondDeblFilt_Eqn \h 8-484 does not hold), the variables p'0, p'1, and p'2 are derived by
p'0 = ( 2*p1 + p0 + q1 + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 488)
p'1 = p1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 489)
p'2 = p2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 490)
The filtered result samples q'i (i = 0..2) are derived as follows.
If chromaStyleFilteringFlag is equal to 0 and the following condition holds,
aq < ( && Abs( p0 " q0 ) < ( ( ( >> 2 ) + 2 ) ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 491)
then the variables q'0, q'1, and q'2 are derived by
q'0 = ( p1 + 2*p0 + 2*q0 + 2*q1 + q2 + 4 ) >> 3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 492)
q'1 = ( p0 + q0 + q1 + q2 + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 493)
q'2 = ( 2*q3 + 3*q2 + q1 + q0 + p0 + 4 ) >> 3 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 494)
– Otherwise (chromaStyleFilteringFlag is equal to 1 or the condition in Equation REF chromaCondDeblFilt2_Eqn \h 8-491 does not hold), the variables q'0, q'1, and q'2 are derived by
q'0 = ( 2*q1 + q0 + p1 + 2 ) >> 2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 495)
q'1 = q1 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 496)
q'2 = q2 ( STYLEREF 1 \s 8- SEQ Equation \* ARABIC 497)
Parsing process
Inputs to this process are bits from the RBSP.
Outputs of this process are syntax element values.
This process is invoked when the descriptor of a syntax element in the syntax tables in subclause REF _Ref20133281 \r \h 7.3 is equal to ue(v), me(v), se(v), te(v) (see subclause REF _Ref24434081 \r \h 9.1), ce(v) (see subclause REF _Ref33186826 \r \h 9.2), or ae(v) (see subclause REF _Ref29798517 \r \h 9.3).
Parsing process for Exp-Golomb codes
This process is invoked when the descriptor of a syntax element in the syntax tables in subclause REF _Ref20133281 \r \h 7.3 is equal to ue(v), me(v), se(v), or te(v). For syntax elements in subclauses REF _Ref18822303 \r \h 7.3.4 and REF _Ref18822306 \r \h 7.3.5, this process is invoked only when entropy_coding_mode_flag is equal to 0.
Inputs to this process are bits from the RBSP.
Outputs of this process are syntax element values.
Syntax elements coded as ue(v), me(v), or se(v) are Exp-Golomb-coded. Syntax elements coded as te(v) are truncated Exp-Golomb-coded. The parsing process for these syntax elements begins with reading the bits starting at the current location in the bitstream up to and including the first non-zero bit, and counting the number of leading bits that are equal to 0. This process is specified as follows:
leadingZeroBits = -"1;
for( b = 0; !b; leadingZeroBits++ ) ( STYLEREF 1 \s 9- SEQ Equation \r 1 \* ARABIC 1)
b = read_bits( 1 )
The variable codeNum is then assigned as follows:
codeNum = 2leadingZeroBits " 1 + read_bits( leadingZeroBits ) ( STYLEREF 1 \s 9- SEQ Equation \* ARABIC 2)
where the value returned from read_bits( leadingZeroBits ) is interpreted as a binary representation of an unsigned integer with most significant bit written first.
REF _Ref24091501 \h Table 91 illustrates the structure of the Exp-Golomb code by separating the bit string into “"prefix”" and “"suffix”" bits. The “"prefix”" bits are those bits that are parsed in the above pseudo-code for the computation of leadingZeroBits, and are shown as either 0 or 1 in the bit string column of REF _Ref24091501 \h Table 91. The “"suffix”" bits are those bits that are parsed in the computation of codeNum and are shown as xi in REF _Ref24091501 \h Table 91, with i being in the range 0 to leadingZeroBits -" 1, inclusive. Each xi can take on values 0 or 1.
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 1 Bit strings with "prefix " and "suffix " bits and assignment to codeNum ranges (informative)
Bit string formRange of codeNum 10 0 1 x01-..2 0 0 1 x1 x03-..6 0 0 0 1 x2 x1 x07-..14 0 0 0 0 1 x3 x2 x1 x015-..300 0 0 0 0 1 x4 x3 x2 x1 x031-..62……
REF _Ref19418112 \h Table 92 illustrates explicitly the assignment of bit strings to codeNum values.
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 2 – Exp-Golomb bit strings and codeNum in explicit form and used as ue(v) (informative)
Bit stringcodeNum100 1 010 1 120 0 1 0 030 0 1 0 140 0 1 1 050 0 1 1 160 0 0 1 0 0 070 0 0 1 0 0 180 0 0 1 0 1 09……
Depending on the descriptor, the value of a syntax element is derived as follows.
– If the syntax element is coded as ue(v), the value of the syntax element is equal to codeNum.
– Otherwise, if the syntax element is coded as se(v), the value of the syntax element is derived by invoking the mapping process for signed Exp-Golomb codes as specified in subclause REF _Ref24094007 \r \h 9.1.1 with codeNum as the input.
– Otherwise, if the syntax element is coded as me(v), the value of the syntax element is derived by invoking the mapping process for coded block pattern as specified in subclause REF _Ref33182509 \r \h \* MERGEFORMAT 9.1.2 with codeNum as the input.
– Otherwise (the syntax element is coded as te(v)), the range of possible values for the syntax element is determined first. The range of this syntax element may be between 0 and x, with x being greater than or equal to 1 and the range is used in the derivation of the value of the syntax element value as follows
– If x is greater than 1, codeNum and the value of the syntax element is derived in the same way as for syntax elements coded as ue(v)
– Otherwise (x is equal to 1), the parsing process for codeNum which is equal to the value of the syntax element is given by a process equivalent to:
b = read_bits( 1 ) ( STYLEREF 1 \s 9- SEQ Equation \* ARABIC 3)codeNum = !b
Mapping process for signed Exp-Golomb codes
Input to this process is codeNum as specified in subclause REF _Ref24105798 \r \h 9.1.
Output of this process is a value of a syntax element coded as se(v).
The syntax element is assigned to the codeNum by ordering the syntax element by its absolute value in increasing order and representing the positive value for a given absolute value with the lower codeNum. REF _Ref19418147 \h Table 93 provides the assignment rule.
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 3 – Assignment of syntax element to codeNum for signed Exp-Golomb coded syntax elements se(v)
codeNumsyntax element value00112 "1324 "2536 "3k( "1)k+1 Ceil( k÷2 )
Mapping process for coded block pattern
Input to this process is codeNum as specified in subclause REF _Ref24105798 \r \h 9.1.
Output of this process is a value of the syntax element coded_block_pattern coded as me(v).
REF _Ref33182469 \h Table 94 shows the assignment of coded_block_pattern to codeNum depending on whether the macroblock prediction mode is equal to Intra_4x4, Intra_8x8 or Inter.
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 4 – Assignment of codeNum to values of coded_block_pattern for macroblock prediction modes
(a) ChromaArrayType is equal to 1 or 2
(a) ChromaArrayType is equal to 1 or 2codeNumcoded_block_patternIntra_4x4, Intra_8x8Inter047013116215130242345278629327303875911101013121114151239471343714451115461316161417361859191031201235211937222142232644242833253534263736274240284439291433024531446328173317183418203520243624193762138926392228402523413227423329433430443622454025463838474141(b) ChromaArrayType is equal to 0 or 3
(b) ChromaArrayType is equal to 0 or 3codeNumcoded_block_patternIntra_4x4, Intra_8x8Inter015010127231144138514363575108101291215101711211124131381414661599
CAVLC parsing process for transform coefficient levels
This process is invoked when parsing syntax elements with descriptor equal to ce(v) in subclause REF _Ref166905480 \r \h 7.3.5.3.2 and when entropy_coding_mode_flag is equal to 0.
Inputs to this process are bits from slice data, a maximum number of non-zero transform coefficient levels maxNumCoeff, the luma block index luma4x4BlkIdx or the chroma block index chroma4x4BlkIdx, cb4x4BlkIdx or cr4x4BlkIdx of the current block of transform coefficient levels.
Output of this process is the list coeffLevel containing transform coefficient levels of the luma block with block index luma4x4BlkIdx or the chroma block with block index chroma4x4BlkIdx, cb4x4BlkIdx or cr4x4BlkIdx.
The process is specified in the following ordered steps:
All transform coefficient levels, with indices from 0 to maxNumCoeff -" 1, in the list coeffLevel are set equal to 0.
The total number of non-zero transform coefficient levels TotalCoeff( coeff_token ) and the number of trailing one transform coefficient levels TrailingOnes( coeff_token ) are derived by parsing coeff_token (see subclause REF _Ref29722469 \r \h 9.2.1) as follows.
– If the number of non-zero transform coefficient levels TotalCoeff( coeff_token ) is equal to 0, the list coeffLevel containing 0 values is returned and no further step is carried out.
– Otherwise, the following steps are carried out.
The non-zero transform coefficient levels are derived by parsing trailing_ones_sign_flag, level_prefix, and level_suffix (see subclause REF _Ref31515681 \r \h 9.2.2).
The runs of zero transform coefficient levels before each non-zero transform coefficient level are derived by parsing total_zeros and run_before (see subclause REF _Ref29962891 \r \h 9.2.3).
The level and run information are combined into the list coeffLevel (see subclause REF _Ref33187434 \r \h 9.2.4).
Parsing process for total number of transform coefficient levels and trailing ones
Inputs to this process are bits from slice data, a maximum number of non-zero transform coefficient levels maxNumCoeff, the luma block index luma4x4BlkIdx or the chroma block index chroma4x4BlkIdx, cb4x4BlkIdx or cr4x4BlkIdx of the current block of transform coefficient levels.
Outputs of this process are TotalCoeff( coeff_token ), TrailingOnes( coeff_token ), and the variable nC.
The syntax element coeff_token is decoded using one of the six VLCs specified in the six right-most columns of REF _Ref205322821 \h Table 95 REF _Ref29963041 \h Table 95. Each VLC specifies both TotalCoeff( coeff_token ) and TrailingOnes( coeff_token ) for a given codeword coeff_token. VLC selection is dependent upon a variable nC that is derived as follows.
– If the CAVLC parsing process is invoked for ChromaDCLevel, nC is derived as follows.
– If ChromaArrayType is equal to 1, nC is set equal to "1,
Otherwise (ChromaArrayType is equal to 2), nC is set equal to "2,
Otherwise, the following applies.ordered steps are specified:
When the CAVLC parsing process is invoked for Intra16x16DCLevel, luma4x4BlkIdx is set equal to 0.
When the CAVLC parsing process is invoked for CbIntra16x16DCLevel, cb4x4BlkIdx is set equal to 0.
– When the CAVLC parsing process is invoked for CrIntra16x16DCLevel, cr4x4BlkIdx is set equal to 0.
– The variables blkA and blkB are derived as follows.
– If the CAVLC parsing process is invoked for Intra16x16DCLevel, Intra16x16ACLevel, or LumaLevel, the process specified in subclause REF _Ref30243050 \r \h \* MERGEFORMAT 6.4.10.4 is invoked with luma4x4BlkIdx as the input, and the output is assigned to mbAddrA, mbAddrB, luma4x4BlkIdxA, and luma4x4BlkIdxB. The 4x4 luma block specified by mbAddrA\luma4x4BlkIdxA is assigned to blkA, and the 4x4 luma block specified by mbAddrB\luma4x4BlkIdxB is assigned to blkB.
– Otherwise, if the CAVLC parsing process is invoked for CbIntra16x16DCLevel, CbIntra16x16ACLevel, or CbLevel, the process specified in subclause REF _Ref166860299 \r \h 6.4.10.6 is invoked with cb4x4BlkIdx as the input, and the output is assigned to mbAddrA, mbAddrB, cb4x4BlkIdxA, and cb4x4BlkIdxB. The 4x4 Cb block specified by mbAddrA\cb4x4BlkIdxA is assigned to blkA, and the 4x4 Cb block specified by mbAddrB\cb4x4BlkIdxB is assigned to blkB.
– Otherwise, if the CAVLC parsing process is invoked for CrIntra16x16DCLevel, CrIntra16x16ACLevel, or CrLevel, the process specified in subclause REF _Ref166860299 \r \h 6.4.10.6 is invoked with cr4x4BlkIdx as the input, and the output is assigned to mbAddrA, mbAddrB, cr4x4BlkIdxA, and cr4x4BlkIdxB. The 4x4 Cr block specified by mbAddrA\cr4x4BlkIdxA is assigned to blkA, and the 4x4 Cr block specified by mbAddrB\cr4x4BlkIdxB is assigned to blkB.
– Otherwise (the CAVLC parsing process is invoked for ChromaACLevel), the process specified in subclause REF _Ref30243063 \r \h \* MERGEFORMAT 6.4.10.5 is invoked with chroma4x4BlkIdx as input, and the output is assigned to mbAddrA, mbAddrB, chroma4x4BlkIdxA, and chroma4x4BlkIdxB. The 4x4 chroma block specified by mbAddrA\iCbCr\chroma4x4BlkIdxA is assigned to blkA, and the 4x4 chroma block specified by mbAddrB\iCbCr\chroma4x4BlkIdxB is assigned to blkB.
– Let nA and nB be the number of non-zero transform coefficient levels (given by TotalCoeff( coeff_token )) in the block of transform coefficient levels blkA located to the left of the current block and the block of transform coefficient levels blkB located above the current block, respectively.– The variable availableFlagN with N being replaced by A and B is derived as follows.
– If any of the following conditions is true, availableFlagN is set equal to 0:.
– mbAddrN is not available,
– Tthe current macroblock is coded using an Intra macroblock prediction mode, constrained_intra_pred_flag is equal to 1, mbAddrN is coded using an Inter macroblock prediction mode, and slice data partitioning is in use (nal_unit_type is in the range of 2 to 4, inclusive).
– Otherwise, availableFlagN is set equal to 1.
– ForWith N being replaced by A and B, when availableFlagN is equal to 1, the variable in mbAddrN, blkN, and nN the following appliesis derived as follows.
– If any of the following conditions is true, nN is set equal to 0:.
– mbAddrN is not available
– The current macroblock is coded using an Intra prediction mode, constrained_intra_pred_flag is equal to 1 and mbAddrN is coded using Inter prediction and slice data partitioning is in use (nal_unit_type is in the range of 2 to 4, inclusive).
– The macroblock mbAddrN has mb_type equal to P_Skip or B_Skip,
– All AC residual transform coefficient levels of the neighbouring block blkN are equal to 0 due to the corresponding bit of CodedBlockPatternLuma or CodedBlockPatternChroma being equal to 0.
– Otherwise, if mbAddrN is an I_PCM macroblock, nN is set equal to 16.
– Otherwise, nN is set equal to the value TotalCoeff( coeff_token ) of the neighbouring block blkN.
NOTE 1 – The values nA and nB that are derived using TotalCoeff( coeff_token ) do not include the DC transform coefficient levels in Intra_16x16 macroblocks or DC transform coefficient levels in chroma blocks, because these transform coefficient levels are decoded separately. When the block above or to the left belongs to an Intra_16x16 macroblock, or is a chroma block, nA and nB is the number of decoded non-zero AC transform coefficient levels.
NOTE 2 – When parsing for Intra16x16DCLevel, CbIntra16x16DCLevel, or CrIntra16x16DCLevel, the values nA and nB are based on the number of non-zero transform coefficient levels in adjacent 4x4 blocks and not on the number of non-zero DC transform coefficient levels in adjacent 16x16 blocks.
– Given the values of nA and nB, tThe variable nC is derived as follows.
– If availableFlagA is equal to 1 and availableFlagB is equal to 1both mbAddrA and mbAddrB are available, the variable nC is set equal to ( nA + nB + 1 ) >> 1.
– Otherwise, if availableFlagA is equal to 1 (and mbAddrA is not available or availableFlagBmbAddrB is equal to 0not available), the variable nC is set equal to to nA + nB.
– Otherwise, if availableFlagB is equal to 1 (and availableFlagA is equal to 0), the variable nC is set equal to nB.
– Otherwise (availableFlagA is equal to 0 and availableFlagB is equal to 0), the variable nC is set equal to 0.
The value of TotalCoeff( coeff_token ) resulting from decoding coeff_token shall be in the range of 0 to maxNumCoeff, inclusive.
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 5 – coeff_token mapping to TotalCoeff( coeff_token ) and TrailingOnes( coeff_token )
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 5 – coeff_token mapping to TotalCoeff( coeff_token ) and TrailingOnes( coeff_token )TrailingOnes( coeff_token )TotalCoeff( coeff_token )0 <= nC < 22 <= nC < 44 <= nC < 88 <= nCnC = = "1nC = = "20011111110000 11011010001 010010 110011 110000 000001 110001 11111011011100000 01101020000 01110001 110010 110001 000001 000001 110120001 000011 10111 10001 010001 100001 1012200101111010001 10001001030000 0011 10000 1110010 000010 000000 110000 0011 1130000 01100010 100110 00010 010000 0110001 100230000 1010010 010111 00010 100000 0100001 011330001 1010111000010 110001 010000 1040000 0001 110000 01110001 1110011 000000 100000 0011 0140000 0011 00001 100101 00011 010000 00110000 0010 1240000 01010001 010101 10011 100000 00100001 010340000 11010010110011 110000 0000000 01050000 0000 1110000 01000001 0110100 00-0000 0001 11150000 0001 100000 1100100 00100 01-0000 0001 10250000 0010 10000 1010100 10100 10-0000 0010 0350000 1000011 010100100 11-0001 001060000 0000 0111 10000 0011 10001 0010101 00-0000 0000 111160000 0000 1100000 01100011 100101 01-0000 0000 110260000 0001 010000 01010011 010101 10-0000 0001 01360000 01000010 0010010101 11-0001 000070000 0000 0101 10000 0001 1110001 0000110 00-0000 0000 0111170000 0000 0111 00000 0011 00010 100110 01-0000 0000 0110270000 0000 1010000 0010 10010 010110 10-0000 0000 101370000 0010 00001 0010000110 11-0000 0001 00080000 0000 0100 00000 0001 0110000 11110111 00-0000 0000 0011 1180000 0000 0101 00000 0001 1100001 1100111 01-0000 0000 0101280000 0000 0110 10000 0001 1010001 1010111 10-0000 0000 0100380000 0001 000000 1000110 10111 11-0000 0000 100090000 0000 0011 110000 0000 11110000 10111000 00--190000 0000 0011 100000 0001 0100000 11101000 01--290000 0000 0100 10000 0001 0010001 0101000 10--390000 0000 1000000 0010 00011 001000 11--0100000 0000 0010 110000 0000 10110000 0111 11001 00--1100000 0000 0010 100000 0000 11100000 10101001 01--2100000 0000 0011 010000 0000 11010000 11011001 10--3100000 0000 0110 00000 0001 1000001 1001001 11--0110000 0000 0001 1110000 0000 10000000 0101 11010 00--1110000 0000 0001 1100000 0000 10100000 0111 01010 01--2110000 0000 0010 010000 0000 10010000 10011010 10--3110000 0000 0011 000000 0001 0000000 11001010 11--0120000 0000 0001 0110000 0000 0111 10000 0100 01011 00--1120000 0000 0001 0100000 0000 0111 00000 0101 01011 01--2120000 0000 0001 1010000 0000 0110 10000 0110 11011 10--3120000 0000 0010 000000 0000 11000000 10001011 11--0130000 0000 0000 11110000 0000 0101 10000 0011 011100 00--1130000 0000 0000 0010000 0000 0101 00000 0011 11100 01--2130000 0000 0001 0010000 0000 0100 10000 0100 11100 10--3130000 0000 0001 1000000 0000 0110 00000 0110 01100 11--0140000 0000 0000 10110000 0000 0011 10000 0010 011101 00--1140000 0000 0000 11100000 0000 0010 110000 0011 001101 01--2140000 0000 0000 11010000 0000 0011 00000 0010 111101 10--3140000 0000 0001 0000000 0000 0100 00000 0010 101101 11--0150000 0000 0000 01110000 0000 0010 010000 0001 011110 00--1150000 0000 0000 10100000 0000 0010 000000 0010 001110 01--2150000 0000 0000 10010000 0000 0010 100000 0001 111110 10--3150000 0000 0000 11000000 0000 0000 10000 0001 101110 11--0160000 0000 0000 01000000 0000 0001 110000 0000 011111 00--1160000 0000 0000 01100000 0000 0001 100000 0001 001111 01--2160000 0000 0000 01010000 0000 0001 010000 0000 111111 10--3160000 0000 0000 10000000 0000 0001 000000 0000 101111 11--
Parsing process for level information
Inputs to this process are bits from slice data, the number of non-zero transform coefficient levels TotalCoeff( coeff_token ), and the number of trailing one transform coefficient levels TrailingOnes( coeff_token ).
Output of this process is a list with name level containing transform coefficient levels.
Initially an index i is set equal to 0. Then the following procedure is iteratively applied TrailingOnes( coeff_token ) times to decode the trailing one transform coefficient levels (if any):
– A 1-bit syntax element trailing_ones_sign_flag is decoded and evaluated as follows.
– If trailing_ones_sign_flag is equal to 0, the value +1 is assigned to level[ i ].
– Otherwise (trailing_ones_sign_flag is equal to 1), the value "1 is assigned to level[ i ].
The index i is incremented by 1.
Following the decoding of the trailing one transform coefficient levels, a variable suffixLength is initialised as follows.
If TotalCoeff( coeff_token ) is greater than 10 and TrailingOnes( coeff_token ) is less than 3, suffixLength is set equal to 1.
– Otherwise (TotalCoeff( coeff_token ) is less than or equal to 10 or TrailingOnes( coeff_token ) is equal to 3), suffixLength is set equal to 0.
The following procedure is then applied iteratively ( TotalCoeff( coeff_token ) –" TrailingOnes( coeff_token ) ) times to decode the remaining levels (if any):
The syntax element level_prefix is decoded as specified in subclause REF _Ref81659351 \r \h 9.2.2.1.
The variable levelSuffixSize is set equal to the variable suffixLength with the exception of the following two cases:.
– – When level_prefix is equal to 14 and suffixLength is equal to 0, levelSuffixSize is set equal to 4,.
– – When level_prefix is greater than or equal to 15, levelSuffixSize is set equal to level_prefix -" 3.
The syntax element level_suffix is decoded as follows.
If levelSuffixSize is greater than 0, the syntax element level_suffix is decoded as unsigned integer representation u(v) with levelSuffixSize bits.
Otherwise (levelSuffixSize is equal to 0), the syntax element level_suffix is inferred to be equal to 0.
– A variable levelCode is set equal to ( Min( 15, level_prefix ) << suffixLength ) + level_suffix.
– When level_prefix is greater than or equal to 15 and suffixLength is equal to 0, levelCode is incremented by 15.
– When level_prefix is greater than or equal to 16, levelCode is incremented by (1<<( level_prefix –" 3 )) " 4096.
When the index i is equal to TrailingOnes( coeff_token ) and TrailingOnes( coeff_token ) is less than 3, levelCode is incremented by 2.
The variable level[ i ] is derived as follows.
If levelCode is an even number, the value ( levelCode + 2 ) >> 1 is assigned to level[ i ].
Otherwise (levelCode is an odd number), the value ( "levelCode " 1) >> 1 is assigned to level[ i ].
When suffixLength is equal to 0, suffixLength is set equal to 1.
When the absolute value of level[ i ] is greater than ( 3 << ( suffixLength " 1 ) ) and suffixLength is less than 6, suffixLength is incremented by 1.
The index i is incremented by 1.
Parsing process for level_prefix
Inputs to this process are bits from slice data.
Output of this process is level_prefix.
The parsing process for this syntax element consists in reading the bits starting at the current location in the bitstream up to and including the first non-zero bit, and counting the number of leading bits that are equal to 0. This process is specified as follows:
leadingZeroBits = "1
for( b = 0; !b; leadingZeroBits++ ) ( STYLEREF 1 \s 9- SEQ Equation \* ARABIC 4)
b = read_bits( 1 )
level_prefix = leadingZeroBits
REF _Ref31612576 \h Table 96 illustrates the codeword table for level_prefix.
NOTE 1 The value of level_prefix is constrained to not exceed 15 in bitstreams conforming to the Baseline, Main, and Extended profiles, as specified in subclauses REF _Ref215990769 \r \h A.2.1, REF _Ref205305909 \r \h A.2.2, and REF _Ref35859104 \r \h A.2.3, respectively. In bitstreams conforming to other profiles, it has been reported that the value of level_prefix cannot exceed (11 + bitDepth) with bitDepth being the variable BitDepthY for transform coefficient blocks related to the luma component and being the variable BitDepthC for transform coefficient blocks related to a chroma component.
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 6 – Codeword table for level_prefix (informative)
level_prefixbit string0110120013000140000 150000 0160000 00170000 000180000 0000 190000 0000 01100000 0000 001110000 0000 0001120000 0000 0000 1130000 0000 0000 01140000 0000 0000 001150000 0000 0000 0001……Parsing process for run information
Inputs to this process are bits from slice data, the number of non-zero transform coefficient levels TotalCoeff( coeff_token ), and the maximum number of non-zero transform coefficient levels maxNumCoeff.
Output of this process is a list of runs of zero transform coefficient levels preceding non-zero transform coefficient levels called run.
Initially, an index i is set equal to 0.
The variable zerosLeft is derived as follows.
– If the number of non-zero transform coefficient levels TotalCoeff( coeff_token ) is equal to the maximum number of non-zero transform coefficient levels maxNumCoeff, a variable zerosLeft is set equal to 0.
– Otherwise (the number of non-zero transform coefficient levels TotalCoeff( coeff_token ) is less than the maximum number of non-zero transform coefficient levels maxNumCoeff), total_zeros is decoded and zerosLeft is set equal to its value.
Let the variable tzVlcIndex be equal to TotalCoeff( coeff_token ).
The VLC used to decode total_zeros is derived as follows.:
– If maxNumCoeff is equal to 4, one of the VLCs specified in REF _Ref36541799 \h Table 99 (a) is used.
– Otherwise, if maxNumCoeff is equal to 8, one of the VLCs specified in REF _Ref36541799 \h \* MERGEFORMAT Table 99 (b) is used.
– Otherwise (maxNumCoeff is not equal to 4 and not equal to 8), VLCs from REF _Ref29749534 \h \* MERGEFORMAT Table 97 and 9-8 are used.
The following procedure is then applied iteratively ( TotalCoeff( coeff_token ) –" 1 ) times:
The variable run[ i ] is derived as follows.
If zerosLeft is greater than zero, a value run_before is decoded based on REF _Ref29749604 \h Table 910 and zerosLeft. run[ i ] is set equal to run_before.
Otherwise (zerosLeft is equal to 0), run[ i ] is set equal to 0.
– The value of run[ i ] is subtracted from zerosLeft and the result assigned to zerosLeft. The result of the subtraction shall be greater than or equal to 0.
– The index i is incremented by 1.
Finally the value of zerosLeft is assigned to run[ i ].
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 7 – total_zeros tables for 4x4 blocks with tzVlcIndex 1 to 7
total_zerostzVlcIndex12345670111101010001 101010000 010000 01101111011111101000000 10000 120101011100101001111110130011100101010011111010040010011010011011010101150001 1010100111011011001160001 0010010010010001101070000 1100110110011011010000180000 10001000100110010000100190000 0110001 10001 100100000 10010000 00100000 0100001 00001 00001 000010000 00-110000 00110000 110000 010000 10000 0--120000 00100000 100000 10000 0---130000 0001 10000 010000 00----140000 0001 00000 00-----150000 0000 1------
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 8 – total_zeros tables for 4x4 blocks with tzVlcIndex 8 to 15
total_zerostzVlcIndex8910111213141500000 010000 010000 100000000000000100010000 000000 00001000100101120000 100010010010111-30111111010101--41110101001---51000101011----6010010001-----70010000 1------80000 00-------
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 9 – total_zeros tables for chroma DC 2x2 and 2x4 blocks
(a) Chroma DC 2x2 block (4:2:0 chroma sampling)
total_zerostzVlcIndex1230111101010200100-3000--
(b) Chroma DC 2x4 block (4:2:2 chroma sampling)
total_zerostzVlcIndex12345670100000011000000101001001000101120110010101101-30010100101011--40011101110111---50001110111----60000 1111-----70000 0------
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 10 – Tables for run_before
run_before
zerosLeft123456>60111111111111110011010100001102-0001010110011013--000010100111004---0000010100115----0001010106-----1000017------00018-----000019------00000110------000000111------0000000112------00000000113------000000000114------00000000001
Combining level and run information
Input to this process are a list of transform coefficient levels called level, a list of runs called run, and the number of non-zero transform coefficient levels TotalCoeff( coeff_token ).
Output of this process is an list coeffLevel of transform coefficient levels.
A variable coeffNum is set equal to -"1 and an index i is set equal to ( TotalCoeff( coeff_token ) " 1 ). The following procedure is iteratively applied TotalCoeff( coeff_token ) times:
coeffNum is incremented by run[ i ] + 1.
coeffLevel[ coeffNum ] is set equal to level[ i ].
The index i is decremented by 1.
CABAC parsing process for slice data
This process is invoked when parsing syntax elements with descriptor ae(v) in subclauses REF _Ref18822303 \r \h 7.3.4 and REF _Ref18822306 \r \h 7.3.5 when entropy_coding_mode_flag is equal to 1.
Inputs to this process are a request for a value of a syntax element and values of prior parsed syntax elements.
Output of this process is the value of the syntax element.
When starting the parsing of the slice data of a slice in subclause REF _Ref18822303 \r \h 7.3.4, the initialisation process of the CABAC parsing process is invoked as specified in subclause REF _Ref25144069 \r \h 9.3.1.
The parsing of syntax elements proceeds as follows:
For each requested value of a syntax element a binarization is derived as described in subclause REF _Ref25130957 \r \h 9.3.2.
The binarization for the syntax element and the sequence of parsed bins determines the decoding process flow as described in subclause REF _Ref24888116 \r \h 9.3.3.
For each bin of the binarization of the syntax element, which is indexed by the variable binIdx, a context index ctxIdx is derived as specified in subclause REF _Ref24994337 \r \h 9.3.3.1.
For each ctxIdx the arithmetic decoding process is invoked as specified in subclause REF _Ref24877878 \r \h 9.3.3.2.
The resulting sequence ( b0 .. bbinIdx ) of parsed bins is compared to the set of bin strings given by the binarization process after decoding of each bin. When the sequence matches a bin string in the given set, the corresponding value is assigned to the syntax element.
In case the request for a value of a syntax element is processed for the syntax element mb_type and the decoded value of mb_type is equal to I_PCM, the decoding engine is initialised after the decoding of any pcm_alignment_zero_bit and all pcm_sample_luma and pcm_sample_chroma data as specified in subclause REF _Ref36140755 \r \h 9.3.1.2.
The whole CABAC parsing process is illustrated in the flowchart of REF _Ref27685218 \h \* MERGEFORMAT Figure 91 with the abbreviation SE for syntax element.
EMBED Visio.Drawing.6
Figure STYLEREF 1 \s 9 SEQ Figure \* ARABIC \s 1 1 – Illustration of CABAC parsing process for a syntax element SE (informative)
Initialisation process
Outputs of this process are initialised CABAC internal variables.
The processes in subclauses REF _Ref24881362 \r \h 9.3.1.1 and REF _Ref36140755 \r \h 9.3.1.2 are invoked when starting the parsing of the slice data of a slice in subclause REF _Ref18822303 \r \h 7.3.4.
The process in subclause REF _Ref36140755 \r \h 9.3.1.2 is also invoked after decoding any pcm_alignment_zero_bit and all pcm_sample_luma and pcm_sample_chroma data for a macroblock of type I_PCM.
Initialisation process for context variables
Outputs of this process are the initialised CABAC context variables indexed by ctxIdx.
Tables REF tab_9_12 \h 912 REF _Ref34017613 \h Table 912 to REF tab_9_33 \h 933 REF _Ref167199169 \h Table 933 contain the values of the variables n and m used in the initialisation of context variables that are assigned to all syntax elements in subclauses REF _Ref18822303 \r \h 7.3.4 and REF _Ref18822306 \r \h 7.3.5 except for the end-of-slice flag.
For each context variable, the two variables pStateIdx and valMPS are initialised.
NOTE 1 – The variable pStateIdx corresponds to a probability state index and the variable valMPS corresponds to the value of the most probable symbol as further described in subclause REF _Ref24877878 \r \h 9.3.3.2.
The two values assigned to pStateIdx and valMPS for the initialisation are derived from SliceQPY, which is derived in Equation REF QPYatSliceLevel_Eqn \h 7-29. Given the two table entries ( m, n ), the initialisation is specified by the following pseudo-code process:
preCtxState = Clip3( 1, 126, ( ( m ( Clip3( 0, 51, SliceQPY ) ) >> 4 ) + n )
if( preCtxState <= 63 ) {
pStateIdx = 63 -" preCtxState
valMPS = 0 ( STYLEREF 1 \s 9- SEQ Equation \* ARABIC 5)
} else {
pStateIdx = preCtxState -" 64
valMPS = 1
}
In REF _Ref205322822 \h Table 911 REF _Ref180840773 \h Table 911, the ctxIdx for which initialisation is needed for each of the slice types are listed. Also listed is the table number that includes the values of m and n needed for the initialisation. For P, SP and B slice type, the initialisation depends also on the value of the cabac_init_idc syntax element. Note that the syntax element names do not affect the initialisation process.
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 11 – Association of ctxIdx and syntax elements for each slice type in the initialisation process
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 11 – Association of ctxIdx and syntax elements for each slice type in the initialisation processSyntax elementTableSlice typeSIIP, SPBslice_data( )mb_skip_flag REF _Ref36574388 \h \* MERGEFORMAT Table 913 REF _Ref36574391 \h \* MERGEFORMAT Table 91411..1324..26mb_field_decoding_flag REF _Ref36574370 \h \* MERGEFORMAT Table 91870..7270..7270..7270..72macroblock_layer( )mb_type REF _Ref34017613 \h \* MERGEFORMAT Table 912 REF _Ref36574388 \h \* MERGEFORMAT Table 913 REF _Ref36574391 \h \* MERGEFORMAT Table 9140..103..1014..2027..35transform_size_8x8_flag REF _Ref36574664 \h \* MERGEFORMAT Table 916na399..401399..401399..401coded_block_pattern (luma) REF _Ref36574370 \h \* MERGEFORMAT Table 91873..7673..7673..7673..76coded_block_pattern (chroma) REF _Ref36574370 \h \* MERGEFORMAT Table 91877..8477..8477..8477..84mb_qp_delta REF _Ref36574636 \h \* MERGEFORMAT Table 91760..6360..6360..6360..63mb_pred( )prev_intra4x4_pred_mode_flag REF _Ref36574636 \h \* MERGEFORMAT Table 91768686868rem_intra4x4_pred_mode REF _Ref36574636 \h \* MERGEFORMAT Table 91769696969prev_intra8x8_pred_mode_flag REF _Ref36574636 \h \* MERGEFORMAT Table 917na686868rem_intra8x8_pred_mode REF _Ref36574636 \h \* MERGEFORMAT Table 917na696969intra_chroma_pred_mode REF _Ref36574636 \h \* MERGEFORMAT Table 91764..6764..6764..6764..67mb_pred( ) andsub_mb_pred( )ref_idx_l0 REF _Ref36574664 \h \* MERGEFORMAT Table 91654..5954..59ref_idx_l1 REF _Ref36574664 \h \* MERGEFORMAT Table 91654..59mvd_l0[ ][ ][ 0 ] REF _Ref36574397 \h \* MERGEFORMAT Table 91540..4640..46mvd_l1[ ][ ][ 0 ] REF _Ref36574397 \h \* MERGEFORMAT Table 91540..46mvd_l0[ ][ ][ 1 ] REF _Ref36574397 \h \* MERGEFORMAT Table 91547..5347..53mvd_l1[ ][ ][ 1 ] REF _Ref36574397 \h \* MERGEFORMAT Table 91547..53sub_mb_pred( )sub_mb_type[ ] REF _Ref36574388 \h \* MERGEFORMAT Table 913
REF _Ref36574391 \h \* MERGEFORMAT Table 91421..2336..39residual_block_cabac( )coded_block_flag REF _Ref36574370 \h \* MERGEFORMAT Table 918 REF _Ref167199143 \h \* MERGEFORMAT Table 925 REF _Ref167199169 \h \* MERGEFORMAT Table 93385..104460..48385..104460..4831012..102385..104460..4831012..102385..104460..4831012..1023significant_coeff_flag[ ] REF _Ref36574690 \h \* MERGEFORMAT Table 919 REF _Ref36574703 \h \* MERGEFORMAT Table 922 REF _Ref81394949 \h \* MERGEFORMAT Table 924 REF _Ref81394949 \h \* MERGEFORMAT Table 924 REF _Ref205322823 \h \* MERGEFORMAT Table 926 REF _Ref167199244 \h \* MERGEFORMAT Table 926 REF _Ref205322824 \h \* MERGEFORMAT Table 930 REF _Ref167199253 \h \* MERGEFORMAT Table 930 REF _Ref167199258 \h \* MERGEFORMAT Table 928 REF _Ref167199262 \h \* MERGEFORMAT Table 929105..165277..337105..165277..337402..416436..450484..571776..863660..689718..747105..165277..337402..416436..450484..571776..863660..689718..747105..165277..337402..416436..450484..571776..863660..689718..747last_significant_coeff_flag[ ] REF _Ref36574720 \h \* MERGEFORMAT Table 920 REF _Ref36202580 \h \* MERGEFORMAT Table 923 REF _Ref81394949 \h \* MERGEFORMAT Table 924 REF _Ref81394949 \h \* MERGEFORMAT Table 924 REF _Ref205322827 \h \* MERGEFORMAT Table 927 REF _Ref167199370 \h \* MERGEFORMAT Table 927 REF _Ref167199374 \h \* MERGEFORMAT Table 931 REF _Ref205322828 \h \* MERGEFORMAT Table 931 REF _Ref167199258 \h \* MERGEFORMAT Table 928 REF _Ref167199262 \h \* MERGEFORMAT Table 929166..226338..398166..226338..398417..425451..459572..659864..951690..707748..765166..226338..398417..425451..459572..659864..951690..707748..765166..226338..398417..425451..459572..659864..951690..707748..765coeff_abs_level_minus1[ ] REF _Ref36574749 \h \* MERGEFORMAT Table 921 REF _Ref81394949 \h \* MERGEFORMAT Table 924 REF _Ref167199454 \h \* MERGEFORMAT Table 932 REF _Ref167199258 \h \* MERGEFORMAT Table 928 REF _Ref167199262 \h \* MERGEFORMAT Table 929227..275227..275426..435952..1011708..717766..775227..275426..435952..1011708..717766..775227..275426..435952..1011708..717766..775
NOTE 2 – ctxIdx equal to 276 is associated with the end_of_slice_flag and the bin of mb_type, which specifies the I_PCM macroblock type. The decoding process specified in subclause REF _Ref33020388 \r \h 9.3.3.2.4 applies to ctxIdx equal to 276. This decoding process, however, may also be implemented by using the decoding process specified in subclause REF _Ref33021086 \r \h 9.3.3.2.1. In this case, the initial values associated with ctxIdx equal to 276 are specified to be pStateIdx = 63 and valMPS = 0, where pStateIdx = 63 represents a non-adapting probability state.
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 12 – Values of variables m and n for ctxIdx from 0 to 10
Initialisation variablesctxIdx012345678910m20232023-"28-"23-"6-"17n-"155474-"155474127104535451
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 13 Values of variables m and n for ctxIdx from 11 to 23
Value of cabac_init_idcInitialisation variablesctxIdx111213141516171819202122230m23232110-"375-"13-"11112-"417n3320949118577865624973501m223416-"24-"292-"6-"1359-"310n2500941118657179525070542m292514-"10-"3-"2726-"4-"2456-"1714n1600516299168510257577357
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 14 – Values of variables m and n for ctxIdx from 24 to 39
Value of cabac_init_idcInitialisation variablesctxIdx242526272829303132333435363738390m1892926169-"46-"201-"13-"111-"6-"17-"69n64430679010412710467786562869561451m261940574126-"45-"15-"4-"6-"1356-"1308n342202366912710176717952699052432m202029543712-"32-"22-"2-"4-"245-"6-"14-"64n401000429712711774851025793884455
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 15 Values of variables m and n for ctxIdx from 40 to 53
Value of cabac_init_idcInitialisation variablesctxIdx40414243444546474849505152530m-"3-"6-"1167-"520-"3-"1054-"30n69819655678688587694546981881m-"2-"5-"102 2-"3-"31-"3-"60-"3-"7-"5n698296597587100567485598186952m-"11-"15-"211920461-"5-"1356-"3-"1n89103116575884966385106637590101
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 16 Values of variables m and n for ctxIdx from 54 to 59, and 399 to 401
Value of cabac_init_idcInitialisation variablesctxIdx545556575859399400401I slicesmnananananana313125nnananananana2131500m"7"5"4"5"71121114n6774748072584051591m"1"11"2"50252121n6677708672613249542m3"4"2"12"71211917n557975975060335061
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 17 Values of variables m and n for ctxIdx from 60 to 69
Initialisation variablesctxIdx60616263646566676869m0000-"940-"7133n41636363838697724162
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 18 – Values of variables m and n for ctxIdx from 70 to 104
ctxIdxI and SI slicesValue of cabac_init_idcctxIdxI and SI slicesValue of cabac_init_idc012012mnmnmnmnmnmnmnmn70011045131573488-"11115-"13108-"49257871155-"478751-"98889-"1263-"346039-"65572069-"396280-"2012790-"268-"16506546173-"17127-"27126-"39127-"3612791-"1584-"157-"1584-"148374-"13102-"2898-"1891-"179192-"13104-"993-"35127-"3712775082-"25101-"1796-"149593-"370-"374-"273-"57976-"774-"2367-"2681-"258494-"893-"992-"12104-"1110477-"21107-"2882-"3598-"258695-"1090-"887-"991-"119178-"27127-"2094-"24102-"128996-"30127-"23126-"31127-"3012779-"31127-"1683-"2397-"179197-"17455435506580-"24127-"22110-"27119-"3112798-"697660756-"27981-"1895-"2191-"2499-"147699-"79165975507282-"27127-"18102-"21110-"18103100-"20127669861-"49283-"21114-"1393-"18102-"1390101-"456-"148-"353-"65684-"30127-"29127-"36127-"37127102-"58206806836885-"17123-"7920801180103-"776-"469-"774-"87186-"12115-"589-"589576104-"22125-"888-"988-"139887-"16122-"796-"794284
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 19 Values of variables m and n for ctxIdx from 105 to 165
ctxIdxI and SI slicesValue of cabac_init_idcctxIdxI and SI slicesValue of cabac_init_idc012012mnmnmnmnmnmnmnmn105-"793-"285-"13103-"486136-"13101553058-"575106-"1187-"678-"1391-"1288137-"1391-"261-"160-"880107-"377-"175-"989-"582138-"1294056-"361-"2183108-"571-"777-"1492-"372139-"1088056-"867-"2164109-"463254-"876-"467140-"1684-"1363-"2584-"1331110-"468550-"1287-"872141-"1086-"560-"1474-"2564111-"1284-"368-"23110-"1689142-"783-"162-"565-"2994112-"762150-"24105-"969143-"1387457552975113-"765642-"1078-"159144-"1994-"6692571763114861-"481-"20112566145170457061-"874115556163-"17994571460721439-"969-"535116-"266-"470-"78127-"471147-"574451-"1170-"227117164067-"70127-"2711481859136818551391118061257-"50127258149-"8102364-"471365119-"278-"276-"46127-"174150-"15100161058-"7691201501135-"466-"444151095963761877121752464-"578-"169152-"475750941-"10661221035161-"471062153272163918253621230441135-"872-"751154-"1175544932-"36812411381825259-"447155-"371452543-"20811251451224-"155-"642156154611489470301260461329-"770-"341157-"1369-"560044171275441336-"675-"653158062-"159051-"3231283117-"1093-"889876159065059246-"2174129151-"773-"34119-"9781602137223319381666130750-"273-"375-"1183161-"1572544-"466-"23124131281913463220952162957144315381737132163394930220671631654-"178124244-"181331462-"7100-"44127-"59016406206093450-"34134-"131089530541671651272969089-"22127135-"15100253-"561-"1572
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 20 Values of variables m and n for ctxIdx from 166 to 226
ctxIdxI and SI slicesValue of cabac_init_idcctxIdxI and SI slicesValue of cabac_init_idc012012mnmnmnmnmnmnmnmn166240112844543919726-"1728336-"2828-"3167159240102804219830-"2528438-"282410168825344103173419928-"2032038-"27270169131804933-"11112920033-"2334-"134-"1834-"1417015904652-"4383120137-"2730635-"1652-"441711319244181563720233-"2330634-"1439-"24172103725128074220340-"2832932-"81917173121804735-"2234020438-"17311937-"6312517462943938-"2583320533-"11262735036291752033262340134320640-"15263030102433176153064639-"18133620741-"637202818341517744505432-"12447208381283426253020178158354102-"9435520941171770294122731790622580025821030-"6167075203418076146356-"156602112735592721931181123865133-"48442122622967877274418211456572910114421337-"16163014351916183153975337-"5144221435-"4183218311536184114265251-"2974821538-"8183517351536185134465539-"945621638-"32229213021281861645114552-"344522173732431174525211871241143669-"581337218385233820423020188104985367-"639492194201843184531121893034-"18244-"5195822035162041272627161901842755327104822139221163165424421911055-"37855-"291245222144895976609319217511546321069223273796416561456193174622310020332242160-"19411731557194089-"18427368632251268-"2891067263819526-"1925733-"2535-"18226297-"9108-"10116-"2412719622-"1730-"734-"3033-"25
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 21 Values of variables m and n for ctxIdx from 227 to 275
ctxIdxI and SI slicesValue of cabac_init_idcctxIdxI and SI slicesValue of cabac_init_idc012012mnmnmnmnmnmnmnmn227-"371-"676-"23112-"24115252-"1273-"655-"1672-"1475228-"642-"244-"1571-"2282253-"876058-"769-"1079229-"550045-"761-"962254-"780064-"469-"983230-"354052053053255-"988-"374-"574-"1292231-"262-"364-"566059256-"17110-"1090-"986-"18108232058-"259-"1177-"1485257-"1197070266-"479233163-"470-"980-"1389258-"2084-"429-"934-"2269234-"272-"475-"984-"1394259-"1179531132-"1675235-"174-"882-"1087-"1192260-"6737421131-"258236-"991-"17102-"34127-"29127261-"474159552158237-"567-"977-"21101-"21100262-"1386-"258-"255-"1378238-"527324-"339-"1457263-"1396-"372-"267-"983239-"339042-"553-"1267264-"1197-"381073-"481240-"244048-"761-"1171265-"19117-"1197-"889-"1399241046055-"1175-"1077266-"878058352-"1381242-"1664-"659-"1577-"2185267-"5338574-"638243-"868-"771-"1791-"1688268-"4481014108-"1362244-"1078-"1283-"25107-"23104269-"2531418178-"658245-"677-"1187-"25111-"1598270-"36213271619-"259246-"1086-"30119-"28122-"37127271-"1371240337-"1673247-"1292158-"1176-"1082272-"1079058-"161-"1076248-"1555-"329-"1044-"848273-"1286-"370-"573-"1386249-"1060-"136-"1052-"861274-"1390-"679-"170-"983250-"662138-"1057-"866275-"1497-"885-"478-"1087251-"465243-"958-"770
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 22 Values of variables m and n for ctxIdx from 277 to 337
ctxIdxI and SI slicesValue of cabac_init_idcctxIdxI and SI slicesValue of cabac_init_idc012012mnmnmnmnmnmnmnmn277-"693-"13106-"21126-"22127308-"1696-"151-"1677-"1067278-"684-"16106-"23124-"25127309-"788749-"264168279-"879-"1087-"20110-"25120310-"885852261077280066-"21114-"26126-"27127311-"785941-"667264281-"171-"18110-"25124-"19114312-"985647-"364068282062-"1498-"17105-"23117313-"1388255257-"578283-"260-"22110-"27121-"251183144661341-"365755284-"259-"21106-"27117-"26117315-"3771044-"366559285-"575-"18103-"17102-"24113316-"376650062265286-"362-"21107-"26117-"28118317-"6765539511454287-"458-"23108-"27116-"3112031810581349-"1661544288-"966-"26112-"33122-"37124319-"176463-"271560289-"179-"1096-"1095-"1094320-"183664-"275270290071-"1295-"14100-"15102321-"799-"269-"170-"276291368-"591-"895-"1099322-"1495-"259-"972-"18862921044-"993-"17111-"1310632329567014601270293-"762-"2294-"28114-"50127324076104416375642941536-"586-"689-"592325-"574931047-"12702951440967-"28017573260701243183511552961627-"480-"482-"586327-"117535311375562971229-"1085-"985-"139432816814341241069298144-"170-"881-"1291329065103810412652992036760-"172-"277330-"1473-"352248-"674300183295856407133136213401241554301542561167-"173332462173213417543021481250956464333-"168744059-"67630310621550069-"781334-"1375738350-"118230417461849169564335115513501940-"277305964175476915573365641057366-"277306-"121041041-"7691673371270264318502542307-"1197746-"667068
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 23 Values of variables m and n for ctxIdx from 338 to 398
ctxIdxI and SI slicesValue of cabac_init_idcctxIdxI and SI slicesValue of cabac_init_idc012012mnmnmnmnmnmnmnmn338156141119-"617-"1336932-"2631-"440-"3737-"17339619111418-"616-"937037-"3027638-"3032134071691114017-"1237144-"3234846-"3334153411214181126-"1227-"2137234-"18301042-"302915342181321931-"1637-"3037334-"15242240-"242425343131123-"233-"2541-"4037440-"15331949-"293422344131532-"1533-"2242-"4137533-"7223238-"123116345151632-"1537-"2848-"4737635-"5263140-"103518346122334-"2139-"3039-"32377330214138-"33128347132339-"2342-"3046-"40378382264446-"53341348152042-"3347-"4252-"513793313234731203628349142641-"3145-"3646-"413802335166529302747350144446-"2849-"3452-"393811358147125442162351174038-"1241-"1743-"1938229-"38601248183135217472129329321138326066311491926353241745-"2469-"7161-"553842230176526453624354212153-"4563-"6356-"4638531-"7212422222423355252248-"2666-"6462-"5038635-"15232023222716356312765-"4377-"7481-"6738734-"3262327212430357222943-"1954-"3945-"20388343273233203129358193539-"1052-"3535-"238936-"1282326282241359145030941-"102815390345282430242242360105718263603413913211234027341660361763202740-"1391392355243218421552362-"277057301430173933412282925391460363-"482-"148228262038394391123421850378364-"394-"57523371845395302919571270-"16123365969-"1997125515543963426225321542153366-"12109-"351251165079397293922611471225636736-"3527037-"3336-"16398196611861183256136836-"3428039-"3637-"14
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 24 – Values of variables m and n for ctxIdx from 402 to 459
ctxIdxI slicesValue of cabac_init_idcctxIdxI slicesValue of cabac_init_idc012012mnmnmnmnmnmnmnmn402"17120"479"585"378431"255"1256"957"1259403"20112"771"681"874432061"660"663"863404"18114"569"1077"972433164"562"465"967405"1185"970"781"1072434068"866"467"668406"1592"866"1780"1875435"992-"876-"782-"1079407"1489"1068"1873"1271436"14106"585"381"378408"2671"1973"474"1163437"1397"681"376"874409"1581"1269"1083"570438"1590"1077"772"972410"1480"1670"971"1775439"1290"781"678"1072411068-"1567-"967-"1472440"1888"1780"1272"1875412"1470-"2062-"161-"1667441"1073"1873"1468"1271413"2456-"1970-"866-"853442"979"474"370"1163414"2368-"1666-"1466-"1459443"1486"1083"676"570415"2450-"2265059-"952444"1073"971"566"1775416-"1174-"2063259-"1168445"1070-"967-"562-"147241723-"139-"217-"109-"2446"1069-"161057-"166741826-"1326-"932-"1330-"10447"566-"866-"461-"85341940-"1533-"942-"931-"4448"964-"1466-"960-"145942049-"1439-"749-"533-"1449"558059154-"95242144341-"2530337450259259258-"1168422456453643311245121-"1021-"1317-"109-"242344344996810372345224-"1133-"1432-"1330-"10424335445276627313845328-"839-"742-"931-"4425198236594757206445428-"146-"249-"533-"1426"375"666"571"971455293512530337427"123"735024"7374562996066433112428134-"742-"136-"8444573520611768103723429143-"845-"242-"11494582936553466273138430054-"548-"252-"10564591467426247572064
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 25 Values of variables m and n for ctxIdx from 460 to 483
ctxIdxI and SI slicesValue of cabac_init_idcctxIdxI and SI slicesValue of cabac_init_idc012012mnmnmnmnmnmnmnmn460-"17123-"7920801180472-"17123-"7920801180461-"12115-"589-"589576473-"12115-"589-"589576462-"16122-"796-"794284474-"16122-"796-"794284463-"11115-"13108-"492578475-"11115-"13108-"492578464-"1263-"346039-"655476-"1263-"346039-"655465-"268-"165065461477-"268-"165065461466-"1584-"157-"1584-"1483478-"1584-"157-"1584-"1483467-"13104-"993-"35127-"37127479-"13104-"993-"35127-"37127468-"370-"374-"273-"579480-"370-"374-"273-"579469-"893-"992-"12104-"11104481-"893-"992-"12104-"11104470-"1090-"887-"991-"1191482-"1090-"887-"991-"1191471-"30127-"23126-"31127-"30127483-"30127-"23126-"31127-"30127
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 26 Values of variables m and n for ctxIdx from 484 to 571
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 26 – Values of variables m and n for ctxIdx from 484 to 571ctxIdxI and SI slicesValue of cabac_init_idcctxIdxI and SI slicesValue of cabac_init_idc012012mnmnmnmnmnmnmnmn484-"793-"285-"13103-"486528-"793-"285-"13103-"486485-"1187-"678-"1391-"1288529-"1187-"678-"1391-"1288486-"377-"175-"989-"582530-"377-"175-"989-"582487-"571-"777-"1492-"372531-"571-"777-"1492-"372488-"463254-"876-"467532-"463254-"876-"467489-"468550-"1287-"872533-"468550-"1287-"872490-"1284-"368-"23110-"1689534-"1284-"368-"23110-"1689491-"762150-"24105-"969535-"762150-"24105-"969492-"765642-"1078-"159536-"765642-"1078-"159493861-"481-"20112566537861-"481-"20112566494556163-"1799457538556163-"1799457495-"266-"470-"78127-"471539-"266-"470-"78127-"471496164067-"70127-"271540164067-"70127-"271497061257-"50127258641061257-"50127258498-"278-"276-"46127-"174542-"278-"276-"46127-"1744991501135-"466-"4445431501135-"466-"444500752464-"578-"169544752464-"578-"1695011035161-"4710625451035161-"4710625020441135-"872-"7515460441135-"872-"75150311381825259-"44754711381825259-"4475041451224-"155-"6425481451224-"155-"6425050461329-"770-"3415490461329-"770-"3415065441336-"675-"6535505441336-"675-"6535073117-"1093-"8898765513117-"1093-"889876508151-"773-"34119-"978552151-"773-"34119-"978509750-"273-"375-"1183553750-"273-"375-"118351028191346322095255428191346322095251116339493022067555163394930220675121462-"7100-"44127-"5905561462-"7100-"44127-"590513-"13108953054167557-"13108953054167514-"15100253-"561-"1572558-"15100253-"561-"1572515-"13101553058-"575559-"13101553058-"575516-"1391-"261-"160-"880560-"1391-"261-"160-"880517-"1294056-"361-"2183561-"1294056-"361-"2183518-"1088056-"867-"2164562-"1088056-"867-"2164519-"1684-"1363-"2584-"1331563-"1684-"1363-"2584-"1331520-"1086-"560-"1474-"2564564-"1086-"560-"1474-"2564521-"783-"162-"565-"2994565-"783-"162-"565-"2994522-"1387457552975566-"1387457552975523-"1994-"6692571763567-"1994-"6692571763524170457061-"874568170457061-"8745250721439-"969-"5355690721439-"969-"535526-"574451-"1170-"227570-"574451-"1170-"22752718591368185513915711859136818551391
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 27 Values of variables m and n for ctxIdx from 572 to 659
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 27 – Values of variables m and n for ctxIdx from 572 to 659ctxIdxI and SI slicesValue of cabac_init_idcctxIdxI and SI slicesValue of cabac_init_idc012012mnmnmnmnmnmnmnmn572240112844543961624011284454395731592401028042617159240102804257482534410317346188253441031734575131804933-"111129619131804933-"11112957615904652-"4383162015904652-"43831577131924418156376211319244181563757810372512807426221037251280742579121804735-"22340623121804735-"2234058062943938-"2583362462943938-"258335812033262340134362520332623401343582153064639-"181336626153064639-"18133658344505432-"1244762744505432-"12447584158354102-"94355628158354102-"94355585062258002586290622580025858676146356-"1566063076146356-"15660587123865133-"4844631123865133-"4844588114565729101144632114565729101144589153975337-"51442633153975337-"51442590114265251-"29748634114265251-"29748591134465539-"9456635134465539-"94565921645114552-"344526361645114552-"344525931241143669-"5813376371241143669-"581337594104985367-"63949638104985367-"639495953034-"18244-"519586393034-"18244-"5195859618427553271048640184275532710485971055-"37855-"2912456411055-"37855-"29124559817511546321069642175115463210695991746223100203364317462231002033600089-"1842736863644089-"184273686360126-"1925733-"2535-"1864526-"1925733-"2535-"1860222-"1730-"734-"3033-"2564622-"1730-"734-"3033-"2560326-"1728336-"2828-"364726-"1728336-"2828-"360430-"2528438-"28241064830-"2528438-"28241060528-"2032038-"2727064928-"2032038-"2727060633-"2334-"134-"1834-"1465033-"2334-"134-"1834-"1460737-"2730635-"1652-"4465137-"2730635-"1652-"4460833-"2330634-"1439-"2465233-"2330634-"1439-"2460940-"2832932-"8191765340-"2832932-"8191761038-"17311937-"6312565438-"17311937-"6312561133-"112627350362965533-"112627350362961240-"1526303010243365640-"1526303010243361341-"637202818341565741-"637202818341561438128342625302065838128342625302061541171770294122736594117177029412273
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 28 – Values of variables m and n for ctxIdx from 660 to 717
ctxIdxI slicesValue of cabac_init_idcctxIdxI slicesValue of cabac_init_idc012012mnmnmnmnmnmnmnmn660"17120"479"585"378689259259258-"1168661"20112"771"681"87469023-"139-"217-"109-"2662"18114"569"1077"97269126-"1326-"932-"1330-"10663"1185"970"781"107269240-"1533-"942-"931-"4664"1592"866"1780"187569349-"1439-"749-"533-"1665"1489"1068"1873"127169444341-"2530337666"2671"1973"474"11636954564536433112667"1581"1269"1083"570696443449968103723668"1480"1670"971"17756973354452766273138669068-"1567-"967-"14726981982365947572064670"1470-"2062-"161-"166769921-"1021-"1317-"109-"2671"2456-"1970-"866-"85370024-"1133-"1432-"1330-"10672"2368-"1666-"1466-"145970128-"839-"742-"931-"4673"2450-"2265059-"95270228-"146-"249-"533-"1674-"1174-"2063259-"1168703293512530337675"14106"585"381"3787042996066433112676"1397"681"376"8747053520611768103723677"1590"1077"772"9727062936553466273138678"1290"781"678"10727071467426247572064679"18881780"1272"1875708"375"666"571"971680"1073"1873"1468"1271709"123"735024"737681"979"474"370"1163710134-"742-"136-"844682"1486"1083"676"570711143-"845-"242-"1149683"1073"971"566"1775712054-"548-"252-"1056684"1070-"967-"562-"1472713"255"1256"957"1259685"1069-"161057-"1667714061"660"663"863686"566-"866-"461-"853715164"562"465"967687"964-"1466-"960-"1459716068"866"467"668688"558059154-"952717"992-"876-"782-"1079
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 29 Values of variables m and n for ctxIdx from 718 to 775
ctxIdxI slicesValue of cabac_init_idcctxIdxI slicesValue of cabac_init_idc012012mnmnmnmnmnmnmnmn718"17120"479"585"378747259259258-"1168719"20112"771"681"87474823-"139-"217-"109-"2720"18114"569"1077"97274926-"1326-"932-"1330-"10721"1185"970"781"107275040-"1533-"942-"931-"4722"1592"866"1780"187575149-"1439-"749-"533-"1723"1489"1068"1873"127175244341-"2530337724"2671"1973"474"11637534564536433112725"1581"1269"1083"570754443449968103723726"1480"1670"971"17757553354452766273138727068-"1567-"967-"14727561982365947572064728"1470-"2062-"161-"166775721-"1021-"1317-"109-"2729"2456-"1970-"866-"85375824-"1133-"1432-"1330-"10730"2368-"1666-"1466-"145975928-"839-"742-"931-"4731"2450-"2265059-"95276028-"146-"249-"533-"1732-"1174-"2063259-"1168761293512530337733"14106"585"381"3787622996066433112734"1397"681"376"8747633520611768103723735"1590"1077"772"9727642936553466273138736"1290"781"678"10727651467426247572064737"1888"1780"1272"1875766"375"666"571"971738"1073"1873"1468"1271767"123"735024"737739"979"474"370"1163768134-"742-"136-"844740"1486"1083"676"570769143-"845-"242-"1149741"1073"971"566"1775770054-"548-"252-"1056742"1070-"967-"562-"1472771"255"1256"957"1259743"1069-"161057-"1667772061"660"663"863744"566-"866-"461-"853773164"562"465"967745"964-"1466-"960-"1459774068"866"467"668746"558059154-"952775"992-"876-"782-"1079
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 30 Values of variables m and n for ctxIdx from 776 to 863
Table STYLEREF 1 \s 9 SEQ Table \* ARABIC \s 1 30 – Values of variables m and n for ctxIdx from 776 to 863ctxIdxI and SI slicesValue of cabac_init_idcctxIdxI and SI slicesValue of cabac_init_idc012012mnmnmnmnmnmnmnmn776-"693-"13106-"21126-"22127820-"693-"13106-"21126-"22127777-"684-"16106-"23124-"25127821-"684-"16106-"23124-"25127778-"879-"1087-"20110-"25120822-"879-"1087-"20110-"25120779066-"21114-"26126-"27127823066-"21114-"26126-"27127780-"171-"18110-"25124-"19114824-"171-"18110-"25124-"19114781062-"1498-"17105-"23117825062-"1498-"17105-"23117782-"260-"22110-"27121-"25118826-"260-"22110-"27121-"25118783-"259-"21106-"27117-"26117827-"259-"21106-"27117-"26117784-"575-"18103-"17102-"24113828-"575-"18103-"17102-"24113785-"362-"21107-"26117-"28118829-"362-"21107-"26117-"28118786-"458-"23108-"27116-"31120830-"458-"23108-"27116-"31120787-"966-"26112-"33122-"37124831-"966-"26112-"33122-"37124788-"179-"1096-"1095-"1094832-"179-"1096-"1095-"1094789071-"1295-"14100-"15102833071-"1295-"14100-"15102790368-"591-"895-"1099834368-"591-"895-"10997911044-"993-"17111-"131068351044-"993-"17111-"13106792-"762-"2294-"28114-"50127836-"762-"2294-"28114-"501277931536-"586-"689-"5928371536-"586-"689-"5927941440967-"28017578381440967-"28017577951627-"480-"482-"5868391627-"480-"482-"5867961229-"1085-"985-"13948401229-"1085-"985-"1394797144-"170-"881-"1291841144-"170-"881-"12917982036760-"172-"2778422036760-"172-"27779918329585640718431832958564071800542561167-"173844542561167-"1738011481250956464845148125095646480210621550069-"78184610621550069-"78180317461849169564847174618491695648049641754769155784896417547691557805-"121041041-"769167849-"121041041-"769167806-"1197746-"667068850-"1197746-"667068807-"1696-"151-"1677-"1067851-"1696-"151-"1677-"1067808-"788749-"264168852-"788749-"264168809-"885852261077853-"