Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2f3e056117360f3d3ca6de362cbfe45b511bafb2
      
https://github.com/WebKit/WebKit/commit/2f3e056117360f3d3ca6de362cbfe45b511bafb2
  Author: Youenn Fablet <[email protected]>
  Date:   2026-06-04 (Thu, 04 Jun 2026)

  Changed paths:
    A LayoutTests/http/tests/webcodecs/vp9-hdr-expected.txt
    A LayoutTests/http/tests/webcodecs/vp9-hdr.bin
    A LayoutTests/http/tests/webcodecs/vp9-hdr.html
    M LayoutTests/platform/glib/TestExpectations
    M Source/WebCore/platform/VideoFrame.cpp
    M Source/WebCore/platform/VideoFrame.h
    M Source/WebCore/platform/graphics/cocoa/CMUtilities.mm
    M Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.mm
    M Source/WebCore/platform/video-codecs/cocoa/WebRTCVideoDecoderVTB.mm
    M Source/WebCore/testing/Internals.cpp
    M Source/WebCore/testing/Internals.h
    M Source/WebCore/testing/Internals.idl

  Log Message:
  -----------
  VP9 VTB
decoder should be able to generate 10 bits video frames
rdar://178628837
https://bugs.webkit.org/show_bug.cgi?id=316204

Reviewed by Jean-Yves Avenard.

For VP9 with a bit depth of 10, we were previously asking the decoder to use 
kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange/kCVPixelFormatType_420YpCbCr8BiPlanarFullRange.
Instead we are now using 
kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange/kCVPixelFormatType_420YpCbCr10BiPlanarFullRange,
 which allows to move towards HDR support in WebRTC/WebCodecs.

To do so, we make sure that the VideoInfo gets the correct bit depth from the 
VP9 parsed data.
We then make sure to write the bit depth in the format description.
Finally, we read back the bit depth when creating the pixel buffer attributes 
from the format description.

We update createFormatDescriptionFromTrackInfo to make sure to set the bit 
depth explicitly for correctness and as it is read later on by our own code.

Covered by internals API until we support
I420P10 web codecs format.

Test: http/tests/webcodecs/vp9-hdr.html
* LayoutTests/http/tests/webcodecs/vp9-hdr-expected.txt: Added.
* LayoutTests/http/tests/webcodecs/vp9-hdr.bin: Added.
* LayoutTests/http/tests/webcodecs/vp9-hdr.html: Added.
* Source/WebCore/platform/VideoFrame.cpp:
(WebCore::VideoFrame::is10bits const):
* Source/WebCore/platform/VideoFrame.h:
* Source/WebCore/platform/graphics/cocoa/CMUtilities.mm:
(WebCore::createFormatDescriptionFromTrackInfo):
(WebCore::computeVideoFrameColorSpace):
* Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.mm:
(WebCore::createVideoInfoFromVPCodecConfigurationRecord):
* Source/WebCore/platform/video-codecs/cocoa/WebRTCVideoDecoderVTB.mm:
(WebCore::bitDepthFromFormat):
(WebCore::createPixelBufferAttributes):
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::is10bitsVideoFrame const):
* Source/WebCore/testing/Internals.h:
* Source/WebCore/testing/Internals.idl:

Canonical link:
https://flagged.apple.com:443/proxy?t2=dU4c7t2If9&o=aHR0cHM6Ly9jb21taXRzLndlYmtpdC5vcmcvMzE0NjIwQG1haW4=&emid=15539df1-e3e2-4649-9c6b-dfc6b9d265ad&c=11



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to