Skip to content

Commit

Permalink
update liboil requirement to 0.3.6
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dschleef committed Jan 27, 2006
1 parent ed0038e commit 02389b0
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 64 deletions.
7 changes: 7 additions & 0 deletions 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):
Expand Down
2 changes: 1 addition & 1 deletion REQUIREMENTS
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions gst/videoscale/Makefile.am
Expand Up @@ -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 \
Expand Down
79 changes: 19 additions & 60 deletions gst/videoscale/vs_scanline.c
Expand Up @@ -27,6 +27,7 @@

#include "vs_scanline.h"

#include <liboil/liboil.h>
#include <glib.h>

/* greyscale, i.e., single componenet */
Expand Down Expand Up @@ -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);
}


Expand Down Expand Up @@ -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);
}


Expand Down Expand Up @@ -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);
}


Expand Down Expand Up @@ -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);
}


Expand Down

0 comments on commit 02389b0

Please sign in to comment.