From a9d68972489e8c4db923426dea4b142f28a03b7a Mon Sep 17 00:00:00 2001 From: ZwX1616 Date: Fri, 23 Feb 2024 19:23:04 -0800 Subject: [PATCH] ae --- system/camerad/cameras/camera_qcom2.cc | 2 +- system/camerad/sensors/os04c10.cc | 29 ++++---------------------- 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/system/camerad/cameras/camera_qcom2.cc b/system/camerad/cameras/camera_qcom2.cc index 1c8a2457eb..4ee167a4c3 100644 --- a/system/camerad/cameras/camera_qcom2.cc +++ b/system/camerad/cameras/camera_qcom2.cc @@ -897,7 +897,7 @@ void CameraState::set_camera_exposure(float grey_frac) { // LOGE("ae - camera %d, cur_t %.5f, sof %.5f, dt %.5f", camera_num, 1e-9 * nanos_since_boot(), 1e-9 * buf.cur_frame_data.timestamp_sof, 1e-9 * (nanos_since_boot() - buf.cur_frame_data.timestamp_sof)); auto exp_reg_array = ci->getExposureRegisters(exposure_time, new_exp_g, dc_gain_enabled); - if (exp_reg_array.size()) sensors_i2c(exp_reg_array.data(), exp_reg_array.size(), CAM_SENSOR_PACKET_OPCODE_SENSOR_CONFIG, ci->data_word); + sensors_i2c(exp_reg_array.data(), exp_reg_array.size(), CAM_SENSOR_PACKET_OPCODE_SENSOR_CONFIG, ci->data_word); } static void process_driver_camera(MultiCameraState *s, CameraState *c, int cnt) { diff --git a/system/camerad/sensors/os04c10.cc b/system/camerad/sensors/os04c10.cc index b7bcbbb9e7..13a68799aa 100644 --- a/system/camerad/sensors/os04c10.cc +++ b/system/camerad/sensors/os04c10.cc @@ -16,9 +16,6 @@ const uint32_t os04c10_analog_gains_reg[] = { 0x5C0, 0x600, 0x640, 0x680, 0x700, 0x780, 0x800, 0x880, 0x900, 0x980, 0xA00, 0xA80, 0xB00, 0xB80, 0xC00, 0xC80, 0xD00, 0xD80, 0xE00, 0xE80, 0xF00, 0xF80}; -const uint32_t VS_TIME_MIN_OS04C10 = 1; -//const uint32_t VS_TIME_MAX_OS04C10 = 34; // vs < 35 - } // namespace OS04C10::OS04C10() { @@ -29,12 +26,6 @@ OS04C10::OS04C10() { frame_height = 1520; frame_stride = (frame_width*10/8); - /* - frame_width = 0xa80; - frame_height = 0x5f0; - frame_stride = 0xd20; - */ - extra_height = 0; frame_offset = 0; @@ -46,13 +37,13 @@ OS04C10::OS04C10() { frame_data_type = 0x2b; mclk_frequency = 24000000; // Hz - dc_gain_factor = 7.32; + dc_gain_factor = 1; dc_gain_min_weight = 1; // always on is fine dc_gain_max_weight = 1; dc_gain_on_grey = 0.9; dc_gain_off_grey = 1.0; exposure_time_min = 2; // 1x - exposure_time_max = 2016; + exposure_time_max = 3200; analog_gain_min_idx = 0x0; analog_gain_rec_idx = 0x0; // 1x analog_gain_max_idx = 0x36; @@ -68,24 +59,12 @@ OS04C10::OS04C10() { } std::vector OS04C10::getExposureRegisters(int exposure_time, int new_exp_g, bool dc_gain_enabled) const { - // t_HCG&t_LCG + t_VS on LPD, t_SPD on SPD uint32_t hcg_time = exposure_time; - //uint32_t lcg_time = hcg_time; - //uint32_t spd_time = std::min(std::max((uint32_t)exposure_time, (exposure_time_max + VS_TIME_MAX_OS04C10) / 3), exposure_time_max + VS_TIME_MAX_OS04C10); - //uint32_t vs_time = std::min(std::max((uint32_t)exposure_time / 40, VS_TIME_MIN_OS04C10), VS_TIME_MAX_OS04C10); - uint32_t real_gain = os04c10_analog_gains_reg[new_exp_g]; - hcg_time = 100; - real_gain = 0x0; - return { - //{0x3501, hcg_time>>8}, {0x3502, hcg_time&0xFF}, - //{0x3581, lcg_time>>8}, {0x3582, lcg_time&0xFF}, - //{0x3541, spd_time>>8}, {0x3542, spd_time&0xFF}, - //{0x35c2, vs_time&0xFF}, - - //{0x3508, real_gain>>8}, {0x3509, real_gain&0xFF}, + {0x3501, hcg_time>>8}, {0x3502, hcg_time&0xFF}, + {0x3508, real_gain>>8}, {0x3509, real_gain&0xFF}, }; }