summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhao Yakui <yakui.zhao@intel.com>2014-03-14 15:16:17 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2014-04-23 14:16:04 +0800
commita5259c1c32bdd60582a79f7cffaff468fd43ac30 (patch)
treee797f20eca117a6938d12fb3792e621355ab54f4
parent5cd2a559ec618c9e628fa695f15a0e90450824f2 (diff)
downloadlibva-intel-driver-a5259c1c32bdd60582a79f7cffaff468fd43ac30.tar.gz
libva-intel-driver-a5259c1c32bdd60582a79f7cffaff468fd43ac30.tar.bz2
libva-intel-driver-a5259c1c32bdd60582a79f7cffaff468fd43ac30.zip
Add the support of create surface based on YV16 format
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 12e7421ce1ed2627270dcb281af4d760afeb7209)
-rwxr-xr-xsrc/i965_drv_video.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c
index 8c5894c..6bd6c30 100755
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -776,7 +776,8 @@ i965_surface_native_memory(VADriverContextP ctx,
// todo, should we disable tiling for 422 format?
if (expected_fourcc == VA_FOURCC('I', '4', '2', '0') ||
expected_fourcc == VA_FOURCC('I', 'Y', 'U', 'V') ||
- expected_fourcc == VA_FOURCC('Y', 'V', '1', '2'))
+ expected_fourcc == VA_FOURCC('Y', 'V', '1', '2') ||
+ expected_fourcc == VA_FOURCC('Y', 'V', '1', '6'))
tiling = 0;
i965_check_alloc_surface_bo(ctx, obj_surface, tiling, expected_fourcc, get_sampling_from_fourcc(expected_fourcc));
@@ -923,6 +924,19 @@ i965_suface_external_memory(VADriverContextP ctx,
break;
+ case VA_FOURCC('Y', 'V', '1', '6'):
+ assert(memory_attibute->num_planes == 3);
+ assert(memory_attibute->pitches[1] == memory_attibute->pitches[2]);
+
+ obj_surface->subsampling = SUBSAMPLE_YUV422H;
+ obj_surface->y_cr_offset = memory_attibute->offsets[1] / obj_surface->width;
+ obj_surface->y_cb_offset = memory_attibute->offsets[2] / obj_surface->width;
+ obj_surface->cb_cr_width = obj_surface->orig_width / 2;
+ obj_surface->cb_cr_height = obj_surface->orig_height;
+ obj_surface->cb_cr_pitch = memory_attibute->pitches[1];
+
+ break;
+
case VA_FOURCC('4', '2', '2', 'V'):
assert(memory_attibute->num_planes == 3);
assert(memory_attibute->pitches[1] == memory_attibute->pitches[2]);
@@ -3004,6 +3018,15 @@ i965_check_alloc_surface_bo(VADriverContextP ctx,
region_height = obj_surface->height + obj_surface->height / 2;
break;
+ case VA_FOURCC('Y', 'V', '1', '6'):
+ obj_surface->cb_cr_width = obj_surface->orig_width / 2;
+ obj_surface->cb_cr_height = obj_surface->orig_height;
+ obj_surface->y_cr_offset = obj_surface->height;
+ obj_surface->y_cb_offset = obj_surface->y_cr_offset + ALIGN(obj_surface->cb_cr_height, 32) / 2;
+ obj_surface->cb_cr_pitch = obj_surface->width / 2;
+ region_height = obj_surface->height + ALIGN(obj_surface->cb_cr_height, 32);
+ break;
+
case VA_FOURCC('Y', 'V', '1', '2'):
case VA_FOURCC('I', '4', '2', '0'):
if (fourcc == VA_FOURCC('Y', 'V', '1', '2')) {
@@ -3297,6 +3320,7 @@ get_sampling_from_fourcc(unsigned int fourcc)
case VA_FOURCC('Y', 'U', 'Y', '2'):
case VA_FOURCC('U', 'Y', 'V', 'Y'):
case VA_FOURCC('4', '2', '2', 'H'):
+ case VA_FOURCC('Y', 'V', '1', '6'):
surface_sampling = SUBSAMPLE_YUV422H;
break;
case VA_FOURCC('4', '2', '2', 'V'):