[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 1442, Tue Apr 20 19:47:00 2004 UTC revision 1443, Thu Apr 22 13:39:33 2004 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.4 2004-04-20 06:10:40 syskin Exp $   * $Id: estimation_pvop.c,v 1.5 2004-04-22 13:39:33 syskin Exp $
25   *   *
26   ****************************************************************************/   ****************************************************************************/
27    
# Line 312  Line 312 
312                                  const IMAGE * const pCurrent,                                  const IMAGE * const pCurrent,
313                                  const IMAGE * const pRef,                                  const IMAGE * const pRef,
314                                  const IMAGE * const vGMC,                                  const IMAGE * const vGMC,
315                                  const int coding_type)                                  const int coding_type,
316                                    const int skip_sad)
317  {  {
318          int mode = MODE_INTER;          int mode = MODE_INTER;
319          int mcsel = 0;          int mcsel = 0;
# Line 338  Line 339 
339          }          }
340    
341          /* 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?" */
342          if (skip_possible && (pMB->sad16 < (int)iQuant * MAX_SAD00_FOR_SKIP))          if (skip_possible && (skip_sad < (int)iQuant * MAX_SAD00_FOR_SKIP))
343                  if ( (100*sad)/(pMB->sad16+1) > FINAL_SKIP_THRESH)                  if ( (100*skip_sad)/(pMB->sad16+1) > FINAL_SKIP_THRESH)
344                          if (Data->chroma || xvid_me_SkipDecisionP(pCurrent, pRef, x, y, Data->iEdgedWidth/2, iQuant, Data->rrv)) {                          if (Data->chroma || xvid_me_SkipDecisionP(pCurrent, pRef, x, y, Data->iEdgedWidth/2, iQuant, Data->rrv)) {
345                                  mode = MODE_NOT_CODED;                                  mode = MODE_NOT_CODED;
346                                  sad = 0;                                  sad = 0;
# Line 897  Line 898 
898                                                          pRef->y + (x + y * iEdgedWidth) * 32,                                                          pRef->y + (x + y * iEdgedWidth) * 32,
899                                                          pParam->edged_width, pMB->sad8 );                                                          pParam->edged_width, pMB->sad8 );
900    
901                            sad00 = 4*MAX(MAX(pMB->sad8[0], pMB->sad8[1]), MAX(pMB->sad8[2], pMB->sad8[3]));
902    
903                          if (Data.chroma) {                          if (Data.chroma) {
904                                  Data.chromaSAD = sad8(pCurrent->u + x*8 + y*(iEdgedWidth/2)*8,                                  Data.chromaSAD = sad8(pCurrent->u + x*8 + y*(iEdgedWidth/2)*8,
905                                                                          pRef->u + x*8 + y*(iEdgedWidth/2)*8, iEdgedWidth/2)                                                                          pRef->u + x*8 + y*(iEdgedWidth/2)*8, iEdgedWidth/2)
906                                                                  + sad8(pCurrent->v + (x + y*(iEdgedWidth/2))*8,                                                                  + sad8(pCurrent->v + (x + y*(iEdgedWidth/2))*8,
907                                                                          pRef->v + (x + y*(iEdgedWidth/2))*8, iEdgedWidth/2);                                                                          pRef->v + (x + y*(iEdgedWidth/2))*8, iEdgedWidth/2);
908                                  pMB->sad16 += Data.chromaSAD;                                  pMB->sad16 += Data.chromaSAD;
909                                    sad00 += Data.chromaSAD;
910                          }                          }
911    
912                          sad00 = pMB->sad16;                          sad00 = 4*MAX(MAX(pMB->sad8[0], pMB->sad8[1]), MAX(pMB->sad8[2], pMB->sad8[3]));
913    
914                          /* initial skip decision */                          /* initial skip decision */
915                          /* no early skip for GMC (global vector = skip vector is unknown!)  */                          /* no early skip for GMC (global vector = skip vector is unknown!)  */
916                          if (current->coding_type != S_VOP)      { /* no fast SKIP for S(GMC)-VOPs */                          if (current->coding_type != S_VOP)      { /* no fast SKIP for S(GMC)-VOPs */
917                                  if (pMB->dquant == 0                                  if (pMB->dquant == 0 && sad00 < pMB->quant * skip_thresh)
                                         && pMB->sad8[0] < pMB->quant * skip_thresh  
                                         && pMB->sad8[1] < pMB->quant * skip_thresh  
                                         && pMB->sad8[2] < pMB->quant * skip_thresh  
                                         && pMB->sad8[3] < pMB->quant * skip_thresh)  
   
918                                          if (Data.chroma || xvid_me_SkipDecisionP(pCurrent, pRef, x, y, iEdgedWidth/2, pMB->quant, Data.rrv)) {                                          if (Data.chroma || xvid_me_SkipDecisionP(pCurrent, pRef, x, y, iEdgedWidth/2, pMB->quant, Data.rrv)) {
919                                                  ZeroMacroblockP(pMB, sad00);                                                  ZeroMacroblockP(pMB, sad00);
920                                                  pMB->mode = MODE_NOT_CODED;                                                  pMB->mode = MODE_NOT_CODED;
# Line 965  Line 964 
964                          else                          else
965                                  ModeDecision_SAD(&Data, pMB, pMBs, x, y, pParam,                                  ModeDecision_SAD(&Data, pMB, pMBs, x, y, pParam,
966                                                                  MotionFlags, current->vop_flags, current->vol_flags,                                                                  MotionFlags, current->vop_flags, current->vol_flags,
967                                                                  pCurrent, pRef, pGMC, current->coding_type);                                                                  pCurrent, pRef, pGMC, current->coding_type, sad00);
968    
969    
970                          if (pMB->mode == MODE_INTRA)                          if (pMB->mode == MODE_INTRA)

Legend:
Removed from v.1442  
changed lines
  Added in v.1443

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