メインコンテンツまでスキップ

3. Conventions Used in This Document

この節では APV の RFC テキストを保持し, bitstream syntax, syntax element processing, decoding and parsing processes, metadata, profiles, levels, bands, raw bitstream format, implementation references を扱う.

RFC 原文​

3.  Conventions Used in This Document

3.1.  General

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
   "OPTIONAL" in this document are to be interpreted as described in
   BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all
   capitals, as shown here.

3.2.  Operators

   The operators and the order of precedence are the same as used in the
   C programming language [ISO9899].  However, there are some exceptions
   for the operators described in the Section 3.2.1 and Section 3.2.2,
   which follows widely used industry practices for video codecs.

3.2.1.  Arithmetic Operators

   //
      an integer division with rounding of the result toward zero.  For
      example, 7//4 and -7//-4 are rounded to 1 and -7//4 and 7//-4 are
      rounded to -1

   / or div(x,y)
      a division in mathematical equations where no truncation or
      rounding is intended

   min(x,y)
      the minimum value of the values x and y

   max(x,y)
      the maximum value of the values x and y

   ceil(x)
      the smallest integer value that is larger than or equal to x

   clip(x,y,z)
      clip(x,y,z)=max(x,min(z,y))

   sum (i=x, y, f(i))
      a summation of f(i) with i taking all integer values from x up to
      and including y

   log2(x)
      the base-2 logarithm of x

3.2.2.  Bitwise Operators

   & (bitwise "and")
      When operating on integer arguments, operates on a two's
      complement representation of the integer value.  When operating on
      arguments with unequal bit depths, the bit depths are equalized by
      adding zeros in significant positions to the argument with lower
      bit depth.

   | (bitwise "or")
      When operating on integer arguments, operates on a two's
      complement representation of the integer value.  When operating on
      arguments with unequal bit depths, the bit depths are equalized by
      adding zeros in significant positions to the argument with lower
      bit depth.

   x >> y
      arithmetic right shift of a two's complement integer
      representation of x by y binary digits.  This function is defined
      only for non-negative integer values of y.  Bits shifted into the
      most significant bits (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 non-
      negative integer values of y.  Bits shifted into the least
      significant bits (LSBs) as a result of the left shift have a value
      equal to 0.

3.3.  Range Notation

   x = y..z
      x takes on integer values starting from y to z, inclusive, with x,
      y, and z being integer numbers and z being greater than y.

3.3.1.  Order of Operations Precedence

   When order of precedence is not indicated explicitly by use of
   parentheses, operations are evaluated in the following order.

   *  Operations of a higher precedence are evaluated before any
      operation of a lower precedence.  Table 1 specifies the precedence
      of operations from highest to lowest; operations closer to the top
      of the table indicate a higher precedence.

   *  Operations of the same precedence are evaluated sequentially from
      left to right.

                +=========================================+
                | operations (with operands x, y, and z)  |
                +=========================================+
                | "x++", "x--"                            |
                +-----------------------------------------+
                | "!x", "-x" (as a unary prefix operator) |
                +-----------------------------------------+
                | x^y (power)                             |
                +-----------------------------------------+
                | "x * y", "x / y", "x // y", "x % y"     |
                +-----------------------------------------+
                | "x + y", "x - y", "sum (i=x, y, f(i))"  |
                +-----------------------------------------+
                | "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", "x -= y"             |
                +-----------------------------------------+

                     Table 1: Operation precedence from
                    highest (top of the table) to lowest
                           (bottom of the table)

3.4.  Variables, Syntax Elements, and Tables

   Each syntax element is described by its name in all lowercase letters
   and its type is provided next to the syntax code in each row.  Each
   syntax element and multi-byte integers are written in big endian
   format.  The decoding process behaves according to the value of the
   syntax element and to the values of previously decoded syntax
   elements.

   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
   uppercase letters and without any underscore characters.  Variables
   with names starting with an uppercase letter are derived for the
   decoding of the current syntax structure and all dependent syntax
   structures.  Variables with names starting with an uppercase letter
   may be used in the decoding process for later syntax structures
   without mentioning the originating syntax structure of the variable.
   Variables with names starting with a lowercase letter are only used
   within the section in which they are derived.

   Functions that specify properties of the current position in the
   bitstream are referred to as syntax functions.  These functions are
   specified in Section 5.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.

   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.  Square brackets are used for the indexing of
   arrays.  In reference to a visual depiction of a matrix, the first
   square bracket is used as a column (horizontal) index and the second
   square bracket is used as a row (vertical) index.

   A specification of values of the entries in rows and columns of an
   array may be denoted by {{...}{...}}, where each inner pair of
   brackets specifies the values of the elements within a row in
   increasing column order and the rows are ordered in increasing row
   order.  Thus, setting a matrix s equal to {{1 6}{4 9}} specifies that
   s[0][0] is set equal to 1, s[1][0] is set equal to 6, s[0][1] is set
   equal to 4, and s[1][1] is set equal to 9.

   Binary notation is indicated by enclosing the string of bit values in
   single quote marks.  For example, '0b01000001' 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.

   A value equal to 0 represents a FALSE condition in a test statement.
   The value TRUE is represented by any value different from zero.

3.5.  Processes

   Processes are used to describe the decoding of syntax elements.  A
   process has a separate specification and invoking.  When invoking a
   process, the 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.

   *  Otherwise (the variables at the invoking and the process
      specification have the same name), the assignment is implied.

   In the specification of a process, a specific coding block is
   referred to by the variable name having a value equal to the address
   of the specific coding block.