static kBitCostThreshold affects compression ratio #54

Open
opened 2026-01-29 20:30:18 +00:00 by claunia · 0 comments
Owner

Originally created by @tesseract2048 on GitHub (Oct 11, 2015).

encode.cc:392

      static const int kSampleRate = 13;
      static const double kMinEntropy = 7.92;
      static const double kBitCostThreshold = bytes * kMinEntropy / kSampleRate;

kBitCostThreshold is cached once initialized.
However, if brotli library is reused within the same process, first compress a small piece of data, then a large one will suffer from poor compression ratio, since some block will be misleadingly uncompressed.

Originally created by @tesseract2048 on GitHub (Oct 11, 2015). `encode.cc`:392 ``` static const int kSampleRate = 13; static const double kMinEntropy = 7.92; static const double kBitCostThreshold = bytes * kMinEntropy / kSampleRate; ``` kBitCostThreshold is cached once initialized. However, if brotli library is reused within the same process, first compress a small piece of data, then a large one will suffer from poor compression ratio, since some block will be misleadingly uncompressed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#54