One document matched: draft-uberti-payload-vp9-01.xml


<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY rfc2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY rfc3550 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3550.xml">
<!ENTITY rfc3551 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3551.xml">
<!ENTITY rfc3711 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3711.xml">
<!ENTITY rfc3984 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3984.xml">
<!ENTITY rfc4855 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4855.xml">
<!ENTITY rfc4566 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4566.xml">
<!ENTITY rfc4585 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4585.xml">
<!ENTITY rfc6838 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6838.xml">
<!ENTITY vp9 SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.grange-vp9-bitstream.xml">

]>
<rfc category="std" docName="draft-uberti-payload-vp9-01" ipr="trust200902">
  <?rfc symrefs="yes" ?>

  <?rfc sortrefs="yes" ?>

  <!-- alphabetize the references -->

  <?rfc comments="no"?>

  <!-- show comments -->

  <?rfc inline="yes" ?>

  <!-- comments are inline -->

  <?rfc toc="yes" ?>

  <!-- generate table of contents -->

  <front>
    <title abbrev="RTP Payload Format for VP9">RTP Payload Format for VP9
    Video</title>

    <author fullname="Justin Uberti" initials="J." surname="Uberti">
      <organization abbrev="Google">Google, Inc.</organization>

      <address>
        <postal>
          <street>747 6th Street South</street>

          <city>Kirkland</city>

          <region>WA</region>

          <code>98033</code>

          <country>USA</country>
        </postal>
        <email>justin@uberti.name</email>
      </address>
    </author>

    <author fullname="Stefan Holmer" initials="S." surname="Holmer">
      <organization abbrev="Google">Google, Inc.</organization>
       <address>
        <postal>
          <street>Kungsbron 2</street>

          <code>111 22</code>

          <city>Stockholm</city>

          <country>Sweden</country>
        </postal>
      </address>
    </author>

    <author fullname="Magnus Flodman" initials="M." surname="Flodman">
      <organization abbrev="Google">Google, Inc.</organization>
      <address>
        <postal>
          <street>Kungsbron 2</street>

          <code>111 22</code>

          <city>Stockholm</city>

          <country>Sweden</country>
        </postal>
      </address>
    </author>

    <author fullname="Jonathan Lennox" initials="J." surname="Lennox">
      <organization abbrev="Vidyo">Vidyo, Inc.</organization>

      <address>
        <postal>
          <street>433 Hackensack Avenue</street>

          <street>Seventh Floor</street>

          <city>Hackensack</city>

          <region>NJ</region>

          <code>07601</code>

          <country>US</country>
        </postal>

        <email>jonathan@vidyo.com</email>
      </address>
    </author>

     <author fullname="Danny Hong" initials="D." surname="Hong">
      <organization abbrev="Vidyo">Vidyo, Inc.</organization>

      <address>
        <postal>
          <street>433 Hackensack Avenue</street>

          <street>Seventh Floor</street>

          <city>Hackensack</city>

          <region>NJ</region>

          <code>07601</code>

          <country>US</country>
        </postal>

        <email>danny@vidyo.com</email>
      </address>
    </author>

    <date/>

    <area>RAI</area>

    <workgroup>Payload Working Group</workgroup>

    <keyword>RFC</keyword>

    <keyword>Request for Comments</keyword>

    <keyword>RTP</keyword>

    <keyword>VP9</keyword>

    <keyword>WebM</keyword>

    <abstract>
      <t>This memo describes an RTP payload format for the VP9 video codec.
      The payload format has wide applicability, as it supports applications
      from low bit-rate peer-to-peer usage, to high bit-rate video
      conferences.  It includes provisions for temporal and spatial scalability.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="intro" title="Introduction">
      <t>This memo describes an RTP payload specification applicable to the
      transmission of video streams encoded using the VP9 video codec <xref
      target="I-D.grange-vp9-bitstream"/>. The format described in this document can be used
      both in peer-to-peer and video conferencing applications.</t>

      <t>TODO: VP9 description.  Please see <xref
      target="I-D.grange-vp9-bitstream"/>.</t>
    </section>

    <section anchor="conventions"
             title="Conventions, Definitions and Acronyms">
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
      "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
      document are to be interpreted as described in <xref
      target="RFC2119"/>.</t>
    </section>

    <section anchor="mediaFormatDescription" title="Media Format Description">
      <t>The VP9 codec can maintain up to eight reference frames, of
      which up to three can be referenced or updated by any new frame.</t>

      <t>VP9 also allows a reference frame to be resampled and used as a
      reference for another frame of a different resolution.  This
      allows internal resolution changes without requiring the use of
      key frames.</t>

      <t>These features together enable an encoder to
      implement various forms of coarse-grained scalability,
      including temporal, spatial and quality scalability modes, as
      well as combinations of these, without the need for explicit
      scalable coding tools.</t>

      <t>Temporal layers define different frame rates of video;
      spatial and quality layers define different and possibly dependent
      representations of a single input frame.  Spatial layers allow
      a frame to be encoded at different resolutions, whereas
      quality layers allow a frame to be encoded at the same
      resolution but at different qualities (and thus with different
      amounts of coding error).  VP9 supports quality layers as
      spatial layers without any resolution changes; hereinafter,
      the term "spatial layer" is used to represent both spatial and
      quality layers.</t>

      <t>This payload format specification defines how such
      temporal and spatial scalability layers can be described and communicated.</t>

      <t>Layers are designed (and MUST be encoded) such that if
      any layer, and all higher layers, are removed from the bitstream
      along any of the two dimensions, the remaining bitstream is
      still correctly decodable.</t>

      <t>For terminology, this document uses the term "layer frame" to refer
      to a single encoded VP9 frame for a particular resolution/quality, and
      "super frame" to refer to all the representations (layer frames) at a single
      instant in time.  A super frame thus consists of one or more layer frames,
      encoding different spatial layers.</t>

      <t>Within a super frame, a layer frame with spatial layer ID equal to S,
      where S > 0, can depend on a frame with a lower spatial layer ID.  This
      "inter-layer" dependency results in additional coding  gain to the
      traditional "inter-picture" dependency, where a frame depends on previously
      coded frame in time.  For simplicity, this payload format assumes that,
      within a super frame if inter-layer dependency is used, a spatial layer S frame
      can only depend on spatial layer S-1 frame when S > 0.  Additionally, if
      inter-picture dependency is used, spatial layer S frame is assumed to only
      depend on prevously coded spatial layer S frame.</t>

      <t>TODO: Describe how simulcast can be supported?</t>

      <t>Given above simplifications for inter-layer and inter-picture
      dependencies, a flag (the D bit described below) is used to indicate whether a
      spatial layer S frame depends on spatial layer S-1 frame.  Then a receiver
      only needs to know the inter-picture dependency structure for a given
      spatial layer frame in order to determine its decodability.  Two modes
      of describing the inter-picture dependency structure are possible:
      "flexible mode" and "non-flexible mode".  An encoder can only switch
      between the two on the very first packet of a key frame with temporal 
      layer ID equal to 0.  </t>

      <t>In flexible mode, each packet can contain up to 3 reference
      indices, which identifies all frames referenced by the frame
      transmitted in the current packet for inter-picture prediction. 
      This (along with the D bit) enables a receiver to identify if a frame 
      is decodable or not and helps it understand the temporal layer structure 
      so that it can drop packets as it sees fit. Since this is signaled in 
      each packet it makes it possible to have very flexible temporal layer
      hierarchies and patterns which are changing dynamically.</t>

      <t>In non-flexible mode, the inter-picture dependency (the reference
      indices) of a group of frames (GOF) MUST be pre-specified as part of the 
      scalability structure (SS) data.  In this mode, each packet will have 
      an index to refer to one of the described frames, from which the
      frames referenced by the frame transmitted in the current packet 
      for inter-picture prediction can be identified.</t>

      <t>The SS data can also be used to specify the resolution of each
      spatial layer present in the VP9 stream.</t>

    </section>

    <section anchor="payloadFormat" title="Payload Format">
      <t>This section describes how the encoded VP9 bitstream is encapsulated
      in RTP. To handle network losses usage of RTP/AVPF <xref
      target="RFC4585"/> is RECOMMENDED. All integer fields in the
      specifications are encoded as unsigned integers in network octet
      order.</t>

      <section anchor="RTPHeaderUsage" title="RTP Header Usage">
        <figure anchor="figureRTPHeader">
          <preamble>The general RTP payload format for VP9 is depicted
          below.</preamble>

          <artwork><![CDATA[
   0                   1                   2                   3
   0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |V=2|P|X|  CC   |M|     PT      |       sequence number         |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                           timestamp                           |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |           synchronization source (SSRC) identifier            |
  +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  |            contributing source (CSRC) identifiers             |
  |                             ....                              |
  +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
  |            VP9 payload descriptor (integer #bytes)            |
  :                                                               :
  |                               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                               : VP9 pyld hdr  |               |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+               |
  |                                                               |
  +                                                               |
  :                   Bytes 2..N of VP9 payload                   :
  |                                                               |
  |                               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |                               :    OPTIONAL RTP padding       |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
          ]]></artwork>

          <postamble>The VP9 payload descriptor and VP9 payload header will be
          described in the next section. OPTIONAL RTP padding MUST NOT be included
          unless the P bit is set.</postamble>
        </figure>

        <t><list style="hanging">
            <t hangText="Marker bit (M):">MUST be set to 1 for the final packet
            of the highest spatial layer frame (the final packet of the super frame),
            and 0 otherwise.  Unless spatial scalability is in use for this super frame,
            this will have the same value as the E bit described below.  Note that a
            MANE MUST set this value to 1 for the target spatial layer frame 
            when shaping out higher spatial layers.</t>

            <t hangText="Timestamp:">The RTP timestamp indicates the time when
            the input frame was sampled, at a clock rate of 90 kHz.  If the
            input frame is encoded with multiple layer frames, all of the
            layer frames of the super frame MUST have the same timestamp.</t>

            <t hangText="Sequence number:">The sequence numbers are
            monotonically increasing in order of the encoded bitstream.</t>
          </list></t>
        <t>The remaining RTP header fields are used as specified in <xref
        target="RFC3550"/>.</t>
      </section>

      <section anchor="VP9payloadDescriptor" title="VP9 Payload Description">
        <figure anchor="figureVP9payloadDescriptor">
          <preamble>In flexible mode (with the F bit below set to 1), The first octets 
          after the RTP header are the VP9 payload descriptor, with the following 
          structure.</preamble>

          <artwork><![CDATA[
      0 1 2 3 4 5 6 7
     +-+-+-+-+-+-+-+-+
     |I|P|L|F|B|E|V|-| (REQUIRED)
     +-+-+-+-+-+-+-+-+
I:   |M| PICTURE ID  | (RECOMMENDED)
     +-+-+-+-+-+-+-+-+
M:   | EXTENDED PID  | (RECOMMENDED)
     +-+-+-+-+-+-+-+-+
L:   |  T  |U|  S  |D| (CONDITIONALLY RECOMMENDED)
     +-+-+-+-+-+-+-+-+                             -\
P,F: | P_DIFF    |X|N| (CONDITIONALLY RECOMMENDED)  .
     +-+-+-+-+-+-+-+-+                              . - up to 3 times
X:   |EXTENDED P_DIFF| (OPTIONAL)                   .
     +-+-+-+-+-+-+-+-+                             -/
V:   | SS            |
     | ..            |
     +-+-+-+-+-+-+-+-+

            ]]></artwork>
        </figure>

        <figure anchor="figureVP9payloadDescriptorNonFlexible">
          <preamble>In non-flexible mode (with the F bit below set to 0), The first octets 
          after the RTP header are the VP9 payload descriptor, with the following 
          structure.</preamble>

          <artwork><![CDATA[
      0 1 2 3 4 5 6 7
     +-+-+-+-+-+-+-+-+
     |I|P|L|F|B|E|V|-| (REQUIRED)
     +-+-+-+-+-+-+-+-+
I:   |M| PICTURE ID  | (RECOMMENDED)
     +-+-+-+-+-+-+-+-+
M:   | EXTENDED PID  | (RECOMMENDED)
     +-+-+-+-+-+-+-+-+
L:   |GOF_IDX|  S  |D| (CONDITIONALLY RECOMMENDED)
     +-+-+-+-+-+-+-+-+
     |   TL0PICIDX   | (CONDITIONALLY REQUIRED)
     +-+-+-+-+-+-+-+-+
V:   | SS            |
     | ..            |
     +-+-+-+-+-+-+-+-+

            ]]></artwork>
        </figure>

        <t><list style="hanging">
          <t hangText="I:">Picture ID (PID) present. When set to one, the
          OPTIONAL PID MUST be present after the mandatory first octet and
          specified as below. Otherwise, PID MUST NOT be present.</t>

          <t hangText="P:">Inter-picture predicted layer frame.  When set to zero, the
          layer frame does not utilize inter-picture prediction.  In this case,
          up-switching to current spatial layer's frame is possible from directly
          lower spatial layer frame.  P SHOULD also be set to zero when
          encoding a layer synchronization frame in response to an <xref target='I-D.lennox-avtext-lrr'>LRR</xref>.</t>

          <t hangText="L:">Layer indices present.  When set to one,
          the one or two octets following the mandatory first octet and the PID
          (if present) is as described by "Layer indices" below.  If the F bit (described below)
          is set to 1 (indicating flexible mode), then only one octet is present for the 
          layer indices. Otherwise if the F bit is set to 0 (indicating non-flexible mode), 
          then two octets are present for the layer indices.</t>

          <t hangText="F:">Flexible mode.  F set to one indicates
          flexible mode and if the P bit is also set to one, then the octets following 
          the mandatory first octet, the PID, and layer indices (if present) are 
          as described by "Reference indices" below.  This MUST only be set to one if the I 
          bit is also set to one; if the I bit is set to zero, then this MUST also be 
          set to zero and ignored by receivers.  The value of this F bit CAN ONLY CHANGE 
          on the very first packet of a key picture.  This is a packet with the P bit
          equal to zero, S or D bit (described below) equal to zero, B bit (described below) 
          equal to 1, and temporal layer ID equal to 0.</t>

          <t hangText="B:">Start of a layer frame. MUST be set to 1 if
          the first payload octet of the RTP packet is the beginning of a
          new VP9 layer frame, and MUST NOT be 1 otherwise. Note that this
          layer frame might not be the very first layer frame of a super frame.</t>

          <t hangText="E:">End of a layer frame.  MUST be set to 1 for the final
          RTP packet of a VP9 layer frame, and 0 otherwise.  This enables a
          decoder to finish decoding the layer frame, where it otherwise may need to
          wait for the next packet to explicitly know that the layer frame is complete.
          Note that, if spatial scalability is in use, more layer frames from the
          same super frame may follow; see the description of the M bit above.</t>

          <t hangText="V:">Scalability structure (SS) data present. When set
          to one, the OPTIONAL SS data MUST be present in the payload descriptor.
          Otherwise, the SS data MUST NOT be present.</t>

          <t hangText="-:">Bit reserved for future use. MUST be set to
          zero and MUST be ignored by the receiver.</t>
        </list></t>

        <t>The mandatory first octet is followed by the extension data fields that
        are enabled:<list style="hanging">
          <t hangText="M:">The most significant bit of the first octet is an
          extension flag. The field MUST be present if the I bit is equal to
          one. If set, the PID field MUST contain 15 bits; otherwise, it MUST
          contain 7 bits. See PID below.</t>

          <t hangText="Picture ID (PID):">Picture ID represented in 7 or 15 bits,
          depending on the M bit. This is a running index of the pictures. The
          field MUST be present if the I bit is equal to one. If M is set to zero,
          7 bits carry the PID; else if M is set to one, 15 bits carry the PID.
          The sender may choose between 7 or 15 bits index. The PID SHOULD start on a
          random number, and MUST wrap after reaching the maximum ID. The receiver
          MUST NOT assume that the number of bits in PID stay the same through the
          session.</t>

          <t hangText="Layer indices:">This information is optional but recommended
          whenever encoding with layers.  In the flexible mode (when the F bit is set to 1),
          one octet is used to specify a layer frame's temporal layer ID (T) and spatial layer ID (S)
          as shown in <xref target="figureVP9payloadDescriptor"/>.
          Additionally, a bit (U) is used to indcate that the current frame is a
          "switching up point" frame.  Another bit (D) is used to indicate whether inter-layer 
          prediction is used for the current layer frame.</t>

          <t>In the non-flexible mode (when the F bit is set to 0), two octets are used
          as depicted in <xref target="figureVP9payloadDescriptorNonFlexible"/>.
          Like the flexible mode, the first byte contains the spatial layer ID and the 
          D bit.  Unlike the flexible mode, instead of the T and U fields, a 
          group of frames index (GOF_IDX) is specified, which can be used to obtain the 
          values of T and U fields from the scalable structure (SS) data described below.
          An additional octet to represent the temporal layer 0 index, TL0PICIDX, is present 
          so that all minimally required frames can be tracked.</t>

          <t>The T and S fields, whether obtained directly or indirectly from the SS data,
          indicate the temporal and spatial layers and can help MCUs measure bitrates 
          per layer and can help them make a quick decision on whether to relay a packet 
          or not.  They can also help receivers determine what layers they are currently
          decoding.

          <list style="hanging">
            <t hangText="T:">The temporal layer ID of current frame.  This field is only present
            in the flexible mode (F = 1).</t>

            <t hangText="U:">Switching up point.  This bit is only present in the flexible mode (F = 1).
            If this bit is set to 1 for the current frame with temporal
            layer ID equal to T, then "switch up" to a higher frame rate is possible as subsequent higher temporal
            layer frames will not depend on any frame before the current frame (in coding time) with temporal layer
            ID greater than T.</t>

            <t hangText="S:">The spatial layer ID of current frame.  Note that frames with spatial layer S > 0
            may be dependent on decoded spatial layer S-1 frame within the same super frame.</t>

            <t hangText="D:">Inter-layer dependency used.  MUST be set to one if current spatial layer S frame
            depends on spatial layer S-1 frame of the same super frame.  MUST only be set to zero if current spatial
            layer S frame does not depend on spatial layer S-1 frame of the same super frame.  For the base layer frame
            with S equal to 0, this D bit MUST be set to zero.</t>

            <t hangText="GOF_IDX:">An index to a frame in the group of frames (GOF) described by the
            SS data.  This field is only present in the non-flexible mode (F = 0).   
            In this mode, the SS data SHOULD have been received and the temporal characteristics of
            each frame must have been speficied as group of frames in the SS data
            (see the description of "Scalability structure" below).  Here, the values of the T and 
            the U fields are derived from the SS data.  Additionally, the frame's inter-picture dependecy can also be
            obtained from the SS data.  In the case no SS data has been received or the received SS data
            does not specify GOF (N_G is set to 0), then GOF_IDX MUST be ignored and the stream is assumed to 
            have no temporal hierarchy with both T and U equal to 0.</t>
            
            <t hangText="TL0PICIDX:">8 bits temporal layer zero index. TL0PICIDX is only present
            in the non-flexible mode (F = 0).  This is a running index for the temporal
            base layer frames, i.e., the frames with temporal layer ID (TID) set to 0.  If TID is larger than 0,
            TL0PICIDX indicates which temporal base layer frame the current frame depends on.  TL0PICIDX MUST be
            incremented when TID is 0.  The index SHOULD start on a random number, and MUST restart
            at 0 after reaching the maximum number 255.</t>
          </list></t>

          <t hangText="Reference indices:">These bytes are optional, but recommended when encoding with
          temporal layers in the flexible mode.  When P and F are both set to one, then at least
          one reference index has to be specified as below.  Additional reference indices (total of up to
          3 reference indices are allowed) may be specified using the N bit below.  When either P or F is
          set to zero, then no reference index is specified.
          <list style="hanging">
            <t hangText="P_DIFF:">The reference index specified as the
            relative PID from the current frame.  For example, when P_DIFF=3
            on a packet containing the frame with PID 112 means
            that the frame refers back to the frame with PID
            109. This calculation is done modulo the size of the PID field,
            i.e., either 7 or 15 bits. For most layer
            structures a 6-bit relative PID will be enough;
            however, the X bit can be used to refer to older frames.</t>

            <t hangText="X:">1 if this layer index has an extended P_DIFF.</t>

            <t hangText="N:">1 if there is additional P_DIFF following the current P_DIFF.</t>
          </list></t>
        </list></t>

      <section anchor="VP9payloadDescriptorSS" title="Scalability Structure (SS):">
        <t>The scalability structure (SS) data describes the resolution of
        each layer frame within a super frame as well as the inter-picture dependencies
        for a group of frames (GOF).  If the VP9 payload descriptor's "V"
        bit is set, the SS data is present in the position indicated in
        <xref target="figureVP9payloadDescriptor"/> and <xref target="figureVP9payloadDescriptorNonFlexible"/>.</t>
        <figure anchor="figureVP9ScalabilityStructure">
            <artwork><![CDATA[
     +-+-+-+-+-+-+-+-+
V:   | N_S |Y|  N_G  |
     +-+-+-+-+-+-+-+-+              -\
Y:   |     WIDTH     | (OPTIONAL)    .
     +               +               .
     |               | (OPTIONAL)    .
     +-+-+-+-+-+-+-+-+               . - N_S + 1 times
     |     HEIGHT    | (OPTIONAL)    .
     +               +               .
     |               | (OPTIONAL)    .
     +-+-+-+-+-+-+-+-+              -/            -\
N_G: |  T  |U| R |-|-| (OPTIONAL)                 .
     +-+-+-+-+-+-+-+-+              -\            . - N_G + 1 times
     |    P_DIFF     | (OPTIONAL)    . - R times  .
     +-+-+-+-+-+-+-+-+              -/            -/
            ]]></artwork>
        </figure>

        <t><list style="hanging">
          <t hangText="N_S:">N_S + 1 indicates the number of spatial
          layers present in the VP9 stream.</t>

          <t hangText="Y:">Each spatial layer's frame resolution present.
          When set to one, the OPTIONAL WIDTH (2 octets) and HEIGHT
          (2 octets) MUST be present for each layer frame.  Otherwise, the
          resolution MUST NOT be present.</t>

          <t hangText="N_G:">N_G + 1 indicates the number of frames
          in a GOF. If N_G is greater than 0, then the SS data allows
          the inter-picture dependency structure of the VP9 stream to
          be pre-declared, rather than indicating it on the fly with
          every packet.  If N_G is greater than 0, then for N_G + 1
          pictures in the GOF, each frame's temporal layer ID (T), switch up point (U), 
          and the R reference indices (P_DIFFs) are specified.</t>

          <t>N_G=0 indicates that either there is only one temporal
          layer or no fixed inter-picture dependency information is present
          going forward in the bitstream.</t>

          <t>Note that for a given super frame, all layer frames follow the
          same inter-picture dependency structure.  However, the frame rate
          of each spatial layer can be different from each other and this can
          be controlled with the use of the D bit described above.  The 
          specified dependency structure in the SS data MUST be for the highest
          frame rate layer.</t>
        </list></t>

        <t>In a scalable stream sent with a fixed pattern, the SS data
        SHOULD be included in the first packet of every key frame. This is a packet 
        with P bit equal to zero, S or D bit equal to zero, B bit equal to 1, and 
        temporal layer ID (TID) equal to 0. The SS data SHOULD also be included in the
        first packet of the first frame in which the SS changes.
        If the SS data is included in a frame with TID not equal to 0,
        it MUST also be repeated in the first packet of the first
        frame with a lower TID, until TID equals to 0.</t>
      </section>
    </section>

      <section anchor="VP9payloadHeader" title="VP9 Payload Header">
		<t>TODO: need to describe VP9 payload header.</t>
      </section>

      <section title="Frame Fragmentation">
		<t>VP9 frames are fragmented into packets, in RTP sequence
		number order, beginning with a
		packet with the B bit set, and ending with a packet with the
		RTP marker bit set.  There is no mechanism for finer-grained
		access to parts of a VP9 frame.</t>
      </section>

      <section title="Examples of VP9 RTP Stream">
		<t>TODO</t>
	  </section>
    </section>

    <section anchor="RPSIandSLI" title="Using VP9 with RPSI and SLI Feedback">
      <t>The VP9 payload descriptor defined in <xref
      target="VP9payloadDescriptor"/> above contains an optional PictureID
      parameter. One use of this parameter is included to enable use of reference
      picture selection index (RPSI) and slice loss indication (SLI), both
      defined in <xref target="RFC4585"/>.</t>

      <section anchor="RPSI" title="RPSI">
		<t>TODO: Update to indicate which frame within the picture.</t>
        <t>The reference picture selection index is a payload-specific
        feedback message defined within the RTCP-based feedback format. The
        RPSI message is generated by a receiver and can be used in two ways.
        Either it can signal a preferred reference picture when a loss has
        been detected by the decoder -- preferably then a reference that the
        decoder knows is perfect -- or, it can be used as positive feedback
        information to acknowledge correct decoding of certain reference
        pictures. The positive feedback method is useful for VP9 used as
        unicast. The use of RPSI for VP9 is preferably combined with a special
        update pattern of the codec's two special reference frames -- the
        golden frame and the altref frame -- in which they are updated in an
        alternating leapfrog fashion. When a receiver has received and
        correctly decoded a golden or altref frame, and that frame had a
        PictureID in the payload descriptor, the receiver can acknowledge this
        simply by sending an RPSI message back to the sender. The message body
        (i.e., the "native RPSI bit string" in <xref target="RFC4585"/>) is
        simply the PictureID of the received frame.</t>
      </section>

      <section anchor="SLI" title="SLI">
		<t>TODO: Update to indicate which frame within the picture.</t>
        <t>The slice loss indication is another payload-specific feedback
        message defined within the RTCP-based feedback format. The SLI message
        is generated by the receiver when a loss or corruption is detected in
        a frame. The format of the SLI message is as follows <xref
        target="RFC4585"/>:</t>

        <figure anchor="figureSLIHeader">
          <artwork><![CDATA[
   0                   1                   2                   3
   0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |         First           |        Number           | PictureID |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            ]]></artwork>
        </figure>

        <t>Here, First is the macroblock address (in scan order) of the first
        lost block and Number is the number of lost blocks. PictureID is the
        six least significant bits of the codec-specific picture identifier in
        which the loss or corruption has occurred. For VP9, this
        codec-specific identifier is naturally the PictureID of the current
        frame, as read from the payload descriptor. If the payload descriptor
        of the current frame does not have a PictureID, the receiver MAY send
        the last received PictureID+1 in the SLI message. The receiver MAY set
        the First parameter to 0, and the Number parameter to the total number
        of macroblocks per frame, even though only parts of the frame is
        corrupted. When the sender receives an SLI message, it can make use of
        the knowledge from the latest received RPSI message. Knowing that the
        last golden or altref frame was successfully received, it can encode
        the next frame with reference to that established reference.</t>
      </section>

      <section title="Example">
		<t>TODO: this example is copied from the VP8 payload format specification,
		and has not been updated for VP9.  It may be incorrect.</t>

        <t>The use of RPSI and SLI is best illustrated in an example. In this
        example, the encoder may not update the altref frame until the last
        sent golden frame has been acknowledged with an RPSI message. If an
        update is not received within some time, a new golden frame update is
        sent instead. Once the new golden frame is established and
        acknowledged, the same rule applies when updating the altref
        frame.</t>

        <texttable anchor="table_example_timing"
                   title="Example signaling between sender and receiver">
          <ttcol align="left">Event</ttcol>

          <ttcol align="left">Sender</ttcol>

          <ttcol align="left">Receiver</ttcol>

          <ttcol align="left">Established reference</ttcol>

          <c>1000</c>

          <c>Send golden frame PictureID = 0</c>

          <c/>

          <c/>

          <c/>

          <c/>

          <c>Receive and decode golden frame</c>

          <c/>

          <c>1001</c>

          <c/>

          <c>Send RPSI(0)</c>

          <c/>

          <c>1002</c>

          <c>Receive RPSI(0)</c>

          <c/>

          <c>golden</c>

          <c>...</c>

          <c>(sending regular frames)</c>

          <c/>

          <c/>

          <c>1100</c>

          <c>Send altref frame PictureID = 100</c>

          <c/>

          <c/>

          <c/>

          <c/>

          <c>Altref corrupted or lost</c>

          <c>golden</c>

          <c>1101</c>

          <c/>

          <c>Send SLI(100)</c>

          <c>golden</c>

          <c>1102</c>

          <c>Receive SLI(100)</c>

          <c/>

          <c/>

          <c>1103</c>

          <c>Send frame with reference to golden</c>

          <c/>

          <c/>

          <c/>

          <c/>

          <c>Receive and decode frame (decoder state restored)</c>

          <c>golden</c>

          <c>...</c>

          <c>(sending regular frames)</c>

          <c/>

          <c/>

          <c>1200</c>

          <c>Send altref frame PictureID = 200</c>

          <c/>

          <c/>

          <c/>

          <c/>

          <c>Receive and decode altref frame</c>

          <c>golden</c>

          <c>1201</c>

          <c/>

          <c>Send RPSI(200)</c>

          <c/>

          <c>1202</c>

          <c>Receive RPSI(200)</c>

          <c/>

          <c>altref</c>

          <c>...</c>

          <c>(sending regular frames)</c>

          <c/>

          <c/>

          <c>1300</c>

          <c>Send golden frame PictureID = 300</c>

          <c/>

          <c/>

          <c/>

          <c/>

          <c>Receive and decode golden frame</c>

          <c>altref</c>

          <c>1301</c>

          <c/>

          <c>Send RPSI(300)</c>

          <c>altref</c>

          <c>1302</c>

          <c>RPSI lost</c>

          <c/>

          <c/>

          <c>1400</c>

          <c>Send golden frame PictureID = 400</c>

          <c/>

          <c/>

          <c/>

          <c/>

          <c>Receive and decode golden frame</c>

          <c>altref</c>

          <c>1401</c>

          <c/>

          <c>Send RPSI(400)</c>

          <c/>

          <c>1402</c>

          <c>Receive RPSI(400)</c>

          <c/>

          <c>golden</c>
        </texttable>

        <t>Note that the scheme is robust to loss of the feedback messages. If
        the RPSI is lost, the sender will try to update the golden (or altref)
        again after a while, without releasing the established reference.
        Also, if an SLI is lost, the receiver can keep sending SLI messages at
        any interval allowed by the RTCP sending timing restrictions as
        specified in <xref target="RFC4585"/>, as long as the picture is
        corrupted.</t>
      </section>
    </section>

    <section anchor="payloadFormatParameters"
             title="Payload Format Parameters">
      <t>This payload format has two required parameters.</t>

      <section anchor="mediaTypeRegistration" title="Media Type Definition">
        <t>This registration is done using the template defined in <xref
        target="RFC6838"/> and following <xref target="RFC4855"/>. <list
            style="hanging">
            <t hangText="Type name:">video</t>

            <t hangText="Subtype name:">VP9</t>

            <t hangText="Required parameters:"><vspace blankLines="0"/> These
            parameters MUST be used to signal the capabilities of a receiver
            implementation. These parameters MUST NOT be used for any other
            purpose. <list style="hanging">
                <t hangText="max-fr:">The value of max-fr is an integer
                indicating the maximum frame rate in units of frames per
                second that the decoder is capable of decoding.</t>

                <t hangText="max-fs:">The value of max-fs is an integer
                indicating the maximum frame size in units of macroblocks that
                the decoder is capable of decoding.</t>

                <t>The decoder is capable of decoding this frame size as long
                as the width and height of the frame in macroblocks are less
                than int(sqrt(max-fs * 8)) - for instance, a max-fs of 1200
                (capable of supporting 640x480 resolution) will support widths
                and heights up to 1552 pixels (97 macroblocks).</t>
              </list></t>

            <t hangText="Optional parameters:">none</t>

            <t hangText="Encoding considerations:"><vspace blankLines="0"/>
            This media type is framed in RTP and contains binary data; see
            Section 4.8 of <xref target="RFC6838"/>.</t>

            <t hangText="Security considerations:">See <xref
            target="securityConsiderations"/> of RFC xxxx. <vspace
            blankLines="0"/> [RFC Editor: Upon publication as an RFC, please
            replace "XXXX" with the number assigned to this document and
            remove this note.]</t>

            <t hangText="Interoperability considerations:">None.</t>

            <t hangText="Published specification:">VP9 bitstream format <xref
            target="I-D.grange-vp9-bitstream"/> and RFC XXXX. <vspace blankLines="0"/> [RFC
            Editor: Upon publication as an RFC, please replace "XXXX" with the
            number assigned to this document and remove this note.] <vspace
            blankLines="0"/></t>

            <t hangText="Applications which use this media type:"><vspace
            blankLines="0"/> For example: Video over IP, video
            conferencing.</t>

            <t hangText="Additional information:">None.</t>

            <t
            hangText="Person & email address to contact for further information:"><vspace
            blankLines="0"/> TODO [Pick a contact]</t>

            <t hangText="Intended usage:">COMMON</t>

            <t hangText="Restrictions on usage:"><vspace blankLines="0"/> This
            media type depends on RTP framing, and hence is only defined for
            transfer via RTP <xref target="RFC3550"/>.</t>

            <t hangText="Author:">TODO [Pick a contact]</t>

            <t hangText="Change controller:"><vspace blankLines="0"/> IETF
            Payload Working Group delegated from the IESG.</t>
          </list></t>
      </section>

      <section title="SDP Parameters">
        <t>The receiver MUST ignore any fmtp parameter unspecified in this
        memo.</t>

        <section title="Mapping of Media Subtype Parameters to SDP">
          <t>The media type video/VP9 string is mapped to fields in the
          Session Description Protocol (SDP) <xref target="RFC4566"/> as
          follows: <list style="symbols">
              <t>The media name in the "m=" line of SDP MUST be video.</t>

              <t>The encoding name in the "a=rtpmap" line of SDP MUST be VP9
              (the media subtype).</t>

              <t>The clock rate in the "a=rtpmap" line MUST be 90000.</t>

              <t>The parameters "max-fs", and "max-fr", MUST be included in
              the "a=fmtp" line of SDP. These parameters are expressed as a
              media subtype string, in the form of a semicolon separated list
              of parameter=value pairs.</t>
            </list></t>

          <section title="Example">
            <t>An example of media representation in SDP is as follows:</t>

            <t>m=video 49170 RTP/AVPF 98<vspace blankLines="0"/> a=rtpmap:98
            VP9/90000<vspace blankLines="0"/> a=fmtp:98 max-fr=30;
            max-fs=3600;<vspace blankLines="0"/></t>
          </section>
        </section>

        <section title="Offer/Answer Considerations">
		  <t>TODO: Update this for VP9</t>
		  <!--
          <t>The VP9 codec offers a decode complexity that is roughly linear
          with the number of pixels encoded. The parameters "max-fr" and
          "max-fs" are defined in <xref target="mediaTypeRegistration"/>,
          where the macroblock size is 16x16 pixels as defined in <xref
          target="RFC6386"/>, the max-fs and max-fr parameters MUST be used to
          establish these limits.</t>

          <t>NOTE IN DRAFT: If closer control of width and height is desired,
          the mechanism described in
          draft-nandakumar-payload-sdp-max-video-resolution is a possible
          candidate for signalling, but since that document appears to be far
          from finalization, this document does not make a reference to that
          document. This note is only intended for facilitating WG discussion,
          and should be deleted before publication of this document as an
          RFC.</t> -->
        </section>
      </section>
    </section>

    <section anchor="securityConsiderations" title="Security Considerations">
      <t>RTP packets using the payload format defined in this specification
      are subject to the security considerations discussed in the RTP
      specification <xref target="RFC3550"/>, and in any applicable RTP
      profile. The main security considerations for the RTP packet carrying
      the RTP payload format defined within this memo are confidentiality,
      integrity and source authenticity. Confidentiality is achieved by
      encryption of the RTP payload. Integrity of the RTP packets through
      suitable cryptographic integrity protection mechanism. Cryptographic
      system may also allow the authentication of the source of the payload. A
      suitable security mechanism for this RTP payload format should provide
      confidentiality, integrity protection and at least source authentication
      capable of determining if an RTP packet is from a member of the RTP
      session or not. Note that the appropriate mechanism to provide security
      to RTP and payloads following this memo may vary. It is dependent on the
      application, the transport, and the signaling protocol employed.
      Therefore a single mechanism is not sufficient, although if suitable the
      usage of SRTP <xref target="RFC3711"/> is recommended. This RTP payload
      format and its media decoder do not exhibit any significant
      non-uniformity in the receiver-side computational complexity for packet
      processing, and thus are unlikely to pose a denial-of-service threat due
      to the receipt of pathological data. Nor does the RTP payload format
      contain any active content.</t>
    </section>

    <section anchor="congestionControl" title="Congestion Control">
      <t>Congestion control for RTP SHALL be used in accordance with RFC 3550
      <xref target="RFC3550"/>, and with any applicable RTP profile; e.g., RFC
      3551 <xref target="RFC3551"/>. The congestion control mechanism can, in
      a real-time encoding scenario, adapt the transmission rate by
      instructing the encoder to encode at a certain target rate. Media aware
      network elements MAY use the information in the VP9 payload descriptor
      in <xref target="VP9payloadDescriptor"/> to identify non-reference
      frames and discard them in order to reduce network congestion. Note that
      discarding of non-reference frames cannot be done if the stream is
      encrypted (because the non-reference marker is encrypted).</t>
    </section>

    <section anchor="IANAConsiderations" title="IANA Considerations">
      <t>The IANA is requested to register the following values:<vspace
      blankLines="0"/> - Media type registration as described in <xref
      target="mediaTypeRegistration"/>.</t>
    </section>
  </middle>

  <back>
    <references>
      &vp9;

      &rfc2119;

      &rfc4585;

      &rfc3550;

      &rfc3711;

      &rfc4566;

      &rfc6838;

      &rfc4855;

      &rfc3551;
	  
	  <!-- Replace with proper ref once it's in the I-D repo -->
	  <reference anchor="I-D.lennox-avtext-lrr">
		<front>
		  <title>The Layer Refresh Request (LRR) RTCP Feedback MessageVideo</title>
		  <author initials="J" surname="Lennox" fullname="Jonathan Lennox"><organization/></author>
		  <author initials="J" surname="Uberti" fullname="Justin Uberti"><organization/></author>
		  <author initials="S" surname="Holmer" fullname="Stefan Holmer"><organization/></author>
		  <author initials="M" surname="Flodman" fullname="Magnus Flodman"><organization/></author>
		  <date month="March" day="9" year="2015"/>
		</front>
		<seriesInfo name="Internet-Draft" value="draft-lennox-avtext-lrr-00"/>
		<format type="TXT" target="http://www.ietf.org/internet-drafts/draft-lennox-avtext-lrr-00.txt"/>
	  </reference>

    </references>
  </back>
</rfc>
<!--  LocalWords:  PictureID DCT Hadamard WHT SSRC CSRC pyld hdr FI VER RPSI
 -->
<!--  LocalWords:  stPartitionSize SLI SDP AVPF SRTP IANA PID PICIDX TID
 -->

PAFTECH AB 2003-20262026-04-23 14:17:46