aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mpegvideo_enc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-16 10:44:38 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-16 11:08:21 +0100
commit1e78679768b3a1ef336c5b52aa5027d8a50fcf0d (patch)
tree2cbf5dc5ecfb123c88ba7f12306b7c1dd2b5f4fe /libavcodec/mpegvideo_enc.c
parent446f7c62a2d1358a276212300d09f9af88f9a228 (diff)
downloadandroid_external_ffmpeg-1e78679768b3a1ef336c5b52aa5027d8a50fcf0d.tar.gz
android_external_ffmpeg-1e78679768b3a1ef336c5b52aa5027d8a50fcf0d.tar.bz2
android_external_ffmpeg-1e78679768b3a1ef336c5b52aa5027d8a50fcf0d.zip
mpegvideo_enc: draw edges on input
Improves Motion estimation, avoids using out of picture areas for %16 != 0 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r--libavcodec/mpegvideo_enc.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index a3f9e76ac8..57608b1f9c 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1119,12 +1119,21 @@ static int load_input_picture(MpegEncContext *s, const AVFrame *pic_arg)
if (src_stride == dst_stride)
memcpy(dst, src, src_stride * h);
else {
- while (h--) {
- memcpy(dst, src, w);
- dst += dst_stride;
+ int h2 = h;
+ uint8_t *dst2 = dst;
+ while (h2--) {
+ memcpy(dst2, src, w);
+ dst2 += dst_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);
+ }
}
}
}