Lines Matching refs:chunk
529 int TryReconstruction(ImageChunk* chunk, unsigned char* out) { in TryReconstruction() argument
534 chunk->level, chunk->method, chunk->windowBits, in TryReconstruction()
535 chunk->memLevel, chunk->strategy); in TryReconstruction()
542 strm.avail_in = chunk->len; in TryReconstruction()
543 strm.next_in = chunk->data; in TryReconstruction()
545 ret = deflateInit2(&strm, chunk->level, chunk->method, chunk->windowBits, in TryReconstruction()
546 chunk->memLevel, chunk->strategy); in TryReconstruction()
553 if (memcmp(out, chunk->deflate_data+p, have) != 0) { in TryReconstruction()
561 if (p != chunk->deflate_len) { in TryReconstruction()
574 int ReconstructDeflateChunk(ImageChunk* chunk) { in ReconstructDeflateChunk() argument
575 if (chunk->type != CHUNK_DEFLATE) { in ReconstructDeflateChunk()
585 for (chunk->level = 6; chunk->level <= 9; chunk->level += 3) { in ReconstructDeflateChunk()
586 chunk->windowBits = -15; // 32kb window; negative to indicate a raw stream. in ReconstructDeflateChunk()
587 chunk->memLevel = 8; // the default value. in ReconstructDeflateChunk()
588 chunk->method = Z_DEFLATED; in ReconstructDeflateChunk()
589 chunk->strategy = Z_DEFAULT_STRATEGY; in ReconstructDeflateChunk()
591 if (TryReconstruction(chunk, out) == 0) { in ReconstructDeflateChunk()