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

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

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

revision 437, Sat Sep 7 09:12:22 2002 UTC revision 486, Mon Sep 16 21:41:20 2002 UTC
# Line 141  Line 141 
141          static const VECTOR zeroMV = { 0, 0 };          static const VECTOR zeroMV = { 0, 0 };
142          VECTOR predMV;          VECTOR predMV;
143    
144          int32_t x, y;          uint32_t x, y;
145          int32_t iIntra = 0;          uint32_t iIntra = 0;
146          VECTOR pmv;          VECTOR pmv;
147    
148          if (sadInit)          if (sadInit)
# Line 153  Line 153 
153    
154                          MACROBLOCK *const pMB = &pMBs[x + y * iWcount];                          MACROBLOCK *const pMB = &pMBs[x + y * iWcount];
155    
                         if (pMB->mode == MODE_NOT_CODED)  
                                 continue;  
   
156                          predMV = get_pmv2(pMBs, pParam->mb_width, 0, x, y, 0);                          predMV = get_pmv2(pMBs, pParam->mb_width, 0, x, y, 0);
157    
158                          pMB->sad16 =                          pMB->sad16 =
# Line 693  Line 690 
690                                                  const uint8_t * const cur,                                                  const uint8_t * const cur,
691                                                  const int x,                                                  const int x,
692                                                  const int y,                                                  const int y,
693                                             int start_x,                                                  const int start_xi,
694                                             int start_y,                                                  const int start_yi,
695                                             int iMinSAD,                                             int iMinSAD,
696                                             VECTOR * const currMV,                                             VECTOR * const currMV,
697                                             const int center_x,                                             const int center_x,
# Line 711  Line 708 
708  {  {
709    
710          int32_t iSAD;          int32_t iSAD;
711            int start_x = start_xi, start_y = start_yi;
712    
713  /* directions: 1 - left (x-1); 2 - right (x+1), 4 - up (y-1); 8 - down (y+1) */  /* directions: 1 - left (x-1); 2 - right (x+1), 4 - up (y-1); 8 - down (y+1) */
714    
# Line 901  Line 899 
899  }  }
900    
901  int32_t  int32_t
902  Diamond16_InterpolMainSearch(  Diamond16_InterpolMainSearch(const uint8_t * const f_pRef,
                                         const uint8_t * const f_pRef,  
903                                           const uint8_t * const f_pRefH,                                           const uint8_t * const f_pRefH,
904                                           const uint8_t * const f_pRefV,                                           const uint8_t * const f_pRefV,
905                                           const uint8_t * const f_pRefHV,                                           const uint8_t * const f_pRefHV,
# Line 1098  Line 1095 
1095                                             const uint8_t * const cur,                                             const uint8_t * const cur,
1096                                             const int x,                                             const int x,
1097                                             const int y,                                             const int y,
1098                                             int start_x,                                             const int start_xi,
1099                                             int start_y,                                             const int start_yi,
1100                                             int iMinSAD,                                             int iMinSAD,
1101                                             VECTOR * const currMV,                                             VECTOR * const currMV,
1102                                             const int center_x,                                             const int center_x,
# Line 1116  Line 1113 
1113  {  {
1114    
1115          int32_t iSAD;          int32_t iSAD;
1116            int start_x = start_xi, start_y = start_yi;
1117    
1118  /* directions: 1 - left (x-1); 2 - right (x+1), 4 - up (y-1); 8 - down (y+1) */  /* directions: 1 - left (x-1); 2 - right (x+1), 4 - up (y-1); 8 - down (y+1) */
1119    
# Line 1395  Line 1393 
1393          }          }
1394    
1395          /* because we might use something like IF (dx>max_dx) THEN dx=max_dx; */          /* because we might use something like IF (dx>max_dx) THEN dx=max_dx; */
         //bPredEq = get_pmvdata(pMBs, x, y, iWcount, 0, pmv, psad);  
1396          bPredEq = get_pmvdata2(pMBs, iWcount, 0, x, y, 0, pmv, psad);          bPredEq = get_pmvdata2(pMBs, iWcount, 0, x, y, 0, pmv, psad);
1397    
1398          if ((x == 0) && (y == 0)) {          if ((x == 0) && (y == 0)) {
# Line 1453  Line 1450 
1450          if ((iMinSAD < 256) ||          if ((iMinSAD < 256) ||
1451                  ((MVequal(*currMV, prevMB->mvs[0])) &&                  ((MVequal(*currMV, prevMB->mvs[0])) &&
1452                   ((int32_t) iMinSAD < prevMB->sad16))) {                   ((int32_t) iMinSAD < prevMB->sad16))) {
1453                  if (iMinSAD < 2 * iQuant)       // high chances for SKIP-mode                  if (iMinSAD < (int)(2 * iQuant))        // high chances for SKIP-mode
1454                  {                  {
1455                          if (!MVzero(*currMV)) {                          if (!MVzero(*currMV)) {
1456                                  iMinSAD += MV16_00_BIAS;                                  iMinSAD += MV16_00_BIAS;
# Line 1658  Line 1655 
1655                                          const uint8_t * const cur,                                          const uint8_t * const cur,
1656                                          const int x,                                          const int x,
1657                                          const int y,                                          const int y,
1658                                          int32_t start_x,                                          const int32_t start_x,
1659                                          int32_t start_y,                                          const int32_t start_y,
1660                                          int32_t iMinSAD,                                          int32_t iMinSAD,
1661                                          VECTOR * const currMV,                                          VECTOR * const currMV,
1662                                     const int center_x,                                     const int center_x,
# Line 1728  Line 1725 
1725                                          const uint8_t * const cur,                                          const uint8_t * const cur,
1726                                          const int x,                                          const int x,
1727                                          const int y,                                          const int y,
1728                                          int32_t start_x,                                     const int32_t start_x,
1729                                          int32_t start_y,                                     const int32_t start_y,
1730                                          int32_t iMinSAD,                                          int32_t iMinSAD,
1731                                          VECTOR * const currMV,                                          VECTOR * const currMV,
1732                                     const int center_x,                                     const int center_x,
# Line 2010  Line 2007 
2007          }          }
2008    
2009          /* because we might use IF (dx>max_dx) THEN dx=max_dx; */          /* because we might use IF (dx>max_dx) THEN dx=max_dx; */
         //bPredEq = get_pmvdata(pMBs, (x >> 1), (y >> 1), iWcount, iSubBlock, pmv, psad);  
2010          bPredEq = get_pmvdata2(pMBs, iWcount, 0, (x >> 1), (y >> 1), iSubBlock, pmv, psad);          bPredEq = get_pmvdata2(pMBs, iWcount, 0, (x >> 1), (y >> 1), iSubBlock, pmv, psad);
2011    
2012          if ((x == 0) && (y == 0)) {          if ((x == 0) && (y == 0)) {
# Line 2325  Line 2321 
2321                  max_dy = EVEN(max_dy);                  max_dy = EVEN(max_dy);
2322          }          }
2323          /* because we might use something like IF (dx>max_dx) THEN dx=max_dx; */          /* because we might use something like IF (dx>max_dx) THEN dx=max_dx; */
         //bPredEq = get_pmvdata(pMBs, x, y, iWcount, 0, pmv, psad);  
2324          bPredEq = get_pmvdata2(pMBs, iWcount, 0, x, y, 0, pmv, psad);          bPredEq = get_pmvdata2(pMBs, iWcount, 0, x, y, 0, pmv, psad);
2325    
2326  /* Step 4: Calculate SAD around the Median prediction.  /* Step 4: Calculate SAD around the Median prediction.
# Line 2608  Line 2603 
2603                  max_dy = EVEN(max_dy);                  max_dy = EVEN(max_dy);
2604          }          }
2605          /* because we might use something like IF (dx>max_dx) THEN dx=max_dx; */          /* because we might use something like IF (dx>max_dx) THEN dx=max_dx; */
         //bPredEq = get_pmvdata(pMBs, x >> 1, y >> 1, iWcount, iSubBlock, pmv[0].x, pmv[0].y, psad);  
2606          bPredEq = get_pmvdata2(pMBs, iWcount, 0, x >> 1, y >> 1, iSubBlock, pmv, psad);          bPredEq = get_pmvdata2(pMBs, iWcount, 0, x >> 1, y >> 1, iSubBlock, pmv, psad);
2607    
2608    
# Line 2835  Line 2829 
2829    
2830          MainSearch16FuncPtr MainSearchPtr;          MainSearch16FuncPtr MainSearchPtr;
2831    
2832          const MACROBLOCK *const prevMB = prevMBs + x + y * iWcount;          MACROBLOCK *const prevMB = (MACROBLOCK *const)prevMBs + x + y * iWcount;
2833          MACROBLOCK *const pMB = pMBs + x + y * iWcount;          MACROBLOCK *const pMB = (MACROBLOCK *const)(pMBs + x + y * iWcount);
2834    
2835          int32_t threshA, threshB;          int32_t threshA, threshB;
2836          int32_t bPredEq;          int32_t bPredEq;
# Line 2906  Line 2900 
2900          if ((iMinSAD < 256) ||          if ((iMinSAD < 256) ||
2901                  ((MVequal(*currMV, prevMB->i_mvs[0])) &&                  ((MVequal(*currMV, prevMB->i_mvs[0])) &&
2902                   ((int32_t) iMinSAD < prevMB->i_sad16))) {                   ((int32_t) iMinSAD < prevMB->i_sad16))) {
2903                  if (iMinSAD < 2 * iQuant)       // high chances for SKIP-mode                  if (iMinSAD < (int)(2 * iQuant))        // high chances for SKIP-mode
2904                  {                  {
2905                          if (!MVzero(*currMV)) {                          if (!MVzero(*currMV)) {
2906                                  iMinSAD += MV16_00_BIAS;                                  iMinSAD += MV16_00_BIAS;
# Line 3075  Line 3069 
3069    
3070          pmv[0] = get_pmv2(pMBs, pParam->mb_width, 0, x, y, 0);          // get _REAL_ prediction (halfpel possible)          pmv[0] = get_pmv2(pMBs, pParam->mb_width, 0, x, y, 0);          // get _REAL_ prediction (halfpel possible)
3071    
 PMVfastInt16_Terminate_without_Refine:  
3072          currPMV->x = currMV->x - center_x;          currPMV->x = currMV->x - center_x;
3073          currPMV->y = currMV->y - center_y;          currPMV->y = currMV->y - center_y;
3074          return iMinSAD;          return iMinSAD;

Legend:
Removed from v.437  
changed lines
  Added in v.486

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