From: Ilya Lavrenov Date: Mon, 17 Dec 2012 11:50:01 +0000 (+0400) Subject: changed loop condition X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~4062^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d246b415738b40c84095378bd540f7ac2abe91aa;p=platform%2Fupstream%2Fopencv.git changed loop condition --- diff --git a/modules/imgproc/src/imgwarp.cpp b/modules/imgproc/src/imgwarp.cpp index 8afddc9..ede6604 100644 --- a/modules/imgproc/src/imgwarp.cpp +++ b/modules/imgproc/src/imgwarp.cpp @@ -1271,7 +1271,7 @@ public: if (cn == 1) { __m128i masklow = _mm_set1_epi16(0x00ff); - for ( ; dx < w - 8; dx += 8, S0 += 16, S1 += 16, D += 8) + for ( ; dx <= w - 8; dx += 8, S0 += 16, S1 += 16, D += 8) { __m128i r0 = _mm_loadu_si128((const __m128i*)S0); __m128i r1 = _mm_loadu_si128((const __m128i*)S1); @@ -1285,7 +1285,7 @@ public: } } else if (cn == 3) - for ( ; dx < w - 6; dx += 6, S0 += 12, S1 += 12, D += 6) + for ( ; dx <= w - 6; dx += 6, S0 += 12, S1 += 12, D += 6) { __m128i r0 = _mm_loadu_si128((const __m128i*)S0); __m128i r1 = _mm_loadu_si128((const __m128i*)S1); @@ -1310,7 +1310,7 @@ public: else { CV_Assert(cn == 4); - for ( ; dx < w - 8; dx += 8, S0 += 16, S1 += 16, D += 8) + for ( ; dx <= w - 8; dx += 8, S0 += 16, S1 += 16, D += 8) { __m128i r0 = _mm_loadu_si128((const __m128i*)S0); __m128i r1 = _mm_loadu_si128((const __m128i*)S1); @@ -1368,7 +1368,7 @@ public: if (cn == 1) { - for ( ; dx < w - 4; dx += 4, S0 += 8, S1 += 8, D += 4) + for ( ; dx <= w - 4; dx += 4, S0 += 8, S1 += 8, D += 4) { __m128i r0 = _mm_loadu_si128((const __m128i*)S0); __m128i r1 = _mm_loadu_si128((const __m128i*)S1); @@ -1383,7 +1383,7 @@ public: } } else if (cn == 3) - for ( ; dx < w - 3; dx += 3, S0 += 6, S1 += 6, D += 3) + for ( ; dx <= w - 3; dx += 3, S0 += 6, S1 += 6, D += 3) { __m128i r0 = _mm_loadu_si128((const __m128i*)S0); __m128i r1 = _mm_loadu_si128((const __m128i*)S1); @@ -1402,7 +1402,7 @@ public: else { CV_Assert(cn == 4); - for ( ; dx < w - 4; dx += 4, S0 += 8, S1 += 8, D += 4) + for ( ; dx <= w - 4; dx += 4, S0 += 8, S1 += 8, D += 4) { __m128i r0 = _mm_loadu_si128((const __m128i*)S0); __m128i r1 = _mm_loadu_si128((const __m128i*)S1);