OSDN Git Service

VPP: Combine the CSC/Scaling together to optimize the performance
authorZhao Yakui <yakui.zhao@intel.com>
Wed, 15 Jul 2015 21:16:41 +0000 (17:16 -0400)
committerXiang, Haihao <haihao.xiang@intel.com>
Sun, 6 Sep 2015 07:13:57 +0000 (15:13 +0800)
Currently it is divided into two steps when the video format is invovled.
In such case it is not efficient.

V1->V2: Follow Haihao's comment to call back the missing operation of
handle background color

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
(cherry picked from commit 4bda4667fd635df5bd27ce01353a3b6d6bf85508)

src/i965_post_processing.c

index f78d7c9..6cb6681 100755 (executable)
@@ -5947,6 +5947,33 @@ i965_proc_picture(VADriverContextP ctx,
         dst_rect.height = obj_surface->orig_height;
     }
 
+    if (IS_GEN7(i965->intel.device_info) ||
+        IS_GEN8(i965->intel.device_info) ||
+        IS_GEN9(i965->intel.device_info)) {
+        unsigned int saved_filter_flag;
+        struct i965_post_processing_context *i965pp_context = i965->pp_context;
+
+        i965_vpp_clear_surface(ctx, &proc_context->pp_context,
+                               obj_surface,
+                               pipeline_param->output_background_color);
+
+        saved_filter_flag = i965pp_context->filter_flags;
+        i965pp_context->filter_flags = VA_FILTER_SCALING_HQ;
+
+        dst_surface.base = (struct object_base *)obj_surface;
+        dst_surface.type = I965_SURFACE_TYPE_SURFACE;
+        i965_image_processing(ctx, &src_surface, &src_rect, &dst_surface, &dst_rect);
+
+        i965pp_context->filter_flags = saved_filter_flag;
+
+        if (num_tmp_surfaces)
+            i965_DestroySurfaces(ctx,
+                             tmp_surfaces,
+                             num_tmp_surfaces);
+
+        return VA_STATUS_SUCCESS;
+    }
+
     int csc_needed = 0;
     if (obj_surface->fourcc && obj_surface->fourcc !=  VA_FOURCC_NV12){
         csc_needed = 1;