diff options
author | Paul B Mahol <onemda@gmail.com> | 2020-07-17 13:45:16 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2020-07-17 13:53:22 +0200 |
commit | 241cdded0fc72102f32429cb3f8c0361c518f993 (patch) | |
tree | 1e0eed23a6b5729e1c27df0eeb47870af90a10ad /libavfilter/vf_bilateral.c | |
parent | d11cc743c8e5a60b196d7ec514fb31d558c933ef (diff) | |
download | ffmpeg-241cdded0fc72102f32429cb3f8c0361c518f993.tar.gz |
avfilter/vf_bilateral: stop using sigmaS as percent of width/height
Diffstat (limited to 'libavfilter/vf_bilateral.c')
-rw-r--r-- | libavfilter/vf_bilateral.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavfilter/vf_bilateral.c b/libavfilter/vf_bilateral.c index 3c9d8006d9..47959afdad 100644 --- a/libavfilter/vf_bilateral.c +++ b/libavfilter/vf_bilateral.c @@ -57,7 +57,7 @@ typedef struct BilateralContext { #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM static const AVOption bilateral_options[] = { - { "sigmaS", "set spatial sigma", OFFSET(sigmaS), AV_OPT_TYPE_FLOAT, {.dbl=0.1}, 0.0, 10, FLAGS }, + { "sigmaS", "set spatial sigma", OFFSET(sigmaS), AV_OPT_TYPE_FLOAT, {.dbl=0.1}, 0.0, 512, FLAGS }, { "sigmaR", "set range sigma", OFFSET(sigmaR), AV_OPT_TYPE_FLOAT, {.dbl=0.1}, 0.0, 1, FLAGS }, { "planes", "set planes to filter", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=1}, 0, 0xF, FLAGS }, { NULL } @@ -145,7 +145,7 @@ static void bilateral_##name(BilateralContext *s, const uint8_t *ssrc, uint8_t * float *slice_factor_a = s->slice_factor_a, *slice_factor_b = s->slice_factor_b; \ float *line_factor_a = s->line_factor_a, *line_factor_b = s->line_factor_b; \ float *range_table = s->range_table; \ - float alpha = expf(-sqrtf(2.f) / (sigma_spatial * width)); \ + float alpha = expf(-sqrtf(2.f) / sigma_spatial); \ float ypr, ycr, *ycy, *ypy, *xcy, fp, fc; \ float inv_alpha_ = 1 - alpha; \ float *ycf, *ypf, *xcf, *in_factor; \ @@ -206,7 +206,7 @@ static void bilateral_##name(BilateralContext *s, const uint8_t *ssrc, uint8_t * } \ memcpy(img_out_f, img_temp, sizeof(float) * width); \ \ - alpha = expf(-sqrtf(2.f) / (sigma_spatial * height)); \ + alpha = expf(-sqrtf(2.f) / sigma_spatial); \ inv_alpha_ = 1 - alpha; \ in_factor = map_factor_a; \ memcpy(map_factor_b, in_factor, sizeof(float) * width); \ |