aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-01-28 00:36:58 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-01-28 00:36:58 +0000
commit5a60360712c331b329e4f6e122b87bd288b20819 (patch)
tree59325ce62cb64ab0c6685d1ba0c5a88b4361a140
parent6ff6cff203f5e15a2f1733c5dd4b85e3731f127d (diff)
downloadffmpeg-5a60360712c331b329e4f6e122b87bd288b20819.tar.gz
4mv + b frame encoding segfault fix
Originally committed as revision 2728 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/motion_est.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c
index a1d56a1f19..e8641790b2 100644
--- a/libavcodec/motion_est.c
+++ b/libavcodec/motion_est.c
@@ -1577,15 +1577,15 @@ static inline int direct_search(MpegEncContext * s, uint8_t *src_data[3], uint8_
max= FFMAX(s->me.direct_basis_mv[i][0], s->me.direct_basis_mv[i][0] - s->me.co_located_mv[i][0])>>shift;
min= FFMIN(s->me.direct_basis_mv[i][0], s->me.direct_basis_mv[i][0] - s->me.co_located_mv[i][0])>>shift;
- max+= (2*mb_x + (i& 1))*8 + 1; // +-1 is for the simpler rounding
- min+= (2*mb_x + (i& 1))*8 - 1;
+ max+= 16*mb_x + 1; // +-1 is for the simpler rounding
+ min+= 16*mb_x - 1;
xmax= FFMIN(xmax, s->width - max);
xmin= FFMAX(xmin, - 16 - min);
max= FFMAX(s->me.direct_basis_mv[i][1], s->me.direct_basis_mv[i][1] - s->me.co_located_mv[i][1])>>shift;
min= FFMIN(s->me.direct_basis_mv[i][1], s->me.direct_basis_mv[i][1] - s->me.co_located_mv[i][1])>>shift;
- max+= (2*mb_y + (i>>1))*8 + 1; // +-1 is for the simpler rounding
- min+= (2*mb_y + (i>>1))*8 - 1;
+ max+= 16*mb_y + 1; // +-1 is for the simpler rounding
+ min+= 16*mb_y - 1;
ymax= FFMIN(ymax, s->height - max);
ymin= FFMAX(ymin, - 16 - min);