aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/vf_tinterlace.c
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2019-12-06 11:01:11 +0100
committerMarton Balint <cus@passwd.hu>2019-12-15 00:23:01 +0100
commit6498522befb21974061cb38ece90b482bd0d2b16 (patch)
tree6d174ab131ffc6e8577d48505affbbf3508d402a /libavfilter/vf_tinterlace.c
parent28b5dc6199ed7b4f62e345865fe28142b9cbf9e0 (diff)
downloadffmpeg-6498522befb21974061cb38ece90b482bd0d2b16.tar.gz
avfilter/vf_tinterlace: add support for bypassing already interlaced frames
The old interlace filter worked this way before it was merged with tinterlace. Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavfilter/vf_tinterlace.c')
-rw-r--r--libavfilter/vf_tinterlace.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libavfilter/vf_tinterlace.c b/libavfilter/vf_tinterlace.c
index 32b2ff9f5a..0ee40ffce6 100644
--- a/libavfilter/vf_tinterlace.c
+++ b/libavfilter/vf_tinterlace.c
@@ -53,6 +53,7 @@ static const AVOption tinterlace_options[] = {
{"complex_filter", "enable complex vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_CVLPF},INT_MIN, INT_MAX, FLAGS, "flags" },
{"cvlpf", "enable complex vertical low-pass filter", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_CVLPF},INT_MIN, INT_MAX, FLAGS, "flags" },
{"exact_tb", "force a timebase which can represent timestamps exactly", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_EXACT_TB}, INT_MIN, INT_MAX, FLAGS, "flags" },
+ {"bypass_il", "bypass already interlaced frames", 0, AV_OPT_TYPE_CONST, {.i64 = TINTERLACE_FLAG_BYPASS_IL}, INT_MIN, INT_MAX, FLAGS, "flags" },
{NULL}
};
@@ -439,6 +440,16 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
* halving the frame rate and preserving image height */
case MODE_INTERLEAVE_TOP: /* top field first */
case MODE_INTERLEAVE_BOTTOM: /* bottom field first */
+ if ((tinterlace->flags & TINTERLACE_FLAG_BYPASS_IL) && cur->interlaced_frame) {
+ av_log(ctx, AV_LOG_WARNING,
+ "video is already interlaced, adjusting framerate only\n");
+ out = av_frame_clone(cur);
+ if (!out)
+ return AVERROR(ENOMEM);
+ out->pts /= 2; // adjust pts to new framerate
+ ret = ff_filter_frame(outlink, out);
+ return ret;
+ }
tff = tinterlace->mode == MODE_INTERLEAVE_TOP;
out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
if (!out)