45 |
const uint32_t width, |
const uint32_t width, |
46 |
const uint32_t height, |
const uint32_t height, |
47 |
const uint32_t fcode, |
const uint32_t fcode, |
48 |
const int precision, /* 2 for qpel, 1 for halfpel */ |
const int precision) /* 2 for qpel, 1 for halfpel */ |
|
const int rrv) |
|
49 |
{ |
{ |
50 |
int k; |
int k; |
51 |
const int search_range = 16 << fcode; |
const int search_range = 16 << fcode; |
52 |
int high = search_range - 1; |
int high = search_range - 1; |
53 |
int low = -search_range; |
int low = -search_range; |
54 |
|
|
|
if (rrv) { |
|
|
high = RRV_MV_SCALEUP(high); |
|
|
low = RRV_MV_SCALEUP(low); |
|
|
block_sz++; |
|
|
} |
|
|
|
|
55 |
k = (int)(width - (x<<block_sz))<<precision; |
k = (int)(width - (x<<block_sz))<<precision; |
56 |
*max_dx = MIN(high, k); |
*max_dx = MIN(high, k); |
57 |
k = (int)(height - (y<<block_sz))<<precision; |
k = (int)(height - (y<<block_sz))<<precision; |
76 |
}; |
}; |
77 |
|
|
78 |
static __inline uint32_t |
static __inline uint32_t |
79 |
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) |
80 |
{ |
{ |
81 |
unsigned int bits; |
unsigned int bits; |
82 |
|
|
83 |
x <<= qpel; |
x <<= qpel; |
84 |
y <<= qpel; |
y <<= qpel; |
|
if (rrv) { x = RRV_MV_SCALEDOWN(x); y = RRV_MV_SCALEDOWN(y); } |
|
85 |
|
|
86 |
x -= pred.x; |
x -= pred.x; |
87 |
bits = (x != 0 ? iFcode:0); |
bits = (x != 0 ? iFcode:0); |