Skip to content

The Compute Layout and Allocation Size algorithm is rounding up subsampled height but not subsampled width #897

@youennf

Description

@youennf

When reading https://www.w3.org/TR/webcodecs/#videoframe-compute-layout-and-allocation-size, I can see:

  • Set computedLayout’s sourceTop to the result of the division of truncated parsedRect.y by sampleHeight, rounded up to the nearest integer.
  • Set computedLayout’s sourceHeight to the result of the division of truncated parsedRect.height by sampleHeight, rounded up to the nearest integer.
    On the other hand, the result of the integer division of truncated parsedRect.x by sampleWidth and the result of the integer division of truncated parsedRect.width by sampleWidth are not rounded up.

Looking at Chromium implementation and WPT test webcodecs/videoFrame-odd-size.any.js, it seems rounding up should be applied for width as well.

@sandersdan, thoughts?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions