1
|
1 // code from xanim sources...
|
|
2 // (I hope that not hurt copyright :o)
|
|
3
|
|
4 #define xaLONG long
|
|
5 #define xaULONG unsigned long
|
|
6 #define xaBYTE char
|
|
7 #define xaUBYTE unsigned char
|
|
8
|
|
9 xaULONG long xa_alaw_2_sign[256];
|
|
10
|
|
11 void Gen_aLaw_2_Signed()
|
|
12 { xaULONG i;
|
|
13 for(i=0;i<256;i++)
|
|
14 { xaUBYTE data = (xaUBYTE)(i);
|
|
15 xaLONG d, t, seg;
|
|
16
|
|
17 data ^= 0x55;
|
|
18
|
|
19 t = (data & 0xf) << 4;
|
|
20 seg = (data & 0x70) >> 4;
|
|
21 if (seg == 0) t += 8;
|
|
22 else if (seg == 1) t += 0x108;
|
|
23 else { t += 108; t <<= seg - 1; }
|
|
24
|
|
25 d = (data & 0x80)?(t):(-t);
|
|
26 xa_alaw_2_sign[i] = (xaULONG)((xaULONG)(d) & 0xffff);
|
|
27 }
|
|
28 }
|
|
29
|