[XviD-devel] Saving motion vectors to disk?

Michael Militzer michael at xvid.org
Sun Apr 1 22:02:58 CEST 2007


Hello,

well, you could easily print out the motion vectors found during encoding
by adding a fprintf() in e.g. encoder.c, FrameCodeP() at around line 1814.
Each MB can have up to four motion vectors (mvs[0], ..., mvs[3]) depending
on mode. You should consider that intra-coded macroblocks have no motion
vector of course and that intra MBs are handled earlier in the loop
(l. 1774).

You can obtain the motion vectors of B-frames in a similar fashion (in
FrameCodeB()). Just, B-frame MBs can have more modes and can have forward
and backward vectors. So for a start, P-frame vectors might be easier to
analyze...

Regards,
Michael


Quoting Martin Breidt <breidt at gmx.de>:

> Hello,
>
> I am new to this list but hopefully someone can help me with this.
>
> I would like to save the 2D motion vectors (either existing ones from an
> AVI or freshly calculates ones) into a file on disk, either in a simple
> binary format or even ASCII. The intent is to load the vectors with some
> other program and run some calculations on them.
>
> Any help in this much appreciated!
> Breidt
>
> _______________________________________________
> XviD-devel mailing list
> XviD-devel at xvid.org
> http://list.xvid.org/mailman/listinfo/xvid-devel
>






More information about the XviD-devel mailing list