summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhao Yakui <yakui.zhao@intel.com>2014-03-14 15:16:26 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2014-04-23 14:16:51 +0800
commit071e5f9abebad6e44e052074b6fc0a1bf62a39be (patch)
tree41923b40e249b2a5a31ae38507b2511873c581a4
parentb329b70baea3a489a14fe80830f6178d3b8ab089 (diff)
downloadlibva-intel-driver-071e5f9abebad6e44e052074b6fc0a1bf62a39be.tar.gz
libva-intel-driver-071e5f9abebad6e44e052074b6fc0a1bf62a39be.tar.bz2
libva-intel-driver-071e5f9abebad6e44e052074b6fc0a1bf62a39be.zip
Add the csc conversion from YV16 to NV12
V1->V2: Follow Zhiwen's comment to handle the scenario of CSC conversion from YV16 to NV12 when the source is YV16 image instead of YV16 surface. Reviewed-by: Wind Yuan <feng.yuan@intel.com> Tested-by: Wind Yuan <feng.yuan@intel.com> Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> (cherry picked from commit 2b5fad11a5c12d3c6ffbef15c02449a3b4e90b98)
-rw-r--r--src/gen8_post_processing.c8
-rwxr-xr-xsrc/i965_post_processing.c23
2 files changed, 29 insertions, 2 deletions
diff --git a/src/gen8_post_processing.c b/src/gen8_post_processing.c
index 78f5a83..84d4864 100644
--- a/src/gen8_post_processing.c
+++ b/src/gen8_post_processing.c
@@ -470,8 +470,10 @@ gen8_pp_set_media_rw_message_surface(VADriverContextP ctx, struct i965_post_proc
dri_bo *bo;
int fourcc = pp_get_surface_fourcc(ctx, surface);
const int U = (fourcc == VA_FOURCC('Y', 'V', '1', '2') ||
+ fourcc == VA_FOURCC('Y', 'V', '1', '6') ||
fourcc == VA_FOURCC('I', 'M', 'C', '1')) ? 2 : 1;
const int V = (fourcc == VA_FOURCC('Y', 'V', '1', '2') ||
+ fourcc == VA_FOURCC('Y', 'V', '1', '6') ||
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') || fourcc == VA_FOURCC('U', 'Y', 'V', 'Y'));
@@ -538,6 +540,12 @@ 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('V', 'V', '1', '6')) {
+ width[1] = obj_image->image.width / 2;
+ height[1] = obj_image->image.height;
+ width[2] = obj_image->image.width / 2;
+ height[2] = obj_image->image.height;
+ }
}
}
diff --git a/src/i965_post_processing.c b/src/i965_post_processing.c
index 8d53676..6713e05 100755
--- a/src/i965_post_processing.c
+++ b/src/i965_post_processing.c
@@ -1702,8 +1702,12 @@ pp_set_media_rw_message_surface(VADriverContextP ctx, struct i965_post_processin
dri_bo *bo;
int fourcc = pp_get_surface_fourcc(ctx, surface);
const int Y = 0;
- const int U = fourcc == VA_FOURCC('Y', 'V', '1', '2') ? 2 : 1;
- const int V = fourcc == VA_FOURCC('Y', 'V', '1', '2') ? 1 : 2;
+ const int U = ((fourcc == VA_FOURCC('Y', 'V', '1', '2')) ||
+ (fourcc == VA_FOURCC('Y', 'V', '1', '6')))
+ ? 2 : 1;
+ const int V = ((fourcc == VA_FOURCC('Y', 'V', '1', '2')) ||
+ (fourcc == VA_FOURCC('Y', 'V', '1', '6')))
+ ? 1 : 2;
const int UV = 1;
int interleaved_uv = fourcc == VA_FOURCC('N', 'V', '1', '2');
int packed_yuv = (fourcc == VA_FOURCC('Y', 'U', 'Y', '2') || fourcc == VA_FOURCC('U', 'Y', 'V', 'Y'));
@@ -1770,6 +1774,12 @@ pp_set_media_rw_message_surface(VADriverContextP ctx, struct i965_post_processin
height[2] = obj_image->image.height / 2;
pitch[2] = obj_image->image.pitches[2];
offset[2] = obj_image->image.offsets[2];
+ if (fourcc == VA_FOURCC('V', 'V', '1', '6')) {
+ width[1] = obj_image->image.width / 2;
+ height[1] = obj_image->image.height;
+ width[2] = obj_image->image.width / 2;
+ height[2] = obj_image->image.height;
+ }
}
}
@@ -1813,8 +1823,10 @@ gen7_pp_set_media_rw_message_surface(VADriverContextP ctx, struct i965_post_proc
dri_bo *bo;
int fourcc = pp_get_surface_fourcc(ctx, surface);
const int U = (fourcc == VA_FOURCC('Y', 'V', '1', '2') ||
+ fourcc == VA_FOURCC('V', 'V', '1', '6') ||
fourcc == VA_FOURCC('I', 'M', 'C', '1')) ? 2 : 1;
const int V = (fourcc == VA_FOURCC('Y', 'V', '1', '2') ||
+ fourcc == VA_FOURCC('V', 'V', '1', '6') ||
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') || fourcc == VA_FOURCC('U', 'Y', 'V', 'Y'));
@@ -1880,6 +1892,12 @@ 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('V', 'V', '1', '6')) {
+ width[1] = obj_image->image.width / 2;
+ height[1] = obj_image->image.height;
+ width[2] = obj_image->image.width / 2;
+ height[2] = obj_image->image.height;
+ }
}
}
@@ -5069,6 +5087,7 @@ i965_image_processing(VADriverContextP ctx,
case VA_FOURCC('4', '2', '2', 'V'):
case VA_FOURCC('4', '1', '1', 'P'):
case VA_FOURCC('4', '4', '4', 'P'):
+ case VA_FOURCC('Y', 'V', '1', '6'):
status = i965_image_pl3_processing(ctx,
src_surface,
src_rect,