PDA

View Full Version : Doubt regarding motion vectors


ramprasad85
23rd September 2009, 09:22
in common/macroblock.c

static inline void x264_mb_mc_0xywh( x264_t *h, int x, int y, int width, int height )
{
const int i8 = x264_scan8[0]+x+8*y;
const int i_ref = h->mb.cache.ref[0][i8];
const int mvx = x264_clip3( h->mb.cache.mv[0][i8][0], h->mb.mv_min[0], h->mb.mv_max[0] );
int mvy = x264_clip3( h->mb.cache.mv[0][i8][1], h->mb.mv_min[1], h->mb.mv_max[1] );

the default search range being 16, i thought the motion vectors mvx and mvy would be within the range -64 to +64.
but it is not so. for example in frame 158 of foreman they are (mvx=-137, mvy=10) (mvx=-136, mvy=-5) (mvx=-129, mvy=12) (mvx=-144, mvy=0) etc
What is wrong in my understanding?

Dark Shikari
23rd September 2009, 09:27
The search range is the range that x264 searches from the best predictor during fullpel search. It has absolutely nothing to do with the actual length of motion vectors.

Perhaps you have confused merange with mvrange?

ramprasad85
23rd September 2009, 10:44
lets take (mvx=-137,mvy=10)
in my understanding -137 means 34 (137/4=34) pixels left (due to the -) of the current mb and a quarter pel interpolation (137%4=1) and 10 means 2 pixels down (due to the +) and a half pel interpolation. am I right?
if i am right, how is it that 34 which is much greater than 16 (default merange) is being used?