MCPcopy Create free account
hub / github.com/HiLab-git/SimpleCRF / flog2

Function flog2

dependency/densecrf/examples/lodepng.cpp:5195–5201  ·  view source on GitHub ↗

log2 approximation. A slight bit faster than std::log. */

Source from the content-addressed store, hash-verified

5193
5194/* log2 approximation. A slight bit faster than std::log. */
5195static float flog2(float f)
5196{
5197 float result = 0;
5198 while(f > 32) { result += 4; f /= 16; }
5199 while(f > 2) { ++result; f /= 2; }
5200 return result + 1.442695f * (f * f * f / 3 - 3 * f * f / 2 + 3 * f - 1.83333f);
5201}
5202
5203static unsigned filter(unsigned char* out, const unsigned char* in, unsigned w, unsigned h,
5204 const LodePNGColorMode* info, const LodePNGEncoderSettings* settings)

Callers 1

filterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected