diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-06-11 04:59:05 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-06-11 05:02:46 +0200 |
commit | 60ab6e24574a984655800d1f7ce16c05f4e9b28c (patch) | |
tree | 58081e288e69a0e8b99aecd40208bd58ed32b8aa /libavcodec/mpegvideo_enc.c | |
parent | c69defd4d014e27cbcf207fe6facaebb02ba1285 (diff) | |
download | ffmpeg-60ab6e24574a984655800d1f7ce16c05f4e9b28c.tar.gz |
avcodec/mpegvideo_enc: fix padding for odd dimensions and interlaced video
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r-- | libavcodec/mpegvideo_enc.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index ba17b2c6ce..be5ccd538c 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -1120,6 +1120,11 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg) int h = s->height >> v_shift; uint8_t *src = pic_arg->data[i]; uint8_t *dst = pic->f->data[i]; + int vpad = 16; + + if ( s->codec_id == AV_CODEC_ID_MPEG2VIDEO + && !s->progressive_sequence) + vpad = 32; if (!s->avctx->rc_buffer_size) dst += INPLACE_OFFSET; @@ -1135,11 +1140,11 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg) src += src_stride; } } - if ((s->width & 15) || (s->height & 15)) { + if ((s->width & 15) || (s->height & (vpad-1))) { s->dsp.draw_edges(dst, dst_stride, w, h, 16>>h_shift, - 16>>v_shift, + vpad>>v_shift, EDGE_BOTTOM); } } |