Mercurial > libavcodec.hg
diff motion_est_template.c @ 2072:c200977cdf78 libavcodec
clip input motion vectors
be somewhat more tollerant on invalid input
return INT_MAX instead of -1 for unuseable mv/mb types as that ensures nicely that they arent used
initalize limits earlier for b frames
a few more asserts to check for out of picture vectors
author | michael |
---|---|
date | Thu, 10 Jun 2004 22:56:43 +0000 |
parents | 3ab8f3e2ae6a |
children | 75aae96e6b54 |
line wrap: on
line diff
--- a/motion_est_template.c Thu Jun 10 04:13:43 2004 +0000 +++ b/motion_est_template.c Thu Jun 10 22:56:43 2004 +0000 @@ -487,6 +487,10 @@ {\ const int key= ((y)<<ME_MAP_MV_BITS) + (x) + map_generation;\ const int index= (((y)<<ME_MAP_SHIFT) + (x))&(ME_MAP_SIZE-1);\ + assert((x) >= xmin);\ + assert((x) <= xmax);\ + assert((y) >= ymin);\ + assert((y) <= ymax);\ /*printf("check_mv %d %d\n", x, y);*/\ if(map[index]!=key){\ d= cmp(s, x, y, 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);\