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_TNR_TYPES_H
17 #define __IA_CSS_TNR_TYPES_H
18 
19 /* @file
20 * CSS-API header file for Temporal Noise Reduction (TNR) parameters.
21 */
22 
23 /* Temporal Noise Reduction (TNR) configuration.
24  *
25  *  When difference between current frame and previous frame is less than or
26  *  equal to threshold, TNR works and current frame is mixed
27  *  with previous frame.
28  *  When difference between current frame and previous frame is greater
29  *  than threshold, we judge motion is detected. Then, TNR does not work and
30  *  current frame is outputted as it is.
31  *  Therefore, when threshold_y and threshold_uv are set as 0, TNR can be disabled.
32  *
33  *  ISP block: TNR1
34  *  ISP1: TNR1 is used.
35  *  ISP2: TNR1 is used.
36  */
37 
38 struct ia_css_tnr_config {
39 	ia_css_u0_16 gain; /** Interpolation ratio of current frame
40 				and previous frame.
41 				gain=0.0 -> previous frame is outputted.
42 				gain=1.0 -> current frame is outputted.
43 				u0.16, [0,65535],
44 			default 32768(0.5), ineffective 65535(almost 1.0) */
45 	ia_css_u0_16 threshold_y; /** Threshold to enable interpolation of Y.
46 				If difference between current frame and
47 				previous frame is greater than threshold_y,
48 				TNR for Y is disabled.
49 				u0.16, [0,65535], default/ineffective 0 */
50 	ia_css_u0_16 threshold_uv; /** Threshold to enable interpolation of
51 				U/V.
52 				If difference between current frame and
53 				previous frame is greater than threshold_uv,
54 				TNR for UV is disabled.
55 				u0.16, [0,65535], default/ineffective 0 */
56 };
57 
58 #endif /* __IA_CSS_TNR_TYPES_H */
59