diff options
author | Paul B Mahol <onemda@gmail.com> | 2017-02-13 21:52:51 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2017-02-13 22:54:20 +0100 |
commit | 72864547f91f2864f75b2829d0c11317ef7b390b (patch) | |
tree | 8dd9467c9f8587eff5c7f0d5039e99bfce922261 /libavfilter/vf_lut.c | |
parent | fb32c561c3820f3bc8833d0c3629388539fe4798 (diff) | |
download | ffmpeg-72864547f91f2864f75b2829d0c11317ef7b390b.tar.gz |
avfilter/vf_lut: do not always explicitly clip pixels
Old behaviour was not useful at all. New behaviour only emulate
old behaviour with default options.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter/vf_lut.c')
-rw-r--r-- | libavfilter/vf_lut.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/libavfilter/vf_lut.c b/libavfilter/vf_lut.c index 312bb37a38..24726739e3 100644 --- a/libavfilter/vf_lut.c +++ b/libavfilter/vf_lut.c @@ -84,17 +84,17 @@ typedef struct LutContext { #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM static const AVOption options[] = { - { "c0", "set component #0 expression", OFFSET(comp_expr_str[0]), AV_OPT_TYPE_STRING, { .str = "val" }, .flags = FLAGS }, - { "c1", "set component #1 expression", OFFSET(comp_expr_str[1]), AV_OPT_TYPE_STRING, { .str = "val" }, .flags = FLAGS }, - { "c2", "set component #2 expression", OFFSET(comp_expr_str[2]), AV_OPT_TYPE_STRING, { .str = "val" }, .flags = FLAGS }, - { "c3", "set component #3 expression", OFFSET(comp_expr_str[3]), AV_OPT_TYPE_STRING, { .str = "val" }, .flags = FLAGS }, - { "y", "set Y expression", OFFSET(comp_expr_str[Y]), AV_OPT_TYPE_STRING, { .str = "val" }, .flags = FLAGS }, - { "u", "set U expression", OFFSET(comp_expr_str[U]), AV_OPT_TYPE_STRING, { .str = "val" }, .flags = FLAGS }, - { "v", "set V expression", OFFSET(comp_expr_str[V]), AV_OPT_TYPE_STRING, { .str = "val" }, .flags = FLAGS }, - { "r", "set R expression", OFFSET(comp_expr_str[R]), AV_OPT_TYPE_STRING, { .str = "val" }, .flags = FLAGS }, - { "g", "set G expression", OFFSET(comp_expr_str[G]), AV_OPT_TYPE_STRING, { .str = "val" }, .flags = FLAGS }, - { "b", "set B expression", OFFSET(comp_expr_str[B]), AV_OPT_TYPE_STRING, { .str = "val" }, .flags = FLAGS }, - { "a", "set A expression", OFFSET(comp_expr_str[A]), AV_OPT_TYPE_STRING, { .str = "val" }, .flags = FLAGS }, + { "c0", "set component #0 expression", OFFSET(comp_expr_str[0]), AV_OPT_TYPE_STRING, { .str = "clipval" }, .flags = FLAGS }, + { "c1", "set component #1 expression", OFFSET(comp_expr_str[1]), AV_OPT_TYPE_STRING, { .str = "clipval" }, .flags = FLAGS }, + { "c2", "set component #2 expression", OFFSET(comp_expr_str[2]), AV_OPT_TYPE_STRING, { .str = "clipval" }, .flags = FLAGS }, + { "c3", "set component #3 expression", OFFSET(comp_expr_str[3]), AV_OPT_TYPE_STRING, { .str = "clipval" }, .flags = FLAGS }, + { "y", "set Y expression", OFFSET(comp_expr_str[Y]), AV_OPT_TYPE_STRING, { .str = "clipval" }, .flags = FLAGS }, + { "u", "set U expression", OFFSET(comp_expr_str[U]), AV_OPT_TYPE_STRING, { .str = "clipval" }, .flags = FLAGS }, + { "v", "set V expression", OFFSET(comp_expr_str[V]), AV_OPT_TYPE_STRING, { .str = "clipval" }, .flags = FLAGS }, + { "r", "set R expression", OFFSET(comp_expr_str[R]), AV_OPT_TYPE_STRING, { .str = "clipval" }, .flags = FLAGS }, + { "g", "set G expression", OFFSET(comp_expr_str[G]), AV_OPT_TYPE_STRING, { .str = "clipval" }, .flags = FLAGS }, + { "b", "set B expression", OFFSET(comp_expr_str[B]), AV_OPT_TYPE_STRING, { .str = "clipval" }, .flags = FLAGS }, + { "a", "set A expression", OFFSET(comp_expr_str[A]), AV_OPT_TYPE_STRING, { .str = "clipval" }, .flags = FLAGS }, { NULL } }; @@ -265,7 +265,7 @@ static int config_props(AVFilterLink *inlink) max[Y] = 235 * (1 << (desc->comp[0].depth - 8)); max[U] = 240 * (1 << (desc->comp[1].depth - 8)); max[V] = 240 * (1 << (desc->comp[2].depth - 8)); - max[A] = (1 << desc->comp[3].depth) - 1; + max[A] = (1 << desc->comp[0].depth) - 1; break; case AV_PIX_FMT_RGB48LE: case AV_PIX_FMT_RGBA64LE: @@ -324,7 +324,7 @@ static int config_props(AVFilterLink *inlink) s->comp_expr_str[color], val, comp); return AVERROR(EINVAL); } - s->lut[comp][val] = av_clip((int)res, min[color], max[color]); + s->lut[comp][val] = av_clip((int)res, 0, max[A]); av_log(ctx, AV_LOG_DEBUG, "val[%d][%d] = %d\n", comp, val, s->lut[comp][val]); } } |