This filter only had an AVClass and empty options because up until recently, avfilter_init_str() errored out when options were provided for a filter without an AVClass. But setting (generic) options is necessary to take advantage of timeline support. So with avfilter_init_str() fixed, the AVClass and the options can be removed.
Unified · Split
| @@ -27,7 +27,6 @@ · 26 unmodified lines | |||
| 27 | 27 | ||
| 28 | #include "libavutil/imgutils.h" | 28 | #include "libavutil/imgutils.h" |
| 29 | #include "libavutil/mem.h" | 29 | #include "libavutil/mem.h" |
| 30 | #include "libavutil/opt.h" | ||
| 31 | 30 | ||
| 32 | #include "avfilter.h" | 31 | #include "avfilter.h" |
| 33 | #include "internal.h" | 32 | #include "internal.h" |
| @@ -41,20 +40,11 @@ typedef struct ThreadData { · 7 unmodified lines | |||
| 41 | } ThreadData; | 40 | } ThreadData; |
| 42 | 41 | ||
| 43 | typedef struct GrayWorldContext { | 42 | typedef struct GrayWorldContext { |
| 44 | const AVClass *class; | ||
| 45 | float *tmpplab; | 43 | float *tmpplab; |
| 46 | int *line_count_pels; | 44 | int *line_count_pels; |
| 47 | float *line_sum; | 45 | float *line_sum; |
| 48 | } GrayWorldContext; | 46 | } GrayWorldContext; |
| 49 | 47 | ||
| 50 | #define OFFSET(x) offsetof(GrayWorldContext, x) | ||
| 51 | #define FLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_RUNTIME_PARAM | ||
| 52 | static const AVOption grayworld_options[] = { | ||
| 53 | { NULL } | ||
| 54 | }; | ||
| 55 | |||
| 56 | AVFILTER_DEFINE_CLASS(grayworld); | ||
| 57 | |||
| 58 | static void apply_matrix(const float matrix[3][3], const float input[3], float output[3]) | 48 | static void apply_matrix(const float matrix[3][3], const float input[3], float output[3]) |
| 59 | { | 49 | { |
| 60 | output[0] = matrix[0][0] * input[0] + matrix[0][1] * input[1] + matrix[0][2] * input[2]; | 50 | output[0] = matrix[0][0] * input[0] + matrix[0][1] * input[1] + matrix[0][2] * input[2]; |
| @@ -311,7 +301,6 @@ const AVFilter ff_vf_grayworld = { · 250 unmodified lines | |||
| 311 | .name = "grayworld", | 301 | .name = "grayworld", |
| 312 | .description = NULL_IF_CONFIG_SMALL("Adjust white balance using LAB gray world algorithm"), | 302 | .description = NULL_IF_CONFIG_SMALL("Adjust white balance using LAB gray world algorithm"), |
| 313 | .priv_size = sizeof(GrayWorldContext), | 303 | .priv_size = sizeof(GrayWorldContext), |
| 314 | .priv_class = &grayworld_class, | ||
| 315 | FILTER_INPUTS(grayworld_inputs), | 304 | FILTER_INPUTS(grayworld_inputs), |
| 316 | FILTER_OUTPUTS(ff_video_default_filterpad), | 305 | FILTER_OUTPUTS(ff_video_default_filterpad), |
| 317 | FILTER_PIXFMTS(AV_PIX_FMT_GBRPF32, AV_PIX_FMT_GBRAPF32), | 306 | FILTER_PIXFMTS(AV_PIX_FMT_GBRPF32, AV_PIX_FMT_GBRAPF32), |