1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Support for Intel Camera Imaging ISP subsystem.
4  * Copyright (c) 2015, Intel Corporation.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms and conditions of the GNU General Public License,
8  * version 2, as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
13  * more details.
14  */
15 
16 #ifndef __IA_CSS_BNLM_PARAM_H
17 #define __IA_CSS_BNLM_PARAM_H
18 
19 #include "type_support.h"
20 #include "vmem.h" /* needed for VMEM_ARRAY */
21 
22 struct bnlm_lut {
23 	VMEM_ARRAY(thr, ISP_VEC_NELEMS); /* thresholds */
24 	VMEM_ARRAY(val, ISP_VEC_NELEMS); /* values */
25 };
26 
27 struct bnlm_vmem_params {
28 	VMEM_ARRAY(nl_th, ISP_VEC_NELEMS);
29 	VMEM_ARRAY(match_quality_max_idx, ISP_VEC_NELEMS);
30 	struct bnlm_lut mu_root_lut;
31 	struct bnlm_lut sad_norm_lut;
32 	struct bnlm_lut sig_detail_lut;
33 	struct bnlm_lut sig_rad_lut;
34 	struct bnlm_lut rad_pow_lut;
35 	struct bnlm_lut nl_0_lut;
36 	struct bnlm_lut nl_1_lut;
37 	struct bnlm_lut nl_2_lut;
38 	struct bnlm_lut nl_3_lut;
39 
40 	/* LUTs used for division approximiation */
41 	struct bnlm_lut div_lut;
42 
43 	VMEM_ARRAY(div_lut_intercepts, ISP_VEC_NELEMS);
44 
45 	/* 240x does not have an ISP instruction to left shift each element of a
46 	 * vector by different shift value. Hence it will be simulated by multiplying
47 	 * the elements by required 2^shift. */
48 	VMEM_ARRAY(power_of_2, ISP_VEC_NELEMS);
49 };
50 
51 /* BNLM ISP parameters */
52 struct bnlm_dmem_params {
53 	bool rad_enable;
54 	s32 rad_x_origin;
55 	s32 rad_y_origin;
56 	s32 avg_min_th;
57 	s32 max_min_th;
58 
59 	s32 exp_coeff_a;
60 	u32 exp_coeff_b;
61 	s32 exp_coeff_c;
62 	u32 exp_exponent;
63 };
64 
65 #endif /* __IA_CSS_BNLM_PARAM_H */
66