libcvd-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libcvd-members] libcvd/cvd_src faster_corner_9.cxx faster_corne...


From: Georg Klein
Subject: [libcvd-members] libcvd/cvd_src faster_corner_9.cxx faster_corne...
Date: Wed, 22 Aug 2007 10:15:37 +0000

CVSROOT:        /cvsroot/libcvd
Module name:    libcvd
Changes by:     Georg Klein <georgklein>        07/08/22 10:15:37

Modified files:
        cvd_src        : faster_corner_9.cxx faster_corner_10.cxx 

Log message:
        Fixed faster_corner_9 and 10 crash due to loop being incremented
        incorrectly; also fixed rather bizarre bug where the corners' x and y 
values
        were swapped. N.b. according to valgrind these routines still perform
        illegal memory access.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd_src/faster_corner_9.cxx?cvsroot=libcvd&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd_src/faster_corner_10.cxx?cvsroot=libcvd&r1=1.1&r2=1.2

Patches:
Index: faster_corner_9.cxx
===================================================================
RCS file: /cvsroot/libcvd/libcvd/cvd_src/faster_corner_9.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- faster_corner_9.cxx 11 Aug 2007 06:07:34 -0000      1.1
+++ faster_corner_9.cxx 22 Aug 2007 10:15:36 -0000      1.2
@@ -33,7 +33,7 @@
                if(is_corner_9<Less>(&I[y][x], I.row_stride(), barrier) || 
is_corner_9<Greater>(&I[y][x], I.row_stride(), barrier))
                    corners.push_back(ImageRef(x, y));
            
-           for(int x=16; x < xend; x++)
+           for(int x=16; x < xend; x+=16)
            {
                const byte* p = &I[y][x];
                __m128i lo, hi;
@@ -197,40 +197,40 @@
                //if(possible & 0x0f) //Does this make it faster?
                {
                    if(possible & (1<< 0))
-                           corners.push_back(ImageRef(y, x + 0));
+                     corners.push_back(ImageRef(x + 0, y));
                    if(possible & (1<< 1))
-                           corners.push_back(ImageRef(y, x + 1));
+                     corners.push_back(ImageRef(x + 1, y));
                    if(possible & (1<< 2))
-                           corners.push_back(ImageRef(y, x + 2));
+                     corners.push_back(ImageRef(x + 2, y));
                    if(possible & (1<< 3))
-                           corners.push_back(ImageRef(y, x + 3));
+                     corners.push_back(ImageRef(x + 3, y));
                    if(possible & (1<< 4))
-                           corners.push_back(ImageRef(y, x + 4));
+                     corners.push_back(ImageRef(x + 4, y));
                    if(possible & (1<< 5))
-                           corners.push_back(ImageRef(y, x + 5));
+                     corners.push_back(ImageRef(x + 5, y));
                    if(possible & (1<< 6))
-                           corners.push_back(ImageRef(y, x + 6));
+                     corners.push_back(ImageRef(x + 6, y));
                    if(possible & (1<< 7))
-                           corners.push_back(ImageRef(y, x + 7));
+                     corners.push_back(ImageRef(x + 7, y));
                }
                //if(possible & 0xf0) //Does this mak( ,  fast)r?
                {
                    if(possible & (1<< 8))
-                           corners.push_back(ImageRef(y, x + 8));
+                     corners.push_back(ImageRef(x + 8, y));
                    if(possible & (1<< 9))
-                           corners.push_back(ImageRef(y, x + 9));
+                     corners.push_back(ImageRef(x + 9, y));
                    if(possible & (1<<10))
-                           corners.push_back(ImageRef(y, x +10));
+                     corners.push_back(ImageRef(x +10, y));
                    if(possible & (1<<11))
-                           corners.push_back(ImageRef(y, x +11));
+                     corners.push_back(ImageRef(x +11, y));
                    if(possible & (1<<12))
-                           corners.push_back(ImageRef(y, x +12));
+                     corners.push_back(ImageRef(x +12, y));
                    if(possible & (1<<13))
-                           corners.push_back(ImageRef(y, x +13));
+                     corners.push_back(ImageRef(x +13, y));
                    if(possible & (1<<14))
-                           corners.push_back(ImageRef(y, x +14));
+                     corners.push_back(ImageRef(x +14, y));
                    if(possible & (1<<15))
-                           corners.push_back(ImageRef(y, x +15));
+                     corners.push_back(ImageRef(x +15, y));
                }
            }
 

Index: faster_corner_10.cxx
===================================================================
RCS file: /cvsroot/libcvd/libcvd/cvd_src/faster_corner_10.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- faster_corner_10.cxx        11 Aug 2007 06:07:34 -0000      1.1
+++ faster_corner_10.cxx        22 Aug 2007 10:15:36 -0000      1.2
@@ -31,7 +31,7 @@
                if(is_corner_10<Less>(&I[y][x], I.row_stride(), barrier) || 
is_corner_10<Greater>(&I[y][x], I.row_stride(), barrier))
                    corners.push_back(ImageRef(x, y));
            
-           for(int x=16; x < xend; x++)
+           for(int x=16; x < xend; x+=16)
            {
                const byte* p = &I[y][x];
                __m128i lo, hi;
@@ -141,40 +141,40 @@
                //if(possible & 0x0f) //Does this make it faster?
                {
                    if(possible & (1<< 0))
-                           corners.push_back(ImageRef(y, x + 0));
+                     corners.push_back(ImageRef(x + 0, y));
                    if(possible & (1<< 1))
-                           corners.push_back(ImageRef(y, x + 1));
+                     corners.push_back(ImageRef(x + 1, y));
                    if(possible & (1<< 2))
-                           corners.push_back(ImageRef(y, x + 2));
+                     corners.push_back(ImageRef(x + 2, y));
                    if(possible & (1<< 3))
-                           corners.push_back(ImageRef(y, x + 3));
+                     corners.push_back(ImageRef(x + 3, y));
                    if(possible & (1<< 4))
-                           corners.push_back(ImageRef(y, x + 4));
+                     corners.push_back(ImageRef(x + 4, y));
                    if(possible & (1<< 5))
-                           corners.push_back(ImageRef(y, x + 5));
+                     corners.push_back(ImageRef(x + 5, y));
                    if(possible & (1<< 6))
-                           corners.push_back(ImageRef(y, x + 6));
+                     corners.push_back(ImageRef(x + 6, y));
                    if(possible & (1<< 7))
-                           corners.push_back(ImageRef(y, x + 7));
+                     corners.push_back(ImageRef(x + 7, y));
                }
                //if(possible & 0xf0) //Does this mak( ,  fast)r?
                {
                    if(possible & (1<< 8))
-                           corners.push_back(ImageRef(y, x + 8));
+                     corners.push_back(ImageRef(x + 8, y));
                    if(possible & (1<< 9))
-                           corners.push_back(ImageRef(y, x + 9));
+                     corners.push_back(ImageRef(x + 9, y));
                    if(possible & (1<<10))
-                           corners.push_back(ImageRef(y, x +10));
+                     corners.push_back(ImageRef(x +10, y));
                    if(possible & (1<<11))
-                           corners.push_back(ImageRef(y, x +11));
+                     corners.push_back(ImageRef(x +11, y));
                    if(possible & (1<<12))
-                           corners.push_back(ImageRef(y, x +12));
+                     corners.push_back(ImageRef(x +12, y));
                    if(possible & (1<<13))
-                           corners.push_back(ImageRef(y, x +13));
+                     corners.push_back(ImageRef(x +13, y));
                    if(possible & (1<<14))
-                           corners.push_back(ImageRef(y, x +14));
+                     corners.push_back(ImageRef(x +14, y));
                    if(possible & (1<<15))
-                           corners.push_back(ImageRef(y, x +15));
+                     corners.push_back(ImageRef(x +15, y));
                }
            }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]