summaryrefslogtreecommitdiff
path: root/include/ia_imaging/anr_public.h
blob: 32c1ef6f34c8b3ec16c8c6ed77a4e3b505c116a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
/*
 * Copyright (C) 2015 - 2017 Intel Corporation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef _ANR_PUBLIC_H_
#define _ANR_PUBLIC_H_

/** @file
* CSS-API header file for 2500/Skycam Advanced Noice Reduction (ANR) kernel/accelerator.
*/
//#include <type_support.h>

/* All structs in this file will be visible to the CSS API User.
* The User will be able to set each one of the config params separately by
* specifying a different config type (see sh_config_type in sh_css.h).
* If one of those config structs is not set explicitly, a default value will
* be use instead.
*/

//////////////////////////////////////////////////////////////
//				ANR SEARCH                                  //
//////////////////////////////////////////////////////////////

/* NONE TO EXPOSE */


//////////////////////////////////////////////////////////////
//				ANR TRANSFORM                               //
//////////////////////////////////////////////////////////////


typedef struct alpha
{
	short Alpha_Gr;
	short Alpha_R;
	short Alpha_B;
	short Alpha_Gb;
	short Alpha_DC_Gr;
	short Alpha_DC_R;
	short Alpha_DC_B;
	short Alpha_DC_Gb;

}alpha_t;


typedef struct beta
{

	short Beta_Gr;
	short Beta_R;
	short Beta_B;
	short Beta_Gb;

}beta_t;


#define W_MATRIX_SIZE 16
typedef struct plain_color_w_matrix
{
	short Gr[W_MATRIX_SIZE];
	short R[W_MATRIX_SIZE];
	short B[W_MATRIX_SIZE];
	short Gb[W_MATRIX_SIZE];


}plain_color_w_matrix_t;


typedef struct anr_transform_plane
{
	alpha_t alpha;
	beta_t beta;
	plain_color_w_matrix_t color_reg_w;

}anr_transform_plane_t;



#define LUT_ENTRY_NUM 25


typedef struct anr_transform_R_CALC
{
	/** bits 0:12 - Xreset */
	short Xreset;
	/** bits 16:28 - Yreset */
	short Yreset;

	/** BITS 32:39 - A = RADIAL GAIN R^2 norm - shift */
	short R_NormFactor;

	/** bits 40:47 - a = Radial gain scale factor*2^6 */
	short radial_gain_scale_factor;

	/** calculated from Xreset */
	int X_sqr_reset;
	/** calculated from Yreset */
	int Y_sqr_reset;

}anr_transform_R_CALC_t;


typedef struct anr_transform_public
{

	short ADAPTIVE_TRESHHOLD_EN;
	anr_transform_plane_t plane_0;
	anr_transform_plane_t plane_1;
	anr_transform_plane_t plane_2;
	anr_transform_R_CALC_t CALC;

}anr_transform_public_t;




/////////////////////////////////////////////////////////////
//				ANR STITCH                                  //
//////////////////////////////////////////////////////////////


#define PYRAMID_ENTRY_NUM 64
typedef struct anr_stitch_public
{
	short pyramid_reg[PYRAMID_ENTRY_NUM];

}anr_stitch_public_t;



//////////////////////////////////////////////////////////////
//				ANR TILE 2 STRM                             //
//////////////////////////////////////////////////////////////

/* NONE to expose */


struct anr_public_config
{
	anr_transform_public_t transform;
	anr_stitch_public_t stitch;
};

struct ia_css_2500_anr_kernel_config
{
	struct anr_public_config anr;
};

/** @brief Print ANR public configuration
 *
 * @param	cfg	The pointer to configuration data
 * @return	None
 *
 * Print ANR public configuration.
 */
void ia_css_anr_public_cfg_dump(const struct ia_css_2500_anr_kernel_config *cfg);

/** @brief Compare two ANR public configurations
 *
 * @param	cfg1	The pointer to first configuration data
 * @param	cfg2	The pointer to second configuration data
 * @param	cfg_dump	Configurations are printed in case of
 *   			   mismatch
 * @return	true - match, false - not match
 *
 * Compare two ANR public configurations
 */
bool ia_css_anr_public_cfg_compare(
	const struct ia_css_2500_anr_kernel_config *cfg1,
	const struct ia_css_2500_anr_kernel_config *cfg2,
	bool cfg_dump);

#endif