[XviD-devel] Most frequent motion vector?

Michael Niedermayer michaelni at gmx.at
Sat Oct 4 11:48:15 CEST 2003


Hi

On Saturday 04 October 2003 10:07, Christoph Lampert wrote:
> Hi guys,
>
> I should have studied computer science instead of maths:
>
> Is there a fast and not too wasteful method to determine which is the most
> frequent motion vector of a XxY field of motion vectors?
sort them using (x + 1024*y) or similar
after that all equal vectors will be together, counting the number of 
occurances and finding the max is trivial after that
and sorting can be done in O(n) time (with radix sort) so this is pretty fast
or u could use qsort() from libc ...

[...]
-- 
Michael
level[i]= get_vlc(); i+=get_vlc();		(violates patent EP0266049)
median(mv[y-1][x], mv[y][x-1], mv[y+1][x+1]);	(violates patent #5,905,535)
buf[i]= qp - buf[i-1];				(violates patent #?)
for more examples, see http://mplayerhq.hu/~michael/patent.html
stop it, see http://petition.eurolinux.org & http://petition.ffii.org/eubsa/en


More information about the XviD-devel mailing list