summaryrefslogtreecommitdiff
path: root/src/post/planar/eq2.c
diff options
context:
space:
mode:
authorDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2008-05-09 17:51:40 +0200
committerDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2008-05-09 17:51:40 +0200
commit902d66eb8304ccffdb683b7130e9f548011b8d30 (patch)
tree9cdd73b5f68131ba2d4944d17e183b4313bdb559 /src/post/planar/eq2.c
parenta51427608e2f4543ae0cb0598517a1e4f6b0928b (diff)
downloadxine-lib-902d66eb8304ccffdb683b7130e9f548011b8d30.tar.gz
xine-lib-902d66eb8304ccffdb683b7130e9f548011b8d30.tar.bz2
Avoid loop for common memory operations (zeroing, copying, moving).
Use the proper function for common memory operations (memset() for zeroing, memcpy() for copying, memmove() for moving), instead of looping through arrays. By extension, remove loops to reset arrays when they were allocated with calloc() and thus already zeroed.
Diffstat (limited to 'src/post/planar/eq2.c')
-rw-r--r--src/post/planar/eq2.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/src/post/planar/eq2.c b/src/post/planar/eq2.c
index 8894b9d06..0ead54f55 100644
--- a/src/post/planar/eq2.c
+++ b/src/post/planar/eq2.c
@@ -442,26 +442,15 @@ static post_plugin_t *eq2_open_plugin(post_class_t *class_gen, int inputs,
_x_post_init(&this->post, 0, 1);
- eq2 = &this->eq2;
- for (i = 0; i < 3; i++) {
- eq2->buf[i] = NULL;
- eq2->buf_w[i] = 0;
- eq2->buf_h[i] = 0;
-
- eq2->param[i].adjust = NULL;
- eq2->param[i].c = 1.0;
- eq2->param[i].b = 0.0;
- eq2->param[i].g = 1.0;
- eq2->param[i].lut_clean = 0;
- }
-
- eq2->gamma = this->params.gamma = 1.0;
- eq2->contrast = this->params.contrast = 1.0;
- eq2->brightness = this->params.brightness = 0.0;
- eq2->saturation = this->params.saturation = 1.0;
- eq2->rgamma = this->params.rgamma = 1.0;
- eq2->ggamma = this->params.ggamma = 1.0;
- eq2->bgamma = this->params.bgamma = 1.0;
+ memset(&this->eq2, 0, sizeof(this->eq2));
+
+ this->eq2.gamma = this->params.gamma = 1.0;
+ this->eq2.contrast = this->params.contrast = 1.0;
+ this->eq2.brightness = this->params.brightness = 0.0;
+ this->eq2.saturation = this->params.saturation = 1.0;
+ this->eq2.rgamma = this->params.rgamma = 1.0;
+ this->eq2.ggamma = this->params.ggamma = 1.0;
+ this->eq2.bgamma = this->params.bgamma = 1.0;
pthread_mutex_init(&this->lock, NULL);