{"action":"created","comment":{"url":"https://api.github.com/repos/python-pillow/Pillow/pulls/comments/66240900","id":66240900,"diff_hunk":"@@ -107,7 +107,7 @@ ImagingPrecompute(int inSize, int outSize, struct filter *filterp,\n     if ( ! kk)\n         return 0;\n \n-    xbounds = calloc(outSize * 2, sizeof(int));\n+    xbounds = malloc(outSize * 2 * sizeof(int));","path":"libImaging/Resample.c","position":19,"original_position":5,"commit_id":"12c8cf94f244b3fc1039e71c7a664b97a2045554","original_commit_id":"f09067e45eeecdd85e8d379ddb7f2ea581e08708","user":{"login":"homm","id":128982,"avatar_url":"https://avatars.githubusercontent.com/u/128982?v=3","gravatar_id":"","url":"https://api.github.com/users/homm","html_url":"https://github.com/homm","followers_url":"https://api.github.com/users/homm/followers","following_url":"https://api.github.com/users/homm/following{/other_user}","gists_url":"https://api.github.com/users/homm/gists{/gist_id}","starred_url":"https://api.github.com/users/homm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/homm/subscriptions","organizations_url":"https://api.github.com/users/homm/orgs","repos_url":"https://api.github.com/users/homm/repos","events_url":"https://api.github.com/users/homm/events{/privacy}","received_events_url":"https://api.github.com/users/homm/received_events","type":"User","site_admin":false},"body":"I've returned malloc anywhere and clearing values [with loop](https://github.com/uploadcare/pillow-simd/blob/12c8cf94f244b3fc1039e71c7a664b97a2045554/libImaging/Resample.c#L138).","created_at":"2016-06-08T11:51:18Z","updated_at":"2016-06-08T11:51:18Z","html_url":"https://github.com/python-pillow/Pillow/pull/1933#discussion_r66240900","pull_request_url":"https://api.github.com/repos/python-pillow/Pillow/pulls/1933","_links":{"self":{"href":"https://api.github.com/repos/python-pillow/Pillow/pulls/comments/66240900"},"html":{"href":"https://github.com/python-pillow/Pillow/pull/1933#discussion_r66240900"},"pull_request":{"href":"https://api.github.com/repos/python-pillow/Pillow/pulls/1933"}}},"pull_request":{"url":"https://api.github.com/repos/python-pillow/Pillow/pulls/1933","id":71799879,"html_url":"https://github.com/python-pillow/Pillow/pull/1933","diff_url":"https://github.com/python-pillow/Pillow/pull/1933.diff","patch_url":"https://github.com/python-pillow/Pillow/pull/1933.patch","issue_url":"https://api.github.com/repos/python-pillow/Pillow/issues/1933","number":1933,"state":"open","locked":false,"title":"Resample vertical pass","user":{"login":"homm","id":128982,"avatar_url":"https://avatars.githubusercontent.com/u/128982?v=3","gravatar_id":"","url":"https://api.github.com/users/homm","html_url":"https://github.com/homm","followers_url":"https://api.github.com/users/homm/followers","following_url":"https://api.github.com/users/homm/following{/other_user}","gists_url":"https://api.github.com/users/homm/gists{/gist_id}","starred_url":"https://api.github.com/users/homm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/homm/subscriptions","organizations_url":"https://api.github.com/users/homm/orgs","repos_url":"https://api.github.com/users/homm/repos","events_url":"https://api.github.com/users/homm/events{/privacy}","received_events_url":"https://api.github.com/users/homm/received_events","type":"User","site_admin":false},"body":"This PR implements separate vertical pass of resampling instead of two transposes.\r\n\r\nOriginally [I've replaced](https://github.com/python-pillow/Pillow/commit/40f9f48) two passes with transpose for the following reasons:\r\n\r\n1. It was harder to heavily change the code in two branches simultaneously.\r\n2. It makes downscaling faster, although upscaling became slightly slower.\r\n\r\nSince then there are many tests for resampling were written and many optimizations were implemented. Now it is time to return upscaling performance.\r\n\r\nResult on aws ec2 c4.large with 1920×1280 RGB image. Megapixels of source image per second.\r\n\r\n            | Destination   | Filter  | 3.2    | FPI    | Vertical pass\r\n------------|---------------|---------|--------|--------|--------------\r\nDownscaling | **16x16**     | Bilinear| 229.31 | 381.97 | 386.89\r\n            |               | Bicubic | 120.64 | 203.59 | 204.98\r\n            |               | Lanczos |  81.33 | 135.74 | 136.20\r\n            | **320x180**   | Bilinear| 133.08 | 161.96 | 193.30\r\n            |               | Bicubic |  77.00 | 109.46 | 123.08\r\n            |               | Lanczos |  51.36 |  77.48 |  83.27\r\nUpscaling   | **2048x1155** | Bilinear|  25.78 |  27.81 |  40.14\r\n            |               | Bicubic |  20.60 |  23.75 |  31.83\r\n            |               | Lanczos |  17.04 |  19.50 |  25.00\r\n            | **5120x2880** | Bilinear|   5.55 |   5.74 |   8.91\r\n            |               | Bicubic |   4.54 |   4.98 |   7.25\r\n            |               | Lanczos |   3.80 |   4.33 |   5.93\r\n\r\nI also include results of stable version and fixed-point separetely to show what FPI doesn't affect upscaling too much, while vertical pass does. Vertical pass faster for upscaling in average by 40% and also makes downscaling to reasonable sizes 10% faster in average.\r\n\r\nThis last two improvements together makes all resampling operations about 60% faster.","created_at":"2016-05-28T11:32:31Z","updated_at":"2016-06-08T11:51:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4858b292e87d609f08fd03135782551cbd6e807b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/python-pillow/Pillow/pulls/1933/commits","review_comments_url":"https://api.github.com/repos/python-pillow/Pillow/pulls/1933/comments","review_comment_url":"https://api.github.com/repos/python-pillow/Pillow/pulls/comments{/number}","comments_url":"https://api.github.com/repos/python-pillow/Pillow/issues/1933/comments","statuses_url":"https://api.github.com/repos/python-pillow/Pillow/statuses/12c8cf94f244b3fc1039e71c7a664b97a2045554","head":{"label":"uploadcare:resample-vertical-pass","ref":"resample-vertical-pass","sha":"12c8cf94f244b3fc1039e71c7a664b97a2045554","user":{"login":"uploadcare","id":978311,"avatar_url":"https://avatars.githubusercontent.com/u/978311?v=3","gravatar_id":"","url":"https://api.github.com/users/uploadcare","html_url":"https://github.com/uploadcare","followers_url":"https://api.github.com/users/uploadcare/followers","following_url":"https://api.github.com/users/uploadcare/following{/other_user}","gists_url":"https://api.github.com/users/uploadcare/gists{/gist_id}","starred_url":"https://api.github.com/users/uploadcare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uploadcare/subscriptions","organizations_url":"https://api.github.com/users/uploadcare/orgs","repos_url":"https://api.github.com/users/uploadcare/repos","events_url":"https://api.github.com/users/uploadcare/events{/privacy}","received_events_url":"https://api.github.com/users/uploadcare/received_events","type":"Organization","site_admin":false},"repo":{"id":26542499,"name":"pillow-simd","full_name":"uploadcare/pillow-simd","owner":{"login":"uploadcare","id":978311,"avatar_url":"https://avatars.githubusercontent.com/u/978311?v=3","gravatar_id":"","url":"https://api.github.com/users/uploadcare","html_url":"https://github.com/uploadcare","followers_url":"https://api.github.com/users/uploadcare/followers","following_url":"https://api.github.com/users/uploadcare/following{/other_user}","gists_url":"https://api.github.com/users/uploadcare/gists{/gist_id}","starred_url":"https://api.github.com/users/uploadcare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uploadcare/subscriptions","organizations_url":"https://api.github.com/users/uploadcare/orgs","repos_url":"https://api.github.com/users/uploadcare/repos","events_url":"https://api.github.com/users/uploadcare/events{/privacy}","received_events_url":"https://api.github.com/users/uploadcare/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/uploadcare/pillow-simd","description":"The friendly PIL fork","fork":true,"url":"https://api.github.com/repos/uploadcare/pillow-simd","forks_url":"https://api.github.com/repos/uploadcare/pillow-simd/forks","keys_url":"https://api.github.com/repos/uploadcare/pillow-simd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uploadcare/pillow-simd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uploadcare/pillow-simd/teams","hooks_url":"https://api.github.com/repos/uploadcare/pillow-simd/hooks","issue_events_url":"https://api.github.com/repos/uploadcare/pillow-simd/issues/events{/number}","events_url":"https://api.github.com/repos/uploadcare/pillow-simd/events","assignees_url":"https://api.github.com/repos/uploadcare/pillow-simd/assignees{/user}","branches_url":"https://api.github.com/repos/uploadcare/pillow-simd/branches{/branch}","tags_url":"https://api.github.com/repos/uploadcare/pillow-simd/tags","blobs_url":"https://api.github.com/repos/uploadcare/pillow-simd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uploadcare/pillow-simd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uploadcare/pillow-simd/git/refs{/sha}","trees_url":"https://api.github.com/repos/uploadcare/pillow-simd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uploadcare/pillow-simd/statuses/{sha}","languages_url":"https://api.github.com/repos/uploadcare/pillow-simd/languages","stargazers_url":"https://api.github.com/repos/uploadcare/pillow-simd/stargazers","contributors_url":"https://api.github.com/repos/uploadcare/pillow-simd/contributors","subscribers_url":"https://api.github.com/repos/uploadcare/pillow-simd/subscribers","subscription_url":"https://api.github.com/repos/uploadcare/pillow-simd/subscription","commits_url":"https://api.github.com/repos/uploadcare/pillow-simd/commits{/sha}","git_commits_url":"https://api.github.com/repos/uploadcare/pillow-simd/git/commits{/sha}","comments_url":"https://api.github.com/repos/uploadcare/pillow-simd/comments{/number}","issue_comment_url":"https://api.github.com/repos/uploadcare/pillow-simd/issues/comments{/number}","contents_url":"https://api.github.com/repos/uploadcare/pillow-simd/contents/{+path}","compare_url":"https://api.github.com/repos/uploadcare/pillow-simd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uploadcare/pillow-simd/merges","archive_url":"https://api.github.com/repos/uploadcare/pillow-simd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uploadcare/pillow-simd/downloads","issues_url":"https://api.github.com/repos/uploadcare/pillow-simd/issues{/number}","pulls_url":"https://api.github.com/repos/uploadcare/pillow-simd/pulls{/number}","milestones_url":"https://api.github.com/repos/uploadcare/pillow-simd/milestones{/number}","notifications_url":"https://api.github.com/repos/uploadcare/pillow-simd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uploadcare/pillow-simd/labels{/name}","releases_url":"https://api.github.com/repos/uploadcare/pillow-simd/releases{/id}","deployments_url":"https://api.github.com/repos/uploadcare/pillow-simd/deployments","created_at":"2014-11-12T15:33:02Z","updated_at":"2016-06-06T19:04:46Z","pushed_at":"2016-06-08T00:46:46Z","git_url":"git://github.com/uploadcare/pillow-simd.git","ssh_url":"git@github.com:uploadcare/pillow-simd.git","clone_url":"https://github.com/uploadcare/pillow-simd.git","svn_url":"https://github.com/uploadcare/pillow-simd","homepage":"http://python-pillow.github.io/","size":17858,"stargazers_count":306,"watchers_count":306,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":1,"forks":8,"open_issues":1,"watchers":306,"default_branch":"3.2.x-simd"}},"base":{"label":"python-pillow:master","ref":"master","sha":"2af16a7b584a6d2be2069cd2f3d1000f417e4eb3","user":{"login":"python-pillow","id":2036701,"avatar_url":"https://avatars.githubusercontent.com/u/2036701?v=3","gravatar_id":"","url":"https://api.github.com/users/python-pillow","html_url":"https://github.com/python-pillow","followers_url":"https://api.github.com/users/python-pillow/followers","following_url":"https://api.github.com/users/python-pillow/following{/other_user}","gists_url":"https://api.github.com/users/python-pillow/gists{/gist_id}","starred_url":"https://api.github.com/users/python-pillow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/python-pillow/subscriptions","organizations_url":"https://api.github.com/users/python-pillow/orgs","repos_url":"https://api.github.com/users/python-pillow/repos","events_url":"https://api.github.com/users/python-pillow/events{/privacy}","received_events_url":"https://api.github.com/users/python-pillow/received_events","type":"Organization","site_admin":false},"repo":{"id":5171600,"name":"Pillow","full_name":"python-pillow/Pillow","owner":{"login":"python-pillow","id":2036701,"avatar_url":"https://avatars.githubusercontent.com/u/2036701?v=3","gravatar_id":"","url":"https://api.github.com/users/python-pillow","html_url":"https://github.com/python-pillow","followers_url":"https://api.github.com/users/python-pillow/followers","following_url":"https://api.github.com/users/python-pillow/following{/other_user}","gists_url":"https://api.github.com/users/python-pillow/gists{/gist_id}","starred_url":"https://api.github.com/users/python-pillow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/python-pillow/subscriptions","organizations_url":"https://api.github.com/users/python-pillow/orgs","repos_url":"https://api.github.com/users/python-pillow/repos","events_url":"https://api.github.com/users/python-pillow/events{/privacy}","received_events_url":"https://api.github.com/users/python-pillow/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/python-pillow/Pillow","description":"The friendly PIL fork (Python Imaging Library)","fork":false,"url":"https://api.github.com/repos/python-pillow/Pillow","forks_url":"https://api.github.com/repos/python-pillow/Pillow/forks","keys_url":"https://api.github.com/repos/python-pillow/Pillow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/python-pillow/Pillow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/python-pillow/Pillow/teams","hooks_url":"https://api.github.com/repos/python-pillow/Pillow/hooks","issue_events_url":"https://api.github.com/repos/python-pillow/Pillow/issues/events{/number}","events_url":"https://api.github.com/repos/python-pillow/Pillow/events","assignees_url":"https://api.github.com/repos/python-pillow/Pillow/assignees{/user}","branches_url":"https://api.github.com/repos/python-pillow/Pillow/branches{/branch}","tags_url":"https://api.github.com/repos/python-pillow/Pillow/tags","blobs_url":"https://api.github.com/repos/python-pillow/Pillow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/python-pillow/Pillow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/python-pillow/Pillow/git/refs{/sha}","trees_url":"https://api.github.com/repos/python-pillow/Pillow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/python-pillow/Pillow/statuses/{sha}","languages_url":"https://api.github.com/repos/python-pillow/Pillow/languages","stargazers_url":"https://api.github.com/repos/python-pillow/Pillow/stargazers","contributors_url":"https://api.github.com/repos/python-pillow/Pillow/contributors","subscribers_url":"https://api.github.com/repos/python-pillow/Pillow/subscribers","subscription_url":"https://api.github.com/repos/python-pillow/Pillow/subscription","commits_url":"https://api.github.com/repos/python-pillow/Pillow/commits{/sha}","git_commits_url":"https://api.github.com/repos/python-pillow/Pillow/git/commits{/sha}","comments_url":"https://api.github.com/repos/python-pillow/Pillow/comments{/number}","issue_comment_url":"https://api.github.com/repos/python-pillow/Pillow/issues/comments{/number}","contents_url":"https://api.github.com/repos/python-pillow/Pillow/contents/{+path}","compare_url":"https://api.github.com/repos/python-pillow/Pillow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/python-pillow/Pillow/merges","archive_url":"https://api.github.com/repos/python-pillow/Pillow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/python-pillow/Pillow/downloads","issues_url":"https://api.github.com/repos/python-pillow/Pillow/issues{/number}","pulls_url":"https://api.github.com/repos/python-pillow/Pillow/pulls{/number}","milestones_url":"https://api.github.com/repos/python-pillow/Pillow/milestones{/number}","notifications_url":"https://api.github.com/repos/python-pillow/Pillow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/python-pillow/Pillow/labels{/name}","releases_url":"https://api.github.com/repos/python-pillow/Pillow/releases{/id}","deployments_url":"https://api.github.com/repos/python-pillow/Pillow/deployments","created_at":"2012-07-24T21:38:39Z","updated_at":"2016-06-08T03:15:02Z","pushed_at":"2016-06-08T00:46:48Z","git_url":"git://github.com/python-pillow/Pillow.git","ssh_url":"git@github.com:python-pillow/Pillow.git","clone_url":"https://github.com/python-pillow/Pillow.git","svn_url":"https://github.com/python-pillow/Pillow","homepage":"http://python-pillow.org","size":24813,"stargazers_count":2533,"watchers_count":2533,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":545,"mirror_url":null,"open_issues_count":178,"forks":545,"open_issues":178,"watchers":2533,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/python-pillow/Pillow/pulls/1933"},"html":{"href":"https://github.com/python-pillow/Pillow/pull/1933"},"issue":{"href":"https://api.github.com/repos/python-pillow/Pillow/issues/1933"},"comments":{"href":"https://api.github.com/repos/python-pillow/Pillow/issues/1933/comments"},"review_comments":{"href":"https://api.github.com/repos/python-pillow/Pillow/pulls/1933/comments"},"review_comment":{"href":"https://api.github.com/repos/python-pillow/Pillow/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/python-pillow/Pillow/pulls/1933/commits"},"statuses":{"href":"https://api.github.com/repos/python-pillow/Pillow/statuses/12c8cf94f244b3fc1039e71c7a664b97a2045554"}}}}
{"actor":{"display_login":"homm"}}