{"action":"created","comment":{"url":"https://api.github.com/repos/paparazzi/paparazzi/pulls/comments/79279954","id":79279954,"diff_hunk":"@@ -781,6 +781,52 @@ static void mt9f002_set_gains(struct mt9f002_t *mt)\n   write_reg(mt, MT9F002_GREEN2_GAIN, mt9f002_calc_gain(mt->gain_green2), 2);\n }\n \n+void mt9f002_set_resolution(struct mt9f002_t *mt)\n+{\n+\t/* Set output resolution */\n+\t  write_reg(mt, MT9F002_X_OUTPUT_SIZE, mt->output_width, 2);\n+\t  write_reg(mt, MT9F002_Y_OUTPUT_SIZE, mt->output_height, 2);\n+\t  /* Set scaling */\n+\t  uint16_t scaleFactor = ceil((float)MT9F002_SCALER_N / mt->output_scaler);\n+\t  mt->output_scaler = (float)MT9F002_SCALER_N / scaleFactor;\n+\t  int x_skip_factor = (mt->x_odd_inc + 1) / 2;\n+\t  int y_skip_factor = (mt->y_odd_inc + 1) / 2;\n+\t  mt->scaled_width \t= ceil((float)mt->output_width / mt->output_scaler) * x_skip_factor - mt->x_odd_inc;\n+\t  mt->scaled_height = ceil((float)mt->output_height / mt->output_scaler) * y_skip_factor - mt->y_odd_inc;\n+\t  if (mt->output_scaler != 1.0)\n+\t  {\n+\t    write_reg(mt, MT9F002_SCALING_MODE, 2, 2); // Vertical and horizontal scaling\n+\t    write_reg(mt, MT9F002_SCALE_M, scaleFactor, 2);\n+\t  }\n+\t  printf(\"OUTPUT_SIZE: (%i, %i)\\tSCALED_SIZE: (%i, %i)\\n\", mt->output_width, mt->output_height, mt->scaled_width, mt->scaled_height);","path":"sw/airborne/boards/bebop/mt9f002.c","position":32,"original_position":32,"commit_id":"fc022b0e1caa23f3ab50b3e82ec71c7c8415e2eb","original_commit_id":"fc022b0e1caa23f3ab50b3e82ec71c7c8415e2eb","user":{"login":"kirkscheper","id":2835523,"avatar_url":"https://avatars.githubusercontent.com/u/2835523?v=3","gravatar_id":"","url":"https://api.github.com/users/kirkscheper","html_url":"https://github.com/kirkscheper","followers_url":"https://api.github.com/users/kirkscheper/followers","following_url":"https://api.github.com/users/kirkscheper/following{/other_user}","gists_url":"https://api.github.com/users/kirkscheper/gists{/gist_id}","starred_url":"https://api.github.com/users/kirkscheper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kirkscheper/subscriptions","organizations_url":"https://api.github.com/users/kirkscheper/orgs","repos_url":"https://api.github.com/users/kirkscheper/repos","events_url":"https://api.github.com/users/kirkscheper/events{/privacy}","received_events_url":"https://api.github.com/users/kirkscheper/received_events","type":"User","site_admin":false},"body":"I guess this was for debugging?","created_at":"2016-09-17T09:14:51Z","updated_at":"2016-09-17T09:30:11Z","html_url":"https://github.com/paparazzi/paparazzi/pull/1856#discussion_r79279954","pull_request_url":"https://api.github.com/repos/paparazzi/paparazzi/pulls/1856","_links":{"self":{"href":"https://api.github.com/repos/paparazzi/paparazzi/pulls/comments/79279954"},"html":{"href":"https://github.com/paparazzi/paparazzi/pull/1856#discussion_r79279954"},"pull_request":{"href":"https://api.github.com/repos/paparazzi/paparazzi/pulls/1856"}}},"pull_request":{"url":"https://api.github.com/repos/paparazzi/paparazzi/pulls/1856","id":85552175,"html_url":"https://github.com/paparazzi/paparazzi/pull/1856","diff_url":"https://github.com/paparazzi/paparazzi/pull/1856.diff","patch_url":"https://github.com/paparazzi/paparazzi/pull/1856.patch","issue_url":"https://api.github.com/repos/paparazzi/paparazzi/issues/1856","number":1856,"state":"open","locked":false,"title":"Bebop front camera subsampling","user":{"login":"wilcoschoneveld","id":3064588,"avatar_url":"https://avatars.githubusercontent.com/u/3064588?v=3","gravatar_id":"","url":"https://api.github.com/users/wilcoschoneveld","html_url":"https://github.com/wilcoschoneveld","followers_url":"https://api.github.com/users/wilcoschoneveld/followers","following_url":"https://api.github.com/users/wilcoschoneveld/following{/other_user}","gists_url":"https://api.github.com/users/wilcoschoneveld/gists{/gist_id}","starred_url":"https://api.github.com/users/wilcoschoneveld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilcoschoneveld/subscriptions","organizations_url":"https://api.github.com/users/wilcoschoneveld/orgs","repos_url":"https://api.github.com/users/wilcoschoneveld/repos","events_url":"https://api.github.com/users/wilcoschoneveld/events{/privacy}","received_events_url":"https://api.github.com/users/wilcoschoneveld/received_events","type":"User","site_admin":false},"body":"This pull request allows for sub-sampling in the bebop front camera to reduce the camera resolution and increase performance. I took the work from @wv-tud and updated it with the latest master. The current settings give a steady 15 fps.\r\n\r\nI'm trying to figure out how to correctly combine subsampling with a desired output size in order to get a more conventional image size, but there are a number of programming restrictions to follow; http://www.onsemi.com/pub_link/Collateral/MT9F002-D.PDF","created_at":"2016-09-16T10:41:49Z","updated_at":"2016-09-17T09:30:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5f93af3f2940a4a0b394fcb5533a41652ef52145","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/paparazzi/paparazzi/pulls/1856/commits","review_comments_url":"https://api.github.com/repos/paparazzi/paparazzi/pulls/1856/comments","review_comment_url":"https://api.github.com/repos/paparazzi/paparazzi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/paparazzi/paparazzi/issues/1856/comments","statuses_url":"https://api.github.com/repos/paparazzi/paparazzi/statuses/fc022b0e1caa23f3ab50b3e82ec71c7c8415e2eb","head":{"label":"wilcoschoneveld:front_cam_subsampling","ref":"front_cam_subsampling","sha":"fc022b0e1caa23f3ab50b3e82ec71c7c8415e2eb","user":{"login":"wilcoschoneveld","id":3064588,"avatar_url":"https://avatars.githubusercontent.com/u/3064588?v=3","gravatar_id":"","url":"https://api.github.com/users/wilcoschoneveld","html_url":"https://github.com/wilcoschoneveld","followers_url":"https://api.github.com/users/wilcoschoneveld/followers","following_url":"https://api.github.com/users/wilcoschoneveld/following{/other_user}","gists_url":"https://api.github.com/users/wilcoschoneveld/gists{/gist_id}","starred_url":"https://api.github.com/users/wilcoschoneveld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilcoschoneveld/subscriptions","organizations_url":"https://api.github.com/users/wilcoschoneveld/orgs","repos_url":"https://api.github.com/users/wilcoschoneveld/repos","events_url":"https://api.github.com/users/wilcoschoneveld/events{/privacy}","received_events_url":"https://api.github.com/users/wilcoschoneveld/received_events","type":"User","site_admin":false},"repo":{"id":58475026,"name":"paparazzi","full_name":"wilcoschoneveld/paparazzi","owner":{"login":"wilcoschoneveld","id":3064588,"avatar_url":"https://avatars.githubusercontent.com/u/3064588?v=3","gravatar_id":"","url":"https://api.github.com/users/wilcoschoneveld","html_url":"https://github.com/wilcoschoneveld","followers_url":"https://api.github.com/users/wilcoschoneveld/followers","following_url":"https://api.github.com/users/wilcoschoneveld/following{/other_user}","gists_url":"https://api.github.com/users/wilcoschoneveld/gists{/gist_id}","starred_url":"https://api.github.com/users/wilcoschoneveld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilcoschoneveld/subscriptions","organizations_url":"https://api.github.com/users/wilcoschoneveld/orgs","repos_url":"https://api.github.com/users/wilcoschoneveld/repos","events_url":"https://api.github.com/users/wilcoschoneveld/events{/privacy}","received_events_url":"https://api.github.com/users/wilcoschoneveld/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wilcoschoneveld/paparazzi","description":"Paparazzi is a free and open-source hardware and software project for unmanned (air) vehicles.","fork":true,"url":"https://api.github.com/repos/wilcoschoneveld/paparazzi","forks_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/forks","keys_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/teams","hooks_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/hooks","issue_events_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/issues/events{/number}","events_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/events","assignees_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/assignees{/user}","branches_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/branches{/branch}","tags_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/tags","blobs_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/git/refs{/sha}","trees_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/statuses/{sha}","languages_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/languages","stargazers_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/stargazers","contributors_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/contributors","subscribers_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/subscribers","subscription_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/subscription","commits_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/commits{/sha}","git_commits_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/git/commits{/sha}","comments_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/comments{/number}","issue_comment_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/issues/comments{/number}","contents_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/contents/{+path}","compare_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/merges","archive_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/downloads","issues_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/issues{/number}","pulls_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/pulls{/number}","milestones_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/milestones{/number}","notifications_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/labels{/name}","releases_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/releases{/id}","deployments_url":"https://api.github.com/repos/wilcoschoneveld/paparazzi/deployments","created_at":"2016-05-10T15:58:47Z","updated_at":"2016-06-21T16:42:28Z","pushed_at":"2016-09-16T15:49:11Z","git_url":"git://github.com/wilcoschoneveld/paparazzi.git","ssh_url":"git@github.com:wilcoschoneveld/paparazzi.git","clone_url":"https://github.com/wilcoschoneveld/paparazzi.git","svn_url":"https://github.com/wilcoschoneveld/paparazzi","homepage":"http://paparazziuav.org","size":69998,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"paparazzi:master","ref":"master","sha":"16a447da37ea718646906756cda17a5ed38d8739","user":{"login":"paparazzi","id":318080,"avatar_url":"https://avatars.githubusercontent.com/u/318080?v=3","gravatar_id":"","url":"https://api.github.com/users/paparazzi","html_url":"https://github.com/paparazzi","followers_url":"https://api.github.com/users/paparazzi/followers","following_url":"https://api.github.com/users/paparazzi/following{/other_user}","gists_url":"https://api.github.com/users/paparazzi/gists{/gist_id}","starred_url":"https://api.github.com/users/paparazzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paparazzi/subscriptions","organizations_url":"https://api.github.com/users/paparazzi/orgs","repos_url":"https://api.github.com/users/paparazzi/repos","events_url":"https://api.github.com/users/paparazzi/events{/privacy}","received_events_url":"https://api.github.com/users/paparazzi/received_events","type":"Organization","site_admin":false},"repo":{"id":1068018,"name":"paparazzi","full_name":"paparazzi/paparazzi","owner":{"login":"paparazzi","id":318080,"avatar_url":"https://avatars.githubusercontent.com/u/318080?v=3","gravatar_id":"","url":"https://api.github.com/users/paparazzi","html_url":"https://github.com/paparazzi","followers_url":"https://api.github.com/users/paparazzi/followers","following_url":"https://api.github.com/users/paparazzi/following{/other_user}","gists_url":"https://api.github.com/users/paparazzi/gists{/gist_id}","starred_url":"https://api.github.com/users/paparazzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paparazzi/subscriptions","organizations_url":"https://api.github.com/users/paparazzi/orgs","repos_url":"https://api.github.com/users/paparazzi/repos","events_url":"https://api.github.com/users/paparazzi/events{/privacy}","received_events_url":"https://api.github.com/users/paparazzi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/paparazzi/paparazzi","description":"Paparazzi is a free and open-source hardware and software project for unmanned (air) vehicles. This is the main software repository.","fork":false,"url":"https://api.github.com/repos/paparazzi/paparazzi","forks_url":"https://api.github.com/repos/paparazzi/paparazzi/forks","keys_url":"https://api.github.com/repos/paparazzi/paparazzi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paparazzi/paparazzi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paparazzi/paparazzi/teams","hooks_url":"https://api.github.com/repos/paparazzi/paparazzi/hooks","issue_events_url":"https://api.github.com/repos/paparazzi/paparazzi/issues/events{/number}","events_url":"https://api.github.com/repos/paparazzi/paparazzi/events","assignees_url":"https://api.github.com/repos/paparazzi/paparazzi/assignees{/user}","branches_url":"https://api.github.com/repos/paparazzi/paparazzi/branches{/branch}","tags_url":"https://api.github.com/repos/paparazzi/paparazzi/tags","blobs_url":"https://api.github.com/repos/paparazzi/paparazzi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paparazzi/paparazzi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paparazzi/paparazzi/git/refs{/sha}","trees_url":"https://api.github.com/repos/paparazzi/paparazzi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paparazzi/paparazzi/statuses/{sha}","languages_url":"https://api.github.com/repos/paparazzi/paparazzi/languages","stargazers_url":"https://api.github.com/repos/paparazzi/paparazzi/stargazers","contributors_url":"https://api.github.com/repos/paparazzi/paparazzi/contributors","subscribers_url":"https://api.github.com/repos/paparazzi/paparazzi/subscribers","subscription_url":"https://api.github.com/repos/paparazzi/paparazzi/subscription","commits_url":"https://api.github.com/repos/paparazzi/paparazzi/commits{/sha}","git_commits_url":"https://api.github.com/repos/paparazzi/paparazzi/git/commits{/sha}","comments_url":"https://api.github.com/repos/paparazzi/paparazzi/comments{/number}","issue_comment_url":"https://api.github.com/repos/paparazzi/paparazzi/issues/comments{/number}","contents_url":"https://api.github.com/repos/paparazzi/paparazzi/contents/{+path}","compare_url":"https://api.github.com/repos/paparazzi/paparazzi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paparazzi/paparazzi/merges","archive_url":"https://api.github.com/repos/paparazzi/paparazzi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paparazzi/paparazzi/downloads","issues_url":"https://api.github.com/repos/paparazzi/paparazzi/issues{/number}","pulls_url":"https://api.github.com/repos/paparazzi/paparazzi/pulls{/number}","milestones_url":"https://api.github.com/repos/paparazzi/paparazzi/milestones{/number}","notifications_url":"https://api.github.com/repos/paparazzi/paparazzi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paparazzi/paparazzi/labels{/name}","releases_url":"https://api.github.com/repos/paparazzi/paparazzi/releases{/id}","deployments_url":"https://api.github.com/repos/paparazzi/paparazzi/deployments","created_at":"2010-11-10T11:14:08Z","updated_at":"2016-09-16T04:42:38Z","pushed_at":"2016-09-17T00:16:44Z","git_url":"git://github.com/paparazzi/paparazzi.git","ssh_url":"git@github.com:paparazzi/paparazzi.git","clone_url":"https://github.com/paparazzi/paparazzi.git","svn_url":"https://github.com/paparazzi/paparazzi","homepage":"http://paparazziuav.org","size":101287,"stargazers_count":610,"watchers_count":610,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":631,"mirror_url":null,"open_issues_count":126,"forks":631,"open_issues":126,"watchers":610,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/paparazzi/paparazzi/pulls/1856"},"html":{"href":"https://github.com/paparazzi/paparazzi/pull/1856"},"issue":{"href":"https://api.github.com/repos/paparazzi/paparazzi/issues/1856"},"comments":{"href":"https://api.github.com/repos/paparazzi/paparazzi/issues/1856/comments"},"review_comments":{"href":"https://api.github.com/repos/paparazzi/paparazzi/pulls/1856/comments"},"review_comment":{"href":"https://api.github.com/repos/paparazzi/paparazzi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/paparazzi/paparazzi/pulls/1856/commits"},"statuses":{"href":"https://api.github.com/repos/paparazzi/paparazzi/statuses/fc022b0e1caa23f3ab50b3e82ec71c7c8415e2eb"}}}}
{"actor":{"display_login":"kirkscheper"}}