From c614948c33cbb80f01f45e08fe1c81e7f37b3d5e Mon Sep 17 00:00:00 2001 From: Bernard Aboba Date: Thu, 16 Mar 2023 13:42:50 -0400 Subject: [PATCH 01/12] Extend EncodedVideoChunkMetadata for Spatial SVC Fixes https://github.com/w3c/webcodecs/issues/619 Rebase of PR https://github.com/w3c/webcodecs/pull/636 --- index.src.html | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/index.src.html b/index.src.html index 1bdf060b..2b25eb05 100644 --- a/index.src.html +++ b/index.src.html @@ -54,6 +54,15 @@
 {
+  "AV1-RTP": {
+    "title": "RTP Payload Format for AV1",
+    "href": "https://aomediacodec.github.io/av1-rtp-spec/",
+    "authors": [
+      "AV1 RTC SG
+    ],
+    "status": "Standard",
+    "publisher": "Alliance for Open Media"
+  },
   "H.273": {
     "href": "https://www.itu.int/rec/T-REC-H.273/en",
     "title": "Coding-independent code points for video signal type identification",

From 96f5b42e2b0b064abf2a53ac90ebef214d9a3156 Mon Sep 17 00:00:00 2001
From: Bernard Aboba 
Date: Thu, 16 Mar 2023 13:44:58 -0400
Subject: [PATCH 02/12] Add missing quote

---
 index.src.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/index.src.html b/index.src.html
index 2b25eb05..d94467d5 100644
--- a/index.src.html
+++ b/index.src.html
@@ -58,7 +58,7 @@
     "title": "RTP Payload Format for AV1",
     "href": "https://aomediacodec.github.io/av1-rtp-spec/",
     "authors": [
-      "AV1 RTC SG
+      "AV1 RTC SG"
     ],
     "status": "Standard",
     "publisher": "Alliance for Open Media"

From 685a192df7c1b129f43ab418d1d663cdfb28ba63 Mon Sep 17 00:00:00 2001
From: Bernard Aboba 
Date: Thu, 16 Mar 2023 14:16:58 -0400
Subject: [PATCH 03/12] Add definitions of Spatial Layer, Chains, Frame Number
 and Decode Target

---
 index.src.html | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/index.src.html b/index.src.html
index d94467d5..4e3c4964 100644
--- a/index.src.html
+++ b/index.src.html
@@ -137,6 +137,24 @@
 :: A grouping of {{EncodedVideoChunk}}s whose timestamp cadence produces a
     particular framerate. See {{VideoEncoderConfig/scalabilityMode}}.
 
+: Spatial Layer
+:: A grouping of {{EncodedVideoChunk}}s which produces a particular
+    resolution. See {{VideoEncoderConfig/scalabilityMode}}.
+    
+: Chains
+:: A sequence of frames for which it can be determined instantly if a frame
+     from that sequence has been lost. Defined in Section A.5 of [[AV1-RTP]].
+     
+: Frame Number
+:: A 16-bit number that increases monotonically in decode order. Defined in
+     Section A.8.3 of [[AV1-RTP]].
+     
+: Decode Target
+:: A numerical index determined by the encoder that indicates the set of
+     frames needed to decode a sequence of {{EncodedVideoChunk}}s at a
+     given spatial and temporal fidelity. Values do not necessarily
+     correspond to a given [=Temporal Layer=] or [=Spatial Layer=].
+    
 : Progressive Image
 :: An image that supports decoding to multiple levels of detail, with lower
     levels becoming available while the encoded data is not yet fully buffered.

From e0d42cf6e5c763e1aa71241eb9e54eeb21fbd16b Mon Sep 17 00:00:00 2001
From: Bernard Aboba 
Date: Thu, 16 Mar 2023 15:07:24 -0400
Subject: [PATCH 04/12] Add svc dictionary members

---
 index.src.html | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/index.src.html b/index.src.html
index 4e3c4964..ba7108dc 100644
--- a/index.src.html
+++ b/index.src.html
@@ -1719,6 +1719,11 @@
 
 dictionary SvcOutputMetadata {
   unsigned long temporalLayerId;
+  unsigned long spatialLayerId;
+  unsigned long frameNumber;
+  sequence  dependencies;
+  sequence  decodeTargets;
+  map  chainLinks;
 };
 
 
@@ -1735,9 +1740,27 @@
     channel data.
 
 : temporalLayerId
-:: A number that identifies the [=temporal layer=] for the associated
+:: A number that identifies the [=Temporal Layer=] for the associated
     {{EncodedVideoChunk}}.
+    
+: spatialLayerId
+:: A number that identifies the [=Spatial Layer=] for the associated
+    {{EncodedVideoChunk}}.
+    
+: frameNumber
+:: A number that identifies the frame.
 
+: dependencies
+:: A sequence of frame number values that this {{EncodedVideoChunk}}
+     depends on.
+     
+: decodeTargets
+:: A sequence of [=Decode Target=] values that this {{EncodedVideoChunk}}
+     participates in.
+     
+: chainLinks
+:: A mapping of [=Decode Target=] values to the last important frame
+     to decode prior to this {{EncodedVideoChunk}}.
 
 Configurations{#configurations}
 ===============================

From d63c40928ec794b2c59ae854197347a67c08e651 Mon Sep 17 00:00:00 2001
From: Bernard Aboba 
Date: Thu, 16 Mar 2023 15:17:08 -0400
Subject: [PATCH 05/12] Use maplike

---
 index.src.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/index.src.html b/index.src.html
index ba7108dc..1ce9d499 100644
--- a/index.src.html
+++ b/index.src.html
@@ -1723,7 +1723,7 @@
   unsigned long frameNumber;
   sequence  dependencies;
   sequence  decodeTargets;
-  map  chainLinks;
+  maplike  chainLinks;
 };
 
 

From 343528a9e599ef4ecfb192369a05d700c7667ef3 Mon Sep 17 00:00:00 2001
From: Bernard Aboba 
Date: Thu, 16 Mar 2023 15:28:26 -0400
Subject: [PATCH 06/12] Remove map

---
 index.src.html | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/index.src.html b/index.src.html
index 1ce9d499..fce01375 100644
--- a/index.src.html
+++ b/index.src.html
@@ -1723,7 +1723,7 @@
   unsigned long frameNumber;
   sequence  dependencies;
   sequence  decodeTargets;
-  maplike  chainLinks;
+  sequence  chainLinks;
 };
 
 
@@ -1759,8 +1759,8 @@
      participates in.
      
 : chainLinks
-:: A mapping of [=Decode Target=] values to the last important frame
-     to decode prior to this {{EncodedVideoChunk}}.
+:: A mapping of [=Decode Target=] values to the frame number of the
+     last important frame to decode prior to this {{EncodedVideoChunk}}.
 
 Configurations{#configurations}
 ===============================

From 81afaf3dd72d3cfa07086159f622206c5839ed9e Mon Sep 17 00:00:00 2001
From: Bernard Aboba 
Date: Thu, 16 Mar 2023 15:38:25 -0400
Subject: [PATCH 07/12] Handle spatial scalability

---
 index.src.html | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/index.src.html b/index.src.html
index fce01375..84e13c4f 100644
--- a/index.src.html
+++ b/index.src.html
@@ -1666,11 +1666,20 @@
                 |svc|.{{SvcOutputMetadata/temporalLayerId}}.
             4. Assign |svc| to
                 |chunkMetadata|.{{EncodedVideoChunkMetadata/svc}}.
-        8. If |encoderConfig|.{{VideoEncoderConfig/alpha}} is set to `"keep"`:
+        8. If |encoderConfig|.{{VideoEncoderConfig/scalabilityMode}}
+            describes more than one [=Spatial Layer=]:
+            1. Let |svc| be a new {{SvcOutputMetadata}} instance.
+            2. Let |spatial_layer_id| be the zero-based index describing the
+                spatial layer for |output|.
+            3. Assign |spatial_layer_id| to
+                |svc|.{{SvcOutputMetadata/spatialLayerId}}.
+            4. Assign |svc| to
+                |chunkMetadata|.{{EncodedVideoChunkMetadata/svc}}.
+        9. If |encoderConfig|.{{VideoEncoderConfig/alpha}} is set to `"keep"`:
             1. Let |alphaSideData| be the encoded alpha data in |output|.
             2. Assign |alphaSideData| to
                 |chunkMetadata|.{{EncodedVideoChunkMetadata/alphaSideData}}.
-        9. Invoke {{VideoEncoder/[[output callback]]}} with |chunk| and
+        10. Invoke {{VideoEncoder/[[output callback]]}} with |chunk| and
             |chunkMetadata|.
   
   
Reset VideoEncoder (with |exception|)
From 356d764fa0a3297c4fcff4645ebc02aaebc82e39 Mon Sep 17 00:00:00 2001 From: Bernard Aboba Date: Tue, 18 Apr 2023 00:41:32 -0700 Subject: [PATCH 08/12] Fix chainLink type --- index.src.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.src.html b/index.src.html index 84e13c4f..c4709b80 100644 --- a/index.src.html +++ b/index.src.html @@ -1732,7 +1732,7 @@ unsigned long frameNumber; sequence dependencies; sequence decodeTargets; - sequence chainLinks; + report chainLinks; }; From a09a6920da01043bcfea434b58297bf702ecae03 Mon Sep 17 00:00:00 2001 From: Bernard Aboba Date: Tue, 18 Apr 2023 00:51:09 -0700 Subject: [PATCH 09/12] Fix typo --- index.src.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.src.html b/index.src.html index c4709b80..3a504177 100644 --- a/index.src.html +++ b/index.src.html @@ -1732,7 +1732,7 @@ unsigned long frameNumber; sequence dependencies; sequence decodeTargets; - report chainLinks; + record chainLinks; }; From d081591a3ba5c8755105daad596e23498961dfa1 Mon Sep 17 00:00:00 2001 From: Bernard Aboba Date: Fri, 21 Apr 2023 17:19:55 -0700 Subject: [PATCH 10/12] record -> map --- index.src.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.src.html b/index.src.html index 3a504177..31fc89e5 100644 --- a/index.src.html +++ b/index.src.html @@ -1732,7 +1732,7 @@ unsigned long frameNumber; sequence dependencies; sequence decodeTargets; - record chainLinks; + map chainLinks; }; From 8dedd2fec26e208abecf5e68354a10f8a769b647 Mon Sep 17 00:00:00 2001 From: Bernard Aboba Date: Fri, 21 Apr 2023 17:24:10 -0700 Subject: [PATCH 11/12] map -> maplike --- index.src.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.src.html b/index.src.html index 31fc89e5..025e364c 100644 --- a/index.src.html +++ b/index.src.html @@ -1732,7 +1732,7 @@ unsigned long frameNumber; sequence dependencies; sequence decodeTargets; - map chainLinks; + maplike chainLinks; }; From 75e05405cc184742a6bd622f6a0bf4bc92a27d72 Mon Sep 17 00:00:00 2001 From: Bernard Aboba Date: Tue, 25 Apr 2023 14:11:45 -0700 Subject: [PATCH 12/12] Use of record --- index.src.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.src.html b/index.src.html index 025e364c..de3e8690 100644 --- a/index.src.html +++ b/index.src.html @@ -1732,7 +1732,7 @@ unsigned long frameNumber; sequence dependencies; sequence decodeTargets; - maplike chainLinks; + record chainLinks; };