diff options
author | David Schleef <ds@schleef.org> | 2006-01-27 23:40:19 +0000 |
---|---|---|
committer | David Schleef <ds@schleef.org> | 2006-01-27 23:40:19 +0000 |
commit | 02389b09e86b270e3cc56cb013a14405bba73b58 (patch) | |
tree | d0f55207009ecb89e66df6e1be29941bd19b307f | |
parent | ed0038e68593ecd002576f2f04a256772878214a (diff) |
update liboil requirement to 0.3.6
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
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | REQUIREMENTS | 2 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | gst/videoscale/Makefile.am | 4 | ||||
-rw-r--r-- | gst/videoscale/vs_scanline.c | 79 |
5 files changed, 30 insertions, 64 deletions
@@ -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): diff --git a/REQUIREMENTS b/REQUIREMENTS index 7800addd..de8739ed 100644 --- a/REQUIREMENTS +++ b/REQUIREMENTS @@ -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 diff --git a/configure.ac b/configure.ac index ca015263..b7c61a7e 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/gst/videoscale/Makefile.am b/gst/videoscale/Makefile.am index 3f778b40..1ef36889 100644 --- a/gst/videoscale/Makefile.am +++ b/gst/videoscale/Makefile.am @@ -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 \ diff --git a/gst/videoscale/vs_scanline.c b/gst/videoscale/vs_scanline.c index a2dc724b..0a8ad7fd 100644 --- a/gst/videoscale/vs_scanline.c +++ b/gst/videoscale/vs_scanline.c @@ -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); } |