| 106 | // ----------------------------------------------------------------------- |
| 107 | |
| 108 | void initnet(ILubyte *thepic, ILint len, ILint sample) |
| 109 | { |
| 110 | ILint i; |
| 111 | ILint *p; |
| 112 | |
| 113 | thepicture = thepic; |
| 114 | lengthcount = len; |
| 115 | samplefac = sample; |
| 116 | |
| 117 | for (i=0; i<netsizethink; i++) { |
| 118 | p = network[i]; |
| 119 | p[0] = p[1] = p[2] = (i << (netbiasshift+8))/netsize; |
| 120 | freq[i] = intbias/netsizethink; // 1/netsize |
| 121 | bias[i] = 0; |
| 122 | } |
| 123 | return; |
| 124 | } |
| 125 | |
| 126 | |
| 127 | // Unbias network to give byte values 0..255 and record position i to prepare for sort |