mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 08:52:18 +01:00
std/brotli: use metablock_builder's distance and RLE helpers in the encoder
This removes the encoder's copies of PrefixEncodeCopyDistance, CommandRestoreDistanceCode, BrotliInitDistanceParams and BrotliOptimizeHuffmanCountsForRle. The shared BrotliInitDistanceParams also handles large-window distance params (used at quality 2).
This commit is contained in:
5 files changed
+179
-674
No files matched your search
@@ -200,6 +200,10 @@ pub struct encoder? implements base.io_transformer(
|
||||
) + (
|
||||
bc : bit_cost,
|
||||
|
||||
// mb provides some metablock.c, command.h and prefix.h functions
|
||||
// (see encode_metablock.wuffs).
|
||||
mb : metablock_builder,
|
||||
|
||||
// tiny_buf is the C code's tiny_buf_ (plus slack for the 8-byte
|
||||
// stores of write_bits).
|
||||
tiny_buf : array[32] base.u8,
|
||||
@@ -269,9 +273,6 @@ pub struct encoder? implements base.io_transformer(
|
||||
gbs_entropy_tmp : array[16] base.u64,
|
||||
gbs_comb_entropy : array[32] base.u64,
|
||||
|
||||
// BrotliOptimizeHistograms' good_for_rle.
|
||||
good_for_rle : array[1024] base.u8,
|
||||
|
||||
// The BrotliStoreMetaBlock block encoders' state (the C code's
|
||||
// BlockEncoder and BlockSplitCode), indexed by block category (with
|
||||
// index 3 for a local BlockTypeCodeCalculator).
|
||||
|
||||
Reference in new issue
Block a user