Lines Matching refs:size
108 * @dict_max: Maximum size of the LZMA2 dictionary (history buffer) for
117 * dict_max specifies the maximum allowed dictionary size that xz_dec_run()
118 * may allocate once it has parsed the dictionary size from the stream
176 uint32_t xz_crc32(const uint8_t *buf, size_t size, uint32_t crc)
180 while (size != 0) {
182 --size;
320 #define memeq(a, b, size) (memcmp(a, b, size) == 0)
366 * could save a few bytes in code size.
454 size_t size;
499 static size_t bcj_x86(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
514 if (size <= 4)
517 size -= 4;
518 for (i = 0; i < size; ++i) {
571 static size_t bcj_powerpc(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
576 for (i = 0; i + 4 <= size; i += 4) {
592 static size_t bcj_ia64(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
633 for (i = 0; i + 16 <= size; i += 16) {
676 static size_t bcj_arm(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
681 for (i = 0; i + 4 <= size; i += 4) {
699 static size_t bcj_armthumb(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
704 for (i = 0; i + 4 <= size; i += 2) {
727 static size_t bcj_sparc(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
732 for (i = 0; i + 4 <= size; i += 4) {
757 uint8_t *buf, size_t *pos, size_t size)
762 size -= *pos;
767 filtered = bcj_x86(s, buf, size);
772 filtered = bcj_powerpc(s, buf, size);
777 filtered = bcj_ia64(s, buf, size);
782 filtered = bcj_arm(s, buf, size);
787 filtered = bcj_armthumb(s, buf, size);
792 filtered = bcj_sparc(s, buf, size);
819 s->temp.size -= copy_size;
820 memmove(s->temp.buf, s->temp.buf + copy_size, s->temp.size);
856 * This needs to be always run when temp.size == 0 to handle a special
860 if (s->temp.size < b->out_size - b->out_pos || s->temp.size == 0) {
862 memcpy(b->out + b->out_pos, s->temp.buf, s->temp.size);
863 b->out_pos += s->temp.size;
880 s->temp.size = b->out_pos - out_start;
881 b->out_pos -= s->temp.size;
882 memcpy(s->temp.buf, b->out + b->out_pos, s->temp.size);
889 if (b->out_pos + s->temp.size < b->out_size)
907 b->out_pos = s->temp.size;
912 s->temp.size = b->out_pos;
920 bcj_apply(s, s->temp.buf, &s->temp.filtered, s->temp.size);
928 s->temp.filtered = s->temp.size;
971 s->temp.size = 0;
1202 * end == size
1203 * size <= size_max
1204 * allocated <= size
1229 /* End of the dictionary buffer. This is the same as the dictionary size. */
1237 uint32_t size;
1240 * Maximum allowed dictionary size.
1384 /* Next position after decoding the compressed size of the chunk. */
1387 /* Uncompressed size of LZMA chunk (2 MiB at maximum) */
1391 * Compressed size of LZMA chunk or compressed/uncompressed
1392 * size of uncompressed chunk (64 KiB at maximum)
1411 * The order below is important on x86 to reduce code size and
1429 uint32_t size;
1499 if (dist >= dict->full || dist >= dict->size) return 0;
1994 if (s->temp.size > 0 || s->lzma2.compressed == 0) {
1995 tmp = 2 * LZMA_IN_REQUIRED - s->temp.size;
1996 if (tmp > s->lzma2.compressed - s->temp.size)
1997 tmp = s->lzma2.compressed - s->temp.size;
2001 memcpy(s->temp.buf + s->temp.size, b->in + b->in_pos, tmp);
2003 if (s->temp.size + tmp == s->lzma2.compressed) {
2004 memset(s->temp.buf + s->temp.size + tmp, 0,
2006 - s->temp.size - tmp);
2007 s->rc.in_limit = s->temp.size + tmp;
2008 } else if (s->temp.size + tmp < LZMA_IN_REQUIRED) {
2009 s->temp.size += tmp;
2013 s->rc.in_limit = s->temp.size + tmp - LZMA_IN_REQUIRED;
2019 if (!lzma_main(s) || s->rc.in_pos > s->temp.size + tmp)
2024 if (s->rc.in_pos < s->temp.size) {
2025 s->temp.size -= s->rc.in_pos;
2027 s->temp.size);
2031 b->in_pos += s->rc.in_pos - s->temp.size;
2032 s->temp.size = 0;
2061 s->temp.size = in_avail;
2102 * uncompressed size (bits 16-20).
2224 && s->temp.size
2259 /* This limits dictionary size to 3 GiB to keep parsing simpler. */
2263 s->dict.size = 2 + (props & 1);
2264 s->dict.size <<= (props >> 1) + 11;
2266 if (s->dict.size > s->dict.size_max)
2269 s->dict.end = s->dict.size;
2271 if (s->dict.allocated < s->dict.size) {
2273 s->dict.buf = malloc(s->dict.size);
2285 s->temp.size = 0;
2319 * in code size (no effect on speed). Doing so limits the uncompressed and
2320 * compressed size of the file to less than 256 MiB and may also weaken
2328 /* Maximum encoded size of a VLI */
2404 uint32_t size;
2409 /* Observed compressed size of the current Block */
2412 /* Observed uncompressed size of the current Block */
2435 vli_type size;
2456 size_t size;
2482 * s->temp.size.
2486 size_t copy_size = minof(b->in_size - b->in_pos, s->temp.size - s->temp.pos);
2492 if (s->temp.pos == s->temp.size) {
2575 size_t size = b->out_pos - s->out_start;
2577 while (size) {
2579 --size;
2595 s->block.hash.unpadded += s->block_header.size
2611 /* Update the Index size and the CRC32 value. */
2615 s->index.size += in_used;
2757 * Validate Backward Size. Note that we never added the size of the
2758 * Index CRC32 field to s->index.size, thus we use s->index.size / 4
2759 * instead of s->index.size / 4 - 1.
2761 if ((s->index.size >> 2) != get_le32(s->temp.buf + 4))
2783 s->temp.size -= 4;
2784 if (xz_crc32(s->temp.buf, s->temp.size, 0)
2785 != get_le32(s->temp.buf + s->temp.size))
2803 if (dec_vli(s, s->temp.buf, &s->temp.pos, s->temp.size)
2814 if (dec_vli(s, s->temp.buf, &s->temp.pos, s->temp.size)
2827 if (s->temp.size - s->temp.pos < 2)
2844 if (s->temp.size - s->temp.pos < 2)
2855 /* Filter Properties contains LZMA2 dictionary size. */
2856 if (s->temp.size - s->temp.pos < 1)
2864 while (s->temp.pos < s->temp.size)
2925 * Calculate the size of the Block Header and
2928 s->block_header.size
2931 s->temp.size = s->block_header.size;
2957 * anymore, so we use it here to test the size
2998 while ((s->index.size + (b->in_pos - s->in_start))
3009 /* Finish the CRC32 value and Index size. */
3024 s->temp.size = STREAM_HEADER_SIZE;
3122 s->temp.size = STREAM_HEADER_SIZE;