Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: b6260a60632edbe368a8521db8ca1ac56385352e
https://github.com/WebKit/WebKit/commit/b6260a60632edbe368a8521db8ca1ac56385352e
Author: Jean-Yves Avenard <[email protected]>
Date: 2026-10-08 (Thu, 08 Oct 2026)
Changed paths:
A
LayoutTests/http/wpt/webcodecs/videoFrame-high-bit-depth-formats-disabled-expected.txt
A
LayoutTests/http/wpt/webcodecs/videoFrame-high-bit-depth-formats-disabled.html
A
LayoutTests/http/wpt/webcodecs/videoFrame-high-bit-depth-formats-expected.txt
A LayoutTests/http/wpt/webcodecs/videoFrame-high-bit-depth-formats.html
M
LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-construction.any.worker-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-drawImage-hbd.any-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-drawImage-hbd.any.worker-expected.txt
M Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
M Source/WebCore/Modules/webcodecs/VideoPixelFormat.idl
M Source/WebCore/Modules/webcodecs/WebCodecsVideoFrame.cpp
M Source/WebCore/Modules/webcodecs/WebCodecsVideoFrameAlgorithms.cpp
M Source/WebCore/Modules/webcodecs/WebCodecsVideoFrameAlgorithms.h
M Source/WebCore/platform/VideoPixelFormat.cpp
M Source/WebCore/platform/VideoPixelFormat.h
Log Message:
-----------
[webcodec] Add the WebCodecs I420P10, I420P12, I422P10, I422P12, I444P10 and
I444P12 VideoPixelFormat values
https://bugs.webkit.org/show_bug.cgi?id=325922
rdar://188889467
Reviewed by Youenn Fablet.
VideoPixelFormat had no high bit depth values, so a VideoFrame could not be
constructed with one of the spec's 10 and 12 bit formats, and the layout
algorithms assumed one byte per sample for every format.
The six non-alpha planar formats are added behind the new
WebCodecsHighBitDepthEnabled preference. Each uses its 8-bit counterpart's
plane count, sub-sampling and offset alignment, with two bytes per sample.
Constructing a frame from a buffer in these formats throws NotSupportedError
until frame creation for them is implemented, and TypeError when the
preference is off.
*
LayoutTests/http/wpt/webcodecs/videoFrame-high-bit-depth-formats-disabled-expected.txt:
Added.
*
LayoutTests/http/wpt/webcodecs/videoFrame-high-bit-depth-formats-disabled.html:
Added.
*
LayoutTests/http/wpt/webcodecs/videoFrame-high-bit-depth-formats-expected.txt:
Added.
* LayoutTests/http/wpt/webcodecs/videoFrame-high-bit-depth-formats.html: Added.
* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WebCore/Modules/webcodecs/VideoPixelFormat.idl:
* Source/WebCore/Modules/webcodecs/WebCodecsVideoFrame.cpp:
(WebCore::WebCodecsVideoFrame::create): Reject the high bit depth formats when
the preference is off.
(WebCore::computeVideoPixelFormat):
* Source/WebCore/Modules/webcodecs/WebCodecsVideoFrameAlgorithms.cpp:
(WebCore::verifyRectOffsetAlignment):
(WebCore::videoPixelFormatToPlaneCount):
(WebCore::videoPixelFormatToSampleByteSizePerPlane): Return 2 for the high bit
depth formats.
(WebCore::sampleCountPerPixel):
(WebCore::videoPixelFormatToHorizontalSubSampling):
(WebCore::videoPixelFormatToVerticalSubSampling):
(WebCore::computeLayoutAndAllocationSize):
* Source/WebCore/Modules/webcodecs/WebCodecsVideoFrameAlgorithms.h:
* Source/WebCore/platform/VideoPixelFormat.cpp:
(WebCore::convertVideoPixelFormatToString):
* Source/WebCore/platform/VideoPixelFormat.h:
(WebCore::isHighBitDepthVideoPixelFormat): Added.
Canonical link: https://commits.webkit.org/323168@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications