rEFIt_UEFI/libeg/lodepng.cpp
/*
returns the code. The bit reader must already have been ensured at least 15 bits
*/
returns the code. The bit reader must already have been ensured at least 15 bits
returns the code . The bit reader must already have been ensured at least 15 bits
static unsigned huffmanDecodeSymbol(LodePNGBitReader* reader, const HuffmanTree* codetree) {
  unsigned short code = peekBits(reader, FIRSTBITS);
  unsigned short l = codetree->table_len[code];
  unsigned short value = codetree->table_value[code];
  if(l <= FIRSTBITS) {
    advanceBits(reader, l);
    return value;
  } else {
    unsigned index2;
    advanceBits(reader, FIRSTBITS);
    index2 = value + peekBits(reader, l - FIRSTBITS);
    advanceBits(reader, codetree->table_len[index2] - FIRSTBITS);
    return codetree->table_value[index2];
  }
}
static unsigned huffmanDecodeSymbol ( LodePNGBitReader * reader , const HuffmanTree * codetree ) { unsigned short code = peekBits ( reader , FIRSTBITS ) ; unsigned short l = codetree -> table_len [ code ] ; unsigned short value = codetree -> table_value [ code ] ; if ( l <= FIRSTBITS ) { advanceBits ( reader , l ) ; return value ; } else { unsigned index2 ; advanceBits ( reader , FIRSTBITS ) ; index2 = value + peekBits ( reader , l - FIRSTBITS ) ; advanceBits ( reader , codetree -> table_len [ index2 ] - FIRSTBITS ) ; return codetree -> table_value [ index2 ] ; } }
returns the code.
returns the code .