]> wimlib.net Git - wimlib/blobdiff - src/lzx_compress.c
bt_matchfinder: remove unnecessary max_len parameter to skip routine
[wimlib] / src / lzx_compress.c
index 1bf1bf0970695382bedbe46f2e113c133f3db80d..19e2daa2a97de024115e4b65ff0097661cd05a73 100644 (file)
@@ -232,9 +232,10 @@ struct lzx_sequence {
        u16 adjusted_length;
 
        /* If bit 31 is clear, then this field contains the match header in bits
-        * 0-8 and the match offset minus LZX_OFFSET_ADJUSTMENT in bits 9-30.
-        * Otherwise, this sequence's literal run was the last literal run in
-        * the block, so there is no match that follows it.  */
+        * 0-8, and either the match offset plus LZX_OFFSET_ADJUSTMENT or a
+        * recent offset code in bits 9-30.  Otherwise (if bit 31 is set), this
+        * sequence's literal run was the last literal run in the block, so
+        * there is no match that follows it.  */
        u32 adjusted_offset_and_match_hdr;
 };
 
@@ -585,13 +586,13 @@ lzx_flush_bits(struct lzx_output_bitstream *os, unsigned max_num_bits)
 
        if (os->end - os->next < 6)
                return;
-       put_unaligned_u16_le(os->bitbuf >> ((os->bitcount - 16) &
+       put_unaligned_le16(os->bitbuf >> ((os->bitcount - 16) &
                                            shift_mask), os->next + 0);
        if (max_num_bits > 16)
-               put_unaligned_u16_le(os->bitbuf >> ((os->bitcount - 32) &
+               put_unaligned_le16(os->bitbuf >> ((os->bitcount - 32) &
                                                shift_mask), os->next + 2);
        if (max_num_bits > 32)
-               put_unaligned_u16_le(os->bitbuf >> ((os->bitcount - 48) &
+               put_unaligned_le16(os->bitbuf >> ((os->bitcount - 48) &
                                                shift_mask), os->next + 4);
        os->next += (os->bitcount >> 4) << 1;
        os->bitcount &= 15;
@@ -616,7 +617,7 @@ lzx_flush_output(struct lzx_output_bitstream *os)
                return 0;
 
        if (os->bitcount != 0) {
-               put_unaligned_u16_le(os->bitbuf << (16 - os->bitcount), os->next);
+               put_unaligned_le16(os->bitbuf << (16 - os->bitcount), os->next);
                os->next += 2;
        }
 
@@ -1882,7 +1883,6 @@ lzx_compress_near_optimal(struct lzx_compressor *c,
                                                   bt_matchfinder_skip_position,
                                                   in_begin,
                                                   in_next - in_begin,
-                                                  max_len,
                                                   nice_len,
                                                   c->max_search_depth,
                                                   next_hashes);