[svn] / trunk / xvidcore / src / motion / motion_est.c Repository:
ViewVC logotype

Diff of /trunk/xvidcore/src/motion/motion_est.c

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

revision 141, Thu Apr 25 23:24:59 2002 UTC revision 170, Thu May 9 21:47:51 2002 UTC
# Line 2  Line 2 
2   *   *
3   *  Modifications:   *  Modifications:
4   *   *
5     *      01.05.2002      updated MotionEstimationBVOP
6   *      25.04.2002 partial prevMB conversion   *      25.04.2002 partial prevMB conversion
7   *  22.04.2002 remove some compile warning by chenm001 <chenm001@163.com>   *  22.04.2002 remove some compile warning by chenm001 <chenm001@163.com>
8   *  14.04.2002 added MotionEstimationBVOP()   *  14.04.2002 added MotionEstimationBVOP()
# Line 289  Line 290 
290          if (sadInit)          if (sadInit)
291                  (*sadInit)();                  (*sadInit)();
292    
   
         /* eventhough we have a seperate prevMBs,  
            pmvfast/epsz does something "funny" with the previous frames data */  
   
 /*      for (i = 0; i < iHcount; i++)  
                 for (j = 0; j < iWcount; j++)  
                 {  
                         pMBs[j + i * iWcount].mvs[0] = prevMBs[j + i * iWcount].mvs[0];  
                         pMBs[j + i * iWcount].mvs[1] = prevMBs[j + i * iWcount].mvs[1];  
                         pMBs[j + i * iWcount].mvs[2] = prevMBs[j + i * iWcount].mvs[2];  
                         pMBs[j + i * iWcount].mvs[3] = prevMBs[j + i * iWcount].mvs[3];  
                 }  
 */  
         /*dprintf("*** BEFORE ***");  
         for (i = 0; i < iHcount; i++)  
                 for (j = 0; j < iWcount; j++)  
                 {  
                         dprintf("   [%i,%i] mode=%i dquant=%i mvs=(%i %i %i %i) sad8=(%i %i %i %i) sad16=(%i)", j,i,  
                                 pMBs[j + i * iWcount].mode,  
                                 pMBs[j + i * iWcount].dquant,  
                                 pMBs[j + i * iWcount].mvs[0],  
                                 pMBs[j + i * iWcount].mvs[1],  
                                 pMBs[j + i * iWcount].mvs[2],  
                                 pMBs[j + i * iWcount].mvs[3],  
                                 prevMBs[j + i * iWcount].sad8[0],  
                                 prevMBs[j + i * iWcount].sad8[1],  
                                 prevMBs[j + i * iWcount].sad8[2],  
                                 prevMBs[j + i * iWcount].sad8[3],  
                                 prevMBs[j + i * iWcount].sad16);  
                 }  
         */  
   
293          // note: i==horizontal, j==vertical          // note: i==horizontal, j==vertical
294          for (i = 0; i < iHcount; i++)          for (i = 0; i < iHcount; i++)
295                  for (j = 0; j < iWcount; j++)                  for (j = 0; j < iWcount; j++)
# Line 395  Line 364 
364                                          pMB->mode = MODE_INTER;                                          pMB->mode = MODE_INTER;
365                                          pMB->mvs[0].x = pMB->mvs[1].x = pMB->mvs[2].x = pMB->mvs[3].x = mv16.x;                                          pMB->mvs[0].x = pMB->mvs[1].x = pMB->mvs[2].x = pMB->mvs[3].x = mv16.x;
366                                          pMB->mvs[0].y = pMB->mvs[1].y = pMB->mvs[2].y = pMB->mvs[3].y = mv16.y;                                          pMB->mvs[0].y = pMB->mvs[1].y = pMB->mvs[2].y = pMB->mvs[3].y = mv16.y;
367                                            pMB->sad8[0] = pMB->sad8[1] = pMB->sad8[2] = pMB->sad8[3] = sad16;
368                                          pMB->pmvs[0].x = pmv16.x;                                          pMB->pmvs[0].x = pmv16.x;
369                                          pMB->pmvs[0].y = pmv16.y;                                          pMB->pmvs[0].y = pmv16.y;
370                                  }                                  }
371                                  else                                  else
372                                    {
373                                          pMB->mode = MODE_INTER4V;                                          pMB->mode = MODE_INTER4V;
374                                            pMB->sad8[0] *= 4;
375                                            pMB->sad8[1] *= 4;
376                                            pMB->sad8[2] *= 4;
377                                            pMB->sad8[3] *= 4;
378                                    }
379                          }                          }
380                          else                          else
381                          {                          {
# Line 407  Line 383 
383                                  pMB->mode = MODE_INTER;                                  pMB->mode = MODE_INTER;
384                                  pMB->mvs[0].x = pMB->mvs[1].x = pMB->mvs[2].x = pMB->mvs[3].x = mv16.x;                                  pMB->mvs[0].x = pMB->mvs[1].x = pMB->mvs[2].x = pMB->mvs[3].x = mv16.x;
385                                  pMB->mvs[0].y = pMB->mvs[1].y = pMB->mvs[2].y = pMB->mvs[3].y = mv16.y;                                  pMB->mvs[0].y = pMB->mvs[1].y = pMB->mvs[2].y = pMB->mvs[3].y = mv16.y;
386                                    pMB->sad8[0] = pMB->sad8[1] = pMB->sad8[2] = pMB->sad8[3] = sad16;
387    
388                                  pMB->pmvs[0].x = pmv16.x;                                  pMB->pmvs[0].x = pmv16.x;
389                                  pMB->pmvs[0].y = pmv16.y;                                  pMB->pmvs[0].y = pmv16.y;
390                          }                          }
391                  }                  }
392    
 /*      dprintf("*** AFTER ***", pMBs[0].b_mvs[0].x);  
         for (i = 0; i < iHcount; i++)  
                 for (j = 0; j < iWcount; j++)  
                 {  
                         dprintf("   [%i,%i] mode=%i dquant=%i mvs=(%i %i %i %i) sad8=(%i %i %i %i) sad16=(%i)", j,i,  
                                 pMBs[j + i * iWcount].mode,  
                                 pMBs[j + i * iWcount].dquant,  
                                 pMBs[j + i * iWcount].mvs[0],  
                                 pMBs[j + i * iWcount].mvs[1],  
                                 pMBs[j + i * iWcount].mvs[2],  
                                 pMBs[j + i * iWcount].mvs[3],  
                                 pMBs[j + i * iWcount].sad8[0],  
                                 pMBs[j + i * iWcount].sad8[1],  
                                 pMBs[j + i * iWcount].sad8[2],  
                                 pMBs[j + i * iWcount].sad8[3],  
                                 pMBs[j + i * iWcount].sad16);  
                 }  
         */  
   
393          return 0;          return 0;
394  }  }
395    
# Line 942  Line 901 
901    
902          iFound=0;          iFound=0;
903    
 /* Step 2: Calculate Distance= |MedianMVX| + |MedianMVY| where MedianMV is the motion  
    vector of the median.  
    If PredEq=1 and MVpredicted = Previous Frame MV, set Found=2  
 */  
   
         if ((bPredEq) && (MVequal(pmv[0],prevMB->mvs[0]) ) )  
                 iFound=2;  
   
 /* Step 3: If Distance>0 or thresb<1536 or PredEq=1 Select small Diamond Search.  
    Otherwise select large Diamond Search.  
 */  
   
         if ( (pmv[0].x != 0) || (pmv[0].y != 0) || (threshB<1536) || (bPredEq) )  
                 iDiamondSize=1; // halfpel!  
         else  
                 iDiamondSize=2; // halfpel!  
   
         if (!(MotionFlags & PMV_HALFPELDIAMOND16) )  
                 iDiamondSize*=2;  
   
904  /* Step 4: Calculate SAD around the Median prediction.  /* Step 4: Calculate SAD around the Median prediction.
905     MinSAD=SAD     MinSAD=SAD
906     If Motion Vector equal to Previous frame motion vector     If Motion Vector equal to Previous frame motion vector
# Line 969  Line 908 
908     If SAD<=256 goto Step 10.     If SAD<=256 goto Step 10.
909  */  */
910    
   
 // Prepare for main loop  
   
911          *currMV=pmv[0];         /* current best := prediction */          *currMV=pmv[0];         /* current best := prediction */
912          if (!(MotionFlags & PMV_HALFPEL16 ))          if (!(MotionFlags & PMV_HALFPEL16 ))
913          {       /* This should NOT be necessary! */          {       /* This should NOT be necessary! */
# Line 1003  Line 939 
939    
940          if ( (iMinSAD < 256 ) || ( (MVequal(*currMV,prevMB->mvs[0])) && ((uint32_t)iMinSAD < prevMB->sad16) ) )          if ( (iMinSAD < 256 ) || ( (MVequal(*currMV,prevMB->mvs[0])) && ((uint32_t)iMinSAD < prevMB->sad16) ) )
941          {          {
942                    if (iMinSAD < 2*iQuant) // high chances for SKIP-mode
943                    {
944                            if (!MVzero(*currMV))
945                            {
946                                    iMinSAD += MV16_00_BIAS;
947                                    CHECK_MV16_ZERO;                // (0,0) saves space for letterboxed pictures
948                                    iMinSAD -= MV16_00_BIAS;
949                            }
950                    }
951    
952                  if (MotionFlags & PMV_QUICKSTOP16)                  if (MotionFlags & PMV_QUICKSTOP16)
953                          goto PMVfast16_Terminate_without_Refine;                          goto PMVfast16_Terminate_without_Refine;
# Line 1010  Line 955 
955                          goto PMVfast16_Terminate_with_Refine;                          goto PMVfast16_Terminate_with_Refine;
956          }          }
957    
958    
959    /* Step 2 (lazy eval): Calculate Distance= |MedianMVX| + |MedianMVY| where MedianMV is the motion
960       vector of the median.
961       If PredEq=1 and MVpredicted = Previous Frame MV, set Found=2
962    */
963    
964            if ((bPredEq) && (MVequal(pmv[0],prevMB->mvs[0]) ) )
965                    iFound=2;
966    
967    /* Step 3 (lazy eval): If Distance>0 or thresb<1536 or PredEq=1 Select small Diamond Search.
968       Otherwise select large Diamond Search.
969    */
970    
971            if ( (!MVzero(pmv[0])) || (threshB<1536) || (bPredEq) )
972                    iDiamondSize=1; // halfpel!
973            else
974                    iDiamondSize=2; // halfpel!
975    
976            if (!(MotionFlags & PMV_HALFPELDIAMOND16) )
977                    iDiamondSize*=2;
978    
979  /*  /*
980     Step 5: Calculate SAD for motion vectors taken from left block, top, top-right, and Previous frame block.     Step 5: Calculate SAD for motion vectors taken from left block, top, top-right, and Previous frame block.
981     Also calculate (0,0) but do not subtract offset.     Also calculate (0,0) but do not subtract offset.
# Line 1019  Line 985 
985    
986  // (0,0) is always possible  // (0,0) is always possible
987    
988            if (!MVzero(pmv[0]))
989          CHECK_MV16_ZERO;          CHECK_MV16_ZERO;
990    
991  // previous frame MV is always possible  // previous frame MV is always possible
992    
993            if (!MVzero(prevMB->mvs[0]))
994            if (!MVequal(prevMB->mvs[0],pmv[0]))
995          CHECK_MV16_CANDIDATE(prevMB->mvs[0].x,prevMB->mvs[0].y);          CHECK_MV16_CANDIDATE(prevMB->mvs[0].x,prevMB->mvs[0].y);
996    
997  // left neighbour, if allowed  // left neighbour, if allowed
998          if (x != 0)  
999            if (!MVzero(pmv[1]))
1000            if (!MVequal(pmv[1],prevMB->mvs[0]))
1001            if (!MVequal(pmv[1],pmv[0]))
1002          {          {
1003                  if (!(MotionFlags & PMV_HALFPEL16 ))                  if (!(MotionFlags & PMV_HALFPEL16 ))
1004                  {       pmv[1].x = EVEN(pmv[1].x);                  {       pmv[1].x = EVEN(pmv[1].x);
1005                  pmv[1].y = EVEN(pmv[1].y);                  pmv[1].y = EVEN(pmv[1].y);
1006                  }                  }
1007    
1008                  CHECK_MV16_CANDIDATE(pmv[1].x,pmv[1].y);                  CHECK_MV16_CANDIDATE(pmv[1].x,pmv[1].y);
1009          }          }
1010    
1011  // top neighbour, if allowed  // top neighbour, if allowed
1012          if (y != 0)          if (!MVzero(pmv[2]))
1013            if (!MVequal(pmv[2],prevMB->mvs[0]))
1014            if (!MVequal(pmv[2],pmv[0]))
1015            if (!MVequal(pmv[2],pmv[1]))
1016          {          {
1017                  if (!(MotionFlags & PMV_HALFPEL16 ))                  if (!(MotionFlags & PMV_HALFPEL16 ))
1018                  {       pmv[2].x = EVEN(pmv[2].x);                  {       pmv[2].x = EVEN(pmv[2].x);
# Line 1044  Line 1021 
1021                  CHECK_MV16_CANDIDATE(pmv[2].x,pmv[2].y);                  CHECK_MV16_CANDIDATE(pmv[2].x,pmv[2].y);
1022    
1023  // top right neighbour, if allowed  // top right neighbour, if allowed
1024                  if ((uint32_t)x != (iWcount-1))                  if (!MVzero(pmv[3]))
1025                    if (!MVequal(pmv[3],prevMB->mvs[0]))
1026                    if (!MVequal(pmv[3],pmv[0]))
1027                    if (!MVequal(pmv[3],pmv[1]))
1028                    if (!MVequal(pmv[3],pmv[2]))
1029                  {                  {
1030                          if (!(MotionFlags & PMV_HALFPEL16 ))                          if (!(MotionFlags & PMV_HALFPEL16 ))
1031                          {       pmv[3].x = EVEN(pmv[3].x);                          {       pmv[3].x = EVEN(pmv[3].x);
# Line 1276  Line 1257 
1257          int32_t psad[4];          int32_t psad[4];
1258          VECTOR newMV;          VECTOR newMV;
1259          VECTOR backupMV;          VECTOR backupMV;
1260            VECTOR startMV;
1261    
1262          const MACROBLOCK * const pMB = pMBs + (x>>1) + (y>>1) * iWcount;          const MACROBLOCK * const pMB = pMBs + (x>>1) + (y>>1) * iWcount;
1263          const MACROBLOCK * const prevMB = prevMBs + (x>>1) + (y>>1) * iWcount;          const MACROBLOCK * const prevMB = prevMBs + (x>>1) + (y>>1) * iWcount;
# Line 1284  Line 1266 
1266          int32_t iFound,bPredEq;          int32_t iFound,bPredEq;
1267          int32_t iMinSAD,iSAD;          int32_t iMinSAD,iSAD;
1268    
1269          int32_t iSubBlock = ((y&1)<<1) + (x&1);          int32_t iSubBlock = (y&1)+(y&1) + (x&1);
1270    
1271            /* Init variables */
1272            startMV.x = start_x;
1273            startMV.y = start_y;
1274    
1275  /* Get maximum range */  /* Get maximum range */
1276          get_range(&min_dx, &max_dx, &min_dy, &max_dy,          get_range(&min_dx, &max_dx, &min_dy, &max_dy,
# Line 1317  Line 1303 
1303    
1304          iFound=0;          iFound=0;
1305    
 /* Step 2: Calculate Distance= |MedianMVX| + |MedianMVY| where MedianMV is the motion  
    vector of the median.  
    If PredEq=1 and MVpredicted = Previous Frame MV, set Found=2  
 */  
   
         if ((bPredEq) && (MVequal(pmv[0],prevMB->mvs[iSubBlock]) ) )  
                 iFound=2;  
   
 /* Step 3: If Distance>0 or thresb<1536 or PredEq=1 Select small Diamond Search.  
    Otherwise select large Diamond Search.  
 */  
   
         if ( (pmv[0].x != 0) || (pmv[0].y != 0) || (threshB<1536/4) || (bPredEq) )  
                 iDiamondSize=1; // 1 halfpel!  
         else  
                 iDiamondSize=2; // 2 halfpel = 1 full pixel!  
   
         if (!(MotionFlags & PMV_HALFPELDIAMOND8) )  
                 iDiamondSize*=2;  
   
1306  /* Step 4: Calculate SAD around the Median prediction.  /* Step 4: Calculate SAD around the Median prediction.
1307     MinSAD=SAD     MinSAD=SAD
1308     If Motion Vector equal to Previous frame motion vector     If Motion Vector equal to Previous frame motion vector
# Line 1347  Line 1313 
1313    
1314  // Prepare for main loop  // Prepare for main loop
1315    
1316          currMV->x=start_x;              /* start with mv16 */          *currMV = startMV;
         currMV->y=start_y;  
1317    
1318          iMinSAD = sad8( cur,          iMinSAD = sad8( cur,
1319                          get_ref_mv(pRef, pRefH, pRefV, pRefHV, x, y, 8, currMV, iEdgedWidth),                          get_ref_mv(pRef, pRefH, pRefV, pRefHV, x, y, 8, currMV, iEdgedWidth),
1320                          iEdgedWidth);                          iEdgedWidth);
1321          iMinSAD += calc_delta_8(currMV->x - pmv[0].x, currMV->y - pmv[0].y, (uint8_t)iFcode, iQuant);          iMinSAD += calc_delta_8(currMV->x - pmv[0].x, currMV->y - pmv[0].y, (uint8_t)iFcode, iQuant);
1322    
1323          if ( (iMinSAD < 256/4 ) || ( (MVequal(*currMV,prevMB->mvs[iSubBlock])) && ((uint32_t)iMinSAD < prevMB->sad8[iSubBlock]) ) )          if ( (iMinSAD < 256/4 ) || ( (MVequal(*currMV,prevMB->mvs[iSubBlock]))
1324                                    && ((uint32_t)iMinSAD < prevMB->sad8[iSubBlock]) ) )
1325          {          {
1326                  if (MotionFlags & PMV_QUICKSTOP16)                  if (MotionFlags & PMV_QUICKSTOP16)
1327                          goto PMVfast8_Terminate_without_Refine;                          goto PMVfast8_Terminate_without_Refine;
# Line 1363  Line 1329 
1329                          goto PMVfast8_Terminate_with_Refine;                          goto PMVfast8_Terminate_with_Refine;
1330          }          }
1331    
1332    /* Step 2 (lazy eval): Calculate Distance= |MedianMVX| + |MedianMVY| where MedianMV is the motion
1333       vector of the median.
1334       If PredEq=1 and MVpredicted = Previous Frame MV, set Found=2
1335    */
1336    
1337            if ((bPredEq) && (MVequal(pmv[0],prevMB->mvs[iSubBlock]) ) )
1338                    iFound=2;
1339    
1340    /* Step 3 (lazy eval): If Distance>0 or thresb<1536 or PredEq=1 Select small Diamond Search.
1341       Otherwise select large Diamond Search.
1342    */
1343    
1344            if ( (!MVzero(pmv[0])) || (threshB<1536/4) || (bPredEq) )
1345                    iDiamondSize=1; // 1 halfpel!
1346            else
1347                    iDiamondSize=2; // 2 halfpel = 1 full pixel!
1348    
1349            if (!(MotionFlags & PMV_HALFPELDIAMOND8) )
1350                    iDiamondSize*=2;
1351    
1352    
1353  /*  /*
1354     Step 5: Calculate SAD for motion vectors taken from left block, top, top-right, and Previous frame block.     Step 5: Calculate SAD for motion vectors taken from left block, top, top-right, and Previous frame block.
# Line 1371  Line 1357 
1357     If MV is (0,0) subtract offset.     If MV is (0,0) subtract offset.
1358  */  */
1359    
1360  // the prediction might be even better than mv16  // the median prediction might be even better than mv16
1361    
1362            if (!MVequal(pmv[0],startMV))
1363          CHECK_MV8_CANDIDATE(pmv[0].x,pmv[0].y);          CHECK_MV8_CANDIDATE(pmv[0].x,pmv[0].y);
1364    
1365  // (0,0) is always possible  // (0,0) if needed
1366            if (!MVzero(pmv[0]))
1367            if (!MVzero(startMV))
1368          CHECK_MV8_ZERO;          CHECK_MV8_ZERO;
1369    
1370  // previous frame MV is always possible  // previous frame MV if needed
1371            if (!MVzero(prevMB->mvs[iSubBlock]))
1372            if (!MVequal(prevMB->mvs[iSubBlock],startMV))
1373            if (!MVequal(prevMB->mvs[iSubBlock],pmv[0]))
1374          CHECK_MV8_CANDIDATE(prevMB->mvs[iSubBlock].x,prevMB->mvs[iSubBlock].y);          CHECK_MV8_CANDIDATE(prevMB->mvs[iSubBlock].x,prevMB->mvs[iSubBlock].y);
1375    
1376  // left neighbour, if allowed          if ( (iMinSAD <= threshA) || ( MVequal(*currMV,prevMB->mvs[iSubBlock]) && ((uint32_t)iMinSAD < prevMB->sad8[iSubBlock]) ) )
1377          if (psad[1] != MV_MAX_ERROR)          {
1378                    if (MotionFlags & PMV_QUICKSTOP16)
1379                            goto PMVfast8_Terminate_without_Refine;
1380                    if (MotionFlags & PMV_EARLYSTOP16)
1381                            goto PMVfast8_Terminate_with_Refine;
1382            }
1383    
1384    
1385    // left neighbour, if allowed and needed
1386            if (!MVzero(pmv[1]))
1387            if (!MVequal(pmv[1],startMV))
1388            if (!MVequal(pmv[1],prevMB->mvs[iSubBlock]))
1389            if (!MVequal(pmv[1],pmv[0]))
1390          {          {
1391                  if (!(MotionFlags & PMV_HALFPEL8 ))                  if (!(MotionFlags & PMV_HALFPEL8 ))
1392                  {       pmv[1].x = EVEN(pmv[1].x);                  {       pmv[1].x = EVEN(pmv[1].x);
# Line 1390  Line 1395 
1395                  CHECK_MV8_CANDIDATE(pmv[1].x,pmv[1].y);                  CHECK_MV8_CANDIDATE(pmv[1].x,pmv[1].y);
1396          }          }
1397    
1398  // top neighbour, if allowed  // top neighbour, if allowed and needed
1399          if (psad[2] != MV_MAX_ERROR)          if (!MVzero(pmv[2]))
1400            if (!MVequal(pmv[2],startMV))
1401            if (!MVequal(pmv[2],prevMB->mvs[iSubBlock]))
1402            if (!MVequal(pmv[2],pmv[0]))
1403            if (!MVequal(pmv[2],pmv[1]))
1404          {          {
1405                  if (!(MotionFlags & PMV_HALFPEL8 ))                  if (!(MotionFlags & PMV_HALFPEL8 ))
1406                  {       pmv[2].x = EVEN(pmv[2].x);                  {       pmv[2].x = EVEN(pmv[2].x);
# Line 1399  Line 1408 
1408                  }                  }
1409                  CHECK_MV8_CANDIDATE(pmv[2].x,pmv[2].y);                  CHECK_MV8_CANDIDATE(pmv[2].x,pmv[2].y);
1410    
1411  // top right neighbour, if allowed  // top right neighbour, if allowed and needed
1412                  if (psad[3] != MV_MAX_ERROR)          if (!MVzero(pmv[3]))
1413            if (!MVequal(pmv[3],startMV))
1414            if (!MVequal(pmv[3],prevMB->mvs[iSubBlock]))
1415            if (!MVequal(pmv[3],pmv[0]))
1416            if (!MVequal(pmv[3],pmv[1]))
1417            if (!MVequal(pmv[3],pmv[2]))
1418                  {                  {
1419                          if (!(MotionFlags & PMV_HALFPEL8 ))                          if (!(MotionFlags & PMV_HALFPEL8 ))
1420                          {       pmv[3].x = EVEN(pmv[3].x);                          {       pmv[3].x = EVEN(pmv[3].x);
# Line 2038  Line 2052 
2052  // TODO: need to incorporate prediction here (eg. sad += calc_delta_16)  // TODO: need to incorporate prediction here (eg. sad += calc_delta_16)
2053  ***************************************************************/  ***************************************************************/
2054    
2055  /*  
2056  void MotionEstimationBVOP(  void MotionEstimationBVOP(
2057                          MBParam * const pParam,                          MBParam * const pParam,
2058                          FRAMEINFO * const frame,                          FRAMEINFO * const frame,
# Line 2060  Line 2074 
2074      const uint32_t mb_height = pParam->mb_height;      const uint32_t mb_height = pParam->mb_height;
2075          const int32_t edged_width = pParam->edged_width;          const int32_t edged_width = pParam->edged_width;
2076    
2077          int32_t i,j;          uint32_t i,j;
2078    
2079          int32_t f_sad16;          int32_t f_sad16;
2080          int32_t b_sad16;          int32_t b_sad16;
# Line 2084  Line 2098 
2098                                  && b_mb->mvs[0].x == 0                                  && b_mb->mvs[0].x == 0
2099                                  && b_mb->mvs[0].y == 0)                                  && b_mb->mvs[0].y == 0)
2100                          {                          {
2101                                  mb->mode = MB_IGNORE;                                  mb->mode = MODE_NOT_CODED;
2102                                  mb->mvs[0].x = 0;                                  mb->mvs[0].x = 0;
2103                                  mb->mvs[0].y = 0;                                  mb->mvs[0].y = 0;
2104                                  mb->b_mvs[0].x = 0;                                  mb->b_mvs[0].x = 0;
# Line 2099  Line 2113 
2113                                                  i, j,                                                  i, j,
2114                                                  frame->motion_flags,  frame->quant, frame->fcode,                                                  frame->motion_flags,  frame->quant, frame->fcode,
2115                                                  pParam,                                                  pParam,
2116                                                  f_mbs,                                                  f_mbs, f_mbs /* todo */,
2117                                                  &mb->mvs[0], &pmv_dontcare);    // ignore pmv                                                  &mb->mvs[0], &pmv_dontcare);    // ignore pmv
2118    
2119                          // backward search                          // backward search
# Line 2108  Line 2122 
2122                                                  i, j,                                                  i, j,
2123                                                  frame->motion_flags,  frame->quant, frame->bcode,                                                  frame->motion_flags,  frame->quant, frame->bcode,
2124                                                  pParam,                                                  pParam,
2125                                                  b_mbs,                                                  b_mbs, b_mbs, /* todo */
2126                                                  &mb->b_mvs[0], &pmv_dontcare);  // ignore pmv                                                  &mb->b_mvs[0], &pmv_dontcare);  // ignore pmv
2127    
2128                          // interpolate search (simple, but effective)                          // interpolate search (simple, but effective)
# Line 2128  Line 2142 
2142                          if (f_sad16 < b_sad16)                          if (f_sad16 < b_sad16)
2143                          {                          {
2144                                  best_sad = f_sad16;                                  best_sad = f_sad16;
2145                                  mb->mode = MB_FORWARD;                                  mb->mode = MODE_FORWARD;
2146                          }                          }
2147                          else                          else
2148                          {                          {
2149                                  best_sad = b_sad16;                                  best_sad = b_sad16;
2150                                  mb->mode = MB_BACKWARD;                                  mb->mode = MODE_BACKWARD;
2151                          }                          }
2152    
2153                          if (i_sad16 < best_sad)                          if (i_sad16 < best_sad)
2154                          {                          {
2155                                  best_sad = i_sad16;                                  best_sad = i_sad16;
2156                                  mb->mode = MB_INTERPOLATE;                                  mb->mode = MODE_INTERPOLATE;
2157                          }                          }
2158    
2159                          if (d_sad16 < best_sad)                          if (d_sad16 < best_sad)
2160                          {                          {
2161                                  best_sad = d_sad16;                                  best_sad = d_sad16;
2162                                  mb->mode = MB_DIRECT;                                  mb->mode = MODE_DIRECT;
2163                          }                          }
2164    
2165                  }                  }
2166          }          }
2167  }  }
   
 */  

Legend:
Removed from v.141  
changed lines
  Added in v.170

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