diff options
author | Thomas Mundt <tmundt75@gmail.com> | 2017-09-18 23:57:17 +0200 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2017-09-23 16:19:58 -0300 |
commit | 58ca446672fec10e851b820ce7df64bd2d1f3a70 (patch) | |
tree | 5868650f529e199d4bc9b4551d3b6fc021847b51 /libavfilter/vf_tinterlace.c | |
parent | 01911b9b3cad85ff1c346165659c0181db661b3e (diff) | |
download | ffmpeg-58ca446672fec10e851b820ce7df64bd2d1f3a70.tar.gz |
avfilter/tinterlace: use drawutils for pad mode
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Thomas Mundt <tmundt75@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavfilter/vf_tinterlace.c')
-rw-r--r-- | libavfilter/vf_tinterlace.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/libavfilter/vf_tinterlace.c b/libavfilter/vf_tinterlace.c index 9ae9daafc1..f934a06b69 100644 --- a/libavfilter/vf_tinterlace.c +++ b/libavfilter/vf_tinterlace.c @@ -156,21 +156,19 @@ static int config_out_props(AVFilterLink *outlink) av_make_q(2, 1)); if (tinterlace->mode == MODE_PAD) { - uint8_t black[4] = { 16, 128, 128, 16 }; - int i, ret; + uint8_t black[4] = { 0, 0, 0, 16 }; + int ret; + ff_draw_init(&tinterlace->draw, outlink->format, 0); + ff_draw_color(&tinterlace->draw, &tinterlace->color, black); if (ff_fmt_is_in(outlink->format, full_scale_yuvj_pix_fmts)) - black[0] = black[3] = 0; + tinterlace->color.comp[0].u8[0] = 0; ret = av_image_alloc(tinterlace->black_data, tinterlace->black_linesize, outlink->w, outlink->h, outlink->format, 16); if (ret < 0) return ret; - /* fill black picture with black */ - for (i = 0; i < 4 && tinterlace->black_data[i]; i++) { - int h = i == 1 || i == 2 ? AV_CEIL_RSHIFT(outlink->h, desc->log2_chroma_h) : outlink->h; - memset(tinterlace->black_data[i], black[i], - tinterlace->black_linesize[i] * h); - } + ff_fill_rectangle(&tinterlace->draw, &tinterlace->color, tinterlace->black_data, + tinterlace->black_linesize, 0, 0, outlink->w, outlink->h); } if (tinterlace->flags & (TINTERLACE_FLAG_VLPF | TINTERLACE_FLAG_CVLPF) && !(tinterlace->mode == MODE_INTERLEAVE_TOP |