aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/motion_est.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2002-03-28 04:25:35 +0000
committerMichael Niedermayer <michaelni@gmx.at>2002-03-28 04:25:35 +0000
commitcf8039b2cf590416a6402b31b444b25e593d5d62 (patch)
treebeaca28cae0a5a219b5f01bee79d620ddef29ed8 /libavcodec/motion_est.c
parentba6802debf8167f8b9259e83f820dfb53c15a227 (diff)
downloadffmpeg-cf8039b2cf590416a6402b31b444b25e593d5d62.tar.gz
mpeg4 4MV encoding
Originally committed as revision 363 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/motion_est.c')
-rw-r--r--libavcodec/motion_est.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c
index 8c4bddd370..e806868a0a 100644
--- a/libavcodec/motion_est.c
+++ b/libavcodec/motion_est.c
@@ -930,9 +930,9 @@ void estimate_motion(MpegEncContext * s,
const int block_y= mb_y*2 + (block>>1);
const int rel_xmin4= xmin - block_x*8;
- const int rel_xmax4= xmax - block_x*8;
+ const int rel_xmax4= xmax - block_x*8 + 8;
const int rel_ymin4= ymin - block_y*8;
- const int rel_ymax4= ymax - block_y*8;
+ const int rel_ymax4= ymax - block_y*8 + 8;
P[0][0] = s->motion_val[mot_xy ][0];
P[0][1] = s->motion_val[mot_xy ][1];
@@ -951,6 +951,7 @@ void estimate_motion(MpegEncContext * s,
P[3][1] = s->motion_val[mot_xy - mot_stride + off[block]][1];
if(P[2][1] > (rel_ymax4<<shift)) P[2][1]= (rel_ymax4<<shift);
if(P[3][0] < (rel_xmin4<<shift)) P[3][0]= (rel_xmin4<<shift);
+ if(P[3][0] > (rel_xmax4<<shift)) P[3][0]= (rel_xmax4<<shift);
if(P[3][1] > (rel_ymax4<<shift)) P[3][1]= (rel_ymax4<<shift);
P[4][0]= mid_pred(P[1][0], P[2][0], P[3][0]);