mirror of
https://github.com/google/brotli.git
synced 2026-09-22 06:35:52 +00:00
Better localization of npostfix and ndirect bounds #392
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 @andrew-aladev on GitHub (Sep 10, 2021).
We can see the following line in docs:
Range is from 0 to (15 << NPOSTFIX) in steps of (1 << NPOSTFIX).Placing such constants in docs/comments is not very good solution, because every brotli bindings implementation will store such constants locally. Brotli authors may update such constants - all bindings will be broken immediately. I think it will be better to store such constants in brotli library itself. I am proposing the following constants:
@andrew-aladev commented on GitHub (Sep 10, 2021):
Also there is an issue:
BROTLI_MAX_NPOSTFIXandBROTLI_MAX_NDIRECTare defined inc/common/constants.honly and these constants are not a part of public header.@andrew-aladev commented on GitHub (Sep 12, 2021):
PS See also ruby-brs commit
@eustas commented on GitHub (Dec 15, 2021):
c/common/constants.his mostly a reflection of specification, so that is why it is not a part of public API.The constants you have mentioned, are impliccitly in spec, so we are fine adding them. (As a consequence, this is not something that could be easily changed, because it will become inconsistent with spec).
To make sure encoder does not do "impossible" things, encoder params go through "sanation", and incorrect combinations are ignored. (See
e83c7b8e8f/c/enc/encode.c (L672))