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_YNR_TYPES_H
17 #define __IA_CSS_YNR_TYPES_H
18 
19 /* @file
20 * CSS-API header file for Noise Reduction (BNR) and YCC Noise Reduction (YNR,CNR).
21 */
22 
23 /* Configuration used by Bayer Noise Reduction (BNR) and
24  *  YCC Noise Reduction (YNR,CNR).
25  *
26  *  ISP block: BNR1, YNR1, CNR1
27  *  ISP1: BNR1,YNR1,CNR1 are used.
28  *  ISP2: BNR1,YNR1,CNR1 are used for Preview/Video.
29  *        BNR1,YNR2,CNR2 are used for Still.
30  */
31 struct ia_css_nr_config {
32 	ia_css_u0_16 bnr_gain;	   /** Strength of noise reduction (BNR).
33 				u0.16, [0,65535],
34 				default 14336(0.21875), ineffective 0 */
35 	ia_css_u0_16 ynr_gain;	   /** Strength of noise reduction (YNR).
36 				u0.16, [0,65535],
37 				default 14336(0.21875), ineffective 0 */
38 	ia_css_u0_16 direction;    /** Sensitivity of edge (BNR).
39 				u0.16, [0,65535],
40 				default 512(0.0078125), ineffective 0 */
41 	ia_css_u0_16 threshold_cb; /** Coring threshold for Cb (CNR).
42 				This is the same as
43 				de_config.c1_coring_threshold.
44 				u0.16, [0,65535],
45 				default 0(0), ineffective 0 */
46 	ia_css_u0_16 threshold_cr; /** Coring threshold for Cr (CNR).
47 				This is the same as
48 				de_config.c2_coring_threshold.
49 				u0.16, [0,65535],
50 				default 0(0), ineffective 0 */
51 };
52 
53 /* Edge Enhancement (sharpen) configuration.
54  *
55  *  ISP block: YEE1
56  *  ISP1: YEE1 is used.
57  *  ISP2: YEE1 is used for Preview/Video.
58  *       (YEE2 is used for Still.)
59  */
60 struct ia_css_ee_config {
61 	ia_css_u5_11 gain;	  /** The strength of sharpness.
62 					u5.11, [0,65535],
63 					default 8192(4.0), ineffective 0 */
64 	ia_css_u8_8 threshold;    /** The threshold that divides noises from
65 					edge.
66 					u8.8, [0,65535],
67 					default 256(1.0), ineffective 65535 */
68 	ia_css_u5_11 detail_gain; /** The strength of sharpness in pell-mell
69 					area.
70 					u5.11, [0,65535],
71 					default 2048(1.0), ineffective 0 */
72 };
73 
74 /* YNR and YEE (sharpen) configuration.
75  */
76 struct ia_css_yee_config {
77 	struct ia_css_nr_config nr; /** The NR configuration. */
78 	struct ia_css_ee_config ee; /** The EE configuration. */
79 };
80 
81 #endif /* __IA_CSS_YNR_TYPES_H */
82