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

Function EncodeAverages

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

Source from the content-addressed store, hash-verified

265}
266
267void EncodeAverages( uint64& _d, const v4i* a, size_t idx )
268{
269 uint64 d = _d;
270 d |= ( idx << 24 );
271 size_t base = idx << 1;
272
273 if( ( idx & 0x2 ) == 0 )
274 {
275 for( int i=0; i<3; i++ )
276 {
277 d |= uint64( a[base+0][i] >> 4 ) << ( i*8 );
278 d |= uint64( a[base+1][i] >> 4 ) << ( i*8 + 4 );
279 }
280 }
281 else
282 {
283 for( int i=0; i<3; i++ )
284 {
285 d |= uint64( a[base+1][i] & 0xF8 ) << ( i*8 );
286 int32 c = ( ( a[base+0][i] & 0xF8 ) - ( a[base+1][i] & 0xF8 ) ) >> 3;
287 c &= ~0xFFFFFFF8;
288 d |= ((uint64)c) << ( i*8 );
289 }
290 }
291 _d = d;
292}
293
294uint64 CheckSolid( const uint8* src )
295{

Callers 2

ProcessRGBFunction · 0.85
ProcessRGB_ETC2Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected