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_SNS_ADAPT_H__
17 #define __HI_COMM_SNS_ADAPT_H__
18 
19 #include "hi_type.h"
20 #include "hi_common_adapt.h"
21 #include "hi_comm_isp_adapt.h"
22 #include "hi_comm_sns.h"
23 
24 #ifdef __cplusplus
25 #if __cplusplus
26 extern "C" {
27 #endif
28 #endif /* End of #ifdef __cplusplus */
29 
30 typedef struct {
31     hi_bool update;
32     hi_u16  black_level[ISP_BAYER_CHN_NUM];
33 } hi_isp_cmos_black_level;
34 
35 typedef struct {
36     SENSOR_ID            sensor_id;
37 } hi_isp_sns_attr_info;
38 
39 typedef struct {
40     hi_bool enable;
41     hi_u8   non_dir_str[ISP_AUTO_ISO_STRENGTH_NUM];
42     hi_u8   non_dir_mf_detail_ehc_str[ISP_AUTO_ISO_STRENGTH_NUM];
43     hi_u8   non_dir_hf_detail_ehc_str[ISP_AUTO_ISO_STRENGTH_NUM];
44     hi_u8   detail_smooth_range[ISP_AUTO_ISO_STRENGTH_NUM];
45 } hi_isp_cmos_demosaic;
46 
47 typedef struct {
48     hi_bool  enable;
49     hi_bool  bnr_mono_sensor_en;
50     hi_bool  nr_lsc_enable;
51     hi_u8    bnr_lsc_max_gain;
52     hi_u16   bnr_lsc_cmp_strength;
53 
54     hi_u8    lut_fine_str[ISP_AUTO_ISO_STRENGTH_NUM];
55     hi_u8    chroma_str[ISP_BAYER_CHN_NUM][ISP_AUTO_ISO_STRENGTH_NUM];
56     hi_u8    wdr_frame_str[WDR_MAX_FRAME_NUM];
57     hi_u8    fusion_frame_str[WDR_MAX_FRAME_NUM];
58     hi_u16   coarse_str[ISP_BAYER_CHN_NUM][ISP_AUTO_ISO_STRENGTH_NUM];
59     hi_u16   lut_coring_wgt[ISP_AUTO_ISO_STRENGTH_NUM];
60     hi_u16   lut_coring_ratio[HI_ISP_BAYERNR_LUT_LENGTH];
61 } hi_isp_cmos_bayernr;
62 
63 typedef struct {
64     hi_u16   calibration_lut_num;
65     hi_float calibration_coef[BAYER_CALIBTAION_MAX_NUM][BAYER_CALIBRATION_PARA_NUM];
66 } hi_isp_cmos_noise_calibration;
67 
68 typedef struct {
69     hi_isp_de_attr attr;
70 } hi_isp_cmos_detail;
71 
72 typedef struct {
73     hi_u8  luma_wgt[ISP_SHARPEN_LUMA_NUM];       /*  Range: [0, 127] */
74     hi_u16 texture_str[ISP_SHARPEN_GAIN_NUM];    /*  Range: [0, 4095]; Format:7.5 */
75     hi_u16 edge_str[ISP_SHARPEN_GAIN_NUM];       /*  Range: [0, 4095]; Format:7.5 */
76     hi_u16 texture_freq;          /*  Range: [0, 4095];Format:6.6 */
77     hi_u16 edge_freq;             /*  Range: [0, 4095];Format:6.6 */
78     hi_u8  over_shoot;            /*  Range: [0, 127] */
79     hi_u8  under_shoot;           /*  Range: [0, 127] */
80     hi_u8  shoot_sup_str;         /*  Range: [0, 255] */
81     hi_u8  shoot_sup_adj;         /*  Range: [0, 15] */
82     hi_u8  detail_ctrl;           /*  Range: [0, 255] */
83     hi_u8  detail_ctrl_thr;       /*  Range: [0, 255] */
84     hi_u8  edge_filt_str;         /*  Range: [0, 63] */
85     hi_u8  edge_filt_max_cap;     /*  Range: [0, 47] */
86     hi_u8  r_gain;                /*  Range: [0, 31] */
87     hi_u8  g_gain;                /*  Range: [0, 255] */
88     hi_u8  b_gain;                /*  Range: [0, 31] */
89     hi_u8  skin_gain;             /*  Range: [0, 31] */
90     hi_u16 max_sharp_gain;        /*  Range: [0, 0x7FF]; Format:8.3 */
91 } hi_isp_cmos_sharpen_manual;
92 
93 typedef struct {
94     hi_u8  luma_wgt[ISP_SHARPEN_LUMA_NUM][ISP_AUTO_ISO_STRENGTH_NUM];     /*  Range: [0, 127] */
95     hi_u16 texture_str[ISP_SHARPEN_GAIN_NUM][ISP_AUTO_ISO_STRENGTH_NUM];  /*  Range: [0, 4095]; Format:7.5 */
96     hi_u16 edge_str[ISP_SHARPEN_GAIN_NUM][ISP_AUTO_ISO_STRENGTH_NUM];     /*  Range: [0, 4095]; Format:7.5 */
97     hi_u16 texture_freq[ISP_AUTO_ISO_STRENGTH_NUM];         /*  Range: [0, 4095]; Format:6.6 */
98     hi_u16 edge_freq[ISP_AUTO_ISO_STRENGTH_NUM];            /*  Range: [0, 4095]; Format:6.6 */
99     hi_u8  over_shoot[ISP_AUTO_ISO_STRENGTH_NUM];           /*  Range: [0, 127] */
100     hi_u8  under_shoot[ISP_AUTO_ISO_STRENGTH_NUM];          /*  Range: [0, 127] */
101     hi_u8  shoot_sup_str[ISP_AUTO_ISO_STRENGTH_NUM];        /*  Range: [0, 255] */
102     hi_u8  shoot_sup_adj[ISP_AUTO_ISO_STRENGTH_NUM];        /*  Range: [0, 15] */
103     hi_u8  detail_ctrl[ISP_AUTO_ISO_STRENGTH_NUM];          /*  Range: [0, 255] */
104     hi_u8  detail_ctrl_thr[ISP_AUTO_ISO_STRENGTH_NUM];      /*  Range: [0, 255] */
105     hi_u8  edge_filt_str[ISP_AUTO_ISO_STRENGTH_NUM];        /*  Range: [0, 63] */
106     hi_u8  edge_filt_max_cap[ISP_AUTO_ISO_STRENGTH_NUM];    /*  Range: [0, 47] */
107     hi_u8  r_gain[ISP_AUTO_ISO_STRENGTH_NUM];               /*  Range: [0, 31] */
108     hi_u8  g_gain[ISP_AUTO_ISO_STRENGTH_NUM];               /*  Range: [0, 255] */
109     hi_u8  b_gain[ISP_AUTO_ISO_STRENGTH_NUM];               /*  Range: [0, 31] */
110     hi_u8  skin_gain[ISP_AUTO_ISO_STRENGTH_NUM];            /*  Range: [0, 31] */
111     hi_u16 max_sharp_gain[ISP_AUTO_ISO_STRENGTH_NUM];       /*  Range: [0, 0x7FF]; Format:8.3 */
112 } hi_isp_cmos_sharpen_auto;
113 
114 typedef struct {
115     hi_u8 skin_umin;
116     hi_u8 skin_vmin;
117     hi_u8 skin_umax;
118     hi_u8 skin_vmax;
119     hi_isp_cmos_sharpen_manual manual_attr;
120     hi_isp_cmos_sharpen_auto   auto_attr;
121 } hi_isp_cmos_sharpen;
122 
123 typedef struct {
124     hi_bool enable;            /* RW; Range:[0, 1]; Format:1.0;Enable/Disable Edge Mark */
125     hi_u8   threshold;         /* RW; range: [0, 255];  Format:8.0; */
126     hi_u32  color;             /* RW; range: [0, 0xFFFFFF];  Format:32.0; */
127 } hi_isp_cmos_edgemark;
128 
129 typedef struct {
130     hi_bool enable;         /* RW; Range:[0, 1]; Format:1.0;Enable/Disable HLC module */
131     hi_u8   luma_thr;       /* RW; range: [0, 255];  Format:8.0; */
132     hi_u8   luma_target;    /* RW; range: [0, 255];  Format:8.0; */
133 } hi_isp_cmos_hlc;
134 
135 typedef struct {
136     hi_bool enable;
137     hi_isp_op_type op_type;
138 
139     hi_u16  manual_strength;
140     hi_u16  auto_strength;
141 
142     hi_u8   spatial_flt_coef;
143     hi_u8   range_flt_coef;
144     hi_u8   contrast_control;
145     hi_s8   detail_adjust_factor;
146     hi_u8   range_ada_max;
147 
148     hi_u8   flt_scale_fine;
149     hi_u8   flt_scale_coarse;
150     hi_u8   grad_rev_max;
151     hi_u8   grad_rev_thr;
152 
153     hi_u8   bright_gain_lmt;
154     hi_u8   bright_gain_lmt_step;
155     hi_u8   dark_gain_lmt_y;
156     hi_u8   dark_gain_lmt_c;
157 
158     hi_u8   pd_strength;
159     hi_u8   local_mixing_bright_max;
160     hi_u8   local_mixing_bright_min;
161     hi_u8   local_mixing_bright_thr;
162     hi_s8   local_mixing_bright_slo;
163     hi_u8   local_mixing_dark_max;
164     hi_u8   local_mixing_dark_min;
165     hi_u8   local_mixing_dark_thr;
166     hi_s8   local_mixing_dark_slo;
167     hi_u16  color_correction_lut[HI_ISP_DRC_CC_NODE_NUM];
168     hi_u16  tone_mapping_value[HI_ISP_DRC_TM_NODE_NUM];
169 
170     hi_u8   asymmetry;
171     hi_u8   second_pole;
172     hi_u8   stretch;
173     hi_u8   compress;
174 
175     hi_u8   curve_sel;
176 
177     hi_u16 x_point[HI_ISP_DRC_CUBIC_POINT_NUM];
178     hi_u16 y_point[HI_ISP_DRC_CUBIC_POINT_NUM];
179     hi_u16 slope[HI_ISP_DRC_CUBIC_POINT_NUM];
180 } hi_isp_cmos_drc;
181 
182 typedef struct {
183     hi_bool  fusion_mode;
184     hi_bool  motion_comp;
185 
186     hi_u16   short_thr;
187     hi_u16   long_thr;
188 
189     hi_bool  force_long;
190     hi_u16   force_long_low_thr;
191     hi_u16   force_long_hig_thr;
192 
193     hi_bool  short_expo_chk;
194     hi_u16   short_check_thd;
195     hi_bool  md_ref_flicker;
196 
197     hi_u8    md_thr_low_gain[ISP_AUTO_ISO_STRENGTH_NUM];
198     hi_u8    md_thr_hig_gain[ISP_AUTO_ISO_STRENGTH_NUM];
199 
200     hi_isp_bnr_mode  bnr_mode;
201     hi_u16   fusion_thr[WDR_MAX_FRAME];
202     hi_u8    mdt_still_thd;
203     hi_u8    mdt_long_blend;
204 } hi_isp_cmos_wdr;
205 
206 typedef struct {
207     hi_bool        enable;           /* RW;Range:[0,1];Format:1.0; */
208     hi_bool        user_lut_enable;    /* RW;Range:[0,1];0:Auto Lut 1:User Lut */
209     hi_isp_op_type op_type;
210     hi_u8          auto_strength;
211     hi_u8          manual_strength;
212 } hi_isp_cmos_dehaze;
213 
214 typedef struct {
215     hi_bool enable;
216     hi_u32  pregamma_lut[PREGAMMA_NODE_NUM];
217 } hi_isp_cmos_pregamma;
218 
219 typedef struct {
220     hi_u16  gamma_lut[GAMMA_EXT_NODE_NUMBER];
221 } hi_isp_cmos_gamma;
222 
223 typedef struct {
224     hi_u32  max_width;
225     hi_u32  max_height;
226 } hi_isp_cmos_sensor_max_resolution;
227 
228 typedef struct {
229     hi_u16  strength[ISP_AUTO_ISO_STRENGTH_NUM];
230     hi_u16  blend_ratio[ISP_AUTO_ISO_STRENGTH_NUM];
231 } hi_isp_cmos_dpc;
232 
233 typedef struct {
234     hi_u16 r_gain[HI_ISP_LSC_GRID_POINTS];
235     hi_u16 gr_gain[HI_ISP_LSC_GRID_POINTS];
236     hi_u16 gb_gain[HI_ISP_LSC_GRID_POINTS];
237     hi_u16 b_gain[HI_ISP_LSC_GRID_POINTS];
238 } hi_isp_lsc_cabli_table;
239 
240 typedef struct {
241     hi_u16 r_gain[HI_ISP_RLSC_POINTS];
242     hi_u16 gr_gain[HI_ISP_RLSC_POINTS];
243     hi_u16 gb_gain[HI_ISP_RLSC_POINTS];
244     hi_u16 b_gain[HI_ISP_RLSC_POINTS];
245 } hi_isp_bnr_lsc_calib_table;
246 
247 typedef struct {
248     hi_u16  mesh_strength;
249     hi_u8   mesh_scale;
250     hi_isp_lsc_cabli_table lsc_calib_table[HI_ISP_MLSC_GAIN_LUT_NUM];
251     hi_isp_bnr_lsc_calib_table bnr_lsc_calib_table;
252 } hi_isp_cmos_lsc;
253 
254 typedef struct {
255     hi_bool   enable;
256     hi_u16    y_ratio_lut[HI_ISP_CA_YRATIO_LUT_LENGTH];  /* 1.10bit  Y Ratio For UV; Max = 2047 FW Limit */
257     hi_s16    iso_ratio[ISP_AUTO_ISO_STRENGTH_NUM];     /* 1.10bit  ISO Ratio  For UV,Max = 2047 FW Limi */
258 } hi_isp_cmos_ca;
259 
260 typedef struct {
261     hi_bool enable;
262     hi_u32  gain_r;
263     hi_u32  gain_g;
264     hi_u32  gain_b;
265     hi_isp_clut_lut clut_lut;
266 } hi_isp_cmos_clut;
267 
268 typedef struct {
269     hi_u16 x;                    /* RW;Range:[0x0,0x100];Format:8.0;The X point of the knee */
270     hi_u32 y;                    /* RW;Range:[0x0,0x100000];Format:21.0;The Y point of the  knee */
271 } hi_isp_cmos_expander_point;
272 
273 typedef struct {
274     hi_bool enable;
275     hi_u8   bit_depth_in;            /* RW;Range:[0xC,0x14];Format:5.0;The Bit depth of input */
276     hi_u8   bit_depth_out;           /* RW;Range:[0xC,0x14];Format:5.0;The Bit depth of output */
277     hi_u16  expander_point_num;      /* Range:[1, 256] */
278     hi_isp_cmos_expander_point expander_point[ISP_EXPANDER_POINT_NUM_MAX];
279 } hi_isp_cmos_expander;
280 
281 typedef struct {
282     hi_bool enable;                                 /* RW,Range: [   0, 1]      */
283     hi_u8   slope;                                  /* RW,Range: [   0, 0xE]    */
284     hi_u8   sensi_slope;                             /* RW,Range: [   0, 0xE]    */
285     hi_u16  sensi_thr;                              /* RW,Range: [   0, 0x3FFF] */
286     hi_u16  threshold[ISP_AUTO_ISO_STRENGTH_NUM]; /* RW,Range: [   0, 0x3FFF] */
287     hi_u16  strength[ISP_AUTO_ISO_STRENGTH_NUM];  /* RW,Range: [   0, 0x100]  */
288     hi_u16  np_offset[ISP_AUTO_ISO_STRENGTH_NUM];  /* RW,Range: [0x200, 0x3FFF] */
289 } hi_isp_cmos_ge;
290 
291 typedef struct {
292     hi_bool enable;                               /* RW;Range:[0x0,0x1];Format:1.0; AntiFalseColor Enable */
293     hi_u8   threshold[ISP_AUTO_ISO_STRENGTH_NUM]; /* RW;Range:[0x0,0x20];Format:6.0;Threshold for antifalsecolor */
294     hi_u8   strength[ISP_AUTO_ISO_STRENGTH_NUM];  /* RW;Range:[0x0,0x1F];Format:5.0;Strength of antifalsecolor */
295 } hi_isp_cmos_afc;
296 
297 typedef struct {
298     hi_bool  enable;
299     hi_u8    gauss_lpf_sigma;
300     hi_u8    he_pos_wgt[ISP_AUTO_ISO_STRENGTH_NUM];
301     hi_u8    he_pos_sigma[ISP_AUTO_ISO_STRENGTH_NUM];
302     hi_u8    he_pos_mean[ISP_AUTO_ISO_STRENGTH_NUM];
303     hi_u8    he_neg_wgt[ISP_AUTO_ISO_STRENGTH_NUM];
304     hi_u8    he_neg_sigma[ISP_AUTO_ISO_STRENGTH_NUM];
305     hi_u8    he_neg_mean[ISP_AUTO_ISO_STRENGTH_NUM];
306     hi_u16   blc_ctrl[ISP_AUTO_ISO_STRENGTH_NUM];
307 } hi_isp_cmos_ldci;
308 
309 typedef struct {
310     hi_u8  de_purple_cr_str;
311     hi_u8  de_purple_cb_str;
312 } hi_isp_cmos_lcac_manual;
313 
314 typedef struct {
315     hi_u8  de_purple_cr_str[ISP_EXP_RATIO_STRENGTH_NUM];
316     hi_u8  de_purple_cb_str[ISP_EXP_RATIO_STRENGTH_NUM];
317 } hi_isp_cmos_lcac_auto;
318 
319 typedef struct {
320     hi_bool        enable;
321     hi_isp_op_type op_mode;
322     hi_u16         var_thr;
323     hi_u16         r_luma_thd[ISP_LCAC_DET_NUM];
324     hi_u16         g_luma_thd[ISP_LCAC_DET_NUM];
325     hi_u16         b_luma_thd[ISP_LCAC_DET_NUM];
326     hi_u16         y_luma_thd[ISP_LCAC_DET_NUM];
327     hi_s16         cbcr_ratio[ISP_LCAC_DET_NUM];
328     hi_u16         purple_det_range;
329     hi_isp_cmos_lcac_manual  manual_attr;
330     hi_isp_cmos_lcac_auto    auto_attr;
331 } hi_isp_cmos_lcac;
332 
333 typedef struct {
334     hi_u32  sensor_id;
335     hi_u8   sensor_mode;
336     hi_bool valid_dng_raw_format;
337     hi_isp_dng_raw_format dng_raw_format;
338 } hi_isp_cmos_sensor_mode;
339 
340 typedef struct {
341     hi_isp_dng_wb_gain wb_gain1; /* the calibration White balance gain of colorcheker in A Light */
342     hi_isp_dng_wb_gain wb_gain2; /* the calibration White balance gain of colorcheker in D50 Light */
343 } hi_isp_cmos_dng_color_param;
344 
345 typedef struct {
346     hi_u32   exp_ratio[EXP_RATIO_NUM];
347 } hi_isp_cmos_wdr_switch_attr;
348 
349 typedef struct {
350     hi_u16 g_param_high_ct[HI_ISP_LSC_GRID_POINTS];
351     hi_u16 g_param_low_ct[HI_ISP_LSC_GRID_POINTS];
352 } hi_isp_acs_y_shading_lut;
353 
354 typedef struct {
355     hi_float avg_rg_map[HI_ISP_LSC_GRID_POINTS];
356     hi_float avg_bg_map[HI_ISP_LSC_GRID_POINTS];
357     hi_float prof_rg_map[HI_ISP_LSC_GRID_POINTS];
358     hi_float prof_bg_map[HI_ISP_LSC_GRID_POINTS];
359 } hi_isp_acs_color_shading_lut;
360 
361 typedef struct {
362     hi_s16   light_index[HI_ISP_ACS_LIGHT_NUM * HI_ISP_ACS_CHN_NUM];
363     hi_float model_ar_min;
364     hi_float model_ar_step;
365     hi_float model_ab_min;
366     hi_float model_ab_step;
367     hi_s16   light_type_g_high;
368     hi_s16   light_type_g_low;
369 } hi_isp_acs_calib_param;
370 
371 typedef struct {
372     hi_bool                       enable;
373     hi_u16                        acs_shading_str;
374     hi_isp_acs_calib_param        acs_calib_param;
375     hi_isp_acs_y_shading_lut      acs_y_shading_lut;
376     hi_isp_acs_color_shading_lut  acs_color_shading_lut;
377 } hi_isp_cmos_acs;
378 
379 typedef union {
380     hi_u64  key;
381     struct {
382         hi_u64  bit1_drc              : 1;   /* [0] */
383         hi_u64  bit1_demosaic         : 1;   /* [1] */
384         hi_u64  bit1_pregamma         : 1;   /* [2] */
385         hi_u64  bit1_gamma            : 1;   /* [3] */
386         hi_u64  bit1_sharpen          : 1;   /* [4] */
387         hi_u64  bit1_edge_mark        : 1;   /* [5] */
388         hi_u64  bit1_hlc              : 1;   /* [6] */
389         hi_u64  bit1_ldci             : 1;   /* [7] */
390         hi_u64  bit1_dpc              : 1;   /* [8] */
391         hi_u64  bit1_lsc              : 1;   /* [9] */
392         hi_u64  bit1_ge               : 1;   /* [10] */
393         hi_u64  bit1_anti_false_color : 1;   /* [11] */
394         hi_u64  bit1_bayer_nr         : 1;   /* [12] */
395         hi_u64  bit1_detail           : 1;   /* [13] */
396         hi_u64  bit1_ca               : 1;   /* [14] */
397         hi_u64  bit1_expander         : 1;   /* [15] */
398         hi_u64  bit1_clut             : 1;   /* [16] */
399         hi_u64  bit1_wdr              : 1;   /* [17] */
400         hi_u64  bit1_dehaze           : 1;   /* [18] */
401         hi_u64  bit1_lcac             : 1;   /* [19] */
402         hi_u64  bit1_acs              : 1;   /* [20] */
403         hi_u64  bit44_rsv             : 43;   /* [21:63] */
404     };
405 } hi_isp_cmos_alg_key;
406 
407 typedef struct {
408     hi_isp_cmos_alg_key              key;
409     const hi_isp_cmos_drc             *drc;
410     const hi_isp_cmos_demosaic        *demosaic;
411     const hi_isp_cmos_pregamma        *pregamma;
412     const hi_isp_cmos_gamma           *gamma;
413     const hi_isp_cmos_sharpen         *sharpen;
414     const hi_isp_cmos_edgemark        *edge_mark;
415     const hi_isp_cmos_hlc             *hlc;
416     const hi_isp_cmos_ldci            *ldci;
417     const hi_isp_cmos_dpc             *dpc;
418     const hi_isp_cmos_lsc             *lsc;
419     const hi_isp_cmos_ge              *ge;
420     const hi_isp_cmos_afc             *anti_false_color;
421     const hi_isp_cmos_bayernr         *bayer_nr;
422     const hi_isp_cmos_detail          *detail;
423     const hi_isp_cmos_ca              *ca;
424     const hi_isp_cmos_expander        *expander;
425     const hi_isp_cmos_clut            *clut;
426     const hi_isp_cmos_wdr             *wdr;
427     const hi_isp_cmos_dehaze          *dehaze;
428     const hi_isp_cmos_lcac            *lcac;
429     const hi_isp_cmos_acs             *acs;
430     hi_isp_cmos_noise_calibration     noise_calibration;
431     hi_isp_cmos_sensor_max_resolution sensor_max_resolution;
432     hi_isp_cmos_sensor_mode           sensor_mode;
433     hi_isp_cmos_dng_color_param       dng_color_param;
434     hi_isp_cmos_wdr_switch_attr       wdr_switch_attr;
435 } hi_isp_cmos_default;
436 
437 typedef struct {
438     hi_u16   width;
439     hi_u16   height;
440     hi_float fps;
441     hi_u8    sns_mode;
442 } hi_isp_cmos_sensor_image_mode;
443 
444 typedef struct {
445     hi_void (*pfn_cmos_sensor_init)(hi_vi_pipe vi_pipe);
446     hi_void (*pfn_cmos_sensor_exit)(hi_vi_pipe vi_pipe);
447     hi_void (*pfn_cmos_sensor_global_init)(hi_vi_pipe vi_pipe);
448     hi_s32 (*pfn_cmos_set_image_mode)(hi_vi_pipe vi_pipe, hi_isp_cmos_sensor_image_mode *sensor_image_mode);
449     hi_s32 (*pfn_cmos_set_wdr_mode)(hi_vi_pipe vi_pipe, hi_u8 mode);
450 
451     /* the algs get data which is associated with sensor, except 3a */
452     hi_s32 (*pfn_cmos_get_isp_default)(hi_vi_pipe vi_pipe, hi_isp_cmos_default *def);
453     hi_s32 (*pfn_cmos_get_isp_black_level)(hi_vi_pipe vi_pipe, hi_isp_cmos_black_level *black_level);
454     hi_s32 (*pfn_cmos_get_sns_reg_info)(hi_vi_pipe vi_pipe, hi_isp_sns_regs_info *sns_regs_info);
455 
456     /* the function of sensor set pixel detect */
457     hi_void (*pfn_cmos_set_pixel_detect)(hi_vi_pipe vi_pipe, hi_bool enable);
458     hi_s32 (*pfn_cmos_get_awb_gains)(hi_vi_pipe vi_pipe, hi_u32 *sensor_awb_gain);
459 } hi_isp_sensor_exp_func;
460 
461 typedef struct {
462     hi_isp_sensor_exp_func sns_exp;
463 } hi_isp_sensor_register;
464 
465 #ifdef __cplusplus
466 #if __cplusplus
467 }
468 #endif
469 #endif /* End of #ifdef __cplusplus */
470 
471 #endif /* __HI_COMM_SNS_ADAPT_H__ */
472