Commit 33140d09 authored by Loren Merritt's avatar Loren Merritt

Another MV clipping fix.


git-svn-id: svn://svn.videolan.org/x264/trunk@114 df754926-b1dd-0310-bc7b-ec298dee348c
parent 91792459
......@@ -76,8 +76,8 @@ void x264_me_search_ref( x264_t *h, x264_me_t *m, int (*mvc)[2], int i_mvc, int
* 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 );
......@@ -85,8 +85,8 @@ void x264_me_search_ref( x264_t *h, x264_me_t *m, int (*mvc)[2], int i_mvc, int
/* 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 );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment