From 2fd5ade76fa887a6e48303134418b3550593022a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Spr=C3=A5ng?= Date: Mon, 1 Jun 2026 17:15:31 +0200 Subject: [PATCH 1/2] first stub --- index.src.html | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/index.src.html b/index.src.html index b6aee7be..1b63e254 100644 --- a/index.src.html +++ b/index.src.html @@ -1733,11 +1733,17 @@ VideoDecoderConfig decoderConfig; SvcOutputMetadata svc; BufferSource alphaSideData; + YuvVideoPsnr psnr; }; dictionary SvcOutputMetadata { unsigned long temporalLayerId; }; +dictionary YuvVideoPsnr { + double y; + double u; + double v; +}; : decoderConfig @@ -2464,6 +2470,7 @@ dictionary VideoEncoderEncodeOptions { boolean keyFrame = false; + boolean generatePsnr = false; }; @@ -2477,7 +2484,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. +
From 904163ec1c94f2f53a453b40ac5687072b7a9c19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Spr=C3=A5ng?= Date: Mon, 1 Jun 2026 17:30:46 +0200 Subject: [PATCH 2/2] more psnr details --- index.src.html | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/index.src.html b/index.src.html index 1b63e254..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: @@ -1739,6 +1751,7 @@ dictionary SvcOutputMetadata { unsigned long temporalLayerId; }; + dictionary YuvVideoPsnr { double y; double u; @@ -1762,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} ===============================