mirror of
https://github.com/google/brotli.git
synced 2026-09-22 06:35:52 +00:00
compressBound() functionality #107
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @richgel999 on GitHub (May 19, 2016).
Hi,
I'm using brotli::BrotliCompressBuffer() in my benchmark, but I need a way to compute the max size of the buffer to allocate to hold the encoded data. zlib has a function like this:
compressBound()
For now, I tried just allocating 10% more bytes than the source file's size, but I encountered 65 exceptions (out of 30,000+ files) so I guess I'll need to bump this up more.
@nemequ commented on GitHub (May 25, 2016):
Dup of #274
Until that is fixed, I think the function in Squash is safe:
26aa037b61/plugins/brotli/squash-brotli.cpp (L265)@nemequ commented on GitHub (Jun 16, 2016):
0.5 provides
BrotliEncoderMaxCompressedSize, I think this can be closed.