Skip to content

This submission is used to improve the performance of the inpaint algorithm for 3 channels images(RGB or BGR)#20746

Merged
opencv-pushbot merged 1 commit intoopencv:3.4from
easonycwang:easonycwang/inpaint_perf_opt
Sep 24, 2021
Merged

This submission is used to improve the performance of the inpaint algorithm for 3 channels images(RGB or BGR)#20746
opencv-pushbot merged 1 commit intoopencv:3.4from
easonycwang:easonycwang/inpaint_perf_opt

Conversation

@easonycwang
Copy link
Copy Markdown

@easonycwang easonycwang commented Sep 24, 2021

This submission is used to improve the performance of the inpaint algorithm for 3 channels images(RGB or BGR).

Reason:
The original algorithm implementation did not consider the cache hits and repeated calculation
The loop of channels is outside the core loop, so the performance is not very good.
Moving the channel loop inside the core loop can significantly improve cache hits and reduce the redundant calculation, thereby improving performance.

Performance:
360P, about >= 30% improvement
iphone8P: 5.52ms -> 3.75ms
iphone6s: 14.04ms -> 9.15ms

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@alalek
Copy link
Copy Markdown
Member

alalek commented Sep 24, 2021

Thank you for contribution!

This patch should go into 3.4 branch first.
We will merge changes from 3.4 into master regularly (weekly/bi-weekly).

Please:

  • change "base" branch of this PR: master => 3.4 (use "Edit" button near PR title)
  • rebase your commits from master onto 3.4 branch. For example:
    git rebase -i --onto upstream/3.4 upstream/master
    (check list of your commits, save and quit (Esc + "wq" + Enter)
    where upstream is configured by following this GitHub guide and fetched (git fetch upstream).
  • push rebased commits into source branch of your fork (with --force option)

Note: no needs to re-open PR, apply changes "inplace".

@easonycwang easonycwang changed the base branch from master to 3.4 September 24, 2021 13:38
This submission is used to improve the performance of the inpaint algorithm for 3 channels images(RGB or BGR).

Reason:
The original algorithm implementation did not consider the cache hits.
The loop of channels is outside the core loop, so the perfmance is not very good.
Moving the channel loop inside the core loop can significantly improve cache hits, thereby improving performance.

Performance:
360P, about >= 30% improvement
iphone8P: 5.52ms -> 3.75ms
iphone6s: 14.04ms -> 9.15ms
@easonycwang easonycwang force-pushed the easonycwang/inpaint_perf_opt branch from bb37005 to 91ff45f Compare September 24, 2021 13:48
@easonycwang easonycwang changed the title Tile:This submission is used to improve the performance of the inpaint algorithm for 3 channels images(RGB or BGR) This submission is used to improve the performance of the inpaint algorithm for 3 channels images(RGB or BGR) Sep 24, 2021
@easonycwang easonycwang reopened this Sep 24, 2021
@easonycwang
Copy link
Copy Markdown
Author

Thanks!
I have been rebased this commit!
@alalek

Copy link
Copy Markdown
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done! Thank you 👍

@opencv-pushbot opencv-pushbot merged commit f96569d into opencv:3.4 Sep 24, 2021
@alalek alalek mentioned this pull request Sep 25, 2021
@alalek alalek mentioned this pull request Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants