SHARE
TWEET

Untitled

a guest Apr 21st, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. __kernel void diff_generator(__global unsigned char *image_a,
  2.     __global unsigned char *image_b, __global unsigned short *image_c, unsigned int range, unsigned int rangeMax)
  3. {
  4.     size_t gx = get_global_id(0);
  5.     size_t offset = range % rangeMax;
  6.     if (offset % gx != 0) return;
  7.    
  8.     size_t px32bit = gx * 4;
  9.     size_t px565 = gx;
  10.  
  11.     if (image_a[px32bit] == image_b[px32bit]) return;
  12.  
  13.     image_a[px32bit] = image_b[px32bit];
  14.     image_c[px565] = ((image_b[px32bit+2] & 0b11111000) << 8) | ((image_b[px32bit + 1] & 0b11111100) << 3) | (image_b[px32bit + 0] >> 3);
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top