Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 71710708fe0a99666018152fbaa81bc70ab7cbe0
      
https://github.com/WebKit/WebKit/commit/71710708fe0a99666018152fbaa81bc70ab7cbe0
  Author: Jean-Yves Avenard <[email protected]>
  Date:   2024-11-12 (Tue, 12 Nov 2024)

  Changed paths:
    A LayoutTests/media/content/test-h264-601-videorange.mp4
    A LayoutTests/media/content/test-vp8-601-videorange.webm
    A LayoutTests/media/content/test-vp9-601-videorange.webm
    M LayoutTests/media/media-source/media-source-vp8-hiddenframes.html
    M LayoutTests/media/media-video-fullrange.html
    A LayoutTests/media/media-video-videorange-expected.txt
    A LayoutTests/media/media-video-videorange.html
    M LayoutTests/media/media-vp8-hiddenframes.html
    M LayoutTests/platform/glib/TestExpectations
    M LayoutTests/platform/ios/TestExpectations
    M LayoutTests/platform/mac-wk1/TestExpectations
    M LayoutTests/platform/mac-wk2/TestExpectations
    M Source/WebCore/Modules/webcodecs/WebCodecsVideoDecoder.cpp
    M Source/WebCore/platform/VideoDecoder.h
    M Source/WebCore/platform/graphics/VP9Utilities.cpp
    M Source/WebCore/platform/graphics/VP9Utilities.h
    M Source/WebCore/platform/graphics/cocoa/CMUtilities.h
    M Source/WebCore/platform/graphics/cocoa/CMUtilities.mm
    M Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.mm
    M Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.h
    M Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.mm
    M Source/WebCore/platform/libwebrtc/LibWebRTCVPXVideoDecoder.cpp

  Log Message:
  -----------
  WebCodec's VideoDecoders don't handle colorspace properly
https://bugs.webkit.org/show_bug.cgi?id=282741
rdar://139412312

Reviewed by Youenn Fablet.

Pass colorspace information to the created CVPixelBuffer.
We add utility methods to construct the colorspace data from the vpcC box and 
VPx bytestream
should the information not be provided on construction.

We prefer colorspace information from this source order given colorspace > 
description data (vpcC) > inband bytestream.

Added tests verifying that black are pure black, and yellow are almost pure 
yellow with 601 videos and video range.
Technically they should be exactly pure (255, 255, 0), however, compression 
artifacts with the source makes it not so.

Fly-by #1: m_isClosed can be accessed concurrently on the decoder's or caller's 
workqueue. Make it atomic.
Fly-by #2: Make relevant members const and add annotation about where some 
members can be accessed from.

* LayoutTests/media/content/test-h264-601-videorange.mp4: Added.
* LayoutTests/media/content/test-vp8-601-videorange.webm: Added.
* LayoutTests/media/content/test-vp9-601-videorange.webm: Added.
* LayoutTests/media/media-source/media-source-vp8-hiddenframes.html: We can 
reduce the fuzz range now that both the VT decoder (mac) will return the same 
colours as VideoDecoder (ios family)
* LayoutTests/media/media-video-fullrange.html: Wait a maximum of 500ms for the 
promise to be resolved as the rVFC callback may not always be called.
* LayoutTests/media/media-video-videorange-expected.txt: Added.
* LayoutTests/media/media-video-videorange.html: Added.
* LayoutTests/media/media-vp8-hiddenframes.html: We can reduce the fuzz range 
now that both the VT decoder (mac) will return the same colours as VideoDecoder 
(ios family)
* LayoutTests/platform/mac-wk1/TestExpectations:
* LayoutTests/platform/wpe/TestExpectations:
* Source/WebCore/Modules/webcodecs/WebCodecsVideoDecoder.cpp:
(WebCore::createVideoDecoderConfig):
* Source/WebCore/platform/VideoDecoder.h:
* Source/WebCore/platform/graphics/VP9Utilities.cpp:
(WebCore::vPCodecConfigurationRecordFromVPXByteStream):
(WebCore::convertToPlatformVideoColorPrimaries):
(WebCore::convertToPlatformVideoTransferCharacteristics):
(WebCore::convertToPlatformVideoMatrixCoefficients):
(WebCore::colorSpaceFromVPCodecConfigurationRecord):
(WebCore::vpcCFromVPXByteStream): Deleted.
* Source/WebCore/platform/graphics/VP9Utilities.h:
* Source/WebCore/platform/graphics/cocoa/CMUtilities.h:
* Source/WebCore/platform/graphics/cocoa/CMUtilities.mm:
(WebCore::convertToCMTransferFunction): Add transfer value for BT601 
(smpte170m) which is the same as 709.2 transfer.
(WebCore::attachColorSpaceToPixelBuffer):
* Source/WebCore/platform/graphics/cocoa/VP9UtilitiesCocoa.mm: Move methods to 
VP9Utilities.cpp
(WebCore::convertToMatrixCoefficients):
(WebCore::createVideoInfoFromVPCodecConfigurationRecord):
(WebCore::convertToPlatformVideoColorPrimaries): Deleted.
(WebCore::convertToPlatformVideoTransferCharacteristics): Deleted.
(WebCore::convertToPlatformVideoMatrixCoefficients): Deleted.
* Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.h:
* Source/WebCore/platform/graphics/cocoa/WebCoreDecompressionSession.mm:
(WebCore::WebCoreDecompressionSession::decodeSampleInternal): Retrieve 
colorspace from CMSampleBuffer and give it to the decoder initialization.
(WebCore::WebCoreDecompressionSession::enqueueDecodedSample): Fly-by: the last 
video frame in a webm doesn't have a duration. A logic
error would have caused to never notify the listener that the frame at 
currentTime had been decoded, leading to the play() promise to never be 
resolved (nor rVFC callback to be called)
(WebCore::WebCoreDecompressionSession::initializeVideoDecoder):
* Source/WebCore/platform/libwebrtc/LibWebRTCVPXVideoDecoder.cpp:
(WebCore::LibWebRTCVPXInternalVideoDecoder::decode):
(WebCore::LibWebRTCVPXInternalVideoDecoder::LibWebRTCVPXInternalVideoDecoder):
(WebCore::LibWebRTCVPXInternalVideoDecoder::createPixelBuffer):
(WebCore::LibWebRTCVPXInternalVideoDecoder::Decoded):

Canonical link: https://commits.webkit.org/286474@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to