Lines Matching refs:hbuf
537 static inline void huffbuff_init(struct huffbuff *hbuf, uint8_t *buf, uint32_t buf_len) in huffbuff_init() argument
539 memset(hbuf, 0, sizeof(struct huffbuff)); in huffbuff_init()
540 hbuf->buf = buf; in huffbuff_init()
541 hbuf->buf_len = buf_len; in huffbuff_init()
544 static inline int huffbuff_bits(struct huffbuff *hbuf, uint8_t nbits) in huffbuff_bits() argument
552 if (hbuf->cur_byte >= hbuf->buf_len) { in huffbuff_bits()
557 if (hbuf->buf[hbuf->cur_byte] & (0x80 >> hbuf->cur_bit)) in huffbuff_bits()
560 if (++hbuf->cur_bit > 7) { in huffbuff_bits()
561 hbuf->cur_byte++; in huffbuff_bits()
562 hbuf->cur_bit = 0; in huffbuff_bits()
622 static int huffman_decode_uncompressed(struct huffbuff *hbuf, in huffman_decode_uncompressed() argument
627 while(hbuf->cur_byte < hbuf->buf_len) { in huffman_decode_uncompressed()
629 if ((c = huffbuff_bits(hbuf, 8)) < 0) in huffman_decode_uncompressed()
660 struct huffbuff hbuf; in huffman_decode() local
667 huffbuff_init(&hbuf, src, srclen); in huffman_decode()
669 while(hbuf.cur_byte < hbuf.buf_len) { in huffman_decode()
671 if ((bit = huffbuff_bits(&hbuf, 1)) < 0) in huffman_decode()
687 huffman_decode_uncompressed(&hbuf, in huffman_decode()