Unified · Split
| @@ -974,23 +974,23 @@ const AVFilter ff_vf_convolution = { · 973 unmodified lines | ||
| 974 | 974 | |
| 975 | 975 | #endif /* CONFIG_CONVOLUTION_FILTER */ |
| 976 | 976 | |
| 977 | −static const AVOption prewitt_roberts_sobel_options[] = { | |
| 977 | +static const AVOption common_options[] = { | |
| 978 | 978 | { "planes", "set planes to filter", OFFSET(planes), AV_OPT_TYPE_INT, {.i64=15}, 0, 15, FLAGS}, |
| 979 | 979 | { "scale", "set scale", OFFSET(scale), AV_OPT_TYPE_FLOAT, {.dbl=1.0}, 0.0, 65535, FLAGS}, |
| 980 | 980 | { "delta", "set delta", OFFSET(delta), AV_OPT_TYPE_FLOAT, {.dbl=0}, -65535, 65535, FLAGS}, |
| 981 | 981 | { NULL } |
| 982 | 982 | }; |
| 983 | 983 | |
| 984 | −#if CONFIG_PREWITT_FILTER | |
| 984 | +AVFILTER_DEFINE_CLASS_EXT(common, "kirsch/prewitt/roberts/scharr/sobel", | |
| 985 | + common_options); | |
| 985 | 986 | |
| 986 | −#define prewitt_options prewitt_roberts_sobel_options | |
| 987 | −AVFILTER_DEFINE_CLASS(prewitt); | |
| 987 | +#if CONFIG_PREWITT_FILTER | |
| 988 | 988 | |
| 989 | 989 | const AVFilter ff_vf_prewitt = { |
| 990 | 990 | .name = "prewitt", |
| 991 | 991 | .description = NULL_IF_CONFIG_SMALL("Apply prewitt operator."), |
| 992 | 992 | .priv_size = sizeof(ConvolutionContext), |
| 993 | − .priv_class = &prewitt_class, | |
| 993 | + .priv_class = &common_class, | |
| 994 | 994 | .init = init, |
| 995 | 995 | .query_formats = query_formats, |
| 996 | 996 | FILTER_INPUTS(convolution_inputs), |
| @@ -1003,14 +1003,11 @@ const AVFilter ff_vf_prewitt = { · 6 unmodified lines | ||
| 1003 | 1003 | |
| 1004 | 1004 | #if CONFIG_SOBEL_FILTER |
| 1005 | 1005 | |
| 1006 | −#define sobel_options prewitt_roberts_sobel_options | |
| 1007 | −AVFILTER_DEFINE_CLASS(sobel); | |
| 1008 | − | |
| 1009 | 1006 | const AVFilter ff_vf_sobel = { |
| 1010 | 1007 | .name = "sobel", |
| 1011 | 1008 | .description = NULL_IF_CONFIG_SMALL("Apply sobel operator."), |
| 1012 | 1009 | .priv_size = sizeof(ConvolutionContext), |
| 1013 | − .priv_class = &sobel_class, | |
| 1010 | + .priv_class = &common_class, | |
| 1014 | 1011 | .init = init, |
| 1015 | 1012 | .query_formats = query_formats, |
| 1016 | 1013 | FILTER_INPUTS(convolution_inputs), |
| @@ -1023,14 +1020,11 @@ const AVFilter ff_vf_sobel = { · 6 unmodified lines | ||
| 1023 | 1020 | |
| 1024 | 1021 | #if CONFIG_ROBERTS_FILTER |
| 1025 | 1022 | |
| 1026 | −#define roberts_options prewitt_roberts_sobel_options | |
| 1027 | −AVFILTER_DEFINE_CLASS(roberts); | |
| 1028 | − | |
| 1029 | 1023 | const AVFilter ff_vf_roberts = { |
| 1030 | 1024 | .name = "roberts", |
| 1031 | 1025 | .description = NULL_IF_CONFIG_SMALL("Apply roberts cross operator."), |
| 1032 | 1026 | .priv_size = sizeof(ConvolutionContext), |
| 1033 | − .priv_class = &roberts_class, | |
| 1027 | + .priv_class = &common_class, | |
| 1034 | 1028 | .init = init, |
| 1035 | 1029 | .query_formats = query_formats, |
| 1036 | 1030 | FILTER_INPUTS(convolution_inputs), |
| @@ -1043,14 +1037,11 @@ const AVFilter ff_vf_roberts = { · 6 unmodified lines | ||
| 1043 | 1037 | |
| 1044 | 1038 | #if CONFIG_KIRSCH_FILTER |
| 1045 | 1039 | |
| 1046 | −#define kirsch_options prewitt_roberts_sobel_options | |
| 1047 | −AVFILTER_DEFINE_CLASS(kirsch); | |
| 1048 | − | |
| 1049 | 1040 | const AVFilter ff_vf_kirsch = { |
| 1050 | 1041 | .name = "kirsch", |
| 1051 | 1042 | .description = NULL_IF_CONFIG_SMALL("Apply kirsch operator."), |
| 1052 | 1043 | .priv_size = sizeof(ConvolutionContext), |
| 1053 | − .priv_class = &kirsch_class, | |
| 1044 | + .priv_class = &common_class, | |
| 1054 | 1045 | .init = init, |
| 1055 | 1046 | .query_formats = query_formats, |
| 1056 | 1047 | FILTER_INPUTS(convolution_inputs), |
| @@ -1063,14 +1054,11 @@ const AVFilter ff_vf_kirsch = { · 6 unmodified lines | ||
| 1063 | 1054 | |
| 1064 | 1055 | #if CONFIG_SCHARR_FILTER |
| 1065 | 1056 | |
| 1066 | −#define scharr_options prewitt_roberts_sobel_options | |
| 1067 | −AVFILTER_DEFINE_CLASS(scharr); | |
| 1068 | − | |
| 1069 | 1057 | const AVFilter ff_vf_scharr = { |
| 1070 | 1058 | .name = "scharr", |
| 1071 | 1059 | .description = NULL_IF_CONFIG_SMALL("Apply scharr operator."), |
| 1072 | 1060 | .priv_size = sizeof(ConvolutionContext), |
| 1073 | − .priv_class = &scharr_class, | |
| 1061 | + .priv_class = &common_class, | |
| 1074 | 1062 | .init = init, |
| 1075 | 1063 | .query_formats = query_formats, |
| 1076 | 1064 | FILTER_INPUTS(convolution_inputs), |