diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2015-06-04 14:11:29 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-06-04 17:03:29 +0200 |
commit | 3b4e694ead8b240e09b9e50140840ef94e1a0688 (patch) | |
tree | 585099aa3e6d75f5999e68ee9f21a92967f79a72 /libavfilter/vf_tinterlace.c | |
parent | b14361486b39f1dc576ecda577fb0257c55174c5 (diff) | |
download | ffmpeg-3b4e694ead8b240e09b9e50140840ef94e1a0688.tar.gz |
lavfi/tinterlace: Double aspect ratio for modes merge and pad.
Diffstat (limited to 'libavfilter/vf_tinterlace.c')
-rw-r--r-- | libavfilter/vf_tinterlace.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavfilter/vf_tinterlace.c b/libavfilter/vf_tinterlace.c index 096a614d67..e2f8c34385 100644 --- a/libavfilter/vf_tinterlace.c +++ b/libavfilter/vf_tinterlace.c @@ -121,6 +121,9 @@ static int config_out_props(AVFilterLink *outlink) outlink->w = inlink->w; outlink->h = tinterlace->mode == MODE_MERGE || tinterlace->mode == MODE_PAD ? inlink->h*2 : inlink->h; + if (tinterlace->mode == MODE_MERGE || tinterlace->mode == MODE_PAD) + outlink->sample_aspect_ratio = av_mul_q(inlink->sample_aspect_ratio, + av_make_q(2, 1)); if (tinterlace->mode == MODE_PAD) { uint8_t black[4] = { 16, 128, 128, 16 }; @@ -266,6 +269,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref) out->height = outlink->h; out->interlaced_frame = 1; out->top_field_first = 1; + out->sample_aspect_ratio = av_mul_q(cur->sample_aspect_ratio, av_make_q(2, 1)); /* write odd frame lines into the upper field of the new frame */ copy_picture_field(tinterlace, out->data, out->linesize, @@ -295,6 +299,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref) return AVERROR(ENOMEM); av_frame_copy_props(out, cur); out->height = outlink->h; + out->sample_aspect_ratio = av_mul_q(cur->sample_aspect_ratio, av_make_q(2, 1)); field = (1 + tinterlace->frame) & 1 ? FIELD_UPPER : FIELD_LOWER; /* copy upper and lower fields */ |