aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/vf_idet.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_idet.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_idet.c')
-rw-r--r--libavfilter/vf_idet.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/libavfilter/vf_idet.c b/libavfilter/vf_idet.c
index 83d992add1..0f150a273d 100644
--- a/libavfilter/vf_idet.c
+++ b/libavfilter/vf_idet.c
@@ -185,11 +185,15 @@ static void filter(AVFilterContext *ctx)
if (idet->last_type == TFF){
idet->cur->top_field_first = 1;
idet->cur->interlaced_frame = 1;
+ idet->cur->flags |= (AV_FRAME_FLAG_INTERLACED | AV_FRAME_FLAG_TOP_FIELD_FIRST);
}else if(idet->last_type == BFF){
idet->cur->top_field_first = 0;
idet->cur->interlaced_frame = 1;
+ idet->cur->flags &= ~AV_FRAME_FLAG_TOP_FIELD_FIRST;
+ idet->cur->flags |= AV_FRAME_FLAG_INTERLACED;
}else if(idet->last_type == PROGRESSIVE){
idet->cur->interlaced_frame = 0;
+ idet->cur->flags &= ~AV_FRAME_FLAG_INTERLACED;
}
for(i=0; i<3; i++)
@@ -238,13 +242,15 @@ static int filter_frame(AVFilterLink *link, AVFrame *picref)
// initial frame(s) and not interlaced, just pass through for
// the analyze_interlaced_flag mode
if (idet->analyze_interlaced_flag &&
- !picref->interlaced_frame &&
+ !(picref->flags & AV_FRAME_FLAG_INTERLACED) &&
!idet->next) {
return ff_filter_frame(ctx->outputs[0], picref);
}
if (idet->analyze_interlaced_flag_done) {
- if (picref->interlaced_frame && idet->interlaced_flag_accuracy < 0)
+ if ((picref->flags & AV_FRAME_FLAG_INTERLACED) && idet->interlaced_flag_accuracy < 0) {
picref->interlaced_frame = 0;
+ picref->flags &= ~AV_FRAME_FLAG_INTERLACED;
+ }
return ff_filter_frame(ctx->outputs[0], picref);
}
@@ -282,8 +288,9 @@ static int filter_frame(AVFilterLink *link, AVFrame *picref)
}
if (idet->analyze_interlaced_flag) {
- if (idet->cur->interlaced_frame) {
+ if (idet->cur->flags & AV_FRAME_FLAG_INTERLACED) {
idet->cur->interlaced_frame = 0;
+ idet->cur->flags &= ~AV_FRAME_FLAG_INTERLACED;
filter(ctx);
if (idet->last_type == PROGRESSIVE) {
idet->interlaced_flag_accuracy --;
@@ -295,8 +302,10 @@ static int filter_frame(AVFilterLink *link, AVFrame *picref)
if (idet->analyze_interlaced_flag == 1) {
ff_filter_frame(ctx->outputs[0], av_frame_clone(idet->cur));
- if (idet->next->interlaced_frame && idet->interlaced_flag_accuracy < 0)
+ if ((idet->next->flags & AV_FRAME_FLAG_INTERLACED) && idet->interlaced_flag_accuracy < 0) {
idet->next->interlaced_frame = 0;
+ idet->next->flags &= ~AV_FRAME_FLAG_INTERLACED;
+ }
idet->analyze_interlaced_flag_done = 1;
av_log(ctx, AV_LOG_INFO, "Final flag accuracy %d\n", idet->interlaced_flag_accuracy);
return ff_filter_frame(ctx->outputs[0], av_frame_clone(idet->next));