From: Thomas D. <tj...@us...> - 2005-09-27 13:02:03
|
Update of /cvsroot/dirac/compress/libdirac_motionest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29343/libdirac_motionest Modified Files: me_mode_decn.cpp me_mode_decn.h Log Message: Use specific matching classes for different pixel accuracies. Reduced search ranges for increased speed. Index: me_mode_decn.h =================================================================== RCS file: /cvsroot/dirac/compress/libdirac_motionest/me_mode_decn.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** me_mode_decn.h 29 Nov 2004 12:55:06 -0000 1.9 --- me_mode_decn.h 27 Sep 2005 13:01:50 -0000 1.10 *************** *** 152,156 **** IntraBlockDiff* m_intradiff; ! BiBChkBlockDiffUp* m_bicheckdiff; //position variables, used in all the mode decisions --- 152,156 ---- IntraBlockDiff* m_intradiff; ! BiBlockDiff* m_bicheckdiff; //position variables, used in all the mode decisions Index: me_mode_decn.cpp =================================================================== RCS file: /cvsroot/dirac/compress/libdirac_motionest/me_mode_decn.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** me_mode_decn.cpp 19 Jul 2005 14:17:28 -0000 1.16 --- me_mode_decn.cpp 27 Sep 2005 13:01:50 -0000 1.17 *************** *** 68,72 **** for (int i=0 ; i<=2 ; ++i) ! m_mode_factor[i] = 160.0*std::pow(0.8 , 2-i); } --- 68,72 ---- for (int i=0 ; i<=2 ; ++i) ! m_mode_factor[i] = 80.0*std::pow(0.8 , 2-i); } *************** *** 124,130 **** m_ref2_updata = &(my_buffer.GetUpComponent( ref2 , Y_COMP)); // Create an object for computing bi-directional prediction calculations ! m_bicheckdiff = new BiBChkBlockDiffUp( *m_ref1_updata , ! *m_ref2_updata , ! *m_pic_data ); } else --- 124,140 ---- m_ref2_updata = &(my_buffer.GetUpComponent( ref2 , Y_COMP)); // Create an object for computing bi-directional prediction calculations ! ! if ( m_encparams.MVPrecision()==3 ) ! m_bicheckdiff = new BiBlockEighthPel( *m_ref1_updata , ! *m_ref2_updata , ! *m_pic_data ); ! else if ( m_encparams.MVPrecision()==2 ) ! m_bicheckdiff = new BiBlockQuarterPel( *m_ref1_updata , ! *m_ref2_updata , ! *m_pic_data ); ! else ! m_bicheckdiff = new BiBlockHalfPel( *m_ref1_updata , ! *m_ref2_updata , ! *m_pic_data ); } else *************** *** 299,303 **** }// j } - } --- 309,312 ---- *************** *** 330,335 **** for ( int j=0 ; j<2 ; ++j ) for (int i=0 ; i<2 ; ++i ) ! AddNewVlist( cand_list , guide_data.Vectors(1)[guide_ypos+j][guide_xpos+i] , 1 , 1 , ! 1<<( 3-m_encparams.MVPrecision() ) ); if (xblock>0 && yblock>0) --- 339,343 ---- for ( int j=0 ; j<2 ; ++j ) for (int i=0 ; i<2 ; ++i ) ! AddNewVlist( cand_list , guide_data.Vectors(1)[guide_ypos+j][guide_xpos+i] , 0 , 0 ); if (xblock>0 && yblock>0) *************** *** 348,353 **** } ! BlockMatcher my_bmatch1( *m_pic_data , *m_ref1_updata , m_encparams.LumaBParams(level) , ! me_data.Vectors(1) , me_data.PredCosts(1) ); me_data.PredCosts(1)[ypos][xpos].total = 100000000.0f; my_bmatch1.FindBestMatchSubp( xpos , ypos , cand_list, mv_pred, lambda ); --- 356,364 ---- } ! BlockMatcher my_bmatch1( *m_pic_data , ! *m_ref1_updata , ! m_encparams.LumaBParams(level) , ! m_encparams.MVPrecision(), ! me_data.Vectors(1) , me_data.PredCosts(1) ); me_data.PredCosts(1)[ypos][xpos].total = 100000000.0f; my_bmatch1.FindBestMatchSubp( xpos , ypos , cand_list, mv_pred, lambda ); *************** *** 360,365 **** for ( int j=0 ; j<2 ; ++j ) for (int i=0 ; i<2 ; ++i ) ! AddNewVlist( cand_list , guide_data.Vectors(2)[guide_ypos+j][guide_xpos+i] , 1 , 1 , ! 1<<( 3-m_encparams.MVPrecision() ) ); if (xblock>0 && yblock>0) --- 371,375 ---- for ( int j=0 ; j<2 ; ++j ) for (int i=0 ; i<2 ; ++i ) ! AddNewVlist( cand_list , guide_data.Vectors(2)[guide_ypos+j][guide_xpos+i] , 0 , 0 ); if (xblock>0 && yblock>0) *************** *** 378,383 **** } ! BlockMatcher my_bmatch2( *m_pic_data , *m_ref2_updata , m_encparams.LumaBParams(level) , ! me_data.Vectors(2) , me_data.PredCosts(2) ); me_data.PredCosts(2)[ypos][xpos].total = 100000000.0f; my_bmatch2.FindBestMatchSubp( xpos , ypos , cand_list, mv_pred, lambda ); --- 388,396 ---- } ! BlockMatcher my_bmatch2( *m_pic_data , ! *m_ref2_updata , ! m_encparams.LumaBParams(level) , ! m_encparams.MVPrecision(), ! me_data.Vectors(2) , me_data.PredCosts(2) ); me_data.PredCosts(2)[ypos][xpos].total = 100000000.0f; my_bmatch2.FindBestMatchSubp( xpos , ypos , cand_list, mv_pred, lambda ); *************** *** 450,454 **** // Finally, calculate the cost if we were to use bi-predictions // /****************************************************************/ - mode_cost = ModeCost( xpos , ypos , REF1AND2 )*m_mode_factor[level]; --- 463,466 ---- *************** *** 456,460 **** me_data.PredCosts(1)[ypos][xpos].mvcost+ me_data.PredCosts(2)[ypos][xpos].mvcost; ! me_data.BiPredCosts()[ypos][xpos].SAD = m_bicheckdiff->Diff(dparams , me_data.Vectors(1)[ypos][xpos] , --- 468,472 ---- me_data.PredCosts(1)[ypos][xpos].mvcost+ me_data.PredCosts(2)[ypos][xpos].mvcost; ! me_data.BiPredCosts()[ypos][xpos].SAD = m_bicheckdiff->Diff(dparams , me_data.Vectors(1)[ypos][xpos] , *************** *** 521,526 **** if ( MB_cost[REF2_ONLY]<MB_cost[predmode] ) predmode = REF2_ONLY; ! if ( MB_cost[REF1AND2]<MB_cost[predmode] ) ! predmode = REF1AND2; } --- 533,538 ---- if ( MB_cost[REF2_ONLY]<MB_cost[predmode] ) predmode = REF2_ONLY; ! if ( MB_cost[REF1AND2]<MB_cost[predmode] ) ! predmode = REF1AND2; } *************** *** 585,588 **** float ModeDecider::GetDCVar( const ValueType dc_val , const ValueType dc_pred) { ! return 8.0*std::abs( static_cast<float>( dc_val - dc_pred ) ); } --- 597,600 ---- float ModeDecider::GetDCVar( const ValueType dc_val , const ValueType dc_pred) { ! return 4.0*std::abs( static_cast<float>( dc_val - dc_pred ) ); } |