ebiggers / wimlib

Mirror of https://wimlib.net/git/wimlib: Library supporting the Windows Imaging Format (WIM). Please file issues on the official forums (https://wimlib.net/forums/viewforum.php?f=1) rather than here.
Other
104 stars 21 forks source link

suggestion #2

Open da0ka opened 1 year ago

da0ka commented 1 year ago

I have suggestion for lzx_compress.c. line 2133 should be in line 2128. line 2140 should be removed.

wdlkmpx commented 1 year ago
--- a/lzx_compress.c    2023-05-06 19:40:22.436861000 -0500
+++ b/lzx_compress.c    2023-05-06 19:42:47.030238982 -0500
@@ -2125,19 +2125,17 @@
        lzx_compute_match_costs(c);
        new_queue = lzx_find_min_cost_path(c, block_begin, block_size,
                           initial_queue, is_16_bit);
-
+       lzx_reset_symbol_frequencies(c);
        if (--num_passes_remaining == 0)
            break;

        /* At least one optimization pass remains.  Update the costs. */
-       lzx_reset_symbol_frequencies(c);
        lzx_tally_item_list(c, block_size, is_16_bit);
        lzx_build_huffman_codes(c);
        lzx_set_costs_from_codes(c);
    }

    /* Done optimizing.  Generate the sequence list and flush the block. */
-   lzx_reset_symbol_frequencies(c);
    seq_idx = lzx_record_item_list(c, block_size, is_16_bit);
    lzx_flush_block(c, os, block_begin, block_size, seq_idx);
    return new_queue;