idnits 2.17.1 draft-ietf-payload-vp9-15.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (4 June 2021) is 1051 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Possible downref: Non-RFC (?) normative reference: ref. 'VP9-BITSTREAM' Summary: 0 errors (**), 0 flaws (~~), 1 warning (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 AVTCore Working Group J. Uberti 3 Internet-Draft S. Holmer 4 Intended status: Standards Track M. Flodman 5 Expires: 6 December 2021 D. Hong 6 Google 7 J. Lennox 8 8x8 / Jitsi 9 4 June 2021 11 RTP Payload Format for VP9 Video 12 draft-ietf-payload-vp9-15 14 Abstract 16 This specification describes an RTP payload format for the VP9 video 17 codec. The payload format has wide applicability, as it supports 18 applications from low bit-rate peer-to-peer usage, to high bit-rate 19 video conferences. It includes provisions for temporal and spatial 20 scalability. 22 Status of This Memo 24 This Internet-Draft is submitted in full conformance with the 25 provisions of BCP 78 and BCP 79. 27 Internet-Drafts are working documents of the Internet Engineering 28 Task Force (IETF). Note that other groups may also distribute 29 working documents as Internet-Drafts. The list of current Internet- 30 Drafts is at https://datatracker.ietf.org/drafts/current/. 32 Internet-Drafts are draft documents valid for a maximum of six months 33 and may be updated, replaced, or obsoleted by other documents at any 34 time. It is inappropriate to use Internet-Drafts as reference 35 material or to cite them other than as "work in progress." 37 This Internet-Draft will expire on 6 December 2021. 39 Copyright Notice 41 Copyright (c) 2021 IETF Trust and the persons identified as the 42 document authors. All rights reserved. 44 This document is subject to BCP 78 and the IETF Trust's Legal 45 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 46 license-info) in effect on the date of publication of this document. 47 Please review these documents carefully, as they describe your rights 48 and restrictions with respect to this document. Code Components 49 extracted from this document must include Simplified BSD License text 50 as described in Section 4.e of the Trust Legal Provisions and are 51 provided without warranty as described in the Simplified BSD License. 53 Table of Contents 55 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 56 2. Conventions, Definitions and Acronyms . . . . . . . . . . . . 3 57 3. Media Format Description . . . . . . . . . . . . . . . . . . 3 58 4. Payload Format . . . . . . . . . . . . . . . . . . . . . . . 5 59 4.1. RTP Header Usage . . . . . . . . . . . . . . . . . . . . 5 60 4.2. VP9 Payload Descriptor . . . . . . . . . . . . . . . . . 6 61 4.2.1. Scalability Structure (SS): . . . . . . . . . . . . . 11 62 4.3. Frame Fragmentation . . . . . . . . . . . . . . . . . . . 13 63 4.4. Scalable encoding considerations . . . . . . . . . . . . 13 64 4.5. Examples of VP9 RTP Stream . . . . . . . . . . . . . . . 13 65 4.5.1. Reference picture use for scalable structure . . . . 14 66 5. Feedback Messages and Header Extensions . . . . . . . . . . . 14 67 5.1. Reference Picture Selection Indication (RPSI) . . . . . . 15 68 5.2. Full Intra Request (FIR) . . . . . . . . . . . . . . . . 15 69 5.3. Layer Refresh Request (LRR) . . . . . . . . . . . . . . . 15 70 6. Payload Format Parameters . . . . . . . . . . . . . . . . . . 16 71 6.1. SDP Parameters . . . . . . . . . . . . . . . . . . . . . 18 72 6.1.1. Mapping of Media Subtype Parameters to SDP . . . . . 18 73 6.1.2. Offer/Answer Considerations . . . . . . . . . . . . . 19 74 7. Media Type Definition . . . . . . . . . . . . . . . . . . . . 19 75 8. Security Considerations . . . . . . . . . . . . . . . . . . . 21 76 9. Congestion Control . . . . . . . . . . . . . . . . . . . . . 21 77 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 22 78 11. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 22 79 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 22 80 12.1. Normative References . . . . . . . . . . . . . . . . . . 22 81 12.2. Informative References . . . . . . . . . . . . . . . . . 23 82 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 24 84 1. Introduction 86 This specification describes an RTP [RFC3550] payload specification 87 applicable to the transmission of video streams encoded using the VP9 88 video codec [VP9-BITSTREAM]. The format described in this document 89 can be used both in peer-to-peer and video conferencing applications. 91 The VP9 video codec was developed by Google, and is the successor to 92 its earlier VP8 [RFC6386] codec. Above the compression improvements 93 and other general enhancements above VP8, VP9 is also designed in a 94 way that allows spatially-scalable video encoding. 96 2. Conventions, Definitions and Acronyms 98 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 99 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 100 "OPTIONAL" in this document are to be interpreted as described in BCP 101 14 [RFC2119] [RFC8174] when, and only when, they appear in all 102 capitals, as shown here. 104 3. Media Format Description 106 The VP9 codec can maintain up to eight reference frames, of which up 107 to three can be referenced by any new frame. 109 VP9 also allows a frame to use another frame of a different 110 resolution as a reference frame. (Specifically, a frame may use any 111 references whose width and height are between 1/16th that of the 112 current frame and twice that of the current frame, inclusive.) This 113 allows internal resolution changes without requiring the use of key 114 frames. 116 These features together enable an encoder to implement various forms 117 of coarse-grained scalability, including temporal, spatial and 118 quality scalability modes, as well as combinations of these, without 119 the need for explicit scalable coding tools. 121 Temporal layers define different frame rates of video; spatial and 122 quality layers define different and possibly dependent 123 representations of a single input frame. Spatial layers allow a 124 frame to be encoded at different resolutions, whereas quality layers 125 allow a frame to be encoded at the same resolution but at different 126 qualities (and thus with different amounts of coding error). VP9 127 supports quality layers as spatial layers without any resolution 128 changes; hereinafter, the term "spatial layer" is used to represent 129 both spatial and quality layers. 131 This payload format specification defines how such temporal and 132 spatial scalability layers can be described and communicated. 134 Temporal and spatial scalability layers are associated with non- 135 negative integer IDs. The lowest layer of either type has an ID of 136 0, and is sometimes referred to as the "base" temporal or spatial 137 layer. 139 Layers are designed, and MUST be encoded, such that if any layer, and 140 all higher layers, are removed from the bitstream along either the 141 spatial or temporal dimension, the remaining bitstream is still 142 correctly decodable. 144 For terminology, this document uses the term "frame" to refer to a 145 single encoded VP9 frame for a particular resolution/quality, and 146 "picture" to refer to all the representations (frames) at a single 147 instant in time. A picture thus consists of one or more frames, 148 encoding different spatial layers. 150 Within a picture, a frame with spatial layer ID equal to SID, where 151 SID > 0, can depend on a frame of the same picture with a lower 152 spatial layer ID. This "inter-layer" dependency can result in 153 additional coding gain compared to the case where only traditional 154 "inter-picture" dependency is used, where a frame depends on 155 previously coded frame in time. For simplicity, this payload format 156 assumes that, within a picture and if inter-layer dependency is used, 157 a spatial layer SID frame can depend only on the immediately previous 158 spatial layer SID-1 frame, when S > 0. Additionally, if inter- 159 picture dependency is used, a spatial layer SID frame is assumed to 160 only depend on a previously coded spatial layer SID frame. 162 Given above simplifications for inter-layer and inter-picture 163 dependencies, a flag (the D bit described below) is used to indicate 164 whether a spatial layer SID frame depends on the spatial layer SID-1 165 frame. Given the D bit, a receiver only needs to additionally know 166 the inter-picture dependency structure for a given spatial layer 167 frame in order to determine its decodability. Two modes of 168 describing the inter-picture dependency structure are possible: 169 "flexible mode" and "non-flexible mode". An encoder can only switch 170 between the two on the first packet of a key frame with temporal 171 layer ID equal to 0. 173 In flexible mode, each packet can contain up to 3 reference indices, 174 which identify all frames referenced by the frame transmitted in the 175 current packet for inter-picture prediction. This (along with the D 176 bit) enables a receiver to identify if a frame is decodable or not 177 and helps it understand the temporal layer structure. Since this is 178 signaled in each packet it makes it possible to have very flexible 179 temporal layer hierarchies, and scalability structures which are 180 changing dynamically. 182 In non-flexible mode, frames are encoded using a fixed, recurring 183 pattern of dependencies; the set of pictures that recur in this 184 pattern is known as a Picture Group (PG). In this mode, the inter- 185 picture dependencies (the reference indices) of the Picture Group 186 MUST be pre-specified as part of the scalability structure (SS) data. 187 Each packet has an index to refer to one of the described pictures in 188 the PG, from which the pictures referenced by the picture transmitted 189 in the current packet for inter-picture prediction can be identified. 191 (Note: A "Picture Group", as used in this document, is not the same 192 thing as the term "Group of Pictures" as it is traditionally used in 193 video coding, i.e. to mean an independently-decoadable run of 194 pictures beginning with a keyframe.) 196 The SS data can also be used to specify the resolution of each 197 spatial layer present in the VP9 stream for both flexible and non- 198 flexible modes. 200 4. Payload Format 202 This section describes how the encoded VP9 bitstream is encapsulated 203 in RTP. To handle network losses usage of RTP/AVPF [RFC4585] is 204 RECOMMENDED. All integer fields in the specifications are encoded as 205 unsigned integers in network octet order. 207 4.1. RTP Header Usage 209 The general RTP payload format for VP9 is depicted below. 211 0 1 2 3 212 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 213 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 214 |V=2|P|X| CC |M| PT | sequence number | 215 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 216 | timestamp | 217 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 218 | synchronization source (SSRC) identifier | 219 +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 220 | contributing source (CSRC) identifiers | 221 | .... | 222 +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 223 | VP9 payload descriptor (integer #octets) | 224 : : 225 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 226 | : | 227 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 228 | | 229 + | 230 : VP9 payload : 231 | | 232 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 233 | : OPTIONAL RTP padding | 234 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 235 Figure 1 237 The VP9 payload descriptor will be described in Section 4.2; the VP9 238 payload is described in [VP9-BITSTREAM]. OPTIONAL RTP padding MUST 239 NOT be included unless the P bit is set. 241 Marker bit (M): MUST be set to 1 for the final packet of the highest 242 spatial layer frame (the final packet of the picture), and 0 243 otherwise. Unless spatial scalability is in use for this picture, 244 this will have the same value as the E bit described below. Note 245 this bit MUST be set to 1 for the target spatial layer frame if a 246 stream is being rewritten to remove higher spatial layers. 248 Payload Type (PT): In line with the policy in Section 3 of 249 [RFC3551], applications using the VP9 RTP payload profile MUST 250 assign a dynamic payload type number to be used in each RTP 251 session and provide a mechanism to indicate the mapping. See 252 Section 6.1 for the mechanism to be used with the Session 253 Description Protocol (SDP) [RFC8866]. 255 Timestamp: The RTP timestamp [RFC3550] indicates the time when the 256 input frame was sampled, at a clock rate of 90 kHz. If the input 257 picture is encoded with multiple layer frames, all of the frames 258 of the picture MUST have the same timestamp. 260 If a frame has the VP9 show_frame field set to 0 (i.e., it is 261 meant only to populate a reference buffer, without being output) 262 its timestamp MAY alternatively be set to be the same as the 263 subsequent frame with show_frame equal to 1. (This will be 264 convenient for playing out pre-encoded content packaged with VP9 265 "superframes", which typically bundle show_frame==0 frames with a 266 subsequent show_frame==1 frame.) Every frame with show_frame==1, 267 however, MUST have a unique timestamp modulo the 2^32 wrap of the 268 field. 270 The remaining RTP Fixed Header Fields (V, P, X, CC, sequence number, 271 SSRC and CSRC identifiers) are used as specified in Section 5.1 of 272 [RFC3550]. 274 4.2. VP9 Payload Descriptor 276 In flexible mode (with the F bit below set to 1), the first octets 277 after the RTP header are the VP9 payload descriptor, with the 278 following structure. 280 0 1 2 3 4 5 6 7 281 +-+-+-+-+-+-+-+-+ 282 |I|P|L|F|B|E|V|Z| (REQUIRED) 283 +-+-+-+-+-+-+-+-+ 284 I: |M| PICTURE ID | (REQUIRED) 285 +-+-+-+-+-+-+-+-+ 286 M: | EXTENDED PID | (RECOMMENDED) 287 +-+-+-+-+-+-+-+-+ 288 L: | TID |U| SID |D| (Conditionally RECOMMENDED) 289 +-+-+-+-+-+-+-+-+ -\ 290 P,F: | P_DIFF |N| (Conditionally REQUIRED) - up to 3 times 291 +-+-+-+-+-+-+-+-+ -/ 292 V: | SS | 293 | .. | 294 +-+-+-+-+-+-+-+-+ 296 Figure 2 298 In non-flexible mode (with the F bit below set to 0), The first 299 octets after the RTP header are the VP9 payload descriptor, with the 300 following structure. 302 0 1 2 3 4 5 6 7 303 +-+-+-+-+-+-+-+-+ 304 |I|P|L|F|B|E|V|Z| (REQUIRED) 305 +-+-+-+-+-+-+-+-+ 306 I: |M| PICTURE ID | (RECOMMENDED) 307 +-+-+-+-+-+-+-+-+ 308 M: | EXTENDED PID | (RECOMMENDED) 309 +-+-+-+-+-+-+-+-+ 310 L: | TID |U| SID |D| (Conditionally RECOMMENDED) 311 +-+-+-+-+-+-+-+-+ 312 | TL0PICIDX | (Conditionally REQUIRED) 313 +-+-+-+-+-+-+-+-+ 314 V: | SS | 315 | .. | 316 +-+-+-+-+-+-+-+-+ 318 Figure 3 320 I: Picture ID (PID) present. When set to one, the OPTIONAL PID MUST 321 be present after the mandatory first octet and specified as below. 322 Otherwise, PID MUST NOT be present. If the V bit was set in the 323 stream's most recent start of a keyframe (i.e. the SS field was 324 present) and the F bit is set to 0 (i.e. non-flexible scalability 325 mode is in use), then this bit MUST be set on every packet. 327 P: Inter-picture predicted frame. When set to zero, the frame does 328 not utilize inter-picture prediction. In this case, up-switching 329 to a current spatial layer's frame is possible from directly lower 330 spatial layer frame. P SHOULD also be set to zero when encoding a 331 layer synchronization frame in response to an LRR 332 [I-D.ietf-avtext-lrr] message (see Section 5.3). When P is set to 333 zero, the TID field (described below) MUST also be set to 0 (if 334 present). Note that the P bit does not forbid intra-picture, 335 inter-layer prediction from earlier frames of the same picture, if 336 any. 338 L: Layer indices present. When set to one, the one or two octets 339 following the mandatory first octet and the PID (if present) is as 340 described by "Layer indices" below. If the F bit (described 341 below) is set to 1 (indicating flexible mode), then only one octet 342 is present for the layer indices. Otherwise if the F bit is set 343 to 0 (indicating non-flexible mode), then two octets are present 344 for the layer indices. 346 F: Flexible mode. F set to one indicates flexible mode and if the P 347 bit is also set to one, then the octets following the mandatory 348 first octet, the PID, and layer indices (if present) are as 349 described by "Reference indices" below. This MUST only be set to 350 1 if the I bit is also set to one; if the I bit is set to zero, 351 then this MUST also be set to zero and ignored by receivers. 352 (Flexible mode's Reference indices are defined as offsets from the 353 Picture ID field, so they would have no meaning if I were not 354 set.) The value of this F bit MUST only change on the first 355 packet of a key picture. A key picture is a picture whose base 356 spatial layer frame is a key frame, and which thus completely 357 resets the encoder state. This packet will have its P bit equal 358 to zero, SID or L bit (described below) equal to zero, and B bit 359 (described below) equal to 1. 361 B: Start of a frame. MUST be set to 1 if the first payload octet of 362 the RTP packet is the beginning of a new VP9 frame, and MUST NOT 363 be 1 otherwise. Note that this frame might not be the first frame 364 of a picture. 366 E: End of a frame. MUST be set to 1 for the final RTP packet of a 367 VP9 frame, and 0 otherwise. This enables a decoder to finish 368 decoding the frame, where it otherwise may need to wait for the 369 next packet to explicitly know that the frame is complete. Note 370 that, if spatial scalability is in use, more frames from the same 371 picture may follow; see the description of the M bit above. 373 V: Scalability structure (SS) data present. When set to one, the 374 OPTIONAL SS data MUST be present in the payload descriptor. 375 Otherwise, the SS data MUST NOT be present. 377 Z: Not a reference frame for upper spatial layers. If set to 1, 378 indicates that frames with higher spatial layers SID+1 and greater 379 of the current and following pictures do not depend on the current 380 spatial layer SID frame. This enables a decoder which is 381 targeting a higher spatial layer to know that it can safely 382 discard this packet's frame without processing it, without having 383 to wait for the "D" bit in the higher-layer frame (see below). 385 The mandatory first octet is followed by the extension data fields 386 that are enabled: 388 M: The most significant bit of the first octet is an extension flag. 389 The field MUST be present if the I bit is equal to one. If M is 390 set, the PID field MUST contain 15 bits; otherwise, it MUST 391 contain 7 bits. See PID below. 393 Picture ID (PID): Picture ID represented in 7 or 15 bits, depending 394 on the M bit. This is a running index of the pictures, where the 395 sender increments the value by 1 for each picture it sends. (Note 396 however that because a middlebox can discard pictures where 397 permitted by the scalability structure, Picture IDs as received by 398 a receiver might not be contiguous.) This field MUST be present 399 if the I bit is equal to one. If M is set to zero, 7 bits carry 400 the PID; else if M is set to one, 15 bits carry the PID in network 401 byte order. The sender may choose between a 7- or 15-bit index. 402 The PID SHOULD start on a random number, and MUST wrap after 403 reaching the maximum ID (0x7f or 0x7fff depending on the index 404 size chosen). The receiver MUST NOT assume that the number of 405 bits in PID stay the same through the session. If this field 406 transitions from 7-bits to 15-bits, the value is zero-extended 407 (i.e. the value after 0x6e is 0x006f); if the field transitions 408 from 15 bits to 7 bits, it is truncated (i.e. the value after 409 0x1bbe is 0xbf). 411 In the non-flexible mode (when the F bit is set to 0), this PID is 412 used as an index to the picture group (PG) specified in the SS 413 data below. In this mode, the PID of the key frame corresponds to 414 the first specified frame in the PG. Then subsequent PIDs are 415 mapped to subsequently specified frames in the PG (modulo N_G, 416 specified in the SS data below), respectively. 418 All frames of the same picture MUST have the same PID value. 420 Frames (and their corresponding pictures) with the VP9 show_frame 421 field equal to 0 MUST have distinct PID values from subsequent 422 pictures with show_frame equal to 1. Thus, a Picture as defined 423 in this specification is different than a VP9 Superframe. 425 All frames of the same picture MUST have the same value for 426 show_frame. 428 Layer indices: This information is optional but RECOMMENDED whenever 429 encoding with layers. For both flexible and non-flexible modes, 430 one octet is used to specify a layer frame's temporal layer ID 431 (TID) and spatial layer ID (SID) as shown both in Figure 2 and 432 Figure 3. Additionally, a bit (U) is used to indicate that the 433 current frame is a "switching up point" frame. Another bit (D) is 434 used to indicate whether inter-layer prediction is used for the 435 current frame. 437 In the non-flexible mode (when the F bit is set to 0), another 438 octet is used to represent temporal layer 0 index (TL0PICIDX), as 439 depicted in Figure 3. The TL0PICIDX is present so that all 440 minimally required frames - the base temporal layer frames - can 441 be tracked. 443 The TID and SID fields indicate the temporal and spatial layers 444 and can help middleboxes and endpoints quickly identify which 445 layer a packet belongs to. 447 TID: The temporal layer ID of current frame. In the case of non- 448 flexible mode, if PID is mapped to a picture in a specified PG, 449 then the value of TID MUST match the corresponding TID value of 450 the mapped picture in the PG. 452 U: Switching up point. If this bit is set to 1 for the current 453 picture with temporal layer ID equal to TID, then "switch up" 454 to a higher frame rate is possible as subsequent higher 455 temporal layer pictures will not depend on any picture before 456 the current picture (in coding order) with temporal layer ID 457 greater than TID. 459 SID: The spatial layer ID of current frame. Note that frames 460 with spatial layer SID > 0 may be dependent on decoded spatial 461 layer SID-1 frame within the same picture. Different frames of 462 the same picture MUST have distinct spatial layer IDs, and 463 frames' spatial layers MUST appear in increasing order within 464 the frame. 466 D: Inter-layer dependency used. MUST be set to one if and only 467 if the current spatial layer SID frame depends on spatial layer 468 SID-1 frame of the same picture, otherwise MUST be set to zero. 469 For the base layer frame (with SID equal to 0), this D bit MUST 470 be set to zero. 472 TL0PICIDX: 8 bits temporal layer zero index. TL0PICIDX is only 473 present in the non-flexible mode (F = 0). This is a running 474 index for the temporal base layer pictures, i.e., the pictures 475 with TID set to 0. If TID is larger than 0, TL0PICIDX 476 indicates which temporal base layer picture the current picture 477 depends on. TL0PICIDX MUST be incremented by 1 when TID is 478 equal to 0. The index SHOULD start on a random number, and 479 MUST restart at 0 after reaching the maximum number 255. 481 Reference indices: When P and F are both set to one, indicating a 482 non-key frame in flexible mode, then at least one reference index 483 MUST be specified as below. Additional reference indices (total 484 of up to 3 reference indices are allowed) may be specified using 485 the N bit below. When either P or F is set to zero, then no 486 reference index is specified. 488 P_DIFF: The reference index (in 7 bits) specified as the relative 489 PID from the current picture. For example, when P_DIFF=3 on a 490 packet containing the picture with PID 112 means that the 491 picture refers back to the picture with PID 109. This 492 calculation is done modulo the size of the PID field, i.e., 493 either 7 or 15 bits. A P_DIFF value of 0 is invalid. 495 N: 1 if there is additional P_DIFF following the current P_DIFF. 497 4.2.1. Scalability Structure (SS): 499 The scalability structure (SS) data describes the resolution of each 500 frame within a picture as well as the inter-picture dependencies for 501 a picture group (PG). If the VP9 payload descriptor's "V" bit is 502 set, the SS data is present in the position indicated in Figure 2 and 503 Figure 3. 505 +-+-+-+-+-+-+-+-+ 506 V: | N_S |Y|G|-|-|-| 507 +-+-+-+-+-+-+-+-+ -\ 508 Y: | WIDTH | (OPTIONAL) . 509 + + . 510 | | (OPTIONAL) . 511 +-+-+-+-+-+-+-+-+ . - N_S + 1 times 512 | HEIGHT | (OPTIONAL) . 513 + + . 514 | | (OPTIONAL) . 515 +-+-+-+-+-+-+-+-+ -/ 516 G: | N_G | (OPTIONAL) 517 +-+-+-+-+-+-+-+-+ -\ 518 N_G: | TID |U| R |-|-| (OPTIONAL) . 519 +-+-+-+-+-+-+-+-+ -\ . - N_G times 520 | P_DIFF | (OPTIONAL) . - R times . 521 +-+-+-+-+-+-+-+-+ -/ -/ 523 Figure 4 525 N_S: N_S + 1 indicates the number of spatial layers present in the 526 VP9 stream. 528 Y: Each spatial layer's frame resolution present. When set to one, 529 the OPTIONAL WIDTH (2 octets) and HEIGHT (2 octets) MUST be 530 present for each layer frame. Otherwise, the resolution MUST NOT 531 be present. 533 G: PG description present flag. 535 -: Bit reserved for future use. MUST be set to zero and MUST be 536 ignored by the receiver. 538 N_G: N_G indicates the number of pictures in a Picture Group (PG). 539 If N_G is greater than 0, then the SS data allows the inter- 540 picture dependency structure of the VP9 stream to be pre-declared, 541 rather than indicating it on the fly with every packet. If N_G is 542 greater than 0, then for N_G pictures in the PG, each picture's 543 temporal layer ID (TID), switch up point (U), and the Reference 544 indices (P_DIFFs) are specified. 546 The first picture specified in the PG MUST have TID set to 0. 548 G set to 0 or N_G set to 0 indicates that either there is only one 549 temporal layer (for non-flexible mode) or no fixed inter-picture 550 dependency information is present (for flexible mode) going 551 forward in the bitstream. 553 Note that for a given picture, all frames follow the same inter- 554 picture dependency structure. However, the frame rate of each 555 spatial layer can be different from each other and this can be 556 described with the use of the D bit described above. The 557 specified dependency structure in the SS data MUST be for the 558 highest frame rate layer. 560 In a scalable stream sent with a fixed pattern, the SS data SHOULD be 561 included in the first packet of every key frame. This is a packet 562 with P bit equal to zero, SID or L bit equal to zero, and B bit equal 563 to 1. The SS data MUST only be changed on the picture that 564 corresponds to the first picture specified in the previous SS data's 565 PG (if the previous SS data's N_G was greater than 0). 567 4.3. Frame Fragmentation 569 VP9 frames are fragmented into packets, in RTP sequence number order, 570 beginning with a packet with the B bit set, and ending with a packet 571 with the E bit set. There is no mechanism for finer-grained access 572 to parts of a VP9 frame. 574 4.4. Scalable encoding considerations 576 In addition to the use of reference frames, VP9 has several 577 additional forms of inter-frame dependencies, largely involving 578 probability tables for the entropy and tree encoders. In VP9 syntax, 579 the syntax element "error_resilient_mode" resets this additional 580 inter-frame data, allowing a frame's syntax to be decoded 581 independently. 583 Due to the requirements of scalable streams, a VP9 encoder producing 584 a scalable stream needs to ensure that a frame does not depend on a 585 previous frame (of the same or a previous picture) that can 586 legitimately be removed from the stream. Thus, a frame that follows 587 a frame that might be removed (in full decode order) MUST be encoded 588 with "error_resilient_mode" set to true. 590 For spatially-scalable streams, this means that 591 "error_resilient_mode" needs to be turned on for the base spatial 592 layer; it can however be turned off for higher spatial layers, 593 assuming they are sent with inter-layer dependency (i.e. with the "D" 594 bit set). For streams that are only temporally-scalable without 595 spatial scalability, "error_resilient_mode" can additionally be 596 turned off for any picture that immediately follows a temporal layer 597 0 frame. 599 4.5. Examples of VP9 RTP Stream 600 4.5.1. Reference picture use for scalable structure 602 As discussed in Section 3, the VP9 codec can maintain up to eight 603 reference frames, of which up to three can be referenced or updated 604 by any new frame. This section illustrates one way that a scalable 605 structure (with three spatial layers and three temporal layers) can 606 be constructed using these reference frames. 608 +==========+=========+============+=========+ 609 | Temporal | Spatial | References | Updates | 610 +==========+=========+============+=========+ 611 | 0 | 0 | 0 | 0 | 612 +----------+---------+------------+---------+ 613 | 0 | 1 | 0,1 | 1 | 614 +----------+---------+------------+---------+ 615 | 0 | 2 | 1,2 | 2 | 616 +----------+---------+------------+---------+ 617 | 2 | 0 | 0 | 6 | 618 +----------+---------+------------+---------+ 619 | 2 | 1 | 1,6 | 7 | 620 +----------+---------+------------+---------+ 621 | 2 | 2 | 2,7 | - | 622 +----------+---------+------------+---------+ 623 | 1 | 0 | 0 | 3 | 624 +----------+---------+------------+---------+ 625 | 1 | 1 | 1,3 | 4 | 626 +----------+---------+------------+---------+ 627 | 1 | 2 | 2,4 | 5 | 628 +----------+---------+------------+---------+ 629 | 2 | 0 | 3 | 6 | 630 +----------+---------+------------+---------+ 631 | 2 | 1 | 4,6 | 7 | 632 +----------+---------+------------+---------+ 633 | 2 | 2 | 5,7 | - | 634 +----------+---------+------------+---------+ 636 Table 1: Example scalability structure 638 This structure is constructed such that the "U" bit can always be 639 set. 641 5. Feedback Messages and Header Extensions 642 5.1. Reference Picture Selection Indication (RPSI) 644 The reference picture selection index is a payload-specific feedback 645 message defined within the RTCP-based feedback format. The RPSI 646 message is generated by a receiver and can be used in two ways. 647 Either it can signal a preferred reference picture when a loss has 648 been detected by the decoder -- preferably then a reference that the 649 decoder knows is perfect -- or, it can be used as positive feedback 650 information to acknowledge correct decoding of certain reference 651 pictures. The positive feedback method is useful for VP9 used for 652 point to point (unicast) communication. The use of RPSI for VP9 is 653 preferably combined with a special update pattern of the codec's two 654 special reference frames -- the golden frame and the altref frame -- 655 in which they are updated in an alternating leapfrog fashion. When a 656 receiver has received and correctly decoded a golden or altref frame, 657 and that frame had a Picture ID in the payload descriptor, the 658 receiver can acknowledge this simply by sending an RPSI message back 659 to the sender. The message body (i.e., the "native RPSI bit string" 660 in [RFC4585]) is simply the (7 or 15 bit) Picture ID of the received 661 frame. 663 Note: because all frames of the same picture must have the same 664 inter-picture reference structure, there is no need for a message to 665 specify which frame is being selected. 667 5.2. Full Intra Request (FIR) 669 The Full Intra Request (FIR) [RFC5104] RTCP feedback message allows a 670 receiver to request a full state refresh of an encoded stream. 672 Upon receipt of an FIR request, a VP9 sender MUST send a picture with 673 a keyframe for its spatial layer 0 layer frame, and then send frames 674 without inter-picture prediction (P=0) for any higher layer frames. 676 5.3. Layer Refresh Request (LRR) 678 The Layer Refresh Request (LRR) [I-D.ietf-avtext-lrr] allows a 679 receiver to request a single layer of a spatially or temporally 680 encoded stream to be refreshed, without necessarily affecting the 681 stream's other layers. 683 +---------------+---------------+ 684 |0|1|2|3|4|5|6|7|0|1|2|3|4|5|6|7| 685 +---------------+---------+-----+ 686 | RES | TID | RES | SID | 687 +---------------+---------+-----+ 689 Figure 5 691 Figure 5 shows the format of LRR's layer index fields for VP9 692 streams. The two "RES" fields MUST be set to 0 on transmission and 693 ingnored on reception. See Section 4.2 for details on the TID and 694 SID fields. 696 Identification of a layer refresh frame can be derived from the 697 reference IDs of each frame by backtracking the dependency chain 698 until reaching a point where only decodable frames are being 699 referenced. Therefore it's recommended for both the flexible and the 700 non-flexible mode that, when switching up points are being encoded in 701 response to a LRR, those packets should contain layer indices and the 702 reference field(s) so that the decoder or a selective forwarding 703 middleboxes [RFC7667] can make this derivation. 705 Example: 707 LRR {1,0}, {2,1} is sent by an MCU when it is currently relaying 708 {1,0} to a receiver and which wants to upgrade to {2,1}. In response 709 the encoder should encode the next frames in layers {1,1} and {2,1} 710 by only referring to frames in {1,0}, or {0,0}. 712 In the non-flexible mode, periodic upgrade frames can be defined by 713 the layer structure of the SS, thus periodic upgrade frames can be 714 automatically identified by the picture ID. 716 6. Payload Format Parameters 718 This payload format has three optional parameters, "max-fr", "max- 719 fs", and "profile-id". 721 The max-fr and max-fs parameters are used to signal the capabilities 722 of a receiver implementation. If the implementation is willing to 723 receive media, both parameters MUST be provided. These parameters 724 MUST NOT be used for any other purpose. A media sender SHOULD NOT 725 send media with a frame rate or frame size exceeding the max-fr and 726 max-fs values signaled. (There may be scenarios, such as pre-encoded 727 media or selective forwarding middleboxes [RFC7667], where a media 728 sender does not have media available that fits within a receivers 729 max-fs and max-fr value; in such scenarios, a sender MAY exceed the 730 signaled values.) 732 max-fr: The value of max-fr is an integer indicating the maximum 733 frame rate in units of frames per second that the decoder is 734 capable of decoding. 736 max-fs: The value of max-fs is an integer indicating the maximum 737 frame size in units of macroblocks that the decoder is capable of 738 decoding. 740 The decoder is capable of decoding this frame size as long as the 741 width and height of the frame in macroblocks are less than 742 int(sqrt(max-fs * 8)) - for instance, a max-fs of 1200 (capable of 743 supporting 640x480 resolution) will support widths and heights up 744 to 1552 pixels (97 macroblocks). 746 profile-id: The value of profile-id is an integer indicating the 747 default coding profile, the subset of coding tools that may have 748 been used to generate the stream or that the receiver supports). 749 Table 2 lists all of the profiles defined in section 7.2 of 750 [VP9-BITSTREAM] and the corresponding integer values to be used. 752 If no profile-id is present, Profile 0 MUST be inferred. (The 753 profile-id parameter was added relatively late in the development 754 of this specification, so some existing implementations may not 755 send it.) 757 Informative note: See Table 3 for capabilities of coding profiles 758 defined in section 7.2 of [VP9-BITSTREAM]. 760 A receiver MUST ignore any parameter unspecified in this 761 specification. 763 +=========+============+ 764 | Profile | profile-id | 765 +=========+============+ 766 | 0 | 0 | 767 +---------+------------+ 768 | 1 | 1 | 769 +---------+------------+ 770 | 2 | 2 | 771 +---------+------------+ 772 | 3 | 3 | 773 +---------+------------+ 775 Table 2: Table of 776 profile-id integer 777 values representing 778 the VP9 profile 779 corresponding to the 780 set of coding tools 781 supported. 783 +=========+===========+=================+==========================+ 784 | Profile | Bit Depth | SRGB Colorspace | Chroma Subsampling | 785 +=========+===========+=================+==========================+ 786 | 0 | 8 | No | YUV 4:2:0 | 787 +---------+-----------+-----------------+--------------------------+ 788 | 1 | 8 | Yes | YUV 4:2:2,4:4:0 or 4:4:4 | 789 +---------+-----------+-----------------+--------------------------+ 790 | 2 | 10 or 12 | No | YUV 4:2:0 | 791 +---------+-----------+-----------------+--------------------------+ 792 | 3 | 10 or 12 | Yes | YUV 4:2:2,4:4:0 or 4:4:4 | 793 +---------+-----------+-----------------+--------------------------+ 795 Table 3: Table of profile capabilities. 797 6.1. SDP Parameters 799 6.1.1. Mapping of Media Subtype Parameters to SDP 801 The media type video/VP9 string is mapped to fields in the Session 802 Description Protocol (SDP) [RFC8866] as follows: 804 * The media name in the "m=" line of SDP MUST be video. 806 * The encoding name in the "a=rtpmap" line of SDP MUST be VP9 (the 807 media subtype). 809 * The clock rate in the "a=rtpmap" line MUST be 90000. 811 * The parameters "max-fr" and "max-fs" MUST be included in the 812 "a=fmtp" line of SDP if the receiver wishes to declare its 813 receiver capabilities. These parameters are expressed as a media 814 subtype string, in the form of a semicolon separated list of 815 parameter=value pairs. 817 * The OPTIONAL parameter profile-id, when present, SHOULD be 818 included in the "a=fmtp" line of SDP. This parameter is expressed 819 as a media subtype string, in the form of a parameter=value pair. 820 When the parameter is not present, a value of 0 MUST be inferred 821 for profile-id. 823 6.1.1.1. Example 825 An example of media representation in SDP is as follows: 827 m=video 49170 RTP/AVPF 98 828 a=rtpmap:98 VP9/90000 829 a=fmtp:98 max-fr=30;max-fs=3600;profile-id=0 831 6.1.2. Offer/Answer Considerations 833 When VP9 is offered over RTP using SDP in an Offer/Answer model 834 [RFC3264] for negotiation for unicast usage, the following 835 limitations and rules apply: 837 * The parameter identifying a media format configuration for VP9 is 838 profile-id. This media format configuration parameter MUST be 839 used symmetrically; that is, the answerer MUST either maintain 840 this configuration parameter or remove the media format (payload 841 type) completely if it is not supported. 843 * The max-fr and max-fs parameters are used declaratively to 844 describe receiver capabilities, even in the Offer/Answer model. 845 The values in an answer are used to describe the answerer's 846 capabilities, and thus their values are set independently of the 847 values in the offer. 849 * To simplify the handling and matching of these configurations, the 850 same RTP payload type number used in the offer SHOULD also be used 851 in the answer and in a subsequent offer, as specified in 852 [RFC3264]. An answer or subsequent offer MUST NOT contain the 853 payload type number used in the offer unless the profile-id value 854 is exactly the same as in the original offer. However, max-fr and 855 max-fs parameters MAY be changed in subsequent offers and answers, 856 with the same payload type number, if an endpoint wishes to change 857 its declared receiver capabilities. 859 7. Media Type Definition 861 This registration is done using the template defined in [RFC6838] and 862 following [RFC4855]. 864 Type name: 865 video 867 Subtype name: 868 VP9 870 Required parameters: 871 N/A. 873 Optional parameters: 874 There are three optional parameters, "max-fr", "max-fs", and 875 "profile-id". See Section 6 for their definition. 877 Encoding considerations: 878 This media type is framed in RTP and contains binary data; see 879 Section 4.8 of [RFC6838]. 881 Security considerations: 882 See Section 8 of RFC xxxx. 884 [RFC Editor: Upon publication as an RFC, please replace "XXXX" 885 with the number assigned to this document and remove this note.] 887 Interoperability considerations: 888 None. 890 Published specification: 891 VP9 bitstream format [VP9-BITSTREAM] and RFC XXXX. 893 [RFC Editor: Upon publication as an RFC, please replace "XXXX" 894 with the number assigned to this document and remove this note.] 896 Applications which use this media type: 897 For example: Video over IP, video conferencing. 899 Fragment identifier considerations: 900 N/A. 902 Additional information: 903 None. 905 Person & email address to contact for further information: 906 Jonathan Lennox 908 Intended usage: 909 COMMON 911 Restrictions on usage: 912 This media type depends on RTP framing, and hence is only defined 913 for transfer via RTP [RFC3550]. 915 Author: 916 Jonathan Lennox 918 Change controller: 919 IETF AVTCore Working Group delegated from the IESG. 921 8. Security Considerations 923 RTP packets using the payload format defined in this specification 924 are subject to the security considerations discussed in the RTP 925 specification [RFC3550], and in any applicable RTP profile such as 926 RTP/AVP [RFC3551], RTP/AVPF [RFC4585], RTP/SAVP [RFC3711], or RTP/ 927 SAVPF [RFC5124]. However, as "Securing the RTP Protocol Framework: 928 Why RTP Does Not Mandate a Single Media Security Solution" [RFC7202] 929 discusses, it is not an RTP payload format's responsibility to 930 discuss or mandate what solutions are used to meet the basic security 931 goals like confidentiality, integrity and source authenticity for RTP 932 in general. This responsibility lays on anyone using RTP in an 933 application. They can find guidance on available security mechanisms 934 in Options for Securing RTP Sessions [RFC7201]. Applications SHOULD 935 use one or more appropriate strong security mechanisms. The rest of 936 this security consideration section discusses the security impacting 937 properties of the payload format itself. 939 Implementations of this RTP payload format need to take appropriate 940 security considerations into account. It is extremely important for 941 the decoder to be robust against malicious or malformed payloads and 942 ensure that they do not cause the decoder to overrun its allocated 943 memory or otherwise mis-behave. An overrun in allocated memory could 944 lead to arbitrary code execution by an attacker. The same applies to 945 the encoder, even though problems in encoders are typically rarer. 947 This RTP payload format and its media decoder do not exhibit any 948 significant non-uniformity in the receiver-side computational 949 complexity for packet processing, and thus are unlikely to pose a 950 denial-of-service threat due to the receipt of pathological data. 951 Nor does the RTP payload format contain any active content. 953 9. Congestion Control 955 Congestion control for RTP SHALL be used in accordance with RFC 3550 956 [RFC3550], and with any applicable RTP profile; e.g., RFC 3551 957 [RFC3551]. The congestion control mechanism can, in a real-time 958 encoding scenario, adapt the transmission rate by instructing the 959 encoder to encode at a certain target rate. Media aware network 960 elements MAY use the information in the VP9 payload descriptor in 961 Section 4.2 to identify non-reference frames and discard them in 962 order to reduce network congestion. Note that discarding of non- 963 reference frames cannot be done if the stream is encrypted (because 964 the non-reference marker is encrypted). 966 10. IANA Considerations 968 The IANA is requested to register the media type registration "video/ 969 vp9" as specified in Section 7. The media type is also requested to 970 be added to the IANA registry for "RTP Payload Format MIME types" 971 . 973 11. Acknowledgments 975 Alex Eleftheriadis, Yuki Ito, Won Kap Jang, Sergio Garcia Murillo, 976 Roi Sasson, Timothy Terriberry, Emircan Uysaler, and Thomas Volkert 977 commented on the development of this document and provided helpful 978 comments and feedback. 980 12. References 982 12.1. Normative References 984 [I-D.ietf-avtext-lrr] 985 Lennox, J., Hong, D., Uberti, J., Holmer, S., and M. 986 Flodman, "The Layer Refresh Request (LRR) RTCP Feedback 987 Message", Work in Progress, Internet-Draft, draft-ietf- 988 avtext-lrr-07, 2 July 2017, 989 . 992 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 993 Requirement Levels", BCP 14, RFC 2119, 994 DOI 10.17487/RFC2119, March 1997, 995 . 997 [RFC3264] Rosenberg, J. and H. Schulzrinne, "An Offer/Answer Model 998 with Session Description Protocol (SDP)", RFC 3264, 999 DOI 10.17487/RFC3264, June 2002, 1000 . 1002 [RFC3550] Schulzrinne, H., Casner, S., Frederick, R., and V. 1003 Jacobson, "RTP: A Transport Protocol for Real-Time 1004 Applications", STD 64, RFC 3550, DOI 10.17487/RFC3550, 1005 July 2003, . 1007 [RFC4585] Ott, J., Wenger, S., Sato, N., Burmeister, C., and J. Rey, 1008 "Extended RTP Profile for Real-time Transport Control 1009 Protocol (RTCP)-Based Feedback (RTP/AVPF)", RFC 4585, 1010 DOI 10.17487/RFC4585, July 2006, 1011 . 1013 [RFC4855] Casner, S., "Media Type Registration of RTP Payload 1014 Formats", RFC 4855, DOI 10.17487/RFC4855, February 2007, 1015 . 1017 [RFC5104] Wenger, S., Chandra, U., Westerlund, M., and B. Burman, 1018 "Codec Control Messages in the RTP Audio-Visual Profile 1019 with Feedback (AVPF)", RFC 5104, DOI 10.17487/RFC5104, 1020 February 2008, . 1022 [RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type 1023 Specifications and Registration Procedures", BCP 13, 1024 RFC 6838, DOI 10.17487/RFC6838, January 2013, 1025 . 1027 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 1028 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 1029 May 2017, . 1031 [RFC8866] Begen, A., Kyzivat, P., Perkins, C., and M. Handley, "SDP: 1032 Session Description Protocol", RFC 8866, 1033 DOI 10.17487/RFC8866, January 2021, 1034 . 1036 [VP9-BITSTREAM] 1037 Grange, A., de Rivaz, P., and J. Hunt, "VP9 Bitstream & 1038 Decoding Process Specification", Version 0.6, 31 March 1039 2016, 1040 . 1044 12.2. Informative References 1046 [RFC3551] Schulzrinne, H. and S. Casner, "RTP Profile for Audio and 1047 Video Conferences with Minimal Control", STD 65, RFC 3551, 1048 DOI 10.17487/RFC3551, July 2003, 1049 . 1051 [RFC3711] Baugher, M., McGrew, D., Naslund, M., Carrara, E., and K. 1052 Norrman, "The Secure Real-time Transport Protocol (SRTP)", 1053 RFC 3711, DOI 10.17487/RFC3711, March 2004, 1054 . 1056 [RFC5124] Ott, J. and E. Carrara, "Extended Secure RTP Profile for 1057 Real-time Transport Control Protocol (RTCP)-Based Feedback 1058 (RTP/SAVPF)", RFC 5124, DOI 10.17487/RFC5124, February 1059 2008, . 1061 [RFC6386] Bankoski, J., Koleszar, J., Quillio, L., Salonen, J., 1062 Wilkins, P., and Y. Xu, "VP8 Data Format and Decoding 1063 Guide", RFC 6386, DOI 10.17487/RFC6386, November 2011, 1064 . 1066 [RFC7201] Westerlund, M. and C. Perkins, "Options for Securing RTP 1067 Sessions", RFC 7201, DOI 10.17487/RFC7201, April 2014, 1068 . 1070 [RFC7202] Perkins, C. and M. Westerlund, "Securing the RTP 1071 Framework: Why RTP Does Not Mandate a Single Media 1072 Security Solution", RFC 7202, DOI 10.17487/RFC7202, April 1073 2014, . 1075 [RFC7667] Westerlund, M. and S. Wenger, "RTP Topologies", RFC 7667, 1076 DOI 10.17487/RFC7667, November 2015, 1077 . 1079 Authors' Addresses 1081 Justin Uberti 1082 Google, Inc. 1083 747 6th Street South 1084 Kirkland, WA 98033 1085 United States of America 1087 Email: justin@uberti.name 1089 Stefan Holmer 1090 Google, Inc. 1091 Kungsbron 2 1092 SE-111 22 Stockholm 1093 Sweden 1095 Email: holmer@google.com 1097 Magnus Flodman 1098 Google, Inc. 1099 Kungsbron 2 1100 SE-111 22 Stockholm 1101 Sweden 1103 Email: mflodman@google.com 1104 Danny Hong 1105 Google, Inc. 1106 1585 Charleston Road 1107 Mountain View, CA 94043 1108 United States of America 1110 Email: dannyhong@google.com 1112 Jonathan Lennox 1113 8x8, Inc. / Jitsi 1114 1350 Broadway 1115 New York, NY 10018 1116 United States of America 1118 Email: jonathan.lennox@8x8.com