-
Notifications
You must be signed in to change notification settings - Fork 526
Add VK_EXT_ycbcr_3plane_16bit_lsb_formats extension #2709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
rmader
wants to merge
1
commit into
KhronosGroup:main
Choose a base branch
from
rmader:ycbcr-16bit-lsb-formats
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| // Copyright 2020-2025 The Khronos Group Inc. | ||
| // | ||
| // SPDX-License-Identifier: CC-BY-4.0 | ||
|
|
||
| include::{generated}/meta/{refprefix}VK_EXT_ycbcr_3plane_16bit_lsb_formats.adoc[] | ||
|
|
||
| === Other Extension Metadata | ||
|
|
||
| *Last Modified Date*:: | ||
| 2025-04-01 | ||
| *IP Status*:: | ||
| No known IP claims. | ||
| *Contributors*:: | ||
| - Robert Mader, Collabora | ||
|
|
||
| === Description | ||
|
|
||
| This extension adds some {YCbCr} formats that are in common use for video | ||
| software encode and decode, but were not part of the | ||
| `apiext:VK_KHR_sampler_ycbcr_conversion` extension. | ||
|
|
||
| include::{generated}/interfaces/VK_EXT_ycbcr_3plane_16bit_lsb_formats.adoc[] | ||
|
|
||
| === Version History | ||
|
|
||
| * Revision 1, 2025-04-01 (Robert Mader) | ||
| ** Initial draft |
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| // Copyright 2022-2025 The Khronos Group Inc. | ||
| // | ||
| // SPDX-License-Identifier: CC-BY-4.0 | ||
|
|
||
| = VK_EXT_ycbcr_3plane_16bit_lsb_formats | ||
| :toc: left | ||
| :docs: https://docs.vulkan.org/spec/latest/ | ||
| :extensions: {docs}appendices/extensions.html# | ||
| :sectnums: | ||
|
|
||
| This extension adds support for 10/12bit {YCbCr} formats used by software | ||
| decoders like ffmpeg, dav1d and libvpx. | ||
|
|
||
| == Problem Statement | ||
|
|
||
| Many popular software video decoders - such as ffmpeg/libav, dav1d and libvpx - | ||
| use formats for 10 and 12 bit content that are not yet supported in Vulkan, but | ||
| are for example in Linux DRM and Mesa GLES. These formats long established and | ||
| optimized for the given task and it would be very hard for decoders to switch | ||
| to formats optimized for hardware video decoders such as P010. | ||
|
|
||
| Supporting these formats directly in drivers has various advantages for apps | ||
| and system compositors, as it allows to avoid unnecessary copies and/or quality | ||
| loss. Further more it can also simplify code-sharing with code-paths for | ||
| hardware decoders. | ||
|
|
||
| Unfortunately it is not possible to use the existing 16 bit formats such as | ||
| VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM as - unlike most formats used by hardware | ||
| decoders - the alignment is LSB, not MSB. The bit-values thus need to get | ||
| shifted by 6 or 4 bit. | ||
|
|
||
| == Proposal | ||
|
|
||
| Add the formats in question. For any drivers already supporting YCbCr formats | ||
| via shaders this should be straight forward. Values in the 0.0 - 1.0 range just | ||
| need to get multiplied by 65535.0 / 1023.0 (for 10 bit) or 65535.0 / 4095.0 (for | ||
| 12 bit). | ||
|
|
||
| == Issues |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here and in other places: needs a proper number