1// { dg-do compile }
2
3void
4filter_scanlines (void *src_buffer, void *dst_buffer, int dst_pitch, int width)
5{
6  int x;
7  unsigned short *src, *dst_a, *dst_b;
8
9  src = (unsigned short *) src_buffer;
10  dst_a = (unsigned short *) dst_buffer;
11  dst_b = ((unsigned short *) dst_buffer) + (dst_pitch >> 1);
12
13  for (x = 0; x < width; x++)
14    {
15      unsigned char gs, gh;
16      gs = src[x];
17      gh = gs + (gs >> 1);
18      dst_a[x] = (gh << 5) | (gh);
19      dst_b[x] = ((gs  - gh) << 5)  | (gs  - gh);
20    }
21}
22