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

Diff of /branches/dev-api-4/xvidcore/src/motion/gmc.c

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

revision 1116, Sat Aug 9 09:52:02 2003 UTC revision 1117, Sat Aug 9 14:41:20 2003 UTC
# Line 35  Line 35 
35  // of pixel 0,0), not the macroblock one.  // of pixel 0,0), not the macroblock one.
36  // Conversely, *dst is the macroblock top-left adress.  // Conversely, *dst is the macroblock top-left adress.
37    
   
38  void Predict_16x16_C(const NEW_GMC_DATA * const This,  void Predict_16x16_C(const NEW_GMC_DATA * const This,
39                                           uint8_t *dst, const uint8_t *src,                                           uint8_t *dst, const uint8_t *src,
40                                           int dststride, int srcstride, int x, int y, int rounding)                                           int dststride, int srcstride, int x, int y, int rounding)
# Line 56  Line 55 
55          int i, j;          int i, j;
56    
57          dst += 16;          dst += 16;
58          for (j=16; j>0; --j)          for (j=16; j>0; --j) {
         {  
59          int U = Uo, V = Vo;          int U = Uo, V = Vo;
60          Uo += dUy; Vo += dVy;          Uo += dUy; Vo += dVy;
61          for (i=-16; i<0; ++i)                  for (i=-16; i<0; ++i) {
62          {                          unsigned int f0, f1, ri = 16, rj = 16;
                 unsigned int f0, f1, ri, rj;  
63                  int Offset;                  int Offset;
   
64                  int u = ( U >> 16 ) << rho;                  int u = ( U >> 16 ) << rho;
65                  int v = ( V >> 16 ) << rho;                  int v = ( V >> 16 ) << rho;
66    
67                  U += dUx; V += dVx;                  U += dUx; V += dVx;
68    
69                  ri = 16;                          if (u > 0 && u <= W) { ri = MTab[u&15]; Offset = u>>4;  }
                 if ((uint32_t)u<=(uint32_t)W) { ri = MTab[u&15]; Offset = u>>4; }  
70                  else if (u>W) Offset = W>>4;                  else if (u>W) Offset = W>>4;
71                  else Offset = -1;                  else Offset = -1;
72    
73                  rj = 16;                          if (v > 0 && v <= H) { rj = MTab[v&15]; Offset += (v>>4)*srcstride; }
                 if ((uint32_t)v<=(uint32_t)H) { rj = MTab[v&15]; Offset += (v>>4)*srcstride; }  
74                  else if (v>H) Offset += (H>>4)*srcstride;                  else if (v>H) Offset += (H>>4)*srcstride;
75                  else Offset -= srcstride;                  else Offset -= srcstride;
76    
# Line 94  Line 89 
89          }          }
90  }  }
91    
   
92  void Predict_8x8_C(const NEW_GMC_DATA * const This,  void Predict_8x8_C(const NEW_GMC_DATA * const This,
93                                           uint8_t *uDst, const uint8_t *uSrc,                                           uint8_t *uDst, const uint8_t *uSrc,
94                                           uint8_t *vDst, const uint8_t *vSrc,                                           uint8_t *vDst, const uint8_t *vSrc,
# Line 117  Line 111 
111    
112          uDst += 8;          uDst += 8;
113          vDst += 8;          vDst += 8;
114          for (j=8; j>0; --j)          for (j=8; j>0; --j) {
         {  
115          int32_t U = Uo, V = Vo;          int32_t U = Uo, V = Vo;
116          Uo += dUy; Vo += dVy;          Uo += dUy; Vo += dVy;
117    
118          for (i=-8; i<0; ++i)                  for (i=-8; i<0; ++i) {
         {  
119                  int Offset;                  int Offset;
120                  uint32_t f0, f1, ri, rj;                  uint32_t f0, f1, ri, rj;
121                  int32_t u, v;                  int32_t u, v;
# Line 132  Line 124 
124                  v = ( V >> 16 ) << rho;                  v = ( V >> 16 ) << rho;
125                  U += dUx; V += dVx;                  U += dUx; V += dVx;
126    
127                  if ((uint32_t)u<=(uint32_t)W) {                          if (u > 0 && u <= W) {
128                  ri = MTab[u&15];                  ri = MTab[u&15];
129                  Offset = u>>4;                  Offset = u>>4;
130                  }                          } else {
                 else {  
131                  ri = 16;                  ri = 16;
132                  if (u>W) Offset = W>>4;                  if (u>W) Offset = W>>4;
133                  else Offset = -1;                  else Offset = -1;
134                  }                  }
135                  if ((uint32_t)v<=(uint32_t)H) {  
136                            if (v > 0 && v <= H) {
137                  rj = MTab[v&15];                  rj = MTab[v&15];
138                  Offset += (v>>4)*srcstride;                  Offset += (v>>4)*srcstride;
139                  }                          } else {
                 else {  
140                  rj = 16;                  rj = 16;
141                  if (v>H) Offset += (H>>4)*srcstride;                  if (v>H) Offset += (H>>4)*srcstride;
142                  else Offset -= srcstride;                  else Offset -= srcstride;
# Line 178  Line 169 
169          }          }
170  }  }
171    
   
172  void get_average_mv_C(const NEW_GMC_DATA * const Dsp, VECTOR * const mv,  void get_average_mv_C(const NEW_GMC_DATA * const Dsp, VECTOR * const mv,
173                                                  int x, int y, int qpel)                                                  int x, int y, int qpel)
174  {  {
# Line 208  Line 198 
198  //////////////////////////////////////////////////////////  //////////////////////////////////////////////////////////
199  // simplified version for 1 warp point  // simplified version for 1 warp point
200    
   
201  void Predict_1pt_16x16_C(const NEW_GMC_DATA * const This,  void Predict_1pt_16x16_C(const NEW_GMC_DATA * const This,
202                                                   uint8_t *Dst, const uint8_t *Src,                                                   uint8_t *Dst, const uint8_t *Src,
203                                                   int dststride, int srcstride, int x, int y, int rounding)                                                   int dststride, int srcstride, int x, int y, int rounding)
# Line 254  Line 243 
243          }          }
244  }  }
245    
   
246  void Predict_1pt_8x8_C(const NEW_GMC_DATA * const This,  void Predict_1pt_8x8_C(const NEW_GMC_DATA * const This,
247                                                   uint8_t *uDst, const uint8_t *uSrc,                                                   uint8_t *uDst, const uint8_t *uSrc,
248                                                   uint8_t *vDst, const uint8_t *vSrc,                                                   uint8_t *vDst, const uint8_t *vSrc,
# Line 311  Line 299 
299          }          }
300  }  }
301    
   
302  void get_average_mv_1pt_C(const NEW_GMC_DATA * const Dsp, VECTOR * const mv,  void get_average_mv_1pt_C(const NEW_GMC_DATA * const Dsp, VECTOR * const mv,
303                                                          int x, int y, int qpel)                                                          int x, int y, int qpel)
304  {  {
# Line 418  Line 405 
405    
406  //////////////////////////////////////////////////////////  //////////////////////////////////////////////////////////
407    
   
408  /* quick and dirty routine to generate the full warped image (pGMC != NULL)  /* quick and dirty routine to generate the full warped image (pGMC != NULL)
409          or just all average Motion Vectors (pGMC == NULL) */          or just all average Motion Vectors (pGMC == NULL) */
410    

Legend:
Removed from v.1116  
changed lines
  Added in v.1117

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