libcvd-members
[Top][All Lists]
Advanced

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

[libcvd-members] libcvd cvd/convolution.h cvd_src/convolution.cc


From: Ethan Eade
Subject: [libcvd-members] libcvd cvd/convolution.h cvd_src/convolution.cc
Date: Fri, 22 Feb 2008 15:40:24 +0000

CVSROOT:        /cvsroot/libcvd
Module name:    libcvd
Changes by:     Ethan Eade <ethaneade>  08/02/22 15:40:24

Modified files:
        cvd            : convolution.h 
        cvd_src        : convolution.cc 

Log message:
        Fixes to previous additions.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd/convolution.h?cvsroot=libcvd&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd_src/convolution.cc?cvsroot=libcvd&r1=1.2&r2=1.3

Patches:
Index: cvd/convolution.h
===================================================================
RCS file: /cvsroot/libcvd/libcvd/cvd/convolution.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- cvd/convolution.h   22 Feb 2008 15:24:33 -0000      1.10
+++ cvd/convolution.h   22 Feb 2008 15:40:23 -0000      1.11
@@ -407,46 +407,6 @@
 }
 
 
-#if defined(CVD_HAVE_SSE) && defined(CVD_HAVE_XMMINTRIN)
-
-#include <xmmintrin.h>
-
-template <class S> const float* convolveMiddle(const float* input, const S& 
factor, const S* kernel, int ksize, int n, float* output) {
-    __m128 kkkk[ksize+1] __attribute__ ((aligned(16)));
-    kkkk[0] = _mm_set1_ps(factor);
-    for (int i=1; i<=ksize; i++)
-       kkkk[i] = _mm_set1_ps(kernel[i-1]);
-    
-    int i=0;
-    for (; i<n && !is_aligned<16>(input); i++, ++input, ++output) { 
-       *output = ConvolveMiddle<float,-1>::at(input, factor, kernel, ksize); 
-    }    
-    
-    for (; i<n-3; i+=4) {
-       __m128 sum = _mm_mul_ps(kkkk[0], _mm_load_ps(input));
-       const float* back = input - ksize-1;
-       const float* front = input + ksize+1;
-       const __m128* kp = kkkk+ksize+1;
-       while (++back != --front) {
-           --kp;
-           const __m128& kr = *kp;
-           const __m128 b = _mm_loadu_ps(back);
-           const __m128 f = _mm_loadu_ps(front);
-           sum = _mm_add_ps(sum, _mm_mul_ps(kr, _mm_add_ps(b,f)));
-       }
-       _mm_stream_ps(output, sum);
-       output += 4;
-       input += 4;
-    }
-
-    for (; i<n; i++, ++input, ++output) { 
-       *output = ConvolveMiddle<float,-1>::at(input, factor, kernel, ksize); 
-    }    
-    return input;
-}
-
-#endif
-
 template <class T> inline void convolveGaussian(BasicImage<T>& I, double 
sigma, double sigmas=3.0)
 {
   convolveGaussian(I,I,sigma,sigmas);
@@ -550,8 +510,6 @@
            rows[r] = rows[r+1];
        rows[swin] = tmp;
     }
-
-    delete[] kernel;
 }
 
 #if defined(CVD_HAVE_SSE) && defined(CVD_HAVE_XMMINTRIN)

Index: cvd_src/convolution.cc
===================================================================
RCS file: /cvsroot/libcvd/libcvd/cvd_src/convolution.cc,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- cvd_src/convolution.cc      22 Feb 2008 15:24:34 -0000      1.2
+++ cvd_src/convolution.cc      22 Feb 2008 15:40:23 -0000      1.3
@@ -1,7 +1,13 @@
 #include <cvd/convolution.h>
 
+#if defined(CVD_HAVE_SSE) && defined(CVD_HAVE_XMMINTRIN)
+#include <xmmintrin.h>
+#endif
+
 using namespace std;
 
+
+
 namespace CVD {
 
 namespace Internal {
@@ -105,6 +111,7 @@
 }
 
 #if defined(CVD_HAVE_SSE) && defined(CVD_HAVE_XMMINTRIN)
+
 inline void convolveMiddle5(const float* in, double factor, const double 
kernel[], int count, float* out)
 {
     int i;




reply via email to

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