调整配置使得能支持最低1帧的帧率

main
Matthew 1 week ago
parent 51601d4783
commit 2f3843a40d

@ -53,7 +53,7 @@ static struct imgsensor_info_struct imgsensor_info = {
.pre = {
.pclk = 148500000,
.linelength = 0x1130, //0x0898, //2200 //record different mode's linelength
.framelength = 0x0465, //0x0456 1110//0x08ca 2250, //record different mode's framelength
.framelength = 0x41EB, //0x0465, //0x0456 1110//0x08ca 2250, //record different mode's framelength
.startx = 0, //record different mode's startx of grabwindow
.starty = 12, //record different mode's starty of grabwindow
.grabwindow_width = 1920, //record different mode's width of grabwindow
@ -64,7 +64,7 @@ static struct imgsensor_info_struct imgsensor_info = {
.cap = {
.pclk = 148500000,
.linelength = 0x1130,
.framelength = 0x0465,
.framelength = 0x41EB, //0x0465,
.startx = 0,
.starty = 12,
.grabwindow_width = 1920,
@ -75,7 +75,7 @@ static struct imgsensor_info_struct imgsensor_info = {
.cap1 = {
.pclk = 148500000,
.linelength = 0x1130,
.framelength = 0x0465,
.framelength = 0x41EB, //0x0465,
.startx = 0,
.starty = 12,
.grabwindow_width = 1920,
@ -116,11 +116,11 @@ static struct imgsensor_info_struct imgsensor_info = {
.grabwindow_width = 1920,
.grabwindow_height = 1080,
.mipi_data_lp2hs_settle_dc = 85,
.max_framerate = 300,
.max_framerate = 300,
},
.margin = 2,
.margin = 16,
.min_shutter = 1,
.max_frame_length = 0xffff,
.max_frame_length = 0xfffff,
.ae_shut_delay_frame = 0,
.ae_sensor_gain_delay_frame = 0,
.ae_ispGain_delay_frame = 2,
@ -332,8 +332,14 @@ static void set_max_framerate(UINT16 framerate,kal_bool min_framelength_en)
kal_uint32 frame_length = imgsensor.frame_length;
LOG_INF("framerate = %d, min framelength should enable = %d\n", framerate,min_framelength_en);
frame_length = imgsensor.pclk / framerate * 10 / imgsensor.line_length;
// Allow 1fps
if (framerate < 1) {
framerate = 1;
}
spin_lock(&imgsensor_drv_lock);
imgsensor.frame_length = (frame_length > imgsensor.min_frame_length) ? frame_length : imgsensor.min_frame_length;
imgsensor.dummy_line = imgsensor.frame_length - imgsensor.min_frame_length;
@ -383,7 +389,7 @@ static void write_shutter(kal_uint16 shutter)
write_cmos_sensor(0x0104, 0x01);
write_cmos_sensor(0x3018, (imgsensor.frame_length&0x0000ff));
write_cmos_sensor(0x3019, (imgsensor.frame_length&0x00ff00)>>8);
write_cmos_sensor(0x301a, (imgsensor.frame_length&0x030000)>>16);
write_cmos_sensor(0x301a, (imgsensor.frame_length&0xff0000)>>16);
write_cmos_sensor(0x0104, 0x00);
}
} else {
@ -391,7 +397,7 @@ static void write_shutter(kal_uint16 shutter)
write_cmos_sensor(0x0104, 0x01);
write_cmos_sensor(0x3018, (imgsensor.frame_length&0x0000ff));
write_cmos_sensor(0x3019, (imgsensor.frame_length&0x00ff00)>>8);
write_cmos_sensor(0x301a, (imgsensor.frame_length&0x030000)>>16);
write_cmos_sensor(0x301a, (imgsensor.frame_length&0xff0000)>>16);
write_cmos_sensor(0x0104, 0x00);
}
// Update Shutter
@ -399,11 +405,12 @@ static void write_shutter(kal_uint16 shutter)
LOG_INF("shutter1 =%d, framelength1 =%d\n", shutter,imgsensor.frame_length);
if(shutter < 1)
if(shutter < 1) {
shutter = 1;
}
if(shutter > 1123)
shutter = 1123;
// if(shutter > 1123)
// shutter = 1123;
write_cmos_sensor(0x0104, 0x01);
write_cmos_sensor(0x3020, shutter&0xFF);

@ -14718,7 +14718,7 @@ Fno,20
// Index MiniExp1/T MaxExp1/T MinGain MaxGain
AETABLE_RPEVIEW_AUTO
90,-50
1,30000,30,1024,1024
1,30000,1,1024,1024
2,30,30,1024,4096
3,30,20,4096,4096
4,20,20,4096,10240
@ -14732,7 +14732,7 @@ AETABLE_END
// Index MiniExp1/T MaxExp1/T MinGain MaxGain
AETABLE_CAPTURE_AUTO
90,-50
1,30000,30,1024,1024
1,30000,1,1024,1024
2,30,30,1024,4096
3,30,20,4096,4096
4,20,20,4096,10240

Loading…
Cancel
Save