Lines Matching refs:bw

161 static int read_block_header(struct bunzip_data *bd, struct bwdata *bw)  in read_block_header()  argument
170 bw->headerCRC = get_bits(bd,32); in read_block_header()
180 if ((bw->origPtr = get_bits(bd,24)) > bd->dbufSize) return RETVAL_DATA_ERROR; in read_block_header()
319 static int read_huffman_data(struct bunzip_data *bd, struct bwdata *bw) in read_huffman_data() argument
324 unsigned int *dbuf = bw->dbuf; in read_huffman_data()
332 byteCount = bw->byteCount; in read_huffman_data()
435 if (bw->origPtr >= (bw->writeCount = dbufCount)) return RETVAL_DATA_ERROR; in read_huffman_data()
450 static void burrows_wheeler_prep(struct bunzip_data *bd, struct bwdata *bw) in burrows_wheeler_prep() argument
453 unsigned int *dbuf = bw->dbuf; in burrows_wheeler_prep()
454 int *byteCount = bw->byteCount; in burrows_wheeler_prep()
469 for (ii=0; ii < bw->writeCount; ii++) { in burrows_wheeler_prep()
479 bw->dataCRC = 0xffffffffL; in burrows_wheeler_prep()
485 if (bw->writeCount) { in burrows_wheeler_prep()
486 bw->writePos = dbuf[bw->origPtr]; in burrows_wheeler_prep()
487 bw->writeCurrent = (unsigned char)bw->writePos; in burrows_wheeler_prep()
488 bw->writePos >>= 8; in burrows_wheeler_prep()
489 bw->writeRun = -1; in burrows_wheeler_prep()
513 static int write_bunzip_data(struct bunzip_data *bd, struct bwdata *bw, in write_bunzip_data() argument
516 unsigned int *dbuf = bw->dbuf; in write_bunzip_data()
521 if (bw->writeCount < 0) return bw->writeCount; in write_bunzip_data()
524 if (!bw->writeCount) { in write_bunzip_data()
528 bw->writeCount = i; in write_bunzip_data()
535 count = bw->writeCount; in write_bunzip_data()
536 pos = bw->writePos; in write_bunzip_data()
537 current = bw->writeCurrent; in write_bunzip_data()
538 run = bw->writeRun; in write_bunzip_data()
567 bw->dataCRC = (bw->dataCRC << 8) in write_bunzip_data()
568 ^ bd->crc32Table[(bw->dataCRC >> 24) ^ outbyte]; in write_bunzip_data()
574 bw->dataCRC = ~(bw->dataCRC); in write_bunzip_data()
575 bd->totalCRC = ((bd->totalCRC << 1) | (bd->totalCRC >> 31)) ^ bw->dataCRC; in write_bunzip_data()
578 if (bw->dataCRC != bw->headerCRC) { in write_bunzip_data()
579 bd->totalCRC = bw->headerCRC+1; in write_bunzip_data()
584 bw->writeCount = count; in write_bunzip_data()
593 bw->writePos = pos; in write_bunzip_data()
594 bw->writeCurrent = current; in write_bunzip_data()
595 bw->writeRun = run; in write_bunzip_data()