summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2009-12-10 10:40:10 +0100
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-12-10 10:41:23 +0100
commit05e8934311f53a48abce5aee323423d9c97cbd95 (patch)
tree3657d5460644074b34fe8bfb3f4c59c82bdc705d
parent397da3535019669ebc28398f4a23153dc59a8c24 (diff)
shapewipe: Don't do pointer dereferences in the processing loop
Lowers the time taken there in my testcase from 6.91% to 6.20% as measured by callgrind.
-rw-r--r--gst/shapewipe/gstshapewipe.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gst/shapewipe/gstshapewipe.c b/gst/shapewipe/gstshapewipe.c
index 6b209d0d1..f45bde5ae 100644
--- a/gst/shapewipe/gstshapewipe.c
+++ b/gst/shapewipe/gstshapewipe.c
@@ -763,6 +763,7 @@ gst_shape_wipe_blend_ayuv_##depth (GstShapeWipe * self, GstBuffer * inbuf, \
gfloat position = self->mask_position; \
gfloat low = position - (self->mask_border / 2.0f); \
gfloat high = position + (self->mask_border / 2.0f); \
+ gint width = self->width, height = self->height; \
\
if (low < 0.0f) { \
high = 0.0f; \
@@ -774,8 +775,8 @@ gst_shape_wipe_blend_ayuv_##depth (GstShapeWipe * self, GstBuffer * inbuf, \
high = 1.0f; \
} \
\
- for (i = 0; i < self->height; i++) { \
- for (j = 0; j < self->width; j++) { \
+ for (i = 0; i < height; i++) { \
+ for (j = 0; j < width; j++) { \
gfloat in = *mask / scale; \
\
if (in < low) { \
@@ -824,6 +825,7 @@ gst_shape_wipe_blend_##name##_##depth (GstShapeWipe * self, GstBuffer * inbuf, \
gfloat position = self->mask_position; \
gfloat low = position - (self->mask_border / 2.0f); \
gfloat high = position + (self->mask_border / 2.0f); \
+ gint width = self->width, height = self->height; \
\
if (low < 0.0f) { \
high = 0.0f; \
@@ -835,8 +837,8 @@ gst_shape_wipe_blend_##name##_##depth (GstShapeWipe * self, GstBuffer * inbuf, \
high = 1.0f; \
} \
\
- for (i = 0; i < self->height; i++) { \
- for (j = 0; j < self->width; j++) { \
+ for (i = 0; i < height; i++) { \
+ for (j = 0; j < width; j++) { \
gfloat in = *mask / scale; \
\
if (in < low) { \