Skip to content
Commit 5cb718c7 authored by Adenilson Cavalcanti's avatar Adenilson Cavalcanti Committed by Commit Bot
Browse files

Increasing the expected compressed output size

Usage of CRC32 Castagnoli as a hash function for the hash table of symbols
used for compression has a side effect where for compression level [4, 5]
it will increase the required output buffer size by 0.1% (i.e. less than 1%)
for a high entropy input (i.e. random data).

To avoid a scenario where client code would fail while compressing data,
this patch will increase the compressBound by 0.8% (i.e. 8x than worst
case scenario).

Validated using zlib_bench with the data from the 'Random Compression
Challenge' on both Intel and Arm.

Bug: 990489
Change-Id: I86c6ab09fce6ab09b45c502221864400b86a7d80
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1733790


Commit-Queue: Adenilson Cavalcanti <cavalcantii@chromium.org>
Reviewed-by: default avatarChris Blume <cblume@chromium.org>
Reviewed-by: default avatarAdenilson Cavalcanti <cavalcantii@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#684170}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 6c37c10f93e9d3ac37fd3018f15ec51340d58369
parent 2b4888a4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment