Browse Source

vf_idet: print accumulated statistics for single and multi frame detection

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n0.11
Michael Niedermayer 13 years ago
parent
commit
4d4df310f2
1 changed files with 10 additions and 3 deletions
  1. +10
    -3
      libavfilter/vf_idet.c

+ 10
- 3
libavfilter/vf_idet.c View File

@@ -39,6 +39,7 @@ typedef struct {


Type last_type; Type last_type;
Type prestat[4]; Type prestat[4];
Type poststat[4];


AVFilterBufferRef *cur; AVFilterBufferRef *cur;
AVFilterBufferRef *next; AVFilterBufferRef *next;
@@ -126,8 +127,6 @@ static void filter(AVFilterContext *ctx)
type = UNDETERMINED; type = UNDETERMINED;
} }


idet->prestat[type] ++;

if (type != UNDETERMINED) if (type != UNDETERMINED)
idet->last_type = type; idet->last_type = type;


@@ -141,6 +140,8 @@ static void filter(AVFilterContext *ctx)
idet->cur->video->interlaced = 0; idet->cur->video->interlaced = 0;
} }


idet->prestat [ type] ++;
idet->poststat[idet->last_type] ++;
av_log(ctx, AV_LOG_INFO, "Single frame:%s, Multi frame:%s\n", type2str(type), type2str(idet->last_type)); av_log(ctx, AV_LOG_INFO, "Single frame:%s, Multi frame:%s\n", type2str(type), type2str(idet->last_type));
} }


@@ -219,12 +220,18 @@ static av_cold void uninit(AVFilterContext *ctx)
{ {
IDETContext *idet = ctx->priv; IDETContext *idet = ctx->priv;


av_log(ctx, AV_LOG_INFO, "TFF:%d BFF:%d Progressive:%d Undetermined:%d\n",
av_log(ctx, AV_LOG_INFO, "Single frame detection: TFF:%d BFF:%d Progressive:%d Undetermined:%d\n",
idet->prestat[TFF], idet->prestat[TFF],
idet->prestat[BFF], idet->prestat[BFF],
idet->prestat[PROGRSSIVE], idet->prestat[PROGRSSIVE],
idet->prestat[UNDETERMINED] idet->prestat[UNDETERMINED]
); );
av_log(ctx, AV_LOG_INFO, "Multi frame detection: TFF:%d BFF:%d Progressive:%d Undetermined:%d\n",
idet->poststat[TFF],
idet->poststat[BFF],
idet->poststat[PROGRSSIVE],
idet->poststat[UNDETERMINED]
);


if (idet->prev) avfilter_unref_buffer(idet->prev); if (idet->prev) avfilter_unref_buffer(idet->prev);
if (idet->cur ) avfilter_unref_buffer(idet->cur ); if (idet->cur ) avfilter_unref_buffer(idet->cur );


Loading…
Cancel
Save