diff options
| author | Klaus Post <klauspost@gmail.com> | 2016-10-15 13:06:22 +0200 |
|---|---|---|
| committer | Nigel Tao <nigeltao@golang.org> | 2016-10-17 09:00:41 +0000 |
| commit | c1cd64d0ac2001ec8fe6f253e4e95561a444d533 (patch) | |
| tree | dedd54721332e898c01f776f92830eb720bd23f1 /src | |
| parent | 05471e9ee64a300bd2dcc4582ee1043c055893bb (diff) | |
| download | go-c1cd64d0ac2001ec8fe6f253e4e95561a444d533.tar.xz | |
compress/flate: use correct table for size estimation
The incorrect table was used for estimating output size.
This can give suboptimal selection of entropy encoder in rare cases.
Change-Id: I8b358200f2d1f9a3f9b79a44269d7be704e1d2d9
Reviewed-on: https://go-review.googlesource.com/31172
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/compress/flate/huffman_bit_writer.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compress/flate/huffman_bit_writer.go b/src/compress/flate/huffman_bit_writer.go index d8b5a3ebd7..6cd6281249 100644 --- a/src/compress/flate/huffman_bit_writer.go +++ b/src/compress/flate/huffman_bit_writer.go @@ -520,7 +520,7 @@ func (w *huffmanBitWriter) writeBlockDynamic(tokens []token, eof bool, input []b // the literalEncoding and the offsetEncoding. w.generateCodegen(numLiterals, numOffsets, w.literalEncoding, w.offsetEncoding) w.codegenEncoding.generate(w.codegenFreq[:], 7) - size, numCodegens := w.dynamicSize(w.literalEncoding, huffOffset, 0) + size, numCodegens := w.dynamicSize(w.literalEncoding, w.offsetEncoding, 0) // Store bytes, if we don't get a reasonable improvement. if ssize, storable := w.storedSize(input); storable && ssize < (size+size>>4) { |
