aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/vf_fieldmatch.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2023-04-12 11:38:46 -0300
committerJames Almer <jamrial@gmail.com>2023-05-04 18:14:11 -0300
commit36827ea783afbb39e5b75e8a982e316739009773 (patch)
tree745980f298dd29d5e56f5d0480e3d837cc8cc0e5 /libavfilter/vf_fieldmatch.c
parent2f561ba953e23887ddb25ab1b6739aab04ff9115 (diff)
downloadffmpeg-36827ea783afbb39e5b75e8a982e316739009773.tar.gz
avfilter: use the new AVFrame interlace flags in all filters
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavfilter/vf_fieldmatch.c')
-rw-r--r--libavfilter/vf_fieldmatch.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/libavfilter/vf_fieldmatch.c b/libavfilter/vf_fieldmatch.c
index bf946beec9..a177cb3fd8 100644
--- a/libavfilter/vf_fieldmatch.c
+++ b/libavfilter/vf_fieldmatch.c
@@ -714,7 +714,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
in = fm->src;
/* parity */
- order = fm->order != FM_PARITY_AUTO ? fm->order : (in->interlaced_frame ? in->top_field_first : 1);
+ order = fm->order != FM_PARITY_AUTO ? fm->order : ((in->flags & AV_FRAME_FLAG_INTERLACED) ?
+ !!(in->flags & AV_FRAME_FLAG_TOP_FIELD_FIRST) : 1);
field = fm->field != FM_PARITY_AUTO ? fm->field : order;
av_assert0(order == 0 || order == 1 || field == 0 || field == 1);
fxo = field ^ order ? fxo1m : fxo0m;
@@ -820,15 +821,21 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
/* mark the frame we are unable to match properly as interlaced so a proper
* de-interlacer can take the relay */
dst->interlaced_frame = interlaced_frame;
- if (dst->interlaced_frame) {
+ if (interlaced_frame) {
+ dst->flags |= AV_FRAME_FLAG_INTERLACED;
av_log(ctx, AV_LOG_WARNING, "Frame #%"PRId64" at %s is still interlaced\n",
outlink->frame_count_in, av_ts2timestr(in->pts, &inlink->time_base));
dst->top_field_first = field;
- }
+ if (field)
+ dst->flags |= AV_FRAME_FLAG_TOP_FIELD_FIRST;
+ else
+ dst->flags &= ~AV_FRAME_FLAG_TOP_FIELD_FIRST;
+ } else
+ dst->flags &= ~AV_FRAME_FLAG_INTERLACED;
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],
- fm->combpel, match, dst->interlaced_frame ? "YES" : "NO");
+ fm->combpel, match, (dst->flags & AV_FRAME_FLAG_INTERLACED) ? "YES" : "NO");
fail:
for (i = 0; i < FF_ARRAY_ELEMS(gen_frames); i++)