[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 1238, Wed Dec 3 19:46:50 2003 UTC revision 1273, Thu Dec 18 02:02:08 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.7 2003-12-03 19:46:50 edgomez Exp $   * $Id: estimation_bvop.c,v 1.1.2.8 2003-12-18 02:02:08 Isibaar Exp $
25   *   *
26   ****************************************************************************/   ****************************************************************************/
27    
# Line 298  Line 298 
298          }          }
299  }  }
300    
301    void
302    CheckCandidate16no4v_qpel(const int x, const int y, SearchData * const data, const unsigned int Direction)
303    {
304            int32_t sad, xc, yc;
305            const uint8_t * Reference;
306            uint32_t t;
307    
308            if ( (x > data->max_dx) || ( x < data->min_dx)
309                    || (y > data->max_dy) || (y < data->min_dy) ) return;
310    
311            if (data->rrv && (!(x&1) && x !=0) | (!(y&1) && y !=0) ) return; /* non-zero even value */
312    
313            Reference = xvid_me_interpolate16x16qpel(x, y, 0, data);
314    
315            xc = x/2; yc = y/2;
316            t = d_mv_bits(x, y, data->predMV, data->iFcode,
317                                            data->qpel^data->qpel_precision, data->rrv);
318    
319            sad = sad16(data->Cur, Reference, data->iEdgedWidth, 256*4096);
320            sad += (data->lambda16 * t * sad)>>10;
321    
322            if (data->chroma && sad < *data->iMinSAD)
323                    sad += xvid_me_ChromaSAD((xc >> 1) + roundtab_79[xc & 0x3],
324                                                                    (yc >> 1) + roundtab_79[yc & 0x3], data);
325    
326            if (sad < *(data->iMinSAD)) {
327                    data->iMinSAD2 = *(data->iMinSAD);
328                    data->currentQMV2.x = data->currentQMV->x;
329                    data->currentQMV2.y = data->currentQMV->y;
330    
331                    data->iMinSAD[0] = sad;
332                    data->currentQMV[0].x = x; data->currentQMV[0].y = y;
333            } else if (sad < data->iMinSAD2) {
334                    data->iMinSAD2 = sad;
335                    data->currentQMV2.x = x; data->currentQMV2.y = y;
336            }
337    }
338    
339  static __inline VECTOR  static __inline VECTOR
340  ChoosePred(const MACROBLOCK * const pMB, const uint32_t mode)  ChoosePred(const MACROBLOCK * const pMB, const uint32_t mode)
341  {  {
# Line 409  Line 447 
447                  Data->qpel_precision = 1;                  Data->qpel_precision = 1;
448                  get_range(&Data->min_dx, &Data->max_dx, &Data->min_dy, &Data->max_dy, x, y, 4,                  get_range(&Data->min_dx, &Data->max_dx, &Data->min_dy, &Data->max_dy, x, y, 4,
449                                          pParam->width, pParam->height, iFcode, 2, 0);                                          pParam->width, pParam->height, iFcode, 2, 0);
450    
451                    if (MotionFlags & XVID_ME_QUARTERPELREFINE16) {
452                            if(MotionFlags & XVID_ME_FASTREFINE16)
453                                    SubpelRefine_Fast(Data, CheckCandidate16no4v_qpel);
454                            else
455                  xvid_me_SubpelRefine(Data, CheckCandidate16no4v);                  xvid_me_SubpelRefine(Data, CheckCandidate16no4v);
456          }          }
457            }
458    
459          /* three bits are needed to code backward mode. four for forward */          /* three bits are needed to code backward mode. four for forward */
460    
# Line 575  Line 619 
619          *Data->iMinSAD += Data->lambda16;          *Data->iMinSAD += Data->lambda16;
620          skip_sad = *Data->iMinSAD;          skip_sad = *Data->iMinSAD;
621    
622            if (!(MotionFlags & XVID_ME_SKIP_DELTASEARCH)) {
623          if (MotionFlags & XVID_ME_USESQUARES16) MainSearchPtr = xvid_me_SquareSearch;          if (MotionFlags & XVID_ME_USESQUARES16) MainSearchPtr = xvid_me_SquareSearch;
624                  else if (MotionFlags & XVID_ME_ADVANCEDDIAMOND16) MainSearchPtr = xvid_me_AdvDiamondSearch;                  else if (MotionFlags & XVID_ME_ADVANCEDDIAMOND16) MainSearchPtr = xvid_me_AdvDiamondSearch;
625                          else MainSearchPtr = xvid_me_DiamondSearch;                          else MainSearchPtr = xvid_me_DiamondSearch;
# Line 582  Line 627 
627          MainSearchPtr(0, 0, Data, 255, CheckCandidate);          MainSearchPtr(0, 0, Data, 255, CheckCandidate);
628    
629          xvid_me_SubpelRefine(Data, CheckCandidate);          xvid_me_SubpelRefine(Data, CheckCandidate);
630            }
631    
632          *best_sad = *Data->iMinSAD;          *best_sad = *Data->iMinSAD;
633    

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

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