• 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 __MPI_ISP_ADAPT_H__
17 #define __MPI_ISP_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_3a_adapt.h"
23 #include "hi_debug_adapt.h"
24 #include "hi_comm_sns_adapt.h"
25 
26 #ifdef __cplusplus
27 #if __cplusplus
28 extern "C" {
29 #endif
30 #endif /* End of #ifdef __cplusplus */
31 
32 hi_s32 hi_mpi_isp_init(hi_vi_pipe vi_pipe);
33 hi_s32 hi_mpi_isp_mem_init(hi_vi_pipe vi_pipe);
34 hi_s32 hi_mpi_isp_run(hi_vi_pipe vi_pipe);
35 hi_s32 hi_mpi_isp_run_once(hi_vi_pipe vi_pipe);
36 hi_s32 hi_mpi_isp_exit(hi_vi_pipe vi_pipe);
37 
38 hi_s32 hi_mpi_isp_sensor_reg_callback(hi_vi_pipe vi_pipe, hi_isp_sns_attr_info *sns_attr_info,
39                                       hi_isp_sensor_register *sns_register);
40 hi_s32 hi_mpi_isp_sensor_unreg_callback(hi_vi_pipe vi_pipe, SENSOR_ID sensor_id);
41 
42 /* if have registered multy libs, set bind attr to appoint the active lib. */
43 hi_s32 hi_mpi_isp_set_bind_attr(hi_vi_pipe vi_pipe, const hi_isp_bind_attr *bind_attr);
44 hi_s32 hi_mpi_isp_get_bind_attr(hi_vi_pipe vi_pipe, hi_isp_bind_attr *bind_attr);
45 hi_s32 hi_mpi_isp_ae_lib_reg_callback(hi_vi_pipe vi_pipe, hi_isp_alg_lib *ae_lib, hi_isp_ae_register *ae_register);
46 hi_s32 hi_mpi_isp_awb_lib_reg_callback(hi_vi_pipe vi_pipe, hi_isp_alg_lib *awb_lib, hi_isp_awb_register *awb_register);
47 hi_s32 hi_mpi_isp_ae_lib_unreg_callback(hi_vi_pipe vi_pipe, hi_isp_alg_lib *ae_lib);
48 hi_s32 hi_mpi_isp_awb_lib_unreg_callback(hi_vi_pipe vi_pipe, hi_isp_alg_lib *awb_lib);
49 
50 hi_s32 hi_mpi_isp_get_lightbox_gain(hi_vi_pipe vi_pipe,
51                                     hi_isp_awb_calibration_gain *awb_calibration_gain);
52 
53 hi_s32 hi_mpi_isp_set_pub_attr(hi_vi_pipe vi_pipe, const hi_isp_pub_attr *pub_attr);
54 hi_s32 hi_mpi_isp_get_pub_attr(hi_vi_pipe vi_pipe, hi_isp_pub_attr *pub_attr);
55 
56 hi_s32 hi_mpi_isp_set_pipe_differ_attr(hi_vi_pipe vi_pipe, const hi_isp_pipe_diff_attr *pipe_differ);
57 hi_s32 hi_mpi_isp_get_pipe_differ_attr(hi_vi_pipe vi_pipe, hi_isp_pipe_diff_attr *pipe_differ);
58 
59 hi_s32 hi_mpi_isp_get_vd_time_out(hi_vi_pipe vi_pipe, hi_isp_vd_type isp_vd_type, hi_u32 milli_sec);
60 hi_s32 hi_mpi_isp_query_inner_state_info(hi_vi_pipe vi_pipe, hi_isp_inner_state_info *inner_state_info);
61 hi_s32 hi_mpi_isp_get_ae_statistics(hi_vi_pipe vi_pipe, hi_isp_ae_statistics *ae_stat);
62 hi_s32 hi_mpi_isp_get_ae_stitch_statistics(hi_vi_pipe vi_pipe, hi_isp_ae_stitch_statistics *stitch_stat);
63 hi_s32 hi_mpi_isp_get_mg_statistics(hi_vi_pipe vi_pipe, hi_isp_mg_statistics *mg_stat);
64 
65 hi_s32 hi_mpi_isp_get_wb_statistics(hi_vi_pipe vi_pipe, hi_isp_wb_statistics *wb_stat);
66 hi_s32 hi_mpi_isp_get_wb_stitch_statistics(hi_vi_pipe vi_pipe, hi_isp_wb_stitch_statistics *stitch_wb_stat);
67 
68 hi_s32 hi_mpi_isp_get_focus_statistics(hi_vi_pipe vi_pipe, hi_isp_af_statistics *af_stat);
69 
70 hi_s32 hi_mpi_isp_set_statistics_config(hi_vi_pipe vi_pipe, const hi_isp_statistics_cfg *stat_cfg);
71 hi_s32 hi_mpi_isp_get_statistics_config(hi_vi_pipe vi_pipe, hi_isp_statistics_cfg *stat_cfg);
72 
73 hi_s32 hi_mpi_isp_get_isp_reg_attr(hi_vi_pipe vi_pipe, hi_isp_reg_attr *isp_reg_attr);
74 
75 hi_s32 hi_mpi_isp_set_fmw_state(hi_vi_pipe vi_pipe, const hi_isp_fmw_state state);
76 hi_s32 hi_mpi_isp_get_fmw_state(hi_vi_pipe vi_pipe, hi_isp_fmw_state *state);
77 
78 hi_s32 hi_mpi_isp_set_debug(hi_vi_pipe vi_pipe, const hi_isp_debug_info *isp_debug);
79 hi_s32 hi_mpi_isp_get_debug(hi_vi_pipe vi_pipe, hi_isp_debug_info *isp_debug);
80 
81 hi_s32 hi_mpi_isp_set_mod_param(const hi_isp_mod_param *mod_param);
82 hi_s32 hi_mpi_isp_get_mod_param(hi_isp_mod_param *mod_param);
83 hi_s32 hi_mpi_isp_set_ctrl_param(hi_vi_pipe vi_pipe, const hi_isp_ctrl_param *isp_ctrl_param);
84 hi_s32 hi_mpi_isp_get_ctrl_param(hi_vi_pipe vi_pipe, hi_isp_ctrl_param *isp_ctrl_param);
85 
86 hi_s32 hi_mpi_isp_set_fswdr_attr(hi_vi_pipe vi_pipe, const hi_isp_wdr_fs_attr *fswdr_attr);
87 hi_s32 hi_mpi_isp_get_fswdr_attr(hi_vi_pipe vi_pipe, hi_isp_wdr_fs_attr *fswdr_attr);
88 
89 hi_s32 hi_mpi_isp_set_drc_attr(hi_vi_pipe vi_pipe, const hi_isp_drc_attr *drc);
90 hi_s32 hi_mpi_isp_get_drc_attr(hi_vi_pipe vi_pipe, hi_isp_drc_attr *drc);
91 
92 hi_s32 hi_mpi_isp_set_dehaze_attr(hi_vi_pipe vi_pipe, const hi_isp_dehaze_attr *dehaze_attr);
93 hi_s32 hi_mpi_isp_get_dehaze_attr(hi_vi_pipe vi_pipe, hi_isp_dehaze_attr *dehaze_attr);
94 
95 hi_s32 hi_mpi_isp_set_ldci_attr(hi_vi_pipe vi_pipe, const hi_isp_ldci_attr *ldci_attr);
96 hi_s32 hi_mpi_isp_get_ldci_attr(hi_vi_pipe vi_pipe, hi_isp_ldci_attr *ldci_attr);
97 
98 hi_s32 hi_mpi_isp_set_sns_slave_attr(hi_slave_dev slave_dev, const hi_isp_slave_sns_sync *sns_sync);
99 hi_s32 hi_mpi_isp_get_sns_slave_attr(hi_slave_dev slav_edev, hi_isp_slave_sns_sync *sns_sync);
100 
101 hi_s32 hi_mpi_isp_set_module_control(hi_vi_pipe vi_pipe, const hi_isp_module_ctrl *mod_ctrl);
102 hi_s32 hi_mpi_isp_get_module_control(hi_vi_pipe vi_pipe, hi_isp_module_ctrl *mod_ctrl);
103 
104 hi_s32 hi_mpi_isp_set_dp_calibrate(hi_vi_pipe vi_pipe, const hi_isp_dp_static_calibrate *dp_calibrate);
105 hi_s32 hi_mpi_isp_get_dp_calibrate(hi_vi_pipe vi_pipe, hi_isp_dp_static_calibrate *dp_calibrate);
106 
107 hi_s32 hi_mpi_isp_set_dp_static_attr(hi_vi_pipe vi_pipe, const hi_isp_dp_static_attr *dp_static_attr);
108 hi_s32 hi_mpi_isp_get_dp_static_attr(hi_vi_pipe vi_pipe,  hi_isp_dp_static_attr *dp_static_attr);
109 
110 hi_s32 hi_mpi_isp_set_dp_dynamic_attr(hi_vi_pipe vi_pipe, const hi_isp_dp_dynamic_attr *dp_dynamic_attr);
111 hi_s32 hi_mpi_isp_get_dp_dynamic_attr(hi_vi_pipe vi_pipe, hi_isp_dp_dynamic_attr *dp_dynamic_attr);
112 
113 hi_s32 hi_mpi_isp_set_dis_attr(hi_vi_pipe vi_pipe, const hi_isp_dis_attr *dis_attr);
114 hi_s32 hi_mpi_isp_get_dis_attr(hi_vi_pipe vi_pipe, hi_isp_dis_attr *dis_attr);
115 
116 hi_s32 hi_mpi_isp_set_mesh_shading_attr(hi_vi_pipe vi_pipe, const hi_isp_shading_attr *shading_attr);
117 hi_s32 hi_mpi_isp_get_mesh_shading_attr(hi_vi_pipe vi_pipe, hi_isp_shading_attr *shading_attr);
118 
119 hi_s32 hi_mpi_isp_set_mesh_shading_gain_lut_attr(hi_vi_pipe vi_pipe,
120                                                  const hi_isp_shading_lut_attr *shading_lut_attr);
121 hi_s32 hi_mpi_isp_get_mesh_shading_gain_lut_attr(hi_vi_pipe vi_pipe,
122                                                  hi_isp_shading_lut_attr *shading_lut_attr);
123 
124 hi_s32 hi_mpi_isp_set_radial_shading_attr(hi_vi_pipe vi_pipe,
125                                           const hi_isp_radial_shading_attr *radial_shading_attr);
126 hi_s32 hi_mpi_isp_get_radial_shading_attr(hi_vi_pipe vi_pipe,
127                                           hi_isp_radial_shading_attr *radial_shading_attr);
128 
129 hi_s32 hi_mpi_isp_set_auto_color_shading_attr(hi_vi_pipe vi_pipe, const hi_isp_acs_attr *acs_attr);
130 hi_s32 hi_mpi_isp_get_auto_color_shading_attr(hi_vi_pipe vi_pipe, hi_isp_acs_attr *acs_attr);
131 
132 hi_s32 hi_mpi_isp_set_radial_shading_lut(hi_vi_pipe vi_pipe,
133                                          const hi_isp_radial_shading_lut_attr *radial_shading_lut_attr);
134 hi_s32 hi_mpi_isp_get_radial_shading_lut(hi_vi_pipe vi_pipe,
135                                          hi_isp_radial_shading_lut_attr *radial_shading_lut_attr);
136 
137 hi_s32 hi_mpi_isp_mesh_shading_calibration(hi_vi_pipe vi_pipe, hi_u16 *src_raw,
138                                            hi_isp_mlsc_calibration_cfg *mlsc_cali_cfg,
139                                            hi_isp_mesh_shading_table *mlsc_table);
140 
141 hi_s32 hi_mpi_isp_radial_shading_calibration(hi_vi_pipe vi_pipe, hi_u16 *src_raw,
142     hi_isp_rlsc_calibration_cfg *rlsc_cali_cfg, hi_isp_radial_shading_table *rlsc_table);
143 
144 hi_s32 hi_mpi_isp_set_nr_attr(hi_vi_pipe vi_pipe, const hi_isp_nr_attr *nr_attr);
145 hi_s32 hi_mpi_isp_get_nr_attr(hi_vi_pipe vi_pipe, hi_isp_nr_attr *nr_attr);
146 
147 hi_s32 hi_mpi_isp_set_de_attr(hi_vi_pipe vi_pipe, const hi_isp_de_attr *de_attr);
148 hi_s32 hi_mpi_isp_get_de_attr(hi_vi_pipe vi_pipe, hi_isp_de_attr *de_attr);
149 
150 hi_s32 hi_mpi_isp_set_color_tone_attr(hi_vi_pipe vi_pipe, const hi_isp_color_tone_attr *ct_attr);
151 hi_s32 hi_mpi_isp_get_color_tone_attr(hi_vi_pipe vi_pipe, hi_isp_color_tone_attr *ct_attr);
152 
153 hi_s32 hi_mpi_isp_set_gamma_attr(hi_vi_pipe vi_pipe, const hi_isp_gamma_attr *gamma_attr);
154 hi_s32 hi_mpi_isp_get_gamma_attr(hi_vi_pipe vi_pipe, hi_isp_gamma_attr *gamma_attr);
155 hi_s32 hi_mpi_isp_set_pre_gamma_attr(hi_vi_pipe vi_pipe, const hi_isp_pregamma_attr *pre_gamma_attr);
156 hi_s32 hi_mpi_isp_get_pre_gamma_attr(hi_vi_pipe vi_pipe, hi_isp_pregamma_attr *pre_gamma_attr);
157 
158 hi_s32 hi_mpi_isp_set_pre_log_lut_attr(hi_vi_pipe vi_pipe, const hi_isp_preloglut_attr *pre_log_lut_attr);
159 hi_s32 hi_mpi_isp_get_pre_log_lut_attr(hi_vi_pipe vi_pipe, hi_isp_preloglut_attr *pre_log_lut_attr);
160 
161 hi_s32 hi_mpi_isp_set_log_lut_attr(hi_vi_pipe vi_pipe, const hi_isp_loglut_attr *log_lut_attr);
162 hi_s32 hi_mpi_isp_get_log_lut_attr(hi_vi_pipe vi_pipe, hi_isp_loglut_attr *log_lut_attr);
163 hi_s32 hi_mpi_isp_set_local_cac_attr(hi_vi_pipe vi_pipe, const hi_isp_local_cac_attr *local_cac_attr);
164 hi_s32 hi_mpi_isp_get_local_cac_attr(hi_vi_pipe vi_pipe, hi_isp_local_cac_attr *local_cac_attr);
165 
166 hi_s32 hi_mpi_isp_set_global_cac_attr(hi_vi_pipe vi_pipe, const hi_isp_global_cac_attr *global_cac_attr);
167 hi_s32 hi_mpi_isp_get_global_cac_attr(hi_vi_pipe vi_pipe, hi_isp_global_cac_attr *global_cac_attr);
168 
169 hi_s32 hi_mpi_isp_set_rc_attr(hi_vi_pipe vi_pipe, const hi_isp_rc_attr *rc_attr);
170 hi_s32 hi_mpi_isp_get_rc_attr(hi_vi_pipe vi_pipe, hi_isp_rc_attr *rc_attr);
171 
172 hi_s32 hi_mpi_isp_set_sharpen_attr(hi_vi_pipe vi_pipe, const hi_isp_sharpen_attr *shp_attr);
173 hi_s32 hi_mpi_isp_get_sharpen_attr(hi_vi_pipe vi_pipe, hi_isp_sharpen_attr *shp_attr);
174 
175 hi_s32 hi_mpi_isp_set_edge_mark_attr(hi_vi_pipe vi_pipe, const hi_isp_edge_mark_attr *isp_edge_mark_attr);
176 hi_s32 hi_mpi_isp_get_edge_mark_attr(hi_vi_pipe vi_pipe, hi_isp_edge_mark_attr *isp_edge_mark_attr);
177 
178 hi_s32 hi_mpi_isp_set_hlc_attr(hi_vi_pipe vi_pipe, const hi_isp_hlc_attr *isp_hlc_attr);
179 hi_s32 hi_mpi_isp_get_hlc_attr(hi_vi_pipe vi_pipe, hi_isp_hlc_attr *isp_hlc_attr);
180 
181 hi_s32 hi_mpi_isp_set_crosstalk_attr(hi_vi_pipe vi_pipe, const hi_isp_cr_attr *cr_attr);
182 hi_s32 hi_mpi_isp_get_crosstalk_attr(hi_vi_pipe vi_pipe, hi_isp_cr_attr *cr_attr);
183 
184 hi_s32 hi_mpi_isp_set_ca_attr(hi_vi_pipe vi_pipe, const hi_isp_ca_attr *ca_attr);
185 hi_s32 hi_mpi_isp_get_ca_attr(hi_vi_pipe vi_pipe, hi_isp_ca_attr *ca_attr);
186 
187 hi_s32 hi_mpi_isp_set_anti_false_color_attr(hi_vi_pipe vi_pipe,
188                                             const hi_isp_antifalsecolor_attr *anti_false_color);
189 hi_s32 hi_mpi_isp_get_anti_false_color_attr(hi_vi_pipe vi_pipe,
190                                             hi_isp_antifalsecolor_attr *anti_false_color);
191 
192 hi_s32 hi_mpi_isp_set_demosaic_attr(hi_vi_pipe vi_pipe, const hi_isp_demosaic_attr *demosaic_attr);
193 hi_s32 hi_mpi_isp_get_demosaic_attr(hi_vi_pipe vi_pipe, hi_isp_demosaic_attr *demosaic_attr);
194 
195 hi_s32 hi_mpi_isp_set_black_level_attr(hi_vi_pipe vi_pipe, const hi_isp_black_level *black_level);
196 hi_s32 hi_mpi_isp_get_black_level_attr(hi_vi_pipe vi_pipe, hi_isp_black_level *black_level);
197 
198 hi_s32 hi_mpi_isp_set_clut_attr(hi_vi_pipe vi_pipe, const hi_isp_clut_attr *clut_attr);
199 hi_s32 hi_mpi_isp_get_clut_attr(hi_vi_pipe vi_pipe, hi_isp_clut_attr *clut_attr);
200 
201 hi_s32 hi_mpi_isp_set_clut_coeff(hi_vi_pipe vi_pipe, const hi_isp_clut_lut *clut_lut);
202 hi_s32 hi_mpi_isp_get_clut_coeff(hi_vi_pipe vi_pipe, hi_isp_clut_lut *clut_lut);
203 
204 hi_s32 hi_mpi_isp_set_dcf_info(hi_vi_pipe vi_pipe, const hi_isp_dcf_info *isp_dcf);
205 hi_s32 hi_mpi_isp_get_dcf_info(hi_vi_pipe vi_pipe, hi_isp_dcf_info *isp_dcf);
206 
207 hi_s32 hi_mpi_isp_set_csc_attr(hi_vi_pipe vi_pipe, const hi_isp_csc_attr *csc_attr);
208 hi_s32 hi_mpi_isp_get_csc_attr(hi_vi_pipe vi_pipe, hi_isp_csc_attr *cscf_attr);
209 
210 hi_s32 hi_mpi_isp_set_rgbir_attr(hi_vi_pipe vi_pipe, const hi_isp_rgbir_attr *rgbir_attr);
211 hi_s32 hi_mpi_isp_get_rgbir_attr(hi_vi_pipe vi_pipe, hi_isp_rgbir_attr *rgbir_attr);
212 
213 hi_s32 hi_mpi_isp_set_register(hi_vi_pipe vi_pipe, hi_u32 addr, hi_u32 value);
214 hi_s32 hi_mpi_isp_get_register(hi_vi_pipe vi_pipe, hi_u32 addr, hi_u32 *value);
215 
216 /* block, return fpn frame when this is function is called. */
217 hi_s32 hi_mpi_isp_fpn_calibrate(hi_vi_pipe vi_pipe, hi_isp_fpn_calibrate_attr *calibrate_attr);
218 hi_s32 hi_mpi_isp_set_fpn_attr(hi_vi_pipe vi_pipe, const hi_isp_fpn_attr *fpn_attr);
219 hi_s32 hi_mpi_isp_get_fpn_attr(hi_vi_pipe vi_pipe, hi_isp_fpn_attr *fpn_attr);
220 
221 hi_s32 hi_mpi_isp_get_dng_image_static_info(hi_vi_pipe vi_pipe,
222                                             hi_isp_dng_image_static_info *dng_image_static_info);
223 hi_s32 hi_mpi_isp_set_dng_color_param(hi_vi_pipe vi_pipe, const hi_isp_dng_color_param *dng_color_param);
224 hi_s32 hi_mpi_isp_get_dng_color_param(hi_vi_pipe vi_pipe, hi_isp_dng_color_param *dng_color_param);
225 
226 hi_s32 hi_mpi_isp_set_smart_info(hi_vi_pipe vi_pipe, const hi_isp_smart_info *smart_info);
227 hi_s32 hi_mpi_isp_get_smart_info(hi_vi_pipe vi_pipe, hi_isp_smart_info *smart_info);
228 
229 hi_s32 hi_mpi_isp_set_frame_info(hi_vi_pipe vi_pipe, const hi_isp_frame_info *isp_frame);
230 hi_s32 hi_mpi_isp_get_frame_info(hi_vi_pipe vi_pipe, const hi_isp_frame_info *isp_frame);
231 
232 hi_s32 hi_mpi_isp_ir_auto_run_once(hi_vi_pipe vi_pipe, hi_isp_ir_auto_attr *ir_attr);
233 hi_s32 hi_mpi_isp_set_raw_pos(hi_vi_pipe vi_pipe, const  hi_isp_raw_pos_attr *raw_pos_attr);
234 hi_s32 hi_mpi_isp_get_raw_pos(hi_vi_pipe vi_pipe,   hi_isp_raw_pos_attr *raw_pos_attr);
235 
236 #ifdef __cplusplus
237 #if __cplusplus
238 }
239 #endif
240 #endif /* End of #ifdef __cplusplus */
241 #endif /* __MPI_ISP_ADAPT_H__ */
242