summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2022-04-26 08:55:12 +0200
committerPaul B Mahol <onemda@gmail.com>2022-04-26 09:21:55 +0200
commitf908f365f9a40dc27bef25b452cc97cd660541ee (patch)
treeb3d7fe693db5b01143055da52a9824b6a3ef7fe4
parentded0334d214f9617122ccf5466f99df5c908277b (diff)
avfilter/vf_colormap: change default nb_patches
-rw-r--r--doc/filters.texi2
-rw-r--r--libavfilter/vf_colormap.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/doc/filters.texi b/doc/filters.texi
index 499f3adcd9..02a3b49832 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -9019,6 +9019,8 @@ Set the source and target video stream patch size in pixels.
@item nb_patches
Set the max number of used patches from source and target video stream.
+Default value is number of patches available in additional video streams.
+Max allowed number of patches is @code{64}.
@item type
Set the adjustments used for target colors. Can be @code{relative} or @code{absolute}.
diff --git a/libavfilter/vf_colormap.c b/libavfilter/vf_colormap.c
index 7fccc33b4f..9a2fe14ef7 100644
--- a/libavfilter/vf_colormap.c
+++ b/libavfilter/vf_colormap.c
@@ -69,7 +69,7 @@ typedef struct ColorMapContext {
static const AVOption colormap_options[] = {
{ "patch_size", "set patch size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "64x64"}, 0, 0, FLAGS },
- { "nb_patches", "set number of patches", OFFSET(size), AV_OPT_TYPE_INT, {.i64 = 8}, 1, MAX_SIZE, FLAGS },
+ { "nb_patches", "set number of patches", OFFSET(size), AV_OPT_TYPE_INT, {.i64 = 0}, 0, MAX_SIZE, FLAGS },
{ "type", "set the target type used", OFFSET(target_type), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS, "type" },
{ "relative", "the target colors are relative", 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 1, FLAGS, "type" },
{ "absolute", "the target colors are absolute", 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 1, FLAGS, "type" },
@@ -428,6 +428,8 @@ static int import_map(AVFilterLink *inlink, AVFrame *in)
if (changed)
s->changed[is_target] = 1;
+ if (!s->size)
+ s->size = FFMIN(idx, MAX_SIZE);
if (!is_target)
s->nb_maps = FFMIN(idx, s->size);