+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),
/*#define DEBUG_ENABLED */
#include <gstvideotestsrc.h>
#include <videotestsrc.h>
+#ifdef HAVE_LIBOIL
+#include <liboil/liboil.h>
+#endif
#include <string.h>
#include <stdlib.h>
}
#endif
-static void
-memset_str2 (unsigned char *dest, unsigned char val, int n)
-{
- int i;
-
- for (i = 0; i < n; i++) {
- *dest = val;
- dest += 2;
- }
-}
-
-static void
-memset_str3 (unsigned char *dest, unsigned char val, int n)
-{
- int i;
-
- for (i = 0; i < n; i++) {
- *dest = val;
- dest += 3;
- }
-}
-
-static void
-memset_str4 (unsigned char *dest, unsigned char val, int n)
-{
- int i;
-
- for (i = 0; i < n; i++) {
- *dest = val;
- dest += 4;
- }
-}
-
#if 0
static void
paint_rect_random (unsigned char *dest, int stride, int x, int y, int w, int h)
p->endptr = dest + p->ystride * p->height;
}
+#ifndef HAVE_LIBOIL
+void splat_u8 (guint8 *dest, int dstr, guint8 val, int n)
+{
+ int i;
+ for(i=0;i<n;i++){
+ *dest = val;
+ dest += dstr;
+ }
+}
+#endif
+
static void
paint_hline_YUY2 (paintinfo * p, int x, int y, int w)
{
int offset;
offset = y * p->ystride;
- memset_str2 (p->yp + offset + x * 2, p->color->Y, w);
- memset_str4 (p->up + offset + x1 * 4, p->color->U, x2 - x1);
- memset_str4 (p->vp + offset + x1 * 4, p->color->V, x2 - x1);
+ splat_u8 (p->yp + offset + x * 2, 2, p->color->Y, w);
+ splat_u8 (p->up + offset + x1 * 4, 4, p->color->U, x2 - x1);
+ splat_u8 (p->vp + offset + x1 * 4, 4, p->color->V, x2 - x1);
}
static void
int offset;
offset = y * p->ystride;
- memset_str3 (p->yp + offset + x * 3, p->color->Y, w);
- memset_str3 (p->up + offset + x * 3, p->color->U, w);
- memset_str3 (p->vp + offset + x * 3, p->color->V, w);
+ splat_u8 (p->yp + offset + x * 3, 3, p->color->Y, w);
+ splat_u8 (p->up + offset + x * 3, 3, p->color->U, w);
+ splat_u8 (p->vp + offset + x * 3, 3, p->color->V, w);
}
static void
{
int offset = y * p->ystride;
- memset_str4 (p->yp + offset + x * 4, p->color->R, w);
- memset_str4 (p->up + offset + x * 4, p->color->G, w);
- memset_str4 (p->vp + offset + x * 4, p->color->B, w);
+ splat_u8 (p->yp + offset + x * 4, 4, p->color->R, w);
+ splat_u8 (p->up + offset + x * 4, 4, p->color->G, w);
+ splat_u8 (p->vp + offset + x * 4, 4, p->color->B, w);
}
static void
{
int offset = y * p->ystride;
- memset_str3 (p->yp + offset + x * 3, p->color->R, w);
- memset_str3 (p->up + offset + x * 3, p->color->G, w);
- memset_str3 (p->vp + offset + x * 3, p->color->B, w);
+ splat_u8 (p->yp + offset + x * 3, 3, p->color->R, w);
+ splat_u8 (p->up + offset + x * 3, 3, p->color->G, w);
+ splat_u8 (p->vp + offset + x * 3, 3, p->color->B, w);
}
static void
b = ((p->color->G<<3)&0xe0) | (p->color->B>>3);
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
- memset_str2 (p->yp + offset + x * 2 + 0, b, w);
- memset_str2 (p->yp + offset + x * 2 + 1, a, w);
+ splat_u8 (p->yp + offset + x * 2 + 0, 2, b, w);
+ splat_u8 (p->yp + offset + x * 2 + 1, 2, a, w);
#else
- memset_str2 (p->yp + offset + x * 2 + 0, a, w);
- memset_str2 (p->yp + offset + x * 2 + 1, b, w);
+ splat_u8 (p->yp + offset + x * 2 + 0, 2, a, w);
+ splat_u8 (p->yp + offset + x * 2 + 1, 2, b, w);
#endif
}
b = ((p->color->G<<2)&0xe0) | (p->color->B>>3);
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
- memset_str2 (p->yp + offset + x * 2 + 0, b, w);
- memset_str2 (p->yp + offset + x * 2 + 1, a, w);
+ splat_u8 (p->yp + offset + x * 2 + 0, 2, b, w);
+ splat_u8 (p->yp + offset + x * 2 + 1, 2, a, w);
#else
- memset_str2 (p->yp + offset + x * 2 + 0, a, w);
- memset_str2 (p->yp + offset + x * 2 + 1, b, w);
+ splat_u8 (p->yp + offset + x * 2 + 0, 2, a, w);
+ splat_u8 (p->yp + offset + x * 2 + 1, 2, b, w);
#endif
}