# HG changeset patch # User michael # Date 1270211648 0 # Node ID 56b71cbf22ace33dc4a62933181942e91f5af918 # Parent 5a7797213359299d3ec8bf309d172acf4c28ee2f Change bidir refine hash code so we only need to perform a single hash calculation for the whole function. negligibly faster (about 0.1%) diff -r 5a7797213359 -r 56b71cbf22ac motion_est.c --- a/motion_est.c Fri Apr 02 11:06:29 2010 +0000 +++ b/motion_est.c Fri Apr 02 12:34:08 2010 +0000 @@ -1475,12 +1475,12 @@ const int ymin= c->ymin<xmax<ymax<avctx->bidir_refine){ int score, end; #define CHECK_BIDIR(fx,fy,bx,by)\ - if( !BIDIR_MAP(fx,fy,bx,by)\ + if( !map[(hashidx+HASH(fx,fy,bx,by))&255]\ &&(fx<=0 || motion_fx+fx<=xmax) && (fy<=0 || motion_fy+fy<=ymax) && (bx<=0 || motion_bx+bx<=xmax) && (by<=0 || motion_by+by<=ymax)\ &&(fx>=0 || motion_fx+fx>=xmin) && (fy>=0 || motion_fy+fy>=ymin) && (bx>=0 || motion_bx+bx>=xmin) && (by>=0 || motion_by+by>=ymin)){\ - BIDIR_MAP(fx,fy,bx,by) = 1;\ + map[(hashidx+HASH(fx,fy,bx,by))&255] = 1;\ score= check_bidir_mv(s, motion_fx+fx, motion_fy+fy, motion_bx+bx, motion_by+by, pred_fx, pred_fy, pred_bx, pred_by, 0, 16);\ if(score < fbmin){\ + hashidx += HASH(fx,fy,bx,by);\ fbmin= score;\ motion_fx+=fx;\ motion_fy+=fy;\