diff --git a/index.src.html b/index.src.html
index b6aee7be..c2b7d5f5 100644
--- a/index.src.html
+++ b/index.src.html
@@ -78,6 +78,12 @@
"Youenn Fablet"
],
"status": "ED"
+ },
+ "ISO-29170-1": {
+ "href": "https://www.iso.org/standard/66532.html",
+ "title": "ISO/IEC 29170-1:2017 - Information technology — Advanced image coding and evaluation — Part 1: Guidelines for image quality assessment",
+ "publisher": "ISO",
+ "date": "November 2017"
}
}
@@ -1689,9 +1695,15 @@
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
+ 9. If |output| contains Peak Signal-to-Noise Ratio (PSNR) metrics:
+ 1. Let |psnr| be a new {{YuvVideoPsnr}} dictionary.
+ 2. Assign the PSNR value for the Y plane in |output| to |psnr|.{{YuvVideoPsnr/y}}.
+ 3. Assign the PSNR value for the U plane in |output| to |psnr|.{{YuvVideoPsnr/u}}.
+ 4. Assign the PSNR value for the V plane in |output| to |psnr|.{{YuvVideoPsnr/v}}.
+ 5. Assign |psnr| to |chunkMetadata|.{{EncodedVideoChunkMetadata/psnr}}.
+ 10. Invoke {{VideoEncoder/[[output callback]]}} with |chunk| and
|chunkMetadata|.
-
+
Reset VideoEncoder (with |exception|)
Run these steps:
@@ -1733,11 +1745,18 @@
VideoDecoderConfig decoderConfig;
SvcOutputMetadata svc;
BufferSource alphaSideData;
+ YuvVideoPsnr psnr;
};
dictionary SvcOutputMetadata {
unsigned long temporalLayerId;
};
+
+dictionary YuvVideoPsnr {
+ double y;
+ double u;
+ double v;
+};
: decoderConfig
@@ -1756,6 +1775,32 @@
:: A number that identifies the [=temporal layer=] for the associated
{{EncodedVideoChunk}}.
+: psnr
+:: The Peak Signal-to-Noise Ratio (PSNR) metrics for the encoded frame, if
+ requested and supported. See {{YuvVideoPsnr}}.
+
+
+YuvVideoPsnr dictionary{#yuv-video-psnr}
+----------------------------------------
+The {{YuvVideoPsnr}} dictionary contains Peak Signal-to-Noise Ratio (PSNR)
+values for the Y, U, and V planes, computed in decibels (dB) according to
+[[ISO-29170-1]].
+
+: y
+:: The Peak Signal-to-Noise Ratio (PSNR) value for the Y (Luma) plane in dB.
+: u
+:: The Peak Signal-to-Noise Ratio (PSNR) value for the U (Chroma) plane in dB.
+: v
+:: The Peak Signal-to-Noise Ratio (PSNR) value for the V (Chroma) plane in dB.
+
+ NOTE: PSNR measurements are calculated by comparing the input frame with the
+ reconstructed frame at the configured coded resolution of the encoder.
+ If the input frame's resolution differs from the configured encoder resolution
+ and is scaled during encoding, the scaled version serves as the reference frame
+ for the PSNR calculation.
+
+
+
Configurations{#configurations}
===============================
@@ -2464,6 +2509,7 @@
dictionary VideoEncoderEncodeOptions {
boolean keyFrame = false;
+ boolean generatePsnr = false;
};
@@ -2477,7 +2523,14 @@
MUST be encoded as a key frame. A value of `false`
indicates that the User Agent has flexibility to decide whether the frame
will be encoded as a [=key frame=].
-
+
+generatePsnr
+
+ A value of `true` indicates that the Encoder will attempt to compute PSNR
+ metrics for the encoded frame and provide them as part of the
+ {{EncodedVideoChunkMetadata}}. Note that not all encoders supports this, so
+ the metrics is provided on a best-effort basis.
+