mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
[MOVED FROM BAD 17/29] 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.
This commit is contained in:
parent
41eed9dcca
commit
5f2e64e3a0
1 changed files with 6 additions and 4 deletions
|
@ -763,6 +763,7 @@ gst_shape_wipe_blend_ayuv_##depth (GstShapeWipe * self, GstBuffer * inbuf, \
|
||||||
gfloat position = self->mask_position; \
|
gfloat position = self->mask_position; \
|
||||||
gfloat low = position - (self->mask_border / 2.0f); \
|
gfloat low = position - (self->mask_border / 2.0f); \
|
||||||
gfloat high = 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) { \
|
if (low < 0.0f) { \
|
||||||
high = 0.0f; \
|
high = 0.0f; \
|
||||||
|
@ -774,8 +775,8 @@ gst_shape_wipe_blend_ayuv_##depth (GstShapeWipe * self, GstBuffer * inbuf, \
|
||||||
high = 1.0f; \
|
high = 1.0f; \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
for (i = 0; i < self->height; i++) { \
|
for (i = 0; i < height; i++) { \
|
||||||
for (j = 0; j < self->width; j++) { \
|
for (j = 0; j < width; j++) { \
|
||||||
gfloat in = *mask / scale; \
|
gfloat in = *mask / scale; \
|
||||||
\
|
\
|
||||||
if (in < low) { \
|
if (in < low) { \
|
||||||
|
@ -824,6 +825,7 @@ gst_shape_wipe_blend_##name##_##depth (GstShapeWipe * self, GstBuffer * inbuf, \
|
||||||
gfloat position = self->mask_position; \
|
gfloat position = self->mask_position; \
|
||||||
gfloat low = position - (self->mask_border / 2.0f); \
|
gfloat low = position - (self->mask_border / 2.0f); \
|
||||||
gfloat high = 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) { \
|
if (low < 0.0f) { \
|
||||||
high = 0.0f; \
|
high = 0.0f; \
|
||||||
|
@ -835,8 +837,8 @@ gst_shape_wipe_blend_##name##_##depth (GstShapeWipe * self, GstBuffer * inbuf, \
|
||||||
high = 1.0f; \
|
high = 1.0f; \
|
||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
for (i = 0; i < self->height; i++) { \
|
for (i = 0; i < height; i++) { \
|
||||||
for (j = 0; j < self->width; j++) { \
|
for (j = 0; j < width; j++) { \
|
||||||
gfloat in = *mask / scale; \
|
gfloat in = *mask / scale; \
|
||||||
\
|
\
|
||||||
if (in < low) { \
|
if (in < low) { \
|
||||||
|
|
Loading…
Reference in a new issue