17.11.2012 Views

Numerical recipes

Numerical recipes

Numerical recipes

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

}<br />

20.4 Huffman Coding and Compression of Data 907<br />

*ilong=j-1;<br />

}<br />

}<br />

free_lvector(nprob,1,(long)(2*hcode->nch-1));<br />

free_lvector((unsigned long *)up,1,(long)(2*hcode->nch-1));<br />

free_lvector(index,1,(long)(2*hcode->nch-1));<br />

void hufapp(unsigned long index[], unsigned long nprob[], unsigned long n,<br />

unsigned long i)<br />

Used by hufmak to maintain a heap structure in the array index[1..l].<br />

{<br />

unsigned long j,k;<br />

}<br />

k=index[i];<br />

while (i >1)) {<br />

if ((j = i nprob[index[j+1]]) j++;<br />

if (nprob[k]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!