|
|
|
@ -183,16 +183,28 @@ static void filter(AVFilterContext *ctx) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (idet->last_type == TFF){ |
|
|
|
|
#if FF_API_INTERLACED_FRAME |
|
|
|
|
FF_DISABLE_DEPRECATION_WARNINGS |
|
|
|
|
idet->cur->top_field_first = 1; |
|
|
|
|
idet->cur->interlaced_frame = 1; |
|
|
|
|
FF_ENABLE_DEPRECATION_WARNINGS |
|
|
|
|
#endif |
|
|
|
|
idet->cur->flags |= (AV_FRAME_FLAG_INTERLACED | AV_FRAME_FLAG_TOP_FIELD_FIRST); |
|
|
|
|
}else if(idet->last_type == BFF){ |
|
|
|
|
#if FF_API_INTERLACED_FRAME |
|
|
|
|
FF_DISABLE_DEPRECATION_WARNINGS |
|
|
|
|
idet->cur->top_field_first = 0; |
|
|
|
|
idet->cur->interlaced_frame = 1; |
|
|
|
|
FF_ENABLE_DEPRECATION_WARNINGS |
|
|
|
|
#endif |
|
|
|
|
idet->cur->flags &= ~AV_FRAME_FLAG_TOP_FIELD_FIRST; |
|
|
|
|
idet->cur->flags |= AV_FRAME_FLAG_INTERLACED; |
|
|
|
|
}else if(idet->last_type == PROGRESSIVE){ |
|
|
|
|
#if FF_API_INTERLACED_FRAME |
|
|
|
|
FF_DISABLE_DEPRECATION_WARNINGS |
|
|
|
|
idet->cur->interlaced_frame = 0; |
|
|
|
|
FF_ENABLE_DEPRECATION_WARNINGS |
|
|
|
|
#endif |
|
|
|
|
idet->cur->flags &= ~AV_FRAME_FLAG_INTERLACED; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -248,7 +260,11 @@ static int filter_frame(AVFilterLink *link, AVFrame *picref) |
|
|
|
|
} |
|
|
|
|
if (idet->analyze_interlaced_flag_done) { |
|
|
|
|
if ((picref->flags & AV_FRAME_FLAG_INTERLACED) && idet->interlaced_flag_accuracy < 0) { |
|
|
|
|
#if FF_API_INTERLACED_FRAME |
|
|
|
|
FF_DISABLE_DEPRECATION_WARNINGS |
|
|
|
|
picref->interlaced_frame = 0; |
|
|
|
|
FF_ENABLE_DEPRECATION_WARNINGS |
|
|
|
|
#endif |
|
|
|
|
picref->flags &= ~AV_FRAME_FLAG_INTERLACED; |
|
|
|
|
} |
|
|
|
|
return ff_filter_frame(ctx->outputs[0], picref); |
|
|
|
@ -289,7 +305,11 @@ static int filter_frame(AVFilterLink *link, AVFrame *picref) |
|
|
|
|
|
|
|
|
|
if (idet->analyze_interlaced_flag) { |
|
|
|
|
if (idet->cur->flags & AV_FRAME_FLAG_INTERLACED) { |
|
|
|
|
#if FF_API_INTERLACED_FRAME |
|
|
|
|
FF_DISABLE_DEPRECATION_WARNINGS |
|
|
|
|
idet->cur->interlaced_frame = 0; |
|
|
|
|
FF_ENABLE_DEPRECATION_WARNINGS |
|
|
|
|
#endif |
|
|
|
|
idet->cur->flags &= ~AV_FRAME_FLAG_INTERLACED; |
|
|
|
|
filter(ctx); |
|
|
|
|
if (idet->last_type == PROGRESSIVE) { |
|
|
|
@ -303,7 +323,11 @@ static int filter_frame(AVFilterLink *link, AVFrame *picref) |
|
|
|
|
ff_filter_frame(ctx->outputs[0], av_frame_clone(idet->cur)); |
|
|
|
|
|
|
|
|
|
if ((idet->next->flags & AV_FRAME_FLAG_INTERLACED) && idet->interlaced_flag_accuracy < 0) { |
|
|
|
|
#if FF_API_INTERLACED_FRAME |
|
|
|
|
FF_DISABLE_DEPRECATION_WARNINGS |
|
|
|
|
idet->next->interlaced_frame = 0; |
|
|
|
|
FF_ENABLE_DEPRECATION_WARNINGS |
|
|
|
|
#endif |
|
|
|
|
idet->next->flags &= ~AV_FRAME_FLAG_INTERLACED; |
|
|
|
|
} |
|
|
|
|
idet->analyze_interlaced_flag_done = 1; |
|
|
|
|