OSDN Git Service

Fix wrong y_cb/cr_offset when the imported surfaces's fourcc is VA_FOURCC_411P
authorWang, Tiantian <tiantian.wang@intel.com>
Thu, 30 Mar 2017 01:35:55 +0000 (21:35 -0400)
committerXiang, Haihao <haihao.xiang@intel.com>
Mon, 12 Jun 2017 05:09:01 +0000 (13:09 +0800)
Signed-off-by: Wang Tiantian <tiantian.wang@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
(cherry picked from commit 01e602844abb34095d15c7990f836f88b922ba40)

src/i965_drv_video.c

index 01fa872..7232c6c 100644 (file)
@@ -1528,8 +1528,8 @@ i965_suface_external_memory(VADriverContextP ctx,
         ASSERT_RET(memory_attibute->pitches[1] == memory_attibute->pitches[2], VA_STATUS_ERROR_INVALID_PARAMETER);
 
         obj_surface->subsampling = SUBSAMPLE_YUV411;
-        obj_surface->y_cb_offset = 0;
-        obj_surface->y_cr_offset = 0;
+        obj_surface->y_cb_offset = obj_surface->height;
+        obj_surface->y_cr_offset = memory_attibute->offsets[2] / obj_surface->width;
         obj_surface->cb_cr_width = obj_surface->orig_width / 4;
         obj_surface->cb_cr_height = obj_surface->orig_height;
         obj_surface->cb_cr_pitch = memory_attibute->pitches[1];