From 420dd22258ff7a7f4cb4ce4c4ea4e9c55585a4e3 Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Mon, 1 Oct 2012 14:12:19 +0400 Subject: [PATCH] fixed a few warnings reported by Oleg; restored SSE2 optimization in FAST --- modules/features2d/src/fast.cpp | 5 ++++- modules/features2d/src/fast_score.cpp | 2 ++ modules/highgui/src/cap_v4l.cpp | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/features2d/src/fast.cpp b/modules/features2d/src/fast.cpp index d940463740..1d62f9009a 100644 --- a/modules/features2d/src/fast.cpp +++ b/modules/features2d/src/fast.cpp @@ -89,7 +89,9 @@ void FAST_t(InputArray _img, std::vector& keypoints, int threshold, bo if( i < img.rows - 3 ) { j = 3; - #if 0 //CV_SSE2 + #if CV_SSE2 + if( patternSize == 16 ) + { for(; j < img.cols - 16 - 3; j += 16, ptr += 16) { __m128i m0, m1; @@ -145,6 +147,7 @@ void FAST_t(InputArray _img, std::vector& keypoints, int threshold, bo curr[j+k] = (uchar)cornerScore(ptr+k, pixel, threshold); } } + } #endif for( ; j < img.cols - 3; j++, ptr++ ) { diff --git a/modules/features2d/src/fast_score.cpp b/modules/features2d/src/fast_score.cpp index b897860b32..17ff3e5ce0 100644 --- a/modules/features2d/src/fast_score.cpp +++ b/modules/features2d/src/fast_score.cpp @@ -78,6 +78,7 @@ void makeOffsets(int pixel[25], int rowStride, int patternSize) pixel[k] = pixel[k - patternSize]; } +#if 0 static void testCorner(const uchar* ptr, const int pixel[], int K, int N, int threshold) { // check that with the computed "threshold" the pixel is still a corner // and that with the increased-by-1 "threshold" the pixel is not a corner anymore @@ -111,6 +112,7 @@ static void testCorner(const uchar* ptr, const int pixel[], int K, int N, int th (delta == 1 && std::max(c0, c1) <= K) ); } } +#endif template<> int cornerScore<16>(const uchar* ptr, const int pixel[], int threshold) diff --git a/modules/highgui/src/cap_v4l.cpp b/modules/highgui/src/cap_v4l.cpp index b970fa0506..619870fd98 100644 --- a/modules/highgui/src/cap_v4l.cpp +++ b/modules/highgui/src/cap_v4l.cpp @@ -1432,7 +1432,7 @@ move_420_block(int yTL, int yTR, int yBL, int yBR, int u, int v, static inline void move_411_block(int yTL, int yTR, int yBL, int yBR, int u, int v, - int rowPixels, unsigned char * rgb) + int /*rowPixels*/, unsigned char * rgb) { const int rvScale = 91881; const int guScale = -22553;