[PATCH v3] drm: drm_fourcc: add 10/12/16bit software decoder YCbCr formats

Daniel Stone daniel at fooishbar.org
Mon May 12 14:26:12 UTC 2025


Hi Rob,

On Fri, 9 May 2025 at 14:36, Robert Mader <robert.mader at collabora.com> wrote:
> This adds FOURCCs for 3-plane 10/12/16bit YCbCr formats used by software
> decoders like ffmpeg, dav1d and libvpx. The intended use-case is buffer
> sharing between decoders and GPUs by allocating buffers with e.g. udmabuf
> or dma-heaps, avoiding unnecessary copies and format conversions in
> various scenarios.
>
> Unlike formats typically used by hardware decoders the 10/12bit formats
> use a LSB alignment. In order to allow fast implementations in GL
> and Vulkan the padding must contain only zeros, so the float
> representation can be calculated by multiplying with 2^6=64 or 2^4=16
> respectively.
>
> MRs or branches for Mesa, Vulkan, Gstreamer, Weston and Mutter can be found at:
>  - https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34303
>  - https://github.com/rmader/Vulkan-Docs/commits/ycbcr-16bit-lsb-formats/
>  - https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8540
>  - https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/1753
>  - https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4348
>
> The naming scheme follows the 'P' and 'Q' formats. The 'S' stands for
> 'software' and was selected in order to make remembering easy.
>
> The 'Sx16' formats could as well be 'Qx16'. We stick with 'S' as 16bit software
> decoders are likely much more common than hardware ones for the foreseeable
> future. Note that these formats already have Vulkan equivalents:
>  - VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM
>  - VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM
>  - VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM

Thanks a lot for these - series is:
Reviewed-by: Daniel Stone <daniels at collabora.com>

Cheers,
Daniel


More information about the dri-devel mailing list