diff options
author | Clément Bœsch <ubitux@gmail.com> | 2013-04-15 17:42:04 +0200 |
---|---|---|
committer | Clément Bœsch <ubitux@gmail.com> | 2013-04-23 01:02:27 +0200 |
commit | b8a5c76131944b4cc17c6db609288d0000d56a43 (patch) | |
tree | 2aeabcf34ac5d3ada79c9ae6168dba392ab393dd /libavfilter/vf_fieldmatch.c | |
parent | f4596e8bb6f74599b8258c87036c237c5da4b209 (diff) | |
download | ffmpeg-b8a5c76131944b4cc17c6db609288d0000d56a43.tar.gz |
lavfi: add frame counter into AVFilterLink and use it in filters.
Diffstat (limited to 'libavfilter/vf_fieldmatch.c')
-rw-r--r-- | libavfilter/vf_fieldmatch.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libavfilter/vf_fieldmatch.c b/libavfilter/vf_fieldmatch.c index ff803f4f88..3495895f08 100644 --- a/libavfilter/vf_fieldmatch.c +++ b/libavfilter/vf_fieldmatch.c @@ -77,7 +77,6 @@ typedef struct { AVFrame *prv, *src, *nxt; ///< main sliding window of 3 frames AVFrame *prv2, *src2, *nxt2; ///< sliding window of the optional second stream - int64_t frame_count; ///< output frame counter int got_frame[2]; ///< frame request flag for each input stream int hsub, vsub; ///< chroma subsampling values uint32_t eof; ///< bitmask for end of stream @@ -738,7 +737,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) /* scene change check */ if (fm->combmatch == COMBMATCH_SC) { - if (fm->lastn == fm->frame_count - 1) { + if (fm->lastn == outlink->frame_count - 1) { if (fm->lastscdiff > fm->scthresh) sc = 1; } else if (luma_abs_diff(fm->prv, fm->src) > fm->scthresh) { @@ -746,7 +745,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) } if (!sc) { - fm->lastn = fm->frame_count; + fm->lastn = outlink->frame_count; fm->lastscdiff = luma_abs_diff(fm->src, fm->nxt); sc = fm->lastscdiff > fm->scthresh; } @@ -805,10 +804,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) dst->interlaced_frame = combs[match] >= fm->combpel; if (dst->interlaced_frame) { av_log(ctx, AV_LOG_WARNING, "Frame #%"PRId64" at %s is still interlaced\n", - fm->frame_count, av_ts2timestr(in->pts, &inlink->time_base)); + outlink->frame_count, av_ts2timestr(in->pts, &inlink->time_base)); dst->top_field_first = field; } - fm->frame_count++; av_log(ctx, AV_LOG_DEBUG, "SC:%d | COMBS: %3d %3d %3d %3d %3d (combpel=%d)" " match=%d combed=%s\n", sc, combs[0], combs[1], combs[2], combs[3], combs[4], |