[FFmpeg-cvslog] avfilter/idet: add metadata to "current" frame instead of "next" frame

Kevin Mitchell git at videolan.org
Sat Nov 1 18:12:06 CET 2014


ffmpeg | branch: master | Kevin Mitchell <kevmitch at gmail.com> | Sat Nov  1 04:10:15 2014 -0700| [2847843868c9d7d7e75e771fd79136a00840a8aa] | committer: Michael Niedermayer

avfilter/idet: add metadata to "current" frame instead of "next" frame

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2847843868c9d7d7e75e771fd79136a00840a8aa
---

 libavfilter/version.h |    2 +-
 libavfilter/vf_idet.c |   24 +++++++++++++-----------
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/libavfilter/version.h b/libavfilter/version.h
index 2fa15eb..440c587 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 b9c4070..56d4cfa 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));
 }
 



More information about the ffmpeg-cvslog mailing list