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