Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 05dbfe1a59f63860bce30ddff7113da859fd2636
https://github.com/WebKit/WebKit/commit/05dbfe1a59f63860bce30ddff7113da859fd2636
Author: Jean-Yves Avenard <[email protected]>
Date: 2026-10-07 (Wed, 07 Oct 2026)
Changed paths:
A
LayoutTests/http/wpt/webcodecs/vp9-codec-string-bit-depth-and-chroma-expected.txt
A LayoutTests/http/wpt/webcodecs/vp9-codec-string-bit-depth-and-chroma.html
A
LayoutTests/imported/w3c/web-platform-tests/webcodecs/vp9-codec-string-profile-constraints.https.any-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/webcodecs/vp9-codec-string-profile-constraints.https.any.html
A
LayoutTests/imported/w3c/web-platform-tests/webcodecs/vp9-codec-string-profile-constraints.https.any.js
A
LayoutTests/imported/w3c/web-platform-tests/webcodecs/vp9-codec-string-profile-constraints.https.any.worker-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/webcodecs/vp9-codec-string-profile-constraints.https.any.worker.html
M LayoutTests/platform/glib/TestExpectations
M Source/WebCore/Modules/webcodecs/WebCodecsVideoDecoder.cpp
M Source/WebCore/Modules/webcodecs/WebCodecsVideoEncoder.cpp
M Source/WebCore/platform/graphics/VP9Utilities.cpp
M Source/WebCore/platform/graphics/VP9Utilities.h
Log Message:
-----------
WebCodecs ignores the bit depth and chroma subsampling in VP9 codec strings
https://bugs.webkit.org/show_bug.cgi?id=325883
rdar://188868426
Reviewed by Youenn Fablet.
WebCodecsVideoDecoder and WebCodecsVideoEncoder accepted any codec string
starting with "vp09.00", or
"vp09.02" when VP9 profile 2 was enabled, without parsing the remaining fields.
Strings missing the
level or bit depth, strings whose bit depth or chroma subsampling contradicted
the profile
(vp09.00.10.10, vp09.02.10.08, vp09.00.10.08.03), and 12-bit profile 2 strings
were reported as
supported; the decoder then dropped or corrupted the frames and the encoder
produced a stream that did
not match.
The WebCodecs VP9 registration defines the codec string through the "Codecs
Parameter String" section
of the VP Codec ISO Media File Format Binding, which limits bit depth and
chroma subsampling by
profile: profile 0 is 8-bit 4:2:0 and profile 2 is 10 or 12-bit 4:2:0. A string
that violates this is
not a valid codec string, which Check Configuration Support step 1 requires to
be unsupported. VP9
codec strings are now parsed with parseVPCodecParametersIgnoringColorFields(),
which validates the
mandatory fields and the chroma subsampling without requiring the color fields
that follow, as
WebCodecs strings commonly omit them. Profile 0 must be 8-bit and profile 2
must be 10-bit, both with
4:2:0 chroma; 12-bit profile 2 is valid but not supported by either the decoder
or the encoder.
The new WPT test covers the invalid strings, which every implementation must
reject. The WebKit test
covers which valid strings WebKit supports.
*
LayoutTests/http/wpt/webcodecs/vp9-codec-string-bit-depth-and-chroma-expected.txt:
Added.
* LayoutTests/http/wpt/webcodecs/vp9-codec-string-bit-depth-and-chroma.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/webcodecs/vp9-codec-string-profile-constraints.https.any-expected.txt:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/webcodecs/vp9-codec-string-profile-constraints.https.any.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/webcodecs/vp9-codec-string-profile-constraints.https.any.js:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/webcodecs/vp9-codec-string-profile-constraints.https.any.worker-expected.txt:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/webcodecs/vp9-codec-string-profile-constraints.https.any.worker.html:
Added.
* LayoutTests/platform/glib/TestExpectations:
* Source/WebCore/Modules/webcodecs/WebCodecsVideoDecoder.cpp:
(WebCore::isSupportedVP9DecoderCodec): Added.
(WebCore::isSupportedDecoderCodec): Use it for vp09 strings.
* Source/WebCore/Modules/webcodecs/WebCodecsVideoEncoder.cpp:
(WebCore::isSupportedVP9EncoderCodec): Added.
(WebCore::isSupportedEncoderCodec): Use it for vp09 strings.
* Source/WebCore/platform/graphics/VP9Utilities.cpp:
(WebCore::parseVPCodecParametersIgnoringColorFields): Added.
* Source/WebCore/platform/graphics/VP9Utilities.h:
Canonical link: https://commits.webkit.org/322962@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications