PostGIS  3.0.0dev-r@@SVN_REVISION@@

◆ uint32_interleave_2()

static uint64_t uint32_interleave_2 ( uint32_t  u1,
uint32_t  u2 
)
static

Definition at line 227 of file g_serialized.c.

References pixval::x, and pixval::y.

Referenced by gbox_get_sortable_hash(), and gserialized_cmp().

228 {
229  uint64_t x = u1;
230  uint64_t y = u2;
231  int i;
232 
233  static uint64_t B[5] =
234  {
235  0x5555555555555555,
236  0x3333333333333333,
237  0x0F0F0F0F0F0F0F0F,
238  0x00FF00FF00FF00FF,
239  0x0000FFFF0000FFFF
240  };
241  static uint64_t S[5] = { 1, 2, 4, 8, 16 };
242 
243  for ( i = 4; i >= 0; i-- )
244  {
245  x = (x | (x << S[i])) & B[i];
246  y = (y | (y << S[i])) & B[i];
247  }
248 
249  return x | (y << 1);
250 }
Here is the caller graph for this function: