initial import
[ICEs.git] / 195695 / xorg.i.6
1 typedef unsigned long long Fx64;
2 static void fxt1_quantize_ALPHA1(void)
3 {
4 unsigned int *cc;
5 const int n_vect = 3;
6 const int n_comp = 4;
7 float vec[1 + 1 + 1][4];
8 int i;
9 int j;
10 int k;
11 Fx64 hi;
12 int j1;
13 int j2;
14 int v1 = 0;
15 int v2 = 0;
16 float err = 1e9;
17 float tv[2 * 2][4];
18 for (j1 = 0; j1 < 2; j1++) {
19 for (j2 = 2; j2 < 4; j2++) {
20 float e = 0.0F;
21 for (i = 0; i < n_comp; i++) {
22 e += (tv[j1][i] - tv[j2][i]) * (tv[j1][i] -
23 tv[j2][i]);
24 }
25 if (e < err)
26 v1 = j1;
27 }
28 }
29 for (i = 0; i < n_comp; i++)
30 vec[0][i] = tv[1 - v1][i];
31 for (j = n_vect - 1; j >= 0; j--)
32 for (i = 0; i < n_comp - 1; i++)
33 hi |= (unsigned int) (vec[j][i] / 8.0F);
34 ((Fx64 *) cc)[1] = hi;
35 }
36 void *structfoo = fxt1_quantize_ALPHA1;