Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

suggestion #2

Open
da0ka opened this issue May 6, 2023 · 1 comment
Open

suggestion #2

da0ka opened this issue May 6, 2023 · 1 comment

Comments

@da0ka
Copy link

da0ka commented May 6, 2023

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

@wdlkmpx
Copy link

wdlkmpx commented May 7, 2023

--- 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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants