History

avfilter/vf_lut3d: lut3d, haldclut: add support for commands

Paul B Mahol committed 5 years ago

Commit 89f78dd1 parent 5f592132 files · +28 −6Browse files

Unified · Split

2 files
  1. doc/filters.texi +8 −0
  2. libavfilter/vf_lut3d.c +20 −6
doc/filters.texi+8−0
@@ -12814,6 +12814,10 @@ This filter also supports the @ref{framesync} options. · 12813 unmodified lines
12814More information about the Hald CLUT can be found on Eskil Steenberg's website12814More information about the Hald CLUT can be found on Eskil Steenberg's website
12815(Hald CLUT author) at @url{http://www.quelsolaar.com/technology/clut.html}.12815(Hald CLUT author) at @url{http://www.quelsolaar.com/technology/clut.html}.
12816 12816
12817@subsection Commands
12818
12819This filter supports the @code{interp} option as @ref{commands}.
12820
12817@subsection Workflow examples12821@subsection Workflow examples
12818 12822
12819@subsubsection Hald CLUT video stream12823@subsubsection Hald CLUT video stream
@@ -13992,6 +13996,10 @@ Interpolate values using a prism. · 1172 unmodified lines
13992@end table13996@end table
13993@end table13997@end table
13994 13998
13999@subsection Commands
14000
14001This filter supports the @code{interp} option as @ref{commands}.
14002
13995@section lumakey14003@section lumakey
13996 14004
13997Turn certain luma values into transparency.14005Turn certain luma values into transparency.
libavfilter/vf_lut3d.c+20−6
@@ -102,12 +102,12 @@ typedef struct ThreadData { · 101 unmodified lines
102#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM102#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
103#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM103#define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
104#define COMMON_OPTIONS \104#define COMMON_OPTIONS \
105 { "interp", "select interpolation mode", OFFSET(interpolation), AV_OPT_TYPE_INT, {.i64=INTERPOLATE_TETRAHEDRAL}, 0, NB_INTERP_MODE-1, FLAGS, "interp_mode" }, \105 { "interp", "select interpolation mode", OFFSET(interpolation), AV_OPT_TYPE_INT, {.i64=INTERPOLATE_TETRAHEDRAL}, 0, NB_INTERP_MODE-1, TFLAGS, "interp_mode" }, \
106 { "nearest", "use values from the nearest defined points", 0, AV_OPT_TYPE_CONST, {.i64=INTERPOLATE_NEAREST}, INT_MIN, INT_MAX, FLAGS, "interp_mode" }, \106 { "nearest", "use values from the nearest defined points", 0, AV_OPT_TYPE_CONST, {.i64=INTERPOLATE_NEAREST}, 0, 0, TFLAGS, "interp_mode" }, \
107 { "trilinear", "interpolate values using the 8 points defining a cube", 0, AV_OPT_TYPE_CONST, {.i64=INTERPOLATE_TRILINEAR}, INT_MIN, INT_MAX, FLAGS, "interp_mode" }, \107 { "trilinear", "interpolate values using the 8 points defining a cube", 0, AV_OPT_TYPE_CONST, {.i64=INTERPOLATE_TRILINEAR}, 0, 0, TFLAGS, "interp_mode" }, \
108 { "tetrahedral", "interpolate values using a tetrahedron", 0, AV_OPT_TYPE_CONST, {.i64=INTERPOLATE_TETRAHEDRAL}, INT_MIN, INT_MAX, FLAGS, "interp_mode" }, \108 { "tetrahedral", "interpolate values using a tetrahedron", 0, AV_OPT_TYPE_CONST, {.i64=INTERPOLATE_TETRAHEDRAL}, 0, 0, TFLAGS, "interp_mode" }, \
109 { "pyramid", "interpolate values using a pyramid", 0, AV_OPT_TYPE_CONST, {.i64=INTERPOLATE_PYRAMID}, INT_MIN, INT_MAX, FLAGS, "interp_mode" }, \109 { "pyramid", "interpolate values using a pyramid", 0, AV_OPT_TYPE_CONST, {.i64=INTERPOLATE_PYRAMID}, 0, 0, TFLAGS, "interp_mode" }, \
110 { "prism", "interpolate values using a prism", 0, AV_OPT_TYPE_CONST, {.i64=INTERPOLATE_PRISM}, INT_MIN, INT_MAX, FLAGS, "interp_mode" }, \110 { "prism", "interpolate values using a prism", 0, AV_OPT_TYPE_CONST, {.i64=INTERPOLATE_PRISM}, 0, 0, TFLAGS, "interp_mode" }, \
111 { NULL }111 { NULL }
112 112
113#define EXPONENT_MASK 0x7F800000113#define EXPONENT_MASK 0x7F800000
@@ -1251,6 +1251,18 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 1137 unmodified lines
1251 return ff_filter_frame(outlink, out);1251 return ff_filter_frame(outlink, out);
1252}1252}
1253 1253
1254static int process_command(AVFilterContext *ctx, const char *cmd, const char *args,
1255 char *res, int res_len, int flags)
1256{
1257 int ret;
1258
1259 ret = ff_filter_process_command(ctx, cmd, args, res, res_len, flags);
1260 if (ret < 0)
1261 return ret;
1262
1263 return config_input(ctx->inputs[0]);
1264}
1265
1254#if CONFIG_LUT3D_FILTER1266#if CONFIG_LUT3D_FILTER
1255static const AVOption lut3d_options[] = {1267static const AVOption lut3d_options[] = {
1256 { "file", "set 3D LUT file name", OFFSET(file), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },1268 { "file", "set 3D LUT file name", OFFSET(file), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
@@ -1352,6 +1364,7 @@ AVFilter ff_vf_lut3d = { · 95 unmodified lines
1352 .outputs = lut3d_outputs,1364 .outputs = lut3d_outputs,
1353 .priv_class = &lut3d_class,1365 .priv_class = &lut3d_class,
1354 .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS,1366 .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | AVFILTER_FLAG_SLICE_THREADS,
1367 .process_command = process_command,
1355};1368};
1356#endif1369#endif
1357 1370
@@ -1620,6 +1633,7 @@ AVFilter ff_vf_haldclut = { · 262 unmodified lines
1620 .outputs = haldclut_outputs,1633 .outputs = haldclut_outputs,
1621 .priv_class = &haldclut_class,1634 .priv_class = &haldclut_class,
1622 .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL | AVFILTER_FLAG_SLICE_THREADS,1635 .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL | AVFILTER_FLAG_SLICE_THREADS,
1636 .process_command = process_command,
1623};1637};
1624#endif1638#endif
1625 1639

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t