Log in

View Full Version : Motion Estimation function


davFR
12th November 2003, 11:13
Hi Everyone,

I would like to use Xvid's motion estimation (ME) function, in order to create a GPL video filter. My problem is that ME function seems deeply integrated into XviD code, and needs lots of parameters and a complicated structure (SearchData).

I would like to find in XviD code the function which only needs 2 consecutive frames and returns a MV matrix. I don't care for the moment if ME process is very long because I don't provide "ME hints" (i.e. MV matrix of the previous frame).

As anyone a clue about the function name I should look at?
I thought that maybe earlier Xvid or Mumosys code would be simpler? Has anyone remembrance of such a very modular function in previous XviD version?

Many thanks to all,

David.

sysKin
12th November 2003, 11:31
As I'm the author of current XviD's ME, I should be able to help. ;)

Estimation is not deeply integrated into the rest of XviD. The only 'entry point' is MotionEstimation() function itself. However, if you want a simple example of how the stuff works, I'd recommend you looked at GMEanalysis() in estimation_gmc.c - it only uses a fraction of the big struct, yet gives each macroblock (16x16) its motion vector.

Estimation for p-frames is a little more complex because it also searches for possible motion vectors of 8x8 blocks. I don't know if you need such precision for your filter, but if you do, compare the differences between CheckCandidate16I() and CheckCandidate16.

Ask any questions you have.

Regards,
Radek

davFR
12th November 2003, 11:38
Thanks, I'll take a look at it as soon I'm home:o)