diff options
Diffstat (limited to 'src/post')
-rw-r--r-- | src/post/audio/upmix_mono.c | 32 | ||||
-rw-r--r-- | src/post/audio/volnorm.c | 5 | ||||
-rw-r--r-- | src/post/planar/eq2.c | 29 |
3 files changed, 27 insertions, 39 deletions
diff --git a/src/post/audio/upmix_mono.c b/src/post/audio/upmix_mono.c index caf99a309..2d3429788 100644 --- a/src/post/audio/upmix_mono.c +++ b/src/post/audio/upmix_mono.c @@ -192,32 +192,32 @@ static void upmix_mono_port_put_buffer(xine_audio_port_t *port_gen, _x_extra_info_merge(buf1->extra_info, buf->extra_info); { - int step = buf->format.bits / 8; + const size_t step = buf->format.bits / 8; uint8_t *src = (uint8_t *)buf->mem; uint8_t *dst0 = (uint8_t *)buf0->mem; uint8_t *dst1 = (uint8_t *)buf1->mem; - int i, k; + int i; for (i = 0; i < buf->num_frames / 2; i++) { - for (k = 0; k < step; k++) - *dst0++ = *src++; + memcpy(dst0, src, step); + dst0 += step; - src -= step; + memcpy(dst0, src, step); + dst0 += step; - for (k = 0; k < step; k++) - *dst0++ = *src++; + src += step; } for (i = buf->num_frames / 2; i < buf->num_frames; i++) { - for (k = 0; k < step; k++) - *dst1++ = *src++; + memcpy(dst1, src, step); + dst1 += step; - src -= step; + memcpy(dst1, src, step); + dst1 += step; - for (k = 0; k < step; k++) - *dst1++ = *src++; + src += step; } } @@ -244,11 +244,11 @@ static void upmix_mono_port_put_buffer(xine_audio_port_t *port_gen, _x_extra_info_merge(buf0->extra_info, buf->extra_info); { - int step = buf->format.bits / 8; + const size_t step = buf->format.bits / 8; uint8_t *src = (uint8_t *)buf->mem; uint8_t *dst0 = (uint8_t *)buf0->mem; int cur_channel = this->params.channel; - int i, j, k; + int i, j; if( cur_channel >= this->channels ) cur_channel = this->channels-1; @@ -259,8 +259,8 @@ static void upmix_mono_port_put_buffer(xine_audio_port_t *port_gen, { for (j = 0; j < this->channels; j++ ) { - for (k = 0; k < step; k++) - *dst0++ = *(src+k); + memcpy(dst0, src, step); + dst0 += step; } src += this->channels * step; } diff --git a/src/post/audio/volnorm.c b/src/post/audio/volnorm.c index 07d06fe1c..4fdb7dbfc 100644 --- a/src/post/audio/volnorm.c +++ b/src/post/audio/volnorm.c @@ -426,9 +426,8 @@ static post_plugin_t *volnorm_open_plugin(post_class_t *class_gen, int inputs, this->mul = MUL_INIT; this->lastavg = MID_S16; this->idx = 0; - for (i = 0; i < NSAMPLES; i++) - this->mem[i].len = this->mem[i].avg = 0; - + memset(this->mem, 0, sizeof(this->mem)); + port = _x_post_intercept_audio_port(&this->post, audio_target[0], &input, &output); port->new_port.open = volnorm_port_open; port->new_port.close = volnorm_port_close; 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); |