MCPcopy Create free account
hub / github.com/VirtualGL/virtualgl / initBuf

Function initBuf

util/fbxvtest.c:51–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49
50
51static void initBuf(fbxv_struct *fb, int id, int seed)
52{
53 int i, j, c;
54 int yindex0, yindex1, uindex, vindex;
55
56 switch(id)
57 {
58 case YUY2_PACKED:
59 yindex0 = 0; uindex = 1; yindex1 = 2; vindex = 3; break;
60 case UYVY_PACKED:
61 uindex = 0; yindex0 = 1; vindex = 2; yindex1 = 3; break;
62 default:
63 yindex0 = yindex1 = uindex = vindex = 0; break;
64 }
65 if(id == YUY2_PACKED || id == UYVY_PACKED)
66 {
67 for(j = 0; j < fb->xvi->height; j++)
68 {
69 for(i = 0; i < fb->xvi->width; i += 2)
70 {
71 fb->xvi->data[fb->xvi->pitches[0] * j + i * 2 + yindex0] =
72 (j + seed) * (i + seed);
73 fb->xvi->data[fb->xvi->pitches[0] * j + i * 2 + yindex1] =
74 (j + seed + 1) * (i + seed + 1);
75 fb->xvi->data[fb->xvi->pitches[0] * j + i * 2 + uindex] =
76 (j + seed) * (i + seed);
77 fb->xvi->data[fb->xvi->pitches[0] * j + i * 2 + vindex] =
78 (j + seed) * (i + seed);
79 }
80 }
81 }
82 else
83 {
84 for(c = 0; c < fb->xvi->num_planes; c++)
85 for(j = 0; j < fb->xvi->height; j++)
86 for(i = 0; i < fb->xvi->width; i++)
87 fb->xvi->data[fb->xvi->offsets[c] +
88 fb->xvi->pitches[c] * (c == 0 ? j : j / 2) +
89 (c == 0 ? i : i / 2)] = (j + seed) * (i + seed);
90 }
91}
92
93
94static int doTest(int id, char *name)

Callers 2

doTestFunction · 0.70
doInteractiveTestFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected