From ff90d39556f8c583c0861a50c746f6b2bf1c0ef3 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Thu, 12 Feb 2004 07:37:50 +0000 Subject: [PATCH] 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): --- ChangeLog | 17 +++++++++++++++++ configure.ac | 8 ++++++++ gst/videofilter/Makefile.am | 4 ++-- gst/videofilter/gstvideobalance.c | 25 ++++++++++++++++++++++--- 4 files changed, 49 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index a2cb26f1e2..a768df7114 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2004-02-11 David Schleef + + 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 * ext/lcs/gstcolorspace.c: (colorspace_find_lcs_format), diff --git a/configure.ac b/configure.ac index db3448eacd..75bf8c713f 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 437eefcbfe..2532300432 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 d3084075f7..ddbf76b94a 100644 --- a/gst/videofilter/gstvideobalance.c +++ b/gst/videofilter/gstvideobalance.c @@ -29,6 +29,9 @@ /*#define DEBUG_ENABLED */ #include +#ifdef HAVE_LIBOIL +#include +#endif #include #include @@ -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;itabley[csrc[y*width + x]]; - } + tablelookup_u8 (cdest + y*width, 1, csrc + y*width, 1, + videobalance->tabley, 1, width); } }