2 * Support for Intel Camera Imaging ISP subsystem.
3 * Copyright (c) 2015, Intel Corporation.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 #ifndef __IA_CSS_XNR3_PARAM_H
16 #define __IA_CSS_XNR3_PARAM_H
18 #include "type_support.h"
20 #include "vmem.h" /* needed for VMEM_ARRAY */
24 /* Scaling factor of the alpha values: which fixed-point value represents 1.0?
25 * It must be chosen such that 1/min_sigma still fits in an ISP vector
27 #define XNR_ALPHA_SCALE_LOG2 5
28 #define XNR_ALPHA_SCALE_FACTOR (1 << XNR_ALPHA_SCALE_LOG2)
30 /* Scaling factor of the coring values on the ISP. */
31 #define XNR_CORING_SCALE_LOG2 (ISP_VEC_ELEMBITS-1)
32 #define XNR_CORING_SCALE_FACTOR (1 << XNR_CORING_SCALE_LOG2)
34 /* Scaling factor of the blending strength on the ISP. */
35 #define XNR_BLENDING_SCALE_LOG2 (ISP_VEC_ELEMBITS-1)
36 #define XNR_BLENDING_SCALE_FACTOR (1 << XNR_BLENDING_SCALE_LOG2)
38 /* XNR3 filter size. Must be 11x11, 9x9 or 5x5. */
40 #define XNR_FILTER_SIZE 9
42 #ifdef FLT_KERNEL_11x11
43 #define XNR_FILTER_SIZE 11
45 #define XNR_FILTER_SIZE 5
49 /* XNR3 alpha (1/sigma) parameters on the ISP, expressed as a base (0) value
50 * for dark areas, and a scaled diff towards the value for bright areas. */
51 struct sh_css_xnr3_alpha_params {
60 /* XNR3 coring parameters on the ISP, expressed as a base (0) value
61 * for dark areas, and a scaled diff towards the value for bright areas. */
62 struct sh_css_xnr3_coring_params {
69 /* XNR3 blending strength on the ISP. */
70 struct sh_css_xnr3_blending_params {
74 /* XNR3 ISP parameters */
75 struct sh_css_isp_xnr3_params {
76 struct sh_css_xnr3_alpha_params alpha;
77 struct sh_css_xnr3_coring_params coring;
78 struct sh_css_xnr3_blending_params blending;
83 * STRUCT sh_css_isp_xnr3_vmem_params
84 * -----------------------------------------------
87 struct sh_css_isp_xnr3_vmem_params {
88 VMEM_ARRAY(x, ISP_VEC_NELEMS);
89 VMEM_ARRAY(a, ISP_VEC_NELEMS);
90 VMEM_ARRAY(b, ISP_VEC_NELEMS);
91 VMEM_ARRAY(c, ISP_VEC_NELEMS);
96 #endif /*__IA_CSS_XNR3_PARAM_H */