12 * We only have room in the key for a maximum of 20 identifiers.
13 * We therefore choose to keep the top 20 bands --- these will
14 * be the most important ones, since this pass is performed after
15 * the threshold and standard deviation passes. If there are more
16 * than 20 bands, the excess are gathered together as an "OTHER" ]
17 * band which appears as band 20.
35 if (i <= TWENTY) return; /* nothing to do! */
37 other = (floatish*) xmalloc(nsamples * sizeof(floatish));
38 /* build a list of samples for "OTHER" */
40 compact = (i - TWENTY) + 1;
42 for (i = 0; i < nsamples; i++) {
46 for (i = 0; i < compact && i < nidents; i++) {
47 for (ch = identtable[i]->chk; ch; ch = ch->next) {
48 for (j = 0; j < ch->nd; j++) {
49 bucket = ch->d[j].bucket;
50 value = ch->d[j].value;
51 if (bucket >= nsamples)
52 Disaster("bucket out of range");
53 other[ bucket ] += value;
58 en = MakeEntry("OTHER");
61 for (i = 0; i < nsamples; i++) {
62 StoreSample(en, i, other[i]);
65 /* slide samples down */
66 for (i = compact; i < nidents; i++) {
67 identtable[i-compact+1] = identtable[i];