diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-23 13:30:51 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-11-23 13:30:51 +0100 |
commit | 25ca8aef54b65c77ed36ab5a6877eba18560e6b8 (patch) | |
tree | 5e90ca85f7a2364a156154e8c9bbc8ca75018736 /libavcodec/mpegvideo_motion.c | |
parent | e9c372362cb736240dcd87658a027ecfb7b9d240 (diff) | |
parent | 4a606c830ae664013cea33800094d4d0f4ec62da (diff) | |
download | ffmpeg-25ca8aef54b65c77ed36ab5a6877eba18560e6b8.tar.gz |
Merge commit '4a606c830ae664013cea33800094d4d0f4ec62da'
* commit '4a606c830ae664013cea33800094d4d0f4ec62da':
av_memcpy_backptr: optimise some special cases
mpegvideo: simplify dxy calculation in hpel_motion()
build: add rules to generate preprocessed source files
Conflicts:
Makefile
libavutil/mem.c
library.mak
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpegvideo_motion.c')
-rw-r--r-- | libavcodec/mpegvideo_motion.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/libavcodec/mpegvideo_motion.c b/libavcodec/mpegvideo_motion.c index 261fc1c405..18e6428888 100644 --- a/libavcodec/mpegvideo_motion.c +++ b/libavcodec/mpegvideo_motion.c @@ -178,20 +178,19 @@ static inline int hpel_motion(MpegEncContext *s, op_pixels_func *pix_op, int motion_x, int motion_y) { - int dxy; + int dxy = 0; int emu=0; - dxy = ((motion_y & 1) << 1) | (motion_x & 1); src_x += motion_x >> 1; src_y += motion_y >> 1; /* WARNING: do no forget half pels */ src_x = av_clip(src_x, -16, s->width); //FIXME unneeded for emu? - if (src_x == s->width) - dxy &= ~1; + if (src_x != s->width) + dxy |= motion_x & 1; src_y = av_clip(src_y, -16, s->height); - if (src_y == s->height) - dxy &= ~2; + if (src_y != s->height) + dxy |= (motion_y & 1) << 1; src += src_y * s->linesize + src_x; if(s->unrestricted_mv && (s->flags&CODEC_FLAG_EMU_EDGE)){ |