summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2009-07-24 19:37:09 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-07-24 19:54:05 +0200
commit6eada080a0b3bb1a0b75c66fc4cfc510f9dd84b0 (patch)
treebc26408634c92935195d0b5661ead9007056f0a8
parent23967b03a75e0082982ffc0637bbe33293d3cf30 (diff)
warptv: Make the sine table global instead of having it in every instance
-rw-r--r--gst/effectv/gstwarp.c14
-rw-r--r--gst/effectv/gstwarp.h1
2 files changed, 8 insertions, 7 deletions
diff --git a/gst/effectv/gstwarp.c b/gst/effectv/gstwarp.c
index dae2604b..fd31dc4a 100644
--- a/gst/effectv/gstwarp.c
+++ b/gst/effectv/gstwarp.c
@@ -63,7 +63,7 @@
GST_BOILERPLATE (GstWarpTV, gst_warptv, GstVideoFilter, GST_TYPE_VIDEO_FILTER);
-static void initSinTable (GstWarpTV * filter);
+static void initSinTable ();
static void initOffsTable (GstWarpTV * filter);
static void initDistTable (GstWarpTV * filter);
@@ -102,7 +102,6 @@ gst_warptv_set_caps (GstBaseTransform * btrans, GstCaps * incaps,
filter->disttable =
g_malloc (filter->width * filter->height * sizeof (guint32));
- initSinTable (filter);
initOffsTable (filter);
initDistTable (filter);
ret = TRUE;
@@ -111,13 +110,15 @@ gst_warptv_set_caps (GstBaseTransform * btrans, GstCaps * incaps,
return ret;
}
+static gint32 sintable[1024 + 256];
+
static void
-initSinTable (GstWarpTV * filter)
+initSinTable ()
{
gint32 *tptr, *tsinptr;
double i;
- tsinptr = tptr = filter->sintable;
+ tsinptr = tptr = sintable;
for (i = 0; i < 1024; i++)
*tptr++ = (int) (sin (i * M_PI / 512) * 32767);
@@ -174,7 +175,7 @@ gst_warptv_transform (GstBaseTransform * trans, GstBuffer * in, GstBuffer * out)
gint xw, yw, cw;
gint32 c, i, x, y, dx, dy, maxx, maxy;
gint32 skip, *ctptr, *distptr;
- gint32 *sintable, *ctable;
+ gint32 *ctable;
GstFlowReturn ret = GST_FLOW_OK;
xw = (gint) (sin ((warptv->tval + 100) * M_PI / 128) * 30);
@@ -185,7 +186,6 @@ gst_warptv_transform (GstBaseTransform * trans, GstBuffer * in, GstBuffer * out)
ctptr = warptv->ctable;
distptr = warptv->disttable;
- sintable = warptv->sintable;
ctable = warptv->ctable;
skip = 0; /* video_width*sizeof(RGB32)/4 - video_width;; */
@@ -275,6 +275,8 @@ gst_warptv_class_init (GstWarpTVClass * klass)
trans_class->start = GST_DEBUG_FUNCPTR (gst_warptv_start);
trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_warptv_set_caps);
trans_class->transform = GST_DEBUG_FUNCPTR (gst_warptv_transform);
+
+ initSinTable ();
}
static void
diff --git a/gst/effectv/gstwarp.h b/gst/effectv/gstwarp.h
index 91cdf84c..a9879604 100644
--- a/gst/effectv/gstwarp.h
+++ b/gst/effectv/gstwarp.h
@@ -54,7 +54,6 @@ struct _GstWarpTV
gint *offstable;
gint32 *disttable;
gint32 ctable[1024];
- gint32 sintable[1024 + 256];
gint tval;
};