[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 347, Sun Jul 28 13:06:46 2002 UTC revision 370, Mon Aug 12 10:07:16 2002 UTC
# Line 186  Line 186 
186    
187                          MACROBLOCK *const pMB = &pMBs[x + y * iWcount];                          MACROBLOCK *const pMB = &pMBs[x + y * iWcount];
188    
189                            if (pMB->mode == MODE_NOT_CODED)
190                                    continue;
191    
192                          predMV = get_pmv2(pMBs, pParam->mb_width, 0, x, y, 0);                          predMV = get_pmv2(pMBs, pParam->mb_width, 0, x, y, 0);
193    
194                          pMB->sad16 =                          pMB->sad16 =
# Line 2888  Line 2891 
2891                  *currMV = pmv[0] = pmv[1] = pmv[2] = pmv[3] = zeroMV;                  *currMV = pmv[0] = pmv[1] = pmv[2] = pmv[3] = zeroMV;
2892    
2893          } else {          } else {
2894    
2895                    bPredEq = get_ipmvdata(pMBs, iWcount, 0, x, y, 0, pmv, psad);
2896    
2897                  threshA = psad[0];                  threshA = psad[0];
2898                  threshB = threshA + 256;                  threshB = threshA + 256;
2899                  if (threshA < 512)                  if (threshA < 512)
# Line 2897  Line 2903 
2903                  if (threshB > 1792)                  if (threshB > 1792)
2904                          threshB = 1792;                          threshB = 1792;
2905    
                 bPredEq = get_ipmvdata(pMBs, iWcount, 0, x, y, 0, pmv, psad);  
2906                  *currMV = pmv[0];                       /* current best := prediction */                  *currMV = pmv[0];                       /* current best := prediction */
2907          }          }
2908    
# Line 3209  Line 3214 
3214                                              : mb->mvs[k].y - mb->directmv[k].y);                                              : mb->mvs[k].y - mb->directmv[k].y);
3215    
3216                                          d_sad16 +=                                          d_sad16 +=
3217                                                  sad8bi(frame->image.y + 2*(i+(k&1))*8 + 2*(j+(k>>1))*8*edged_width,                                                  sad8bi(frame->image.y + (2*i+(k&1))*8 + (2*j+(k>>1))*8*edged_width,
3218                                                    get_ref_mv(f_ref->y, f_refH->y, f_refV->y, f_refHV->y,                                                    get_ref_mv(f_ref->y, f_refH->y, f_refV->y, f_refHV->y,
3219                                                                  2*(i+(k&1)), 2*(j+(k>>1)), 8, &mb->mvs[k], edged_width),                                                                  (2*i+(k&1)), (2*j+(k>>1)), 8, &mb->mvs[k], edged_width),
3220                                                    get_ref_mv(b_ref->y, b_refH->y, b_refV->y, b_refHV->y,                                                    get_ref_mv(b_ref->y, b_refH->y, b_refV->y, b_refHV->y,
3221                                                                  2*(i+(k&1)), 2*(j+(k>>1)), 8, &mb->b_mvs[k], edged_width),                                                                  (2*i+(k&1)), (2*j+(k>>1)), 8, &mb->b_mvs[k], edged_width),
3222                                                    edged_width);                                                    edged_width);
3223                                  }                                  }
3224                          }                          }
# Line 3297  Line 3302 
3302                                                  f_predMV.x, f_predMV.y, b_predMV.x, b_predMV.y,                                                  f_predMV.x, f_predMV.y, b_predMV.x, b_predMV.y,
3303                                                  f_min_dx, f_max_dx, f_min_dy, f_max_dy,                                                  f_min_dx, f_max_dx, f_min_dy, f_max_dy,
3304                                                  b_min_dx, b_max_dx, b_min_dy, b_max_dy,                                                  b_min_dx, b_max_dx, b_min_dy, b_max_dy,
3305                                                  edged_width,  1,                                                  edged_width,  2,
3306                                                  frame->fcode, frame->bcode,frame->quant,0);                                                  frame->fcode, frame->bcode,frame->quant,0);
3307    
3308                            i_sad16 = Diamond16_InterpolMainSearch(
3309                                                    f_ref->y, f_refH->y, f_refV->y, f_refHV->y,
3310                                                    frame->image.y + i * 16 + j * 16 * edged_width,
3311                                                    b_ref->y, b_refH->y, b_refV->y, b_refHV->y,
3312                                                    i, j,
3313                                                    f_interpolMV.x, f_interpolMV.y,
3314                                                    b_interpolMV.x, b_interpolMV.y,
3315                                                    i_sad16,
3316                                                    &f_interpolMV, &b_interpolMV,
3317                                                    f_predMV.x, f_predMV.y, b_predMV.x, b_predMV.y,
3318                                                    f_min_dx, f_max_dx, f_min_dy, f_max_dy,
3319                                                    b_min_dx, b_max_dx, b_min_dy, b_max_dy,
3320                                                    edged_width,  1,
3321                                                    frame->fcode, frame->bcode,frame->quant,0);             // equiv to halfpel refine
3322    
3323    
3324  /*  DIRECT MODE DELTA VECTOR SEARCH.  /*  DIRECT MODE DELTA VECTOR SEARCH.
3325      This has to be made more effective, but at the moment I'm happy it's running at all */      This has to be made more effective, but at the moment I'm happy it's running at all */
3326    
3327  /* range is taken without fcode restriction, just a hack instead of writing down the dimensions, of course */  /* There are two range restrictions for direct mode: deltaMV is limited to [-32,31] in halfpel units, and
3328       absolute vector must not lie outside of image dimensions. Constraint one is dealt with by CHECK_MV16_DIRECT
3329       and for constraint two we need distance to boundary. This is done by get_range very large fcode (hack!) */
3330    
3331                          get_range(&min_dx, &max_dx, &min_dy, &max_dy, i, j, 16, iWidth, iHeight, 19);                          get_range(&min_dx, &max_dx, &min_dy, &max_dy, i, j, 16, iWidth, iHeight, 19);
3332    
# Line 3317  Line 3339 
3339                                                  0,0,                                                  0,0,
3340                                                  d_sad16,                                                  d_sad16,
3341                                                  &mb->deltamv,                                                  &mb->deltamv,
3342                                                  mb->directmv, // this has to be pre-initialized with b_mb->mvs[}                                                  mb->directmv, // this has to be pre-initialized with b_mb->mvs[]
3343                                            min_dx, max_dx, min_dy, max_dy,
3344                                                    edged_width, 2, frame->quant, 0);
3345    
3346                            d_sad16 = Diamond16_DirectMainSearch(
3347                                                    f_ref->y, f_refH->y, f_refV->y, f_refHV->y,
3348                                                    frame->image.y + i*16 + j*16*edged_width,
3349                                                    b_ref->y, b_refH->y, b_refV->y, b_refHV->y,
3350                                                    i, j,
3351                                                    TRB,TRD,
3352                                                    mb->deltamv.x, mb->deltamv.y,
3353                                                    d_sad16,
3354                                                    &mb->deltamv,
3355                                                    mb->directmv, // this has to be pre-initialized with b_mb->mvs[]
3356                                          min_dx, max_dx, min_dy, max_dy,                                          min_dx, max_dx, min_dy, max_dy,
3357                                                  edged_width, 1, frame->quant, 0);                                                  edged_width, 1, frame->quant, 0);               // equiv to halfpel refine
3358    
3359    
3360  //                      i_sad16 = 65535;                /* remove the comment to disable any of the MODEs */  //                      i_sad16 = 65535;                /* remove the comment to disable any of the MODEs */

Legend:
Removed from v.347  
changed lines
  Added in v.370

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