update liboil requirement to 0.3.6
authorDavid Schleef <ds@schleef.org>
Fri, 27 Jan 2006 23:40:19 +0000 (23:40 +0000)
committerDavid Schleef <ds@schleef.org>
Fri, 27 Jan 2006 23:40:19 +0000 (23:40 +0000)
Original commit message from CVS:
* REQUIREMENTS:
* configure.ac: update liboil requirement to 0.3.6
* gst/videoscale/Makefile.am:
* gst/videoscale/vs_scanline.c: liboilify

ChangeLog
REQUIREMENTS
configure.ac
gst/videoscale/Makefile.am
gst/videoscale/vs_scanline.c

index f2f14dd..a6ae1f2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-01-27  David Schleef  <ds@schleef.org>
+
+       * REQUIREMENTS:
+       * configure.ac: update liboil requirement to 0.3.6
+       * gst/videoscale/Makefile.am:
+       * gst/videoscale/vs_scanline.c: liboilify
+
 2006-01-27  Jan Schmidt  <thaytan@mad.scientist.com>
 
        * ext/libvisual/visual.c: (get_buffer):
index 7800add..de8739e 100644 (file)
@@ -88,7 +88,7 @@ swfdec                (for the swfdec (flash) plugin)
                        http://www.schleef.org/swfdec/
 liboil         (for the liboil optimization library)
                        http://www.schleef.org/liboil/
-               >=      0.2.0
+               >=      0.3.6
 flac           (for the FLAC lossless audio format)
                        http://flac.sourceforge.net
                 >= 1.0.3 preferred, 1.0.2 should work
index ca01526..b7c61a7 100644 (file)
@@ -203,7 +203,7 @@ dnl GLib is required
 GST_GLIB_CHECK([2.6])
 
 dnl liboil is required
-PKG_CHECK_MODULES(LIBOIL, liboil-0.3 >= 0.3.2, HAVE_LIBOIL=yes, HAVE_LIBOIL=no)
+PKG_CHECK_MODULES(LIBOIL, liboil-0.3 >= 0.3.6, HAVE_LIBOIL=yes, HAVE_LIBOIL=no)
 if test "x${HAVE_LIBOIL}" != xyes ; then
   AC_ERROR([liboil-0.3 is required])
 fi
index 3f778b4..1ef3688 100644 (file)
@@ -5,9 +5,9 @@ libgstvideoscale_la_SOURCES = \
        vs_image.c \
        vs_scanline.c
 
-libgstvideoscale_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS)
+libgstvideoscale_la_CFLAGS = $(GST_CFLAGS) $(GST_BASE_CFLAGS) $(LIBOIL_CFLAGS)
 libgstvideoscale_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
-libgstvideoscale_la_LIBADD = $(GST_BASE_LIBS) $(GST_LIBS)
+libgstvideoscale_la_LIBADD = $(GST_BASE_LIBS) $(GST_LIBS) $(LIBOIL_LIBS)
 
 noinst_HEADERS = \
        gstvideoscale.h \
index a2dc724..0a8ad7f 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "vs_scanline.h"
 
+#include <liboil/liboil.h>
 #include <glib.h>
 
 /* greyscale, i.e., single componenet */
@@ -65,31 +66,23 @@ void
 vs_scanline_resample_linear_Y (guint8 * dest, guint8 * src, int n,
     int *accumulator, int increment)
 {
-  int acc = *accumulator;
-  int i;
-  int j;
-  int x;
+  uint32_t vals[2];
 
-  for (i = 0; i < n; i++) {
-    j = acc >> 16;
-    x = acc & 0xffff;
-    dest[i] = (src[j] * (65536 - x) + src[j + 1] * x) >> 16;
+  vals[0] = *accumulator;
+  vals[1] = increment;
 
-    acc += increment;
-  }
+  oil_resample_linear_u8 (dest, src, n, vals);
 
-  *accumulator = acc;
+  *accumulator = vals[0];
 }
 
 void
 vs_scanline_merge_linear_Y (guint8 * dest, guint8 * src1, guint8 * src2,
     int n, int x)
 {
-  int i;
+  uint32_t value = x >> 8;
 
-  for (i = 0; i < n; i++) {
-    dest[i] = (src1[i] * (65536 - x) + src2[i] * x) >> 16;
-  }
+  oil_merge_linear_u8 (dest, src1, src2, &value, n);
 }
 
 
@@ -135,41 +128,23 @@ void
 vs_scanline_resample_linear_RGBA (guint8 * dest, guint8 * src, int n,
     int *accumulator, int increment)
 {
-  int acc = *accumulator;
-  int i;
-  int j;
-  int x;
+  uint32_t vals[2];
 
-  for (i = 0; i < n; i++) {
-    j = acc >> 16;
-    x = acc & 0xffff;
-    dest[i * 4 + 0] = (src[j * 4 + 0] * (65536 - x) + src[j * 4 + 4] * x) >> 16;
-    dest[i * 4 + 1] = (src[j * 4 + 1] * (65536 - x) + src[j * 4 + 5] * x) >> 16;
-    dest[i * 4 + 2] = (src[j * 4 + 2] * (65536 - x) + src[j * 4 + 6] * x) >> 16;
-    dest[i * 4 + 3] = (src[j * 4 + 3] * (65536 - x) + src[j * 4 + 7] * x) >> 16;
+  vals[0] = *accumulator;
+  vals[1] = increment;
 
-    acc += increment;
-  }
+  oil_resample_linear_argb ((guint32 *) dest, (guint32 *) src, n, vals);
 
-  *accumulator = acc;
+  *accumulator = vals[0];
 }
 
 void
 vs_scanline_merge_linear_RGBA (guint8 * dest, guint8 * src1, guint8 * src2,
     int n, int x)
 {
-  int i;
+  uint32_t value = x >> 8;
 
-  for (i = 0; i < n; i++) {
-    dest[i * 4 + 0] =
-        (src1[i * 4 + 0] * (65536 - x) + src2[i * 4 + 0] * x) >> 16;
-    dest[i * 4 + 1] =
-        (src1[i * 4 + 1] * (65536 - x) + src2[i * 4 + 1] * x) >> 16;
-    dest[i * 4 + 2] =
-        (src1[i * 4 + 2] * (65536 - x) + src2[i * 4 + 2] * x) >> 16;
-    dest[i * 4 + 3] =
-        (src1[i * 4 + 3] * (65536 - x) + src2[i * 4 + 3] * x) >> 16;
-  }
+  oil_merge_linear_u8 (dest, src1, src2, &value, n * 4);
 }
 
 
@@ -235,16 +210,9 @@ void
 vs_scanline_merge_linear_RGB (guint8 * dest, guint8 * src1, guint8 * src2,
     int n, int x)
 {
-  int i;
+  uint32_t value = x >> 8;
 
-  for (i = 0; i < n; i++) {
-    dest[i * 3 + 0] =
-        (src1[i * 3 + 0] * (65536 - x) + src2[i * 3 + 3] * x) >> 16;
-    dest[i * 3 + 1] =
-        (src1[i * 3 + 1] * (65536 - x) + src2[i * 3 + 4] * x) >> 16;
-    dest[i * 3 + 2] =
-        (src1[i * 3 + 2] * (65536 - x) + src2[i * 3 + 5] * x) >> 16;
-  }
+  oil_merge_linear_u8 (dest, src1, src2, &value, n * 3);
 }
 
 
@@ -431,18 +399,9 @@ void
 vs_scanline_merge_linear_UYVY (guint8 * dest, guint8 * src1, guint8 * src2,
     int n, int x)
 {
-  int i;
+  uint32_t value = x >> 8;
 
-  for (i = 0; i < n; i++) {
-    dest[i * 4 + 0] =
-        (src1[i * 4 + 0] * (65536 - x) + src2[i * 4 + 0] * x) >> 16;
-    dest[i * 4 + 1] =
-        (src1[i * 4 + 1] * (65536 - x) + src2[i * 4 + 1] * x) >> 16;
-    dest[i * 4 + 2] =
-        (src1[i * 4 + 2] * (65536 - x) + src2[i * 4 + 2] * x) >> 16;
-    dest[i * 4 + 3] =
-        (src1[i * 4 + 3] * (65536 - x) + src2[i * 4 + 3] * x) >> 16;
-  }
+  oil_merge_linear_u8 (dest, src1, src2, &value, n * 4);
 }