Skip to content

multi-texture-format: Add P010 YCbCr format

Robert Mader requested to merge rmader/mutter:p010-support into main

From the main commit:

It's the 10 bit equivalent to NV12 and uses the same layout as P016, i.e.
16 bit components with the lowest 6 bits set to 0 (padding), allowing us
to use 16 bit "subformats".

Thus adding support is quite trivial as we can reuse the NV12 shader.
The format is widely supported in decoding and display hardware (on Intel
since Kaby Lake), as well as modern codecs (AV1, VP9, HEVC) and has
visible quality advantages over NV12.

Note that the additional colors are lost if composited to a 8 bit RGB
framebuffer. Switching between direct scanout and compositing can thus
cause quality differences. This is no new phenomena, however, as the
same is the case already for e.g. GL clients using 10 bit formats -
including video players.

Also note that P012 and P016 could trivially added as well - it's not
done here as they are uncommen and thus hard to test.

How to test:

  • have a GPU that supports P010 with VA-API, such as recent AMD generations
  • have a 10bit encoded file, such as "Camp by Sony" from https://kodi.wiki/view/Samples
  • Gstreamer (1.24 / with MR below):
    • without installing: build (meson setup build) and enter build env (./gst-env.py in the gstreamer root folder)
    • gst-launch-1.0 filesrc location=~/Videos/Camp_by_Sony.mp4 ! qtdemux ! h265parse ! vah265dec ! vapostproc ! waylandsink fullscreen=1
  • mpv (v0.36.1 / with MR below for direct scanout)
    • mpv --hwdec=vaapi --vo=dmabuf-wayland ~/Videos/Camp_by_Sony.mp4 --fs

Related:

Edited by Robert Mader

Merge request reports