* with componant magnitude greater.
* XXX: if some vector can go outside, (accelerator, ....) you need to clip
* them yourself */
- bmx = x264_clip3( ( m->mvp[0] + 2 ) >> 2, mv_x_min, mv_x_max );
- bmy = x264_clip3( ( m->mvp[1] + 2 ) >> 2, mv_y_min, mv_y_max );
+ bmx = ( x264_clip3( m->mvp[0], mv_x_min, mv_x_max ) + 2 ) >> 2;
+ bmy = ( x264_clip3( m->mvp[1], mv_y_min, mv_y_max ) + 2 ) >> 2;
bcost = h->pixf.sad[i_pixel]( m->p_fenc, m->i_stride,
&p_fref[bmy * m->i_stride + bmx], m->i_stride );
/* try extra predictors if provided */
for( i_iter = 0; i_iter < i_mvc; i_iter++ )
{
- const int mx = x264_clip3( ( mvc[i_iter][0] + 2 ) >> 2, mv_x_min, mv_x_max );
- const int my = x264_clip3( ( mvc[i_iter][1] + 2 ) >> 2, mv_y_min, mv_y_max );
+ const int mx = ( x264_clip3( mvc[i_iter][0], mv_x_min, mv_x_max ) + 2 ) >> 2;
+ const int my = ( x264_clip3( mvc[i_iter][1], mv_y_min, mv_y_max ) + 2 ) >> 2;
if( mx != bmx || my != bmy )
COST_MV( mx, my );
}