• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef __HI_COMM_ISP_ADAPT_H__
17 #define __HI_COMM_ISP_ADAPT_H__
18 
19 #include "hi_type.h"
20 #include "hi_errno.h"
21 #include "hi_common_adapt.h"
22 #include "hi_isp_debug.h"
23 #include "hi_comm_video_adapt.h"
24 #include "hi_comm_isp.h"
25 #include "hi_isp_defines.h"
26 
27 #ifdef __cplusplus
28 #if __cplusplus
29 extern "C" {
30 #endif
31 #endif /* End of #ifdef __cplusplus */
32 
33 typedef ISP_ERR_CODE_E hi_isp_err_code;
34 typedef ISP_SNS_MODE_E hi_isp_sns_mode;
35 
36 /* Defines the structure of ISP module parameters. */
37 typedef struct {
38     hi_u32 int_bot_half; /* RW;Range:[0, 1]; Format:32.0; Indicate ISP interrupt bottom half,No distinction vipipe */
39     hi_u32 quick_start;  /* RW;Range:[0, 1]; Format:32.0; Indicate ISP Quick Start No distinction vipipe.
40                             Only used for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
41     hi_bool  long_frm_int_en;  /* when wdr mode enable/disable long frame pipe interrupt.   */
42                                /* Only used for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
43 } hi_isp_mod_param;
44 
45 /* Defines the structure of ISP control parameters. */
46 typedef struct {
47     hi_u8   be_buf_num;      /* RW;Range:[2, 9]; offline be cfg buffer number(Only used for offline mode).
48                                 Not support changed after isp init */
49     hi_u32  proc_param;      /* RW;Format:32.0; Indicate the update frequency of ISP_PROC information,
50                                 No distinction vipipe */
51     hi_u32  stat_intvl;      /* RW;Range:(0, 0xffffffff];Format:32.0;
52                                 Indicate the time interval of ISP statistic information */
53     hi_u32  update_pos;      /* RW;Range:[0, 1]; Format:32.0; Indicate the location of the configuration register of
54                                 ISP interrupt */
55     hi_u32  int_time_out;    /* RW;Format:32.0; Indicate the time(unit:ms) of interrupt timeout */
56     hi_u32  pwm_number;      /* R;Format:32.0; Indicate PWM number */
57     hi_u32  port_int_delay;  /* RW;Format:32.0; Port intertupt delay value, unit:clk */
58     hi_bool ldci_tpr_flt_en; /* R;Indicate Enable LDCI temporal filter. Not support changed after isp init */
59 } hi_isp_ctrl_param;
60 
61 typedef ISP_OP_TYPE_E     hi_isp_op_type;
62 typedef ISP_PRIOR_FRAME_E hi_isp_prior_frame;
63 typedef ISP_STATUS_E      hi_isp_status;
64 
65 typedef struct {
66     hi_s32 offset[ISP_BAYER_CHN_NUM];   /* RW;Range:[-4095, 4095];Format:12.0; Black level differences between the
67                                            offset value */
68     hi_u32 gain[ISP_BAYER_CHN_NUM];     /* RW;Range:[0x80, 0x400];Format:4.8; The gain difference ratio */
69     hi_u16 color_matrix[CCM_MATRIX_SIZE]; /* RW;Range:[0x0, 0xFFFF];Format:8.8;Color correction matrix variance ratio */
70 } hi_isp_pipe_diff_attr;
71 
72 typedef ISP_BAYER_FORMAT_E hi_isp_bayer_format;
73 typedef ISP_BAYER_RAWBIT_E hi_isp_bayer_raw_bit;
74 
75 /* ISP public attribute, contains the public image attribute */
76 typedef struct {
77     hi_rect             wnd_rect;        /* RW; start position of the cropping window, image width, and image height */
78     hi_size             sns_size;        /* RW; width and height of the image output from the sensor */
79     hi_float            f32_frame_rate;  /* RW; range: [0, 0xFFFF]; for frame rate */
80     hi_isp_bayer_format bayer;           /* RW; range:[0,3];format:2.0;the format of the input bayer image */
81     hi_wdr_mode         wdr_mode;        /* RW; WDR mode select */
82     hi_u8               sns_mode;        /* RW; range: [0, 0xFF]; format: 8.0; for special sensor mode switches */
83 } hi_isp_pub_attr;
84 
85 /* Slave mode sensor sync signal generate module */
86 typedef struct {
87     union {
88         struct {
89             hi_u32  bit16_rsv           :  16;
90             hi_u32  bit_h_inv           :  1;
91             hi_u32  bit_v_inv           :  1;
92             hi_u32  bit12_rsv           :  12;
93             hi_u32  bit_h_enable        :  1;
94             hi_u32  bit_v_enable        :  1;
95         } bits;
96         hi_u32 bytes;
97     } cfg;
98 
99     hi_u32  vs_time;
100     hi_u32  hs_time;
101     hi_u32  vs_cyc;
102     hi_u32  hs_cyc;
103     hi_u32  hs_dly_cyc;
104     hi_u32  slave_mode_time;
105 } hi_isp_slave_sns_sync;
106 
107 typedef ISP_FMW_STATE_E hi_isp_fmw_state;
108 
109 typedef ISP_RAW_POS_E   hi_isp_raw_pos;
110 
111 typedef struct {
112     hi_isp_raw_pos raw_pos;
113     hi_bool  raw_enable;
114 } hi_isp_raw_pos_attr;
115 
116 /* Defines the WDR mode of the ISP */
117 typedef struct {
118     hi_wdr_mode  wdr_mode;
119 } hi_isp_wdr_mode;
120 
121 typedef union {
122     hi_u64  key;
123     struct {
124         hi_u64  bit_bypass_isp_d_gain        : 1;   /* RW;[0] */
125         hi_u64  bit_bypass_anti_false_color  : 1;   /* RW;[1] */
126         hi_u64  bit_bypass_crosstalk_removal : 1;   /* RW;[2] */
127         hi_u64  bit_bypass_dpc            : 1;   /* RW;[3] */
128         hi_u64  bit_bypass_nr             : 1;   /* RW;[4] */
129         hi_u64  bit_bypass_dehaze         : 1;   /* RW;[5] */
130         hi_u64  bit_bypass_wb_gain        : 1;   /* RW;[6] */
131         hi_u64  bit_bypass_mesh_shading   : 1;   /* RW;[7] */
132         hi_u64  bit_bypass_drc            : 1;   /* RW;[8] */
133         hi_u64  bit_bypass_demosaic       : 1;   /* RW;[9] */
134         hi_u64  bit_bypass_color_matrix   : 1;   /* RW;[10] */
135         hi_u64  bit_bypass_gamma          : 1;   /* RW;[11] */
136         hi_u64  bit_bypass_fswdr          : 1;   /* RW;[12] */
137         hi_u64  bit_bypass_ca             : 1;   /* RW;[13] */
138         hi_u64  bit_bypass_csc            : 1;   /* RW;[14] */
139         hi_u64  bit_bypass_radial_crop    : 1;   /* RW;[15]; Not support for Hi3516CV500/Hi3516DV300/Hi3516AV300/
140                                                     Hi3559V200/Hi3556V200 */
141         hi_u64  bit_bypass_sharpen        : 1;   /* RW;[16] */
142         hi_u64  bit_bypass_local_cac      : 1;   /* RW;[17] */
143         hi_u64  bit_bypass_global_cac     : 1;   /* RW;[18]; Not support for Hi3516EV200/
144                                                     Hi3516EV300/Hi3518EV300/Hi3516DV200 */
145         hi_u64  bit2_chn_select           : 2;   /* RW;[19:20] */
146         hi_u64  bit_bypass_ldci           : 1;   /* RW;[21] */
147         hi_u64  bit_bypass_pregamma       : 1;   /* RW;[22] */
148         hi_u64  bit_bypass_radial_shading : 1;   /* RW;[23]; Only used for Hi3559AV100/Hi3519AV100 */
149         hi_u64  bit_bypass_ae_stat_fe     : 1;   /* RW;[24] */
150         hi_u64  bit_bypass_ae_stat_be     : 1;   /* RW;[25] */
151         hi_u64  bit_bypass_mg_stat        : 1;   /* RW;[26] */
152         hi_u64  bit_bypass_de             : 1;   /* RW;[27]; Only used for Hi3516CV500/Hi3516DV300/Hi3516AV300/
153                                                     Hi3559V200/Hi3556V200 */
154         hi_u64  bit_bypass_af_stat_fe     : 1;   /* RW;[28]; Only used for Hi3559AV100/Hi3519AV100 */
155         hi_u64  bit_bypass_af_stat_be     : 1;   /* RW;[29] */
156         hi_u64  bit_bypass_awb_stat       : 1;   /* RW;[30]; */
157         hi_u64  bit_bypass_clut           : 1;   /* RW;[31]; Not support for  Hi3516EV200/Hi3516EV300/Hi3518EV300/
158                                                     Hi3516DV200 */
159         hi_u64  bit_bypass_hlc            : 1;   /* RW;[32]; Not support for Hi3559AV100/
160                                                     Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
161         hi_u64  bit_bypass_edge_mark      : 1;   /* RW;[33]; Not support for Hi3516EV200/
162                                                     Hi3516EV300/Hi3518EV300/Hi3516DV200 */
163         hi_u64  bit_bypass_rgbir          : 1;   /* RW;[34]; Only used for Hi3516EV200/Hi3516EV300/Hi3518EV300/
164                                                     Hi3516DV200 */
165         hi_u64  bit_rsv29                 : 29;  /* H; [35:63] */
166     };
167 } hi_isp_module_ctrl;
168 
169 typedef ISP_COMBINE_MODE_E   hi_isp_combine_mode;
170 typedef ISP_WDR_MERGE_MODE_E hi_isp_wdr_merge_mode;
171 typedef ISP_BNR_MODE_E       hi_isp_bnr_mode;
172 typedef ISP_WDR_WBGAIN_POSITION_E hi_isp_wdr_wb_gain_position;
173 
174 typedef struct {
175     hi_u8 md_thr_low_gain;
176     hi_u8 md_thr_hig_gain;
177 } hi_isp_fswdr_manual_attr;
178 
179 typedef struct {
180     hi_u8 md_thr_low_gain[ISP_AUTO_ISO_STRENGTH_NUM];
181     hi_u8 md_thr_hig_gain[ISP_AUTO_ISO_STRENGTH_NUM];
182 } hi_isp_fswdr_auto_attr;
183 
184 typedef struct {
185     hi_bool short_expo_chk;     /* RW;Range:[0x0,0x1];Format:1.0; */
186     hi_u16  short_check_thd;   /* RW;Range:[0x0,0xFFF];Format:12.0 */
187     hi_bool md_ref_flicker;
188     hi_u8   mdt_still_thd;     /* RW;Range:[0x0,0xFE];Format:8.0 */
189     hi_u8   mdt_full_thd;      /* RW;Range:[0x0,0xFE];Format:8.0,only used for Hi3559AV100 */
190     hi_u8   mdt_long_blend;    /* RW;Range:[0x0,0xFE] */
191     hi_isp_op_type op_type;
192     hi_isp_fswdr_manual_attr manual_attr;
193     hi_isp_fswdr_auto_attr   auto_attr;
194 } hi_isp_fswdr_mdt_attr;
195 
196 typedef struct {
197     hi_bool motion_comp;        /* RW;Range:[0, 0x1];Format:1.0; enable/disable motion compensation */
198     hi_u16  short_thr;          /* RW;Range:[0, 0xFFF];Format:12.0; data above this threshold will be taken from
199                                    short exposure only. */
200     hi_u16  long_thr;           /* RW;Range:[0, 0xFFF];Format:12.0; limited range:[0x0, short_thr], data below this
201                                    threshold will be taken from long exposure only. */
202     hi_bool force_long;         /* RW;Range:[0, 1];Format:1.0; enable/disable force long;
203                                    not support for Hi3559AV100 */
204     hi_u16  force_long_low_thr; /* RW;Range:[0, 0xFFF];Format:12.0; data above this threshold will force to choose
205                                    long frame only,not support for Hi3559AV100 */
206     hi_u16  force_long_hig_thr; /* RW;Range:[0, 0xFFF];Format:12.0; data below this threshold will force to choose
207                                    long frame only,not support for Hi3559AV100 */
208     hi_isp_fswdr_mdt_attr wdr_mdt;
209 } hi_isp_wdr_combine_attr;
210 
211 typedef struct {
212     hi_u16  fusion_thr[WDR_MAX_FRAME_NUM];    /* RW;Range:[0x0,0x3FFF];Format:14.0;the threshold of the 4 frame */
213 } hi_isp_fusion_attr;
214 
215 typedef struct {
216     hi_isp_bnr_mode bnr_mode;   /* RW;Range:[0, 1];Format:1.0; enable/disable the bnr of wdr */
217     hi_bool short_frame_nr;     /* RW;Range:[0, 1];Format:1.0; enable/disable the bnr of short frame
218                                    Only used for Hi3519AV100 */
219     hi_u8   short_frame_nr_str; /* RW;Range:[0, 0x3F];Format:8.0;the Level 2 short frame sigma weight of G channel,
220                                    Only used for Hi3519AV100 */
221     hi_u8   fusion_bnr_str;     /* RW;Range:[0, 0x3F];Format:3.3,Only used for Hi3519AV100 */
222     hi_u8   noise_floor[NOISESET_ELENUM]; /* RW;Range:[0x0,0xFF];Format:8.0,Only used for Hi3559AV100/Hi3519AV100 */
223     hi_u8   full_mdt_sig_g_wgt;  /* RW;Range:[0, 0x1F];Format:8.0,Only used for Hi3519AV100 */
224     hi_u8   full_mdt_sig_rb_wgt; /* RW;Range:[0, 0x1F];Format:8.0,Only used for Hi3519AV100 */
225     hi_u8   full_mdt_sig_wgt;    /* RW;Range:[0, 0x1F];Format:8.0,Only used for Hi3559AV100 */
226     hi_u8   g_sigma_gain[3];     /* RW;Range:[0, 0xFF];Format:8.0,Only used for Hi3559AV100/Hi3519AV100 */
227     hi_u8   rb_sigma_gain[3];    /* RW;Range:[0, 0xFF];Format:8.0,Only used for Hi3559AV100/Hi3519AV100 */
228 } hi_isp_wdr_bnr_attr;
229 
230 typedef struct {
231     hi_isp_wdr_merge_mode   wdr_merge_mode;
232     hi_isp_wdr_combine_attr wdr_combine;
233     hi_isp_wdr_bnr_attr     bnr_attr;         /* Only used for Hi3559AV100/Hi3519AV100 */
234     hi_isp_fusion_attr      fusion_attr;
235     hi_isp_wdr_wb_gain_position wdr_wb_gain_position; /* RW; Range: [0x0, 0x1]; WDR Gain with or without WB Gain.
236                                                          Only used for Hi3559AV100 */
237 } hi_isp_wdr_fs_attr;
238 
239 typedef struct {
240     hi_u16 x;     /* RW; Range:[0, 1000]; Format:10.0; x position of the characteristic point of the cubic curve;
241                      Only used for Hi3559AV100 */
242     hi_u16 y;     /* RW; Range:[0, 1000]; Format:10.0; y position of the characteristic point of the cubic curve;
243                      Only used for Hi3559AV100 */
244     hi_u16 slope; /* RW; Range:[0, 10000]; Format:14.0; slope of the characteristic point of the cubic curve;
245                      Only used for Hi3559AV100 */
246 } hi_isp_drc_cubic_point_attr;
247 
248 typedef struct {
249     hi_u8   asymmetry;    /* RW; Range:[0x1, 0x1E]; Format:5.0; The parameter0 of DRC asymmetry tone mapping curve */
250     hi_u8   second_pole;  /* RW; Range:[0x96,0xD2]; Format:8.0; The parameter1 of DRC asymmetry tone mapping curve */
251     hi_u8   stretch;      /* RW; Range:[0x1E,0x3C]; Format:6.0; The parameter2 of DRC asymmetry tone mapping curve */
252     hi_u8   compress;     /* RW; Range:[0x64,0xC8]; Format:8.0; The parameter3 of DRC asymmetry tone mapping curve */
253 } hi_isp_drc_asymmetry_curve_attr;
254 
255 typedef struct {
256     hi_u16 strength; /* RW; Range:Hi3559AV100 = [0x0, 0xFF] | Hi3519AV100 = [0x0, 0x3FF] | Hi3516CV500 = [0x0, 0x3FF] |
257                         Hi3516DV300 = [0x0, 0x3FF] | Hi3516AV300 = [0x0, 0x3FF] | Hi3559V200 = [0x0, 0x3FF] |
258                         Hi3556V200 = [0x0, 0x3FF] | Hi3516EV200 = [0x0, 0x3FF] | Hi3516EV300 = [0x0, 0x3FF] |
259                         Hi3518EV300 = [0x0, 0x3FF] | Hi3516DV200 = [0x0, 0x3FF];
260                         Strength of dynamic range compression. Higher values lead to higher differential gain between
261                         shadows and highlights. */
262 } hi_isp_drc_manual_attr;
263 
264 typedef struct {
265     hi_u16 strength;  /* RW; Range:Hi3559AV100 = [0x0, 0xFF] | Hi3519AV100 = [0x0, 0x3FF] | Hi3516CV500 = [0x0, 0x3FF]|
266                          Hi3516DV300 = [0x0, 0x3FF] |Hi3516AV300 = [0x0, 0x3FF] | Hi3559V200 = [0x0, 0x3FF]|
267                          Hi3556V200 = [0x0, 0x3FF] | Hi3516EV200 = [0x0, 0x3FF] | Hi3516EV300 = [0x0, 0x3FF]|
268                          Hi3518EV300 = [0x0, 0x3FF]|Hi3516DV200 = [0x0, 0x3FF];
269                          It is the base strength. The strength used in ISP is generated by firmware.
270                          n linear mode, strength = f1(u16Strength, histogram)
271                          In sensor WDR mode: strength = f2(u16Strength, histogram)
272                          In 2to1 WDR mode: strength = f3(ExpRatio) */
273 
274     hi_u16 strength_max; /* RW; Range: Hi3559AV100 = [0x0, 0xFF] | Hi3519AV100 = [0x0, 0x3FF] |
275                             Hi3516CV500 = [0x0, 0x3FF] | Hi3516DV300 = [0x0, 0x3FF] | Hi3516AV300 = [0x0, 0x3FF] |
276                             Hi3559V200 = [0x0, 0x3FF] | Hi3556V200 = [0x0, 0x3FF] | Hi3516EV200 = [0x0, 0x3FF]|
277                             Hi3516EV300 = [0x0, 0x3FF] | Hi3518EV300 = [0x0, 0x3FF]| Hi3516DV200 = [0x0, 0x3FF];
278                             Maximum DRC strength in Auto mode */
279     hi_u16 strength_min; /* RW; Range: Hi3559AV100 = [0x0, 0xFF] | Hi3519AV100 = [0x0, 0x3FF] |
280                             Hi3516CV500 = [0x0, 0x3FF] | Hi3516DV300 = [0x0, 0x3FF] | Hi3516AV300 = [0x0, 0x3FF] |
281                             Hi3559V200 = [0x0, 0x3FF] | Hi3556V200 = [0x0, 0x3FF]| Hi3516EV200 = [0x0, 0x3FF] |
282                             Hi3516EV300 = [0x0, 0x3FF]|Hi3518EV300 = [0x0, 0x3FF]|Hi3516DV200 = [0x0, 0x3FF];
283                             Minimum DRC strength in Auto mode */
284 } hi_isp_drc_auto_attr;
285 
286 typedef ISP_DRC_CURVE_SELECT_E hi_isp_drc_curve_select;
287 
288 typedef struct {
289     hi_bool enable;
290     hi_isp_drc_curve_select curve_select;  /* RW; Range:[0x0, 0x2]; Select tone mapping curve type */
291 
292     hi_u8  pd_strength;           /* RW; Range:[0x0, 0x80]; Format:8.0; Controls the purple detection strength,
293                                       Only used for Hi3559AV100/Hi3519AV100/Hi3516CV500/Hi3516DV300/Hi3516AV300/
294                                       Hi3559V200/Hi3556V200 */
295     hi_u8  local_mixing_bright_max; /* RW; Range:[0x0, 0x80]; Format:8.0;
296                                        Maximum enhancement strength for positive detail */
297     hi_u8  local_mixing_bright_min; /* RW; Range:[0x0, 0x40]; Format:8.0;
298                                        Minimum enhancement strength for positive detail */
299     hi_u8  local_mixing_bright_thr; /* RW; Range:[0x0, 0xFF]; Format:8.0;
300                                        Luma threshold for enhancement strength adaptation of positive detail */
301     hi_s8  local_mixing_bright_slo; /* RW; Range:[-7, 7]; Format:s4.0;
302                                        Enhancement strength adaptation slope for positive detail */
303     hi_u8  local_mixing_dark_max;   /* RW; Range:[0x0, 0x80]; Format:8.0;
304                                        Maximum enhancement strength for negative detail */
305     hi_u8  local_mixing_dark_min;   /* RW; Range:[0x0, 0x40]; Format:8.0;
306                                        Minimum enhancement strength for negative detail */
307     hi_u8  local_mixing_dark_thr;   /* RW; Range:[0x0, 0xFF]; Format:8.0;
308                                        Luma threshold for enhancement strength adaptation of negative detail */
309     hi_s8  local_mixing_dark_slo;   /* RW; Range:[-7, 7]; Format:s4.0;
310                                        Enhancement strength adaptation slope for negative detail */
311 
312     hi_u8  detail_bright_str;      /* RW; Range:[0x0, 0x80]; Format:8.0; Controls the gain of the non-linear positive
313                                       detail enhancement; Only used for Hi3559AV100 */
314     hi_u8  detail_dark_str;        /* RW; Range:[0x0, 0x80]; Format:8.0; Controls the gain of the non-linear negative
315                                       detail enhancement; Only used for Hi3559AV100 */
316     hi_u8  detail_bright_step;     /* RW; Range:[0x0, 0x80]; Format:8.0; Controls the step of the non-linear positive
317                                       detail enhancement; Only used for Hi3559AV100 */
318     hi_u8  detail_dark_step;       /* RW; Range:[0x0, 0x80]; Format:8.0; Controls the step of the non-linear negative
319                                       detail enhancement; Only used for Hi3559AV100 */
320 
321     hi_u8  bright_gain_lmt;         /* RW; Range:[0x0, 0xF];  Format:4.0; Bright area gain high limit */
322     hi_u8  bright_gain_lmt_step;    /* RW; Range:[0x0, 0xF];  Format:4.0; Bright area gain high limit step */
323     hi_u8  dark_gain_lmt_y;         /* RW; Range:[0x0, 0x85]; Format:7.0; Dark area luma gain limit */
324     hi_u8  dark_gain_lmt_c;         /* RW; Range:[0x0, 0x85]; Format:7.0; Dark area chroma gain limit */
325     hi_u16 color_correction_lut[HI_ISP_DRC_CC_NODE_NUM]; /* RW; Range:[0x0, 0x400]; Format:4.12;
326                                                             LUT of color correction coefficients */
327     hi_u16 tone_mapping_value[HI_ISP_DRC_TM_NODE_NUM];   /* RW; Range:[0x0, 0xffff]; Format:16.0;
328                                                             LUT of user-defined curve */
329 
330     hi_u8  flt_scale_coarse;     /* RW; Range:[0x0, 0xF]; Format:4.0; Spatial filter scale coarse control;
331                                     Only used for Hi3559AV100 and Hi3519AV100 */
332     hi_u8  flt_scale_fine;       /* RW; Range:[0x0, 0xF]; Format:4.0; Spatial filter scale fine control;
333                                     Only used for Hi3559AV100 and Hi3519AV100  */
334     hi_u8  contrast_control;     /* RW; Range:[0x0, 0xF]; Format:4.0; Contrast control */
335     hi_s8  detail_adjust_factor; /* RW; Range:[-15, 15];  Format:4.0; Detail adjustment factor */
336 
337     hi_u8  spatial_flt_coef;     /* RW; Range: Hi3559AV100 = [0x0, 0xA] | Hi3519AV100 = [0x0, 0x5] |
338                                     Hi3516CV500 = [0x0, 0x5] | Hi3516DV300 = [0x0, 0x5] | Hi3516AV300 = [0x0, 0x5] |
339                                     Hi3559V200 = [0x0, 0x5] | Hi3556V200 = [0x0, 0x5] | Hi3516EV200 = [0x0, 0x5] |
340                                     Hi3516EV300 = [0x0, 0x5] |Hi3518EV300 = [0x0, 0x5]|Hi3516DV200 = [0x0, 0x5];
341                                     Spatial filter coefficients */
342     hi_u8  range_flt_coef;    /* RW; Range:[0x0, 0xA]; Format:4.0; Range filter coefficients */
343     hi_u8  range_ada_max;     /* RW; Range:[0x0, 0x8]; Format:4.0; Maximum range filter coefficient adaptation range */
344 
345     hi_u8  grad_rev_max;         /* RW; Range:[0x0, 0x40]; Format:7.0; Maximum gradient reversal reduction strength */
346     hi_u8  grad_rev_thr;         /* RW; Range:[0x0, 0x80]; Format:8.0; Gradient reversal reduction threshold */
347 
348     hi_u8  dp_detect_range_ratio; /* RW; Range:[0x0, 0x1F]; Format:5.0; DRC defect pixel detection control parameter;
349                                      Only used for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
350     hi_u8  dp_detect_thr_slo;     /* RW; Range:[0x0, 0x1F]; Format:5.0; DRC defect pixel detection control parameter;
351                                      Only used for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
352     hi_u16 dp_detect_thr_min;     /* RW; Range:[0x0, 0xFFFF]; Format:16.0; DRC defect pixel detection control parameter;
353                                      Only used for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
354 
355     hi_isp_op_type op_type;
356     hi_isp_drc_manual_attr manual_attr;
357     hi_isp_drc_auto_attr   auto_attr;
358     hi_isp_drc_cubic_point_attr cubic_point[HI_ISP_DRC_CUBIC_POINT_NUM];
359     hi_isp_drc_asymmetry_curve_attr asymmetry_curve;
360 } hi_isp_drc_attr;
361 
362 typedef struct {
363     hi_u8 wgt;   /* RW;Range:Hi3559AV100 = [0x0, 0x80] | Hi3519AV100 = [0x0, 0x80]| Hi3516CV500 = [0x0, 0xFF] |
364                     Hi3516DV300 = [0x0, 0xFF]| Hi3516AV300 = [0x0, 0xFF]|Hi3559V200 = [0x0, 0xFF] |
365                     Hi3556V200 = [0x0, 0xFF] | Hi3516EV200 = [0x0, 0xFF] | Hi3516EV300 = [0x0, 0xFF] |
366                     Hi3518EV300 = [0x0, 0xFF]| Hi3516DV200 = [0x0, 0xFF];
367                     Format:1.7;Weight of Gaussian distribution */
368     hi_u8 sigma; /* RW;Range: [0x1, 0xFF];Format:0.8;Sigma of Gaussian distribution */
369     hi_u8 mean;  /* RW;Range: [0x0, 0xFF];Format:0.8;Mean of Gaussian distribution */
370 } hi_isp_ldci_gauss_coef_attr;
371 
372 typedef struct {
373     hi_isp_ldci_gauss_coef_attr  he_pos_wgt;
374     hi_isp_ldci_gauss_coef_attr  he_neg_wgt;
375 } hi_isp_ldci_he_wgt_attr;
376 
377 typedef struct {
378     hi_isp_ldci_he_wgt_attr  he_wgt;
379     hi_u16                   blc_ctrl;  /* RW;Range: [0x0, 0x1FF];Format:9.0;Restrain dark region */
380 } hi_isp_ldci_manual_attr;
381 
382 typedef struct {
383     hi_isp_ldci_he_wgt_attr  he_wgt[ISP_AUTO_ISO_STRENGTH_NUM];
384     hi_u16                   blc_ctrl[ISP_AUTO_ISO_STRENGTH_NUM]; /* RW;Range: [0x0, 0x1FF];Format:9.0;auto mode,
385                                                                      Restrain dark region */
386 } hi_isp_ldci_auto_attr;
387 
388 typedef struct {
389     hi_bool                 enable;          /* RW;Range:[0x0,0x1];Format:1.0; */
390     hi_u8                   gauss_lpf_sigma; /* RW;Range: [0x1, 0xFF];Format:0.8;
391                                                 Coefficient of Gaussian low-pass filter */
392     hi_isp_op_type          op_type;
393     hi_isp_ldci_manual_attr manual_attr;
394     hi_isp_ldci_auto_attr   auto_attr;
395     hi_u16                  tpr_incr_coef;   /* RW;Range: [0x0, 0x100];Format:0.9;
396                                                 Increase Coefficient of temporal filter */
397     hi_u16                  tpr_decr_coef;   /* RW;Range: [0x0, 0x100];Format:0.9;
398                                                 Decrease Coefficient of temporal filter */
399 } hi_isp_ldci_attr;
400 
401 typedef ISP_CA_TYPE_E hi_isp_ca_type;
402 
403 typedef struct {
404     hi_u32  y_ratio_lut[HI_ISP_CA_YRATIO_LUT_LENGTH];  /* RW;Range:[0,2047];Format:1.11 */
405     hi_s32  iso_ratio[ISP_AUTO_ISO_STRENGTH_NUM];      /* RW;Range:[0,2047];Format:1.10 */
406 } hi_isp_ca_lut;
407 
408 /* Only used for Hi3559AV100/Hi3519AV100 */
409 typedef struct {
410     hi_u8   cp_lut_y[HI_ISP_CA_YRATIO_LUT_LENGTH]; /* RW;Range:[0,255];Format:8.0; */
411     hi_u8   cp_lut_u[HI_ISP_CA_YRATIO_LUT_LENGTH]; /* RW;Range:[0,255];Format:8.0; */
412     hi_u8   cp_lut_v[HI_ISP_CA_YRATIO_LUT_LENGTH]; /* RW;Range:[0,255];Format:8.0; */
413 } hi_isp_cp_lut;
414 
415 typedef struct {
416     hi_bool enable;             /* RW;Range:[0x0,0x1];Format:1.0 */
417     hi_isp_ca_type ca_cp_en;    /* Only used for Hi3559AV100/Hi3519AV100 */
418     hi_isp_ca_lut  ca;
419     hi_isp_cp_lut  cp;         /* Only used for Hi3559AV100/Hi3519AV100 */
420 } hi_isp_ca_attr;
421 
422 /* CSC */
423 typedef struct {
424     hi_s16 csc_in_dc[ISP_CSC_DC_NUM];   /* RW; Range:[-1024, 1023]; Format: 11.0; Input dc component for csc matrix */
425     hi_s16 csc_out_dc[ISP_CSC_DC_NUM];  /* RW; Range:[-1024, 1023]; Format: 11.0; Output dc component for csc matrix */
426     hi_s16 csc_coef[ISP_CSC_COEF_NUM];  /* RW; Range:[-4096, 4095]; Format: 5.10; 3x3 coefficients for csc matrix */
427 } hi_isp_csc_matrx;
428 
429 typedef struct {
430     hi_bool enable;            /* RW; Range:[0, 1];Format:1.0; Enable/Disable CSC Function */
431 
432     hi_color_gamut color_gamut; /* RW; Range: [0, 3]; Color gamut type; COLOR_GAMUT_BT2020 only used for Hi3559AV100 */
433     hi_u8   hue;              /* RW; Range:[0, 100];Format:8.0; Csc Hue Value */
434     hi_u8   luma;             /* RW; Range:[0, 100];Format:8.0; Csc Luma Value */
435     hi_u8   contr;            /* RW; Range:[0, 100];Format:8.0; Csc Contrast Value */
436     hi_u8   satu;             /* RW; Range:[0, 100];Format:8.0; Csc Saturation Value */
437     hi_bool limited_range_en; /* RW; Range: [0x0, 0x1];
438                                  Enable/Disable: Enable Limited range output mode(default full range output) */
439     hi_bool ext_csc_en;       /* RW; Range: [0x0, 0x1]; Enable/Disable: Enable extended luma range */
440     hi_bool ct_mode_en;       /* RW; Range: [0x0, 0x1]; Enable/Disable: Enable ct mode */
441     hi_isp_csc_matrx csc_magtrx;     /* RW; Color Space Conversion matrix */
442 } hi_isp_csc_attr;
443 
444 /* CLUT */
445 typedef struct {
446     hi_bool enable; /* RW; Range:[0, 1];Format:1.0; Enable/Disable CLUT Function,
447                        Not support for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
448     hi_u32  gain_r; /* RW; Range:[0, 4095];Format:12.0,
449                        Not support for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
450     hi_u32  gain_g; /* RW; Range:[0, 4095];Format:12.0,
451                        Not support for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
452     hi_u32  gain_b; /* RW; Range:[0, 4095];Format:12.0,
453                        Not support for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
454 } hi_isp_clut_attr;
455 
456 /* CLUT LUT */
457 typedef struct {
458     hi_u32 lut[HI_ISP_CLUT_LUT_LENGTH];  /* RW; Range: Hi3559AV100 = [0, 4294967295] | Hi3519AV100 = [0x0, 1073741823]|
459                                             Hi3516CV500 = [0x0, 1073741823]| Hi3516DV300 = [0x0, 1073741823] |
460                                             Hi3516AV300 = [0x0, 1073741823] | Hi3559V200 = [0x0, 1073741823]|
461                                             Hi3556V200 = [0x0, 1073741823];
462                                             Not support for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
463 } hi_isp_clut_lut;
464 
465 /*
466  * Defines the type of static defect pixel calibration
467  * 0 = bright defect pixel calibration
468  * 1 = dark defect pixel calibration
469  */
470 typedef ISP_STATIC_DP_TYPE_E hi_isp_static_dp_type;
471 
472 typedef struct {
473     hi_bool enable_detect;                /* RW; Range: [0, 1];Format 1.0;Set 'HI_TRUE'to start static defect-pixel
474                                              calibration, and firmware will set 'HI_FALSE' when finished,
475                                              Not support for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
476     hi_isp_static_dp_type static_dp_type; /* RW; Range: [0, 1];Format 1.0;Select static bright/dark defect-pixel
477                                              calibration,Not support for Hi3516EV200/Hi3516EV300/Hi3518EV300/
478                                              Hi3516DV200 */
479     hi_u8  start_thresh;  /* RW; Range: [1, 255]; Format 8.0;Start threshold for static defect-pixel calibraiton,
480                              Not support for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
481     hi_u16 count_max;     /* RW; Range:Hi3559AV100 = [0, 8192] | Hi3519AV100 = [0, 8192]| Hi3516CV500 = [0, 6144] |
482                              Hi3516DV300 = [0, 6144] | Hi3516AV300 = [0, 6144] |Hi3559V200 = [0, 6144] |
483                              Hi3556V200 = [0, 6144];Format 14.0; limited Range: [0, STATIC_DP_COUNT_NORMAL*BlkNum],
484                              Limit of max number of static defect-pixel calibraiton.
485                              Not support for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
486     hi_u16 count_min;     /* RW; Range:Hi3559AV100 = [0, 8192] | Hi3519AV100 = [0, 8192]| Hi3516CV500 = [0, 6144] |
487                              Hi3516DV300 = [0, 6144]| Hi3516AV300 = [0, 6144]| Hi3559V200 = [0, 6144] |
488                              Hi3556V200 = [0, 6144];Format 14.0; limited Range: [0, u16CountMax],
489                              Limit of min number of static defect-pixel calibraiton.
490                              Not support for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
491     hi_u16 time_limit;    /* RW; Range: [0x0, 1600];Format 11.0;Time limit for static defect-pixel calibraiton, in
492                              frame number,Not support for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
493 
494     hi_u32 table[STATIC_DP_COUNT_MAX];  /* R; Range: [0, 0x1FFF1FFF];Format 29.0;Static defect-pixel calibraiton table,
495                                            0~12 bits represents the X coordinate of the defect pixel,
496                                            16~28 bits represent the Y coordinate of the defect pixel.
497                                            Not support for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
498     hi_u8  finish_thresh;   /* R; Range: [0, 255];Format 8.0; Finish threshold for static defect-pixel calibraiton,
499                                Not support for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
500     hi_u16 count;          /* R; Range:Hi3559AV100 = [0, 8192] | Hi3519AV100 = [0, 8192] Hi3516CV500 = [0, 6144]|
501                               Hi3516DV300 = [0, 6144]| Hi3516AV300 = [0, 6144]| Hi3559V200 = [0, 6144] |
502                               Hi3556V200 = [0, 6144];Format 14.0; Finish number for static defect-pixel calibraiton
503                               Not support for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
504     hi_isp_status status;  /* R; Range: [0, 2];Format 2.0;Status of static defect-pixel calibraiton,
505                               Not support for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
506 } hi_isp_dp_static_calibrate;
507 
508 typedef struct {
509     hi_bool enable;       /* RW; Range: [0, 1];Format 1.0;Enable/disable the static defect-pixel module,
510                              Not support for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
511     hi_u16  bright_count; /* RW; Range:Hi3559AV100 = [0, 8192] | Hi3519AV100 = [0, 8192]| Hi3516CV500 = [0, 6144]|
512                              Hi3516DV300 = [0, 6144]| Hi3516AV300 = [0, 6144]| Hi3559V200 = [0, 6144] |
513                              Hi3556V200 = [0, 6144];Format 14.0;limited Range: [0, STATIC_DP_COUNT_NORMAL*BlkNum],
514                              When used as input(W), indicate the number of static bright defect pixels;
515                              As output(R),indicate the number of static bright and dark defect pixels.
516                              Not support for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
517     hi_u16  dark_count;   /* RW; Range:Hi3559AV100 = [0, 8192] | Hi3519AV100 = [0, 8192]| Hi3516CV500 = [0, 6144]|
518                              Hi3516DV300 = [0, 6144]| Hi3516AV300 = [0, 6144]|Hi3559V200 = [0, 6144] |
519                              Hi3556V200 = [0, 6144];Format 14.0;limited Range: [0, STATIC_DP_COUNT_NORMAL*BlkNum],
520                              When used as input(W), indicate the number of static dark defect pixels;
521                              As output(R), invalid value 0.
522                              Not support for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
523     hi_u32  bright_table[STATIC_DP_COUNT_MAX]; /* RW; Range: [0x0, 0x1FFF1FFF];Format 29.0;
524                                                   0~12 bits represents the X coordinate of the defect pixel,
525                                                   16~28 bits represent the Y coordinate of the defect pixel
526                                                   Notice: When used as input(W), indicate static bright defect pixels
527                                                   table; As output(R), indicate static bright and dark defect pixels
528                                                   table.
529                                                   Not support for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
530 
531     hi_u32  dark_table[STATIC_DP_COUNT_MAX]; /* RW; Range: [0x0, 0x1FFF1FFF];Format 29.0;
532                                                 0~12 bits represents the X coordinate of the defect pixel,
533                                                 16~28 bits represent the Y coordinate of the defect pixel
534                                                 Notice: When used as input(W), indicate static dark defect pixels table;
535                                                 As output(R), invalid value.
536                                                 Not support for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
537     hi_bool show;                  /* RW; Range: [0, 1];Format 1.0;RW;highlight static defect pixel,
538                                       Not support for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
539 } hi_isp_dp_static_attr;
540 
541 typedef struct {
542     hi_u16  strength;           /* RW; Range: [0, 255];Format:8.0;Dynamic DPC strength. */
543     hi_u16  blend_ratio;        /* RW; Range: [0, 128];Format:9.0;Blending ratio required for DPC */
544 } hi_isp_dp_dynamic_manual_attr;
545 
546 typedef struct {
547     hi_u16  strength[ISP_AUTO_ISO_STRENGTH_NUM];  /* RW; Range: [0, 255];Format:8.0;Dynamic DPC strength. */
548     hi_u16  blend_ratio[ISP_AUTO_ISO_STRENGTH_NUM]; /* RW; Range: [0, 128];Format:9.0;Blending ratio required for DPC */
549 } hi_isp_dp_dynamic_auto_attr;
550 
551 typedef struct {
552     hi_bool enable;             /* RW; Range: [0, 1];Format 1.0;Enable/disable the dynamic defect-pixel module */
553     hi_bool sup_twinkle_en;     /* RW; Range: [0, 1];Format 1.0;Enable/disable the twinkle suppression  module */
554     hi_s8   soft_thr;           /* RW; Range: [0, 127];Format s8.0;twinkle suppression threshold */
555     hi_u8   soft_slope;         /* RW; Range: [0, 255];Format 8.0;Correction controlling parameter of the pixels whose
556                                    deviation is smaller than s8SoftThr. */
557     hi_isp_op_type op_type;     /* RW; Range: [0, 1];Format 1.0;Working mode of dynamic DPC */
558     hi_isp_dp_dynamic_manual_attr manual_attr;
559     hi_isp_dp_dynamic_auto_attr   auto_attr;
560 } hi_isp_dp_dynamic_attr;
561 
562 typedef struct {
563     hi_bool enable; /* RW; Range: [0, 1];Format 1.0;Enable/disable dis module,
564                        Not support for Hi3516CV500/Hi3516DV300/Hi3516AV300/Hi3559V200/Hi3556V200 */
565 } hi_isp_dis_attr;
566 
567 typedef struct {
568     hi_bool enable;      /* RW; Range:[0, 1];Format:1.0; HI_TRUE: enable lsc; HI_FALSE: disable lsc */
569     hi_u16  mesh_str;    /* RW; Range:Hi3559AV100=[0, 65535]| Hi3519AV100=[0, 65535]|Hi3516CV500=[0, 65535]|
570                             Hi3516DV300=[0, 65535]|Hi3516AV300=[0, 65535]| Hi3559V200=[0, 65535]|
571                             Hi3556V200=[0, 65535] | Hi3516EV200 = [0x0, 1023] | Hi3516EV300 = [0x0,1023] |
572                             Hi3518EV300 = [0x0,1023] | Hi3516DV200 = [0x0,1023];
573                             The strength of the mesh shading correction */
574     hi_u16  blend_ratio; /* RW; Range:[0, 256];Format:9.0; the blendratio of the two mesh gain lookup-table */
575 } hi_isp_shading_attr;
576 
577 typedef struct {
578     hi_u16  r_gain[HI_ISP_LSC_GRID_POINTS];  /* RW; Range:[0, 1023];Member used to store the calibration data of the
579                                                 R channel required for LSC. */
580     hi_u16  gr_gain[HI_ISP_LSC_GRID_POINTS]; /* RW; Range:[0, 1023];Member used to store the calibration data of the
581                                                 Gr channel required for LSC. */
582     hi_u16  gb_gain[HI_ISP_LSC_GRID_POINTS]; /* RW; Range:[0, 1023];Member used to store the calibration data of the
583                                                 Gb channel required for LSC. */
584     hi_u16  b_gain[HI_ISP_LSC_GRID_POINTS];  /* RW; Range:[0, 1023];Member used to store the calibration data of the
585                                                 B channel required for LSC. */
586 } hi_isp_shading_gain_lut;
587 
588 typedef struct {
589     hi_u16  r_gain[HI_ISP_RLSC_POINTS];  /* RW; Range:[0, 65535];Member used to store the calibration data of the
590                                             R channel required for BNR_LSC.
591                                             Not support for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
592     hi_u16  gr_gain[HI_ISP_RLSC_POINTS]; /* RW; Range:[0, 65535];Member used to store the calibration data of the
593                                             Gr channel required for BNR_LSC.
594                                             Not support for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
595     hi_u16  gb_gain[HI_ISP_RLSC_POINTS]; /* RW; Range:[0, 65535];Member used to store the calibration data of the
596                                             Gb channel required for BNR_LSC.
597                                             Not support for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
598     hi_u16  b_gain[HI_ISP_RLSC_POINTS];  /* RW; Range:[0, 65535];Member used to store the calibration data of the
599                                             B channel required for BNR_LSC.
600                                             Not support for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
601 } hi_isp_bnr_lsc_gain_lut;
602 
603 typedef struct {
604     hi_u8   mesh_scale;        /* RW; Range:[0, 7];Format:3.0;Three bit value that selects the scale and precision for
605                                   the 10 bit gain coefficients stored in mesh tables */
606     hi_u16  x_grid_width[HI_ISP_MLSC_X_HALF_GRID_NUM]; /* RW; Range:Hi3559AV100=[4, 1988]| Hi3519AV100=[4, 1988]|
607                                                             Hi3516CV500=[4, 1092]|Hi3516DV300=[4, 1092]|
608                                                             Hi3516AV300=[4, 1092]|Hi3559V200=[4, 1092]|
609                                                             Hi3556V200=[4, 1092] | Hi3516EV200 = [4,255]|
610                                                             Hi3516EV300 = [4,255]|Hi3518EV300 = [4,255]|
611                                                             Hi3516DV200 = [4,255]; limited Range:[4, u32Width/4 - 60],
612                                                           Member used to store the width data of each GRID partition */
613     hi_u16  y_grid_width[HI_ISP_MLSC_Y_HALF_GRID_NUM]; /* RW; Range:Hi3559AV100=[4, 1988]| Hi3519AV100=[4, 1988]|
614                                                             Hi3516CV500=[4, 1092]|Hi3516DV300=[4, 1092]|
615                                                             Hi3516AV300=[4, 1092]|Hi3559V200=[4, 1092]|
616                                                             Hi3556V200=[4, 1092]|Hi3516EV200 = [4,255]|
617                                                             Hi3516EV300 =[4,255]| Hi3518EV300 = [4,255 ]|
618                                                             Hi3516DV200 = [4,255 ]; limited Range:[4, u32Height/4 - 60];
619                                                         Member used to store the height data of each GRID partition */
620     hi_isp_shading_gain_lut lsc_gain_lut[HI_ISP_MLSC_GAIN_LUT_NUM];
621     hi_isp_bnr_lsc_gain_lut bnr_lsc_gain_lut; /* Not support for Hi3559AV100/Hi3519AV100 */
622 } hi_isp_shading_lut_attr;
623 
624 typedef struct {
625     hi_isp_bayer_format bayer;    /* RW; Range: [0, 3];Format ENUM;Shows bayer pattern */
626     hi_isp_bayer_raw_bit raw_bit;  /* RW; Range: {8,10,12,14,16};Format ENUM;Shows input raw bitwidth */
627 
628     hi_u16  img_height; /* RW; Range: [0, 65535];Format 16.0;Input raw image height */
629     hi_u16  img_width;  /* RW; Range: [0, 65535];Format 16.0;Input raw image width */
630 
631     hi_u16  dst_img_height; /* RW; Range: [0, 65535];Format 16.0;limited Range:[0, u16ImgHeight], Image height that
632                                crop from input raw image, set to ImgHeight if don't need to crop */
633     hi_u16  dst_img_width;  /* RW; Range: [0, 65535];Format 16.0;limited Range:[0, u16ImgWidth], Image width that
634                                crop from input raw image, set to ImgWidth if don't need to crop */
635     hi_u16  offset_x;       /* RW; Range: [0, 65535];Format 16.0;limited Range:[0, u16ImgWidth - u16DstImgWidth],
636                                Horizontal offset that crop from input raw image, set to 0 if don't need to crop */
637     hi_u16  offset_y;       /* RW; Range: [0, 65535];Format 16.0;limited Range:[0, u16ImgHeight - u16DstImgHeight],
638                                Vertical offset that crop from input raw image, set to 0 if don't need to crop */
639 
640     hi_u32  mesh_scale; /* RW; Range: [0, 7];Format 3.0; Shows Mesh Scale value */
641 
642     hi_u16  blc_offset_r; /* RW; Range: [0, 4095];Format 12.0;BLC value for R channel */
643     hi_u16  blc_offset_gr; /* RW; Range: [0, 4095];Format 12.0;BLC value for Gr channel */
644     hi_u16  blc_offset_gb; /* RW; Range: [0, 4095];Format 12.0;BLC value for Gb channel */
645     hi_u16  blc_offset_b; /* RW; Range: [0, 4095];Format 12.0;BLC value for B channel */
646 } hi_isp_mlsc_calibration_cfg;
647 
648 typedef struct {
649     hi_u8   mesh_scale;       /* RW; Range:[0, 7];Format:3.0;Three bit value that selects the scale and precision for
650                                  the 10 bit gain coefficients stored in mesh tables */
651     hi_u16  x_grid_width[HI_ISP_MLSC_X_HALF_GRID_NUM]; /* RW; Range:Hi3559AV100=[4, 16323]| Hi3519AV100=[4, 16323]|
652                                                      Hi3516CV500=[4, 16323]|Hi3516DV300=[4, 16323]|
653                                                      Hi3516AV300=[4, 16323] | Hi3559V200=[4, 16323]|
654                                                      Hi3556V200=[4, 16323]|Hi3516EV200 = [4,255]|
655                                                      Hi3516EV300 =[4,255]| Hi3518EV300 = [4,255]|
656                                                      Hi3516DV200 = [4,255]; limited Range:[4, u16ImgWidth /4 - 60],
657                                                      Member used to store the width data of each GRID partition */
658     hi_u16  y_grid_width[HI_ISP_MLSC_Y_HALF_GRID_NUM]; /* RW; Hi3559AV100=[4, 16323]| Hi3519AV100=[4, 16323]|
659                                                      Hi3516CV500=[4, 16323]|Hi3516DV300=[4, 16323]|
660                                                      Hi3516AV300=[4, 16323]| Hi3559V200=[4, 16323] |
661                                                      Hi3556V200=[4, 16323]|Hi3516EV200 = [4,255]|
662                                                      Hi3516EV300 =[4,255]| Hi3518EV300 = [4,255 ]|
663                                                      Hi3516DV200 = [4,255]; limited Range:[4, u16ImgHeight /4 - 60],
664                                                      Member used to store the height data of each GRID partition */
665     hi_isp_shading_gain_lut lsc_gain_lut;
666     hi_isp_bnr_lsc_gain_lut bnr_lsc_gain_lut; /* Not support for Hi3559AV100/Hi3519AV100/
667                                                  Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
668 } hi_isp_mesh_shading_table;
669 
670 /* Only used for Hi3559AV100/Hi3519AV100 */
671 typedef struct {
672     hi_bool enable;          /* RW; Range:[0, 1];Format:1.0; enable/disable rlsc */
673     hi_u16  radial_str;     /* RW; Range:[0, 65535];Format:4.12; the strength of the mesh shading correction */
674 } hi_isp_radial_shading_attr;
675 
676 /* Only used for Hi3559AV100/Hi3519AV100 */
677 typedef struct {
678     hi_u16  r_gain[HI_ISP_RLSC_POINTS];  /* RW; Range:[0, 65535];Member used to store the calibration data of the
679                                             R channel required for RLSC.Only used for Hi3559AV100/Hi3519AV100 */
680     hi_u16  gr_gain[HI_ISP_RLSC_POINTS]; /* RW; Range:[0, 65535];Member used to store the calibration data of the
681                                             Gr channel required for RLSC.Only used for Hi3559AV100/Hi3519AV100 */
682     hi_u16  gb_gain[HI_ISP_RLSC_POINTS]; /* RW; Range:[0, 65535];Member used to store the calibration data of the
683                                             Gb channel required for RLSC.Only used for Hi3559AV100/Hi3519AV100 */
684     hi_u16  b_gain[HI_ISP_RLSC_POINTS];  /* RW; Range:[0, 65535];Member used to store the calibration data of the
685                                             B channel required for RLSC.Only used for Hi3559AV100/Hi3519AV100 */
686 } hi_isp_radial_shading_gain_lut;
687 
688 /* Only used for Hi3559AV100/Hi3519AV100 */
689 typedef struct {
690     hi_operation_mode light_mode;  /* RW; Range:[0, 1];Format:1.0; 1: manual mode; 0: auto mode */
691     hi_u16  blend_ratio;           /* RW; Range:[0, 256];Format:8.0; Used in manual mode only, indicates the light
692                                       blending strength for the first light info */
693     hi_u8   light_type1;           /* RW; Range:[0, 2];Format:2.0; Used in manual mode only, indicates the first light
694                                       source selected */
695     hi_u8   light_type2;           /* RW; Range:[0, 2];Format:2.0; Used in manual mode only, indicates the second light
696                                       source selected */
697     hi_u8   radial_scale;          /* RW; Range:[0, 13];Format:4.0;Four bit value that selects the scale and precision
698                                       for the 10 bit gain coefficients */
699     hi_u16  center_r_x;    /* RW; Range:[0, 65535];Format:16.0;Limited Range:[0, Width], shows x value of the position
700                               of optical center of red channel */
701     hi_u16  center_r_y;    /* RW; Range:[0, 65535];Format:16.0;Limited Range:[0, Height], shows y value of the position
702                               of optical center of red channel */
703     hi_u16  center_gr_x;   /* RW; Range:[0, 65535];Format:16.0;Limited Range:[0, Width], shows x value of the position
704                               of optical center of gr channel */
705     hi_u16  center_gr_y;   /* RW; Range:[0, 65535];Format:16.0;Limited Range:[0, Height], shows y value of the position
706                               of optical center of gr channel */
707     hi_u16  center_gb_x;   /* RW; Range:[0, 65535];Format:16.0;Limited Range:[0, Width], shows x value of the position
708                               of optical center of gb channel */
709     hi_u16  center_gb_y;   /* RW; Range:[0, 65535];Format:16.0;Limited Range:[0, Height], shows y value of the position
710                               of optical center of gb channel */
711     hi_u16  center_b_x;    /* RW; Range:[0, 65535];Format:16.0;Limited Range:[0, Width], shows x value of the position
712                               of optical center of blue channel */
713     hi_u16  center_b_y;    /* RW; Range:[0, 65535];Format:16.0;Limited Range:[0, Height], shows y value of the position
714                               of optical center of blue channel */
715     hi_u16  off_center_r;  /* RW; Range:[0, 65535];Format:16.0;related to the 1/R^2 value of red channel */
716     hi_u16  off_center_gr; /* RW; Range:[0, 65535];Format:16.0;related to the 1/R^2 value of gr channel */
717     hi_u16  off_center_gb; /* RW; Range:[0, 65535];Format:16.0;related to the 1/R^2 value of gb channel */
718     hi_u16  off_center_b;  /* RW; Range:[0, 65535];Format:16.0;related to the 1/R^2 value of blue channel */
719     hi_isp_radial_shading_gain_lut rlsc_gain_lut[3]; /* Only used for Hi3559AV100/Hi3519AV100 */
720 } hi_isp_radial_shading_lut_attr;
721 
722 typedef struct {
723     hi_isp_bayer_format bayer;    /* RW; Range: [0, 3];Format ENUM;Shows bayer pattern */
724     hi_isp_bayer_raw_bit raw_bit;  /* RW; Range: {8,10,12,14,16};Format ENUM;Shows input raw bitwidth */
725 
726     hi_u16  img_height; /* RW; Range: [0, 65535];Format 16.0;Input raw image height */
727     hi_u16  img_width;  /* RW; Range: [0, 65535];Format 16.0;Input raw image width */
728 
729     hi_u16  center_x;       /* RW; Range: [0, 65535];Format 16.0;limited Range:[0, u16ImgWidth - u16DstImgWidth],
730                                Horizontal offset that crop from input raw image, set to 0 if don't need to crop */
731     hi_u16  center_y;       /* RW; Range: [0, 65535];Format 16.0;limited Range:[0, u16ImgHeight - u16DstImgHeight],
732                                Vertical offset that crop from input raw image, set to 0 if don't need to crop */
733     hi_u16  radius;      /* RW; Range: [0, 65535];Format 16.0; radius of the area need to calibrate */
734 
735     hi_u16  radial_scale; /* RW; Range: [0, 13];Format 3.0; Shows Scale value */
736 
737     hi_u16  blc_offset_r; /* RW; Range: [0, 4095];Format 12.0;BLC value for R channel */
738     hi_u16  blc_offset_gr; /* RW; Range: [0, 4095];Format 12.0;BLC value for Gr channel */
739     hi_u16  blc_offset_gb; /* RW; Range: [0, 4095];Format 12.0;BLC value for Gb channel */
740     hi_u16  blc_offset_b; /* RW; Range: [0, 4095];Format 12.0;BLC value for B channel */
741 } hi_isp_rlsc_calibration_cfg;
742 
743 typedef struct {
744     hi_u8   radial_scale;       /* RW; Range:[0, 13];Format:4.0;Four bit value that selects the scale and precision
745                                       for the 10 bit gain coefficients */
746     hi_u16  center_x;    /* RW; Range:[0, 65535];Format:16.0;Limited Range:[0, Width], shows x value of the position
747                               of optical center */
748     hi_u16  center_y;    /* RW; Range:[0, 65535];Format:16.0;Limited Range:[0, Height], shows y value of the position
749                               of optical center */
750     hi_u16  offcenter;   /* RW; Range:[0, 65535];Format:16.0;related to the 1/R^2 value of all channel */
751     hi_isp_radial_shading_gain_lut rlsc_gain_lut; /* Only used for Hi3559AV100/Hi3519AV100 */
752 } hi_isp_radial_shading_table;
753 
754 typedef struct {
755     hi_bool enable;       /* RW; Range:[0,1];Format:1.0;Acs Enable */
756     hi_u16  y_strength;   /* RW; Range:[0,256];Format:8.0;Acs correction strength for y shading */
757     hi_u16  run_interval; /* RW; Range:[1,255];Format:16.0;Acs Run Interval */
758     hi_bool lock_enable;  /* RW; Range:[0,1];Format:1.0;Lock Gain Lut Enable */
759 } hi_isp_acs_attr;
760 
761 typedef struct {
762     hi_u8   chroma_str[ISP_BAYER_CHN_NUM]; /* RW;Range:[0, 3];Format:2.0;
763                                               Strength of Chrmoa noise reduction for R/Gr/Gb/B channel,
764                                               Not support for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
765     hi_u8   fine_str;                      /* RW;Range:[0, 0x80];Format:8.0;Strength of Luma noise reduction */
766     hi_u16  coring_wgt;                    /* RW;Range:[0, 0xc80];Format:12.0;Strength of reserving the random noise */
767     hi_u16  coarse_str[ISP_BAYER_CHN_NUM]; /* RW;Range:[0, 0x360];Format:10.0; Coarse Strength of noise reduction */
768 } hi_isp_nr_manual_attr;
769 
770 typedef struct {
771     hi_u8   chroma_str[ISP_BAYER_CHN_NUM][ISP_AUTO_ISO_STRENGTH_NUM];  /* RW;Range:[0, 3];Format:2.0;
772                                                                           Strength of chrmoa noise reduction for
773                                                                           R/Gr/Gb/B channel,
774                                                                           Not support for Hi3516EV200/Hi3516EV300/
775                                                                           Hi3518EV300/Hi3516DV200 */
776     hi_u8   fine_str[ISP_AUTO_ISO_STRENGTH_NUM];                      /* RW;Range:[0, 0x80];Format:8.0;
777                                                                          Strength of luma noise reduction */
778     hi_u16  coring_wgt[ISP_AUTO_ISO_STRENGTH_NUM];                    /* RW;Range:[0, 0xc80];Format:12.0;
779                                                                          Strength of reserving the random noise */
780     hi_u16  coarse_str[ISP_BAYER_CHN_NUM][ISP_AUTO_ISO_STRENGTH_NUM]; /* RW;Range:[0, 0x360];Format:10.0;
781                                                                          Coarse Strength of noise reduction */
782 } hi_isp_nr_auto_attr;
783 
784 typedef struct {
785     hi_u8 wdr_frame_str[WDR_MAX_FRAME_NUM];    /* RW;Range:[0, 0x50];Format:7.0; Strength of each frame in wdr mode */
786     hi_u8 fusion_frame_str[WDR_MAX_FRAME_NUM]; /* RW;Range:[0, 0x50];Format:7.0; Strength of each frame in wdr mode.
787                                                   Only used for Hi3516CV500/Hi3516DV300/Hi3516AV300/Hi3559V200/
788                                                   Hi3556V200/Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
789 } hi_isp_nr_wdr_attr;
790 
791 typedef struct {
792     hi_bool  enable;               /* RW;Range:[0, 1];Format:1.0; Nr Enable */
793     hi_bool  low_power_enable;     /* RW;Range:[0, 1];Format:1.0; Nr Low Power Enable.
794                                       Not support for Hi3516CV500/Hi3516DV300/Hi3516AV300/Hi3559V200/Hi3556V200/
795                                       Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
796     hi_bool  nr_lsc_enable;        /* RW;Range:[0, 1];Format:1.0;
797                                       HI_TRUE: Noise reduction refers to lens shading;
798                                       HI_FALSE: Noise reduction not refers to lens shading; */
799     hi_u8    nr_lsc_ratio;         /* RW;Range:[0, 0xff];Format:8.0; Ratio of referring to lens shading.
800                                       Not support for Hi3516CV500/Hi3516DV300/Hi3516AV300/Hi3559V200/Hi3556V200/
801                                       Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
802     hi_u8    bnr_lsc_max_gain;     /* RW;Range:[0, 0xbf];Format:2.6; Max gain for referring to lens shading.
803                                       Only used for Hi3516CV500/Hi3516DV300/Hi3516AV300/Hi3559V200/Hi3556V200/
804                                       Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
805     hi_u16   bnr_lsc_cmp_strength; /* RW;Range:[0, 0x100];Format:1.8; Compare strength for referring to lens shading.
806                                       Only used for Hi3516CV500/Hi3516DV300/Hi3516AV300/Hi3559V200/Hi3556V200/
807                                       Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
808     hi_u16   coring_ratio[HI_ISP_BAYERNR_LUT_LENGTH];  /* RW;Range:[0, 0x3ff];Format:12.0;
809                                                           Strength of reserving the random noise according to luma */
810 
811     hi_isp_op_type op_type;
812     hi_isp_nr_auto_attr auto_attr;
813     hi_isp_nr_manual_attr manual_attr;
814     hi_isp_nr_wdr_attr  wdr_attr;
815 } hi_isp_nr_attr;
816 
817 /* Only used for Hi3516CV500/Hi3516DV300/Hi3516AV300/Hi3559V200/Hi3556V200/
818    Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
819 typedef struct {
820     hi_u16       global_gain;         /* RW;Range:[0, 0x100];Format:1.8 */
821     hi_u16       gain_lf;             /* RW;Range:[0, 0x20];Format:2.4 */
822     hi_u16       gain_hf;             /* RW;Range:[0, 0x20];Format:2.4 */
823 } hi_isp_de_manual_attr;
824 
825 /* Only used for Hi3516CV500/Hi3516DV300/Hi3516AV300/Hi3559V200/Hi3556V200 */
826 typedef struct {
827     hi_u16       global_gain[ISP_AUTO_ISO_STRENGTH_NUM]; /* RW;Range:[0x0, 0x100];Format:1.8 */
828     hi_u16       gain_lf[ISP_AUTO_ISO_STRENGTH_NUM];     /* RW;Range:[0x0, 0x20];Format:2.4 */
829     hi_u16       gain_hf[ISP_AUTO_ISO_STRENGTH_NUM];     /* RW;Range:[0x0, 0x20];Format:2.4 */
830 } hi_isp_de_auto_attr;
831 
832 /* Only used for Hi3516CV500/Hi3516DV300/Hi3516AV300/Hi3559V200/Hi3556V200 */
833 typedef struct {
834     hi_bool       enable;                                    /* RW;Range:[0x0,0x1];Format:1.0; De Enable */
835     hi_u16        luma_gain_lut[HI_ISP_DE_LUMA_GAIN_LUT_N]; /* RW;Range:[0x0,0x100];Format:1.8 */
836 
837     hi_isp_op_type        op_type;
838     hi_isp_de_auto_attr   auto_attr;
839     hi_isp_de_manual_attr manual_attr;
840 } hi_isp_de_attr;
841 
842 /* Only support Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
843 typedef ISP_IRBAYER_FORMAT_E hi_isp_ir_bayer_format;
844 typedef ISP_IR_CVTMAT_MODE_E hi_isp_ir_cvtmat_mode;
845 
846 /* Only support Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
847 typedef struct {
848     hi_bool                enable;          /* RW;Range:[0x0,0x1];Format:1.0; Enable/Disable RGBIR module */
849     hi_isp_ir_bayer_format in_pattern;      /* RW;Range:[0x0,0x7];Format:3.0; IR pattern of the input signal */
850     hi_isp_bayer_format    out_pattern;     /* RW;Range:[0x0,0x3];Format:2.0; Bayer pattern of the output signal */
851 
852     hi_u16                 exp_ctrl[ISP_EXP_CTRL_NUM]; /* RW;Range:[0, 2047];Format:11.0;
853                                                           Over expose control parameter */
854     hi_u16                 gain[ISP_EXP_CTRL_NUM];     /* RW;Range:[0, 511];Format:9.0; Over expose control parameter */
855 
856     hi_isp_ir_cvtmat_mode ir_cvt_mat_mode;
857     hi_s16                cvt_matrix[ISP_CVTMAT_NUM]; /* RW;Range:[-32768, 32767];Format:s15.0; RGBIR to Bayer image
858                                                          Convert matrix coefficients(need calibration) */
859 } hi_isp_rgbir_attr;
860 
861 typedef ISP_GAMMA_CURVE_TYPE_E hi_isp_gamma_curve_type;
862 typedef struct {
863     hi_bool   enable;                     /* RW; Range:[0, 1]; Format:1.0;Enable/Disable Gamma Function */
864     hi_u16    table[GAMMA_NODE_NUM];    /* RW; Range:[0, 4095]; Format:12.0;Gamma LUT nodes value */
865 
866     hi_isp_gamma_curve_type curve_type;    /* RW; Range:[0, 3]; Format:2.0;Gamma curve type */
867 } hi_isp_gamma_attr;
868 
869 typedef struct {
870     hi_bool enable;                   /* RW; Range:[0, 1]; Format:1.0;Enable/Disable PreGamma Function */
871     hi_u32  table[PREGAMMA_NODE_NUM]; /* RW; Range:Hi3559AV100 = [0, 0x100000] | Hi3519AV100 = [0, 0x100000] |
872                                          Hi3516CV500 = [0, 0xFFFFF] |Hi3516DV300 = [0, 0xFFFFF] |
873                                          Hi3516AV300 = [0, 0xFFFFF] |Hi3559V200 = [0, 0xFFFFF] |
874                                          Hi3556V200 = [0, 0xFFFFF] |Hi3516EV200 = [0x0, 0xFFFFF]|
875                                          Hi3516EV300 = [0x0, 0xFFFFF]|Hi3518EV300 = [0x0,0xFFFFF]|
876                                          Hi3516DV200 = [0x0,0xFFFFF]; Format:21.0;
877                                          PreGamma LUT nodes value */
878 } hi_isp_pregamma_attr;
879 
880 typedef struct {
881     hi_bool enable;    /* RW; Range:[0, 1]; Format:1.0;Enable/Disable PreLogLUT Function.
882                           Not support for Hi3516CV500/Hi3516DV300/Hi3516AV300/Hi3559V200/Hi3556V200 */
883 } hi_isp_preloglut_attr;
884 
885 typedef struct {
886     hi_bool enable;    /* RW; Range:[0, 1]; Format:1.0;Enable/Disable LogLUT Function.
887                           Not support for Hi3516CV500/Hi3516DV300/Hi3516AV300/Hi3559V200/Hi3556V200 */
888 } hi_isp_loglut_attr;
889 
890 typedef struct {
891     hi_u8  luma_wgt[ISP_SHARPEN_LUMA_NUM]; /* RW; Range: Hi3559AV100 =[0, 127]|Hi3519AV100=[0, 127]|
892                                                Hi3516CV500 = [0, 127]|Hi3516DV300 =[0, 127]| Hi3516AV300 =[0, 127]|
893                                                Hi3559V200 = [0, 127]| Hi3556V200 =[0, 127]| Hi3516EV200 = [0x0, 31]|
894                                                Hi3516EV300 = [0x0, 31]|Hi3518EV300 = [0x0, 31]|Hi3516DV200 = [0x0, 31];
895                                                Format:0.7;Adjust the sharpen strength according to luma.
896                                                Sharpen strength will be weaker when it decrease. */
897     hi_u16 texture_str[ISP_SHARPEN_GAIN_NUM]; /* RW; Range: [0, 4095]; Format:7.5;Undirectional sharpen strength for
898                                                  texture and detail enhancement */
899     hi_u16 edge_str[ISP_SHARPEN_GAIN_NUM];    /* RW; Range: [0, 4095]; Format:7.5;
900                                            Directional sharpen strength for edge enhancement */
901     hi_u16 texture_freq;       /* RW; Range: [0, 4095];Format:6.6; Texture frequency adjustment.
902                                   Texture and detail will be finer when it increase */
903     hi_u16 edge_freq;          /* RW; Range: [0, 4095];Format:6.6; Edge frequency adjustment.
904                                   Edge will be narrower and thiner when it increase */
905     hi_u8  over_shoot;         /* RW; Range: [0, 127]; Format:7.0;u8OvershootAmt */
906     hi_u8  under_shoot;        /* RW; Range: [0, 127]; Format:7.0;u8UndershootAmt */
907     hi_u8  shoot_sup_str;      /* RW; Range: [0, 255]; Format:8.0;overshoot and undershoot suppression strength, the
908                                   amplitude and width of shoot will be decrease when shootSupSt increase */
909     hi_u8  shoot_sup_adj;      /* RW; Range: [0, 15]; Format:4.0;overshoot and undershoot suppression adjusting,
910                                   adjust the edge shoot suppression strength */
911     hi_u8  detail_ctrl;        /* RW; Range: [0, 255]; Format:8.0;Different sharpen strength for detail and edge.
912                                   When it is bigger than 128, detail sharpen strength will be stronger than edge */
913     hi_u8  detail_ctrl_thr;    /* RW; Range: [0, 255]; Format:8.0; The threshold of DetailCtrl, it is used to
914                                   distinguish detail and edge. */
915     hi_u8  edge_filt_str;      /* RW; Range: [0, 63]; Format:6.0;The strength of edge filtering. */
916     hi_u8  edge_filt_max_cap;  /* RW; Range: [0, 47]; Format:6.0;The max capacity of edge filtering. */
917     hi_u8  r_gain;             /* RW; Range: [0, 31];   Format:5.0;Sharpen Gain for Red Area */
918     hi_u8  g_gain;             /* RW; Range: [0, 255]; Format:8.0; Sharpen Gain for Green Area */
919     hi_u8  b_gain;             /* RW; Range: [0, 31];   Format:5.0;Sharpen Gain for Blue Area */
920     hi_u8  skin_gain;          /* RW; Range: [0, 31]; Format:5.0;Sharpen Gain for Skin Area */
921     hi_u16 max_sharp_gain;     /* RW; Range: [0, 0x7FF]; Format:8.3; Maximum sharpen gain */
922     hi_u8  weak_detail_gain;   /* RW; Range: [0, 127]; Only support for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200;
923                                   sharpen Gain for weakdetail */
924 } hi_isp_sharpen_manual_attr;
925 
926 typedef struct {
927     hi_u8  luma_wgt[ISP_SHARPEN_LUMA_NUM][ISP_AUTO_ISO_STRENGTH_NUM];  /* RW; Range:Hi3559AV100 =[0, 127]|
928                                                                         Hi3519AV100=[0, 127]|Hi3516CV500 = [0, 127]|
929                                                                         Hi3516DV300 =[0, 127]|  Hi3516AV300 =[0, 127]|
930                                                                         Hi3559V200 = [0, 127] |Hi3556V200 = [0, 127]|
931                                                                         Hi3556V200 =[0, 127]| Hi3516EV200 = [0x0, 31]|
932                                                                         Hi3516EV300 = [0x0, 31]|Hi3518EV300 = [0x0, 31]|
933                                                                         Hi3516DV200 = [0x0, 31]; Format:0.7;
934                                                                         Adjust the sharpen strength according to luma.
935                                                                     Sharpen strength will be weaker when it decrease */
936     hi_u16 texture_str[ISP_SHARPEN_GAIN_NUM][ISP_AUTO_ISO_STRENGTH_NUM];  /* RW; Range: [0, 4095]; Format:7.5;
937                                                                              Undirectional sharpen strength for texture
938                                                                              and detail enhancement */
939     hi_u16 edge_str[ISP_SHARPEN_GAIN_NUM][ISP_AUTO_ISO_STRENGTH_NUM]; /* RW; Range: [0, 4095]; Format:7.5; Directional
940                                                                          sharpen strength for edge enhancement */
941     hi_u16 texture_freq[ISP_AUTO_ISO_STRENGTH_NUM];   /* RW; Range: [0, 4095]; Format:6.6;Texture frequency adjustment.
942                                                          Texture and detail will be finer when it increase */
943     hi_u16 edge_freq[ISP_AUTO_ISO_STRENGTH_NUM];      /* RW; Range: [0, 4095]; Format:6.6;Edge frequency adjustment.
944                                                          Edge will be narrower and thiner when it increase */
945     hi_u8  over_shoot[ISP_AUTO_ISO_STRENGTH_NUM];     /* RW; Range: [0, 127];  Format:7.0;u8OvershootAmt */
946     hi_u8  under_shoot[ISP_AUTO_ISO_STRENGTH_NUM];    /* RW; Range: [0, 127];  Format:7.0;u8UndershootAmt */
947     hi_u8  shoot_sup_str[ISP_AUTO_ISO_STRENGTH_NUM];  /* RW; Range: [0, 255]; Format:8.0;overshoot and undershoot
948                                                          suppression strength, the amplitude and width of shoot will be
949                                                          decrease when shootSupSt increase */
950     hi_u8  shoot_sup_adj[ISP_AUTO_ISO_STRENGTH_NUM];  /* RW; Range: [0, 15]; Format:4.0;overshoot and undershoot
951                                                    suppression adjusting, adjust the edge shoot suppression strength */
952     hi_u8  detail_ctrl[ISP_AUTO_ISO_STRENGTH_NUM];    /* RW; Range: [0, 255]; Format:8.0;Different sharpen strength for
953                                                          detail and edge. When it is bigger than 128, detail sharpen
954                                                          strength will be stronger than edge. */
955     hi_u8  detail_ctrl_thr[ISP_AUTO_ISO_STRENGTH_NUM]; /* RW; Range: [0, 255]; Format:8.0; The threshold of DetailCtrl,
956                                                           it is used to distinguish detail and edge. */
957     hi_u8  edge_filt_str[ISP_AUTO_ISO_STRENGTH_NUM];   /* RW; Range: [0, 63]; Format:6.0;
958                                                           The strength of edge filtering. */
959     hi_u8  edge_filt_max_cap[ISP_AUTO_ISO_STRENGTH_NUM]; /* RW; Range: [0, 47]; Format:6.0;
960                                                             The max capacity of edge filtering. */
961     hi_u8  r_gain[ISP_AUTO_ISO_STRENGTH_NUM];        /* RW; Range: [0, 31]; Format:5.0; Sharpen Gain for Red Area */
962     hi_u8  g_gain[ISP_AUTO_ISO_STRENGTH_NUM];        /* RW; Range: [0, 255]; Format:8.0; Sharpen Gain for Green Area */
963     hi_u8  b_gain[ISP_AUTO_ISO_STRENGTH_NUM];        /* RW; Range: [0, 31]; Format:5.0; Sharpen Gain for Blue Area */
964     hi_u8  skin_gain[ISP_AUTO_ISO_STRENGTH_NUM];      /* RW; Range: [0, 31]; Format:5.0;Sharpen Gain for Skin Area */
965     hi_u16 max_sharp_gain[ISP_AUTO_ISO_STRENGTH_NUM]; /* RW; Range: [0, 0x7FF]; Format:8.3; Maximum sharpen gain */
966     hi_u8  weak_detail_gain[ISP_AUTO_ISO_STRENGTH_NUM]; /* RW; Range: [0, 127]; Format:7.0;
967                                                       Only support for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200;
968                                                       sharpen Gain for weakdetail */
969 } hi_isp_sharpen_auto_attr;
970 
971 typedef struct {
972     hi_bool enable;    /* RW; Range:[0, 1]; Format:1.0;Enable/Disable sharpen module */
973     hi_u8 skin_umin;   /* RW; Range: [0, 255];  Format:8.0; U min value of the range of skin area */
974     hi_u8 skin_vmin;   /* RW; Range: [0, 255];  Format:8.0; V min value of the range of skin area */
975     hi_u8 skin_umax;   /* RW; Range: [0, 255];  Format:8.0; U max value of the range of skin area */
976     hi_u8 skin_vmax;   /* RW; Range: [0, 255];  Format:8.0; V max value of the range of skin area */
977     hi_isp_op_type op_type;
978     hi_isp_sharpen_manual_attr manual_attr;
979     hi_isp_sharpen_auto_attr   auto_attr;
980 } hi_isp_sharpen_attr;
981 
982 /* Not support for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
983 typedef struct {
984     hi_bool enable;     /* RW; Range:[0, 1]; Format:1.0;Enable/Disable Edge Mark */
985     hi_u8   threshold;  /* RW; Range: [0, 255];  Format:8.0 */
986     hi_u32  color;      /* RW; Range: [0, 0xFFFFFF];  Format:32.0 */
987 } hi_isp_edge_mark_attr;
988 
989 /* High Light Constraint */
990 /* Not support for Hi3559AV100/Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
991 typedef struct {
992     hi_bool enable;              /* RW; Range:[0, 1];  Format:1.0;Enable/Disable HLC module */
993     hi_u8   luma_thr;            /* RW; Range:[0, 255];Format:8.0 */
994     hi_u8   luma_target;         /* RW; Range:[0, 255];Format:8.0 */
995 } hi_isp_hlc_attr;
996 
997 /* Crosstalk Removal */
998 typedef struct {
999     hi_bool  enable;      /* RW; Range: [0, 1];Format 1.0;Enable/disable the crosstalk removal module */
1000     hi_u8    slope;       /* RW; Range: Hi3559AV100 = [0, 14] | Hi3519AV100 = [0, 14]|Hi3516CV500 = [0, 14]|
1001                              Hi3516DV300 =[0, 14] |Hi3516AV300 =[0, 14] | Hi3559V200 =[0, 14] |Hi3556V200 =[0, 14] |
1002                              Hi3516EV200 = [0,16]|Hi3516EV300 = [0,16]|Hi3518EV300 = [0,16]|Hi3516DV200 = [0,16];
1003                              Crosstalk slope value. */
1004     hi_u8    sensi_slope;  /* RW; Range: Hi3559AV100 = [0, 14] | Hi3519AV100 = [0, 14]|Hi3516CV500 = [0, 14]|
1005                               Hi3516DV300 =[0, 14]||Hi3516AV300 =[0, 14] | Hi3559V200 =[0, 14] |Hi3556V200 =[0, 14] |
1006                               Hi3516EV200 = [0,16]|Hi3516EV300 = [0,16]|Hi3518EV300 = [0,16]|Hi3516DV200 = [0,16];
1007                               Crosstalk sensitivity. */
1008     hi_u16   sensi_thr;   /* RW; Range: Hi3559AV100 = [0, 16383] | Hi3519AV100 = [0, 16383]|Hi3516CV500 = [0, 16383]|
1009                              Hi3516DV300 =[0, 16383]|Hi3516AV300 =[0, 16383]| Hi3559V200 =[0, 16383]|
1010                              Hi3556V200 =[0, 16383]|Hi3516EV200 = [0,65535]|Hi3516EV300 = [0,65535]|
1011                              Hi3518EV300 = [0,65535]|Hi3516DV200 = [0,65535]; Crosstalk sensitivity threshold. */
1012     hi_u16   strength[ISP_AUTO_ISO_STRENGTH_NUM];   /* RW; Range: [0,256];Crosstalk strength value. */
1013     hi_u16   threshold[ISP_AUTO_ISO_STRENGTH_NUM];  /* RW; Range: Hi3559AV100 = [0, 16383] | Hi3519AV100 = [0, 16383]|
1014                                                        Hi3516CV500 = [0, 16383]|Hi3516DV300 =[0, 16383] |
1015                                                        Hi3516AV300 =[0, 16383]|Hi3559V200 =[0, 16383] |
1016                                                        Hi3556V200 =[0, 16383] |Hi3516EV200 = [0,65535]|
1017                                                        Hi3516EV300 = [0,65535]|Hi3518EV300 = [0,65535]|
1018                                                        Hi3516DV200 = [0,65535]; Crosstalk threshold. */
1019     hi_u16   np_offset[ISP_AUTO_ISO_STRENGTH_NUM];   /* RW; Range: Hi3559AV100 = [512, 16383] |
1020                                                         Hi3519AV100 = [512, 16383]|Hi3516CV500 = [512, 16383]|
1021                                                         Hi3516DV300 =[512, 16383] |Hi3516AV300 =[512, 16383] |
1022                                                         Hi3559V200 =[512, 16383] |Hi3556V200 =[512, 16383] |
1023                                                         Hi3516EV200 = [8192,65535]|Hi3516EV300 = [8192,65535]|
1024                                                         Hi3518EV300 = [8192,65535]|Hi3516DV200 = [8192,65535];
1025                                                         Set Noise profile value. */
1026 } hi_isp_cr_attr;
1027 
1028 typedef struct {
1029     hi_u8    threshold;     /* RW;Range:[0x0,0x20];Format:6.0;Threshold for antifalsecolor */
1030     hi_u8    strength;      /* RW;Range:[0x0,0x1F];Format:5.0;Strength of antifalsecolor */
1031 } hi_isp_antifalsecolor_manual_attr;
1032 
1033 typedef struct {
1034     hi_u8  threshold[ISP_AUTO_ISO_STRENGTH_NUM];    /* RW;Range:[0x0,0x20];Format:6.0;Threshold for antifalsecolor */
1035     hi_u8  strength[ISP_AUTO_ISO_STRENGTH_NUM];     /* RW;Range:[0x0,0x1F];Format:5.0;Strength of antifalsecolor */
1036 } hi_isp_antifalsecolor_auto_attr;
1037 
1038 typedef struct {
1039     hi_bool  enable;                               /* RW;Range:[0x0,0x1];Format:1.0; AntiFalseColor Enable */
1040     hi_isp_op_type op_type;
1041     hi_isp_antifalsecolor_auto_attr auto_attr;
1042     hi_isp_antifalsecolor_manual_attr manual_attr;
1043 } hi_isp_antifalsecolor_attr;
1044 
1045 typedef struct {
1046     hi_u8   non_dir_str;            /* RW; Range:[0x0, 0xFF]; Format:4.4; Non-direction strength */
1047     hi_u8   non_dir_mf_detail_ehc_str; /* RW; Range:Hi3559AV100 = [0x0, 0x10] |Hi3519AV100 = [0x0, 0x7f] |
1048                                           Hi3516CV500= [0x0, 0x7f]|Hi3516DV300= [0x0, 0x7f]| Hi3516AV300= [0x0, 0x7f]|
1049                                           Hi3559V200= [0x0, 0x7f]|Hi3556V200= [0x0, 0x7f]| Hi3516EV200 = [0x0, 0x7f]|
1050                                           Hi3516EV300 = [0x0, 0x7f]|Hi3518EV300 = [0x0, 0x7f]|Hi3516DV200 = [0x0, 0x7f];
1051                                           Format:3.4; Non-direction medium frequent detail enhance  strength */
1052     hi_u8   non_dir_hf_detail_ehc_str; /* RW; Range:[0x0, 0x10]; Format:2.2;
1053                                           Non-direction high frequent detail enhance strength */
1054     hi_u8   detail_smooth_range;    /* RW; Range:Hi3559AV100 = [0x1, 0x8] |Hi3519AV100 = [0x1, 0x7] |
1055                                        Hi3516CV500 = [0x1, 0x7]|Hi3516DV300 = [0x1, 0x7]| Hi3516AV300 = [0x1, 0x7]|
1056                                        Hi3559V200 = [0x1, 0x7]|Hi3556V200 = [0x1, 0x7] | Hi3516EV200 = [0x1, 0x7]|
1057                                        Hi3516EV300 = [0x1, 0x7]|Hi3518EV300 = [0x1, 0x7]|Hi3516DV200 = [0x1, 0x7];
1058                                        Format:4.0; Detail smooth range */
1059     hi_u16  detail_smooth_str;     /* RW;Range:[0x0, 0x100]; Format:9.0; Strength of detail smooth,
1060                                       Only used for Hi3559AV100 */
1061     hi_u8   color_noise_ctrl_thdf; /* RW;Range:[0x0,0xff]; Format:8.0; Threshold of color noise cancel */
1062     hi_u8   color_noise_ctrl_strf; /* RW;Range:[0x0, 0x8]; Format:4.0; Strength of color noise cancel,
1063                                       Not available for Hi3559AV100 */
1064     hi_u8   color_noise_ctrl_thdy; /* RW;Range:Hi3559AV100 = [0x0, 0xFF] |Hi3519AV100 = [0x0, 0xFF] |
1065                                       Hi3516CV500 = [0x0, 0xFF] |Hi3516DV300 = [0x0, 0xFF] | Hi3516AV300 = [0x0, 0xFF] |
1066                                       Hi3559V200 = [0x0, 0xFF] | Hi3556V200 = [0x0, 0xFF] |Hi3516EV200 = [0x0, 0xF] |
1067                                       Hi3516EV300 = [0x0, 0xF] |Hi3518EV300 = [0x0, 0xF];
1068                                       Format:8.0; Range of color denoise luma, related to luminance and saturation */
1069     hi_u8   color_noise_ctrl_stry; /* RW;Range:Hi3559AV100 = [0x0, 0xFF] |Hi3519AV100 = [0x0, 0xFF] |
1070                                       Hi3516CV500 = [0x0, 0xFF] |Hi3516DV300 = [0x0, 0xFF] | Hi3516AV300 = [0x0, 0xFF] |
1071                                       Hi3559V200 = [0x0, 0xFF] | Hi3556V200 = [0x0, 0xFF] |Hi3516EV200 = [0x0, 0x3F] |
1072                                       Hi3516EV300 = [0x0, 0x3F] |Hi3518EV300 = [0x0, 0x3F];
1073                                       Format:8.0;Format:8.0; Strength of color denoise luma */
1074 } hi_isp_demosaic_manual_attr;
1075 
1076 typedef struct {
1077     hi_u8   non_dir_str[ISP_AUTO_ISO_STRENGTH_NUM];     /* RW; Range:[0x0, 0xFF]; Format:4.4; Non-direction strength */
1078     hi_u8   non_dir_mf_detail_ehc_str[ISP_AUTO_ISO_STRENGTH_NUM]; /* RW; Range:Hi3559AV100 = [0x0, 0x10] |
1079                                                                    Hi3519AV100 = [0x0, 0x7f] |Hi3516CV500= [0x0, 0x7f]|
1080                                                                    Hi3516DV300= [0x0, 0x7f]|Hi3516AV300= [0x0, 0x7f]|
1081                                                                    Hi3559V200 = [0x0, 0x7f] |Hi3556V200= [0x0, 0x7f] |
1082                                                                    Hi3516EV200= [0x0, 0x7f]|Hi3516EV300 = [0x0, 0x7f] |
1083                                                                    Hi3518EV300= [0x0, 0x7f]|Hi3516DV200 = [0x0, 0x7f];
1084                                                                    Format:3.4; Non-direction medium frequent detail
1085                                                                    enhance strength */
1086     hi_u8   non_dir_hf_detail_ehc_str[ISP_AUTO_ISO_STRENGTH_NUM]; /* RW; Range:[0x0, 0x10]; Format:2.2; Non-direction
1087                                                                      high frequent detail enhance strength */
1088     hi_u8   detail_smooth_range[ISP_AUTO_ISO_STRENGTH_NUM];    /* RW; Range:Hi3559AV100 = [0x1, 0x8] |
1089                                                                   Hi3519AV100 = [0x1, 0x7] |Hi3516CV500 = [0x1, 0x7]|
1090                                                                   Hi3516DV300 = [0x1, 0x7]|Hi3516AV300 = [0x1, 0x7]|
1091                                                                   Hi3559V200 = [0x1, 0x7] |Hi3556V200 = [0x1, 0x7]|
1092                                                                   Hi3516EV200= [0x1, 0x7]|Hi3516EV300 = [0x, 0x7] |
1093                                                                   Hi3518EV300= [0x1, 0x7]|Hi3516DV200= [0x1, 0x7];
1094                                                                   Format:4.0; Detail smooth range */
1095     hi_u16  detail_smooth_str[ISP_AUTO_ISO_STRENGTH_NUM];     /* RW;Range:[0x0, 0x100]; Format:9.0;
1096                                                                  Strength of detail smooth,Only used for Hi3559AV100 */
1097     hi_u8   color_noise_ctrl_thdf[ISP_AUTO_ISO_STRENGTH_NUM]; /* RW;Range:[0x0, 0xff]; Format:8.0;
1098                                                                  Threshold of color noise cancel */
1099     hi_u8   color_noise_ctrl_strf[ISP_AUTO_ISO_STRENGTH_NUM]; /* RW;Range:[0x0, 0x8]; Format:4.0; Strength of color
1100                                                                  noise cancel, Not available for Hi3559AV100 */
1101     hi_u8   color_noise_ctrl_thdy[ISP_AUTO_ISO_STRENGTH_NUM];  /* RW;Range:Hi3559AV100 = [0x0, 0xFF] |
1102                                                                  Hi3519AV100 = [0x0, 0xFF] | Hi3516CV500 = [0x0, 0xFF] |
1103                                                                  Hi3516DV300 = [0x0, 0xFF] | Hi3516AV300 = [0x0, 0xFF] |
1104                                                                  Hi3559V200 = [0x0, 0xFF] | Hi3556V200 = [0x0, 0xFF] |
1105                                                                  Hi3516EV200 = [0x0, 0xF] | Hi3516EV300 = [0x0, 0xF] |
1106                                                                  Hi3518EV300 = [0x0, 0xF]; Format:8.0; Range of color
1107                                                                  denoise luma, related to luminance and saturation */
1108     hi_u8   color_noise_ctrl_stry[ISP_AUTO_ISO_STRENGTH_NUM];  /* RW;Range:Hi3559AV100 = [0x0, 0xFF] |
1109                                                                 Hi3519AV100 = [0x0, 0xFF] | Hi3516CV500 = [0x0, 0xFF] |
1110                                                                 Hi3516DV300 = [0x0, 0xFF] | Hi3516AV300 = [0x0, 0xFF] |
1111                                                                 Hi3559V200 = [0x0, 0xFF] | Hi3556V200 = [0x0, 0xFF] |
1112                                                                 Hi3516EV200 = [0x0, 0x3F] | Hi3516EV300 = [0x0, 0x3F] |
1113                                                                 Hi3518EV300 = [0x0, 0x3F]; Format:8.0;Format:8.0;
1114                                                                 Strength of color denoise luma */
1115 } hi_isp_demosaic_auto_attr;
1116 
1117 typedef struct {
1118     hi_bool enable;        /* RW; Range:[0, 1]; Format:1.0;Enable/Disable demosaic module */
1119     hi_isp_op_type op_type;
1120     hi_isp_demosaic_manual_attr manual_attr;
1121     hi_isp_demosaic_auto_attr   auto_attr;
1122 } hi_isp_demosaic_attr;
1123 
1124 /* Defines the attributes of the ISP black level */
1125 typedef struct {
1126     hi_isp_op_type op_type;
1127     hi_u16         black_level[ISP_BAYER_CHN_NUM]; /* RW; Range: [0x0, 0xFFF];Format:12.0;
1128                                                       Black level values that correspond to the black levels of the
1129                                                       R,Gr, Gb, and B components respectively. */
1130 } hi_isp_black_level;
1131 
1132 typedef ISP_FPN_TYPE_E hi_isp_fpn_type;
1133 
1134 /* Defines the information about calibrated black frames */
1135 typedef struct {
1136     hi_u32              iso;             /* RW;Range:[0x64,0xFFFFFFFF];Format:32.0;FPN CALIBRATE ISO */
1137     hi_u32              offset[VI_MAX_SPLIT_NODE_NUM]; /* RW;Range:[0, 0xFFF];Format:12.0;
1138                                                           FPN frame u32Offset (agv pixel value) */
1139     hi_u32              frm_size;         /* RW;FPN frame size (exactly frm size or compress len) */
1140     hi_video_frame_info fpn_frame;         /* FPN frame info, 8bpp,10bpp,12bpp,16bpp. Compression or not */
1141 } hi_isp_fpn_frame_info;
1142 
1143 /* Defines the calibration attribute of the FPN removal module */
1144 typedef struct {
1145     hi_u32                 threshold;  /* RW;Range:[1,0xFFF];Format:12.0;pix value > threshold means defective pixel */
1146     hi_u32                 frame_num;  /* RW;Range:[1, 16];Format:5.0;Number of frames to be calibrated.
1147                                         The value range is {1, 2, 4, 8, 16},that is, the integer exponentiation of 2 */
1148     hi_isp_fpn_type        fpn_type;   /* frame mode or line mode */
1149     hi_isp_fpn_frame_info  fpn_cali_frame;
1150 } hi_isp_fpn_calibrate_attr;
1151 
1152 /* Defines the manual correction attribute of the FPN removal module */
1153 typedef struct {
1154     hi_u32  strength;         /* RW;Range:[0,1023];Format:10.0;Manual correction strength */
1155 } hi_isp_fpn_manual_attr;
1156 
1157 /* Defines the automatic correction attribute of the FPN removal module */
1158 typedef struct {
1159     hi_u32 strength;          /* RW;Range:[0,1023];Format:10.0;Auto correction strength */
1160 } hi_isp_fpn_auto_attr;
1161 
1162 /* Defines the correction attribute of the FPN removal module */
1163 typedef struct {
1164     hi_bool                enable;   /* RW;Range:[0,1];Format:1.0; */
1165     hi_isp_op_type         op_type;  /* manual or auto mode */
1166     hi_isp_fpn_type        fpn_type;
1167     hi_isp_fpn_frame_info  fpn_frm_info;
1168     hi_isp_fpn_manual_attr manual_attr;
1169     hi_isp_fpn_auto_attr   auto_attr;
1170 } hi_isp_fpn_attr;
1171 
1172 /* Defines the manual dehze attribute */
1173 typedef struct {
1174     hi_u8 strength;  /* RW;Range:[0,0xFF];Format:8.0;Manual dehze strength */
1175 } hi_isp_dehaze_manual_attr;
1176 
1177 /* Defines the automatic dehze attribute */
1178 typedef struct {
1179     hi_u8 strength; /* RW;Range:[0,0xFF];Format:8.0;Weighted coefficient for automatic dehaze strength. */
1180 } hi_isp_dehaze_auto_attr;
1181 
1182 /* Defines the ISP dehaze attribute */
1183 typedef struct {
1184     hi_bool  enable;           /* RW;Range:[0,1];Format:1.0; */
1185     hi_bool  user_lut_enable;    /* RW;Range:[0,1];0:Auto Lut 1:User Lut */
1186     hi_u8    dehaze_lut[DEHAZE_LUT_SIZE];
1187     hi_isp_op_type      op_type;
1188     hi_isp_dehaze_manual_attr manual_attr;
1189     hi_isp_dehaze_auto_attr   auto_attr;
1190     hi_u16       tmprflt_incr_coef; /* RW, Range: [0x0, 0x80].filter increase coeffcient. */
1191     hi_u16       tmprflt_decr_coef; /* RW, Range: [0x0, 0x80].filter decrease coeffcient. */
1192 } hi_isp_dehaze_attr;
1193 
1194 /* Defines purple fringing correction manual attribute */
1195 typedef struct {
1196     hi_u8 de_purple_cr_str;   /* RW;Range: [0,8];Format:4.0;Correction strength of the R channel */
1197     hi_u8 de_purple_cb_str;   /* RW;Range: [0,8];Format:4.0;Correction strength of the B channel */
1198 } hi_isp_depurplestr_manual_attr;
1199 
1200 /* Defines purple fringing correction automatic attribute */
1201 typedef struct {
1202     hi_u8 de_purple_cr_str[ISP_EXP_RATIO_STRENGTH_NUM]; /* RW;Range: [0, 8];Format:4.0;
1203                                                            Correction strength of the R channel */
1204     hi_u8 de_purple_cb_str[ISP_EXP_RATIO_STRENGTH_NUM]; /* RW;Range: [0, 8];Format:4.0;
1205                                                            Correction strength of the B channel */
1206 } hi_isp_depurplestr_auto_attr;
1207 
1208 /* Purple fringing detection and correction attribute */
1209 typedef struct {
1210     hi_bool enable;               /* RW;Range: [0, 1];Format:1.0; enable/disable local cac */
1211     hi_u16  purple_det_range;     /* RW;Range: [0, 410];Format:9.0;Purple fringing detection scope */
1212     hi_u16  var_thr;              /* RW;Range: [0, 4095];Format:12.0;Edge detection threshold */
1213     hi_u16  r_det_thr[ISP_LCAC_DET_NUM];   /* RW;Range: [0,4095];Format:12.0;Component R detection threshold */
1214     hi_u16  g_det_thr[ISP_LCAC_DET_NUM];   /* RW;Range: [0,4095];Format:12.0;Component G detection threshold */
1215     hi_u16  b_det_thr[ISP_LCAC_DET_NUM];   /* RW;Range: [0,4095];Format:12.0;Component B detection threshold */
1216     hi_u16  luma_det_thr[ISP_LCAC_DET_NUM];  /* RW;Range: [0,4095];Format:12.0;Component Luma detection threshold */
1217     hi_s16  cbcr_ratio[ISP_LCAC_DET_NUM];  /* RW;Range: [-2048,2047];Format:S12.0; Cb/Cr ratio threshold */
1218     hi_isp_op_type      op_type;  /* RW;Range: [0, 1];Format:1.0;Purple fringing correction working mode */
1219     hi_isp_depurplestr_manual_attr manual_attr;
1220     hi_isp_depurplestr_auto_attr   auto_attr;
1221 } hi_isp_local_cac_attr;
1222 
1223 /* Defines the lateral chromatic aberration correction attribute,
1224    Not support for Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
1225 typedef struct {
1226     hi_bool enable;            /* RW; Range: [0, 1];Format: 1.0;  enable/disable global cac */
1227     hi_u16  ver_coordinate;    /* RW; Range: [0, 8191];Format: 13.0; limited Range: [0, ImageHeight - 1],
1228                                   Vertical coordinate of the optical center */
1229     hi_u16  hor_coordinate;    /* RW; Range: [0, 8191];Format: 13.0; limited range : [0, ImageWidth - 1],
1230                                   Horizontal coordinate of the optical center */
1231     hi_s16  param_red_a;       /* RW; Range: [-256, 255];Format: 9.0;
1232                                   Coefficient a of the radius polynomial corresponding to channel R */
1233     hi_s16  param_red_b;       /* RW; Range: [-256, 255];Format: 9.0;
1234                                   Coefficient b of the radius polynomial corresponding to channel R */
1235     hi_s16  param_red_c;       /* RW; Range: [-256, 255];Format: 9.0;
1236                                   Coefficient c of the radius polynomial corresponding to channel R */
1237     hi_s16  param_blue_a;      /* RW; Range: [-256, 255];Format: 9.0;
1238                                   Coefficient a of the radius polynomial corresponding to channel B */
1239     hi_s16  param_blue_b;      /* RW; Range: [-256, 255];Format: 9.0;
1240                                   Coefficient b of the radius polynomial corresponding to channel B */
1241     hi_s16  param_blue_c;      /* RW; Range: [-256, 255];Format: 9.0;
1242                                   Coefficient c of the radius polynomial corresponding to channel B */
1243     hi_u8   ver_norm_shift;    /* RW; Range: [0, 7];Format: 3.0;
1244                                   Normalized shift parameter in the vertical direction */
1245     hi_u8   ver_norm_factor;   /* RW; Range: [0, 31];Format: 5.0;
1246                                   Normalized coefficient in the vertical direction */
1247     hi_u8   hor_norm_shift;    /* RW; Range: [0, 7];Format: 3.0;
1248                                   Normalized shift parameter in the horizontal direction */
1249     hi_u8   hor_norm_factor;   /* RW; Range: [0, 31];Format: 5.0; Normalized coefficient in the horizontal direction */
1250     hi_u16  cor_var_thr;       /* RW; Range: [0, 4095];Format: 12.0;
1251                                   Variance threshold of lateral chromatic aberration correction */
1252 } hi_isp_global_cac_attr;
1253 
1254 /* Defines the Radial Crop attribute */
1255 typedef struct {
1256     hi_bool  enable;       /* RW;Range:[0, 1];Format:1.0; enable/disable ridial crop.
1257                               Not support for Hi3516CV500/Hi3516DV300/Hi3516AV300/Hi3559V200/Hi3556V200 */
1258     hi_point center_coor;  /* RW;the coordinate of central pixel.
1259                               Not support for Hi3516CV500/Hi3516DV300/Hi3516AV300/Hi3559V200/Hi3556V200 */
1260     hi_u32   radius;       /* RW;Range:[0, 11586];Format:14.0; when the distance to central pixel is greater than
1261                               u32Radius, the pixel value becomes 0.
1262                               Not support for Hi3516CV500/Hi3516DV300/Hi3516AV300/Hi3559V200/Hi3556V200 */
1263 } hi_isp_rc_attr;
1264 
1265 typedef struct {
1266     hi_u16 texture_str[ISP_SHARPEN_GAIN_NUM];  /* RW; range: [0, 4095]; Format:7.5;Undirectional sharpen strength for
1267                                                   texture and detail enhancement */
1268     hi_u16 edge_str[ISP_SHARPEN_GAIN_NUM];     /* RW; range: [0, 4095]; Format:7.5;Directional sharpen strength for
1269                                                   edge enhancement */
1270     hi_u16 texture_freq;         /* RW; range: [0, 4095];Format:6.6; Texture frequency adjustment.
1271                                     Texture and detail will be finer when it increase */
1272     hi_u16 edge_freq;            /* RW; range: [0, 4095];Format:6.6; Edge frequency adjustment.
1273                                     Edge will be narrower and thiner when it increase */
1274     hi_u8  over_shoot;           /* RW; range: [0, 127]; Format:7.0;u8OvershootAmt */
1275     hi_u8  under_shoot;          /* RW; range: [0, 127]; Format:7.0;u8UndershootAmt */
1276     hi_u8  shoot_sup_str;        /* RW; range: [0, 255]; Format:8.0;overshoot and undershoot suppression strength,
1277                                     the amplitude and width of shoot will be decrease when shootSupSt increase */
1278 
1279     hi_u8   nr_lsc_ratio;                     /* RW;Range:[0x0, 0xff];Format:8.0; Strength of reserving the random
1280                                                  noise according to luma,
1281                                                  Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 not support */
1282     hi_u16  coarse_str[ISP_BAYER_CHN_NUM];    /* RW;Range:[0x0, 0x3ff];Format:10.0;
1283                                                  Coarse Strength of noise reduction */
1284     hi_u8   wdr_frame_str[WDR_MAX_FRAME_NUM]; /* RW;Range:[0x0, 0x50];Format:7.0;
1285                                                  Coarse strength of each frame in wdr mode */
1286     hi_u8   chroma_str[ISP_BAYER_CHN_NUM];  /* RW;Range:[0x0, 0x3];Format:2.0;Strength of Chrmoa noise reduction for
1287                                                R/Gr/Gb/B channel, Hi3516CV500/Hi3516DV300/Hi3516AV300/Hi3559V200/
1288                                               Hi3556V200/Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 not support */
1289     hi_u8   fine_str;             /* RW;Range:[0x0,0x80];Format:8.0;Strength of Luma noise reduction */
1290     hi_u16  coring_wgt;           /* RW;Range:[0x0,0xC80];Format:12.0;Strength of reserving the random noise */
1291 
1292     hi_u16 dehaze_strength_actual; /* RW;Range:[0,0xFF];Format:8.0;actual dehze strength */
1293     hi_u16 drc_strength_actual;  /* RW;Range: Hi3559AV100 = [0x0, 0xFF] | Hi3519AV100 = [0x0, 0x3FF] |
1294                                     Hi3516CV500 = [0x0, 0x3FF]| Hi3516DV300 = [0x0, 0x3FF]| Hi3516AV300 = [0x0, 0x3FF]|
1295                                     Hi3559V200 = [0x0, 0x3FF]| Hi3556V200 = [0x0, 0x3FF]| Hi3516EV200 = [0x0, 0x3FF]|
1296                                     Hi3516EV300 = [0x0, 0x3FF]|Hi3518EV300 = [0x0, 0x3FF]|Hi3516DV200 = [0x0, 0x3FF];
1297                                     Strength of dynamic range compression.
1298                                     Higher values lead to higher differential gain between shadows and highlights. */
1299     hi_u32 wdr_exp_ratio_actual[WDR_MAX_FRAME_NUM - 1]; /* RW; Range:[0x40, 0x4000]; Format:26.6; 0x40 means 1 times.
1300                                                            When enExpRatioType is OP_TYPE_AUTO, u32ExpRatio is invalid.
1301                                                            When enExpRatioType is OP_TYPE_MANUAL, u32ExpRatio is
1302                                                            quotient of long exposure time / short exposure time. */
1303     hi_bool wdr_switch_finish;       /* RW; Range:[0, 1];Format:1.0;HI_TRUE: WDR switch is finished */
1304     hi_bool res_switch_finish;       /* RW; Range:[0, 1];Format:1.0;HI_TRUE: Resolution switch is finished */
1305     hi_u16  bl_actual[ISP_BAYER_CHN_NUM]; /* RW; Range: [0x0, 0xFFF];Format:12.0;
1306                                              Actual Black level values that correspond to the black levels of
1307                                              the R,Gr, Gb, and B components respectively. */
1308 } hi_isp_inner_state_info;
1309 
1310 typedef ISP_AE_SWITCH_E          hi_isp_ae_switch;
1311 typedef ISP_AE_FOUR_PLANE_MODE_E hi_isp_ae_four_plane_mode;
1312 typedef ISP_AE_HIST_SKIP_E       hi_isp_ae_hist_skip;
1313 typedef ISP_AE_HIST_OFFSET_X_E   hi_isp_ae_hist_offset_x;
1314 typedef ISP_AE_HIST_OFFSET_Y_E   hi_isp_ae_hist_offset_y;
1315 
1316 /* Defines the mode configuration for the sampling points during global histogram statistics. */
1317 typedef struct {
1318     hi_isp_ae_hist_skip hist_skip_x;  /* RW; Range:[0, 6]; Format:4.0;
1319                                          Histogram decimation in horizontal direction: 0=every pixel;
1320                                          1=every 2nd pixel; 2=every 3rd pixel; 3=every 4th pixel; 4=every 5th pixel;
1321                                          5=every 8th pixel; 6+=every 9th pixel */
1322     hi_isp_ae_hist_skip hist_skip_y;  /* RW; Range:[0, 6]; Format:4.0;
1323                                          Histogram decimation in vertical direction: 0=every pixel; 1=every 2nd pixel;
1324                                          2=every 3rd pixel; 3=every 4th pixel; 4=every 5th pixel; 5=every 8th pixel;
1325                                          6+=every 9th pixel */
1326     hi_isp_ae_hist_offset_x hist_offset_x;  /* RW; Range:[0, 1]; Format:1.0;
1327                                                0= start from the first column; 1=start from second column */
1328     hi_isp_ae_hist_offset_y hist_offset_y;  /* RW; Range:[0, 1]; Format:1.0;
1329                                                0= start from the first row; 1= start from second row */
1330 } hi_isp_ae_hist_config;
1331 
1332 typedef ISP_AE_STAT_MODE_E hi_isp_ae_stat_mode;
1333 
1334 /* Crops the input image of the AE module */
1335 typedef struct {
1336     hi_bool enable; /* RW; Range: [0,1];  Format:1.0;AE crop enable. */
1337     hi_u16  x;   /* RW; Range: Hi3559AV100 = [0, 8192 - 256]|Hi3519AV100 = [0, 8192 - 256]|
1338                     Hi3516CV500 = [0, 4608 - 256]|Hi3516DV300 = [0, 4608 - 256]| Hi3516AV300 = [0, 4608 - 256]|
1339                     Hi3559V200   = [0, 4608 - 256]|Hi3556V200  = [0, 4608 - 256]| Hi3516EV200 = [0,3072 - 256]|
1340                     Hi3516EV300 = [0,3072 - 256]|Hi3518EV300 = [0,3072 - 256]|Hi3516DV200 = [0,3072 - 256];
1341                     Format:13.0;AE image crop start x, limited range:[0, ImageWidth - 256] */
1342     hi_u16  y;   /* RW; Range: Hi3559AV100 = [0, 8192 - 120]|Hi3519AV100 = [0, 8192 - 120]|
1343                     Hi3516CV500 = [0, 4608 - 120]|Hi3516DV300 = [0, 4608 - 120]| Hi3516AV300 = [0, 4608 - 120]|
1344                     Hi3559V200   = [0, 4608 - 120]|Hi3556V200   = [0, 4608 - 120]| Hi3516EV200 = [0,3072 - 120]|
1345                     Hi3516EV300 = [0,3072 - 120]|Hi3518EV300 = [0,3072 - 120]| Hi3516DV200 = [0,3072 - 120];
1346                     Format:13.0;AEimage crop start y, limited range:[0, ImageHeight - 120]  */
1347     hi_u16  w;   /* RW; Range: Hi3559AV100 = [256, 8192]|Hi3519AV100 = [256, 8192]|Hi3516CV500 = [256, 4608]|
1348                     Hi3516DV300 = [256, 4608] | Hi3516AV300 = [256, 4608] |Hi3559V200   = [256, 4608]|
1349                     Hi3556V200  = [256, 4608]| Hi3516EV200 = [256, 3072]|Hi3516EV300 = [256, 3072]|
1350                     Hi3518EV300 = [256, 3072]|Hi3516DV200 = [256, 3072];
1351                     Format:14.0;AE image crop width,  limited range:[256, ImageWidth] */
1352     hi_u16  h;   /* RW; Range: Hi3559AV100 = [120, 8192]|Hi3519AV100 = [120, 8192]|Hi3516CV500 = [120, 4608]|
1353                     Hi3516DV300 = [120, 4608] | Hi3516AV300 = [120, 4608] |Hi3559V200   = [120, 4608]|
1354                     Hi3556V200  = [120, 4608]| Hi3516EV200 = [120, 3072]|Hi3516EV300 = [120, 3072]|
1355                     Hi3518EV300 = [120, 3072]|Hi3516DV200 = [120, 3072];
1356                     Format:14.0;AE image crop height  limited range:[120, ImageHeight] */
1357 } hi_isp_ae_crop;
1358 
1359 /* config of statistics structs */
1360 typedef struct {
1361     hi_isp_ae_switch          ae_switch;          /* RW; Range:[0, 2]; Format:2.0;
1362                                                      The position of AE histogram in ISP BE pipeline */
1363     hi_isp_ae_hist_config     hist_config;
1364     hi_isp_ae_four_plane_mode four_plane_mode;    /* RW; Range:[0, 1]; Format:2.0;Four Plane Mode Enable */
1365     hi_isp_ae_stat_mode       hist_mode;          /* RW; Range:[0, 1]; Format:2.0;AE Hist Rooting Mode */
1366     hi_isp_ae_stat_mode       aver_mode;          /* RW; Range:[0, 1]; Format:2.0;AE Aver Rooting Mode */
1367     hi_isp_ae_stat_mode       max_gain_mode;      /* RW; Range:[0, 1]; Format:2.0;Max Gain Rooting Mode */
1368     hi_isp_ae_crop            crop;
1369     hi_u8 weight[AE_ZONE_ROW][AE_ZONE_COLUMN]; /* RW; Range:[0x0, 0xF]; Format:4.0; AE weighting table */
1370 } hi_isp_ae_statistics_cfg;
1371 
1372 /* Smart Info */
1373 typedef struct {
1374     hi_bool  enable;
1375     hi_bool  available;
1376     hi_u8    luma;
1377 } hi_isp_people_roi;
1378 
1379 typedef struct {
1380     hi_bool  enable;
1381     hi_bool  available;
1382     hi_u32   tunnel_area_ratio;
1383     hi_u32   tunnel_exp_perf;
1384 } hi_isp_tunnel_roi;
1385 
1386 typedef struct {
1387     hi_isp_people_roi  people_roi[PEOPLE_CLASS_MAX];
1388     hi_isp_tunnel_roi  tunnel_roi[TUNNEL_CLASS_MAX];
1389 } hi_isp_smart_info;
1390 
1391 typedef ISP_PEOPLE_TYPE_E hi_isp_people_type;
1392 typedef ISP_TUNNEL_TYPE_E hi_isp_tunnel_type;
1393 
1394 /* fines whether the peak value of the zoned IIR statistics is calculated */
1395 typedef ISP_AF_PEAK_MODE_E hi_isp_af_peak_mode;
1396 
1397 /* Defines whether the zoned statistics are squared in square mode */
1398 typedef ISP_AF_SQU_MODE_E  hi_isp_af_squ_mode;
1399 
1400 /* Crops the input image of the AF module */
1401 typedef struct {
1402     hi_bool enable; /* RW; Range: [0,1];  Format:1.0; AF crop enable */
1403     hi_u16  x;    /* RW; Range: Hi3559AV100 = [0, 7936]|Hi3519AV100 = [0, 7936]|Hi3516CV500 = [0, 4352]|
1404                      Hi3516DV300 = [0, 4352]| Hi3516AV300 = [0, 4352]|Hi3559V200 = [0, 4352]|
1405                      Hi3556V200  = [0, 4352]|Hi3516EV200 = [0, 2816]|Hi3516EV300 = [0, 2816]|
1406                      Hi3518EV300 = [0, 2816]|Hi3516DV200 = [0, 2816];
1407                      Format:13.0;AF image crop start x, limited range:[0, ImageWidth-256] */
1408     hi_u16  y;    /* RW; Range: Hi3559AV100 = [0, 8072]|Hi3519AV100 = [0, 8072]|Hi3516CV500 = [0, 4488]|
1409                      Hi3516DV300 = [0, 4488]| Hi3516AV300 = [0, 4488]|Hi3559V200 = [0, 4488]|
1410                      Hi3556V200  = [0, 4488]|Hi3516EV200 = [0, 2952]|Hi3516EV300 = [0,2952]|
1411                      Hi3518EV300 = [0,2952]|Hi3516DV200 = [0,2952];
1412                      Format:13.0;AF image crop start y, limited range:[0, ImageHeight-120] */
1413     hi_u16  w;    /* RW; Range: Hi3559AV100 = [256, 8192]|Hi3519AV100 = [256, 8192]|Hi3516CV500 = [256, 4608]|
1414                      Hi3516DV300 = [256, 4608]| Hi3516AV300 = [256, 4608]| Hi3559V200  = [256, 4608]|
1415                      Hi3556V200  = [256, 4608]Hi3516EV200 = [256, 3072]|
1416                      Hi3516EV300 = [256, 3072]|Hi3518EV300 = [256, 3072]|Hi3516DV200 = [256, 3072];
1417                      Format:14.0;AF image crop width, limited range:[256, ImageWidth] */
1418     hi_u16  h;    /* RW; Range: Hi3559AV100 = [120, 8192]|Hi3519AV100 = [120, 8192]|Hi3516CV500 = [120, 4608]|
1419                      Hi3516DV300 = [120, 4608]| Hi3516AV300 = [120, 4608]| Hi3559V200  = [120, 4608]|
1420                      Hi3556V200  = [120, 4608]Hi3516EV200 = [120,3072]|
1421                      Hi3516EV300 = [120,3072]|Hi3518EV300 = [120, 3072]|Hi3516DV200 = [120, 3072];
1422                      Format:14.0;AF image crop height, limited range:[120, ImageHeight] */
1423 } hi_isp_af_crop;
1424 
1425 /* Defines the position of AF module statistics */
1426 typedef ISP_AF_STATISTICS_POS_E hi_isp_af_statistics_pos;
1427 
1428 /* Configures the Bayer field of the AF module */
1429 typedef struct {
1430     hi_u8               gamma_gain_limit; /* RW; Range: [0x0, 0x5]; Format:3.0,
1431                                              Not support Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
1432     hi_u8               gamma_value;      /* RW; Range: Hi3559AV100 = [0x0, 0x6] | Hi3519AV100 = [0x0, 0x6] |
1433                                              Hi3516CV500 = [0x0, 0x6] | Hi3516DV300 = [0x0, 0x6]|
1434                                              Hi3516AV300 = [0x0, 0x6]|Hi3559V200 = [0x0, 0x6]|
1435                                              Hi3556V200  = [0x0, 0x6]|Hi3516EV200 = [0x0, 0x1]|Hi3516EV300 = [0x0, 0x1]|
1436                                              Hi3518EV300 = [0x0, 0x1]|Hi3516DV200 = [0x0, 0x1]; */
1437     hi_isp_bayer_format pattern;          /* RW; Range: [0x0, 0x3]; Format:2.0;raw domain pattern */
1438 } hi_isp_af_raw_cfg;
1439 
1440 /* Configures the pre-filter of the AF module */
1441 typedef struct {
1442     hi_bool             en;         /* RW; Range: [0,1]; Format:1.0; pre filter enable  .          */
1443     hi_u16              strength; /* RW; Range: [0x0, 0xFFFF]; Format:16.0;pre filter strength    */
1444 } hi_isp_af_pre_filter_cfg;
1445 
1446 /* Defines AF statistics configuration parameters */
1447 typedef struct {
1448     hi_bool                 enable;     /* RW; Range: [0,1];   AF enable. */
1449     hi_u16                  h_wnd;      /* RW; Range: [1, 17]; AF statistic window horizontal block.  */
1450     hi_u16                  v_wnd;      /* RW; Range: [1, 15]; AF statistic window veritical block.  */
1451     hi_u16                  h_size;     /* RW; Range: Hi3559AV100 = [256, 8192]|Hi3519AV100 = [256, 8192]|
1452                                            Hi3516CV500 = [256, 4608]|Hi3516DV300 = [256, 4608]|
1453                                            Hi3516AV300 = [256, 4608]|Hi3559V200 = [256, 4608]|
1454                                            Hi3556V200  = [256, 4608]|Hi3516EV200 = [256,3072]|
1455                                            Hi3516EV300 = [256,3072]|Hi3518EV300 = [256,3072]|Hi3516DV200 = [256,3072];
1456                                            limited Range: [256, ImageWidth],AF image width. */
1457     hi_u16                  v_size;    /* RW; Range: Hi3559AV100 = [120, 8192]|Hi3519AV100 = [120, 8192]|
1458                                           Hi3516CV500 = [120, 4608]|Hi3516DV300 = [120, 4608]|
1459                                           Hi3516AV300 = [120, 4608]|Hi3559V200 = [120, 4608]|
1460                                           Hi3556V200  = [120, 4608]|Hi3516EV200 = [120,3072]|Hi3516EV300 = [120,3072]|
1461                                           Hi3518EV300 = [120,3072]|Hi3516DV200 = [120,3072];
1462                                           limited Range: [120, ImageHeight],AF image height. */
1463     hi_isp_af_peak_mode      peak_mode;      /* RW; Range: [0,1]; AF peak value statistic mode. */
1464     hi_isp_af_squ_mode       squ_mode;       /* RW; Range: [0,1]; AF statistic square accumulate. */
1465     hi_isp_af_crop           crop;           /* RW; AF input image crop */
1466     hi_isp_af_statistics_pos statistics_pos; /* RW; Range: [0,2]; AF statistic position, it can be set to yuv or raw */
1467     hi_isp_af_raw_cfg        raw_cfg;        /* RW; When AF locate at RAW domain, these para should be cfg. */
1468     hi_isp_af_pre_filter_cfg pre_flt_cfg;    /* RW; pre filter cfg */
1469     hi_u16                   high_luma_th;   /* RW; Range: [0,0xFF]; high luma threshold. */
1470 } hi_isp_af_cfg;
1471 
1472 /* Configures the AF level depend gain module */
1473 typedef struct {
1474     hi_bool     ld_en;                    /* RW; Range: [0, 1]; FILTER level depend gain enable. */
1475     hi_u16      th_low;                   /* RW; range: [0x0, 0xFF]; FILTER level depend th low */
1476     hi_u16      gain_low;                 /* RW; range: [0x0, 0xFF]; FILTER level depend gain low */
1477     hi_u16      slp_low;                  /* RW; range: [0x0, 0xF];  FILTER level depend slope low */
1478     hi_u16      th_high;                  /* RW; range: [0x0, 0xFF]; FILTER level depend th high */
1479     hi_u16      gain_high;                /* RW; range: [0x0, 0xFF]; FILTER level depend gain high */
1480     hi_u16      slp_high;                 /* RW; range: [0x0, 0xF];  FILTER level depend slope high */
1481 } hi_isp_af_ld;
1482 
1483 /* Configures the AF coring module */
1484 typedef struct {
1485     hi_u16      th;                      /* RW; Range: [0x0, 0x7FF];FILTER coring threshold. */
1486     hi_u16      slp;                     /* RW; Range: [0x0, 0xF];  FILTER Coring Slope */
1487     hi_u16      lmt;                     /* RW; Range: [0x0, 0x7FF];FILTER coring limit */
1488 } hi_isp_af_coring;
1489 
1490 /* Defines the IIR parameter configuration of horizontal filters for AF statistics. */
1491 typedef struct {
1492     hi_bool          narrow_band;             /* RW; Range: [0, 1]; IIR narrow band enable. */
1493     hi_bool          iir_en[IIR_EN_NUM];      /* RW; Range: [0, 1]; IIR enable. */
1494     hi_u8            iir_shift;               /* RW; Range: [0, 63]; IIR Shift.Only used for Hi3559AV100/Hi3519AV100 */
1495     hi_s16           iir_gain[IIR_GAIN_NUM];  /* RW; Range: [-511, 511]. IIR gain,gain0 range:[0,255]. */
1496     hi_u16           iir_shift_lut[IIR_SHIFT_NUM]; /* RW; Range: [0x0, 0x7];  IIR shift. */
1497     hi_isp_af_ld     ld;                       /* RW; filter level depend. */
1498     hi_isp_af_coring coring;                   /* RW; filter coring. */
1499 } hi_isp_af_h_param;
1500 
1501 typedef struct {
1502     hi_s16           firh[FIR_GAIN_NUM]; /* RW; Range: [-31, 31];   FIR gain. */
1503     hi_isp_af_ld     ld;                 /* RW; filter level depend. */
1504     hi_isp_af_coring coring;             /* RW; filter coring.  */
1505 } hi_isp_af_v_param;
1506 
1507 typedef struct {
1508     hi_u16 acc_shift_y;                   /* RW; Range: [0x0, 0xF]; luminance Y statistic shift. */
1509     hi_u16 acc_shift_h[ACC_SHIFT_H_NUM];  /* RW; Range: [0x0, 0xF]; IIR statistic shift. */
1510     hi_u16 acc_shift_v[ACC_SHIFT_V_NUM];  /* RW; Range: [0x0, 0xF]; FIR statistic shift. */
1511     hi_u16 hl_cnt_shift;                  /* RW; Range: [0x0, 0xF]; High luminance counter shift */
1512 } hi_isp_af_fv_param;
1513 
1514 typedef struct {
1515     hi_isp_af_cfg        config;
1516     hi_isp_af_h_param    h_param_iir0;
1517     hi_isp_af_h_param    h_param_iir1;
1518     hi_isp_af_v_param    v_param_fir0;
1519     hi_isp_af_v_param    v_param_fir1;
1520     hi_isp_af_fv_param   fv_param;
1521 } hi_isp_focus_statistics_cfg;
1522 
1523 /*
1524    the main purpose of stat key was to access individual statistic info separately...
1525    ...for achieving performance optimization of CPU, because of we acquire stat...
1526    ... in ISP_DRV ISR for our firmware reference and USER can also use alternative MPI...
1527    ... to do this job, so bit1AeStat1~bit1AfStat for MPI behavior control, and bit16IsrAccess...
1528    ... for ISR access control, they were independent. but they have the same bit order, for example...
1529    ... bit1AeStat1 for MPI AeStat1 access key, and bit16 of u32Key for ISR AeStat1 access key
1530  */
1531 typedef union {
1532     hi_u64  key;
1533     struct {
1534         hi_u64  bit1_fe_ae_glo_stat      : 1;   /* [0] */
1535         hi_u64  bit1_fe_ae_loc_stat      : 1;   /* [1] */
1536         hi_u64  bit1_fe_ae_sti_glo_stat  : 1;   /* [2] .Only used for Hi3559AV100/Hi3519AV100 */
1537         hi_u64  bit1_fe_ae_sti_loc_stat  : 1;   /* [3] .Only used for Hi3559AV100/Hi3519AV100 */
1538         hi_u64  bit1_be_ae_glo_stat      : 1;   /* [4] */
1539         hi_u64  bit1_be_ae_loc_stat      : 1;   /* [5] */
1540         hi_u64  bit1_be_ae_sti_glo_stat  : 1;   /* [6] .Only used for Hi3559AV100/Hi3519AV100 */
1541         hi_u64  bit1_be_ae_sti_loc_stat  : 1;   /* [7] .Only used for Hi3559AV100/Hi3519AV100 */
1542         hi_u64  bit1_awb_stat1           : 1;   /* [8] */
1543         hi_u64  bit1_awb_stat2           : 1;   /* [9] */
1544         hi_u64  bit2_rsv0                : 2;   /* [10:11] */
1545         hi_u64  bit1_fe_af_stat          : 1;   /* [12] .Only used for Hi3559AV100/Hi3519AV100 */
1546         hi_u64  bit1_be_af_stat          : 1;   /* [13] */
1547         hi_u64  bit2_rsv1                : 2;   /* [14:15] */
1548         hi_u64  bit1_dehaze              : 1;   /* [16] */
1549         hi_u64  bit1_mg_stat             : 1;   /* [17] */
1550         hi_u64  bit14_rsv                : 14;   /* [18:31] */
1551         hi_u64  bit32_isr_access         : 32;   /* [32:63] */
1552     };
1553 } hi_isp_statistics_ctrl;
1554 
1555 typedef struct {
1556     hi_u16 grid_y_pos[AE_ZONE_ROW + 1];   /* R */
1557     hi_u16 grid_x_pos[AE_ZONE_COLUMN + 1]; /* R */
1558     hi_u8  status;                        /* R;0:not update, 1: update,others:reserved */
1559 } hi_isp_ae_grid_info;
1560 
1561 typedef struct {
1562     hi_u16 grid_y_pos[MG_ZONE_ROW + 1];    /* R */
1563     hi_u16 grid_x_pos[MG_ZONE_COLUMN + 1]; /* R */
1564     hi_u8  status;                         /* R;0:not update, 1: update,others:reserved */
1565 } hi_isp_mg_grid_info;
1566 
1567 typedef struct {
1568     hi_u16 grid_y_pos[AWB_ZONE_ORIG_ROW  + 1];   /* R */
1569     hi_u16 grid_x_pos[AWB_ZONE_ORIG_COLUMN + 1]; /* R */
1570     hi_u8  status;                               /* R;0:not update, 1: update,others:reserved */
1571 } hi_isp_awb_grid_info;
1572 
1573 typedef struct {
1574     hi_u16 grid_y_pos[AF_ZONE_ROW + 1];    /* R */
1575     hi_u16 grid_x_pos[AF_ZONE_COLUMN + 1]; /* R */
1576     hi_u8  status;                         /* R;0:not update, 1: update,others:reserved */
1577 } hi_isp_focus_grid_info;
1578 
1579 typedef struct {
1580     hi_u32 fe_hist1024_value[ISP_CHN_MAX_NUM][HIST_NUM];  /* R; Range: [0x0, 0xFFFFFFFF]; Format:32.0;
1581                                                              Global 1024 bins histogram of FE */
1582     hi_u16 fe_global_avg[ISP_CHN_MAX_NUM][BAYER_PATTERN_NUM]; /* R; Range: [0x0, 0xFFFF]; Format:16.0;
1583                                                                  Global average value of FE,
1584                                                          Not support Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
1585     hi_u16 fe_zone_avg[ISP_CHN_MAX_NUM][AE_ZONE_ROW][AE_ZONE_COLUMN][BAYER_PATTERN_NUM]; /* R; Range: [0x0, 0xFFFF];
1586                                                                                             Format:16.0;
1587                                                                                             Zone average value of FE,
1588                               Not support for Hi3516CV500/ Hi3516DV300/Hi3516AV300/ Hi3559V200/Hi3556V200's Fe1 and Fe3,
1589                               Not support Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
1590     hi_u32 be_hist1024_value[HIST_NUM];                                 /* R; Range: [0x0, 0xFFFFFFFF]; Format:32.0;
1591                                                                            Global 1024 bins histogram of BE */
1592     hi_u16 be_global_avg[BAYER_PATTERN_NUM];                            /* R; Range: [0x0, 0xFFFF]; Format:16.0;
1593                                                                            Global average value of BE */
1594     hi_u16 be_zone_avg[AE_ZONE_ROW][AE_ZONE_COLUMN][BAYER_PATTERN_NUM]; /* R; Range: [0x0, 0xFFFF]; Format:16.0;
1595                                                                            Zone average value of BE */
1596     hi_isp_ae_grid_info fe_grid_info;
1597     hi_isp_ae_grid_info be_grid_info;
1598 } hi_isp_ae_statistics;
1599 
1600 /* Not support for Hi3516CV500/Hi3516DV300/Hi3516AV300/Hi3559V200/Hi3556V200/
1601    Hi3516EV200/Hi3516EV300/Hi3518EV300/Hi3516DV200 */
1602 typedef struct {
1603     hi_u32 fe_hist1024_value[ISP_CHN_MAX_NUM][HIST_NUM];      /* R; Range: [0x0, 0xFFFFFFFF]; Format:32.0;
1604                                                                  Global 1024 bins histogram of FE */
1605     hi_u16 fe_global_avg[ISP_CHN_MAX_NUM][BAYER_PATTERN_NUM]; /* R; Range: [0x0, 0xFFFF]; Format:16.0;
1606                                                                  Global average value of FE. */
1607     hi_u16 fe_zone_avg[VI_MAX_PIPE_NUM][ISP_CHN_MAX_NUM][AE_ZONE_ROW][AE_ZONE_COLUMN][BAYER_PATTERN_NUM]; /* R;
1608                                                                                     Range: [0x0, 0xFFFF]; Format:16.0;
1609                                                                                     Zone average value of FE. */
1610     hi_u32 be_hist1024_value[HIST_NUM];          /* R; Range: [0x0, 0xFFFFFFFF]; Format:32.0;
1611                                                     Global 1024 bins histogram of BE. */
1612     hi_u16 be_global_avg[BAYER_PATTERN_NUM];     /* R; Range: [0x0, 0xFFFF]; Format:16.0; Global average value of BE */
1613     hi_u16 be_zone_avg[VI_MAX_PIPE_NUM][AE_ZONE_ROW][AE_ZONE_COLUMN][BAYER_PATTERN_NUM]; /* R; Range: [0x0, 0xFFFF];
1614                                                                                             Format:16.0;
1615                                                                                             Zone average value of BE */
1616 } hi_isp_ae_stitch_statistics;
1617 
1618 typedef struct {
1619     hi_u16 au16_zone_avg[MG_ZONE_ROW][MG_ZONE_COLUMN][BAYER_PATTERN_NUM]; /* R; Range: [0x0, 0xFF]; Format:8.0;
1620                                                                              Zone average value */
1621     hi_isp_mg_grid_info grid_info;
1622 } hi_isp_mg_statistics;
1623 
1624 /* AWB */
1625 typedef ISP_AWB_SWITCH_E hi_isp_awb_switch;
1626 typedef ISP_AWB_GAIN_SWITCH_E hi_isp_awb_gain_switch;
1627 
1628 /* Crops the input image of the AWB module */
1629 typedef struct {
1630     hi_bool enable;  /* RW; Range: [0,1];  Format:1.0;AWB crop enable */
1631     hi_u16  x;    /* RW; Range: Hi3559AV100 = [0, 8192 - 60]|Hi3519AV100 = [0, 8192 - 60]|Hi3516CV500 = [0, 4608 - 60]|
1632                      Hi3516DV300 = [0, 4608 - 60]| Hi3516AV300 = [0, 4608 - 60]|Hi3559V200   = [0, 4608 - 60]|
1633                      Hi3556V200 = [0, 4608 - 60]| Hi3516EV200 = [0,3072 - 60]|Hi3516EV300 = [0,3072 - 60]|
1634                      Hi3518EV300 = [0,3072 - 60]|Hi3516DV200 = [0,3072 - 60];
1635                      Format:13.0;AWB image crop start x, limited range:[0, ImageWidth - u16ZoneCol * 60] */
1636     hi_u16  y;    /* RW; Range: Hi3559AV100 = [0, 8192 - 14]|Hi3519AV100 = [0, 8192 - 14]|Hi3516CV500 = [0, 4608 - 14]|
1637                      Hi3516DV300 = [0, 4608 - 14]| Hi3516AV300 = [0, 4608 - 14]|Hi3559V200   = [0, 4608 - 14]|
1638                      Hi3556V200   = [0, 4608 - 14]| Hi3516EV200 = [0,3072-14]|Hi3516EV300 = [0,3072-14]|
1639                      Hi3518EV300 = [0,3072-14]|Hi3516DV200 = [0,3072-14];
1640                      Format:13.0;AWB image crop start y,limited range:[0, ImageHeight - u16ZoneRow * 14] */
1641     hi_u16  w;    /* RW; Range: Hi3559AV100 = [60, 8192]|Hi3519AV100 = [60, 8192]|Hi3516CV500 = [60, 4608]|
1642                      Hi3516DV300 = [60, 4608] | Hi3516AV300 = [60, 4608] |Hi3559V200 = [60, 4608]|
1643                      Hi3556V200 = [60, 4608]| Hi3516EV200 = [60,3072]|Hi3516EV300 = [60,3072]|Hi3518EV300 = [60,3072]|
1644                      Hi3516DV200 = [60,3072]; Format:14.0;
1645                      AWB image crop width, limited range:[u16ZoneCol * 60, ImageWidth] */
1646     hi_u16  h;    /* RW; Range: Hi3559AV100 = [14, 8192]|Hi3519AV100 = [14, 8192]|Hi3516CV500 = [14, 4608]|
1647                      Hi3516DV300 = [14, 4608] | Hi3516AV300 = [14, 4608] |Hi3559V200 = [14, 4608]|
1648                      Hi3556V200 = [14, 4608] | Hi3516EV200 = [14,3072]|Hi3516EV300 = [14,3072]|Hi3518EV300 = [14,3072]|
1649                      Hi3516DV200 = [14,3072]; Format:14.0;
1650                      AWB image crop height, limited range:[u16ZoneRow * 14, ImageHeight] */
1651 } hi_isp_awb_crop;
1652 
1653 /* Defines the AWB statistics configuration */
1654 typedef struct {
1655     hi_isp_awb_switch awb_switch; /* RW; Range: [0x0, 0x2]; Position of AWB statistics in pipeline */
1656     hi_u16 zone_row;           /* RW; Range: [0x1, 0x20]; Vertical Blocks,
1657                                   limited range:[1, min(32, ImageHeight /AWB_MIN_HEIGHT)] */
1658     hi_u16 zone_col;           /* RW; Range: [0x1, 0x20]; Horizontal Blocks,
1659                                   limited range:[BlkNum, min(32, Width /AWB_MIN_WIDTH)] */
1660     hi_u16 zone_bin;           /* RW; Range:Hi3559AV100 = [1, 4] | Hi3519AV100 = [1, 4] | Hi3516CV500 = [1, 1]|
1661                                   Hi3516DV300 = [1, 1]| Hi3516AV300 = [1, 1]|Hi3559V200 = [1, 1]|Hi3556V200 = [1, 1]|
1662                                   Hi3516EV200 = [1,1]|Hi3516EV300 = [1,1]|Hi3518EV300 = [1,1]|Hi3516DV200 = [1,1];
1663                                   Brightness Bins */
1664     hi_u16 hist_bin_thresh[AWB_ZONE_BIN_MAX]; /* RW; Range: [0x0, 0xFFFF]; Bin Threshold */
1665     hi_u16 white_level;        /* RW; Range: [0x0, 0xFFFF];Upper limit of valid data for white region,
1666                                   for Bayer statistics, [0x0, 0x3FF] for RGB statistics */
1667     hi_u16 black_level;        /* RW; Range: [0x0, 0xFFFF];limited range: [0x0, u16WhiteLevel],
1668                                   Lower limit of valid data for white region .
1669                                   for Bayer statistics, bitwidth is 12, for RGB statistics, bitwidth is 10 */
1670     hi_u16 cb_max;             /* RW; Range: [0x0, 0xFFF];Maximum value of B/G for white region */
1671     hi_u16 cb_min;             /* RW; Range: [0x0, 0xFFF];
1672                                   limited range: [0x0, u16CbMax]Minimum value of B/G for white region */
1673     hi_u16 cr_max;             /* RW; Range: [0x0, 0xFFF];Maximum value of R/G for white region */
1674     hi_u16 cr_min;             /* RW; Range: [0x0, 0xFFF];
1675                                   limited range: [0x0, u16CrMax],Minimum value of R/G for white region */
1676     hi_isp_awb_crop crop;
1677 } hi_isp_wb_statistics_cfg;
1678 
1679 typedef struct {
1680     hi_u16  zone_row;                            /* R; Range: [0x0, 0x20];
1681                                                     effective horizontal block number for AWB statistic stitch window */
1682     hi_u16  zone_col;                            /* R; Range: [0x0, 0x80];
1683                                                     effective vetical block number for AWB statistic stitch window */
1684     hi_u16  zone_avg_r[AWB_ZONE_STITCH_MAX];     /* R; Range: [0x0, 0xFFFF];Zone Average R  for Stitich mode */
1685     hi_u16  zone_avg_g[AWB_ZONE_STITCH_MAX];     /* R; Range: [0x0, 0xFFFF];Zone Average G  for Stitich mode */
1686     hi_u16  zone_avg_b[AWB_ZONE_STITCH_MAX];     /* R; Range: [0x0, 0xFFFF];Zone Average B  for Stitich mode */
1687     hi_u16  zone_count_all[AWB_ZONE_STITCH_MAX]; /* R; Range: [0x0, 0xFFFF];
1688                                                     normalized number of Gray points  for Stitich mode */
1689 } hi_isp_wb_stitch_statistics;
1690 
1691 typedef struct {
1692     hi_u16 global_r;          /* R; Range: [0x0, 0xFFFF];Global WB output Average R */
1693     hi_u16 global_g;          /* R; Range: [0x0, 0xFFFF];Global WB output Average G */
1694     hi_u16 global_b;          /* R; Range: [0x0, 0xFFFF];Global WB output Average B */
1695     hi_u16 count_all;         /* R; Range: [0x0, 0xFFFF];normalized number of Gray points */
1696 
1697     hi_u16 zone_avg_r[AWB_ZONE_NUM];            /* R; Range: [0x0, 0xFFFF];Zone Average R */
1698     hi_u16 zone_avg_g[AWB_ZONE_NUM];            /* R; Range: [0x0, 0xFFFF];Zone Average G */
1699     hi_u16 zone_avg_b[AWB_ZONE_NUM];            /* R; Range: [0x0, 0xFFFF];Zone Average B */
1700     hi_u16 zone_count_all[AWB_ZONE_NUM];        /* R; Range: [0x0, 0xFFFF];normalized number of Gray points */
1701     hi_isp_awb_grid_info grid_info;
1702 } hi_isp_wb_statistics;
1703 
1704 typedef struct {
1705     hi_u16  v1;            /* R; Range: [0x0, 0xFFFF];vertical fir block1 Statistics */
1706     hi_u16  h1;            /* R; Range: [0x0, 0xFFFF];horizontal iir block1 Statistics */
1707     hi_u16  v2;            /* R; Range: [0x0, 0xFFFF];vertical fir block2 Statistics */
1708     hi_u16  h2;            /* R; Range: [0x0, 0xFFFF];horizontal iir block2 Statistics */
1709     hi_u16  y;             /* R; Range: [0x0, 0xFFFF];Y Statistics */
1710     hi_u16  hl_cnt;        /* R; Range: [0x0, 0xFFFF];HlCnt Statistics */
1711 } hi_isp_focus_zone;
1712 
1713 typedef struct {
1714     hi_isp_focus_zone zone_metrics[WDR_CHN_MAX][AF_ZONE_ROW][AF_ZONE_COLUMN]; /* R; The zoned measure of contrast */
1715 } hi_isp_fe_focus_statistics;
1716 
1717 typedef struct {
1718     hi_isp_focus_zone zone_metrics[AF_ZONE_ROW][AF_ZONE_COLUMN]; /* R; The zoned measure of contrast */
1719 } hi_isp_be_focus_statistics;
1720 
1721 typedef struct {
1722     hi_isp_fe_focus_statistics  fe_af_stat; /* only used for Hi3559AV100/Hi3519AV100 */
1723     hi_isp_be_focus_statistics  be_af_stat;
1724     hi_isp_focus_grid_info      fe_af_grid_info; /* only used for Hi3559AV100/Hi3519AV100 */
1725     hi_isp_focus_grid_info      be_af_grid_info;
1726 } hi_isp_af_statistics;
1727 
1728 typedef struct {
1729     hi_isp_statistics_ctrl      key;
1730     hi_isp_ae_statistics_cfg    ae_cfg;
1731     hi_isp_wb_statistics_cfg    wb_cfg;
1732     hi_isp_focus_statistics_cfg focus_cfg;
1733 } hi_isp_statistics_cfg;
1734 
1735 /* ISP debug information */
1736 typedef struct {
1737     hi_bool debug_en;     /* RW; 1:enable debug, 0:disable debug */
1738     hi_u64  phy_addr;     /* RW; phy address of debug info */
1739     hi_u32  depth;        /* RW; depth of debug info */
1740 } hi_isp_debug_info;
1741 
1742 typedef struct {
1743     hi_u32  rsv;         /* H;need to add member */
1744 } hi_isp_dbg_attr;
1745 
1746 typedef struct {
1747     hi_u32  frm_num_bgn;
1748     hi_u32  rsv;           /* H;need to add member */
1749     hi_u32  frm_num_end;
1750 } hi_isp_dbg_status;
1751 
1752 typedef ISP_SNS_TYPE_E hi_isp_sns_type;
1753 
1754 /* sensor communication bus */
1755 typedef union {
1756     hi_s8   i2c_dev;
1757     struct {
1758         hi_s8  bit4_ssp_dev       : 4;
1759         hi_s8  bit4_ssp_cs        : 4;
1760     } ssp_dev;
1761 } hi_isp_sns_commbus;
1762 
1763 typedef struct {
1764     hi_bool update;        /* RW; Range: [0x0, 0x1]; Format:1.0;
1765                               HI_TRUE: The sensor registers are written,
1766                               HI_FALSE: The sensor registers are not written */
1767     hi_u8   delay_frm_num; /* RW; Number of delayed frames for the sensor register */
1768     hi_u8   int_pos;       /* RW;Position where the configuration of the sensor register takes effect */
1769     hi_u8   dev_addr;      /* RW;Sensor device address */
1770     hi_u32  reg_addr;      /* RW;Sensor register address */
1771     hi_u32  addr_byte_num; /* RW;Bit width of the sensor register address */
1772     hi_u32  data;          /* RW;Sensor register data */
1773     hi_u32  data_byte_num; /* RW;Bit width of sensor register data */
1774 } hi_isp_i2c_data;
1775 
1776 typedef struct {
1777     hi_bool update;             /* RW; Range: [0x0, 0x1]; Format:1.0;
1778                                    HI_TRUE: The sensor registers are written,
1779                                    HI_FALSE: The sensor registers are not written */
1780     hi_u8   delay_frm_num;      /* RW; Number of delayed frames for the sensor register */
1781     hi_u8   int_pos;            /* RW;Position where the configuration of the sensor register takes effect */
1782     hi_u32  dev_addr;           /* RW;Sensor device address */
1783     hi_u32  dev_addr_byte_num;  /* RW;Bit width of the sensor device address */
1784     hi_u32  reg_addr;           /* RW;Sensor register address */
1785     hi_u32  reg_addr_byte_num;  /* RW;Bit width of the sensor register address */
1786     hi_u32  data;               /* RW;Sensor register data */
1787     hi_u32  data_byte_num;      /* RW;Bit width of sensor register data */
1788 } hi_isp_ssp_data;
1789 
1790 typedef struct {
1791     hi_u32  sns_vmax_addr[ISP_MAX_SNS_EXP_ADDR_NUM];  /* 3 addr high  mid  low */
1792     hi_u32  sns_exp_addr[ISP_MAX_SNS_EXP_ADDR_NUM];   /* 3 addr high  mid  low */
1793     hi_u32  sns_readout_time;
1794     hi_isp_sns_mode sns_exp_mode;     /* 1: shr   0:exp */
1795 } hi_isp_mcf_data;
1796 
1797 typedef struct {
1798     hi_isp_sns_type sns_type;
1799     hi_u32  reg_num;               /* RW;Number of registers required when exposure results are written to the sensor.
1800                                       The member value cannot be dynamically changed */
1801     hi_u8   cfg2_valid_delay_max;  /* RW;Maximum number of delayed frames from the time when all sensor registers are
1802                                       configured to the time when configurations take effect, which is used to ensure
1803                                       the synchronization between sensor registers and ISP registers */
1804     hi_isp_sns_commbus  com_bus;
1805     union {
1806         hi_isp_i2c_data i2c_data[ISP_MAX_SNS_REGS];
1807         hi_isp_ssp_data ssp_data[ISP_MAX_SNS_REGS];
1808     };
1809 
1810     struct {
1811         hi_bool update;
1812         hi_u8   delay_frm_num;
1813         hi_u32  slave_vs_time;      /* RW;time of vsync. Unit: inck clock cycle */
1814         hi_u32  slave_bind_dev;
1815     } slv_sync;
1816 
1817     hi_isp_mcf_data mcf_data; /* only for hi3516dv200/hi3516ev300 */
1818 
1819     hi_bool config;
1820 } hi_isp_sns_regs_info;
1821 
1822 typedef ISP_VD_TYPE_E hi_isp_vd_type;
1823 
1824 /* Defines the attributes of the virtual addresses for the registers of ISP submodules */
1825 typedef struct {
1826     hi_void *isp_ext_reg_addr;        /* R;Start virtual address for the ISP external virtual registers */
1827     hi_u32  isp_ext_reg_size;         /* R;Size of the ISP external virtual registers */
1828     hi_void *ae_ext_reg_addr;         /* R;Start virtual address for the AE library module */
1829     hi_u32  ae_ext_reg_size;          /* R;Size of the AE library module */
1830     hi_void *awb_ext_reg_addr;        /* R;Start virtual address for the AWB library module */
1831     hi_u32  awb_ext_reg_size;         /* R;Size of the AWB library module */
1832 } hi_isp_reg_attr;
1833 
1834 /* AI structs */
1835 typedef ISP_IRIS_TYPE_E hi_isp_iris_type;
1836 typedef ISP_IRIS_F_NO_E hi_isp_iris_f_no;
1837 
1838 typedef struct {
1839     hi_s32 kp;             /* RW; Range:[0, 100000]; Format:32.0; the proportional gain of PID algorithm,
1840                               default value is 7000 */
1841     hi_s32 ki;             /* RW; Range:[0, 1000]; Format:32.0; the integral gain of PID algorithm,
1842                               default value is 100 */
1843     hi_s32 kd;             /* RW; Range:[0, 100000]; Format:32.0; the derivative gain of PID algorithm,
1844                               default value is 3000 */
1845     hi_u32 min_pwm_duty;   /* RW; Range:[0, 1000]; Format:32.0; which is the min pwm duty for dciris control */
1846     hi_u32 max_pwm_duty;   /* RW; Range:[0, 1000]; Format:32.0; which is the max pwm duty for dciris control */
1847     hi_u32 open_pwm_duty;  /* RW; Range:[0, 1000]; Format:32.0; which is the open pwm duty for dciris control */
1848 } hi_isp_dciris_attr;
1849 
1850 typedef struct {
1851     hi_bool step_fno_table_change;    /* W; Range:[0, 1]; Format:1.0; Step-F number mapping table change or not */
1852     hi_bool zero_is_max;              /* RW; Range:[0, 1]; Format:1.0; Step 0 corresponds to max aperture or not,
1853                                          it's related to the specific iris */
1854     hi_u16  total_step;               /* RW; Range:[1, 1024]; Format:16.0; Total steps of  Piris's aperture,
1855                                          it's related to the specific iris */
1856     hi_u16  step_count;               /* RW; Range:[1, 1024]; Format:16.0; Used steps of Piris's aperture.
1857                                          when Piris's aperture is too small, the F number precision is not enough,
1858                                          so not all the steps can be used. It's related to the specific iris */
1859     hi_u16 step_fno_table[AI_MAX_STEP_FNO_NUM];  /* RW; Range:[1, 1024]; Format:16.0; Step-F number mapping table.
1860                                                     F1.0 is expressed as 1024, F32 is expressed as 1,
1861                                                     it's related to the specific iris */
1862     hi_isp_iris_f_no  max_iris_fno_target;  /* RW; Range:[0, 10]; Format:4.0;
1863                                                Max F number of Piris's aperture, it's related to the specific iris */
1864     hi_isp_iris_f_no  min_iris_fno_target;  /* RW; Range:[0, 10]; Format:4.0;
1865                                                Min F number of Piris's aperture, it's related to the specific iris */
1866 
1867     hi_bool fno_ex_valid;           /* RW; Range:[0, 1]; Format:1.0; use equivalent gain to present FNO or not */
1868     hi_u32  max_iris_fno_target_linear;  /* RW; Range:[1, 1024]; Format:16.0;
1869                                             Max equivalent gain of F number of Piris's aperture,
1870                                             only used when bFNOExValid is true, it's related to the specific iris */
1871     hi_u32  min_iris_fno_target_linear;  /* RW; Range:[1, 1024]; Format:16.0;
1872                                             Min equivalent gain of F number of Piris's aperture,
1873                                             only used when bFNOExValid is true, it's related to the specific iris */
1874 } hi_isp_piris_attr;
1875 
1876 /* Defines the MI attribute */
1877 typedef struct {
1878     hi_u32  hold_value;           /* RW; Range:[0, 1000]; Format:32.0; iris hold value for DC-iris */
1879     hi_isp_iris_f_no  iris_fno;   /* RW; Range:[0, 10]; Format:4.0; the F number of P-iris */
1880 } hi_isp_mi_attr;
1881 
1882 typedef ISP_IRIS_STATUS_E hi_isp_iris_status;
1883 
1884 /* Defines the iris attribute */
1885 typedef struct {
1886     hi_bool enable;                    /* RW;iris enable/disable */
1887     hi_isp_op_type     op_type;        /* auto iris or manual iris */
1888     hi_isp_iris_type   iris_type;      /* DC-iris or P-iris */
1889     hi_isp_iris_status iris_status;    /* RW; status of Iris */
1890     hi_isp_mi_attr     mi_attr;
1891 } hi_isp_iris_attr;
1892 
1893 /* AE structs */
1894 typedef ISP_AE_MODE_E     hi_isp_ae_mode;
1895 typedef ISP_AE_STRATEGY_E hi_isp_ae_strategy;
1896 
1897 /* Defines the maximum exposure time or gain and minimum exposure time or gain */
1898 typedef struct {
1899     hi_u32 max;  /* RW;Range:[0,0xFFFFFFFF];Format:32.0;Maximum value */
1900     hi_u32 min;  /* RW;Range:[0,0xFFFFFFFF];Format:32.0;limited Range:[0,u32Max],Minimum value */
1901 } hi_isp_ae_range;
1902 
1903 /* Defines the ISP exposure delay attribute */
1904 typedef struct {
1905     hi_u16 black_delay_frame;    /* RW; Range:[0, 65535]; Format:16.0; AE black delay frame count */
1906     hi_u16 white_delay_frame;    /* RW; Range:[0, 65535]; Format:16.0; AE white delay frame count */
1907 } hi_isp_ae_delay;
1908 
1909 typedef ISP_ANTIFLICKER_MODE_E hi_isp_antiflicker_mode;
1910 
1911 /* Defines the anti-flicker attribute */
1912 typedef struct {
1913     hi_bool enable;      /* RW; Range:[0, 1]; Format:1.0; */
1914     hi_u8   frequency;   /* RW; Range:[0, 255]; Format:8.0;
1915                             usually this value is 50 or 60  which is the frequency of the AC power supply */
1916     hi_isp_antiflicker_mode  mode;
1917 } hi_isp_antiflicker;
1918 
1919 typedef struct {
1920     hi_bool enable; /* RW; Range:[0, 1]; Format:1.0; */
1921 
1922     hi_u8   luma_diff; /* RW; Range:[0, 100]; Format:8.0; if subflicker mode enable, current luma is less than AE
1923                           compensation plus LumaDiff, AE will keep min antiflicker shutter time
1924                           (for example: 1/100s or 1/120s) to avoid flicker. while current luma is larger than AE
1925                           compensation plus the LumaDiff, AE will reduce shutter time to avoid over-exposure and
1926                           introduce flicker in the pircture */
1927 } hi_isp_subflicker;
1928 
1929 typedef ISP_FSWDR_MODE_E hi_isp_fswdr_mode;
1930 
1931 typedef struct {
1932     /* base parameter */
1933     hi_isp_ae_range exp_time_range;   /* RW; Range:[0x0, 0xFFFFFFFF]; Format:32.0; sensor exposure time (unit: us),
1934                                          it's related to the specific sensor */
1935     hi_isp_ae_range a_gain_range;     /* RW; Range:[0x400, 0xFFFFFFFF]; Format:22.10;
1936                                          sensor analog gain (unit: times, 10bit precision), it's related to the
1937                                          specific sensor */
1938     hi_isp_ae_range d_gain_range;     /* RW; Range:[0x400, 0xFFFFFFFF]; Format:22.10;
1939                                          sensor digital gain (unit: times, 10bit precision), it's related to the
1940                                          specific sensor */
1941     hi_isp_ae_range ispd_gain_range;  /* RW; Range:[0x400, 0x40000]; Format:22.10;
1942                                          ISP digital gain (unit: times, 10bit precision), it's related to the
1943                                          ISP digital gain range */
1944     hi_isp_ae_range sys_gain_range;   /* RW; Range:[0x400, 0xFFFFFFFF]; Format:22.10;
1945                                          system gain (unit: times, 10bit precision), it's related to the specific sensor
1946                                          and ISP Dgain range */
1947     hi_u32 gain_threshold;            /* RW; Range:[0x400, 0xFFFFFFFF]; Format:22.10;
1948                                          Gain threshold for slow shutter mode (unit: times, 10bit precision) */
1949 
1950     hi_u8   speed;                   /* RW; Range:[0x0, 0xFF]; Format:8.0;
1951                                         AE adjust step for dark scene to bright scene switch */
1952     hi_u16  black_speed_bias;        /* RW; Range:[0x0, 0xFFFF]; Format:16.0;
1953                                         AE adjust step bias for bright scene to dark scene switch */
1954     hi_u8   tolerance;               /* RW; Range:[0x0, 0xFF]; Format:8.0; AE adjust tolerance */
1955     hi_u8   compensation;            /* RW; Range:[0x0, 0xFF]; Format:8.0; AE compensation */
1956     hi_u16  ev_bias;                 /* RW; Range:[0x0, 0xFFFF]; Format:16.0; AE EV bias */
1957     hi_isp_ae_strategy ae_strategy_mode;  /* RW; Range:[0, 1]; Format:1.0; Support Highlight prior or Lowlight prior */
1958     hi_u16  hist_ratio_slope;       /* RW; Range:[0x0, 0xFFFF]; Format:16.0; AE hist ratio slope */
1959     hi_u8   max_hist_offset;        /* RW; Range:[0x0, 0xFF]; Format:8.0; Max hist offset */
1960 
1961     hi_isp_ae_mode     ae_mode;     /* RW; Range:[0, 1]; Format:1.0; AE mode(slow shutter/fix framerate)(onvif) */
1962     hi_isp_antiflicker antiflicker;
1963     hi_isp_subflicker  subflicker;
1964     hi_isp_ae_delay    ae_delay_attr;
1965 
1966     hi_bool manual_exp_value;     /* RW; Range:[0, 1]; Format:1.0; manual exposure value or not */
1967     hi_u32  exp_value;            /* RW; Range:(0x0, 0xFFFFFFFF]; Format:32.0; manual exposure value */
1968 
1969     hi_isp_fswdr_mode fswdr_mode; /* RW; Range:[0, 2]; Format:2.0; FSWDR running mode */
1970     hi_bool wdr_quick;            /* RW; Range:[0, 1]; Format:1.0; WDR use delay strategy or not;
1971                                      If is true, WDR AE adjust will be faster */
1972 
1973     hi_u16  iso_cal_coef;     /* RW; Range:[0x0, 0xFFFF]; Format:8.8;
1974                                  The coefficient between Standard ISO and origin ISO (unit: times, 8bit precision) */
1975 } hi_isp_ae_attr;
1976 
1977 typedef struct {
1978     hi_isp_op_type exp_time_op_type;
1979     hi_isp_op_type a_gain_op_type;
1980     hi_isp_op_type d_gain_op_type;
1981     hi_isp_op_type ispd_gain_op_type;
1982 
1983     hi_u32 exp_time;   /* RW; Range:[0x0, 0xFFFFFFFF]; Format:32.0;
1984                           sensor exposure time (unit: us), it's related to the specific sensor */
1985     hi_u32 a_gain;     /* RW; Range:[0x400, 0xFFFFFFFF]; Format:22.10;
1986                           sensor analog gain (unit: times, 10bit precision), it's related to the specific sensor */
1987     hi_u32 d_gain;     /* RW; Range:[0x400, 0xFFFFFFFF]; Format:22.10;
1988                           sensor digital gain (unit: times, 10bit precision), it's related to the specific sensor */
1989     hi_u32 isp_d_gain; /* RW; Range:[0x400, 0x40000]; Format:22.10;
1990                           ISP digital gain(unit: times, 10bit precision), it's related to the ISP digital gain range */
1991 } hi_isp_me_attr;
1992 
1993 typedef struct {
1994     hi_bool         bypass;      /* RW; Range:[0, 1]; Format:1.0; */
1995     hi_isp_op_type  op_type;
1996     hi_u8     ae_run_interval;   /* RW; Range:[0x1, 0xFF]; Format:8.0; set the AE run interval */
1997     hi_bool   hist_stat_adjust;  /* RW; Range:[0, 1]; Format:1.0;
1998                                     HI_TRUE: 256 bin histogram statistic config will adjust when large red or blue
1999                                     area detected.
2000                                     HI_FALSE: 256 bin histogram statistic config will not change */
2001     hi_bool   ae_route_ex_valid;   /* RW; Range:[0, 1]; Format:1.0; use extend AE route or not */
2002     hi_isp_me_attr   manual_attr;
2003     hi_isp_ae_attr   auto_attr;
2004     hi_isp_prior_frame prior_frame; /* RW; Range:[0, 3]; Format:1.0; AE prior frame */
2005     hi_bool ae_gain_sep_cfg; /* RW; Range:[0, 1]; Format:1.0; long and short frame gain separately configure or not */
2006     hi_bool advance_ae; /* RW; Range:[0, 1]; Format:1.0;  open advance AE or not */
2007 } hi_isp_exposure_attr;
2008 
2009 typedef struct {
2010     hi_u32  int_time;         /* RW; Range:(0x0, 0xFFFFFFFF]; Format:32.0;
2011                                  sensor exposure time (unit: us), it's related to the specific sensor */
2012     hi_u32  sys_gain;         /* RW; Range:[0x400, 0xFFFFFFFF]; Format:22.10;
2013                                  system gain (unit: times, 10bit precision), it's related to the specific sensor and
2014                                  ISP Dgain range */
2015     hi_isp_iris_f_no iris_fno;  /* RW; Range:[0, 10]; Format:4.0;
2016                                    the F number of the iris's aperture, only support for Piris */
2017     hi_u32  iris_fno_lin;       /* RW; Range:[0x1, 0x400]; Format:32.0;
2018                                    the equivalent gain of F number of the iris's aperture, only support for Piris */
2019 } hi_isp_ae_route_node;
2020 
2021 typedef struct {
2022     hi_u32 total_num;     /* RW; Range:[0, 0x10]; Format:8.0; total node number of AE route */
2023     hi_isp_ae_route_node route_node[ISP_AE_ROUTE_MAX_NODES];
2024 } hi_isp_ae_route;
2025 
2026 typedef struct {
2027     hi_u32  int_time;     /* RW; Range:(0x0, 0xFFFFFFFF]; Format:32.0;
2028                              sensor exposure time (unit: us), it's related to the specific sensor */
2029     hi_u32  a_gain;       /* RW; Range:[0x400, 0x3FFFFF]; Format:22.10;
2030                              sensor analog gain (unit: times, 10bit precision), it's related to the specific sensor */
2031     hi_u32  d_gain;       /* RW; Range:[0x400, 0x3FFFFF]; Format:22.10;
2032                              sensor digital gain (unit: times, 10bit precision), it's related to the specific sensor */
2033     hi_u32  isp_d_gain;   /* RW; Range:[0x400, 0x40000]; Format:22.10;
2034                              ISP digital gain (unit: times, 10bit precision) */
2035     hi_isp_iris_f_no  iris_fno;  /* RW; Range:[0, 10]; Format:4.0;
2036                                     the F number of the iris's aperture, only support for Piris */
2037     hi_u32  iris_fno_lin;  /* RW; Range:[0x1, 0x400]; Format:32.0;
2038                               the equivalent gain of F number of the iris's aperture, only support for Piris */
2039 } hi_isp_ae_route_ex_node;
2040 
2041 typedef struct {
2042     hi_u32 total_num;       /* RW; Range:[0, 0x10]; Format:8.0; total node number of extend AE route */
2043     hi_isp_ae_route_ex_node route_ex_node[ISP_AE_ROUTE_EX_MAX_NODES];
2044 } hi_isp_ae_route_ex;
2045 
2046 typedef struct {
2047     hi_u32  exp_time;                   /* R; Range:[0x0, 0xFFFFFFFF]; Format:32.0; */
2048     hi_u32  short_exp_time;             /* R; Range:[0x0, 0xFFFFFFFF]; Format:32.0; */
2049     hi_u32  median_exp_time;            /* R; Range:[0x0, 0xFFFFFFFF]; Format:32.0; */
2050     hi_u32  long_exp_time;              /* R; Range:[0x0, 0xFFFFFFFF]; Format:32.0; */
2051     hi_u32  a_gain;                     /* R; Range:[0x400, 0xFFFFFFFF]; Format:22.10; */
2052     hi_u32  d_gain;                     /* R; Range:[0x400, 0xFFFFFFFF]; Format:22.10; */
2053     hi_u32  a_gain_sf;                  /* R; Range:[0x400, 0xFFFFFFFF]; Format:22.10; */
2054     hi_u32  d_gain_sf;                  /* R; Range:[0x400, 0xFFFFFFFF]; Format:22.10; */
2055     hi_u32  isp_d_gain;                 /* R; Range:[0x400, 0xFFFFFFFF]; Format:22.10; */
2056     hi_u32  exposure;                   /* R; Range:[0x40, 0xFFFFFFFF]; Format:26.6; */
2057     hi_bool exposure_is_max;            /* R; Range:[0, 1]; Format:1.0; */
2058     hi_s16  hist_error;                 /* R; Range:[-32768, 32767]; Format:16.0; */
2059     hi_u32  ae_hist1024_value[HIST_NUM]; /* R; Range:[0x0, 0xFFFFFFFF]; Format:32.0;
2060                                             1024 bins histogram for channel 1 */
2061 
2062     hi_u8  ave_lum;                 /* R; Range:[0x0, 0xFF]; Format:8.0; */
2063     hi_u32 lines_per500ms;          /* R; Range:[0x0, 0xFFFFFFFF]; Format:32.0; exposure lines per 500ms */
2064     hi_u32 piris_fno;               /* R; Range:[0x0, 0x400]; Format:32.0; */
2065     hi_u32 fps;                     /* R; Range:[0x0, 0xFFFFFFFF]; Format:32.0; actual fps */
2066     hi_u32 iso;                     /* R; Range:[0x64, 0xFFFFFFFF]; Format:32.0; */
2067     hi_u32 isosf;                   /* R; Range:[0x64, 0xFFFFFFFF]; Format:32.0; */
2068     hi_u32 iso_calibrate;           /* R; Range:[0x0, 0xFFFFFFFF]; Format:32.0; */
2069     hi_u32 ref_exp_ratio;           /* R; Range:[0x40, 0x4000]; Format:26.6; */
2070     hi_u16 wdr_exp_coef;            /* R; Range:[0x0, 0x400]; Format:6.10; 0x400 means 1 times */
2071     hi_u32 first_stable_time;       /* R; Range:[0x0, 0xFFFFFFFF]; Format:32.0; AE first stable time for quick start */
2072     hi_u32 quick_star_iso;          /* R; Range:[0x64, 0xFFFFFFFF]; Format:32.0; */
2073     hi_isp_ae_route ae_route;       /* R; Actual AE route */
2074     hi_isp_ae_route_ex ae_route_ex; /* R; Actual AE route_ex */
2075     hi_isp_ae_route ae_route_sf;    /* R; Actual AE route_sf */
2076     hi_isp_ae_route_ex ae_route_sf_ex; /* R; Actual AE route_sf_ex */
2077 } hi_isp_exp_info;
2078 
2079 typedef struct {
2080     hi_u32 reg_addr;
2081     hi_u32 reg_value;
2082 } hi_isp_exp_param_reg;
2083 
2084 typedef struct {
2085     hi_u32 tar_fps;
2086     hi_u32 tar_isp_dgain; /* 10 bit */
2087     hi_isp_exp_param_reg time_reg[10]; /* default 10 */
2088     hi_isp_exp_param_reg again_reg[10]; /* default 10 */
2089     hi_isp_exp_param_reg dgain_reg[10]; /*  default 10 */
2090 } hi_isp_exp_conv_param;
2091 
2092 typedef struct {
2093     hi_isp_op_type exp_ratio_type;   /* RW; Range:[0, 1]; Format:1.0;
2094                                         OP_TYPE_AUTO: The ExpRatio used in ISP is generated by firmware;
2095                                         OP_TYPE_MANUAL: The ExpRatio used in ISP is set by u32ExpRatio */
2096     hi_u32 exp_ratio[EXP_RATIO_NUM]; /* RW; Range:[0x40, 0xFFF]; Format:26.6; 0x40 means 1 times.
2097                                         When enExpRatioType is OP_TYPE_AUTO, u32ExpRatio is invalid.
2098                                         When enExpRatioType is OP_TYPE_MANUAL, u32ExpRatio is quotient of
2099                                         long exposure time / short exposure time. */
2100     hi_u32 exp_ratio_max;           /* RW; Range:[0x40, 0x4000]; Format:26.6; 0x40 means 1 times.
2101                                        When enExpRatioType is OP_TYPE_AUTO, u32ExpRatioMax is max(upper limit) of
2102                                        ExpRatio generated by firmware.
2103                                        When enExpRatioType is OP_TYPE_MANUAL, u32ExpRatioMax is invalid. */
2104     hi_u32 exp_ratio_min;          /* RW; Range:[0x40, 0x4000]; Format:26.6; limited Range:[0x40, u32ExpRatioMax],
2105                                       0x40 means 1 times.
2106                                       When enExpRatioType is OP_TYPE_AUTO, u32ExpRatioMin is min(lower limit) of
2107                                       ExpRatio generated by firmware.
2108                                       When enExpRatioType is OP_TYPE_MANUAL, u32ExpRatioMin is invalid. */
2109     hi_u16 tolerance;              /* RW; Range:[0x0, 0xFF]; Format:8.0;et the dynamic range tolerance.
2110                                       Format: unsigned 6.2-bit fixed-point. 0x4 means 1dB. */
2111     hi_u16 speed;                  /* RW; Range:[0x0, 0xFF]; Format:8.0; exposure ratio adjust speed */
2112     hi_u16 ratio_bias;             /* RW; Range:[0x0, 0xFFFF]; Format:16.0; exposure ratio bias */
2113     hi_u16 high_light_target;      /* RW; Range:[0x0, 0x400]; Format:10.0; the high light target. */
2114     hi_u16 exp_coef_min;       /* RW; Range:[0x0, 0x400]; Format:6.10; 0x400 means 1 times; min exposure coefficient */
2115 } hi_isp_wdr_exposure_attr;
2116 
2117 typedef struct {
2118     hi_isp_op_type exp_hdr_lv_type;   /* RW; Range:[0, 1]; Format:1.0;
2119                                          OP_TYPE_AUTO: The ExpHDRLv used in ISP is generated by firmware;
2120                                          OP_TYPE_MANUAL: The ExpHDRLv used in ISP is set by u32ExpHDRLv */
2121     hi_u32 exp_hdr_lv;             /* RW; Range:[0x40, 0x400]; Format:26.6; 0x40 means 1 times.
2122                                       When enExpHDRLvType is OP_TYPE_AUTO, u32ExpHDRLv is invalid.
2123                                       When enExpHDRLvType is OP_TYPE_MANUAL, u32ExpHDRLv is the quotient of
2124                                       exposure / linear exposure. */
2125     hi_u32 exp_hdr_lv_max;         /* RW; Range:[0x40, 0x400]; Format:26.6; 0x40 means 1 times.
2126                                       When enExpHDRLvType is OP_TYPE_AUTO, u32ExpHDRLvMax is max(upper limit) of
2127                                       ExpHDRLv generated by firmware.
2128                                       When enExpHDRLvType is OP_TYPE_MANUAL, u32ExpHDRLvMax is invalid. */
2129     hi_u32 exp_hdr_lv_min;         /* RW; Range:[0x40, 0x400]; Format:26.6; limited range:[0x40, u32ExpHDRLvMax],
2130                                       0x40 means 1 times.
2131                                       When enExpHDRLvType is OP_TYPE_AUTO, u32ExpHDRLvMin is min(lower limit) of
2132                                       ExpHDRLv generated by firmware.
2133                                       When enExpHDRLvType is OP_TYPE_MANUAL, u32ExpHDRLvMin is invalid. */
2134     hi_u32 exp_hdr_lv_weight;      /* RW; Range:[0x0, 0x400]; Format:16.0; exposure HDR level weight. */
2135 } hi_isp_hdr_exposure_attr;
2136 
2137 typedef struct {
2138     hi_bool enable;               /* RW; Range:[0, 1]; Format:1.0; smart ae enable or not */
2139     hi_bool ir_mode;              /* RW; Range:[0, 1]; Format:1.0; smart ae IR mode or not */
2140     hi_isp_op_type smart_exp_type;  /* RW; Range:[0, 1]; Format:1.0;
2141                                        OP_TYPE_AUTO: The ExpCoef used in ISP is  generated by firmware;
2142                                        OP_TYPE_MANUAL: The ExpCoef used in ISP is set by u32ExpCoef */
2143     hi_u16  exp_coef;             /* RW; Range:[0x0, 0xFFFF]; Format:6.10; 0x400 means 1 times.
2144                                      When enExpHDRLvType is OP_TYPE_AUTO, u32ExpCoef is invalid.
2145                                      When enExpHDRLvType is OP_TYPE_MANUAL, u32ExpCoef is the quotient of exposure. */
2146     hi_u8   luma_target;          /* RW; Range:[0x0, 0xFF]; Format:8.0; luma target of smart ae. */
2147     hi_u16  exp_coef_max;         /* RW; Range:[0x0, 0xFFFF]; Format:6.10; 0x400 means 1 times.
2148                                      When enExpHDRLvType is OP_TYPE_AUTO, u32ExpCoefvMax is max(upper limit) of ExpCoef
2149                                      generated by firmware.
2150                                      When enExpHDRLvType is OP_TYPE_MANUAL, u32ExpCoefMax is invalid. */
2151     hi_u16  exp_coef_min;         /* RW; Range:[0x0, 0xFFFF]; Format:6.10; 0x400 means 1 times.
2152                                      When enExpHDRLvType is OP_TYPE_AUTO, u32ExpCoefMax is min(lower limit) of ExpCoef
2153                                      generated by firmware.
2154                                      When enExpHDRLvType is OP_TYPE_MANUAL, u32ExpCoefMin is invalid. */
2155     hi_u8   smart_interval;       /* RW; Range:[0x1, 0xFF]; Format:8.0; smart ae run interval */
2156     hi_u8   smart_speed;          /* RW; Range:[0x0, 0xFF]; Format:8.0; smart ae adjust step */
2157     hi_u16  smart_delay_num;      /* RW; Range:[0x0, 0x400]; Format:16.0; smart ae adjust delay frame num */
2158 } hi_isp_smart_exposure_attr;
2159 
2160 /* AWB structs */
2161 /*
2162  * Defines the AWB online calibration type
2163  * u16AvgRgain: the avg value of Rgain after online calibration
2164  * u16AvgBgain: the avg value of Bgain after online calibration
2165  */
2166 typedef struct {
2167     hi_u16 avg_r_gain;
2168     hi_u16 avg_b_gain;
2169 } hi_isp_awb_calibration_gain;
2170 
2171 typedef ISP_AWB_ALG_TYPE_E      hi_isp_awb_alg_type;
2172 typedef ISP_AWB_MULTI_LS_TYPE_E hi_isp_awb_multi_ls_type;
2173 typedef ISP_AWB_INDOOR_OUTDOOR_STATUS_E hi_isp_awb_indoor_outdoor_status;
2174 
2175 /* Defines the AWB gain range */
2176 typedef struct {
2177     hi_bool enable;
2178     hi_isp_op_type   op_type;
2179 
2180     hi_u16 high_rg_limit; /* RW; Range:[0x0, 0xFFF]; Format:4.8;
2181                              in Manual Mode, user define the Max Rgain of High Color Temperature */
2182     hi_u16 high_bg_limit; /* RW; Range:[0x0, 0xFFF]; Format:4.8;
2183                              in Manual Mode, user define the Min Bgain of High Color Temperature */
2184     hi_u16 low_rg_limit;  /* RW; Range:[0x0, 0xFFF]; Format:4.8; limited range:[0x0, u16HighRgLimit),
2185                              in Manual Mode, user define the Min Rgain of Low Color Temperature */
2186     hi_u16 low_bg_limit;  /* RW; Range:[0, 0xFFF]; Format:4.8; limited Range:(u16HighBgLimit, 0xFFF],
2187                              in Manual Mode, user define the Max Bgain of Low Color Temperature */
2188 } hi_isp_awb_ct_limit_attr;
2189 
2190 typedef struct {
2191     hi_bool enable;                 /* RW; Range:[0, 1]; Format:1.0; Outdoor/Indoor scenario determination enable */
2192     hi_isp_op_type   op_type;
2193     hi_isp_awb_indoor_outdoor_status outdoor_status; /* RW;User should config indoor or outdoor status in Manual Mode */
2194     hi_u32 out_thresh;         /* RW;Format:32.0;shutter time(in us) to judge indoor or outdoor */
2195     hi_u16 low_start;          /* RW;Format:16.0;5000K is recommend */
2196     hi_u16 low_stop;           /* RW;Format:16.0;limited range:(0, u16LowStart),
2197                                   4500K is recommend, should be smaller than u8LowStart */
2198     hi_u16 high_start;         /* RW;Format:16.0;limited range:(u16LowStart, 0xFFFF],
2199                                   6500K is recommend, shoule be larger than u8LowStart */
2200     hi_u16 high_stop;          /* RW;Format:16.0;limited range:(u16HighStart, 0xFFFF],
2201                                   8000K is recommend, should be larger than u8HighStart */
2202     hi_bool green_enhance_en;  /* RW; Range:[0, 1]; Format:1.0;If this is enabled, Green channel will be enhanced
2203                                   based on the ratio of green plant */
2204     hi_u8   out_shift_limit;   /* RW; Range:[0, 0xFF]; Format:8.0;Max white point zone distance to Planckian Curve */
2205 } hi_isp_awb_in_out_attr;
2206 
2207 typedef struct {
2208     hi_bool enable;                         /* RW; Range:[0, 1]; Format:1.0;
2209                                                If enabled, statistic parameter cr, cb will change according to iso */
2210 
2211     hi_u16  cr_max[ISP_AUTO_ISO_STRENGTH_NUM]; /* RW; Range:[0x0, 0xFFF]; au16CrMax[i] >= au16CrMin[i] */
2212     hi_u16  cr_min[ISP_AUTO_ISO_STRENGTH_NUM]; /* RW; Range:[0x0, 0xFFF] */
2213     hi_u16  cb_max[ISP_AUTO_ISO_STRENGTH_NUM]; /* RW; Range:[0x0, 0xFFF]; au16CbMax[i] >= au16CbMin[i] */
2214     hi_u16  cb_min[ISP_AUTO_ISO_STRENGTH_NUM]; /* RW; Range:[0x0, 0xFFF] */
2215 } hi_isp_awb_cbcr_track_attr;
2216 
2217 /* Defines the parameters of the luminance histogram statistics for white balance */
2218 typedef struct {
2219     hi_bool enable;                        /* RW; Range:[0, 1]; Format:1.0;
2220                                               If enabled, zone weight to awb is combined with zone luma */
2221     hi_isp_op_type   op_type;              /* In auto mode, the weight distribution follows Gaussian distribution */
2222     hi_u8   hist_thresh[AWB_LUM_HIST_NUM]; /* RW; Range:[0x0, 0xFF]; Format:8.0;
2223                                               In manual mode, user define luma thresh, thresh[0] is 0,
2224                                               thresh[5] is 0xFF,  thresh[i] greater or equal to  thresh[i-1] */
2225     hi_u16  hist_wt[AWB_LUM_HIST_NUM];     /* RW; Range:[0x0, 0xFFFF]; Format:16.0;
2226                                               user can define luma weight in both manual and auto mode. */
2227 } hi_isp_awb_lum_histgram_attr;
2228 
2229 /* Defines the information about a separate illuminant */
2230 typedef struct {
2231     hi_u16 white_r_gain;  /* RW;Range:[0x0, 0xFFF]; Format:4.8; G/R of White points at this light source */
2232     hi_u16 white_b_gain;  /* RW;Range:[0x0, 0xFFF]; Format:4.8; G/B of White points at this light source */
2233     hi_u16 exp_quant;     /* RW;shutter time * again * dgain >> 4, Not support Now */
2234     hi_u8  light_status;  /* RW;Range:[0,2]; Format:2.0; idle  1:add light source  2:delete sensitive color */
2235     hi_u8  radius;        /* RW;Range:[0x0, 0xFF];  Format:8.0; Radius of light source, */
2236 } hi_isp_awb_extra_light_source_info;
2237 
2238 /* extended AWB attributes */
2239 typedef struct {
2240     hi_u8  tolerance;        /* RW; Range:[0x0, 0xFF]; Format:8.0; AWB adjust tolerance */
2241     hi_u8  zone_radius;      /* RW; Range:[0x0, 0xFF]; Format:8.0; radius of AWB blocks */
2242     hi_u16 curve_l_limit;    /* RW; Range:[0x0, 0x100]; Format:9.0; Left limit of AWB Curve,
2243                                 recomend for indoor 0xE0, outdoor 0xE0 */
2244     hi_u16 curve_r_limit;    /* RW; Range:[0x100, 0xFFF]; Format:12.0; Right Limit of AWB Curve,
2245                                 recomend for indoor 0x130, outdoor 0x120 */
2246 
2247     hi_bool  extra_light_en; /* RW; Range:[0, 1]; Format:1.0; Enable special light source function */
2248     hi_isp_awb_extra_light_source_info  light_info[AWB_LS_NUM];
2249     hi_isp_awb_in_out_attr              in_or_out;
2250 
2251     hi_bool multi_light_source_en;           /* RW; Range:[0, 1]; Format:1.0; If enabled, awb will do special process
2252                                                 in multi light source enviroment */
2253     hi_isp_awb_multi_ls_type multi_ls_type;  /* Saturation or CCM Tunning */
2254     hi_u16  multi_ls_scaler;                 /* RW; Range:[0x0, 0x100]; Format:12.0;
2255                                                 In saturation type, it means the max saturation it can achieve,
2256                                                 in ccm type, it means the strenght of multi process. */
2257     hi_u16  multi_ct_bin[AWB_MULTI_CT_NUM];  /* RW; Range:[0, 0XFFFF]; Format:16.0;
2258                                                 AWB Support divide the color temperature range by 8 bins */
2259     hi_u16  multi_ct_wt[AWB_MULTI_CT_NUM];   /* RW; Range:[0x0, 0x400];Weight for different color temperature,
2260                                                 same value of 8 means CT weight does't work, */
2261 
2262     hi_bool fine_tun_en;       /* RW; Range:[0x0, 0x1]; Format:1.0;If enabled, skin color scene will be optimized */
2263     hi_u8   fine_tun_strength; /* RW; Range:[0x0, 0xFF]; Format:8.0;
2264                                   larger value means better performance of skin color scene,
2265                                   but will increase error probability in low color temperature scene */
2266 } hi_isp_awb_attr_ex;
2267 
2268 typedef struct {
2269     hi_bool enable;               /* RW; Range:[0x0, 0x1]; Format:1.0;If AWB is disabled, static wb gain will be used,
2270                                      otherwise auto wb gain will be used */
2271 
2272     hi_u16 ref_color_temp;        /* RW; Range:[0x0, 0xFFFF]; Format:16.0; Calibration Information */
2273     hi_u16 static_wb[ISP_BAYER_CHN_NUM];   /* RW; Range:[0x0, 0xFFF]; Format:12.0;Calibration Information */
2274     hi_s32 curve_para[AWB_CURVE_PARA_NUM]; /* RW; Format:32.0;Calibration Information,
2275                                               limited Range:as32CurvePara[3] != 0, as32CurvePara[4]==128 */
2276 
2277     hi_isp_awb_alg_type       alg_type;
2278 
2279     hi_u8  rg_strength;     /* RW; Range: [0x0, 0xFF]; Format:8.0; AWB Strength of R Channel */
2280     hi_u8  bg_strength;     /* RW; Range: [0x0, 0xFF]; Format:8.0; AWB Strength of B Channel */
2281     hi_u16 speed;           /* RW; Range: [0x0, 0xFFF]; Format:12.0; Convergence speed of AWB  */
2282     hi_u16 zone_sel;        /* RW; Range: [0, 255]; Format:8.0; A value of 0 or 0xFF means global AWB,
2283                                A value between 0 and 0xFF means zoned AWB */
2284     hi_u16 high_color_temp; /* RW; Range: [0, 65535]; Format:16.0; AWB max temperature, Recommended: [8500, 10000] */
2285     hi_u16 low_color_temp;  /* RW; Range: [0, 65535]; Format:16.0; Limited Range:[0, u16HighColorTemp),
2286                                AWB min temperature, Recommended: [2000, 2500] */
2287     hi_isp_awb_ct_limit_attr ct_limit;
2288     hi_bool shift_limit_en;  /* RW; Range: [0, 1]; Format:1.0; If enabled, when the statistic information is out of
2289                                 range, it should be project back */
2290     hi_u8  shift_limit;      /* RW; Range: [0x0, 0xFF];  Format:8.0; planckian curve range, Recommended: [0x30, 0x50] */
2291     hi_bool gain_norm_en;    /* RW; Range: [0, 1]; Format:1.0; if enabled, the min of RGB gain is fixed. */
2292     hi_bool natural_cast_en; /* RW, Range: [0, 1]; Format:1.0; if enabled, the color performance will be natural in
2293                                 lowlight and low color temperature */
2294 
2295     hi_isp_awb_cbcr_track_attr cb_cr_track;
2296     hi_isp_awb_lum_histgram_attr luma_hist;
2297     hi_bool awb_zone_wt_en;      /* RW, Range: [0, 1]; Format:1.0; if enabled, user can set weight for each zones */
2298     hi_u8   zone_wt[(AWB_ZONE_ORIG_ROW) * (AWB_ZONE_ORIG_COLUMN)];   /* RW; Range: [0, 255]; Format:8.0;Zone Wt Table */
2299 } hi_isp_awb_attr;
2300 
2301 typedef struct {
2302     hi_s16 kelvin;   /* RW;Range:[-32768, 32767];Kelvin */
2303     hi_s16 wbr;      /* RW;Range:[-32768, 32767];WBR value */
2304     hi_s16 wbb;      /* RW;Range:[-32768, 32767];WBB value */
2305 } hi_isp_spec_awb_bbl_tbl;
2306 
2307 typedef struct {
2308     hi_s16 kelvin; /* RW;Range:[-32768, 32767];kevin */
2309     hi_s16 dbb;    /* RW;Range:[-32768, 32767];DeltaBlackBody */
2310 } hi_isp_spec_awb_kelvin_dbb_map;
2311 
2312 typedef struct {
2313     hi_s32    r_gain; /* RW;Range:[-2147483648, 2147483647]; RgainValue */
2314     hi_s32    b_gain; /* RW;Range:[-2147483648, 2147483647]; BgainValue */
2315 } hi_isp_speckcwb;
2316 
2317 typedef struct {
2318     hi_s16    r_gain; /* RW;Range:[-32768, 32767]; RgainValue(16bit) */
2319     hi_s16    b_gain; /* RW;Range:[-32768, 32767]; BgainValue(16bit) */
2320 } hi_isp_speckcwbs16;
2321 
2322 typedef struct {
2323     hi_s16    bv;          /* RW;Range:[-32768, 32767]; The center value of the Bv value targeted by this table. */
2324     hi_u8     fact_tbl[SPECAWB_FACTTBL_SIZE][SPECAWB_FACTTBL_SIZE];  /* RW;Range:[0, 0xFF]; Weight for light source
2325                                                                         detection. */
2326 } hi_isp_spec_awb_facttbl_element;
2327 
2328 typedef struct {
2329     hi_isp_speckcwb     wb_center;        /* RW;WB gain value at the center of the table: The table index is calculated
2330                                              as a relative value from this gain. */
2331     hi_isp_speckcwb     wb_min;           /* RW;Minimum value of WB gain that the table covers. */
2332     hi_isp_speckcwb     wb_max;           /* RW;Maximum value of WB gain that the table covers. */
2333     hi_isp_speckcwb     log_fact;         /* RW;Range covered by the table: 1/exp(stLogFact) to exp(stLogFact).
2334                                              For example, if it is 1.0, WBDelta will be 1/e to e.
2335                                              However, e = 2.71828 ... (base of natural logarithm) */
2336     hi_s32              limit_fact_min;   /* RW;Range:[0, s32LimitFactMax];AWB statics threshold value:
2337                                              minimum threshold value of ratio to pixel maximum value. */
2338     hi_s32              limit_fact_max;   /* RW;Range:[s32LimitFactMin, 0xFFFF];AWB statics threshold value:
2339                                              maximum threshold value of ratio to pixel maximum value. */
2340     hi_s32              limit_fact_limit; /* RW;Range:[0x600, 0x4000];AWB statics limit value:
2341                                              ratio to (pixel maximum value * s32LimitFactMax) */
2342     hi_s32              fact_offset;      /* RW;Range:[0, 0x800];
2343                                              The offset value of the weight when calculating the AWB statics. */
2344     hi_s32              b_fact;           /* RW;Range:[0x399, 0x500];
2345                                              The value of specular weight when calculating the AWB statics. */
2346     hi_s32              a_cnt_min;        /* RW;Range:[0, 0x20];Threshold for block adoption.
2347                                              If the integrated value of the AWB statics is less than m_ACntMin,
2348                                              the block is ignored. */
2349     hi_isp_speckcwb     wb_neutral;       /* RW;WB gain returned when AWB calculation can not be performed. */
2350     hi_u8               last_is_flash;    /* RW;Range:[1]: The last table is used for flash.
2351                                              0: Used for unknown Bv value. */
2352     hi_s16              bv_flash_e_limit; /* RW;Range:[-32768, 32767];Threshold of Bv value before strobe lighting when
2353                                              using table for strobe. If bLastIsFlash == TRUE and the Bv value before
2354                                              strobe flash is less than this value, use the table for strobe. */
2355     hi_s32              a_percent;        /* RW;Range:[0, 100];A value percent of the WB statics */
2356     hi_isp_speckcwbs16  wb_cnv_tbl[SPECAWB_FACTTBL_SIZE][SPECAWB_FACTTBL_SIZE]; /* RW; WB gain conversion table
2357                                                                              (incomplete chromatic adaptation table) */
2358     hi_u8               element_num;                /* RW; Range:[7];Number of connected ISP_SPECAWB_FACTTBL_ELEMENT */
2359     hi_isp_spec_awb_facttbl_element fact_element[SPECAWB_FACTTBL_ELMNUM];       /* RW; Weight Table */
2360     hi_isp_spec_awb_kelvin_dbb_map  kelvin_dbb_tbl[SPECAWB_FACTTBL_SIZE][SPECAWB_FACTTBL_SIZE]; /* RW;KelvinDbb table */
2361     hi_isp_spec_awb_bbl_tbl         black_body_tbl[SPECAWB_BBL_SIZE];                           /* RW;BlackBody table */
2362     hi_u16                          fno;       /* RW; Range:[10, 100];F number of the len,F1.4=14,F2.8=28,F36 =360... */
2363 } hi_isp_spec_awb_attr;
2364 
2365 typedef struct {
2366     hi_s16 blend_high_bv_thr;          /* RW; Range: [-32768, 32767]; High Bv threshold for inner blending function */
2367     hi_u16 blend_high_bv_wt;           /* RW; Range: [0, 2048]; High Bv  weight for inner blending function */
2368     hi_s16 blend_low_bv_thr;           /* RW; Range: [-32768, blend_high_bv_thr);
2369                                           Low Bv threshold for inner blending function */
2370     hi_u16 blend_low_bv_wt;            /* RW; Range: [0, 2048]; Low Bv  weight for inner blending function */
2371 } hi_isp_spec_awb_control;
2372 
2373 typedef struct {
2374     hi_s32 src_kelvin;    /* RW;Range:[-2147483648, 2147483647]; Source kelvin */
2375     hi_s32 dst_kelvin;    /* RW;Range:[-2147483648, 2147483647]; Destination kelvin */
2376 } hi_isp_spec_awb_caa_conversion;
2377 
2378 typedef struct {
2379     hi_u8   enable;       /* RW;Range:[0,1]; lut enable */
2380     hi_s16  bv;           /* RW;Range:[-32768, 32767]; Bv value */
2381     hi_isp_spec_awb_caa_conversion kelvin_con[SPECAWB_KEVIN_CONVER_MAX_NUM];
2382     hi_isp_speckcwbs16 wb_cnv_tbl[SPECAWB_FACTTBL_SIZE][SPECAWB_FACTTBL_SIZE];
2383 } hi_isp_spec_awb_caa_tbl;
2384 
2385 typedef struct {
2386     hi_isp_spec_awb_caa_tbl control[SPECAWB_MAX_CAA_NUM];
2387 } hi_isp_spec_awb_caa_control;
2388 
2389 typedef struct {
2390     hi_u16 r_gain;            /* RW; Range: [0x0, 0xFFF]; Format:4.8; Multiplier for R  color channel  */
2391     hi_u16 gr_gain;           /* RW; Range: [0x0, 0xFFF]; Format:4.8; Multiplier for Gr color channel */
2392     hi_u16 gb_gain;           /* RW; Range: [0x0, 0xFFF]; Format:4.8; Multiplier for Gb color channel */
2393     hi_u16 b_gain;            /* RW; Range: [0x0, 0xFFF]; Format:4.8; Multiplier for B  color channel */
2394 } hi_isp_mwb_attr;
2395 
2396 typedef ISP_AWB_ALG_E hi_isp_awb_alg;
2397 
2398 typedef struct {
2399     hi_bool bypass;              /* RW; Range: [0, 1];  Format:1.0; If enabled, awb will be bypassed */
2400     hi_u8   awb_run_interval;    /* RW; Range: [0x1, 0xFF];  Format:8.0; set the AWB run interval */
2401     hi_isp_op_type   op_type;
2402     hi_isp_mwb_attr  manual_attr;
2403     hi_isp_awb_attr  auto_attr;
2404     hi_isp_awb_alg   alg_type;
2405 } hi_isp_wb_attr;
2406 
2407 typedef struct {
2408     hi_bool sat_en;               /* RW; Range: [0, 1]; Format:1.0;
2409                                      If bSatEn=1, the active CCM = SatMatrix * ManualMatrix,
2410                                      else tha active CCM =  ManualMatrix */
2411     hi_u16  ccm[CCM_MATRIX_SIZE]; /* RW; Range: [0x0, 0xFFFF]; Format:8.8; Manul CCM matrix, */
2412 } hi_isp_color_matrix_manual;
2413 
2414 typedef struct {
2415     hi_u16 color_temp;           /* RW; Range: [500, 30000]; Format:16.0; the current color temperature */
2416     hi_u16 ccm[CCM_MATRIX_SIZE]; /* RW; Range: [0x0, 0xFFFF]; Format:8.8;CCM matrixes for different color temperature */
2417 } hi_isp_color_matrix_param;
2418 
2419 typedef struct {
2420     hi_bool iso_act_en;    /* RW; Range: [0, 1]; Format:1.0; if enabled, CCM will bypass in low light */
2421     hi_bool temp_act_en;   /* RW; Range: [0, 1]; Format:1.0; if enabled, CCM will bypass when color temperature is
2422                               larger than 8000K or less than 2500K */
2423     hi_u16  ccm_tab_num;   /* RW; Range: [0x3, 0x7]; Format:16.0; The number of CCM matrixes */
2424     hi_isp_color_matrix_param ccm_tab[CCM_MATRIX_NUM];
2425 } hi_isp_color_matrix_auto;
2426 
2427 typedef struct {
2428     hi_isp_op_type op_type;
2429     hi_isp_color_matrix_manual manual_attr;
2430     hi_isp_color_matrix_auto   auto_attr;
2431 } hi_isp_color_matrix_attr;
2432 
2433 typedef struct {
2434     hi_u8 saturation;           /* RW; Range: [0, 0xFF]; Format:8.0; set the manual saturation of CCM */
2435 } hi_isp_saturation_manual;
2436 
2437 typedef struct {
2438     hi_u8 sat[ISP_AUTO_ISO_STRENGTH_NUM];           /* RW; Range: [0, 0xFF]; should be decreased with increasing ISO */
2439 } hi_isp_saturation_auto;
2440 
2441 typedef struct {
2442     hi_isp_op_type op_type;
2443     hi_isp_saturation_manual manual_attr;
2444     hi_isp_saturation_auto   auto_attr;
2445 } hi_isp_saturation_attr;
2446 
2447 typedef struct {
2448     hi_u16 red_cast_gain;        /* RW; Range: [0x100, 0x180]; Format:4.8; R channel gain after CCM */
2449     hi_u16 green_cast_gain;      /* RW; Range: [0x100, 0x180]; Format:4.8; G channel gain after CCM */
2450     hi_u16 blue_cast_gain;       /* RW; Range: [0x100, 0x180]; Format:4.8; B channel gain after CCM */
2451 } hi_isp_color_tone_attr;
2452 
2453 typedef struct {
2454     hi_u16 r_gain;               /* R; Range: [0x0, 0xFFF]; Format:8.8;AWB result of R color channel */
2455     hi_u16 gr_gain;              /* R; Range: [0x0, 0xFFF]; Format:8.8; AWB result of Gr color channel */
2456     hi_u16 gb_gain;              /* R; Range: [0x0, 0xFFF]; Format:8.8; AWB result of Gb color channel */
2457     hi_u16 b_gain;               /* R; Range: [0x0, 0xFFF]; Format:8.8; AWB result of B color channel */
2458     hi_u16 saturation;           /* R; Range: [0x0, 0xFF];Format:8.0;Current saturation */
2459     hi_u16 color_temp;           /* R; Range: [0x0, 0xFFFF];Format:16.0;Detect color temperature, maybe out of color
2460                                     cemeprature range */
2461     hi_u16 ccm[CCM_MATRIX_SIZE]; /* R; Range: [0x0, 0xFFFF];Format:16.0;Current color correction matrix */
2462 
2463     hi_u16 ls0_ct;               /* R; Range: [0x0, 0xFFFF];Format:16.0;color tempearture of primary light source */
2464     hi_u16 ls1_ct;               /* R; Range: [0x0, 0xFFFF];Format:16.0;color tempearture of secondary light source */
2465     hi_u16 ls0_area;             /* R; Range: [0x0, 0xFF];Format:8.0;area of primary light source */
2466     hi_u16 ls1_area;             /* R; Range: [0x0, 0xFF];Format:8.0;area of secondary light source */
2467     hi_u8  multi_degree;         /* R; Range: [0x0, 0xFF];0 means uniform light source, larger value means multi
2468                                     light source */
2469     hi_u16 active_shift;         /* R; Range;[0x0,0xFF] */
2470     hi_u32 first_stable_time;    /* R, Range: [0x0, 0xFFFFFFFF];Format:32.0;AWB first stable frame number */
2471     hi_isp_awb_indoor_outdoor_status in_out_status;   /* R; indoor or outdoor status */
2472     hi_s16 bv;                                   /* R; Range;[-32768, 32767]; Bv value */
2473 } hi_isp_wb_info;
2474 
2475 typedef struct {
2476     hi_bool is_ir_mode;
2477     hi_u32 exp_time;
2478     hi_u32 a_gain;
2479     hi_u32 d_gain;
2480     hi_u32 ispd_gain;
2481     hi_u32 exposure;
2482     hi_u32 init_iso;
2483     hi_u32 lines_per500ms;
2484     hi_u32 piris_fno;
2485     hi_u16 wb_r_gain;
2486     hi_u16 wb_g_gain;
2487     hi_u16 wb_b_gain;
2488     hi_u16 sample_r_gain;
2489     hi_u16 sample_b_gain;
2490     hi_u16 init_ccm[CCM_MATRIX_SIZE];
2491     hi_bool ae_route_ex_valid;
2492     hi_bool quick_start_en;
2493     hi_isp_ae_route ae_route;
2494     hi_isp_ae_route_ex ae_route_ex;
2495     hi_isp_ae_route ae_route_sf;
2496     hi_isp_ae_route_ex ae_route_sf_ex;
2497 } hi_isp_init_attr;
2498 
2499 /* AF structs */
2500 typedef struct {
2501     hi_s32 distance_max; /* RW;the focuse range */
2502     hi_s32 distance_min;
2503     hi_u8  weight[AF_ZONE_ROW][AF_ZONE_COLUMN]; /* RW;weighting table */
2504 } hi_isp_af_attr;
2505 
2506 typedef struct {
2507     hi_s32 default_speed;     /* RW;1,default speed(unit:m/s).(onvif) */
2508 } hi_isp_mf_attr;
2509 
2510 typedef struct {
2511     hi_isp_op_type  op_type;
2512     hi_isp_mf_attr  manual_attr;
2513     hi_isp_af_attr  auto_attr;
2514 } hi_isp_focus_attr;
2515 
2516 typedef DNG_CFALAYOUT_TYPE_E hi_isp_dng_cfa_layout_type;
2517 
2518 typedef struct {
2519     hi_s32 numerator;   /* represents the numerator of a fraction, */
2520     hi_s32 denominator; /* the denominator. */
2521 } hi_isp_dng_srational;
2522 
2523 typedef struct {
2524     hi_u16 blc_repeat_rows;
2525     hi_u16 blc_repeat_cols;
2526 } hi_isp_dng_blc_repeat_dim;
2527 
2528 typedef struct {
2529     hi_isp_dng_srational default_scale_h;
2530     hi_isp_dng_srational default_scale_v;
2531 } hi_isp_dng_default_scale;
2532 
2533 typedef struct {
2534     hi_u16 repeat_pattern_dim_rows;
2535     hi_u16 repeat_pattern_dim_cols;
2536 } hi_isp_dng_repeat_pattern_dim;
2537 
2538 /* Defines the structure of dng raw format. */
2539 typedef struct {
2540     hi_u8 bits_per_sample;                      /* RO;Format:8.0; Indicate the bit numbers of raw data */
2541     hi_u8 cfa_plane_color[CFACOLORPLANE];       /* RO;Format:8.0; Indicate the planer numbers of raw data;
2542                                                    0:red 1:green 2: blue */
2543     hi_isp_dng_cfa_layout_type cfa_layout;      /* RO;Range:[1,9]; Describes the spatial layout of the CFA */
2544     hi_isp_dng_blc_repeat_dim blc_repeat_dim;   /* Specifies repeat pattern size for the BlackLevel */
2545     hi_u32 white_level;                         /* RO;Format:32.0; Indicate the WhiteLevel of the raw data */
2546     hi_isp_dng_default_scale default_scale;     /* Specifies the default scale factors for each direction to convert
2547                                                    the image to square pixels */
2548     hi_isp_dng_repeat_pattern_dim cfa_repeat_pattern_dim; /* Specifies the pixel number of repeat color planer in
2549                                                              each direction */
2550     hi_u8 cfa_pattern[ISP_BAYER_CHN];        /* RO;Format:8.0; Indicate the bayer start order; 0:red 1:green 2: blue */
2551 } hi_isp_dng_raw_format;
2552 
2553 /* Defines the structure of dng image static infomation. read only */
2554 typedef struct {
2555     hi_isp_dng_raw_format dng_raw_format;
2556     hi_isp_dng_srational color_matrix1[CCM_MATRIX_SIZE];       /* defines a transformation matrix that converts XYZ
2557                                                                   values to reference camera native color space values,
2558                                                                   under the first calibration illuminant. */
2559     hi_isp_dng_srational color_matrix2[CCM_MATRIX_SIZE];       /* defines a transformation matrix that converts XYZ
2560                                                                   values to reference camera native color space values,
2561                                                                   under the second calibration illuminant. */
2562     hi_isp_dng_srational camera_calibration1[CCM_MATRIX_SIZE]; /* defines a calibration matrix that transforms reference
2563                                                                   camera native space values to individual camera native
2564                                                                   space values under the first calibration illuminant */
2565     hi_isp_dng_srational camera_calibration2[CCM_MATRIX_SIZE]; /* defines a calibration matrix that transforms reference
2566                                                                  camera native space values to individual camera native
2567                                                                  space values under the second calibration illuminant */
2568     hi_isp_dng_srational forwad_matrix1[CCM_MATRIX_SIZE];      /* defines a matrix that maps white balanced camera
2569                                                                   colors to XYZ D50 colors */
2570     hi_isp_dng_srational forwad_matrix2[CCM_MATRIX_SIZE];      /* defines a matrix that maps white balanced camera
2571                                                                   colors to XYZ D50 colors */
2572 
2573     hi_u8  calibration_illuminant1;      /* RO;Format:8.0;Light source, actually this means white balance setting.
2574                                             '0' means unknown, '1' daylight, '2' fluorescent, '3' tungsten, '10' flash,
2575                                             '17' standard light A, '18' standard light B, '19' standard light C,
2576                                             '20' D55, '21' D65, '22' D75, '255' other */
2577     hi_u8  calibration_illuminant2;      /* RO;Format:8.0;Light source, actually this means white balance setting.
2578                                             '0' means unknown, '1' daylight, '2' fluorescent, '3' tungsten, '10' flash,
2579                                             '17' standard light A, '18' standard light B, '19' standard light C,
2580                                             '20' D55, '21' D65, '22' D75, '255' other */
2581 } hi_isp_dng_image_static_info;
2582 
2583 /* Defines the structure of DNG WB gain used for calculate DNG colormatrix. */
2584 typedef struct {
2585     hi_u16 r_gain;            /* RW;Range: [0x0, 0xFFF]; Multiplier for R  color channel */
2586     hi_u16 g_gain;            /* RW;Range: [0x0, 0xFFF]; Multiplier for G  color channel */
2587     hi_u16 b_gain;            /* RW;Range: [0x0, 0xFFF]; Multiplier for B  color channel */
2588 } hi_isp_dng_wb_gain;
2589 
2590 /* Defines the structure of DNG color parameters. */
2591 typedef struct {
2592     hi_isp_dng_wb_gain wb_gain1; /* the calibration White balance gain of colorcheker in low colortemper light source */
2593     hi_isp_dng_wb_gain wb_gain2; /* the calibration White balance gain of colorcheker in high colortemper
2594                                     light source */
2595 } hi_isp_dng_color_param;
2596 
2597 typedef ISP_IR_STATUS_E        hi_isp_ir_status;
2598 typedef ISP_IR_SWITCH_STATUS_E hi_isp_ir_switch_status;
2599 
2600 typedef struct {
2601     hi_bool enable;            /* RW, HI_TRUE: enable IR_auto function;  HI_TRUE: disable IR_auto function. */
2602     hi_u32  normal_to_ir_iso_thr; /* RW, Range: [0, 0xFFFFFFFF]. ISO threshold of switching from normal to IR mode. */
2603     hi_u32  ir_to_normal_iso_thr; /* RW, Range: [0, 0xFFFFFFFF]. ISO threshold of switching from IR to normal mode. */
2604     hi_u32  rg_max;           /* RW, Range: [0x0, 0xFFF].    Maximum value of R/G in IR scene, 4.8-bit fix-point. */
2605     hi_u32  rg_min;           /* RW, Range: [0x0, u32RGMax]. Minimum value of R/G in IR scene, 4.8-bit fix-point. */
2606     hi_u32  bg_max;           /* RW, Range: [0x0, 0xFFF].    Maximum value of B/G in IR scene, 4.8-bit fix-point. */
2607     hi_u32  bg_min;           /* RW, Range: [0x0, u32BGMax]. Minimum value of B/G in IR scene, 4.8-bit fix-point. */
2608 
2609     hi_isp_ir_status ir_status; /* RW. Current IR status. */
2610     hi_isp_ir_switch_status ir_switch; /* RO, IR switch status. */
2611 } hi_isp_ir_auto_attr;
2612 
2613 typedef ISP_CALCFLICKER_TYPE_E hi_isp_calc_flicker_type;
2614 
2615 typedef struct  {
2616     hi_u32 lines_per_second;      /* The total line number of 1 second */
2617 } hi_isp_calc_flicker_input;
2618 
2619 typedef struct {
2620     hi_isp_calc_flicker_type flicker_type;  /* The calculate result of flicker type */
2621 } hi_isp_calc_flicker_output;
2622 
2623 #ifdef __cplusplus
2624 #if __cplusplus
2625 }
2626 #endif
2627 #endif /* End of #ifdef __cplusplus */
2628 
2629 #endif /* __HI_COMM_ISP_ADAPT_H__ */
2630