Convert HOG from SSE SIMD to HAL - 35-45% faster on Power (VSX)#15199
Merged
alalek merged 4 commits intoopencv:3.4from Aug 8, 2019
ChipKerchner:hogToHal
Merged
Convert HOG from SSE SIMD to HAL - 35-45% faster on Power (VSX)#15199alalek merged 4 commits intoopencv:3.4from ChipKerchner:hogToHal
alalek merged 4 commits intoopencv:3.4from
ChipKerchner:hogToHal
Conversation
Contributor
|
Shouldn't it be transformed differently? Before: #if CV_SSE2
...
#elif CV_NEON
...
#else
...
#endifAfter: #if CV_SIMD128 // or CV_SIMD for wide universal intrinsics
...
#else
...
#endif |
Contributor
Author
|
I could remove the NEON specific code and use the CV_SIMD128 for 3 platforms (SSE2, NEON, VSX) instead. I just did NOT have a way of testing NEON. |
Member
|
Yes, this is right way. |
terfendail
reviewed
Aug 1, 2019
modules/objdetect/src/hog.cpp
Outdated
|
|
||
| v_int32x4 sign = (ione & v_reinterpret_as_s32(_angle < fzero)); | ||
| v_int32x4 _hidx = v_trunc(_angle); | ||
| _hidx -= sign; |
Contributor
There was a problem hiding this comment.
I suppose v_floor intrinsic could be used here to compute _hidx instead of lines 502-504
terfendail
reviewed
Aug 2, 2019
modules/objdetect/src/hog.cpp
Outdated
| v_int32x4 mask0 = _hidx >> 31; | ||
| v_int32x4 it0 = mask0 & _nbins; | ||
| mask0 = (_hidx < _nbins); | ||
| v_int32x4 it1 = ~mask0 & _nbins; |
Contributor
There was a problem hiding this comment.
I think the code will seem simpler if >= is used instead of < invertion
alalek
reviewed
Aug 2, 2019
modules/objdetect/src/hog.cpp
Outdated
| int32x4_t ifour = vdupq_n_s32(4); | ||
| #if CV_SIMD128 | ||
| const float a[] = { 0.0, 1.0, 2.0, 3.0 }; | ||
| v_float32x4 idx = v_load((float *)a); |
Member
There was a problem hiding this comment.
v_float32x4 idx(0.0f, 1.0f, 2.0f, 3.0f); here and above (line 251).
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Convert HOG from SSE SIMD to HAL - 35-45% faster on Power (VSX).