[Mp4-tech] encoder and decoder output different motion vectors

Tomer Segal tsegal netvision.net.il
Fri Aug 4 02:06:03 EDT 2006


i actually had the same suspicion, but i followed the relevant execution path in both encoder and decoder and found that this was not the case. in the encoder i can see that the subtraction of the predictors takes place only after the values are output. in the decoder i can see that the predictors are added before the values are output.
however, this turned my on to another issue. the MVDs are scaled down in the encoder when written to the mpeg file and are later scaled up by the decoder. in both cases they are forced into a certain range (as described in iso-14496-2, clause 7.6.3).
i found that for the complex sequence i was working on two MVD coordinates (out tens of thousands) were effected by this (they were outside the range and were assigned the highest value in the range). this means the corresponding decoded MVD coordinates would surely be different and ultimately the reconstructed MVs too. moreover, since these different MVs will later be used to create predictors for other macroblocks those macroblocks will in turn be different as well. 
that being said, intuitively it seems the inaccuracies this could introduce would be restricted to a limited number of VOPs and a limited number of macroblocks (these were only two coordinates out of tens of thousands). the differences i get between encoder and decoder MVs are spread across all VOPs and across almost all macroblocks so i doubt this alone could be the cause.
thanks,
Tomer
  ----- Original Message ----- 
  From: Steinberg Erez-RM96322 
  To: Tomer Segal 
  Cc: mp4-tech lists.mpegif.org 
  Sent: Thursday, August 03, 2023 09:41
  Subject: RE: [Mp4-tech] encoder and decoder output different motion vectors
  Perhaps one of them is not giving you the MV (instead your are getting the MVD or MVP)
  MVx = MVPx + MVDx
  MVy = MVPy + MVDy
  Regards,
  Erez
------------------------------------------------------------------------------
  From: mp4-tech-bounces lists.mpegif.org [mailto:mp4-tech-bounces lists.mpegif.org] On Behalf Of Tomer Segal
  Sent: Wednesday, August 02, 2023 5:33
  To: mp4-tech lists.mpegif.org
  Subject: [Mp4-tech] encoder and decoder output different motion vectors
  hi,
  i'm a little confused about a set of results i got using the mpeg4 reference software (MoMuSys-1.0-001220_sony).
  i encoded a yuv sequence having the encoder output the motion vectors calculated during encoding. then decoded the resulting mpeg file with the decoder, enabling a trace of the motion vectors extracted during  decoding. i repeated these steps twice, once for a very simple yuv sequence (few blocks change throughout the sequence) and a second time using a more complex sequence. for the simple sequence the motion vectors output by the encoder and the decoder were exactly the same. for the complex sequence however there were differences between the vectors - in most blocks vectors differed by a single halfpel, but a few of them differed by as much as 5 halfpels.
  i thought the motion vectors extracted by the decoder were suppose to be exactly the same as the ones calculated in the encoder. am i wrong? i tried finding the answer in the mpeg4 iso and other related articles but i was unable to.
  if indeed the vectors are supposed to be identical, what could be causing this difference? 
  Thanks,
      Tomer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/mp4-tech/attachments/20060804/6135c70d/attachment.html


More information about the Mp4-tech mailing list