[cvs] / xvidcore / src / motion / motion_inlines.h Repository:
ViewVC logotype

Diff of /xvidcore/src/motion/motion_inlines.h

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

revision 1.1.2.1, Wed Sep 10 22:19:00 2003 UTC revision 1.1.2.6, Sun Nov 16 15:32:38 2003 UTC
# Line 70  Line 70 
70          *min_dy = MAX(low, k);          *min_dy = MAX(low, k);
71  }  }
72    
73  /* mv.length table */  /* reversed mv.length table */
74  static const int mvtab[64] = {  static const int r_mvtab[64] = {
75          1, 2, 3, 4, 6, 7, 7, 7,          12, 12, 12, 12, 12, 12, 12, 12,
         9, 9, 9, 10, 10, 10, 10, 10,  
         10, 10, 10, 10, 10, 10, 10, 10,  
         10, 11, 11, 11, 11, 11, 11, 12,  
76          12, 12, 12, 12, 12, 12, 12, 12,          12, 12, 12, 12, 12, 12, 12, 12,
77          12, 12, 12, 12, 12, 12, 12, 12,          12, 12, 12, 12, 12, 12, 12, 12,
78          12, 12, 12, 12, 12, 12, 12, 12, 12          12, 12, 12, 12, 12, 12, 12, 12,
79            12, 11, 11, 11, 11, 11, 11, 10,
80            10, 10, 10, 10, 10, 10, 10, 10,
81            10, 10, 10, 10, 10, 9, 9, 9,
82            7, 7, 7, 6, 4, 3, 2, 1
83  };  };
84    
85  static __inline uint32_t  static __inline uint32_t
86  d_mv_bits(int x, int y, const VECTOR pred, const uint32_t iFcode, const int qpel, const int rrv)  d_mv_bits(int x, int y, const VECTOR pred, const uint32_t iFcode, const int qpel, const int rrv)
87  {  {
88          int bits;          unsigned int bits;
         const int q = (1 << (iFcode - 1)) - 1;  
89    
90          x <<= qpel;          x <<= qpel;
91          y <<= qpel;          y <<= qpel;
# Line 93  Line 93 
93    
94          x -= pred.x;          x -= pred.x;
95          bits = (x != 0 ? iFcode:0);          bits = (x != 0 ? iFcode:0);
96          x = abs(x);          x = -abs(x);
         x += q;  
97          x >>= (iFcode - 1);          x >>= (iFcode - 1);
98          bits += mvtab[x];          bits += r_mvtab[x+63];
99    
100          y -= pred.y;          y -= pred.y;
101          bits += (y != 0 ? iFcode:0);          bits += (y != 0 ? iFcode:0);
102          y = abs(y);          y = -abs(y);
         y += q;  
103          y >>= (iFcode - 1);          y >>= (iFcode - 1);
104          bits += mvtab[y];          bits += r_mvtab[y+63];
105    
106          return bits;          return bits;
107  }  }
# Line 133  Line 131 
131          pMB->mvs[0] = pMB->mvs[1] = pMB->mvs[2] = pMB->mvs[3] = zeroMV;          pMB->mvs[0] = pMB->mvs[1] = pMB->mvs[2] = pMB->mvs[3] = zeroMV;
132          pMB->qmvs[0] = pMB->qmvs[1] = pMB->qmvs[2] = pMB->qmvs[3] = zeroMV;          pMB->qmvs[0] = pMB->qmvs[1] = pMB->qmvs[2] = pMB->qmvs[3] = zeroMV;
133          pMB->sad16 = pMB->sad8[0] = pMB->sad8[1] = pMB->sad8[2] = pMB->sad8[3] = sad;          pMB->sad16 = pMB->sad8[0] = pMB->sad8[1] = pMB->sad8[2] = pMB->sad8[3] = sad;
134            pMB->mcsel = 0;
135            pMB->cbp = 0;
136  }  }
137    
138  /* check if given vector is equal to any vector checked before */  /* check if given vector is equal to any vector checked before */
139  static __inline int  static __inline int
140  vector_repeats(const VECTOR * const pmv, const int i)  vector_repeats(const VECTOR * const pmv, const unsigned int i)
141  {  {
142          unsigned int j;          unsigned int j;
143          for (j = 0; j < i; j++)          for (j = 0; j < i; j++)
# Line 148  Line 148 
148  /*      make a binary mask that prevents diamonds/squares  /*      make a binary mask that prevents diamonds/squares
149          from checking a vector which has been checked as a prediction */          from checking a vector which has been checked as a prediction */
150  static __inline int  static __inline int
151  make_mask(const VECTOR * const pmv, const int i, const int current)  make_mask(const VECTOR * const pmv, const unsigned int i, const unsigned int current)
152  {  {
153          unsigned int mask = 255, j;          unsigned int mask = 255, j;
154          for (j = 0; j < i; j++) {          for (j = 0; j < i; j++) {

Legend:
Removed from v.1.1.2.1  
changed lines
  Added in v.1.1.2.6

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