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

Diff of /branches/dev-api-3/xvidcore/src/motion/motion_est.c

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

revision 769, Sat Jan 11 14:59:24 2003 UTC revision 770, Sat Jan 11 17:37:11 2003 UTC
# Line 856  Line 856 
856                  }                  }
857          }          }
858    
859          if (current->global_flags & XVID_GMC )  /* first GMC step only for S(GMC)-VOPs */          if (current->global_flags & XVID_GMC )  /* GMC only for S(GMC)-VOPs */
860          {          {
861                  current->warp = GlobalMotionEst( pMBs, pParam, current, reference, pRefH, pRefV, pRefHV);                  current->warp = GlobalMotionEst( pMBs, pParam, current, reference, pRefH, pRefV, pRefHV);
862          }          }
# Line 2036  Line 2036 
2036    
2037                          oldnum++;                          oldnum++;
2038                          meanx += ABS(( sol[0] + (16*mx+8)*sol[1] + (16*my+8)*sol[2] ) - mv.x );                          meanx += ABS(( sol[0] + (16*mx+8)*sol[1] + (16*my+8)*sol[2] ) - mv.x );
2039                          meany += ABS(( sol[3] + (16*my+8)*sol[1] - (16*mx+8)*sol[2] ) - mv.y );                          meany += ABS(( sol[3] - (16*mx+8)*sol[2] + (16*my+8)*sol[1] ) - mv.y );
   
2040                  }                  }
2041    
2042          if (2*meanx > oldnum)   /* mittlere Abweichung von Ebene */          if (4*meanx > oldnum)   /* better fit than 0.25 is useless */
2043                  meanx /= oldnum;                  meanx /= oldnum;
2044          else          else
2045                  meanx = 0.5;                  meanx = 0.25;
2046          if (2*meany > oldnum)  
2047            if (4*meany > oldnum)
2048                  meany /= oldnum;                  meany /= oldnum;
2049          else          else
2050                  meanx = 0.5;                  meany = 0.25;
   
 //      fprintf(stderr,"meanx = %8.5f  meany = %8.5f   %d\n",meanx,meany, oldnum);  
2051    
2052    /*      fprintf(stderr,"sol = (%8.5f, %8.5f, %8.5f, %8.5f)\n",sol[0],sol[1],sol[2],sol[3]);
2053            fprintf(stderr,"meanx = %8.5f  meany = %8.5f   %d\n",meanx,meany, oldnum);
2054    */
2055          num = 0;          num = 0;
2056          for (my = 0; my < MBh; my++)          for (my = 0; my < MBh; my++)
2057                  for (mx = 0; mx < MBw; mx++)                  for (mx = 0; mx < MBw; mx++)
# Line 2063  Line 2064 
2064                                  continue;                                  continue;
2065    
2066                          if  ( ( ABS(( sol[0] + (16*mx+8)*sol[1] + (16*my+8)*sol[2] ) - mv.x ) > meanx )                          if  ( ( ABS(( sol[0] + (16*mx+8)*sol[1] + (16*my+8)*sol[2] ) - mv.x ) > meanx )
2067                             || ( ABS(( sol[3] + (16*my+8)*sol[1] - (16*mx+8)*sol[2] ) - mv.y ) > meany ) )                             || ( ABS(( sol[3] - (16*mx+8)*sol[2] + (16*my+8)*sol[1] ) - mv.y ) > meany ) )
2068                                  MBmask[mbnum]=0;                                  MBmask[mbnum]=0;
2069                          else                          else
2070                                  num++;                                  num++;

Legend:
Removed from v.769  
changed lines
  Added in v.770

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