Commit ee62378f authored by Loren Merritt's avatar Loren Merritt

limit vertical motion vectors to +/-512, since some decoders actually depend on that limit.


git-svn-id: svn://svn.videolan.org/x264/trunk@663 df754926-b1dd-0310-bc7b-ec298dee348c
parent 30317541
......@@ -224,7 +224,10 @@ static void x264_mb_analyse_init( x264_t *h, x264_mb_analysis_t *a, int i_qp )
{
int i, j;
int i_fmv_range = 4 * h->param.analyse.i_mv_range;
int i_fpel_border = 5; // 3 for hex search, 2 for subpel, ignores subme7 & bime
// limit motion search to a slightly smaller range than the theoretical limit,
// since the search may go a few iterations past its given range
int i_fpel_border = 5; // umh unconditional radius
int i_spel_border = 8; // 1.5 for subpel_satd, 1.5 for subpel_rd, 2 for bime, round up
/* Calculate max allowed MV range */
#define CLIP_FMV(mv) x264_clip3( mv, -i_fmv_range, i_fmv_range )
......@@ -262,7 +265,7 @@ static void x264_mb_analyse_init( x264_t *h, x264_mb_analysis_t *a, int i_qp )
h->mb.mv_min[1] = 4*( -16*mb_y - 24 );
h->mb.mv_max[1] = 4*( 16*( mb_height - mb_y - 1 ) + 24 );
h->mb.mv_min_spel[1] = CLIP_FMV( h->mb.mv_min[1] );
h->mb.mv_min_spel[1] = x264_clip3( h->mb.mv_min[1], X264_MAX(4*(-512+i_spel_border), -i_fmv_range), i_fmv_range );
h->mb.mv_max_spel[1] = CLIP_FMV( h->mb.mv_max[1] );
h->mb.mv_max_spel[1] = X264_MIN( h->mb.mv_max_spel[1], thread_mvy_range*4 );
h->mb.mv_min_fpel[1] = (h->mb.mv_min_spel[1]>>2) + i_fpel_border;
......
......@@ -493,7 +493,7 @@ static int x264_validate_parameters( x264_t *h )
if( h->param.analyse.i_mv_range <= 0 )
h->param.analyse.i_mv_range = l->mv_range;
else
h->param.analyse.i_mv_range = x264_clip3(h->param.analyse.i_mv_range, 32, 2048);
h->param.analyse.i_mv_range = x264_clip3(h->param.analyse.i_mv_range, 32, 512);
if( h->param.analyse.i_direct_8x8_inference < 0 )
h->param.analyse.i_direct_8x8_inference = l->direct8x8;
}
......
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