2 * Copyright © 2010 Intel Corporation
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the
6 * "Software"), to deal in the Software without restriction, including
7 * without limitation the rights to use, copy, modify, merge, publish,
8 * distribute, sub license, and/or sell copies of the Software, and to
9 * permit persons to whom the Software is furnished to do so, subject to
10 * the following conditions:
12 * The above copyright notice and this permission notice (including the
13 * next paragraph) shall be included in all copies or substantial portions
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
19 * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
20 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 * Li Xiaowei <xiaowei.a.li@intel.com>
34 #include <intel_bufmgr.h>
35 #include <va/va_vpp.h>
36 #include "i965_gpe_utils.h"
38 #define MAX_SURF_IN_SUM 5
43 VPP_GPE_SCENE_CHANGE_DETECTION,
47 typedef struct _KernelParameterBase{
48 unsigned short pic_width;
49 unsigned short pic_height;
52 typedef struct _KernelParameterSharpening{
53 KernelParameterBase base;
54 }KernelParameterSharpening;
56 typedef struct _ThreadParameterBase{
57 unsigned int pic_width;
58 unsigned int pic_height;
63 typedef struct _ThreadParameterSharpenig{
64 ThreadParameterBase base;
65 unsigned int l_amount;
66 unsigned int d_amount;
67 }ThreadParameterSharpening;
69 struct vpp_gpe_context{
70 struct intel_batchbuffer *batch;
71 struct i965_gpe_context gpe_ctx;
72 struct i965_buffer_surface vpp_batchbuffer;
73 struct i965_buffer_surface vpp_kernel_return;
75 VAProcPipelineParameterBuffer *pipeline_param;
76 enum VPP_GPE_TYPE filter_type;
77 unsigned int sub_shader_index;
78 unsigned int sub_shader_sum;
80 unsigned char * kernel_param;
81 unsigned int kernel_param_size;
83 unsigned char * thread_param;
84 unsigned int thread_param_size;
85 unsigned int thread_num;
87 struct object_surface *surface_pipeline_input_object;
88 struct object_surface *surface_output_object;
89 VASurfaceID surface_tmp;
90 struct object_surface *surface_tmp_object;
91 struct object_surface *surface_input_object[MAX_SURF_IN_SUM];
92 unsigned int forward_surf_sum;
93 unsigned int backward_surf_sum;
95 unsigned int in_frame_w;
96 unsigned int in_frame_h;
97 unsigned int is_first_frame;
99 void (*gpe_context_init)(VADriverContextP ctx,
100 struct i965_gpe_context *gpe_context);
102 void (*gpe_context_destroy)(struct i965_gpe_context *gpe_context);
104 void (*gpe_load_kernels)(VADriverContextP ctx,
105 struct i965_gpe_context *gpe_context,
106 struct i965_kernel *kernel_list,
107 unsigned int num_kernels);
111 struct vpp_gpe_context *
112 vpp_gpe_context_init(VADriverContextP ctx);
115 vpp_gpe_context_destroy(VADriverContextP ctx,
116 struct vpp_gpe_context* vpp_context);
119 vpp_gpe_process_picture(VADriverContextP ctx,
120 struct vpp_gpe_context * vpp_context);