:: [Frei0r] Add fast char-float-char c…
Pàgina inicial
Delete this message
Reply to this message
Autor: Marko Cebokli
Data:  
A: Minimalistic plugin API for video effects
Assumptes vells: Re: [Frei0r] Review Request: Light Graffiti with SSE
Assumpte: [Frei0r] Add fast char-float-char conversion functions with gamma correction
Hello,

I have added a bunch of table based functions for fast char/float/char
conversion, which can also simultaneosly do almost arbitrary gama->linear and
back conversions.

I plan to change the existing plugins which work with float, to use these
functions, and of course use them in future plugins.

This way, we can have liear color space processing, which was discussed here
recently, not only at zero cost, but even with some speed gain, as I have
found that these functions are faster than the usual

out[i].r=f1*(float)*cin++;
and
*cout++=(uint8_t)(in[i].r*255.0);

The new float to char conversion can also take ANY floating value as input and
return a valid 0...255, thus removing the need for [0...1] range checking in
the float domain, making further speed improvements possible.

Marko Cebokli