Lines Matching defs:huff
52 Vchuff_t *huff = vcgetmtdata(vc, Vchuff_t*);
54 huff->type = 0;
55 huff->maxs = 0;
57 { memcpy(huff->freq, freq, VCH_SIZE*sizeof(freq[0]));
58 huff->type |= VCH_HASFREQ;
61 { memcpy(huff->size, size, VCH_SIZE*sizeof(size[0]));
62 huff->maxs = maxs;
63 huff->type |= VCH_HASSIZE;
84 Vchuff_t *huff = vcgetmtdata(vc, Vchuff_t*);
85 ssize_t *freq = huff->freq;
86 ssize_t *size = huff->size;
87 Vcbit_t *bits = huff->bits;
93 if(!(huff->type&VCH_HASFREQ) )
96 huff->type = 0;
98 if(!(huff->type&VCH_HASSIZE) &&
99 (huff->maxs = vchsize(VCH_SIZE,freq,size,NIL(int*))) < 0)
101 huff->type = 0;
104 if(huff->maxs > 0)
117 huff->maxs = vchbits(VCH_SIZE, size, bits); /* compute bits per byte */
119 vcioputc(&io, huff->maxs); /* the control code */
123 if(huff->maxs == 0) /* a single run */
127 if((s = vchputcode(VCH_SIZE, size, huff->maxs, vcionext(&io), vciomore(&io))) <= 0)
165 Vchuff_t *huff = vcgetmtdata(vc, Vchuff_t*);
188 { if((n = vchgetcode(VCH_SIZE, huff->size, sz, vcionext(&io), vciomore(&io))) < 0)
192 if(vchbits(VCH_SIZE, huff->size, huff->bits) < 0)
194 if(huff->trie)
195 vchdeltrie(huff->trie);
196 if(!(huff->trie = vchbldtrie(VCH_SIZE, huff->size, huff->bits)) )
198 node = huff->trie->node;
199 size = huff->trie->size;
200 ntop = huff->trie->ntop;
241 Vchuff_t *huff;
244 { if(!(huff = (Vchuff_t*)malloc(sizeof(Vchuff_t))) )
246 huff->trie = NIL(Vchtrie_t*);
247 huff->maxs = 0;
248 huff->type = 0;
249 vcsetmtdata(vc, huff);
253 { if((huff = vcgetmtdata(vc, Vchuff_t*)) )
254 { if(huff->trie)
255 vchdeltrie(huff->trie);
256 free(huff);