# HG changeset patch # User lorenm # Date 1136772492 0 # Node ID 10934895be5a376c3eb04b499a5d688bc67b00f8 # Parent 8a7d694a21ebe50053e0d79f33644d691056a1d2 10l: bidir_refine didn't save the new mvs. also improve speed. diff -r 8a7d694a21eb -r 10934895be5a motion_est.c --- a/motion_est.c Mon Jan 09 02:05:17 2006 +0000 +++ b/motion_est.c Mon Jan 09 02:08:12 2006 +0000 @@ -1636,6 +1636,12 @@ const int ymin= c->ymin<xmax<ymax<avctx->bidir_refine){ int score, end; #define CHECK_BIDIR(fx,fy,bx,by)\ - if( (fx<=0 || motion_fx+fx<=xmax) && (fy<=0 || motion_fy+fy<=ymax) && (bx<=0 || motion_bx+bx<=xmax) && (by<=0 || motion_by+by<=ymax)\ + if( !BIDIR_MAP(fx,fy,bx,by)\ + &&(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;\ 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){\ fbmin= score;\ @@ -1696,6 +1704,11 @@ }while(!end); } + s->b_bidir_forw_mv_table[xy][0]= motion_fx; + s->b_bidir_forw_mv_table[xy][1]= motion_fy; + s->b_bidir_back_mv_table[xy][0]= motion_bx; + s->b_bidir_back_mv_table[xy][1]= motion_by; + return fbmin; }