Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ds2 add pitch #107

Merged
merged 5 commits into from
Jun 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions board/canaan/k510/k510_rootfs_skeleton/etc/init.d/rc.sysinit
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ cd /
ntpdate ntp.aliyun.com >/dev/null 2>&1 &
/app/dsp_log/dsp_log &

i2ctransfer -f -y 0 w3@0x10 0x01 0x00 0x00

cd /app/mediactl_lib/
./v4l2_drm.out -f video_drm_1080x1920.conf -e 1 &
cd /
6 changes: 4 additions & 2 deletions package/ai/code/object_detect_opencv/data/video.conf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"video5_width":320,
"video5_height":240,
"video5_height_r":240,
"video5_out_format":1
"video5_out_format":1,
"video5_pitch":320
}
},
"sensor1":{
Expand Down Expand Up @@ -70,7 +71,8 @@
"video9_width":320,
"video9_height":240,
"video9_height_r":240,
"video9_out_format":1
"video9_out_format":1,
"video9_pitch":320
}
},
"mipi_csi2":{
Expand Down
6 changes: 4 additions & 2 deletions package/ai/code/object_detect_v4l2/data/video.conf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"video5_width":320,
"video5_height":240,
"video5_height_r":240,
"video5_out_format":1
"video5_out_format":1,
"video5_pitch":320
}
},
"sensor1":{
Expand Down Expand Up @@ -70,7 +71,8 @@
"video9_width":320,
"video9_height":240,
"video9_height_r":240,
"video9_out_format":1
"video9_out_format":1,
"video9_pitch":320
}
},
"mipi_csi2":{
Expand Down
6 changes: 4 additions & 2 deletions package/ai/code/retinaface_mb_320_opencv/data/video.conf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"video5_width":320,
"video5_height":240,
"video5_height_r":240,
"video5_out_format":1
"video5_out_format":1,
"video5_pitch":320
}
},
"sensor1":{
Expand Down Expand Up @@ -70,7 +71,8 @@
"video9_width":320,
"video9_height":240,
"video9_height_r":240,
"video9_out_format":1
"video9_out_format":1,
"video9_pitch":320
}
},
"mipi_csi2":{
Expand Down
6 changes: 4 additions & 2 deletions package/ai/code/retinaface_mb_320_v4l2/data/video.conf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"video5_width":320,
"video5_height":240,
"video5_height_r":240,
"video5_out_format":1
"video5_out_format":1,
"video5_pitch":320
}
},
"sensor1":{
Expand Down Expand Up @@ -70,7 +71,8 @@
"video9_width":320,
"video9_height":240,
"video9_height_r":240,
"video9_out_format":1
"video9_out_format":1,
"video9_pitch":320
}
},
"mipi_csi2":{
Expand Down
6 changes: 4 additions & 2 deletions package/ai/code/video_object_detect_320.conf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"video5_width":320,
"video5_height":320,
"video5_height_r":240,
"video5_out_format":0
"video5_out_format":0,
"video5_pitch":320
}
},
"sensor1":{
Expand Down Expand Up @@ -70,7 +71,8 @@
"video9_width":320,
"video9_height":240,
"video9_height_r":240,
"video9_out_format":1
"video9_out_format":1,
"video9_pitch":320
}
},
"mipi_csi2":{
Expand Down
6 changes: 4 additions & 2 deletions package/ai/code/video_object_detect_320x320.conf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"video5_width":320,
"video5_height":320,
"video5_height_r":320,
"video5_out_format":0
"video5_out_format":0,
"video5_pitch":320
}
},
"sensor1":{
Expand Down Expand Up @@ -70,7 +71,8 @@
"video9_width":320,
"video9_height":240,
"video9_height_r":240,
"video9_out_format":1
"video9_out_format":1,
"video9_pitch":320
}
},
"mipi_csi2":{
Expand Down
6 changes: 4 additions & 2 deletions package/ai/code/video_object_detect_432x368.conf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"video5_width":432,
"video5_height":368,
"video5_height_r":368,
"video5_out_format":0
"video5_out_format":0,
"video5_pitch":432
}
},
"sensor1":{
Expand Down Expand Up @@ -70,7 +71,8 @@
"video9_width":320,
"video9_height":240,
"video9_height_r":240,
"video9_out_format":1
"video9_out_format":1,
"video9_pitch":320
}
},
"mipi_csi2":{
Expand Down
6 changes: 4 additions & 2 deletions package/ai/code/video_object_detect_512.conf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"video5_width":512,
"video5_height":512,
"video5_height_r":400,
"video5_out_format":0
"video5_out_format":0,
"video5_pitch":512
}
},
"sensor1":{
Expand Down Expand Up @@ -70,7 +71,8 @@
"video9_width":320,
"video9_height":240,
"video9_height_r":240,
"video9_out_format":1
"video9_out_format":1,
"video9_pitch":320
}
},
"mipi_csi2":{
Expand Down
6 changes: 4 additions & 2 deletions package/ai/code/video_object_detect_640.conf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"video5_width":640,
"video5_height":640,
"video5_height_r":480,
"video5_out_format":0
"video5_out_format":0,
"video5_pitch":640
}
},
"sensor1":{
Expand Down Expand Up @@ -70,7 +71,8 @@
"video9_width":320,
"video9_height":240,
"video9_height_r":240,
"video9_out_format":1
"video9_out_format":1,
"video9_pitch":320
}
},
"mipi_csi2":{
Expand Down
6 changes: 4 additions & 2 deletions package/ai/code/video_object_detect_640x480.conf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"video5_width":640,
"video5_height":480,
"video5_height_r":480,
"video5_out_format":0
"video5_out_format":0,
"video5_pitch":640
}
},
"sensor1":{
Expand Down Expand Up @@ -70,7 +71,8 @@
"video9_width":320,
"video9_height":240,
"video9_height_r":240,
"video9_out_format":1
"video9_out_format":1,
"video9_pitch":320
}
},
"mipi_csi2":{
Expand Down
6 changes: 4 additions & 2 deletions package/encode_app/src/video_sample.conf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"video5_width":320,
"video5_height":320,
"video5_height_r":240,
"video5_out_format":1
"video5_out_format":1,
"video5_pitch":320
}
},
"sensor1":{
Expand Down Expand Up @@ -70,7 +71,8 @@
"video9_width":320,
"video9_height":240,
"video9_height_r":240,
"video9_out_format":1
"video9_out_format":1,
"video9_pitch":320
}
},
"mipi_csi2":{
Expand Down
6 changes: 4 additions & 2 deletions package/encode_app/src/video_sample_720p60.conf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"video5_width":320,
"video5_height":320,
"video5_height_r":240,
"video5_out_format":1
"video5_out_format":1,
"video5_pitch":320
}
},
"sensor1":{
Expand Down Expand Up @@ -70,7 +71,8 @@
"video9_width":320,
"video9_height":240,
"video9_height_r":240,
"video9_out_format":1
"video9_out_format":1,
"video9_pitch":320
}
},
"mipi_csi2":{
Expand Down
6 changes: 4 additions & 2 deletions package/encode_app/src/video_sample_vga480p75.conf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"video5_width":320,
"video5_height":320,
"video5_height_r":240,
"video5_out_format":1
"video5_out_format":1,
"video5_pitch":320
}
},
"sensor1":{
Expand Down Expand Up @@ -70,7 +71,8 @@
"video9_width":320,
"video9_height":240,
"video9_height_r":240,
"video9_out_format":1
"video9_out_format":1,
"video9_pitch":320
}
},
"mipi_csi2":{
Expand Down
24 changes: 24 additions & 0 deletions package/ffmpeg_canaan/0024-buildroot-ffmpeg.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Index: b/libavdevice/video_sample.conf
===================================================================
--- a/libavdevice/video_sample.conf
+++ b/libavdevice/video_sample.conf
@@ -33,7 +33,8 @@
"video5_width":320,
"video5_height":320,
"video5_height_r":240,
- "video5_out_format":1
+ "video5_out_format":1,
+ "video5_pitch":320
}
},
"sensor1":{
@@ -70,7 +71,8 @@
"video9_width":320,
"video9_height":240,
"video9_height_r":240,
- "video9_out_format":1
+ "video9_out_format":1,
+ "video9_pitch":320
}
},
"mipi_csi2":{
6 changes: 4 additions & 2 deletions package/mediactl_lib/src/config/video_drm_1080x1920.conf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"video5_width":320,
"video5_height":320,
"video5_height_r":240,
"video5_out_format":1
"video5_out_format":1,
"video5_pitch":320
}
},
"sensor1":{
Expand Down Expand Up @@ -70,7 +71,8 @@
"video9_width":320,
"video9_height":240,
"video9_height_r":240,
"video9_out_format":1
"video9_out_format":1,
"video9_pitch":320
}
},
"mipi_csi2":{
Expand Down
6 changes: 4 additions & 2 deletions package/mediactl_lib/src/config/video_drm_1080x1920_r2k.conf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"video5_width":320,
"video5_height":320,
"video5_height_r":240,
"video5_out_format":1
"video5_out_format":1,
"video5_pitch":320
}
},
"sensor1":{
Expand Down Expand Up @@ -70,7 +71,8 @@
"video9_width":320,
"video9_height":240,
"video9_height_r":240,
"video9_out_format":1
"video9_out_format":1,
"video9_pitch":320
}
},
"mipi_csi2":{
Expand Down
6 changes: 4 additions & 2 deletions package/mediactl_lib/src/config/video_drm_1920x1080.conf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"video5_width":320,
"video5_height":320,
"video5_height_r":240,
"video5_out_format":1
"video5_out_format":1,
"video5_pitch":320
}
},
"sensor1":{
Expand Down Expand Up @@ -70,7 +71,8 @@
"video9_width":320,
"video9_height":240,
"video9_height_r":240,
"video9_out_format":1
"video9_out_format":1,
"video9_pitch":320
}
},
"mipi_csi2":{
Expand Down
6 changes: 4 additions & 2 deletions package/mediactl_lib/src/isp/isp_cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ int isp_f2k_cfg(struct media_entity *entity,struct isp_cfg_info *isp_cfg,uint32_
isp_wrap_info->ds1Info.ds1_uv_buf1_base = phyAddr+line_stride*height;

//
width = isp_wrap_info->ds2Info.ds2_size.width;
//width = isp_wrap_info->ds2Info.ds2_size.width;
width = isp_wrap_info->ds2Info.ds2_size.pitch; // add pitch
line_stride = calc_stride(width);
if( OUT_ARGB == isp_wrap_info->ds2Info.ds2_out_img_out_format)
{
Expand Down Expand Up @@ -421,7 +422,8 @@ int isp_r2k_cfg(struct media_entity *entity,struct isp_cfg_info *isp_cfg,uint32_
isp_wrap_info->ds1Info.ds1_uv_buf1_base = phyAddr+line_stride*height;

//
width = isp_wrap_info->ds2Info.ds2_size.width;
//width = isp_wrap_info->ds2Info.ds2_size.width;
width = isp_wrap_info->ds2Info.ds2_size.pitch;
line_stride = calc_stride(width);
if( OUT_ARGB == isp_wrap_info->ds2Info.ds2_out_img_out_format)
{
Expand Down
1 change: 1 addition & 0 deletions package/mediactl_lib/src/isp/isp_com.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ struct image_size_s
{
unsigned int width;
unsigned int height;
unsigned int pitch;
};

typedef enum _VI_PIPE_ID
Expand Down
Loading