Clarify color space handling across decoding, encoding, and rendering - #954
Open
dalecurtis wants to merge 1 commit into
Open
dalecurtis wants to merge 1 commit into
dalecurtis wants to merge 1 commit into
Conversation
Fixes #940. - Define an internal color space on the underlying media resource (which may represent H.273 code points beyond the WebIDL enums), exposing unspecified or unrecognized components as null on VideoFrame.colorSpace. - In Output VideoFrames: use the decoder-emitted color space if decoding transforms the color space; otherwise select the most specified color space between [[active decoder config]].colorSpace and the bitstream color space (breaking ties in favor of [[active decoder config]].colorSpace), falling back to a codec-specific default or sRGB (RGB formats) / REC709 (other formats) only when not fully specified and the decoder requires a fully specified color space. - In Output EncodedVideoChunks: allow encoders to modify the input frame's internal color space matrix and range to satisfy codec requirements (assuming full-range rgb for RGB formats and limited-range bt709 otherwise when unspecified), and populate outputConfig.colorSpace from the encoder-emitted color space if specified or else the frame's internal color space after any modifications. - Remove the heuristic guessing allowance from Pick Color Space and specify fallback to sRGB (RGB formats) or REC709 (other formats) during rendering when the internal color space is not fully specified.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #940.
Define an internal color space on the underlying media resource (which may represent H.273 code points beyond the WebIDL enums), exposing unspecified or unrecognized components as null on VideoFrame.colorSpace.
In Output VideoFrames: use the decoder-emitted color space if decoding transforms the color space; otherwise select the most specified color space between [[active decoder config]].colorSpace and the bitstream color space (breaking ties in favor of [[active decoder config]].colorSpace), falling back to a codec-specific default or sRGB (RGB formats) / REC709 (YUV formats) only when not fully specified and the media pipeline requires a fully specified color space.
In Output EncodedVideoChunks: allow encoders to modify the input frame's internal color space matrix and range to satisfy codec requirements (assuming full-range rgb for RGB formats and limited-range bt709 otherwise when unspecified), and populate outputConfig.colorSpace from the encoder-emitted color space if specified or else the frame's internal color space after any modifications.
Remove the heuristic guessing allowance from Pick Color Space and specify fallback to sRGB (RGB formats) or REC709 (other formats) during rendering when the internal color space is not fully specified.
Preview | Diff