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, 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; |
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 |
} |
} |
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; |
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 */ |