diff options
author | Paul B Mahol <onemda@gmail.com> | 2020-02-12 11:25:25 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2020-02-12 11:27:28 +0100 |
commit | 28743f1803721b6d0b7dcfcc1cb07c1e58f8cc12 (patch) | |
tree | c9d83bfe0a16ff0f9dd7cfcaaa2a6e137480e977 /libavfilter/vf_median.c | |
parent | d9751a116275ec0281ea7c4bd28d8d10b457e264 (diff) | |
download | ffmpeg-28743f1803721b6d0b7dcfcc1cb07c1e58f8cc12.tar.gz |
avfilter/vf_median: implement percentile option
Diffstat (limited to 'libavfilter/vf_median.c')
-rw-r--r-- | libavfilter/vf_median.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavfilter/vf_median.c b/libavfilter/vf_median.c index ee264e1a74..0189fabd07 100644 --- a/libavfilter/vf_median.c +++ b/libavfilter/vf_median.c @@ -60,6 +60,7 @@ static const AVOption median_options[] = { { "radius", "set median radius", OFFSET(radius), AV_OPT_TYPE_INT, {.i64=1}, 1, 127, FLAGS }, { "planes", "set planes to filter", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=0xF}, 0, 0xF, FLAGS }, { "radiusV", "set median vertical radius", OFFSET(radiusV), AV_OPT_TYPE_INT, {.i64=0},0, 127, FLAGS }, + { "percentile", "set median percentile", OFFSET(percentile), AV_OPT_TYPE_FLOAT, {.dbl=.5}, 0., 1., FLAGS }, { NULL } }; @@ -127,7 +128,7 @@ static void check_params(MedianContext *s, AVFilterLink *inlink) } } - s->t = 2 * s->radius * s->radiusV + 2 * s->radius; + s->t = (2 * s->radius * s->radiusV + s->radiusV + s->radius) * 2.f * s->percentile; } static int config_input(AVFilterLink *inlink) |