Skip to content

Commit

Permalink
Run optimisations on merged blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
NeRdTheNed committed Nov 12, 2023
1 parent a25bcd5 commit 65be1b8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ public long mergeBlocks() {
pos += 3;

if ((nextBlock != null) && currentBlock.canMerge(nextBlock)) {
final DeflateBlock merged = currentBlock.merge(nextBlock);
final DeflateBlock merged = optimiseBlock(currentBlock.merge(nextBlock), pos);
final long currentSizeNoMerge = currentBlock.getSizeBits(pos);
final long nextSizeNoMerge = nextBlock.getSizeBits(pos + currentSizeNoMerge + 3);
final long currentSaved = (currentSizeNoMerge + 3 + nextSizeNoMerge) - merged.getSizeBits(pos);
Expand Down
Binary file modified test/asyoulik/asyoulik-gzip-opt.txt.gz
Binary file not shown.
6 changes: 3 additions & 3 deletions test/asyoulik/asyoulik-gzip-opt.txt.gz.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
File type recognised as GZip
165 bits saved in stream 0 (unnamed stream)
Total bits saved 165
Saved 165 bits with optimisation
167 bits saved in stream 0 (unnamed stream)
Total bits saved 167
Saved 167 bits with optimisation

0 comments on commit 65be1b8

Please sign in to comment.