[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 174, Sat May 11 23:54:30 2002 UTC revision 175, Sun May 12 17:21:30 2002 UTC
# Line 54  Line 54 
54  #define MV16_THRESHOLD  192  #define MV16_THRESHOLD  192
55  #define MV8_THRESHOLD   56  #define MV8_THRESHOLD   56
56    
57  #define NEIGH_MOVE_THRESH 8  #define NEIGH_MOVE_THRESH 0
58  // how much a block's MV must differ from his neighbour  // how much a block's MV must differ from his neighbour
59  // to be search for INTER4V. The more, the faster...  // to be search for INTER4V. The more, the faster...
60    
# Line 299  Line 299 
299                          pMB->sad16 = SEARCH16(pRef->y, pRefH->y, pRefV->y, pRefHV->y, pCurrent,                          pMB->sad16 = SEARCH16(pRef->y, pRefH->y, pRefV->y, pRefHV->y, pCurrent,
300                                           x, y, current->motion_flags, current->quant, current->fcode,                                           x, y, current->motion_flags, current->quant, current->fcode,
301                                           pParam, pMBs, prevMBs, &pMB->mv16, &pMB->pmvs[0]);                                           pParam, pMBs, prevMBs, &pMB->mv16, &pMB->pmvs[0]);
                 }  
302    
         for (y = 0; y < iHcount; y++)  
                 for (x = 0; x < iWcount; x++)  
                 {  
                         MACROBLOCK* const pMB = &pMBs[x + y * iWcount];  
303    
304                          if (0 < (pMB->sad16 - MV16_INTER_BIAS))                          if (0 < (pMB->sad16 - MV16_INTER_BIAS))
305                          {                          {
# Line 327  Line 322 
322                                          continue;                                          continue;
323                                  }                                  }
324                          }                          }
325                            pMB->mode = MODE_INTER;
326                            pMB->mvs[0] = pMB->mvs[1] = pMB->mvs[2] = pMB->mvs[3] = pMB->mv16;
327               pMB->sad8[0] = pMB->sad8[1] = pMB->sad8[2] = pMB->sad8[3] = pMB->sad16;
328                    }
329    
330            // we try to do as few INTER4V-searches as possible. So we split ME in two parts, normal
331            // SEARCH16 and only for special blocks SEARCH8. May this should be modified for quality
332            // levels.
333    
334    
335    
336            if (current->global_flags & XVID_INTER4V)
337                    for (y = 0; y < iHcount; y++)
338                            for (x = 0; x < iWcount; x++)
339                            {
340                                    MACROBLOCK* const pMB = &pMBs[x + y * iWcount];
341    
342                          if ( (current->global_flags & XVID_INTER4V)                                  if (pMB->mode == MODE_INTRA)
343                                  && (!(current->global_flags & XVID_LUMIMASKING)                                          continue;
344                                          || pMB->dquant == NO_CHANGE) )  
345    
346                                    if ( (!(current->global_flags & XVID_LUMIMASKING) || pMB->dquant == NO_CHANGE) )
347                          {                          {
348                                  int32_t neigh=0;                                  int32_t neigh=0;
349    
# Line 353  Line 366 
366    
367                                  if (neigh > NEIGH_MOVE_THRESH)                                  if (neigh > NEIGH_MOVE_THRESH)
368                                  {                                  {
369                                          int32_t sad8 = 129; //IMV16X16 * current->quant;                                          int32_t sad8 = IMV16X16 * current->quant;
370    
371                                  if (sad8 < pMB->sad16)                                  if (sad8 < pMB->sad16)
372                                  sad8 += pMB->sad8[0]                                  sad8 += pMB->sad8[0]
# Line 396  Line 409 
409                                          pMB->sad8[3] *= 4;                                          pMB->sad8[3] *= 4;
410                                          continue;                                          continue;
411                                  }                                  }
412    
413                                            pMB->mvs[0] = pMB->mvs[1] = pMB->mvs[2] = pMB->mvs[3] = pMB->mv16;
414                                  }                                  }
415    
416                          }                          }
417    
418                          pMB->mode = MODE_INTER;                  // get_pmv has to be called again, because inter4v changes predictors
                         pMB->mvs[0] = pMB->mvs[1] = pMB->mvs[2] = pMB->mvs[3] = pMB->mv16;  
          pMB->sad8[0] = pMB->sad8[1] = pMB->sad8[2] = pMB->sad8[3] = pMB->sad16;  
419    
420                          pmv = get_pmv(pMBs, x, y, pParam->mb_width, 0);                          pmv = get_pmv(pMBs, x, y, pParam->mb_width, 0);
421                          // get_pmv has to be called again.                          pMB->pmvs[0].x = pMB->mv16.x - pmv.x;   /* the other pmvs are only needed in INTER4V-mode */
                         // intra-decision and inter4v change predictors  
   
                                 pMB->pmvs[0].x = pMB->mv16.x - pmv.x;  
422                                  pMB->pmvs[0].y = pMB->mv16.y - pmv.y;                                  pMB->pmvs[0].y = pMB->mv16.y - pmv.y;
423    
424                  }                  }
425    
426          return 0;          return 0;

Legend:
Removed from v.174  
changed lines
  Added in v.175

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