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 #include "ia_css_types.h"
17 #include "sh_css_defs.h"
18 #include "ia_css_debug.h"
19 
20 #include "ia_css_anr.host.h"
21 
22 const struct ia_css_anr_config default_anr_config = {
23 	10,
24 	{
25 		0, 3, 1, 2, 3, 6, 4, 5, 1, 4, 2, 3, 2, 5, 3, 4,
26 		0, 3, 1, 2, 3, 6, 4, 5, 1, 4, 2, 3, 2, 5, 3, 4,
27 		0, 3, 1, 2, 3, 6, 4, 5, 1, 4, 2, 3, 2, 5, 3, 4,
28 		0, 3, 1, 2, 3, 6, 4, 5, 1, 4, 2, 3, 2, 5, 3, 4
29 	},
30 	{10, 20, 30}
31 };
32 
33 void
ia_css_anr_encode(struct sh_css_isp_anr_params * to,const struct ia_css_anr_config * from,unsigned int size)34 ia_css_anr_encode(
35     struct sh_css_isp_anr_params *to,
36     const struct ia_css_anr_config *from,
37     unsigned int size)
38 {
39 	(void)size;
40 	to->threshold = from->threshold;
41 }
42 
43 void
ia_css_anr_dump(const struct sh_css_isp_anr_params * anr,unsigned int level)44 ia_css_anr_dump(
45     const struct sh_css_isp_anr_params *anr,
46     unsigned int level)
47 {
48 	if (!anr) return;
49 	ia_css_debug_dtrace(level, "Advance Noise Reduction:\n");
50 	ia_css_debug_dtrace(level, "\t%-32s = %d\n",
51 			    "anr_threshold", anr->threshold);
52 }
53 
54 void
ia_css_anr_debug_dtrace(const struct ia_css_anr_config * config,unsigned int level)55 ia_css_anr_debug_dtrace(
56     const struct ia_css_anr_config *config,
57     unsigned int level)
58 {
59 	ia_css_debug_dtrace(level,
60 			    "config.threshold=%d\n",
61 			    config->threshold);
62 }
63