26 |
* along with this program; if not, write to the Free Software |
* along with this program; if not, write to the Free Software |
27 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
28 |
* |
* |
29 |
* $Id: motion_est.h,v 1.1.2.9 2002-12-08 14:57:09 syskin Exp $ |
* $Id: motion_est.h,v 1.1.2.10 2002-12-11 10:32:29 syskin Exp $ |
30 |
* |
* |
31 |
***************************************************************************/ |
***************************************************************************/ |
32 |
|
|
100 |
-1, -2, 1, 2 |
-1, -2, 1, 2 |
101 |
}; |
}; |
102 |
|
|
103 |
|
#define RRV_MV_SCALEDOWN(a) ( (a)>=0 ? (a+1)/2 : (a-1)/2 ) |
104 |
|
#define RRV_MV_SCALEUP(a) ( (a)>0 ? 2*(a)-1 : (a)<0 ? 2*(a)+1 : (a) ) |
105 |
|
|
106 |
typedef struct |
typedef struct |
107 |
{ |
{ |
129 |
int * temp; |
int * temp; |
130 |
int qpel, qpel_precision; |
int qpel, qpel_precision; |
131 |
int chroma; |
int chroma; |
132 |
|
int rrv; |
133 |
//fields for interpolate and direct mode |
//fields for interpolate and direct mode |
134 |
const uint8_t *bRef; |
const uint8_t *bRef; |
135 |
const uint8_t *bRefH; |
const uint8_t *bRefH; |
187 |
} |
} |
188 |
|
|
189 |
static void __inline |
static void __inline |
190 |
|
get_range_rrv(int32_t * const min_dx, |
191 |
|
int32_t * const max_dx, |
192 |
|
int32_t * const min_dy, |
193 |
|
int32_t * const max_dy, |
194 |
|
const uint32_t x, |
195 |
|
const uint32_t y, |
196 |
|
const uint32_t block_sz, /* block dimension, 8 or 16 */ |
197 |
|
const uint32_t width, |
198 |
|
const uint32_t height, |
199 |
|
const uint32_t fcode) |
200 |
|
{ |
201 |
|
int k; |
202 |
|
const int search_range = 32 << (fcode - 1); |
203 |
|
const int high = RRV_MV_SCALEUP(search_range - 1); //halfzero -> halfpel, because we do our search in halfpel |
204 |
|
const int low = RRV_MV_SCALEUP(-search_range); |
205 |
|
|
206 |
|
k = 2 * (int)(width - x*block_sz); |
207 |
|
*max_dx = MIN(high, k); |
208 |
|
k = 2 * (int)(height - y*block_sz); |
209 |
|
*max_dy = MIN(high, k); |
210 |
|
|
211 |
|
k = -2 * (int)((x+1) * block_sz); |
212 |
|
*min_dx = MAX(low, k); |
213 |
|
k = -2 * (int)((y+1) * block_sz); |
214 |
|
*min_dy = MAX(low, k); |
215 |
|
} |
216 |
|
|
217 |
|
static void __inline |
218 |
get_range_qpel(int32_t * const min_dx, |
get_range_qpel(int32_t * const min_dx, |
219 |
int32_t * const max_dx, |
int32_t * const max_dx, |
220 |
int32_t * const min_dy, |
int32_t * const min_dy, |
282 |
int inter4v, |
int inter4v, |
283 |
MACROBLOCK * const pMB); |
MACROBLOCK * const pMB); |
284 |
|
|
|
|
|
|
#ifdef _SMP |
|
|
bool |
|
|
SMP_MotionEstimation(MBParam * const pParam, |
|
|
FRAMEINFO * const current, |
|
|
FRAMEINFO * const reference, |
|
|
const IMAGE * const pRefH, |
|
|
const IMAGE * const pRefV, |
|
|
const IMAGE * const pRefHV, |
|
|
const uint32_t iLimit); |
|
|
#endif |
|
|
|
|
285 |
#endif /* _MOTION_EST_H_ */ |
#endif /* _MOTION_EST_H_ */ |