The next commit will introduce a proper decimation filter to be used along with the field matching filter. To avoid confusion with this filter which has currently a very limited usage (and will not work properly with the fieldmatching filter), the new decimation filter will take the decimate name, and this filter is renamed to mpdecimate.tags/n2.0
| @@ -2118,7 +2118,6 @@ blackframe_filter_deps="gpl" | |||||
| boxblur_filter_deps="gpl" | boxblur_filter_deps="gpl" | ||||
| colormatrix_filter_deps="gpl" | colormatrix_filter_deps="gpl" | ||||
| cropdetect_filter_deps="gpl" | cropdetect_filter_deps="gpl" | ||||
| decimate_filter_deps="gpl avcodec" | |||||
| delogo_filter_deps="gpl" | delogo_filter_deps="gpl" | ||||
| deshake_filter_deps="avcodec" | deshake_filter_deps="avcodec" | ||||
| deshake_filter_select="dsputil" | deshake_filter_select="dsputil" | ||||
| @@ -2137,6 +2136,7 @@ interlace_filter_deps="gpl" | |||||
| kerndeint_filter_deps="gpl" | kerndeint_filter_deps="gpl" | ||||
| movie_filter_deps="avcodec avformat" | movie_filter_deps="avcodec avformat" | ||||
| mp_filter_deps="gpl avcodec swscale inline_asm" | mp_filter_deps="gpl avcodec swscale inline_asm" | ||||
| mpdecimate_filter_deps="gpl avcodec" | |||||
| mptestsrc_filter_deps="gpl" | mptestsrc_filter_deps="gpl" | ||||
| negate_filter_deps="lut_filter" | negate_filter_deps="lut_filter" | ||||
| noise_filter_deps="gpl" | noise_filter_deps="gpl" | ||||
| @@ -2383,7 +2383,7 @@ curves=vintage | |||||
| @end example | @end example | ||||
| @end itemize | @end itemize | ||||
| @section decimate | |||||
| @section mpdecimate | |||||
| Drop frames that do not differ greatly from the previous frame in | Drop frames that do not differ greatly from the previous frame in | ||||
| order to reduce frame rate. | order to reduce frame rate. | ||||
| @@ -109,7 +109,6 @@ OBJS-$(CONFIG_COPY_FILTER) += vf_copy.o | |||||
| OBJS-$(CONFIG_CROP_FILTER) += vf_crop.o | OBJS-$(CONFIG_CROP_FILTER) += vf_crop.o | ||||
| OBJS-$(CONFIG_CROPDETECT_FILTER) += vf_cropdetect.o | OBJS-$(CONFIG_CROPDETECT_FILTER) += vf_cropdetect.o | ||||
| OBJS-$(CONFIG_CURVES_FILTER) += vf_curves.o | OBJS-$(CONFIG_CURVES_FILTER) += vf_curves.o | ||||
| OBJS-$(CONFIG_DECIMATE_FILTER) += vf_decimate.o | |||||
| OBJS-$(CONFIG_DELOGO_FILTER) += vf_delogo.o | OBJS-$(CONFIG_DELOGO_FILTER) += vf_delogo.o | ||||
| OBJS-$(CONFIG_DESHAKE_FILTER) += vf_deshake.o | OBJS-$(CONFIG_DESHAKE_FILTER) += vf_deshake.o | ||||
| OBJS-$(CONFIG_DRAWBOX_FILTER) += vf_drawbox.o | OBJS-$(CONFIG_DRAWBOX_FILTER) += vf_drawbox.o | ||||
| @@ -137,6 +136,7 @@ OBJS-$(CONFIG_LUT_FILTER) += vf_lut.o | |||||
| OBJS-$(CONFIG_LUTRGB_FILTER) += vf_lut.o | OBJS-$(CONFIG_LUTRGB_FILTER) += vf_lut.o | ||||
| OBJS-$(CONFIG_LUTYUV_FILTER) += vf_lut.o | OBJS-$(CONFIG_LUTYUV_FILTER) += vf_lut.o | ||||
| OBJS-$(CONFIG_MP_FILTER) += vf_mp.o | OBJS-$(CONFIG_MP_FILTER) += vf_mp.o | ||||
| OBJS-$(CONFIG_MPDECIMATE_FILTER) += vf_mpdecimate.o | |||||
| OBJS-$(CONFIG_NEGATE_FILTER) += vf_lut.o | OBJS-$(CONFIG_NEGATE_FILTER) += vf_lut.o | ||||
| OBJS-$(CONFIG_NOFORMAT_FILTER) += vf_format.o | OBJS-$(CONFIG_NOFORMAT_FILTER) += vf_format.o | ||||
| OBJS-$(CONFIG_NOISE_FILTER) += vf_noise.o | OBJS-$(CONFIG_NOISE_FILTER) += vf_noise.o | ||||
| @@ -107,7 +107,6 @@ void avfilter_register_all(void) | |||||
| REGISTER_FILTER(CROP, crop, vf); | REGISTER_FILTER(CROP, crop, vf); | ||||
| REGISTER_FILTER(CROPDETECT, cropdetect, vf); | REGISTER_FILTER(CROPDETECT, cropdetect, vf); | ||||
| REGISTER_FILTER(CURVES, curves, vf); | REGISTER_FILTER(CURVES, curves, vf); | ||||
| REGISTER_FILTER(DECIMATE, decimate, vf); | |||||
| REGISTER_FILTER(DELOGO, delogo, vf); | REGISTER_FILTER(DELOGO, delogo, vf); | ||||
| REGISTER_FILTER(DESHAKE, deshake, vf); | REGISTER_FILTER(DESHAKE, deshake, vf); | ||||
| REGISTER_FILTER(DRAWBOX, drawbox, vf); | REGISTER_FILTER(DRAWBOX, drawbox, vf); | ||||
| @@ -135,6 +134,7 @@ void avfilter_register_all(void) | |||||
| REGISTER_FILTER(LUTRGB, lutrgb, vf); | REGISTER_FILTER(LUTRGB, lutrgb, vf); | ||||
| REGISTER_FILTER(LUTYUV, lutyuv, vf); | REGISTER_FILTER(LUTYUV, lutyuv, vf); | ||||
| REGISTER_FILTER(MP, mp, vf); | REGISTER_FILTER(MP, mp, vf); | ||||
| REGISTER_FILTER(MPDECIMATE, mpdecimate, vf); | |||||
| REGISTER_FILTER(NEGATE, negate, vf); | REGISTER_FILTER(NEGATE, negate, vf); | ||||
| REGISTER_FILTER(NOFORMAT, noformat, vf); | REGISTER_FILTER(NOFORMAT, noformat, vf); | ||||
| REGISTER_FILTER(NOISE, noise, vf); | REGISTER_FILTER(NOISE, noise, vf); | ||||
| @@ -29,7 +29,7 @@ | |||||
| #include "libavutil/avutil.h" | #include "libavutil/avutil.h" | ||||
| #define LIBAVFILTER_VERSION_MAJOR 3 | #define LIBAVFILTER_VERSION_MAJOR 3 | ||||
| #define LIBAVFILTER_VERSION_MINOR 54 | |||||
| #define LIBAVFILTER_VERSION_MINOR 55 | |||||
| #define LIBAVFILTER_VERSION_MICRO 100 | #define LIBAVFILTER_VERSION_MICRO 100 | ||||
| #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ | #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ | ||||
| @@ -20,7 +20,7 @@ | |||||
| */ | */ | ||||
| /** | /** | ||||
| * @file decimate filter, ported from libmpcodecs/vf_decimate.c by | |||||
| * @file mpdecimate filter, ported from libmpcodecs/vf_decimate.c by | |||||
| * Rich Felker. | * Rich Felker. | ||||
| */ | */ | ||||
| @@ -55,7 +55,7 @@ typedef struct { | |||||
| #define OFFSET(x) offsetof(DecimateContext, x) | #define OFFSET(x) offsetof(DecimateContext, x) | ||||
| #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM | #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM | ||||
| static const AVOption decimate_options[] = { | |||||
| static const AVOption mpdecimate_options[] = { | |||||
| { "max", "set the maximum number of consecutive dropped frames (positive), or the minimum interval between dropped frames (negative)", | { "max", "set the maximum number of consecutive dropped frames (positive), or the minimum interval between dropped frames (negative)", | ||||
| OFFSET(max_drop_count), AV_OPT_TYPE_INT, {.i64=0}, INT_MIN, INT_MAX, FLAGS }, | OFFSET(max_drop_count), AV_OPT_TYPE_INT, {.i64=0}, INT_MIN, INT_MAX, FLAGS }, | ||||
| { "hi", "set high dropping threshold", OFFSET(hi), AV_OPT_TYPE_INT, {.i64=64*12}, INT_MIN, INT_MAX, FLAGS }, | { "hi", "set high dropping threshold", OFFSET(hi), AV_OPT_TYPE_INT, {.i64=64*12}, INT_MIN, INT_MAX, FLAGS }, | ||||
| @@ -64,7 +64,7 @@ static const AVOption decimate_options[] = { | |||||
| { NULL } | { NULL } | ||||
| }; | }; | ||||
| AVFILTER_DEFINE_CLASS(decimate); | |||||
| AVFILTER_DEFINE_CLASS(mpdecimate); | |||||
| /** | /** | ||||
| * Return 1 if the two planes are different, 0 otherwise. | * Return 1 if the two planes are different, 0 otherwise. | ||||
| @@ -224,7 +224,7 @@ static int request_frame(AVFilterLink *outlink) | |||||
| return ret; | return ret; | ||||
| } | } | ||||
| static const AVFilterPad decimate_inputs[] = { | |||||
| static const AVFilterPad mpdecimate_inputs[] = { | |||||
| { | { | ||||
| .name = "default", | .name = "default", | ||||
| .type = AVMEDIA_TYPE_VIDEO, | .type = AVMEDIA_TYPE_VIDEO, | ||||
| @@ -235,7 +235,7 @@ static const AVFilterPad decimate_inputs[] = { | |||||
| { NULL } | { NULL } | ||||
| }; | }; | ||||
| static const AVFilterPad decimate_outputs[] = { | |||||
| static const AVFilterPad mpdecimate_outputs[] = { | |||||
| { | { | ||||
| .name = "default", | .name = "default", | ||||
| .type = AVMEDIA_TYPE_VIDEO, | .type = AVMEDIA_TYPE_VIDEO, | ||||
| @@ -244,15 +244,15 @@ static const AVFilterPad decimate_outputs[] = { | |||||
| { NULL } | { NULL } | ||||
| }; | }; | ||||
| AVFilter avfilter_vf_decimate = { | |||||
| .name = "decimate", | |||||
| AVFilter avfilter_vf_mpdecimate = { | |||||
| .name = "mpdecimate", | |||||
| .description = NULL_IF_CONFIG_SMALL("Remove near-duplicate frames."), | .description = NULL_IF_CONFIG_SMALL("Remove near-duplicate frames."), | ||||
| .init = init, | .init = init, | ||||
| .uninit = uninit, | .uninit = uninit, | ||||
| .priv_size = sizeof(DecimateContext), | .priv_size = sizeof(DecimateContext), | ||||
| .query_formats = query_formats, | .query_formats = query_formats, | ||||
| .inputs = decimate_inputs, | |||||
| .outputs = decimate_outputs, | |||||
| .priv_class = &decimate_class, | |||||
| .inputs = mpdecimate_inputs, | |||||
| .outputs = mpdecimate_outputs, | |||||
| .priv_class = &mpdecimate_class, | |||||
| }; | }; | ||||