mirror of
https://github.com/google/brotli.git
synced 2026-02-04 05:35:09 +00:00
[PR #105] [MERGED] [python] expose new encoder parameters as kwargs of brotli.compress #709
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?
📋 Pull Request Information
Original PR: https://github.com/google/brotli/pull/105
Author: @anthrotype
Created: 5/8/2015
Status: ✅ Merged
Merged: 5/11/2015
Merged by: @szabadka
Base:
master← Head:newparams📝 Commits (10+)
89c74d6[brotlimodule] use keyword arguments for mode and enable_transforms;b2eba12[brotlimodule] add enable_dictionary parameter (defautls to True)6264bea[brotlimodule] add greedy_block_split parameter (defaults to False);4c1d069[brotlimodule] add new keyword params docstring of brotli.compressdbcb326[brotlimodule] add enable_context_modeling parameter (defaults to True)6d935db[brotlimodule] add quality, lgwin and lgblock parameters3351bb0[brotlimodule] apply uniform docstring style32c44ec[bro.py] use argparse instead of getopt4106a40[bro.py] use new optional encoder parameters when compressing;b7e8291[bro.py] remove debug print📊 Changes
2 files changed (+182 additions, -85 deletions)
View changed files
📝
python/bro.py(+53 -68)📝
python/brotlimodule.cc(+129 -17)📄 Description
I added support for the new BrotliParams to the Python extension, as requested in https://github.com/google/brotli/issues/72.
I also modified the bro.py script so that we can control these parameters from the command line.
I have a question. In the encode.h, it's written that the parameter "quality" has to be in the range from 0 to 11. I presume this range is inclusive. Now, if I set the quality between 1 and 11, the output changes accordingly. However, if I set it to 0, the output is always truncated to the same 10 bytes. Does this mean that 0 is an invalid value for the 'quality' parameter?
Thanks.
C.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.