mirror of
https://github.com/opencv/opencv.git
synced 2025-06-13 04:52:53 +08:00
Merge pull request #11162 from kinchungwong:master
This commit is contained in:
commit
017c217bb0
@ -323,14 +323,10 @@ void HOGDescriptor::computeGradient(const Mat& img, Mat& grad, Mat& qangle,
|
|||||||
int end = gradsize.width + 2;
|
int end = gradsize.width + 2;
|
||||||
xmap -= 1, x = 0;
|
xmap -= 1, x = 0;
|
||||||
#if CV_SSE2
|
#if CV_SSE2
|
||||||
__m128i ithree = _mm_set1_epi32(3);
|
|
||||||
for ( ; x <= end - 4; x += 4)
|
for ( ; x <= end - 4; x += 4)
|
||||||
{
|
{
|
||||||
//emulation of _mm_mullo_epi32
|
|
||||||
__m128i mul_res = _mm_loadu_si128((const __m128i*)(xmap + x));
|
__m128i mul_res = _mm_loadu_si128((const __m128i*)(xmap + x));
|
||||||
__m128i tmp1 = _mm_mul_epu32(ithree, mul_res);
|
mul_res = _mm_add_epi32(_mm_add_epi32(mul_res, mul_res), mul_res); // multiply by 3
|
||||||
__m128i tmp2 = _mm_mul_epu32( _mm_srli_si128(ithree,4), _mm_srli_si128(mul_res,4));
|
|
||||||
mul_res = _mm_unpacklo_epi32(_mm_shuffle_epi32(tmp1, _MM_SHUFFLE (0,0,2,0)), _mm_shuffle_epi32(tmp2, _MM_SHUFFLE (0,0,2,0)));
|
|
||||||
_mm_storeu_si128((__m128i*)(xmap + x), mul_res);
|
_mm_storeu_si128((__m128i*)(xmap + x), mul_res);
|
||||||
}
|
}
|
||||||
#elif CV_NEON
|
#elif CV_NEON
|
||||||
|
Loading…
Reference in New Issue
Block a user