goom: liboil to orc conversion

This commit is contained in:
David Schleef 2010-06-04 18:16:25 -07:00
parent 9ff3ef0c92
commit 2cb6cfed22
4 changed files with 18 additions and 16 deletions

View file

@ -37,8 +37,8 @@ libgstgoom_la_SOURCES = \
goom_tools.h goom_tools.h goom_config.h \
$(ARCH_FILES)
libgstgoom_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(GOOM_FILTER_CFLAGS) $(LIBOIL_CFLAGS) $(ARCH_CFLAGS)
libgstgoom_la_LIBADD = $(GST_BASE_LIBS) $(GST_LIBS) $(LIBM) $(LIBOIL_LIBS)
libgstgoom_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(GOOM_FILTER_CFLAGS) $(ARCH_CFLAGS) $(ORC_CFLAGS)
libgstgoom_la_LIBADD = $(GST_BASE_LIBS) $(GST_LIBS) $(LIBM) $(ORC_LIBS)
libgstgoom_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
libgstgoom_la_LIBTOOLFLAGS = --tag=disable-static

View file

@ -4,7 +4,7 @@ http://ios.free.fr/?page=projet&quoi=1
Like the original library so is the Goom plugin available under the LGPL license
This is based on goom2k4 with changes to plugin_info.c and mmx.h to use liboil for CPU
This is based on goom2k4 with changes to plugin_info.c and mmx.h to use Orc for CPU
detection and GStreamer-specific ifdef's for architecture detection.
These files are not in use right now:

View file

@ -43,8 +43,6 @@
#include <gst/video/video.h>
#include "goom.h"
#include <liboil/liboil.h>
GST_DEBUG_CATEGORY (goom_debug);
#define GST_CAT_DEFAULT goom_debug
@ -587,8 +585,6 @@ plugin_init (GstPlugin * plugin)
{
GST_DEBUG_CATEGORY_INIT (goom_debug, "goom", 0, "goom visualisation element");
oil_init ();
return gst_element_register (plugin, "goom", GST_RANK_NONE, GST_TYPE_GOOM);
}

View file

@ -29,6 +29,9 @@
#include "drawmethods.h"
#include <math.h>
#include <stdio.h>
#ifdef HAVE_ORC
#include <orc/orc.h>
#endif
#if defined (HAVE_CPU_PPC64) || defined (HAVE_CPU_PPC)
@ -43,9 +46,6 @@
#include "mmx.h"
#endif /* HAVE_MMX */
#include <liboil/liboil.h>
#include <liboil/liboilfunction.h>
#include <liboil/liboilcpu.h>
GST_DEBUG_CATEGORY_EXTERN (goom_debug);
#define GST_CAT_DEFAULT goom_debug
@ -53,25 +53,30 @@ GST_DEBUG_CATEGORY_EXTERN (goom_debug);
static void
setOptimizedMethods (PluginInfo * p)
{
unsigned int cpuFlavour = oil_cpu_get_flags ();
#ifdef HAVE_ORC
unsigned int cpuFlavour =
orc_target_get_default_flags (orc_target_get_by_name ("mmx"));
#else
unsigned int cpuFlavour = 0;
#endif
/* set default methods */
p->methods.draw_line = draw_line;
p->methods.zoom_filter = zoom_filter_c;
/* p->methods.create_output_with_brightness = create_output_with_brightness;*/
GST_INFO ("liboil cpu flags: 0x%08x", cpuFlavour);
GST_INFO ("orc cpu flags: 0x%08x", cpuFlavour);
/* FIXME: what about HAVE_CPU_X86_64 ? */
#ifdef HAVE_CPU_I386
#ifdef HAVE_MMX
#ifdef HAVE_ORC
GST_INFO ("have an x86");
if (cpuFlavour & OIL_IMPL_FLAG_MMXEXT) {
if (cpuFlavour & ORC_TARGET_MMX_MMXEXT) {
GST_INFO ("Extended MMX detected. Using the fastest methods!");
p->methods.draw_line = draw_line_xmmx;
p->methods.zoom_filter = zoom_filter_xmmx;
} else if (cpuFlavour & OIL_IMPL_FLAG_MMX) {
} else if (cpuFlavour & ORC_TARGET_MMX_MMX) {
GST_INFO ("MMX detected. Using fast methods!");
p->methods.draw_line = draw_line_mmx;
p->methods.zoom_filter = zoom_filter_mmx;
@ -79,6 +84,7 @@ setOptimizedMethods (PluginInfo * p)
GST_INFO ("Too bad ! No SIMD optimization available for your CPU.");
}
#endif
#endif
#endif /* HAVE_CPU_I386 */
/* disable all PPC stuff until someone finds out what to use here instead of
@ -92,7 +98,7 @@ setOptimizedMethods (PluginInfo * p)
#endif /* HAVE_CPU_PPC64 */
#ifdef HAVE_CPU_PPC
if ((cpuFlavour & OIL_IMPL_FLAG_ALTIVEC) != 0) {
if ((cpuFlavour & ORC_TARGET_ALTIVEC_ALTIVEC) != 0) {
/* p->methods.create_output_with_brightness = ppc_brightness_G4; */
p->methods.zoom_filter = ppc_zoom_G4;
} else {