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

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

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

revision 1682, Fri Feb 24 08:46:22 2006 UTC revision 1701, Wed Apr 19 15:42:19 2006 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_pvop.c,v 1.19 2006-02-24 08:46:22 syskin Exp $   * $Id: estimation_pvop.c,v 1.22 2006-04-19 15:42:19 syskin Exp $
25   *   *
26   ****************************************************************************/   ****************************************************************************/
27    
# Line 296  Line 296 
296    
297          /* final skip decision, a.k.a. "the vector you found, really that good?" */          /* final skip decision, a.k.a. "the vector you found, really that good?" */
298          if (skip_possible && (skip_sad < (int)iQuant * MAX_SAD00_FOR_SKIP))          if (skip_possible && (skip_sad < (int)iQuant * MAX_SAD00_FOR_SKIP))
299                  if ( (100*skip_sad)/(pMB->sad16+1) > FINAL_SKIP_THRESH)                  if ( (100*skip_sad)/(pMB->sad16+1) < FINAL_SKIP_THRESH)
300                          if (Data->chroma || xvid_me_SkipDecisionP(pCurrent, pRef, x, y, Data->iEdgedWidth/2, iQuant)) {                          if (Data->chroma || xvid_me_SkipDecisionP(pCurrent, pRef, x, y, Data->iEdgedWidth/2, iQuant)) {
301                                  mode = MODE_NOT_CODED;                                  mode = MODE_NOT_CODED;
302                                  sad = 0;                                  sad = 0;
# Line 1016  Line 1016 
1016                  (current->vop_flags & XVID_VOP_MODEDECISION_RD ? 2:1);                  (current->vop_flags & XVID_VOP_MODEDECISION_RD ? 2:1);
1017          int block = start_y*mb_width;          int block = start_y*mb_width;
1018          int * complete_count_self = h->complete_count_self;          int * complete_count_self = h->complete_count_self;
1019          const int * complete_count_above = h->complete_count_above;          const volatile int * complete_count_above = h->complete_count_above;
1020          int max_mbs;          int max_mbs;
1021          int current_mb = 0;          int current_mb = 0;
1022    
# Line 1047  Line 1047 
1047                          MACROBLOCK *pMB, *prevMB;                          MACROBLOCK *pMB, *prevMB;
1048                          int skip;                          int skip;
1049    
                         pMB = &pMBs[block];  
                         prevMB = &reference->mbs[block];  
   
                         pMB->sad16 =  
                                 sad16v(pCurrent->y + (x + y * iEdgedWidth) * 16,  
                                                         pRef->y + (x + y * iEdgedWidth) * 16,  
                                                         pParam->edged_width, pMB->sad8);  
   
                         sad00 = 4*MAX(MAX(pMB->sad8[0], pMB->sad8[1]), MAX(pMB->sad8[2], pMB->sad8[3]));  
   
                         if (Data.chroma) {  
                                 Data.chromaSAD = sad8(pCurrent->u + x*8 + y*(iEdgedWidth/2)*8,  
                                                                         pRef->u + x*8 + y*(iEdgedWidth/2)*8, iEdgedWidth/2)  
                                                                 + sad8(pCurrent->v + (x + y*(iEdgedWidth/2))*8,  
                                                                         pRef->v + (x + y*(iEdgedWidth/2))*8, iEdgedWidth/2);  
                                 pMB->sad16 += Data.chromaSAD;  
                                 sad00 += Data.chromaSAD;  
                         }  
   
1050                          if (current_mb >= max_mbs) {                          if (current_mb >= max_mbs) {
1051                                  /* we ME-ed all macroblocks we safely could. grab next portion */                                  /* we ME-ed all macroblocks we safely could. grab next portion */
1052                                  int above_count = *complete_count_above; /* sync point */                                  int above_count = *complete_count_above; /* sync point */
# Line 1088  Line 1069 
1069                                  }                                  }
1070                          }                          }
1071    
                         skip = InitialSkipDecisionP(sad00, pParam, current, pMB, prevMB, x, y, &Data, pGMC,  
                                                                                 pCurrent, pRef, MotionFlags);  
                         if (current_mb >= max_mbs) {  
                                 /* we ME-ed all macroblocks we safely could. grab next portion */  
                                 int above_count = *complete_count_above; /* sync point */  
                                 if (above_count == mb_width) {  
                                         /* full line above is ready */  
                                         above_count = mb_width+1;  
                                         if (y < mb_height-y_step) {  
                                                 /* this is not last line, grab a portion of MBs from the next line too */  
                                                 above_count += MAX(0, complete_count_above[1] - 1);  
                                         }  
                                 }  
1072    
1073                                  max_mbs = current_mb + above_count - x - 1;                          pMB = &pMBs[block];
1074                            prevMB = &reference->mbs[block];
1075    
1076                                  if (current_mb >= max_mbs) {                          pMB->sad16 =
1077                                          /* current workload is zero */                                  sad16v(pCurrent->y + (x + y * iEdgedWidth) * 16,
1078                                          x--;                                                          pRef->y + (x + y * iEdgedWidth) * 16,
1079                                          sched_yield();                                                          pParam->edged_width, pMB->sad8);
1080                                          continue;  
1081                                  }                          sad00 = 4*MAX(MAX(pMB->sad8[0], pMB->sad8[1]), MAX(pMB->sad8[2], pMB->sad8[3]));
1082    
1083                            if (Data.chroma) {
1084                                    Data.chromaSAD = sad8(pCurrent->u + x*8 + y*(iEdgedWidth/2)*8,
1085                                                                            pRef->u + x*8 + y*(iEdgedWidth/2)*8, iEdgedWidth/2)
1086                                                                    + sad8(pCurrent->v + (x + y*(iEdgedWidth/2))*8,
1087                                                                            pRef->v + (x + y*(iEdgedWidth/2))*8, iEdgedWidth/2);
1088                                    pMB->sad16 += Data.chromaSAD;
1089                                    sad00 += Data.chromaSAD;
1090                          }                          }
1091    
1092                            skip = InitialSkipDecisionP(sad00, pParam, current, pMB, prevMB, x, y, &Data, pGMC,
1093                                                                                    pCurrent, pRef, MotionFlags);
1094    
1095                          if (skip) {                          if (skip) {
1096                                  current_mb++;                                  current_mb++;
1097                                  block++;                                  block++;
# Line 1150  Line 1130 
1130                  complete_count_above++;                  complete_count_above++;
1131          }          }
1132    
1133            h->minfcode = getMinFcode(MVmax);
1134    
1135          h->MVmax = MVmax;          h->MVmax = MVmax;
1136          h->mvSum = mvSum;          h->mvSum = mvSum;
1137          h->mvCount = mvCount;          h->mvCount = mvCount;

Legend:
Removed from v.1682  
changed lines
  Added in v.1701

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