Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e6c06f5064de2622d2e2df6249917a4c2ab545f4
      
https://github.com/WebKit/WebKit/commit/e6c06f5064de2622d2e2df6249917a4c2ab545f4
  Author: Jean-Yves Avenard <[email protected]>
  Date:   2026-10-07 (Wed, 07 Oct 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-copyTo-chroma-subsampling.any-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-copyTo-chroma-subsampling.any.html
    A 
LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-copyTo-chroma-subsampling.any.js
    A 
LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-copyTo-chroma-subsampling.any.worker-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-copyTo-chroma-subsampling.any.worker.html
    M Source/WebCore/Modules/webcodecs/WebCodecsVideoFrameAlgorithms.cpp
    M Source/WebCore/Modules/webcodecs/WebCodecsVideoFrameAlgorithms.h

  Log Message:
  -----------
  WebCodecs computes wrong plane layouts for I422 and I444 VideoFrames
https://bugs.webkit.org/show_bug.cgi?id=325915
rdar://188885351

Reviewed by Youenn Fablet.

videoPixelFormatToSubSampling() returned one factor for both axes and gave
2 for every chroma plane, so allocationSize() and copyTo() halved the chroma
height of I422 frames and both chroma dimensions of I444 frames, and
verifyRectOffsetAlignment() rejected an odd y for I422. The byte width was
also computed by dividing by sampleWidth * sampleBytes, which only matched
the spec while every sample was one byte.

The horizontal and vertical sub-sampling factors are now separate, as the
spec defines them: I422 chroma is 2x1 and I444 is not sub-sampled. I422 only
requires an even x offset, and the left and width bytes are the sample count
divided by the sub-sampling factor, multiplied by the sample size.

* 
LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-copyTo-chroma-subsampling.any-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-copyTo-chroma-subsampling.any.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-copyTo-chroma-subsampling.any.js:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-copyTo-chroma-subsampling.any.worker-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/webcodecs/videoFrame-copyTo-chroma-subsampling.any.worker.html:
 Added.
* Source/WebCore/Modules/webcodecs/WebCodecsVideoFrameAlgorithms.cpp:
(WebCore::verifyRectOffsetAlignment): Only require an even x for I422.
(WebCore::isChromaPlane): Added.
(WebCore::videoPixelFormatToHorizontalSubSampling): Added.
(WebCore::videoPixelFormatToVerticalSubSampling): Added.
(WebCore::computeLayoutAndAllocationSize): Use the per-axis factors and 
multiply by the sample size.
(WebCore::videoPixelFormatToSubSampling): Deleted.
* Source/WebCore/Modules/webcodecs/WebCodecsVideoFrameAlgorithms.h:

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



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

Reply via email to