[svn] / branches / dev-api-4 / xvidcore / src / motion / estimation_bvop.c Repository:
ViewVC logotype

Diff of /branches/dev-api-4/xvidcore/src/motion/estimation_bvop.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1273, Thu Dec 18 02:02:08 2003 UTC revision 1274, Thu Dec 18 02:53:30 2003 UTC
# Line 21  Line 21 
21   *  along with this program ; if not, write to the Free Software   *  along with this program ; if not, write to the Free Software
22   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
23   *   *
24   * $Id: estimation_bvop.c,v 1.1.2.8 2003-12-18 02:02:08 Isibaar Exp $   * $Id: estimation_bvop.c,v 1.1.2.9 2003-12-18 02:53:30 Isibaar Exp $
25   *   *
26   ****************************************************************************/   ****************************************************************************/
27    
# Line 39  Line 39 
39  #include "sad.h"  #include "sad.h"
40  #include "motion_inlines.h"  #include "motion_inlines.h"
41    
   
42  static int32_t  static int32_t
43  ChromaSAD2(const int fx, const int fy, const int bx, const int by,  ChromaSAD2(const int fx, const int fy, const int bx, const int by,
44                          SearchData * const data)                          SearchData * const data)
# Line 712  Line 711 
711  {  {
712          int i, j;          int i, j;
713          int b_range[4], f_range[4];          int b_range[4], f_range[4];
714            int threshA = (MotionFlags & XVID_ME_FAST_MODEINTERPOLATE) ? 0 : 500;
715            int threshB = (MotionFlags & XVID_ME_FAST_MODEINTERPOLATE) ? 0 : 300;
716    
717          Data->qpel_precision = 0;          Data->qpel_precision = 0;
718          *Data->iMinSAD = 4096*256;          *Data->iMinSAD = 4096*256;
# Line 780  Line 781 
781    
782          /* qpel refinement */          /* qpel refinement */
783          if (Data->qpel) {          if (Data->qpel) {
784                  if (*Data->iMinSAD > *best_sad + 500) return;                  if (*Data->iMinSAD > *best_sad + threshA) return;
785                  Data->qpel_precision = 1;                  Data->qpel_precision = 1;
786                  get_range(&Data->min_dx, &Data->max_dx, &Data->min_dy, &Data->max_dy, x, y, 4, pParam->width, pParam->height, fcode, 2, 0);                  get_range(&Data->min_dx, &Data->max_dx, &Data->min_dy, &Data->max_dy, x, y, 4, pParam->width, pParam->height, fcode, 2, 0);
787    
# Line 789  Line 790 
790                  Data->currentQMV[1].x = 2 * Data->currentMV[1].x;                  Data->currentQMV[1].x = 2 * Data->currentMV[1].x;
791                  Data->currentQMV[1].y = 2 * Data->currentMV[1].y;                  Data->currentQMV[1].y = 2 * Data->currentMV[1].y;
792                  SubpelRefine_dir(Data, CheckCandidateInt, 1);                  SubpelRefine_dir(Data, CheckCandidateInt, 1);
793                  if (*Data->iMinSAD > *best_sad + 300) return;                  if (*Data->iMinSAD > *best_sad + threshB) return;
794                  get_range(&Data->min_dx, &Data->max_dx, &Data->min_dy, &Data->max_dy, x, y, 4, pParam->width, pParam->height, bcode, 2, 0);                  get_range(&Data->min_dx, &Data->max_dx, &Data->min_dy, &Data->max_dy, x, y, 4, pParam->width, pParam->height, bcode, 2, 0);
795                  SubpelRefine_dir(Data, CheckCandidateInt, 2);                  SubpelRefine_dir(Data, CheckCandidateInt, 2);
796          }          }
# Line 867  Line 868 
868                  for (i = 0; i < pParam->mb_width; i++) {                  for (i = 0; i < pParam->mb_width; i++) {
869                          MACROBLOCK * const pMB = frame->mbs + i + j * pParam->mb_width;                          MACROBLOCK * const pMB = frame->mbs + i + j * pParam->mb_width;
870                          const MACROBLOCK * const b_mb = b_mbs + i + j * pParam->mb_width;                          const MACROBLOCK * const b_mb = b_mbs + i + j * pParam->mb_width;
871                            int interpol_search;
872    
873  /* special case, if collocated block is SKIPed in P-VOP: encoding is forward (0,0), cpb=0 without further ado */  /* special case, if collocated block is SKIPed in P-VOP: encoding is forward (0,0), cpb=0 without further ado */
874                          if (b_reference->coding_type != S_VOP)                          if (b_reference->coding_type != S_VOP)
# Line 914  Line 916 
916                                                  MODE_BACKWARD, &Data);                                                  MODE_BACKWARD, &Data);
917    
918                          /* interpolate search comes last, because it uses data from forward and backward as prediction */                          /* interpolate search comes last, because it uses data from forward and backward as prediction */
919                            if (frame->motion_flags & XVID_ME_FAST_MODEINTERPOLATE)
920                                    interpol_search = (best_sad > Data.iQuant * 3 * MAX_SAD00_FOR_SKIP * (Data.chroma ? 3:2));
921                            else
922                                    interpol_search = 1;
923    
924                            if (interpol_search) {
925                          SearchInterpolate(f_ref, f_refH->y, f_refV->y, f_refHV->y,                          SearchInterpolate(f_ref, f_refH->y, f_refV->y, f_refHV->y,
926                                                  b_ref, b_refH->y, b_refV->y, b_refHV->y,                                                  b_ref, b_refH->y, b_refV->y, b_refHV->y,
927                                                  i, j,                                                  i, j,
# Line 923  Line 931 
931                                                  &f_predMV, &b_predMV,                                                  &f_predMV, &b_predMV,
932                                                  pMB, &best_sad,                                                  pMB, &best_sad,
933                                                  &Data);                                                  &Data);
934                            }
935    
936                          /* final skip decision */                          /* final skip decision */
937                          if ( (skip_sad < Data.iQuant * MAX_SAD00_FOR_SKIP * (Data.chroma ? 3:2) )                          if ( (skip_sad < Data.iQuant * MAX_SAD00_FOR_SKIP * (Data.chroma ? 3:2) )

Legend:
Removed from v.1273  
changed lines
  Added in v.1274

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4