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 hh, *dbuf = bw->dbuf; in read_huffman_data()
332 byteCount = bw->byteCount; in read_huffman_data()
437 if (bw->origPtr >= (bw->writeCount = dbufCount)) return RETVAL_DATA_ERROR; in read_huffman_data()
452 static void burrows_wheeler_prep(struct bunzip_data *bd, struct bwdata *bw) in burrows_wheeler_prep() argument
455 unsigned int *dbuf = bw->dbuf; in burrows_wheeler_prep()
456 int *byteCount = bw->byteCount; in burrows_wheeler_prep()
468 for (ii=0; ii < bw->writeCount; ii++) { in burrows_wheeler_prep()
478 bw->dataCRC = 0xffffffffL; in burrows_wheeler_prep()
484 if (bw->writeCount) { in burrows_wheeler_prep()
485 bw->writePos = dbuf[bw->origPtr]; in burrows_wheeler_prep()
486 bw->writeCurrent = (unsigned char)bw->writePos; in burrows_wheeler_prep()
487 bw->writePos >>= 8; in burrows_wheeler_prep()
488 bw->writeRun = -1; in burrows_wheeler_prep()
512 static int write_bunzip_data(struct bunzip_data *bd, struct bwdata *bw, in write_bunzip_data() argument
515 unsigned int *dbuf = bw->dbuf; in write_bunzip_data()
520 if (bw->writeCount < 0) return bw->writeCount; in write_bunzip_data()
523 if (!bw->writeCount) { in write_bunzip_data()
527 bw->writeCount = i; in write_bunzip_data()
534 count = bw->writeCount; in write_bunzip_data()
535 pos = bw->writePos; in write_bunzip_data()
536 current = bw->writeCurrent; in write_bunzip_data()
537 run = bw->writeRun; in write_bunzip_data()
566 bw->dataCRC = (bw->dataCRC << 8) in write_bunzip_data()
567 ^ bd->crc32Table[(bw->dataCRC >> 24) ^ outbyte]; in write_bunzip_data()
573 bw->dataCRC = ~(bw->dataCRC); in write_bunzip_data()
574 bd->totalCRC = ((bd->totalCRC << 1) | (bd->totalCRC >> 31)) ^ bw->dataCRC; in write_bunzip_data()
577 if (bw->dataCRC != bw->headerCRC) { in write_bunzip_data()
578 bd->totalCRC = bw->headerCRC+1; in write_bunzip_data()
583 bw->writeCount = count; in write_bunzip_data()
592 bw->writePos = pos; in write_bunzip_data()
593 bw->writeCurrent = current; in write_bunzip_data()
594 bw->writeRun = run; in write_bunzip_data()