rEFIt_UEFI/libeg/lodepng.cpp
/*
given the code lengths (as stored in the PNG file), generate the tree as defined
by Deflate. maxbitlen is the maximum bits that a code in the tree can have.
return value is error.
*/
given the code lengths (as stored in the PNG file), generate the tree as defined
by Deflate. maxbitlen is the maximum bits that a code in the tree can have.
return value is error.
given the code lengths ( as stored in the PNG file ) generate the tree as defined by Deflate . maxbitlen is the maximum bits that a code in the tree can have . return value is error .
static unsigned HuffmanTree_makeFromLengths(HuffmanTree* tree, const unsigned* bitlen,
                                            size_t numcodes, unsigned maxbitlen) {
  tree->lengths = (unsigned*)AllocateCopyPool(numcodes * sizeof(unsigned), (const void*)bitlen);
  if(!tree->lengths) return 83; 
  tree->numcodes = (unsigned)numcodes; 
  tree->maxbitlen = maxbitlen;
  return HuffmanTree_makeFromLengths2(tree);
}
static unsigned HuffmanTree_makeFromLengths ( HuffmanTree * tree , const unsigned * bitlen , size_t numcodes , unsigned maxbitlen ) { tree -> lengths = ( unsigned * ) AllocateCopyPool ( numcodes * sizeof ( unsigned ) , ( const void * ) bitlen ) ; if ( ! tree -> lengths ) return 83 ; tree -> numcodes = ( unsigned ) numcodes ; tree -> maxbitlen = maxbitlen ; return HuffmanTree_makeFromLengths2 ( tree ) ; }
given the code lengths (as stored in the PNG file), generate the tree as defined
by Deflate.
given the code lengths ( as stored in the PNG file ) generate the tree as defined by Deflate .
//  unsigned i; //  tree->lengths = (unsigned*)lodepng_malloc(numcodes * sizeof(unsigned)); /*alloc fail*/ //  for(i = 0; i != numcodes; ++i) tree->lengths[i] = bitlen[i]; /*number of symbols*/