diff options
author | Xiang, Haihao <haihao.xiang@intel.com> | 2012-06-28 12:01:32 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2012-06-28 12:48:39 +0800 |
commit | ac254ae493b15fdf041bbc55030b68124b138292 (patch) | |
tree | e63985c20897f415ec07c9fcb463ea93c7038437 /src | |
parent | 8ecb68e5c4eb1c5b94eac47c0d92057b2ec27c03 (diff) | |
download | vaapi-intel-driver-ac254ae493b15fdf041bbc55030b68124b138292.tar.gz vaapi-intel-driver-ac254ae493b15fdf041bbc55030b68124b138292.tar.bz2 vaapi-intel-driver-ac254ae493b15fdf041bbc55030b68124b138292.zip |
Add support for UYVY
Tested on SNB and IVB.
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Diffstat (limited to 'src')
-rwxr-xr-x | src/i965_drv_video.c | 3 | ||||
-rw-r--r-- | src/i965_drv_video.h | 2 | ||||
-rwxr-xr-x | src/i965_post_processing.c | 17 |
3 files changed, 18 insertions, 4 deletions
diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c index 6b44bba..41f8b0f 100755 --- a/src/i965_drv_video.c +++ b/src/i965_drv_video.c @@ -108,6 +108,8 @@ i965_image_formats_map[I965_MAX_IMAGE_FORMATS + 1] = { { VA_FOURCC('N','V','1','2'), VA_LSB_FIRST, 12, } }, { I965_SURFACETYPE_YUV, { VA_FOURCC('Y','U','Y','2'), VA_LSB_FIRST, 16, } }, + { I965_SURFACETYPE_YUV, + { VA_FOURCC('U','Y','V','Y'), VA_LSB_FIRST, 16, } }, }; /* List of supported subpicture formats */ @@ -2109,6 +2111,7 @@ i965_CreateImage(VADriverContextP ctx, image->data_size = size + 2 * size2; break; case VA_FOURCC('Y','U','Y','2'): + case VA_FOURCC('U','Y','V','Y'): image->num_planes = 1; image->pitches[0] = width * 2; image->offsets[0] = 0; diff --git a/src/i965_drv_video.h b/src/i965_drv_video.h index 32ae4ce..e40e9b4 100644 --- a/src/i965_drv_video.h +++ b/src/i965_drv_video.h @@ -43,7 +43,7 @@ #define I965_MAX_PROFILES 11 #define I965_MAX_ENTRYPOINTS 5 #define I965_MAX_CONFIG_ATTRIBUTES 10 -#define I965_MAX_IMAGE_FORMATS 4 +#define I965_MAX_IMAGE_FORMATS 10 #define I965_MAX_SUBPIC_FORMATS 4 #define I965_MAX_DISPLAY_ATTRIBUTES 4 diff --git a/src/i965_post_processing.c b/src/i965_post_processing.c index 499d786..b3d5f81 100755 --- a/src/i965_post_processing.c +++ b/src/i965_post_processing.c @@ -1365,7 +1365,7 @@ gen7_pp_set_media_rw_message_surface(VADriverContextP ctx, struct i965_post_proc const int V = (fourcc == VA_FOURCC('Y', 'V', '1', '2') || fourcc == VA_FOURCC('I', 'M', 'C', '1')) ? 1 : 2; int interleaved_uv = fourcc == VA_FOURCC('N', 'V', '1', '2'); - int packed_yuv = (fourcc == VA_FOURCC('Y', 'U', 'Y', '2')); + int packed_yuv = (fourcc == VA_FOURCC('Y', 'U', 'Y', '2') || fourcc == VA_FOURCC('U', 'Y', 'V', 'Y')); if (surface->type == I965_SURFACE_TYPE_SURFACE) { obj_surface = SURFACE(surface->id); @@ -1458,6 +1458,10 @@ gen7_pp_set_media_rw_message_surface(VADriverContextP ctx, struct i965_post_proc format0 = SURFACE_FORMAT_YCRCB_NORMAL; break; + case VA_FOURCC('U', 'Y', 'V', 'Y'): + format0 = SURFACE_FORMAT_YCRCB_SWAPY; + break; + default: break; } @@ -2203,6 +2207,10 @@ static void gen7_update_src_surface_uv_offset(VADriverContextP ctx, pp_static_parameter->grf2.di_destination_packed_y_component_offset = 0; pp_static_parameter->grf2.di_destination_packed_u_component_offset = 1; pp_static_parameter->grf2.di_destination_packed_v_component_offset = 3; + } else if (fourcc == VA_FOURCC('U', 'Y', 'V', 'Y')) { + pp_static_parameter->grf2.di_destination_packed_y_component_offset = 1; + pp_static_parameter->grf2.di_destination_packed_u_component_offset = 0; + pp_static_parameter->grf2.di_destination_packed_v_component_offset = 2; } } @@ -4021,7 +4029,8 @@ i965_image_pl3_processing(VADriverContextP ctx, dst_rect, PP_PL3_LOAD_SAVE_PL3, NULL); - } else if (fourcc == VA_FOURCC('Y', 'U', 'Y', '2')) { + } else if (fourcc == VA_FOURCC('Y', 'U', 'Y', '2') || + fourcc == VA_FOURCC('U', 'Y', 'V', 'Y')) { vaStatus = i965_post_processing_internal(ctx, i965->pp_context, src_surface, src_rect, @@ -4070,7 +4079,8 @@ i965_image_pl2_processing(VADriverContextP ctx, dst_rect, PP_NV12_LOAD_SAVE_PL3, NULL); - } else if (fourcc == VA_FOURCC('Y', 'U', 'Y', '2')) { + } else if (fourcc == VA_FOURCC('Y', 'U', 'Y', '2') || + fourcc == VA_FOURCC('U', 'Y', 'V', 'Y')) { vaStatus = i965_post_processing_internal(ctx, i965->pp_context, src_surface, src_rect, @@ -4159,6 +4169,7 @@ i965_image_processing(VADriverContextP ctx, dst_rect); break; case VA_FOURCC('Y', 'U', 'Y', '2'): + case VA_FOURCC('U', 'Y', 'V', 'Y'): status = i965_image_pl1_processing(ctx, src_surface, src_rect, |