Mercurial > libavcodec.hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
2071:41d30bae5019 | 2072:c200977cdf78 |
---|---|
485 | 485 |
486 #define CHECK_MV(x,y)\ | 486 #define CHECK_MV(x,y)\ |
487 {\ | 487 {\ |
488 const int key= ((y)<<ME_MAP_MV_BITS) + (x) + map_generation;\ | 488 const int key= ((y)<<ME_MAP_MV_BITS) + (x) + map_generation;\ |
489 const int index= (((y)<<ME_MAP_SHIFT) + (x))&(ME_MAP_SIZE-1);\ | 489 const int index= (((y)<<ME_MAP_SHIFT) + (x))&(ME_MAP_SIZE-1);\ |
490 assert((x) >= xmin);\ | |
491 assert((x) <= xmax);\ | |
492 assert((y) >= ymin);\ | |
493 assert((y) <= ymax);\ | |
490 /*printf("check_mv %d %d\n", x, y);*/\ | 494 /*printf("check_mv %d %d\n", x, y);*/\ |
491 if(map[index]!=key){\ | 495 if(map[index]!=key){\ |
492 d= cmp(s, x, y, 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);\ | 496 d= cmp(s, x, y, 0, 0, size, h, ref_index, src_index, cmpf, chroma_cmpf, flags);\ |
493 map[index]= key;\ | 497 map[index]= key;\ |
494 score_map[index]= d;\ | 498 score_map[index]= d;\ |