Merge tag 'drm-misc-fixes-2017-12-14' of git://anongit.freedesktop.org/drm/drm-misc
[sfrench/cifs-2.6.git] / drivers / staging / media / atomisp / pci / atomisp2 / css2400 / isp / kernels / bnlm / ia_css_bnlm_types.h
1 /*
2  * Support for Intel Camera Imaging ISP subsystem.
3  * Copyright (c) 2015, Intel Corporation.
4  *
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.
8  *
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
12  * more details.
13  */
14
15 #ifndef __IA_CSS_BNLM_TYPES_H
16 #define __IA_CSS_BNLM_TYPES_H
17
18 /* @file
19 * CSS-API header file for Bayer Non-Linear Mean parameters.
20 */
21
22 #include "type_support.h" /* int32_t */
23
24 /* Bayer Non-Linear Mean configuration
25  *
26  * \brief BNLM public parameters.
27  * \details Struct with all parameters for the BNLM kernel that can be set
28  * from the CSS API.
29  *
30  * ISP2.6.1: BNLM is used.
31  */
32 struct ia_css_bnlm_config {
33         bool            rad_enable;     /** Enable a radial dependency in a weight calculation */
34         int32_t         rad_x_origin;   /** Initial x coordinate for a radius calculation */
35         int32_t         rad_y_origin;   /** Initial x coordinate for a radius calculation */
36         /* a threshold for average of weights if this < Th, do not denoise pixel */
37         int32_t         avg_min_th;
38         /* minimum weight for denoising if max < th, do not denoise pixel */
39         int32_t         max_min_th;
40
41         /**@{*/
42         /* Coefficient for approximation, in the form of (1 + x / N)^N,
43          * that fits the first-order exp() to default exp_lut in BNLM sheet
44          * */
45         int32_t         exp_coeff_a;
46         uint32_t        exp_coeff_b;
47         int32_t         exp_coeff_c;
48         uint32_t        exp_exponent;
49         /**@}*/
50
51         int32_t nl_th[3];       /** Detail thresholds */
52
53         /* Index for n-th maximum candidate weight for each detail group */
54         int32_t match_quality_max_idx[4];
55
56         /**@{*/
57         /* A lookup table for 1/sqrt(1+mu) approximation */
58         int32_t mu_root_lut_thr[15];
59         int32_t mu_root_lut_val[16];
60         /**@}*/
61         /**@{*/
62         /* A lookup table for SAD normalization */
63         int32_t sad_norm_lut_thr[15];
64         int32_t sad_norm_lut_val[16];
65         /**@}*/
66         /**@{*/
67         /* A lookup table that models a weight's dependency on textures */
68         int32_t sig_detail_lut_thr[15];
69         int32_t sig_detail_lut_val[16];
70         /**@}*/
71         /**@{*/
72         /* A lookup table that models a weight's dependency on a pixel's radial distance */
73         int32_t sig_rad_lut_thr[15];
74         int32_t sig_rad_lut_val[16];
75         /**@}*/
76         /**@{*/
77         /* A lookup table to control denoise power depending on a pixel's radial distance */
78         int32_t rad_pow_lut_thr[15];
79         int32_t rad_pow_lut_val[16];
80         /**@}*/
81         /**@{*/
82         /* Non linear transfer functions to calculate the blending coefficient depending on detail group */
83         /* detail group 0 */
84         /**@{*/
85         int32_t nl_0_lut_thr[15];
86         int32_t nl_0_lut_val[16];
87         /**@}*/
88         /**@{*/
89         /* detail group 1 */
90         int32_t nl_1_lut_thr[15];
91         int32_t nl_1_lut_val[16];
92         /**@}*/
93         /**@{*/
94         /* detail group 2 */
95         int32_t nl_2_lut_thr[15];
96         int32_t nl_2_lut_val[16];
97         /**@}*/
98         /**@{*/
99         /* detail group 3 */
100         int32_t nl_3_lut_thr[15];
101         int32_t nl_3_lut_val[16];
102         /**@}*/
103         /**@}*/
104 };
105
106 #endif /* __IA_CSS_BNLM_TYPES_H */