Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: b85d0dce6c17069c21e3a822334e4a6fde3f3f1d
https://github.com/WebKit/WebKit/commit/b85d0dce6c17069c21e3a822334e4a6fde3f3f1d
Author: Youenn Fablet <[email protected]>
Date: 2026-09-28 (Mon, 28 Sep 2026)
Changed paths:
M
LayoutTests/imported/w3c/web-platform-tests/webcodecs/full-cycle-test.https.any.js
M Source/WebCore/platform/graphics/PlatformVideoColorSpace.h
M Source/WebCore/platform/libwebrtc/LibWebRTCVPXVideoEncoder.cpp
M
Source/WebCore/platform/mediastream/cocoa/RealtimeOutgoingVideoSourceCocoa.cpp
M Source/WebCore/platform/video-codecs/cocoa/GPUVideoDecoderVTB.mm
M Source/WebCore/platform/video-codecs/cocoa/GPUVideoDecoderVTBH264.h
M Source/WebCore/platform/video-codecs/cocoa/GPUVideoEncoderVTB.mm
M Source/WebKit/GPUProcess/webrtc/LibWebRTCCodecsProxy.mm
Log Message:
-----------
Add proper color space support to WebCore H264 decoder
rdar://188373969
https://bugs.webkit.org/show_bug.cgi?id=325262
Reviewed by Jean-Yves Avenard.
We remove the H264 color space override in WebCore H264 decoder.
We enable the WebCore H264 encoder color space handling.
This works fine for regular YUV frames but we still hit an issue for RGB frames.
For RGB frames, we follow https://w3c.github.io/webcodecs/#srgb-color-space
which mention that canvas frames have a specific color space.
We introduce a new srgbColorSpace routine in PlatformVideoColorSpace.h and
update LibWebRTCCodecsProxy::encodeFrame to directly use it.
Given fullRange = true is expected, we update the converter to generate full
range pixel buffers.
We update RealtimeOutgoingVideoSourceCocoa to use srgbColorSpace as well, which
updates the transfer to sRGB as per webcodecs spec.
For LibWebRTCVPXInternalVideoEncoder, we would also like to use that same
srgbColorSpace for RGB frames.
We for now update the transfer to BT709 as VP9 encoder is not able to preserve
the transfer directly in the bitstream.
We do the same for LibWebRTCVPXInternalVideoEncoder.
We resync some WPT webcodecs tests from upstream to keep them passing as VP9
cannot preserver transfer directly in the bitstream.
Covered by existing and updated tests.
*
LayoutTests/imported/w3c/web-platform-tests/webcodecs/full-cycle-test.https.any.js:
(promise_setup.async const):
(promise_setup):
(async runFullCycleTest):
* Source/WebCore/platform/graphics/PlatformVideoColorSpace.h:
(WebCore::srgbColorSpace):
* Source/WebCore/platform/libwebrtc/LibWebRTCVPXVideoEncoder.cpp:
(WebCore::LibWebRTCVPXInternalVideoEncoder::encode):
*
Source/WebCore/platform/mediastream/cocoa/RealtimeOutgoingVideoSourceCocoa.cpp:
(WebCore::RealtimeOutgoingVideoSourceCocoa::videoFrameAvailable):
* Source/WebCore/platform/video-codecs/cocoa/GPUVideoDecoderVTB.mm:
(WebCore::createMultiImageCallback):
(WebCore::GPUVideoDecoderVTB::decodeFrameInternal):
(WebCore::overrideColorSpaceAttachments): Deleted.
* Source/WebCore/platform/video-codecs/cocoa/GPUVideoDecoderVTBH264.h:
* Source/WebCore/platform/video-codecs/cocoa/GPUVideoEncoderVTB.mm:
(WebCore::GPUVideoEncoderVTB::configureCompressionSession):
* Source/WebKit/GPUProcess/webrtc/LibWebRTCCodecsProxy.mm:
(WebKit::LibWebRTCCodecsProxy::encodeFrame):
Canonical link: https://commits.webkit.org/322056@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications