Skip to content

frontends/va: add support for A2RGB10/X2RGB10/A2BGR10/X2BGR10

nyanmisaka requested to merge nyanmisaka/mesa:va-a2rgb10 into main

What does this MR do and why?

  • Add support for A2RGB10/X2RGB10/A2BGR10/X2BGR10 (Closes: #8285)

tested with:

ffmpeg -vaapi_device /dev/dri/renderD128 -f lavfi -i testsrc=s=1280x720,format=x2rgb10le -vf hwupload,scale_vaapi=format=nv12 -c:v h264_vaapi -b:v 4M -maxrate 4M -maxrate 8M -async_depth 4 -y /tmp/out.mp4
Applying option vaapi_device (set VAAPI hardware device (DRM path or X11 display name)) with argument /dev/dri/renderD128.
[AVHWDeviceContext @ 0x56102606c000] libva: VA-API version 1.19.0
[AVHWDeviceContext @ 0x56102606c000] libva: Trying to open /usr/lib/dri/radeonsi_drv_video.so
[AVHWDeviceContext @ 0x56102606c000] libva: Found init function __vaDriverInit_1_19
[AVHWDeviceContext @ 0x56102606c000] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x56102606c000] Initialised VAAPI connection: version 1.19
[AVHWDeviceContext @ 0x56102606c000] Format 0x3231564e -> nv12.
[AVHWDeviceContext @ 0x56102606c000] Format 0x30313050 -> p010le.
[AVHWDeviceContext @ 0x56102606c000] Format 0x36313050 -> unknown.
[AVHWDeviceContext @ 0x56102606c000] Format 0x30323449 -> yuv420p.
[AVHWDeviceContext @ 0x56102606c000] Format 0x32315659 -> yuv420p.
[AVHWDeviceContext @ 0x56102606c000] Format 0x56595559 -> unknown.
[AVHWDeviceContext @ 0x56102606c000] Format 0x32595559 -> yuyv422.
[AVHWDeviceContext @ 0x56102606c000] Format 0x59565955 -> uyvy422.
[AVHWDeviceContext @ 0x56102606c000] Format 0x30303859 -> gray.
[AVHWDeviceContext @ 0x56102606c000] Format 0x50343434 -> yuv444p.
[AVHWDeviceContext @ 0x56102606c000] Format 0x50424752 -> unknown.
[AVHWDeviceContext @ 0x56102606c000] Format 0x41524742 -> bgra.
[AVHWDeviceContext @ 0x56102606c000] Format 0x41424752 -> rgba.
[AVHWDeviceContext @ 0x56102606c000] Format 0x42475241 -> argb.
[AVHWDeviceContext @ 0x56102606c000] Format 0x58524742 -> bgr0.
[AVHWDeviceContext @ 0x56102606c000] Format 0x58424752 -> rgb0.
[AVHWDeviceContext @ 0x56102606c000] Format 0x30335241 -> unknown.
[AVHWDeviceContext @ 0x56102606c000] Format 0x30334241 -> unknown.
[AVHWDeviceContext @ 0x56102606c000] Format 0x30335258 -> x2rgb10le.
[AVHWDeviceContext @ 0x56102606c000] Format 0x30334258 -> unknown.
[AVHWDeviceContext @ 0x56102606c000] VAAPI driver: Mesa Gallium driver 23.3.0-devel for AMD Radeon Graphics (renoir, LLVM 15.0.7, DRM 3.52, 6.4.5-1-MANJARO).
[AVHWDeviceContext @ 0x56102606c000] Driver not found in known nonstandard list, using standard behaviour.
  • Fix RGBx to BGRx postproc conversion (otherwise the channel order of RGBx will be messed up)

tested with:

ffmpeg -vaapi_device /dev/dri/renderD128 -f lavfi -i testsrc=s=1280x720,format=bgra -vf hwupload,scale_vaapi=format=rgba,hwdownload,format=rgba -vframes 1 -f image2 -y /tmp/out%03d.png

Merge request reports