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>
Fri, 7 Apr 2017 05:20:00 +0000 (13:20 +0800)
Signed-off-by: Wang Tiantian <tiantian.wang@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
src/i965_drv_video.c

index 0ca5332..6798c6e 100644 (file)
@@ -1504,8 +1504,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];