Re[2]: [XviD-devel] Global Motion Compensation

Radek 'sysKin' Czyz xvid-devel@xvid.org
Fri, 25 Oct 2002 22:21:30 +0930


------------9E1851103F01E877
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

> let's combine our effords in this, because I had similar plans:
> I guess fast GMC has to work like that: First calculate global
> translation (e.g. from motion vectors or another way), then refine to
> more free parameters (sheer/zoom)...

I haven't thought beyond one-point GMC yet.

> One crucial step is _which_ motion vectors from ME to consider in getting
> translation and which not. There are several ways for that, maybe we can
> compare which of our ideas works best before switching to the next step.

Now this is what I'm pround of ;)
My reasoning was: the most popular ones, while ignoring the others.
How to find them? I thought about some kind of a histogram, but I
found a better way.
I'll attach the function here. Call it after ME to see how it works -
or before ME if max_bframes >=0 OR after reading hinted ME data.

> Do you have any fixed test clips in mind such we can compare results?
> I guess the Matrix Lobby scene isn't too bad, agreed, but we should have
> other material, too.

Well I made myself some clips (from hq divx, resized, stored in
lossless codec) and I'm using them for all my tests...

> It may be more fun in the beginning, but it's also dangerous because you
> might follow tracks that were proven to be bad. So if you want to have
> one or two good general papers, just tell me.
> I won't tell you the URLs right now so you have a choice to say "no" ;-)

No, I'm not saying 'no'. Sure, gemme URLs.

Radek

PS Ah right, the code. attaching now
Oh, I just remembered - P/B/I decision needs to be fixed a bit to work
with it (pMB-> mode needs to be set to INTER if it found a vector, or
INTRA if deviation was bigger then SAD. It wasn't important for the
function before).
Ah, ask me what the code does (ie how) 'cause I really want to send
this mail NOW ;)
------------9E1851103F01E877
Content-Type: text/plain; name="gmc.txt"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="gmc.txt"

DQpWRUNUT1INCkdsb2JhbE1vdGlvbkVzdChjb25zdCBNQUNST0JMT0NLICogY29uc3QgcE1Ccywg
Y29uc3QgTUJQYXJhbSAqIGNvbnN0IHBQYXJhbSwgY29uc3QgdWludDMyX3QgaUZjb2RlKQ0Kew0K
DQoJaW50IGNvdW50LCBiZXN0Y291bnQgPSAwOw0KCW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