summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2004-02-12 07:37:50 +0000
committerDavid Schleef <ds@schleef.org>2004-02-12 07:37:50 +0000
commitff90d39556f8c583c0861a50c746f6b2bf1c0ef3 (patch)
tree33bf1498dadf6861471b6a14442f4474e043fc69
parent5e7c5ea3b107abeefe1d4ebbea2c2084f68c35dc (diff)
Convert a few inner loops to use liboil. This is currently optional, and is only enabled if liboil is present (duh!).
Original commit message from CVS: Convert a few inner loops to use liboil. This is currently optional, and is only enabled if liboil is present (duh!). * configure.ac: Check for liboil-0.1 * gst/intfloat/Makefile.am: * gst/intfloat/gstint2float.c: (conv_f32_s16), (scalarmult_f32), (gst_int2float_chain_gint16): * gst/videofilter/Makefile.am: * gst/videofilter/gstvideobalance.c: (gst_videobalance_class_init), (tablelookup_u8), (gst_videobalance_planar411): * gst/videotestsrc/Makefile.am: * gst/videotestsrc/gstvideotestsrc.c: (plugin_init): * gst/videotestsrc/videotestsrc.c: (splat_u8), (paint_hline_YUY2), (paint_hline_IYU2), (paint_hline_str4), (paint_hline_str3), (paint_hline_RGB565), (paint_hline_xRGB1555):
-rw-r--r--ChangeLog17
-rw-r--r--configure.ac8
-rw-r--r--gst/videofilter/Makefile.am4
-rw-r--r--gst/videofilter/gstvideobalance.c25
4 files changed, 49 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index a2cb26f1..a768df71 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,22 @@
2004-02-11 David Schleef <ds@schleef.org>
+ Convert a few inner loops to use liboil. This is currently
+ optional, and is only enabled if liboil is present (duh!).
+ * configure.ac: Check for liboil-0.1
+ * gst/intfloat/Makefile.am:
+ * gst/intfloat/gstint2float.c: (conv_f32_s16), (scalarmult_f32),
+ (gst_int2float_chain_gint16):
+ * gst/videofilter/Makefile.am:
+ * gst/videofilter/gstvideobalance.c: (gst_videobalance_class_init),
+ (tablelookup_u8), (gst_videobalance_planar411):
+ * gst/videotestsrc/Makefile.am:
+ * gst/videotestsrc/gstvideotestsrc.c: (plugin_init):
+ * gst/videotestsrc/videotestsrc.c: (splat_u8), (paint_hline_YUY2),
+ (paint_hline_IYU2), (paint_hline_str4), (paint_hline_str3),
+ (paint_hline_RGB565), (paint_hline_xRGB1555):
+
+2004-02-11 David Schleef <ds@schleef.org>
+
* ext/lcs/gstcolorspace.c: (colorspace_find_lcs_format),
(gst_colorspace_caps_get_fourcc), (colorspace_setup_converter),
(gst_colorspace_getcaps), (gst_colorspace_link),
diff --git a/configure.ac b/configure.ac
index db3448ea..75bf8c71 100644
--- a/configure.ac
+++ b/configure.ac
@@ -337,6 +337,14 @@ if test "x$HAVE_GDK_LOADERS" == "xyes"; then
fi
AM_CONDITIONAL(HAVE_GDK_LOADERS, test "x$HAVE_GDK_LOADERS" = "xyes")
+PKG_CHECK_MODULES(LIBOIL, liboil-0.1, HAVE_LIBOIL=yes, HAVE_LIBOIL=no)
+AC_SUBST(LIBOIL_CFLAGS)
+AC_SUBST(LIBOIL_LIBS)
+if test "x${HAVE_LIBOIL}" = xyes ; then
+ #AC_DEFINE_UNQUOTED(HAVE_LIBOIL, 1, [Define if liboil is being used])
+ true
+fi
+
dnl ===========================================================================
dnl ============================= gst plug-ins ================================
dnl ===========================================================================
diff --git a/gst/videofilter/Makefile.am b/gst/videofilter/Makefile.am
index 437eefcb..25323004 100644
--- a/gst/videofilter/Makefile.am
+++ b/gst/videofilter/Makefile.am
@@ -24,9 +24,9 @@ libgstvideoflip_la_LIBADD =
libgstvideoflip_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstvideobalance_la_SOURCES = gstvideobalance.c
-libgstvideobalance_la_CFLAGS = $(GST_CFLAGS)
+libgstvideobalance_la_CFLAGS = $(GST_CFLAGS) $(LIBOIL_CFLAGS)
libgstvideobalance_la_LIBADD = $(top_builddir)/gst-libs/gst/libgstinterfaces-$(GST_MAJORMINOR).la
-libgstvideobalance_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) -lm
+libgstvideobalance_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(LIBOIL_LIBS) -lm
libgstgamma_la_SOURCES = gstgamma.c
libgstgamma_la_CFLAGS = $(GST_CFLAGS)
diff --git a/gst/videofilter/gstvideobalance.c b/gst/videofilter/gstvideobalance.c
index d3084075..ddbf76b9 100644
--- a/gst/videofilter/gstvideobalance.c
+++ b/gst/videofilter/gstvideobalance.c
@@ -29,6 +29,9 @@
/*#define DEBUG_ENABLED */
#include <gstvideobalance.h>
+#ifdef HAVE_LIBOIL
+#include <liboil/liboil.h>
+#endif
#include <string.h>
#include <math.h>
@@ -197,6 +200,10 @@ gst_videobalance_class_init (gpointer g_class, gpointer class_data)
gobject_class->dispose = gst_videobalance_dispose;
videofilter_class->setup = gst_videobalance_setup;
+
+#ifdef HAVE_LIBOIL
+ oil_init();
+#endif
}
static void
@@ -480,6 +487,19 @@ gst_videobalance_update_tables_planar411 (GstVideobalance *vb)
}
}
+#ifndef HAVE_LIBOIL
+void tablelookup_u8 (guint8 *dest, int dstr, guint8 *src, int sstr,
+ guint8 *table, int tstr, int n)
+{
+ int i;
+ for(i=0;i<n;i++){
+ *dest = table[*src * tstr];
+ dest += dstr;
+ src += sstr;
+ }
+}
+#endif
+
static void gst_videobalance_planar411(GstVideofilter *videofilter,
void *dest, void *src)
{
@@ -504,9 +524,8 @@ static void gst_videobalance_planar411(GstVideofilter *videofilter,
guint8 *csrc = src;
for(y=0;y<height;y++) {
- for(x=0;x<width;x++) {
- cdest[y*width + x] = videobalance->tabley[csrc[y*width + x]];
- }
+ tablelookup_u8 (cdest + y*width, 1, csrc + y*width, 1,
+ videobalance->tabley, 1, width);
}
}