[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libcvd-members] libcvd Makefile.in configure configure.in cvd_s...
From: |
Edward Rosten |
Subject: |
[libcvd-members] libcvd Makefile.in configure configure.in cvd_s... |
Date: |
Wed, 11 May 2011 11:06:33 +0000 |
CVSROOT: /cvsroot/libcvd
Module name: libcvd
Changes by: Edward Rosten <edrosten> 11/05/11 11:06:32
Modified files:
. : Makefile.in configure configure.in
Added files:
cvd_src/MMX : half_sample.cc
cvd_src/SSE2 : half_sample.cc
cvd_src/noarch : half_sample.cc
Removed files:
cvd_src : half_sample.cc
Log message:
Rearrange code to remove conditional compilation in halfsample.
Not tested for 32 bit platforms but should work...
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libcvd/Makefile.in?cvsroot=libcvd&r1=1.97&r2=1.98
http://cvs.savannah.gnu.org/viewcvs/libcvd/configure?cvsroot=libcvd&r1=1.160&r2=1.161
http://cvs.savannah.gnu.org/viewcvs/libcvd/configure.in?cvsroot=libcvd&r1=1.161&r2=1.162
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd_src/half_sample.cc?cvsroot=libcvd&r1=1.1&r2=0
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd_src/MMX/half_sample.cc?cvsroot=libcvd&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd_src/SSE2/half_sample.cc?cvsroot=libcvd&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd_src/noarch/half_sample.cc?cvsroot=libcvd&rev=1.1
Patches:
Index: Makefile.in
===================================================================
RCS file: /cvsroot/libcvd/libcvd/Makefile.in,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -b -r1.97 -r1.98
--- Makefile.in 20 Apr 2011 11:32:58 -0000 1.97
+++ Makefile.in 11 May 2011 11:06:32 -0000 1.98
@@ -91,7 +91,6 @@
cvd_src/bayer.o \
cvd_src/morphology.o \
cvd_src/colourspace_convert.o \
- cvd_src/half_sample.o \
cvd_src/draw.o \
cvd_src/yuv422.o \
cvd_src/yuv420.o \
Index: configure
===================================================================
RCS file: /cvsroot/libcvd/libcvd/configure,v
retrieving revision 1.160
retrieving revision 1.161
diff -u -b -r1.160 -r1.161
--- configure 19 Apr 2011 13:37:11 -0000 1.160
+++ configure 11 May 2011 11:06:32 -0000 1.161
@@ -12865,8 +12865,9 @@
cvd_src/i686/yuv411_to_stuff_MMX_64 inline_asm mmxext x86
cvd_src/yuv411_to_stuff END
-cvd_src/i686/halfsample,INTERNAL_HALFSAMPLE_MMX8 mmx 32bit x86
assembler END
-INTERNAL_HALFSAMPLE_SSE16
sse2 END
+cvd_src/i686/halfsample,cvd_src/MMX/half_sample mmx 32bit x86
assembler END
+cvd_src/SSE2/half_sample
sse2
+cvd_src/noarch/half_sample
END
INTERNAL_YV402P_MMX
mmx END
Index: configure.in
===================================================================
RCS file: /cvsroot/libcvd/libcvd/configure.in,v
retrieving revision 1.161
retrieving revision 1.162
diff -u -b -r1.161 -r1.162
--- configure.in 19 Apr 2011 13:37:11 -0000 1.161
+++ configure.in 11 May 2011 11:06:32 -0000 1.162
@@ -943,8 +943,9 @@
cvd_src/i686/yuv411_to_stuff_MMX_64 inline_asm mmxext x86
cvd_src/yuv411_to_stuff END
-cvd_src/i686/halfsample,INTERNAL_HALFSAMPLE_MMX8 mmx 32bit x86
assembler END
-INTERNAL_HALFSAMPLE_SSE16
sse2 END
+cvd_src/i686/halfsample,cvd_src/MMX/half_sample mmx 32bit x86
assembler END
+cvd_src/SSE2/half_sample
sse2
+cvd_src/noarch/half_sample
END
INTERNAL_YV402P_MMX
mmx END
Index: cvd_src/MMX/half_sample.cc
===================================================================
RCS file: cvd_src/MMX/half_sample.cc
diff -N cvd_src/MMX/half_sample.cc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ cvd_src/MMX/half_sample.cc 11 May 2011 11:06:32 -0000 1.1
@@ -0,0 +1,23 @@
+#include "cvd/vision.h"
+#include "cvd/config.h"
+
+namespace CVD
+{
+ namespace Internal{
+
+ extern "C" {
+ void cvd_asm_halfsample_mmx(const unsigned
char*, unsigned char*, int, int);
+ }
+ }
+
+ void halfSample(const BasicImage<byte>& in, BasicImage<byte>& out)
+ {
+ if( (in.size()/2) != out.size())
+ throw
Exceptions::Vision::IncompatibleImageSizes("halfSample");
+
+ if (is_aligned<8>(in.data()) && is_aligned<8>(out.data()) &&
(in.size().x % 8 == 0))
+ Internal::cvd_asm_halfsample_mmx(in.data(), out.data(),
in.size().x, in.size().y);
+ else
+ halfSample<byte>(in, out);
+ }
+}
Index: cvd_src/SSE2/half_sample.cc
===================================================================
RCS file: cvd_src/SSE2/half_sample.cc
diff -N cvd_src/SSE2/half_sample.cc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ cvd_src/SSE2/half_sample.cc 11 May 2011 11:06:32 -0000 1.1
@@ -0,0 +1,50 @@
+#include "cvd/vision.h"
+#include <emmintrin.h>
+
+
+namespace CVD
+{
+ namespace Internal{
+
+ void halfSampleSSE2(const byte* in, byte* out, int w, int h)
+ {
+ const unsigned long long mask[2] =
{0x00FF00FF00FF00FFull, 0x00FF00FF00FF00FFull};
+ //byte test[16];
+ const byte* nextRow = in + w;
+ __m128i m = _mm_loadu_si128((const __m128i*)mask);
+ int sw = w >> 4;
+ int sh = h >> 1;
+
+ for (int i=0; i<sh; i++)
+ {
+ for (int j=0; j<sw; j++)
+ {
+ __m128i here = _mm_load_si128((const
__m128i*)in);
+ __m128i next = _mm_load_si128((const
__m128i*)nextRow);
+ here = _mm_avg_epu8(here,next);
+ next =
_mm_and_si128(_mm_srli_si128(here,1), m);
+ here = _mm_and_si128(here,m);
+ here = _mm_avg_epu16(here, next);
+ _mm_storel_epi64((__m128i*)out,
_mm_packus_epi16(here,here));
+ in += 16;
+ nextRow += 16;
+ out += 8;
+ }
+
+ in += w;
+ nextRow += w;
+ }
+ }
+ }
+
+ void halfSample(const BasicImage<byte>& in, BasicImage<byte>& out)
+ {
+ if( (in.size()/2) != out.size())
+ throw
Exceptions::Vision::IncompatibleImageSizes("halfSample");
+
+ if (is_aligned<16>(in.data()) && is_aligned<16>(out.data()) &&
((in.size().x % 16) == 0))
+ Internal::halfSampleSSE2(in.data(), out.data(),
in.size().x, in.size().y);
+ else
+ halfSample<byte>(in, out);
+ }
+}
Index: cvd_src/noarch/half_sample.cc
===================================================================
RCS file: cvd_src/noarch/half_sample.cc
diff -N cvd_src/noarch/half_sample.cc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ cvd_src/noarch/half_sample.cc 11 May 2011 11:06:32 -0000 1.1
@@ -0,0 +1,10 @@
+#include "cvd/vision.h"
+
+
+namespace CVD
+{
+ void halfSample(const BasicImage<byte>& in, BasicImage<byte>& out)
+ {
+ halfSample<byte>(in, out);
+ }
+}
Index: cvd_src/half_sample.cc
===================================================================
RCS file: cvd_src/half_sample.cc
diff -N cvd_src/half_sample.cc
--- cvd_src/half_sample.cc 28 Feb 2008 00:27:22 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,78 +0,0 @@
-#include "cvd/vision.h"
-#include "cvd/config.h"
-
-#ifdef CVD_INTERNAL_HAVE_HALFSAMPLE_SSE16
-#include <emmintrin.h>
-#endif
-
-
-namespace CVD
-{
- namespace Internal{
-
- #if CVD_INTERNAL_HAVE_HALFSAMPLE_MMX8
- extern "C" {
- void cvd_asm_halfsample_mmx(const unsigned
char*, unsigned char*, int, int);
- }
- #endif
-
- #ifdef CVD_INTERNAL_HAVE_HALFSAMPLE_SSE16
- void halfSampleSSE2(const byte* in, byte* out, int w, int h)
- {
- const unsigned long long mask[2] =
{0x00FF00FF00FF00FFull, 0x00FF00FF00FF00FFull};
- //byte test[16];
- const byte* nextRow = in + w;
- __m128i m = _mm_loadu_si128((const __m128i*)mask);
- int sw = w >> 4;
- int sh = h >> 1;
-
- for (int i=0; i<sh; i++)
- {
- for (int j=0; j<sw; j++)
- {
- __m128i here = _mm_load_si128((const
__m128i*)in);
- __m128i next = _mm_load_si128((const
__m128i*)nextRow);
- here = _mm_avg_epu8(here,next);
- next =
_mm_and_si128(_mm_srli_si128(here,1), m);
- here = _mm_and_si128(here,m);
- here = _mm_avg_epu16(here, next);
- _mm_storel_epi64((__m128i*)out,
_mm_packus_epi16(here,here));
- in += 16;
- nextRow += 16;
- out += 8;
- }
-
- in += w;
- nextRow += w;
- }
- }
- #endif
-
-
- }
-
- void halfSample(const BasicImage<byte>& in, BasicImage<byte>& out)
- {
- if( (in.size()/2) != out.size())
- throw
Exceptions::Vision::IncompatibleImageSizes("halfSample");
-
- #if CVD_INTERNAL_HAVE_HALFSAMPLE_SSE16
- if (is_aligned<16>(in.data()) &&
is_aligned<16>(out.data()) && ((in.size().x % 16) == 0))
- {
- Internal::halfSampleSSE2(in.data(), out.data(),
in.size().x, in.size().y);
- return;
- }
- #endif
-
- #ifdef CVD_INTERNAL_HAVE_HALFSAMPLE_MMX8
- if (is_aligned<8>(in.data()) && is_aligned<8>(out.data()) &&
(in.size().x % 8 == 0))
- {
- Internal::cvd_asm_halfsample_mmx(in.data(), out.data(),
in.size().x, in.size().y);
- return;
- }
-
- #endif
-
- halfSample<byte>(in, out);
- }
-}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libcvd-members] libcvd Makefile.in configure configure.in cvd_s...,
Edward Rosten <=