[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[E-devel] Re: E CVS: proto moom



> 
> just for information, here is the page of Michael Niedermayer (ffmpeg
> lead dev) about optimization :
> 
> http://guru.multimedia.cx/category/optimization/
> 
> maybe it can help
> 
> Vincent
> 

	Could be a useful reference to have around.. 
especially for those, like me, who often get their bits&bytes
confused... 
	Many years ago, I once attended my one-and-only ever
'computer science' class, and the only thing I could remember
from that was some kind of 'mantra' that went something like
"eight bits in a byte.. eight bits in a byte.."
	Unfortunately, I often ended up reversing the mantra
for some reason.. and I still do to this day.

	Thanks for the pointer :)

	Interesting the method mentioned there for computing
max and min.

whereas I had, for a,b in the range [0,255],
min(a,b) = b - ((b-a)&(~(b-a)>>8));
and
max(a,b) = a + ((b-a)&(~(b-a)>>8));

the page there uses,
min(a,b) = a + ((b-a)&((b-a)>>31));
and
max(a,b) = b - ((b-a)&((b-a)>>31));

which presumably works for a greater range of values..
that could be useful.

	In the particular case of the 'rgb2hsv' function,
the two methods give statistically identical results in
measurable performance (all else being the same). But again,
this could be useful in other contexts.

	I'll tell you what could be even more useful:
If said "multimedia guru" would take a short break from working
on 'ffmpeg' (whatever that is, it doesn't sound very cosmic),
and maybe seek out some "enlightenment" instead :) :)

    jose.