From 9f727ea05c24400ab1f2d8513e1112262c8731a9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Sun, 18 Apr 2010 09:33:49 +0200 Subject: [PATCH] gamma: Stop using liboil The used liboil function is deprecated, only has a reference implementation and is more complex than what's needed here. --- gst/videofilter/Makefile.am | 6 ++---- gst/videofilter/gstgamma.c | 22 +++++++++++++++------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/gst/videofilter/Makefile.am b/gst/videofilter/Makefile.am index 32fd41c3d..409affbb2 100644 --- a/gst/videofilter/Makefile.am +++ b/gst/videofilter/Makefile.am @@ -35,12 +35,10 @@ libgstvideobalance_la_LIBTOOLFLAGS = --tag=disable-static libgstgamma_la_SOURCES = gstgamma.c libgstgamma_la_CFLAGS = $(GST_CFLAGS) $(GST_CONTROLLER_CFLAGS) \ $(GST_BASE_CFLAGS) \ - $(GST_PLUGINS_BASE_CFLAGS) \ - $(LIBOIL_CFLAGS) + $(GST_PLUGINS_BASE_CFLAGS) libgstgamma_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) -lgstvideo-@GST_MAJORMINOR@ \ $(GST_CONTROLLER_LIBS) \ - $(GST_BASE_LIBS) $(GST_LIBS) \ - $(LIBOIL_LIBS) + $(GST_BASE_LIBS) $(GST_LIBS) libgstgamma_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(LIBM) libgstgamma_la_LIBTOOLFLAGS = --tag=disable-static diff --git a/gst/videofilter/gstgamma.c b/gst/videofilter/gstgamma.c index 544601440..e7306d2b4 100644 --- a/gst/videofilter/gstgamma.c +++ b/gst/videofilter/gstgamma.c @@ -45,7 +45,6 @@ #endif #include "gstgamma.h" -#include #include #include @@ -199,17 +198,27 @@ gst_gamma_calculate_tables (GstGamma * gamma) static void gst_gamma_planar_ip (GstGamma * gamma, guint8 * data) { - gint size; + gint i, j, height; + gint width, row_stride, row_wrap; + const guint8 *table = gamma->gamma_table; data = data + gst_video_format_get_component_offset (gamma->format, 0, gamma->width, gamma->height); - size = - gst_video_format_get_row_stride (gamma->format, 0, - gamma->width) * gst_video_format_get_component_height (gamma->format, 0, + + width = gst_video_format_get_component_width (gamma->format, 0, gamma->width); + height = gst_video_format_get_component_height (gamma->format, 0, gamma->height); + row_stride = gst_video_format_get_row_stride (gamma->format, 0, gamma->width); + row_wrap = row_stride - width; - oil_tablelookup_u8 (data, 1, data, 1, gamma->gamma_table, 1, size); + for (i = 0; i < height; i++) { + for (j = 0; j < width; j++) { + *data = table[*data]; + data++; + } + data += row_wrap; + } } static gboolean @@ -302,7 +311,6 @@ plugin_init (GstPlugin * plugin) { GST_DEBUG_CATEGORY_INIT (gamma_debug, "gamma", 0, "gamma"); - oil_init (); gst_controller_init (NULL, NULL); return gst_element_register (plugin, "gamma", GST_RANK_NONE, GST_TYPE_GAMMA); -- 2.34.1