[Ffmpeg-devel] MPEG4: Edge emulation for field motion vectors

Rahul Kumar kr.rahul
Fri Feb 17 15:37:54 CET 2006

Hi everyone,
  I have a doubt regarding handling of unrestricted motion vectors
for field macroblocks  (ie MV_TYPE_FIELD), in a frame picture  (ie
s->picture_structure == PICT_FRAME)

In such a scenario we call edge emulation routine with the following args:
// in function mpeg_motion
ff_emulated_edge_mc(s->edge_emu_buffer, ptr_y, s->linesize, 17, 17+field_based,
 src_x, src_y<<field_based, s->h_edge_pos, s->v_edge_pos);

However shouldn't we be calling the above function with (2 * s->linesize)

Best regards,

PS: Alternatively if we look at the MPEG4 ISO code (microsoft's
implementation of natural video coding):
The function "motionCompMB()" (in file mc.cpp) which handles motion
compensation calls "motionCompYField()" for field macroblock, which
in-turn doubles frame-width before performing edge emulation.

More information about the ffmpeg-devel mailing list