MCPcopy Create free account
hub / github.com/crownengine/crown / bitRangeConvert

Function bitRangeConvert

3rdparty/bimg/src/image.cpp:1379–1393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1377 }
1378
1379 static uint8_t bitRangeConvert(uint32_t _in, uint32_t _from, uint32_t _to)
1380 {
1381 using namespace bx;
1382 uint32_t tmp0 = uint32_sll(1, _to);
1383 uint32_t tmp1 = uint32_sll(1, _from);
1384 uint32_t tmp2 = uint32_dec(tmp0);
1385 uint32_t tmp3 = uint32_dec(tmp1);
1386 uint32_t tmp4 = uint32_mul(_in, tmp2);
1387 uint32_t tmp5 = uint32_add(tmp3, tmp4);
1388 uint32_t tmp6 = uint32_srl(tmp5, _from);
1389 uint32_t tmp7 = uint32_add(tmp5, tmp6);
1390 uint32_t result = uint32_srl(tmp7, _from);
1391
1392 return uint8_t(result);
1393 }
1394
1395 static void decodeBlockDxt(uint8_t _dst[16*4], const uint8_t _src[8])
1396 {

Callers 13

decodeBlockDxtFunction · 0.85
decodeBlockDxt1Function · 0.85
decodeBlockDxt23AFunction · 0.85
decodeBlockBc7Function · 0.85
decodeBlockATCFunction · 0.85
decodeBlockEtc2ModeTFunction · 0.85
decodeBlockEtc2ModeHFunction · 0.85
decodeBlockEtc12Function · 0.85
decodeBlockPtc14RgbAddAFunction · 0.85
decodeBlockPtc14RgbAddBFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected