Skip to content

WUI based implementation to initUndistortRectifyMap#14994

Merged
alalek merged 4 commits intoopencv:3.4from
terfendail:wintr_undistort
Jul 18, 2019
Merged

WUI based implementation to initUndistortRectifyMap#14994
alalek merged 4 commits intoopencv:3.4from
terfendail:wintr_undistort

Conversation

@terfendail
Copy link
Copy Markdown
Contributor

This pullrequest changes

WUI based implementation to initUndistortRectifyMap

@terfendail terfendail force-pushed the wintr_undistort branch 5 times, most recently from ecc8e34 to 09dd6d3 Compare July 9, 2019 12:31
@terfendail
Copy link
Copy Markdown
Contributor Author

Performance change for InitUndistortMap::Undistort

Baseline Reference time PR time Speedup
SSE2 4.561 2.189 2.08
SSE3 4.560 2.195 2.08
SSE4_2 4.452 2.069 2.15
AVX2 0.930 0.860 1.08

#if CV_TRY_AVX2
#if CV_TRY_AVX2
if( useAVX2 )
j = cv::initUndistortRectifyMapLine_AVX(m1f, m2f, m1, m2,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What is about performance difference between w.u.i below and this "AVX" code branch?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I suppose AVX2 branch should be executed for AVX2 baseline. Also I've tested performance against CPU_BASELINE=AVX2 and CPU_DISPATCH=AVX2 and got 15% performance improvement. So I think average performance gain is about 10% due to manual cycle unrolling and a few reused constant values.
I think it is reasonable to replace AVX2 branch with dynamic dispatching of w.u.i code. Does it make sense to make this change a part of the PR?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It make sense to avoid code duplication if we archiving similar performance.

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 👍

@alalek alalek merged commit e0f8bb8 into opencv:3.4 Jul 18, 2019
@alalek alalek mentioned this pull request Jul 18, 2019
@terfendail terfendail deleted the wintr_undistort branch July 19, 2019 10:05
dvd42 pushed a commit to dvd42/opencv that referenced this pull request Aug 6, 2019
WUI based implementation to initUndistortRectifyMap (opencv#14994)

* Add initUndistortRectifyMap performance test

* Move cv namespace boundaries

* Add wide universal intrinsics based implementation to initUndistortRectifyMap

* Dispatch undistort
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.

2 participants