[MPlayer-dev-eng] rgb<->yuv convertion question

Jonas Jensen jbj at knef.dk
Thu Jan 15 10:05:22 CET 2004


On Thu, 2004-01-15 at 01:59, mayaray wrote:
> so how can i clamp and use fixed point in vc using c++?
> should i write the clamp function?

Yes. Here's an example from the bmovl code:
#define INRANGE(a,b,c)  ( ((a) < (b)) ? (b) : ( ((a) > (c)) ? (c) : (a) ) )

You might want to make it an inline function instead of a macro.

> i can only find fixed point type in opengl and asm, does it 
> exist in c++?

It's called an int, and that's what you should be using in any
calculation that requires speed. And if you've never heard of the int,
you might want to equip yourself with a beginner's C/C++ book and start
over.

-- 
Jonas Jensen <jbj at knef.dk>




More information about the MPlayer-dev-eng mailing list