[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 1373, Wed Mar 3 20:57:36 2004 UTC revision 1374, Thu Mar 4 00:47:17 2004 UTC
# Line 19  Line 19 
19   *  along with this program ; if not, write to the Free Software   *  along with this program ; if not, write to the Free Software
20   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21   *   *
22   * $Id: gmc.c,v 1.1.2.6 2003-10-01 23:23:01 edgomez Exp $   * $Id: gmc.c,v 1.1.2.7 2004-03-04 00:47:17 syskin Exp $
23   *   *
24   ****************************************************************************/   ****************************************************************************/
25    
# Line 70  Line 70 
70                          U += dUx; V += dVx;                          U += dUx; V += dVx;
71    
72                          if (u > 0 && u <= W) { ri = MTab[u&15]; Offset = u>>4;  }                          if (u > 0 && u <= W) { ri = MTab[u&15]; Offset = u>>4;  }
73                          else if (u > W) Offset = W>>4;                          else {
74                                    if (u > W) Offset = W>>4;
75                          else Offset = -1;                          else Offset = -1;
76                                    ri = 0;
77                            }
78    
79                          if (v > 0 && v <= H) { rj = MTab[v&15]; Offset += (v>>4)*srcstride; }                          if (v > 0 && v <= H) { rj = MTab[v&15]; Offset += (v>>4)*srcstride; }
80                          else if (v > H) Offset += (H>>4)*srcstride;                          else {
81                                    if (v > H) Offset += (H>>4)*srcstride;
82                          else Offset -= srcstride;                          else Offset -= srcstride;
83                                    rj = 0;
84                            }
85    
86                          f0      = src[Offset + 0];                          f0      = src[Offset + 0];
87                          f0 |= src[Offset + 1] << 16;                          f0 |= src[Offset + 1] << 16;
# Line 214  Line 220 
220    
221          int32_t uo = This->Uo + (x<<8);  /* ((16*x)<<4) */          int32_t uo = This->Uo + (x<<8);  /* ((16*x)<<4) */
222          int32_t vo = This->Vo + (y<<8);          int32_t vo = This->Vo + (y<<8);
223          const uint32_t ri = MTab[uo & 15];          uint32_t ri = MTab[uo & 15];
224          const uint32_t rj = MTab[vo & 15];          uint32_t rj = MTab[vo & 15];
225          int i, j;          int i, j;
226    
227          int32_t Offset;          int32_t Offset;
228          if ((uint32_t)vo<=(uint32_t)H) Offset   = (vo>>4)*srcstride;          if (vo>=(-16*4) && vo<=H) Offset = (vo>>4)*srcstride;
229          else if (vo>H)                           Offset = ( H>>4)*srcstride;          else {
230                    if (vo>H) Offset = ( H>>4)*srcstride;
231          else                                                     Offset =-16*srcstride;          else                                                     Offset =-16*srcstride;
232          if ((uint32_t)uo<=(uint32_t)W) Offset += (uo>>4);                  rj = MTab[0];
233          else if (uo>W)                           Offset += ( W>>4);          }
234            if (uo>=(-16*4) && uo<=W) Offset += (uo>>4);
235            else {
236                    if (uo>W) Offset += (W>>4);
237          else                                                     Offset -= 16;          else                                                     Offset -= 16;
238                    ri = MTab[0];
239            }
240    
241          Dst += 16;          Dst += 16;
242    
# Line 259  Line 271 
271    
272          int32_t uo = This->Uco + (x<<7);          int32_t uo = This->Uco + (x<<7);
273          int32_t vo = This->Vco + (y<<7);          int32_t vo = This->Vco + (y<<7);
274          const uint32_t rri = MTab[uo & 15];          uint32_t rri = MTab[uo & 15];
275          const uint32_t rrj = MTab[vo & 15];          uint32_t rrj = MTab[vo & 15];
276          int i, j;          int i, j;
277    
278          int32_t Offset;          int32_t Offset;
279          if ((uint32_t)vo<=(uint32_t)H) Offset = (vo>>4)*srcstride;          if (vo>=(-8*4) && vo<=H) Offset = (vo>>4)*srcstride;
280          else if (vo>H) Offset = ( H>>4)*srcstride;          else {
281                    if (vo>H) Offset = ( H>>4)*srcstride;
282          else Offset =-8*srcstride;          else Offset =-8*srcstride;
283          if ((uint32_t)uo<=(uint32_t)W) Offset += (uo>>4);                  rrj = MTab[0];
284          else if (uo>W) Offset += (W>>4);          }
285            if (uo>=(-8*4) && uo<=W) Offset += (uo>>4);
286            else {
287                    if (uo>W) Offset += ( W>>4);
288          else Offset -= 8;          else Offset -= 8;
289                    rri = MTab[0];
290            }
291    
292          uDst += 8;          uDst += 8;
293          vDst += 8;          vDst += 8;

Legend:
Removed from v.1373  
changed lines
  Added in v.1374

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