summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex wu <zhiwen.wu@intel.com>2014-03-23 20:45:27 -0600
committerXiang, Haihao <haihao.xiang@intel.com>2014-04-23 14:20:45 +0800
commit5bf0709f52fc3308a6345585f9acae182e60df00 (patch)
treef20ac433e94ee68c430ebd0e9fe819c905181198
parent7b6523cb9d63e3cfcc238dfd0d5f4fc323ca59e2 (diff)
V3: Add 422H support.
Changes between V3 to V2: 1. Add 422H support into gen8_post_processing.c, according to yakui's comments. changes between V2 and V1: 1. Rebase on staging branch. 2. Add 422H support for pp. 3. Reword the commit title. Signed-off-by: Alex wu <zhiwen.wu@intel.com> Reviewed-by: Zhao Yakui <yakui.zhao@intel.com> (cherry picked from commit 347dd731d31dd37b242bbace744125554f2c09e7)
-rw-r--r--src/gen8_post_processing.c2
-rwxr-xr-xsrc/i965_drv_video.c13
-rwxr-xr-xsrc/i965_post_processing.c2
3 files changed, 15 insertions, 2 deletions
diff --git a/src/gen8_post_processing.c b/src/gen8_post_processing.c
index a4fbcbb..4fbc01e 100644
--- a/src/gen8_post_processing.c
+++ b/src/gen8_post_processing.c
@@ -540,7 +540,7 @@ gen8_pp_set_media_rw_message_surface(VADriverContextP ctx, struct i965_post_proc
height[2] = obj_image->image.height / 2;
pitch[2] = obj_image->image.pitches[V];
offset[2] = obj_image->image.offsets[V];
- if (fourcc == VA_FOURCC_YV16) {
+ if (fourcc == VA_FOURCC_YV16 || fourcc == VA_FOURCC_422H) {
width[1] = obj_image->image.width / 2;
height[1] = obj_image->image.height;
width[2] = obj_image->image.width / 2;
diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c
index 0dcac01..e801a4d 100755
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -152,6 +152,8 @@ i965_image_formats_map[I965_MAX_IMAGE_FORMATS + 1] = {
{ VA_FOURCC_YUY2, VA_LSB_FIRST, 16, } },
{ I965_SURFACETYPE_YUV,
{ VA_FOURCC_UYVY, VA_LSB_FIRST, 16, } },
+ { I965_SURFACETYPE_YUV,
+ { VA_FOURCC_422H, VA_LSB_FIRST, 16, } },
{ I965_SURFACETYPE_RGBA,
{ VA_FOURCC_RGBX, VA_LSB_FIRST, 32, 24, 0x000000ff, 0x0000ff00, 0x00ff0000 } },
{ I965_SURFACETYPE_RGBA,
@@ -2821,6 +2823,16 @@ i965_CreateImage(VADriverContextP ctx,
image->offsets[2] = size + size2;
image->data_size = size + 2 * size2;
break;
+ case VA_FOURCC_422H:
+ image->num_planes = 3;
+ image->pitches[0] = awidth;
+ image->offsets[0] = 0;
+ image->pitches[1] = awidth / 2;
+ image->offsets[1] = size;
+ image->pitches[2] = awidth / 2;
+ image->offsets[2] = size + (awidth / 2) * aheight;
+ image->data_size = size + 2 * ((awidth / 2) * aheight);
+ break;
case VA_FOURCC_NV12:
image->num_planes = 2;
image->pitches[0] = awidth;
@@ -3228,6 +3240,7 @@ VAStatus i965_DeriveImage(VADriverContextP ctx,
break;
case VA_FOURCC_I420:
+ case VA_FOURCC_422H:
image->num_planes = 3;
image->pitches[0] = w_pitch; /* Y */
image->offsets[0] = 0;
diff --git a/src/i965_post_processing.c b/src/i965_post_processing.c
index 136e8e3..3dc7d8c 100755
--- a/src/i965_post_processing.c
+++ b/src/i965_post_processing.c
@@ -1892,7 +1892,7 @@ gen7_pp_set_media_rw_message_surface(VADriverContextP ctx, struct i965_post_proc
height[2] = obj_image->image.height / 2;
pitch[2] = obj_image->image.pitches[V];
offset[2] = obj_image->image.offsets[V];
- if (fourcc == VA_FOURCC_YV16) {
+ if (fourcc == VA_FOURCC_YV16 || fourcc == VA_FOURCC_422H) {
width[1] = obj_image->image.width / 2;
height[1] = obj_image->image.height;
width[2] = obj_image->image.width / 2;