MCPcopy Create free account
hub / github.com/GPUOpen-Tools/compressonator / ep_find_floor

Function ep_find_floor

cmp_framework/common/hdr_encode.cpp:2265–2284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2263}
2264
2265int ep_find_floor(float v, int bits, int use_par, int odd) {
2266#ifndef USE_NEWRAMP
2267 float *p = ep_d[BTT(bits)];
2268#endif
2269 int i1 = 0;
2270 int i2 = 1 << (bits - use_par);
2271 odd = use_par ? odd : 0;
2272 while (i2 - i1>1) {
2273 int j = (i1 + i2) / 2;
2274#ifndef USE_NEWRAMP
2275 if (v >= p[(j << use_par) + odd])
2276#else
2277 if (v >= ep_df(BTT(bits), (j << use_par) + odd))
2278#endif
2279 i1 = j;
2280 else
2281 i2 = j;
2282 }
2283 return (i1 << use_par) + odd;
2284}
2285
2286
2287

Callers 1

ep_shaker_2_dFunction · 0.70

Calls 1

ep_dfFunction · 0.85

Tested by

no test coverage detected