diff options
author | Li Xiaowei <xiaowei.a.li@intel.com> | 2013-01-04 17:21:03 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2013-01-17 13:08:40 +0800 |
commit | 06f065adba7917c8120539bf90231f9e0adf5a4a (patch) | |
tree | fedef7fff5b8a554a84baed1e0802c1f3280c4d2 /src/gen75_vpp_vebox.c | |
parent | df0914b9779110b014895d706dbf68e028392b63 (diff) | |
download | libva-intel-driver-06f065adba7917c8120539bf90231f9e0adf5a4a.tar.gz libva-intel-driver-06f065adba7917c8120539bf90231f9e0adf5a4a.tar.bz2 libva-intel-driver-06f065adba7917c8120539bf90231f9e0adf5a4a.zip |
VEBOX: support multi color balance params in one filter
Signed-off-by: Li Xiaowei <xiaowei.a.li@intel.com>
Diffstat (limited to 'src/gen75_vpp_vebox.c')
-rw-r--r-- | src/gen75_vpp_vebox.c | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/src/gen75_vpp_vebox.c b/src/gen75_vpp_vebox.c index 5da015f..af18023 100644 --- a/src/gen75_vpp_vebox.c +++ b/src/gen75_vpp_vebox.c @@ -358,21 +358,25 @@ void hsw_veb_iecp_pro_amp_table(VADriverContextP ctx, struct intel_vebox_context float src_contrast = 1.0; float src_brightness = 0.0; float tmp_value = 0.0; + unsigned int i = 0; - VAProcFilterParameterBufferColorBalance * amp_param = - (VAProcFilterParameterBufferColorBalance *) proc_ctx->filter_iecp_amp; - VAProcColorBalanceType attrib = amp_param->attrib; - - if(attrib == VAProcColorBalanceHue) { - src_hue = amp_param->value; //(-180.0, 180.0) - }else if(attrib == VAProcColorBalanceSaturation) { - src_saturation = amp_param->value; //(0.0, 10.0) - }else if(attrib == VAProcColorBalanceBrightness) { - src_brightness = amp_param->value; // (-100.0, 100.0) - brightness = intel_format_convert(src_brightness, 7, 4, 1); - }else if(attrib == VAProcColorBalanceContrast) { - src_contrast = amp_param->value; // (0.0, 10.0) - contrast = intel_format_convert(src_contrast, 4, 7, 0); + VAProcFilterParameterBufferColorBalance * amp_params = + (VAProcFilterParameterBufferColorBalance *) proc_ctx->filter_iecp_amp; + + for (i = 0; i < proc_ctx->filter_iecp_amp_num_elements; i++){ + VAProcColorBalanceType attrib = amp_params[i].attrib; + + if(attrib == VAProcColorBalanceHue) { + src_hue = amp_params[i].value; //(-180.0, 180.0) + }else if(attrib == VAProcColorBalanceSaturation) { + src_saturation = amp_params[i].value; //(0.0, 10.0) + }else if(attrib == VAProcColorBalanceBrightness) { + src_brightness = amp_params[i].value; // (-100.0, 100.0) + brightness = intel_format_convert(src_brightness, 7, 4, 1); + }else if(attrib == VAProcColorBalanceContrast) { + src_contrast = amp_params[i].value; // (0.0, 10.0) + contrast = intel_format_convert(src_contrast, 4, 7, 0); + } } tmp_value = cos(src_hue/180*PI) * src_contrast * src_saturation; @@ -1109,6 +1113,7 @@ VAStatus gen75_vebox_process_picture(VADriverContextP ctx, } else if (filter->type == VAProcFilterColorBalance) { proc_ctx->filters_mask |= VPP_IECP_PRO_AMP; proc_ctx->filter_iecp_amp = filter; + proc_ctx->filter_iecp_amp_num_elements = obj_buf->num_elements; } else if (filter->type == VAProcFilterColorStandard){ proc_ctx->filters_mask |= VPP_IECP_CSC; proc_ctx->filter_iecp_csc = filter; |