diff options
author | Paul B Mahol <onemda@gmail.com> | 2021-10-21 21:05:02 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2021-10-21 22:02:58 +0200 |
commit | f0ad40b525b5f882f048cf69139bbe496ba59eea (patch) | |
tree | c35f4e02272fb0f3c7ee56ca4615e9494cc9481b | |
parent | 7216458c96a7635af5ae7428fdcad6c81ba870d7 (diff) | |
download | ffmpeg-f0ad40b525b5f882f048cf69139bbe496ba59eea.tar.gz |
avfilter/vf_bilateral: remove unneeded multiplications
-rw-r--r-- | libavfilter/vf_bilateral.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libavfilter/vf_bilateral.c b/libavfilter/vf_bilateral.c index 2a4a3df6cc..61c9084933 100644 --- a/libavfilter/vf_bilateral.c +++ b/libavfilter/vf_bilateral.c @@ -186,11 +186,11 @@ static void bilateral_##name(BilateralContext *s, const uint8_t *ssrc, uint8_t * *temp_factor_x++ = fc = inv_alpha_ + alpha_ * fp; \ fp = fc; \ } \ - --temp_x; *temp_x = 0.5f*((*temp_x) + (*--in_x)); \ + --temp_x; *temp_x = ((*temp_x) + (*--in_x)); \ tpr = *--texture_x; \ ypr = *in_x; \ \ - --temp_factor_x; *temp_factor_x = 0.5f*((*temp_factor_x) + 1); \ + --temp_factor_x; *temp_factor_x = ((*temp_factor_x) + 1); \ fp = 1; \ \ for (int x = width - 2; x >= 0; x--) { \ @@ -200,13 +200,13 @@ static void bilateral_##name(BilateralContext *s, const uint8_t *ssrc, uint8_t * float alpha_ = range_table[range_dist]; \ \ ycr = inv_alpha_ * (*--in_x) + alpha_ * ypr; \ - --temp_x; *temp_x = 0.5f*((*temp_x) + ycr); \ + --temp_x; *temp_x = ((*temp_x) + ycr); \ tpr = tcr; \ ypr = ycr; \ \ fc = inv_alpha_ + alpha_*fp; \ --temp_factor_x; \ - *temp_factor_x = 0.5f*((*temp_factor_x) + fc); \ + *temp_factor_x = ((*temp_factor_x) + fc); \ fp = fc; \ } \ } \ @@ -238,14 +238,14 @@ static void bilateral_##name(BilateralContext *s, const uint8_t *ssrc, uint8_t * ypf = line_factor_b; \ memcpy(ypf, &in_factor[h1 * width], sizeof(float) * width); \ for (int x = 0; x < width; x++) \ - map_factor_b[h1 * width + x] = 0.5f*(map_factor_b[h1 * width + x] + ypf[x]); \ + map_factor_b[h1 * width + x] = (map_factor_b[h1 * width + x] + ypf[x]); \ \ ycy = slice_factor_a; \ ypy = slice_factor_b; \ memcpy(ypy, &img_temp[h1 * width], sizeof(float) * width); \ for (int x = 0, k = 0; x < width; x++) { \ int idx = h1 * width + x; \ - img_out_f[idx] = 0.5f*(img_out_f[idx] + ypy[k++]) / map_factor_b[h1 * width + x]; \ + img_out_f[idx] = (img_out_f[idx] + ypy[k++]) / map_factor_b[h1 * width + x]; \ } \ \ for (int y = h1 - 1; y >= 0; y--) { \ @@ -270,11 +270,11 @@ static void bilateral_##name(BilateralContext *s, const uint8_t *ssrc, uint8_t * float ycc, fcc = inv_alpha_*(*xcf++) + alpha_*(*ypf_++); \ \ *ycf_++ = fcc; \ - *factor_ = 0.5f * (*factor_ + fcc); \ + *factor_ = (*factor_ + fcc); \ \ ycc = inv_alpha_*(*xcy++) + alpha_*(*ypy_++); \ *ycy_++ = ycc; \ - *out_ = 0.5f * (*out_ + ycc) / (*factor_); \ + *out_ = (*out_ + ycc) / (*factor_); \ out_++; \ factor_++; \ } \ |