OSDN Git Service

VPP: Fix AVS parameters for Ivybridge
authorXiang, Haihao <haihao.xiang@intel.com>
Mon, 30 Jan 2012 05:42:09 +0000 (13:42 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Wed, 31 Oct 2012 08:46:14 +0000 (16:46 +0800)
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
src/i965_post_processing.c
src/i965_post_processing.h

index e732969..2a7c48a 100644 (file)
@@ -1947,9 +1947,9 @@ gen7_pp_nv12_avs_initialize(VADriverContextP ctx, struct i965_post_processing_co
 
     pp_static_parameter->grf1.pointer_to_inline_parameter = 7;
     pp_static_parameter->grf3.sampler_load_horizontal_scaling_step_ratio = (float) pp_avs_context->src_w / pp_avs_context->dest_w;
-    pp_static_parameter->grf4.sampler_load_vertical_scaling_step = (float) 1.0 / out_h;
-    pp_static_parameter->grf5.sampler_load_vertical_frame_origin = 0.0; /* FIXME */
-    pp_static_parameter->grf6.sampler_load_horizontal_frame_origin = 0.0;
+    pp_static_parameter->grf4.sampler_load_vertical_scaling_step = (float) 1.0 / pp_avs_context->dest_h;
+    pp_static_parameter->grf5.sampler_load_vertical_frame_origin = -(float)pp_avs_context->dest_y / pp_avs_context->dest_h;
+    pp_static_parameter->grf6.sampler_load_horizontal_frame_origin = -(float)pp_avs_context->dest_x / pp_avs_context->dest_w;
 
     dst_surface->flags = src_surface->flags;
 
index 0f9e79f..2d6ec38 100644 (file)
@@ -346,12 +346,12 @@ struct gen7_pp_static_parameter
     } grf4;
 
     struct {
-        unsigned int sampler_load_vertical_frame_origin;
+        float sampler_load_vertical_frame_origin;
         unsigned int padx[7];
     } grf5;
 
     struct {
-        unsigned int sampler_load_horizontal_frame_origin;
+        float sampler_load_horizontal_frame_origin;
         unsigned int padx[7];
     } grf6;
 };