[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 1602, Thu Mar 3 01:27:07 2005 UTC revision 1603, Fri Mar 4 22:13:33 2005 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.14 2005-03-03 01:27:07 Isibaar Exp $   * $Id: estimation_pvop.c,v 1.15 2005-03-04 22:13:33 Isibaar Exp $
25   *   *
26   ****************************************************************************/   ****************************************************************************/
27    
# Line 858  Line 858 
858                          }                          }
859    
860                          if(MotionFlags & XVID_ME_DETECT_STATIC_MOTION) {                          if(MotionFlags & XVID_ME_DETECT_STATIC_MOTION) {
861                                    VECTOR *cmpMV;
862                                    VECTOR staticMV = { 0, 0 };
863    
864                                    if (current->coding_type == S_VOP)
865                                            cmpMV = &pMB->amv;
866                                    else
867                                            cmpMV = &staticMV;
868    
869                                  if(x > 0 && y > 0 && x < pParam->mb_width) {                                  if(x > 0 && y > 0 && x < pParam->mb_width) {
870                                          if(MVequal((&pMBs[(x-1) + y * pParam->mb_width])->mvs[0], zeroMV) &&                                          if(MVequal((&pMBs[(x-1) + y * pParam->mb_width])->mvs[0], *cmpMV) &&
871                                             MVequal((&pMBs[x + (y-1) * pParam->mb_width])->mvs[0], zeroMV) &&                                             MVequal((&pMBs[x + (y-1) * pParam->mb_width])->mvs[0], *cmpMV) &&
872                                         MVequal((&pMBs[(x+1) + (y-1) * pParam->mb_width])->mvs[0], zeroMV) &&                                         MVequal((&pMBs[(x+1) + (y-1) * pParam->mb_width])->mvs[0], *cmpMV) &&
873                                         MVequal(prevMB->mvs[0], zeroMV)) {                                         MVequal(prevMB->mvs[0], *cmpMV)) {
874                                                  stat_thresh = MAX((&pMBs[(x-1) + y * pParam->mb_width])->sad16,                                                  stat_thresh = MAX((&pMBs[(x-1) + y * pParam->mb_width])->sad16,
875                                                                            MAX((&pMBs[x + (y-1) * pParam->mb_width])->sad16,                                                                            MAX((&pMBs[x + (y-1) * pParam->mb_width])->sad16,
876                                                                            MAX((&pMBs[(x+1) + (y-1) * pParam->mb_width])->sad16,                                                                            MAX((&pMBs[(x+1) + (y-1) * pParam->mb_width])->sad16,
# Line 876  Line 884 
884                                  }                                  }
885                          }                          }
886    
887                           /* favorize (0,0) vector for cartoons */                           /* favorize (0,0) or global vector for cartoons */
888                          if ((current->vop_flags & XVID_VOP_CARTOON) &&                          if (current->vop_flags & XVID_VOP_CARTOON) {
889                                  ((sad00 < pMB->quant * 4 * skip_thresh) || (sad00 < stat_thresh))) {                                  if (current->coding_type == S_VOP) {
890                                            int32_t iSAD = sad16(pCurrent->y + (x + y * iEdgedWidth) * 16,
891                                            pGMC->y + 16*y*iEdgedWidth + 16*x, iEdgedWidth, 65536);
892    
893                                            if (Data.chroma) {
894                                                    iSAD += sad8(pCurrent->u + x*8 + y*(iEdgedWidth/2)*8, pGMC->u + 8*y*(iEdgedWidth/2) + 8*x, iEdgedWidth/2);
895                                                    iSAD += sad8(pCurrent->v + (x + y*(iEdgedWidth/2))*8, pGMC->v + 8*y*(iEdgedWidth/2) + 8*x, iEdgedWidth/2);
896                                            }
897    
898                                            if (iSAD <= stat_thresh) {              /* mode decision GMC */
899                                                    pMB->mode = MODE_INTER;
900                                                    pMB->sad16 = pMB->sad8[0] = pMB->sad8[1] = pMB->sad8[2] = pMB->sad8[3] = iSAD;
901                                                    pMB->mcsel = 1;
902                                                    if (Data.qpel) {
903                                                            pMB->qmvs[0] = pMB->qmvs[1] = pMB->qmvs[2] = pMB->qmvs[3] = pMB->amv;
904                                                            pMB->mvs[0].x = pMB->mvs[1].x = pMB->mvs[2].x = pMB->mvs[3].x = pMB->amv.x/2;
905                                                            pMB->mvs[0].y = pMB->mvs[1].y = pMB->mvs[2].y = pMB->mvs[3].y = pMB->amv.y/2;
906                                                    } else
907                                                            pMB->mvs[0] = pMB->mvs[1] = pMB->mvs[2] = pMB->mvs[3] = pMB->amv;
908    
909                                                    continue;
910                                            }
911                                    }
912                                    else if (sad00 < stat_thresh) {
913                                  ZeroMacroblockP(pMB, sad00);                                  ZeroMacroblockP(pMB, sad00);
914                                  pMB->cbp = 0x3f;                                  pMB->cbp = 0x3f;
915                                  continue;                                  continue;
916                          }                          }
917                            }
918    
919                          SearchP(pRef, pRefH->y, pRefV->y, pRefHV->y, pCurrent, x,                          SearchP(pRef, pRefH->y, pRefV->y, pRefHV->y, pCurrent, x,
920                                          y, MotionFlags, current->vop_flags,                                          y, MotionFlags, current->vop_flags,

Legend:
Removed from v.1602  
changed lines
  Added in v.1603

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