diff options
author | Kevin Mitchell <kevmitch@gmail.com> | 2014-11-01 04:10:15 -0700 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-11-01 18:03:38 +0100 |
commit | 2847843868c9d7d7e75e771fd79136a00840a8aa (patch) | |
tree | 2336ea45a3378554f6d79e7ab13b79d2244061de | |
parent | 8d9277c3c01c24616532f05a5a09c8bfc7387010 (diff) | |
download | ffmpeg-2847843868c9d7d7e75e771fd79136a00840a8aa.tar.gz |
avfilter/idet: add metadata to "current" frame instead of "next" frame
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavfilter/version.h | 2 | ||||
-rw-r--r-- | libavfilter/vf_idet.c | 24 |
2 files changed, 14 insertions, 12 deletions
diff --git a/libavfilter/version.h b/libavfilter/version.h index 2fa15ebe2e..440c587981 100644 --- a/libavfilter/version.h +++ b/libavfilter/version.h @@ -31,7 +31,7 @@ #define LIBAVFILTER_VERSION_MAJOR 5 #define LIBAVFILTER_VERSION_MINOR 2 -#define LIBAVFILTER_VERSION_MICRO 100 +#define LIBAVFILTER_VERSION_MICRO 101 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ LIBAVFILTER_VERSION_MINOR, \ diff --git a/libavfilter/vf_idet.c b/libavfilter/vf_idet.c index b9c4070d48..56d4cfabb6 100644 --- a/libavfilter/vf_idet.c +++ b/libavfilter/vf_idet.c @@ -82,6 +82,7 @@ static void filter(AVFilterContext *ctx) int64_t delta=0; Type type, best_type; int match = 0; + AVDictionary **metadata = avpriv_frame_get_metadatap(idet->cur); for (i = 0; i < idet->csp->nb_components; i++) { int w = idet->cur->width; @@ -147,14 +148,25 @@ static void filter(AVFilterContext *ctx) idet->prestat [ type] ++; idet->poststat[idet->last_type] ++; + av_log(ctx, AV_LOG_DEBUG, "Single frame:%s, Multi frame:%s\n", type2str(type), type2str(idet->last_type)); + + av_dict_set_int(metadata, "lavfi.idet.single.tff", idet->prestat[TFF], 0); + av_dict_set_int(metadata, "lavfi.idet.single.bff", idet->prestat[BFF], 0); + av_dict_set_int(metadata, "lavfi.idet.single.progressive", idet->prestat[PROGRESSIVE], 0); + av_dict_set_int(metadata, "lavfi.idet.single.undetermined", idet->prestat[UNDETERMINED], 0); + + av_dict_set_int(metadata, "lavfi.idet.multiple.tff", idet->poststat[TFF], 0); + av_dict_set_int(metadata, "lavfi.idet.multiple.bff", idet->poststat[BFF], 0); + av_dict_set_int(metadata, "lavfi.idet.multiple.progressive", idet->poststat[PROGRESSIVE], 0); + av_dict_set_int(metadata, "lavfi.idet.multiple.undetermined", idet->poststat[UNDETERMINED], 0); + } static int filter_frame(AVFilterLink *link, AVFrame *picref) { AVFilterContext *ctx = link->dst; IDETContext *idet = ctx->priv; - AVDictionary **metadata = avpriv_frame_get_metadatap(picref); if (idet->prev) av_frame_free(&idet->prev); @@ -178,16 +190,6 @@ static int filter_frame(AVFilterLink *link, AVFrame *picref) filter(ctx); - av_dict_set_int(metadata, "lavfi.idet.single.tff", idet->prestat[TFF], 0); - av_dict_set_int(metadata, "lavfi.idet.single.bff", idet->prestat[BFF], 0); - av_dict_set_int(metadata, "lavfi.idet.single.progressive", idet->prestat[PROGRESSIVE], 0); - av_dict_set_int(metadata, "lavfi.idet.single.undetermined", idet->prestat[UNDETERMINED], 0); - - av_dict_set_int(metadata, "lavfi.idet.multiple.tff", idet->poststat[TFF], 0); - av_dict_set_int(metadata, "lavfi.idet.multiple.bff", idet->poststat[BFF], 0); - av_dict_set_int(metadata, "lavfi.idet.multiple.progressive", idet->poststat[PROGRESSIVE], 0); - av_dict_set_int(metadata, "lavfi.idet.multiple.undetermined", idet->poststat[UNDETERMINED], 0); - return ff_filter_frame(ctx->outputs[0], av_frame_clone(idet->cur)); } |