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

Diff of /branches/dev-api-4/xvidcore/src/motion/motion_inlines.h

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

revision 1186, Fri Oct 24 13:28:23 2003 UTC revision 1187, Sat Oct 25 16:51:38 2003 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: motion_inlines.h,v 1.1.2.4 2003-10-24 13:28:23 syskin Exp $   * $Id: motion_inlines.h,v 1.1.2.5 2003-10-25 16:51:38 syskin Exp $
25   *   *
26   ****************************************************************************/   ****************************************************************************/
27    
# 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,
79          12, 12, 12, 12, 12, 12, 12, 12          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 94  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  }  }

Legend:
Removed from v.1186  
changed lines
  Added in v.1187

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