:: Re: [Frei0r] [PATCH] Add "colgate",…
Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Steinar H. Gunderson
Fecha:  
A: Minimalistic plugin API for video effects
Asunto: Re: [Frei0r] [PATCH] Add "colgate", a new color correction plugin.
On Wed, Sep 19, 2012 at 10:57:28AM -0700, Dan Dennedy wrote:
> a couple of other plugins are doing:
>
> #if defined(_MSC_VER)
> __inline const long int lrintf(float x){
>         return (long int)(x+0.5);
> }
> #endif /* _MSC_VER */


That is wrong, though; it is mis-rounding both negative numbers (like -0.7)
and some positive numbers (like 0.5). It is also slow (exactly how slow
depends on the instruction set available; with SSE, it's okay-ish,
but on x87, it involves fiddling with the control word).

The “const” seems redundant, by the way.

> Do you want to provide an update with that?


For colgate, we can probably live with a wrong-and-slow lrintf() replacement,
so if it helps you, I can include that, sure.

/* Steinar */
--
Homepage: http://www.sesse.net/