高通 eeprom lsc值的计算
在eeprom烧录中 lsc的值需要驱动中自己计算
LSC: Lens shading and Color shading
reasons:
- Camera module assembly variation such as l ens holder alignment with camera module
- Lens assembly variation
- Sensor micro lens variation(sensor CRA variation).
- Pan/tilt of image sensor during assembly
计算
数据存放格式
总共抓取17*13 block,获取每块的四通道平均值:
R_spc = (Measured Red average / R_max) * 1023;
Gr_spc = (Measured Gr average / Gr_max)*1023;
Gb_spc = (Measured Gb average / Gb_max)*1023;
B_spc = (Measured Blue average / B_max) *1023;
低位在前 高位在后
lsc_buf = e_ctrl->eeprom_params.buffer + LSC_DATA_OFFSET;
for (light = 0; light < ROLLOFF_MAX_LIGHT; light++) {
e_ctrl->eeprom_data.lsc.lsc_calib[light].mesh_rolloff_table_size =
LSC_GRID_SIZE;
}
for (i = 0; i < LSC_GRID_SIZE * 8; i += 8) {
gain_r = lsc_buf[i + 0] | lsc_buf[i + 1]<< 8;
gain_gr = lsc_buf[i + 2] | lsc_buf[i + 3]<< 8;
gain_gb = lsc_buf[i + 4] | lsc_buf[i + 5]<< 8;
gain_b = lsc_buf[i + 6] | lsc_buf[i + 7]<< 8;
for (light = 0; light < ROLLOFF_MAX_LIGHT; light++) {
e_ctrl->eeprom_data.lsc.lsc_calib[light].r_gain[i/8] = gain_r;
e_ctrl->eeprom_data.lsc.lsc_calib[light].gr_gain[i/8] = gain_gr;
e_ctrl->eeprom_data.lsc.lsc_calib[light].gb_gain[i/8] = gain_gb;
e_ctrl->eeprom_data.lsc.lsc_calib[light].b_gain[i/8] = gain_b;
}
}
高位在前 低位在后
lsc_buf = e_ctrl->eeprom_params.buffer + LSC_DATA_OFFSET;
for (light = 0; light < ROLLOFF_MAX_LIGHT; light++) {
e_ctrl->eeprom_data.lsc.lsc_calib[light].mesh_rolloff_table_size =
LSC_GRID_SIZE;
}
for (i = 0; i < LSC_GRID_SIZE * 8; i += 8) {
gain_r = lsc_buf[i + 0] << 8 | lsc_buf[i + 1];
gain_gr = lsc_buf[i + 2] << 8 | lsc_buf[i + 3];
gain_gb = lsc_buf[i + 4] << 8 | lsc_buf[i + 5];
gain_b = lsc_buf[i + 6] << 8 | lsc_buf[i + 7];
for (light = 0; light < ROLLOFF_MAX_LIGHT; light++) {
e_ctrl->eeprom_data.lsc.lsc_calib[light].r_gain[i/8] = gain_r;
e_ctrl->eeprom_data.lsc.lsc_calib[light].gr_gain[i/8] = gain_gr;
e_ctrl->eeprom_data.lsc.lsc_calib[light].gb_gain[i/8] = gain_gb;
e_ctrl->eeprom_data.lsc.lsc_calib[light].b_gain[i/8] = gain_b;
}
}