st/va: add support YUY2

YUY2 is a duplicate of YUYV and is used by gstreamer for 4:2:2.

Acked-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3738>
This commit is contained in:
Pierre-Eric Pelloux-Prayer
2020-02-13 19:24:43 +01:00
parent d2e715e57a
commit 5bc71e1bac
2 changed files with 4 additions and 1 deletions
+2
View File
@@ -46,6 +46,7 @@ static const VAImageFormat formats[] =
{VA_FOURCC('I','4','2','0')},
{VA_FOURCC('Y','V','1','2')},
{VA_FOURCC('Y','U','Y','V')},
{VA_FOURCC('Y','U','Y','2')},
{VA_FOURCC('U','Y','V','Y')},
{.fourcc = VA_FOURCC('B','G','R','A'), .byte_order = VA_LSB_FIRST, 32, 32,
0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000},
@@ -160,6 +161,7 @@ vlVaCreateImage(VADriverContextP ctx, VAImageFormat *format, int width, int heig
case VA_FOURCC('U','Y','V','Y'):
case VA_FOURCC('Y','U','Y','V'):
case VA_FOURCC('Y','U','Y','2'):
img->num_planes = 1;
img->pitches[0] = w * 2;
img->offsets[0] = 0;
+2 -1
View File
@@ -49,7 +49,7 @@
#define VL_VA_DRIVER(ctx) ((vlVaDriver *)ctx->pDriverData)
#define VL_VA_PSCREEN(ctx) (VL_VA_DRIVER(ctx)->vscreen->pscreen)
#define VL_VA_MAX_IMAGE_FORMATS 11
#define VL_VA_MAX_IMAGE_FORMATS 12
#define VL_VA_ENC_GOP_COEFF 16
#define UINT_TO_PTR(x) ((void*)(uintptr_t)(x))
@@ -94,6 +94,7 @@ VaFourccToPipeFormat(unsigned format)
case VA_FOURCC('Y','V','1','2'):
return PIPE_FORMAT_YV12;
case VA_FOURCC('Y','U','Y','V'):
case VA_FOURCC('Y','U','Y','2'):
return PIPE_FORMAT_YUYV;
case VA_FOURCC('U','Y','V','Y'):
return PIPE_FORMAT_UYVY;