search for: clampfloattobyte

Displaying 1 result from an estimated 1 matches for "clampfloattobyte".

2005 Jun 22
1
Questions about efficiency.
...previous answers, now there was a question of efficiency. I use the formula of transformation YUV12->RGB: float r = nY + 1.371f * ( nV - 128 ); float g = nY - 0.698f * ( nV - 128 ) - 0.336f * ( nU - 128 ); float b = nY + 1.732f * ( nU - 128 ); frame[index + 0] = ClampFloatToByte( r ); frame[index + 1] = ClampFloatToByte( g ); frame[index + 2] = ClampFloatToByte( b ); frame[index + 3]= 255; But an execution time of this transformation on my computer of the order of 10-15 milliseconds - very long. After I have translated all calculations in integer...