View Full Version : The best motion vector of a macroblock...


Redhat_doom
24th January 2009, 20:57
Hi,

As you know, for each MB, the best motion vector is predicted during the encoding process. But do you know where this predicted motion vector is stored? I think it is written to one of the fields of MB table. Am I right? Thanks!

MfA
26th January 2009, 22:19
You are mixing up motion estimation and motion prediction. The best guess at what the motion vector will be based on previous (in a coding sense) motion vectors, is the prediction. This is not stored anywhere, the decoder simply repeats the prediction. What is usually coded is the difference between this predicted vector and the motion vector which comes from motion estimation.

You seem to want to find coded MVs, these are not stored as such ... the only way to get them is to decode the video.

FFDSHOW can visualize the motion vectors from H.264 video BTW.

Redhat_doom
26th January 2009, 22:59
Thanks! As far as I know, for each MB, two motion vectors are found. The first motion vector (P1) is "estimated" using the best MB match in the previous frame while the second motion vector (P2) is "predicted" using the available motion vectors of neighboring MBs in the current frame. Then a motion vector difference (mvd) is calculated as mvd=P1-P2 and this difference is encoded. Right?

At the decoder side, we have this mvd and the decoder does the same motion vector prediction to obtain P2. Finally, using P1=mvd+P2, we can obtain the actual motion vector associated to this MB. But is it true? Thanks again!