[svn] / branches / dev-api-3 / xvidcore / src / motion / motion_est.c Repository:
ViewVC logotype

Diff of /branches/dev-api-3/xvidcore/src/motion/motion_est.c

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

revision 753, Wed Jan 1 12:50:44 2003 UTC revision 754, Wed Jan 1 13:04:06 2003 UTC
# Line 753  Line 753 
753          uint32_t x, y;          uint32_t x, y;
754          uint32_t iIntra = 0;          uint32_t iIntra = 0;
755          int32_t InterBias, quant = current->quant, sad00;          int32_t InterBias, quant = current->quant, sad00;
         uint8_t *qimage;  
756    
757          // some pre-initialized thingies for SearchP          // some pre-initialized thingies for SearchP
758          int32_t temp[8];          int32_t temp[8];
# Line 779  Line 778 
778                  Data.qpel = Data.chroma = 0;                  Data.qpel = Data.chroma = 0;
779          }          }
780    
781          if((qimage = (uint8_t *) malloc(32 * pParam->edged_width)) == NULL)          Data.RefQ = pRefV->u; // a good place, also used in MC (for similar purpose)
                 return 1; // allocate some mem for qpel interpolated blocks  
                                   // somehow this is dirty since I think we shouldn't use malloc outside  
                                   // encoder_create() - so please fix me!  
         Data.RefQ = qimage;  
782          if (sadInit) (*sadInit) ();          if (sadInit) (*sadInit) ();
783    
784          for (y = 0; y < mb_height; y++) {          for (y = 0; y < mb_height; y++) {
# Line 875  Line 870 
870                                                    pParam->edged_width);                                                    pParam->edged_width);
871    
872                                          if (deviation < (pMB->sad16 - InterBias)) {                                          if (deviation < (pMB->sad16 - InterBias)) {
873                                          if (++iIntra >= iLimit) { free(qimage); return 1; }                                          if (++iIntra >= iLimit) return 1;
874                                          pMB->mode = MODE_INTRA;                                          pMB->mode = MODE_INTRA;
875                                          pMB->mvs[0] = pMB->mvs[1] = pMB->mvs[2] =                                          pMB->mvs[0] = pMB->mvs[1] = pMB->mvs[2] =
876                                                          pMB->mvs[3] = zeroMV;                                                          pMB->mvs[3] = zeroMV;
# Line 887  Line 882 
882                          }                          }
883                  }                  }
884          }          }
         free(qimage);  
885    
886          if (current->coding_type == S_VOP)      /* first GMC step only for S(GMC)-VOPs */          if (current->coding_type == S_VOP)      /* first GMC step only for S(GMC)-VOPs */
887                  current->GMC_MV = GlobalMotionEst( pMBs, pParam, current->fcode );                  current->GMC_MV = GlobalMotionEst( pMBs, pParam, current->fcode );
# Line 1760  Line 1754 
1754    
1755          const int32_t TRB = time_pp - time_bp;          const int32_t TRB = time_pp - time_bp;
1756          const int32_t TRD = time_pp;          const int32_t TRD = time_pp;
         uint8_t * qimage;  
1757    
1758  // some pre-inintialized data for the rest of the search  // some pre-inintialized data for the rest of the search
1759    
# Line 1777  Line 1770 
1770          Data.qpel = pParam->m_quarterpel;          Data.qpel = pParam->m_quarterpel;
1771          Data.rounding = 0;          Data.rounding = 0;
1772    
1773          if((qimage = (uint8_t *) malloc(32 * pParam->edged_width)) == NULL)          Data.RefQ = f_refV->u; // a good place, also used in MC (for similar purpose)
                 return; // allocate some mem for qpel interpolated blocks  
                                   // somehow this is dirty since I think we shouldn't use malloc outside  
                                   // encoder_create() - so please fix me!  
         Data.RefQ = qimage;  
   
1774          // note: i==horizontal, j==vertical          // note: i==horizontal, j==vertical
1775          for (j = 0; j < pParam->mb_height; j++) {          for (j = 0; j < pParam->mb_height; j++) {
1776    
# Line 1879  Line 1867 
1867                          }                          }
1868                  }                  }
1869          }          }
         free(qimage);  
1870  }  }
1871    
1872  static __inline void  static __inline void

Legend:
Removed from v.753  
changed lines
  Added in v.754

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