Commit 1e786797 authored by Michael Niedermayer's avatar Michael Niedermayer

mpegvideo_enc: draw edges on input

Improves Motion estimation, avoids using out of picture areas for %16 != 0
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 446f7c62
...@@ -1119,12 +1119,21 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg) ...@@ -1119,12 +1119,21 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg)
if (src_stride == dst_stride) if (src_stride == dst_stride)
memcpy(dst, src, src_stride * h); memcpy(dst, src, src_stride * h);
else { else {
while (h--) { int h2 = h;
memcpy(dst, src, w); uint8_t *dst2 = dst;
dst += dst_stride; while (h2--) {
memcpy(dst2, src, w);
dst2 += dst_stride;
src += src_stride; src += src_stride;
} }
} }
if ((s->width & 15) || (s->height & 15)) {
s->dsp.draw_edges(dst, dst_stride,
w, h,
16>>h_shift,
16>>v_shift,
EDGE_BOTTOM);
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment