Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to get the max compressed size #5

Open
nemequ opened this issue Nov 29, 2015 · 1 comment
Open

Add a way to get the max compressed size #5

nemequ opened this issue Nov 29, 2015 · 1 comment

Comments

@nemequ
Copy link

nemequ commented Nov 29, 2015

For lzham_compress_memory, it would be helpful to have a function or macro to get the worst-case output buffer size given a specified input buffer size (basically, lzham's version of zlib's compressBound).

Based on some tests it seems like something around 5 bytes, plus 5 bytes per half-megabyte or fraction thereof… I'm currently using this code, but I can't promise it's right (it was determined empirically based on randomly sized blobs of random data up to 8 MiB).

@richgel999
Copy link
Owner

Great point, I'm on it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants