Updates to Brotli compression format, decoder and encoder

This commit contains a batch of changes that were made to the Brotli
compression algorithm in the last three weeks. Most important changes:

  * Added UTF8 context model for good text compression.
  * Simplified context modeling by having only 4 context modes.
  * Per-block context mode selection.
  * Faster backward copying and bit reading functions.
  * More efficient histogram coding.
  * Streaming support for the decoder and encoder.
This commit is contained in:
Zoltan Szabadka
2013-11-15 19:02:17 +01:00
parent 79e99afe46
commit 1571db36a9
23 changed files with 1647 additions and 870 deletions
+3 -3
View File
@@ -66,8 +66,8 @@ struct EntropyCode {
uint16_t bits_[kSize];
// How many non-zero depth.
int count_;
// First two symbols with non-zero depth.
int symbols_[2];
// First four symbols with non-zero depth.
int symbols_[4];
};
template<int kSize>
@@ -82,7 +82,7 @@ void BuildEntropyCode(const Histogram<kSize>& histogram,
if (histogram.total_count_ == 0) return;
for (int i = 0; i < kSize; ++i) {
if (histogram.data_[i] > 0) {
if (code->count_ < 2) code->symbols_[code->count_] = i;
if (code->count_ < 4) code->symbols_[code->count_] = i;
++code->count_;
}
}