Commit c16119a2 authored by Loren Merritt's avatar Loren Merritt

Fix clipping of mvs in probe_pskip. (Previously it mixed up fullpel with...

Fix clipping of mvs in probe_pskip. (Previously it mixed up fullpel with qpel.) This should eliminate the black blocks that sometimes appeared in high motion, low detail scenes.


git-svn-id: svn://svn.videolan.org/x264/trunk@108 df754926-b1dd-0310-bc7b-ec298dee348c
parent 6558c832
......@@ -347,6 +347,10 @@ void x264_mb_predict_mv_pskip( x264_t *h, int mv[2] )
{
x264_mb_predict_mv_16x16( h, 0, 0, mv );
}
/* FIXME: ensure that mvp doesn't extend past picture edge + padding.
* we can't just clip the mv here, since the original value may be
* needed for predicting other mvs. */
}
static int x264_mb_predict_mv_direct16x16_temporal( x264_t *h )
......
......@@ -799,19 +799,12 @@ int x264_macroblock_probe_skip( x264_t *h, int b_bidir )
/* Get the MV */
x264_mb_predict_mv_pskip( h, mvp );
/* Special case, need to clip the vector */
n = 16 * h->mb.i_mb_x + mvp[0];
if( n < -24 )
mvp[0] = -24 - 16*h->mb.i_mb_x;
else if( n > 16 * h->sps->i_mb_width + 24 )
mvp[0] = 16 * ( h->sps->i_mb_width - h->mb.i_mb_x ) + 24;
n = 16 * h->mb.i_mb_y + mvp[1];
if( n < -24 )
mvp[1] = -24 - 16*h->mb.i_mb_y;
else if( n > 16 * h->sps->i_mb_height + 8 )
mvp[1] = 16 * ( h->sps->i_mb_height - h->mb.i_mb_y ) + 8;
mvp[0] = x264_clip3( mvp[0],
4*( -16*h->mb.i_mb_x - 24 ),
4*( 16*( h->sps->i_mb_width - h->mb.i_mb_x ) + 8 ) );
mvp[1] = x264_clip3( mvp[1],
4*( -16*h->mb.i_mb_y - 24 ),
4*( 16*( h->sps->i_mb_height - h->mb.i_mb_y ) + 8 ) );
/* Motion compensation */
h->mc[MC_LUMA]( h->mb.pic.p_fref[0][0][0], h->mb.pic.i_stride[0],
......
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