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

Function EncodeSelectors

3rdparty/bimg/3rdparty/etc2/ProcessRGB.cpp:654–675  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

652
653template<class T, class S>
654uint64 EncodeSelectors( uint64 d, const T terr[2][8], const S tsel[16][8], const uint32* id, const uint64 value, const uint64 error)
655{
656 size_t tidx[2];
657 tidx[0] = GetLeastError( terr[0], 8 );
658 tidx[1] = GetLeastError( terr[1], 8 );
659
660 if ((terr[0][tidx[0]] + terr[1][tidx[1]]) >= error)
661 {
662 return value;
663 }
664
665 d |= tidx[0] << 26;
666 d |= tidx[1] << 29;
667 for( int i=0; i<16; i++ )
668 {
669 uint64 t = tsel[i][tidx[id[i]%2]];
670 d |= ( t & 0x1 ) << ( i + 32 );
671 d |= ( t & 0x2 ) << ( i + 47 );
672 }
673
674 return FixByteOrder(d);
675}
676}
677
678uint64 ProcessRGB( const uint8* src )

Callers 2

ProcessRGBFunction · 0.70
ProcessRGB_ETC2Function · 0.70

Calls 2

GetLeastErrorFunction · 0.85
FixByteOrderFunction · 0.85

Tested by

no test coverage detected