[cvs] / xvidcore / src / motion / estimation_bvop.c Repository:
ViewVC logotype

Diff of /xvidcore/src/motion/estimation_bvop.c

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

revision 1.20, Thu Dec 9 04:58:12 2004 UTC revision 1.22, Fri Dec 17 11:57:59 2004 UTC
# Line 965  Line 965 
965  {  {
966          uint32_t i, j;          uint32_t i, j;
967          int32_t best_sad = 256*4096;          int32_t best_sad = 256*4096;
         int32_t sad2;  
968          uint32_t skip_sad;          uint32_t skip_sad;
969            int fb_thresh;
970          const MACROBLOCK * const b_mbs = b_reference->mbs;          const MACROBLOCK * const b_mbs = b_reference->mbs;
971    
972          VECTOR f_predMV, b_predMV;          VECTOR f_predMV, b_predMV;
# Line 1040  Line 1039 
1039                          SearchBF_initial(i, j, frame->motion_flags, frame->bcode, pParam, pMB,                          SearchBF_initial(i, j, frame->motion_flags, frame->bcode, pParam, pMB,
1040                                                  &b_predMV, &best_sad, MODE_BACKWARD, &Data_b, Data_d.currentMV[2]);                                                  &b_predMV, &best_sad, MODE_BACKWARD, &Data_b, Data_d.currentMV[2]);
1041    
1042                          sad2 = best_sad;                          if (frame->motion_flags&XVID_ME_BFRAME_EARLYSTOP)
1043                                    fb_thresh = best_sad;
1044                            else
1045                                    fb_thresh = best_sad + (best_sad>>1);
1046    
1047                          if (Data_f.iMinSAD[0] < 2*sad2+2000)                          if (Data_f.iMinSAD[0] <= fb_thresh)
1048                                  SearchBF_final(i, j, frame->motion_flags, pParam, &best_sad, &Data_f);                                  SearchBF_final(i, j, frame->motion_flags, pParam, &best_sad, &Data_f);
1049    
1050                          if (Data_b.iMinSAD[0] < 2*sad2+2000)                          if (Data_b.iMinSAD[0] <= fb_thresh)
1051                                  SearchBF_final(i, j, frame->motion_flags, pParam, &best_sad, &Data_b);                                  SearchBF_final(i, j, frame->motion_flags, pParam, &best_sad, &Data_b);
1052    
1053                          SearchInterpolate_initial(i, j, frame->motion_flags, pParam, &f_predMV, &b_predMV, &best_sad,                          SearchInterpolate_initial(i, j, frame->motion_flags, pParam, &f_predMV, &b_predMV, &best_sad,
1054                                                                    &Data_i, Data_f.currentMV[0], Data_b.currentMV[0]);                                                                    &Data_i, Data_f.currentMV[0], Data_b.currentMV[0]);
1055    
1056                          if (((Data_i.iMinSAD[0] < 2*best_sad+2000) && !(frame->motion_flags&XVID_ME_FAST_MODEINTERPOLATE))                          if (((Data_i.iMinSAD[0] < best_sad +(best_sad>>3)) && !(frame->motion_flags&XVID_ME_FAST_MODEINTERPOLATE))
1057                                  || Data_i.iMinSAD[0] <= best_sad)                                  || Data_i.iMinSAD[0] <= best_sad)
1058    
1059                                  SearchInterpolate_final(i, j, frame->motion_flags, pParam, &best_sad, &Data_i);                                  SearchInterpolate_final(i, j, frame->motion_flags, pParam, &best_sad, &Data_i);
1060    
1061                          if ((Data_d.iMinSAD[0] <= 2*best_sad) && (!frame->motion_flags&XVID_ME_SKIP_DELTASEARCH))                          if (Data_d.iMinSAD[0] <= 2*best_sad)
1062                                    if ((!(frame->motion_flags&XVID_ME_SKIP_DELTASEARCH) && (best_sad > 750))
1063                                            || (best_sad > 1000))
1064    
1065                                  SearchDirect_final(frame->motion_flags, b_mb, &best_sad, &Data_d);                                  SearchDirect_final(frame->motion_flags, b_mb, &best_sad, &Data_d);
1066    
1067                          /* final skip decision */                          /* final skip decision */
# Line 1076  Line 1081 
1081    
1082                          if (frame->vop_flags & XVID_VOP_RD_BVOP)                          if (frame->vop_flags & XVID_VOP_RD_BVOP)
1083                                  ModeDecision_BVOP_RD(&Data_d, &Data_b, &Data_f, &Data_i,                                  ModeDecision_BVOP_RD(&Data_d, &Data_b, &Data_f, &Data_i,
1084                                          pMB, b_mb, &f_predMV, &b_predMV, frame->motion_flags, pParam, i, j);                                          pMB, b_mb, &f_predMV, &b_predMV, frame->motion_flags, pParam, i, j, best_sad);
1085                          else                          else
1086                                  ModeDecision_BVOP_SAD(&Data_d, &Data_b, &Data_f, &Data_i, pMB, b_mb, &f_predMV, &b_predMV);                                  ModeDecision_BVOP_SAD(&Data_d, &Data_b, &Data_f, &Data_i, pMB, b_mb, &f_predMV, &b_predMV);
1087    

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.22

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