.. | .. |
---|
23 | 23 | #include "isp_otp_golden.h" |
---|
24 | 24 | |
---|
25 | 25 | |
---|
26 | | -unsigned int isp_lib_log_param = 0;//0xffffffff; |
---|
| 26 | +unsigned int isp_manage_lib_log_param = 0;//0xffffffff; |
---|
| 27 | +unsigned int msc_update_sel; |
---|
27 | 28 | |
---|
28 | 29 | void isp_get_saved_regs(struct isp_lib_context *isp_gen) |
---|
29 | 30 | { |
---|
.. | .. |
---|
137 | 138 | isp_gen->rolloff_entity_ctx.rolloff_param->rolloff_frame_id = isp_gen->af_frame_cnt; |
---|
138 | 139 | //rolloff_sensor_info. |
---|
139 | 140 | isp_gen->rolloff_entity_ctx.rolloff_param->rolloff_sensor_info = isp_gen->sensor_info; |
---|
140 | | - //rolloff lsc_cfg. |
---|
141 | | - isp_gen->rolloff_entity_ctx.rolloff_param->lsc_cfg = isp_gen->module_cfg.lens_cfg.lsc_cfg; |
---|
| 141 | + isp_gen->rolloff_entity_ctx.rolloff_param->rolloff_ctrl = isp_gen->alsc_settings; |
---|
142 | 142 | } |
---|
143 | 143 | |
---|
144 | 144 | void __isp_rolloff_run(struct isp_lib_context *isp_gen) |
---|
.. | .. |
---|
149 | 149 | |
---|
150 | 150 | isp_rolloff_cxt->ops->isp_rolloff_run(isp_rolloff_cxt->rolloff_entity, |
---|
151 | 151 | &isp_rolloff_cxt->rolloff_stats, &isp_rolloff_cxt->rolloff_result); |
---|
152 | | - |
---|
153 | | - if (!isp_gen->isp_ini_cfg.isp_test_settings.wdr_en) { |
---|
154 | | - for (i = 0; i < 256; i++) |
---|
155 | | - { |
---|
156 | | - lens_tbl[4*i + 0] = isp_rolloff_cxt->rolloff_result.lens_table_output[i + 0]; |
---|
157 | | - lens_tbl[4*i + 1] = isp_rolloff_cxt->rolloff_result.lens_table_output[i + 256]; |
---|
158 | | - lens_tbl[4*i + 2] = isp_rolloff_cxt->rolloff_result.lens_table_output[i + 512]; |
---|
159 | | - } |
---|
160 | | - } else { |
---|
161 | | - for (i = 0; i < 256; i++) |
---|
162 | | - { |
---|
163 | | - lens_tbl[4*i + 0] = (unsigned short)sqrt((double)isp_rolloff_cxt->rolloff_result.lens_table_output[i + 0] * 1024); |
---|
164 | | - lens_tbl[4*i + 1] = (unsigned short)sqrt((double)isp_rolloff_cxt->rolloff_result.lens_table_output[i + 256] * 1024); |
---|
165 | | - lens_tbl[4*i + 2] = (unsigned short)sqrt((double)isp_rolloff_cxt->rolloff_result.lens_table_output[i + 512] * 1024); |
---|
166 | | - } |
---|
167 | | - } |
---|
168 | 152 | } |
---|
169 | 153 | |
---|
170 | 154 | void __isp_afs_set_params(struct isp_lib_context *isp_gen) |
---|
.. | .. |
---|
237 | 221 | { |
---|
238 | 222 | isp_gen->awb_entity_ctx.awb_param->awb_frame_id = isp_gen->awb_frame_cnt; |
---|
239 | 223 | isp_gen->awb_entity_ctx.awb_param->awb_ctrl = isp_gen->awb_settings; |
---|
| 224 | + isp_gen->awb_entity_ctx.awb_param->awb_isp_id = isp_gen->isp_id; |
---|
240 | 225 | //sensor info. |
---|
241 | 226 | isp_gen->awb_entity_ctx.awb_param->awb_sensor_info = isp_gen->sensor_info; |
---|
242 | 227 | } |
---|
.. | .. |
---|
458 | 443 | isp_gen->stats_ctx.wb_gain_saved.gb_gain = 256; |
---|
459 | 444 | isp_gen->stats_ctx.wb_gain_saved.b_gain = 256; |
---|
460 | 445 | |
---|
| 446 | + //alsc settings |
---|
| 447 | + isp_gen->alsc_settings.frequency = 6; |
---|
| 448 | + isp_gen->alsc_settings.start = isp_gen->alsc_settings.frequency * 5; |
---|
| 449 | + isp_gen->alsc_settings.smooth_pool_size = 16; |
---|
| 450 | + isp_gen->alsc_settings.th_tableSwitch = 2; |
---|
| 451 | + isp_gen->alsc_settings.th_lowLight = 35; |
---|
| 452 | + isp_gen->alsc_settings.th_complex = 563; |
---|
| 453 | + isp_gen->alsc_settings.th_highSat = 645; |
---|
| 454 | + isp_gen->alsc_settings.th_semiFlat = 46; |
---|
| 455 | + |
---|
461 | 456 | //dynamic judge |
---|
462 | 457 | dynamic_stats->enable = 0; |
---|
463 | 458 | |
---|
.. | .. |
---|
564 | 559 | |
---|
565 | 560 | mod_cfg->module_enable_flag |= ISP_FEATURES_MODE; |
---|
566 | 561 | |
---|
567 | | - isp_lib_log_param = param->isp_test_settings.isp_log_param; |
---|
| 562 | + isp_manage_lib_log_param = param->isp_test_settings.isp_log_param; |
---|
568 | 563 | |
---|
569 | 564 | return 0; |
---|
570 | 565 | } |
---|
.. | .. |
---|
1537 | 1532 | |
---|
1538 | 1533 | HW_S32 __isp_ctx_update_rolloff_cfg(struct isp_lib_context *isp_gen) |
---|
1539 | 1534 | { |
---|
| 1535 | + int m; |
---|
| 1536 | + |
---|
1540 | 1537 | if (!isp_gen->rolloff_entity_ctx.rolloff_param) { |
---|
1541 | 1538 | return -1; |
---|
1542 | 1539 | } |
---|
1543 | 1540 | |
---|
1544 | 1541 | //rolloff_sensor_info. |
---|
1545 | 1542 | isp_gen->rolloff_entity_ctx.rolloff_param->rolloff_sensor_info = isp_gen->sensor_info; |
---|
1546 | | - //rolloff_ini_cfg. |
---|
1547 | | - memcpy(&isp_gen->rolloff_entity_ctx.rolloff_param->rolloff_ini.lens_table_ini[0], |
---|
1548 | | - &isp_gen->isp_ini_cfg.isp_tunning_settings.lsc_tbl[0][3], 768*sizeof(unsigned short)); |
---|
1549 | | - isp_gen->rolloff_entity_ctx.rolloff_param->rolloff_ini.rolloff_ratio = isp_gen->isp_ini_cfg.isp_tunning_settings.rolloff_ratio; |
---|
1550 | | - isp_rolloff_set_params_helper(&isp_gen->rolloff_entity_ctx, ISP_ROLLOFF_INI_DATA); |
---|
1551 | 1543 | |
---|
1552 | | - //rolloff lsc_cfg. |
---|
1553 | | - isp_gen->rolloff_entity_ctx.rolloff_param->lsc_cfg = isp_gen->module_cfg.lens_cfg.lsc_cfg; |
---|
| 1544 | + for (m = 0; m < 11 * ROLLOFF_WIN_SIZE; m++) { |
---|
| 1545 | + isp_gen->rolloff_entity_ctx.rolloff_param->rolloff_ini.Rgain[m] |
---|
| 1546 | + = isp_gen->isp_ini_cfg.isp_tunning_settings.msc_tbl[(m / ROLLOFF_WIN_SIZE) + 1][m % ROLLOFF_WIN_SIZE]; |
---|
| 1547 | + } |
---|
| 1548 | + |
---|
| 1549 | + isp_rolloff_set_params_helper(&isp_gen->rolloff_entity_ctx, ISP_ROLLOFF_INI_DATA); |
---|
1554 | 1550 | |
---|
1555 | 1551 | return 0; |
---|
1556 | 1552 | } |
---|
.. | .. |
---|
1809 | 1805 | __isp_awb_run(isp_gen); |
---|
1810 | 1806 | |
---|
1811 | 1807 | if (isp_gen->isp_ini_cfg.isp_test_settings.lsc_en) { |
---|
1812 | | -#if ISP_LIB_USE_ROLLOFF |
---|
1813 | | - __isp_rolloff_set_params(isp_gen); |
---|
1814 | | - __isp_rolloff_run(isp_gen); |
---|
1815 | | -#else |
---|
1816 | 1808 | config_lens_table(isp_gen, isp_gen->af_entity_ctx.af_result.std_code_output); |
---|
1817 | | -#endif |
---|
1818 | 1809 | } |
---|
1819 | 1810 | |
---|
1820 | 1811 | #if (ISP_VERSION >= 521) |
---|
1821 | 1812 | if (isp_gen->isp_ini_cfg.isp_test_settings.msc_en) { |
---|
| 1813 | + if (isp_gen->isp_ini_cfg.isp_tunning_settings.mff_mod >= 3) { |
---|
| 1814 | + __isp_rolloff_set_params(isp_gen); |
---|
| 1815 | + __isp_rolloff_run(isp_gen); |
---|
| 1816 | + } |
---|
1822 | 1817 | config_msc_table(isp_gen, isp_gen->af_entity_ctx.af_result.std_code_output); |
---|
1823 | 1818 | } |
---|
1824 | 1819 | #endif |
---|