From 4880825bd669fd62d6f6d0ec3c59f6fbb698283d Mon Sep 17 00:00:00 2001 From: Yan Wang Date: Tue, 11 Dec 2018 17:01:17 +0800 Subject: [PATCH] Add AYUV image format. Fixes #375. Signed-off-by: Yan Wang --- media_driver/linux/common/ddi/media_libva.cpp | 10 ++++++++++ media_driver/linux/common/ddi/media_libva_caps.cpp | 1 + 2 files changed, 11 insertions(+) diff --git a/media_driver/linux/common/ddi/media_libva.cpp b/media_driver/linux/common/ddi/media_libva.cpp index 13d406e9a7..7d8e59b965 100644 --- a/media_driver/linux/common/ddi/media_libva.cpp +++ b/media_driver/linux/common/ddi/media_libva.cpp @@ -3906,6 +3906,10 @@ VAStatus DdiMedia_CreateImage( gmmParams.Format = GMM_FORMAT_MFX_JPEG_YUV422V_TYPE; gmmParams.BaseHeight = MOS_ALIGN_CEIL(height, 32); break; + case VA_FOURCC_AYUV: + gmmParams.Format = GMM_FORMAT_AYUV_TYPE; + gmmParams.BaseHeight = MOS_ALIGN_CEIL(height, 32); + break; default: MOS_FreeMemory(vaimg); @@ -4005,6 +4009,12 @@ VAStatus DdiMedia_CreateImage( vaimg->offsets[1] = gmmPitch * gmmHeight; vaimg->offsets[2] = gmmPitch * gmmHeight * 2; break; + case VA_FOURCC_AYUV: + vaimg->format.bits_per_pixel = 32; + vaimg->num_planes = 1; + vaimg->pitches[0] = gmmPitch; + vaimg->offsets[0] = 0; + break; } mediaCtx->pGmmClientContext->DestroyResInfoObject(gmmResourceInfo); diff --git a/media_driver/linux/common/ddi/media_libva_caps.cpp b/media_driver/linux/common/ddi/media_libva_caps.cpp index 307de0d512..4f99bf4ba3 100644 --- a/media_driver/linux/common/ddi/media_libva_caps.cpp +++ b/media_driver/linux/common/ddi/media_libva_caps.cpp @@ -129,6 +129,7 @@ const VAImageFormat MediaLibvaCaps::m_supportedImageformats[] = {VA_FOURCC_P208, VA_LSB_FIRST, 8, 0,0,0,0,0}, {VA_FOURCC_P016, VA_LSB_FIRST, 12, 0,0,0,0,0}, {VA_FOURCC('P','0','1','0'), VA_LSB_FIRST, 24, 0,0,0,0,0}, + {VA_FOURCC_AYUV, VA_LSB_FIRST, 32, 24, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000}, }; MediaLibvaCaps::MediaLibvaCaps(DDI_MEDIA_CONTEXT *mediaCtx)